修改DictSelect组件bug

Signed-off-by: huorexiaji <houkunxiao@qq.com>
This commit is contained in:
huorexiaji 2023-03-25 07:36:01 +00:00 committed by Gitee
parent f2d098d5d1
commit b75cc66222
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -58,8 +58,10 @@
// -------------------------- --------------------------
let valueIsArray = ref(false);
const dictValueList = ref([]);
async function queryDict() {
valueIsArray = Array.isArray(props.value)
let res = await dictApi.valueList(props.keyCode);
dictValueList.value = res.data;
}
@ -102,7 +104,7 @@
emit('change', selected);
return selected;
}
if (Array.isArray(props.value)) {
if (valueIsArray) {
let valueList = dictValueList.value.filter((e) => value.includes(e.valueCode));
valueList = valueList.map((e) => e.valueCode);
emit('update:value', valueList);