jobsys-explore 4.7.12 → 4.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -96,6 +96,11 @@ export default defineComponent({
|
|
|
96
96
|
*/
|
|
97
97
|
submitDisabled: { type: Boolean, default: false },
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* 表单项改变后,用哪种方式回填数据,默认是"auto"不变,可以设置为"auto"、"init"和Function回调
|
|
101
|
+
*/
|
|
102
|
+
fillMode: { type: [String, Function], default: "auto" },
|
|
103
|
+
|
|
99
104
|
/**
|
|
100
105
|
* 是否显示关闭按钮
|
|
101
106
|
*/
|
|
@@ -238,7 +243,7 @@ export default defineComponent({
|
|
|
238
243
|
watch(
|
|
239
244
|
() => formItems.value,
|
|
240
245
|
() => {
|
|
241
|
-
|
|
246
|
+
recoverFormData()
|
|
242
247
|
},
|
|
243
248
|
)
|
|
244
249
|
|
|
@@ -305,6 +310,17 @@ export default defineComponent({
|
|
|
305
310
|
state.submitFormBackup = cloneDeep(extractFormData)
|
|
306
311
|
}
|
|
307
312
|
|
|
313
|
+
const recoverFormData = () => {
|
|
314
|
+
if (props.fillMode === "auto") {
|
|
315
|
+
initFormData(state.submitForm)
|
|
316
|
+
} else if (props.fillMode === "init") {
|
|
317
|
+
initFormData(dataForInit.value || false)
|
|
318
|
+
} else if (isFunction(props.fillMode)) {
|
|
319
|
+
const fillData = props.fillMode(cloneDeep(dataForInit.value), cloneDeep(state.submitForm))
|
|
320
|
+
initFormData(fillData)
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
308
324
|
//远程拿数据模式
|
|
309
325
|
const fetchItem = () => {
|
|
310
326
|
if (props.fetchUrl) {
|