diff --git a/src/components/scIconSelect/index.vue b/src/components/scIconSelect/index.vue
index d1988478..ab562222 100644
--- a/src/components/scIconSelect/index.vue
+++ b/src/components/scIconSelect/index.vue
@@ -1,35 +1,47 @@
-
-
-
-
-
-
-
- {{item.name}} {{item.icons.length}}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}} {{item.icons.length}}
+
+
+
+
+
+
+ 清除
+ 取消
+
@@ -40,27 +52,28 @@
export default {
props: {
modelValue: { type: String, default: "" },
- placeholder: { type: String, default: "请输入或者选择图标" },
- clearable: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
},
data() {
return {
- defaultValue: '',
+ value: "",
dialogVisible: false,
- data: []
+ data: [],
+ searchText: ""
}
},
watch:{
modelValue(val){
- this.defaultValue = val
+ this.value = val
},
- defaultValue(val){
+ value(val){
this.$emit('update:modelValue', val)
+ },
+ searchText(val){
+ this.search(val)
}
},
mounted() {
- this.defaultValue = this.modelValue
this.data.push(...config.icons)
},
methods: {
@@ -74,25 +87,41 @@
if(e.target.tagName != 'SPAN'){
return false
}
- this.defaultValue = e.target.dataset.icon
+ this.value = e.target.dataset.icon
this.dialogVisible = false
- this.$emit('update:modelValue', this.defaultValue);
+ },
+ clear(){
+ this.value = ""
+ this.dialogVisible = false
+ },
+ search(text){
+ if(text){
+ const filterData = JSON.parse(JSON.stringify(config.icons))
+ filterData.forEach(t => {
+ t.icons = t.icons.filter(n => n.includes(text))
+ })
+ this.data = filterData
+ }else{
+ this.data = JSON.parse(JSON.stringify(config.icons))
+ }
}
}
}
diff --git a/src/views/vab/iconselect.vue b/src/views/vab/iconselect.vue
index 6931639f..0774d5d9 100644
--- a/src/views/vab/iconselect.vue
+++ b/src/views/vab/iconselect.vue
@@ -13,7 +13,7 @@
-
+
保存