feat:添加 scope 点击事件

This commit is contained in:
zhangyu
2022-01-14 11:04:01 +08:00
parent 95c3995c70
commit 3622b68c60
3 changed files with 32 additions and 34 deletions

View File

@@ -2493,14 +2493,6 @@
}
}
},
"clone-regexp": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-2.2.0.tgz",
"integrity": "sha512-beMpP7BOtTipFuW8hrJvREQ2DrRu3BE7by0ZpibtfBA+qfHYvMGTc2Yb1JMYPKg/JUw0CHYvpg796aNTSW9z7Q==",
"requires": {
"is-regexp": "^2.0.0"
}
},
"clone-response": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
@@ -4505,11 +4497,6 @@
"integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==",
"dev": true
},
"diacritics": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/diacritics/-/diacritics-1.3.0.tgz",
"integrity": "sha1-PvqHMj67hj5mls67AILUj/PW96E="
},
"diffie-hellman": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
@@ -7438,11 +7425,6 @@
"has": "^1.0.1"
}
},
"is-regexp": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-2.1.0.tgz",
"integrity": "sha512-OZ4IlER3zmRIoB9AqNhEggVxqIH4ofDns5nRrPS6yQxXE1TPCUpFznBfRQmQa8uC+pXqjMnukiJBxCisIxiLGA=="
},
"is-resolvable": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
@@ -13906,6 +13888,11 @@
"repeat-string": "^1.6.1"
}
},
"to-style": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/to-style/-/to-style-1.3.3.tgz",
"integrity": "sha1-Y6K3Cm9KfU/cLtV6C+TnI1y2aZw="
},
"toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
@@ -14554,6 +14541,15 @@
"element-resize-detector": "^1.2.1"
}
},
"vue-highlight-text": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/vue-highlight-text/-/vue-highlight-text-1.6.2.tgz",
"integrity": "sha512-0mSzB/MyrHJm09boCev7yA9mEk3ROig9K5guLlpT+GePz/FH3ikMnY+8aXaAJA1mIHRjQv/gCCCCtohLC2Qq1g==",
"requires": {
"to-style": "^1.3.3",
"vue": "^2.5.11"
}
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
@@ -14678,15 +14674,6 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"vue-text-highlight": {
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/vue-text-highlight/-/vue-text-highlight-2.0.10.tgz",
"integrity": "sha512-6WMWqr3OYonmK257o87shm7efMaFTyevEo8u5fN15gceyy2463fITFj9Wuh+W5lqLUm4n6cAZUS+y6xfzYB2aA==",
"requires": {
"clone-regexp": "^2.1.0",
"diacritics": "^1.3.0"
}
},
"vuedraggable": {
"version": "2.23.2",
"resolved": "https://registry.npm.taobao.org/vuedraggable/download/vuedraggable-2.23.2.tgz",

View File

@@ -41,11 +41,11 @@
"vue-countupjs": "^1.0.0",
"vue-draggable-resizable": "^2.3.0",
"vue-grid-layout": "^2.3.12",
"vue-highlight-text": "^1.6.2",
"vue-i18n": "^8.15.1",
"vue-quill-editor": "^3.0.6",
"vue-resource": "^1.5.1",
"vue-router": "^3.0.1",
"vue-text-highlight": "^2.0.10",
"vuedraggable": "^2.23.2",
"vuex": "^3.1.2",
"xlsx": "^0.15.6",
@@ -69,6 +69,7 @@
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-vue": "^7.7.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",

View File

@@ -28,7 +28,7 @@
>
<div class="list-item-content">
<i class="nz-icon" :class="selectIcon(item)" />
<TextHighlight :queries="searchStr" :highlightClass='"list-item-highlight"' :overWriteStyle="{color: '#FA901C'}" style="vertical-align: middle" :title="item.name">{{item.name}}</TextHighlight>
<HighlightText :keyword="searchStr" :overWriteStyle="{color: '#FA901C'}" style="vertical-align: middle" :title="item.name">{{item.name}}</HighlightText>
</div>
<div class="list-item-sub" v-if="item.sub">
{{ item.sub }}
@@ -81,13 +81,12 @@
</template>
<script>
// import HighlightText from 'vue-highlight-text'
import TextHighlight from 'vue-text-highlight';
import HighlightText from 'vue-highlight-text'
export default {
name: 'globalSearch',
components: {
TextHighlight
HighlightText
},
computed: {
globalShow () {
@@ -139,6 +138,7 @@ export default {
],
timer: null,
searchTimer: null,
scopeChangeTimer: null,
isKeyDown: false,
stat: {
@@ -268,9 +268,19 @@ export default {
this.nextLoading = true
this.getData()
},
scopeChange () {
this.pageObj.pageNo = 1
scopeChange (item) {
if (this.scopeChangeTimer) {
clearInterval(this.scopeChangeTimer)
this.scopeChangeTimer = null
}
this.loading = true
item.isSelect = !item.isSelect
this.scopeChangeTimer = setTimeout(() => {
this.pageObj.pageNo = 1
this.tableData = []
this.selectIndex = 0
this.getData()
}, 100)
},
getData () {
const param = {