fixed
							parent
							
								
									d717fd0804
								
							
						
					
					
						commit
						98bd1fd292
					
				| 
						 | 
				
			
			@ -30,7 +30,7 @@
 | 
			
		|||
 | 
			
		||||
    <div class="wrapper flex column">
 | 
			
		||||
      <header class="table-info flex alc">
 | 
			
		||||
        现在单字{{single}}个, 词组{{words}}个!
 | 
			
		||||
        现有单字{{single}}个, 词组{{words}}个!
 | 
			
		||||
      </header>
 | 
			
		||||
 | 
			
		||||
      <div class="search">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								js/index.js
								
								
								
								
							
							
						
						
									
										15
									
								
								js/index.js
								
								
								
								
							| 
						 | 
				
			
			@ -34,7 +34,8 @@ Anot({
 | 
			
		|||
    fetch('./data/table.txt')
 | 
			
		||||
      .then(r => r.text())
 | 
			
		||||
      .then(r => {
 | 
			
		||||
        // console.log(r)
 | 
			
		||||
        //
 | 
			
		||||
 | 
			
		||||
        r.split('\n').forEach(it => {
 | 
			
		||||
          it = it
 | 
			
		||||
            .trim()
 | 
			
		||||
| 
						 | 
				
			
			@ -48,10 +49,6 @@ Anot({
 | 
			
		|||
          }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        window.foo = WB_TABLE
 | 
			
		||||
 | 
			
		||||
        console.log(WB_TABLE)
 | 
			
		||||
 | 
			
		||||
        this.single = WB_TABLE.length
 | 
			
		||||
      })
 | 
			
		||||
  },
 | 
			
		||||
| 
						 | 
				
			
			@ -70,10 +67,10 @@ Anot({
 | 
			
		|||
        params.txt = params.txt.replace(/[\sa-z]/g, '')
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (params.txt.length > 1) {
 | 
			
		||||
        res = params.txt.split('').map(t => WB_TABLE.get(t))
 | 
			
		||||
      } else {
 | 
			
		||||
      if (reverse || params.txt.length === 1) {
 | 
			
		||||
        res = [WB_TABLE.get(params.txt)]
 | 
			
		||||
      } else {
 | 
			
		||||
        res = params.txt.split('').map(t => WB_TABLE.get(t))
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (reverse) {
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +97,7 @@ Anot({
 | 
			
		|||
          .join('\n')
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.result = `查询结果: \n${res}`
 | 
			
		||||
      this.result = `查询耗时: ${t1}ms\n查询结果: \n${res}`
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,6 +48,7 @@ export class Enum {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  get(k) {
 | 
			
		||||
    console.log('>>>>', k)
 | 
			
		||||
    if (this.#dict_k[k]) {
 | 
			
		||||
      return this.#dict_k[k]
 | 
			
		||||
    } else if (this.#dict_v[k]) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue