|
|
@@ -121,6 +121,10 @@ export default { |
|
|
|
type: Boolean, |
|
|
|
default: false, |
|
|
|
}, |
|
|
|
// extraParams: { |
|
|
|
// type: Object, |
|
|
|
// default: () => ({}) |
|
|
|
// } |
|
|
|
}, |
|
|
|
inject: ["urls"], |
|
|
|
data() { |
|
|
@@ -248,7 +252,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
/** init **/ |
|
|
|
init(id, detailMode, extraParams) { |
|
|
|
init(id, detailMode, tagInfo, extraParams) { |
|
|
|
// console.log("[DialogJustForm] init", this.dataForm, id, detailMode); |
|
|
|
if (this.$refs.dataForm) { |
|
|
|
// console.log("[DialogJustForm] clearing form validation..."); |
|
|
@@ -258,6 +262,14 @@ export default { |
|
|
|
|
|
|
|
this.detailMode = detailMode ?? false; |
|
|
|
|
|
|
|
/** 判断 extraParams */ |
|
|
|
if (extraParams && typeof extraParams === "object") { |
|
|
|
for (const [key, value] of Object.entries(extraParams)) { |
|
|
|
// console.log("[dialog] dataForm | key | value", this.dataForm, key, value); |
|
|
|
this.$set(this.dataForm, key, value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.dataForm.id = id || null; |
|
|
|
if (this.dataForm.id) { |
|
|
@@ -298,15 +310,6 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
// 如果不是编辑,看看是否有其他 extraParams |
|
|
|
|
|
|
|
if (extraParams && typeof extraParams === "object") { |
|
|
|
for (const [key, value] of Object.entries(extraParams)) { |
|
|
|
this.$set(this.dataForm, key, value); |
|
|
|
console.log('[DialogJustForm] setting: ', key, value) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.loadingStatus = false; |
|
|
|
} |
|
|
|
}); |
|
|
|