done 基本完成工艺管理

This commit is contained in:
lb
2023-02-24 14:47:51 +08:00
parent b0286bcc08
commit b573e2dc2f
4 changed files with 7 additions and 9 deletions

View File

@@ -424,20 +424,18 @@ export default {
updateOptions() {
return new Promise((resolve, reject) => {
if (!this.dataForm?.id) resolve(null);
if (this.watingToRefreshQueue.length) {
this.watingToRefreshQueue.forEach((opt) => {
console.log("[刷新数据, ", opt, "]");
if ("fetchData" in opt) {
opt.fetchData(this.dataForm.id).then(({ data: res }) => {
opt.fetchData(this.dataForm.id ? this.dataForm.id : -1).then(({ data: res }) => {
if (res.code === 0) {
this.$set(
opt,
"options",
"list" in res.data
? res.data.list.map((i) => ({ label: i.name, value: i.id }))
: res.data.map((i) => ({ label: i.name, value: i.id }))
? res.data.list.map((i) => ({ label: i.code, value: i.id }))
: res.data.map((i) => ({ label: i.code, value: i.id }))
);
resolve({ done: true });
@@ -504,7 +502,7 @@ export default {
});
} else {
// 如果不是编辑
// this.dialogVisible = true;
this.updateOptions()
}
});
},