mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-19 11:56:39 +08:00
Pre Merge pull request !17 from huorexiaji/master
This commit is contained in:
commit
7b4cc8815b
@ -58,8 +58,10 @@
|
|||||||
|
|
||||||
// -------------------------- 查询 字典数据 --------------------------
|
// -------------------------- 查询 字典数据 --------------------------
|
||||||
|
|
||||||
|
let valueIsArray = ref(false);
|
||||||
const dictValueList = ref([]);
|
const dictValueList = ref([]);
|
||||||
async function queryDict() {
|
async function queryDict() {
|
||||||
|
valueIsArray = Array.isArray(props.value)
|
||||||
let res = await dictApi.valueList(props.keyCode);
|
let res = await dictApi.valueList(props.keyCode);
|
||||||
dictValueList.value = res.data;
|
dictValueList.value = res.data;
|
||||||
}
|
}
|
||||||
@ -102,7 +104,7 @@
|
|||||||
emit('change', selected);
|
emit('change', selected);
|
||||||
return selected;
|
return selected;
|
||||||
}
|
}
|
||||||
if (Array.isArray(props.value)) {
|
if (valueIsArray) {
|
||||||
let valueList = dictValueList.value.filter((e) => value.includes(e.valueCode));
|
let valueList = dictValueList.value.filter((e) => value.includes(e.valueCode));
|
||||||
valueList = valueList.map((e) => e.valueCode);
|
valueList = valueList.map((e) => e.valueCode);
|
||||||
emit('update:value', valueList);
|
emit('update:value', valueList);
|
||||||
|
Loading…
Reference in New Issue
Block a user