fix: 更换字体高亮插件

This commit is contained in:
zhangyu
2022-01-14 10:50:28 +08:00
parent 4e1e520d87
commit 95c3995c70
4 changed files with 43 additions and 20 deletions

View File

@@ -2493,6 +2493,14 @@
} }
} }
}, },
"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": { "clone-response": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
@@ -4497,6 +4505,11 @@
"integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==",
"dev": true "dev": true
}, },
"diacritics": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/diacritics/-/diacritics-1.3.0.tgz",
"integrity": "sha1-PvqHMj67hj5mls67AILUj/PW96E="
},
"diffie-hellman": { "diffie-hellman": {
"version": "5.0.3", "version": "5.0.3",
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
@@ -7425,6 +7438,11 @@
"has": "^1.0.1" "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": { "is-resolvable": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
@@ -13888,11 +13906,6 @@
"repeat-string": "^1.6.1" "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": { "toidentifier": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
@@ -14541,15 +14554,6 @@
"element-resize-detector": "^1.2.1" "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": { "vue-hot-reload-api": {
"version": "2.3.4", "version": "2.3.4",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz", "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
@@ -14674,6 +14678,15 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true "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": { "vuedraggable": {
"version": "2.23.2", "version": "2.23.2",
"resolved": "https://registry.npm.taobao.org/vuedraggable/download/vuedraggable-2.23.2.tgz", "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-countupjs": "^1.0.0",
"vue-draggable-resizable": "^2.3.0", "vue-draggable-resizable": "^2.3.0",
"vue-grid-layout": "^2.3.12", "vue-grid-layout": "^2.3.12",
"vue-highlight-text": "^1.6.2",
"vue-i18n": "^8.15.1", "vue-i18n": "^8.15.1",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-resource": "^1.5.1", "vue-resource": "^1.5.1",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vue-text-highlight": "^2.0.10",
"vuedraggable": "^2.23.2", "vuedraggable": "^2.23.2",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"xlsx": "^0.15.6", "xlsx": "^0.15.6",

View File

@@ -107,9 +107,13 @@
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
.list-item-highlight{
background: none;
color: $--color-primary;
}
} }
.list-item-sub{ .list-item-sub{
ont-size: 14px; font-size: 14px;
color: $--color-info; color: $--color-info;
font-weight: 400; font-weight: 400;
margin-top: 2px; margin-top: 2px;
@@ -158,6 +162,7 @@
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
.scope-box { .scope-box {
cursor: pointer;
color: $--background-color-disabled; color: $--background-color-disabled;
.nz-icon { .nz-icon {
margin-right: 5px; margin-right: 5px;

View File

@@ -28,7 +28,7 @@
> >
<div class="list-item-content"> <div class="list-item-content">
<i class="nz-icon" :class="selectIcon(item)" /> <i class="nz-icon" :class="selectIcon(item)" />
<HighlightText :keyword="searchStr" :overWriteStyle="{color: '#FA901C'}" style="vertical-align: middle" :title="item.name">{{item.name}}</HighlightText> <TextHighlight :queries="searchStr" :highlightClass='"list-item-highlight"' :overWriteStyle="{color: '#FA901C'}" style="vertical-align: middle" :title="item.name">{{item.name}}</TextHighlight>
</div> </div>
<div class="list-item-sub" v-if="item.sub"> <div class="list-item-sub" v-if="item.sub">
{{ item.sub }} {{ item.sub }}
@@ -69,7 +69,7 @@
{{$t('globalSearch.toEsc')}} {{$t('globalSearch.toEsc')}}
</div> </div>
<div class="global-search-footer-right"> <div class="global-search-footer-right">
<div class="scope-box" v-for="item in scope" :class="item.isSelect ? 'is-select' : ''" :key="item.type"> <div class="scope-box" v-for="item in scope" :class="item.isSelect ? 'is-select' : ''" :key="item.type" @click="scopeChange(item)">
<i class="nz-icon" :class="selectIcon(item)" /> <i class="nz-icon" :class="selectIcon(item)" />
{{stat[item.type] || 0}} {{stat[item.type] || 0}}
</div> </div>
@@ -81,12 +81,13 @@
</template> </template>
<script> <script>
import HighlightText from 'vue-highlight-text' // import HighlightText from 'vue-highlight-text'
import TextHighlight from 'vue-text-highlight';
export default { export default {
name: 'globalSearch', name: 'globalSearch',
components: { components: {
HighlightText TextHighlight
}, },
computed: { computed: {
globalShow () { globalShow () {
@@ -267,6 +268,10 @@ export default {
this.nextLoading = true this.nextLoading = true
this.getData() this.getData()
}, },
scopeChange () {
this.pageObj.pageNo = 1
this.loading = true
},
getData () { getData () {
const param = { const param = {
pageNo: this.pageObj.pageNo, pageNo: this.pageObj.pageNo,