【update】国际研讨会-WASIC需求变更2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a-checkbox-group v-if="tagType=='checkbox'" @change="onChange" :value="arrayValue" :disabled="disabled">
|
||||
<a-checkbox v-for="item in dictOptions" :key="'a_checkbox_'+ item.value" :value="item.value">{{ item.text || item.label }}</a-checkbox>
|
||||
<a-checkbox v-for="item in dictOptions" :key="'a_checkbox_'+ item.value" :value="item.value" :disabled="item.disabled">{{ item.text || item.label }}</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
|
||||
<a-select
|
||||
@@ -47,6 +47,12 @@
|
||||
default:'',
|
||||
required:false
|
||||
},
|
||||
// 是否按照下拉框的顺序过滤
|
||||
sortable:{
|
||||
type:Boolean,
|
||||
default:true,
|
||||
required:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -103,7 +109,19 @@
|
||||
|
||||
},
|
||||
onChange (selectedValue) {
|
||||
this.$emit('change', selectedValue.join(this.spliter))
|
||||
let arr = [...selectedValue]
|
||||
if(this.sortable) {
|
||||
arr.sort((a, b) => {
|
||||
let firstIndex = this.dictOptions.findIndex(ele => ele.value === a)
|
||||
let secondIndex = this.dictOptions.findIndex(ele => ele.value === b)
|
||||
if(firstIndex > secondIndex) {
|
||||
return 1
|
||||
} else {
|
||||
return -1
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$emit('change', arr.join(this.spliter))
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
this.dictOptions = dictOptions
|
||||
|
||||
Reference in New Issue
Block a user