add 上料信息“
This commit is contained in:
@@ -86,14 +86,20 @@ export default {
|
||||
field.fn().then(({ data: res }) => {
|
||||
if (res.code === 0 && res.data) {
|
||||
// TODO: 此处需要随具体情况再做更新
|
||||
field.select = res.map((_) => {
|
||||
// 找到默认项
|
||||
if (_.default) {
|
||||
this.searchForm[index] = _.value;
|
||||
}
|
||||
return _;
|
||||
});
|
||||
console.log("[update] 更新选项列表", res, field.select);
|
||||
if ("list" in res.data) {
|
||||
this.$set(
|
||||
field,
|
||||
"select",
|
||||
res.data.list.map((item) => ({ label: item.name, value: item.id }))
|
||||
);
|
||||
console.log("[update] 更新选项列表", res, field.select);
|
||||
}
|
||||
} else {
|
||||
this.$message({
|
||||
message: `${field.label} 数据获取出错: ${res.code} - ${res.msg}`,
|
||||
type: 'error',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user