修改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

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);