form-custom-test 3.0.193 → 3.0.195
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.
- package/dist/designer.es.js +34 -30
- package/dist/designer.style.css +1 -1
- package/dist/designer.umd.js +20 -20
- package/dist/render.es.js +34 -30
- package/dist/render.style.css +1 -1
- package/dist/render.umd.js +4 -4
- package/package.json +1 -1
package/dist/render.es.js
CHANGED
|
@@ -25818,6 +25818,13 @@ const _sfc_main$y = {
|
|
|
25818
25818
|
}
|
|
25819
25819
|
});
|
|
25820
25820
|
}
|
|
25821
|
+
} else if (wItem.type === "sub-table" && wItem.formItemFlag) {
|
|
25822
|
+
let fieldName = wItem.options.name;
|
|
25823
|
+
if (!this.formData.hasOwnProperty(fieldName)) {
|
|
25824
|
+
this.formDataModel[fieldName] = deepClone(wItem.options.defaultValue || []);
|
|
25825
|
+
} else {
|
|
25826
|
+
this.formDataModel[fieldName] = deepClone(this.formData[fieldName]);
|
|
25827
|
+
}
|
|
25821
25828
|
} else if (wItem.type === "sub-form") {
|
|
25822
25829
|
let subFormName = wItem.options.name;
|
|
25823
25830
|
if (!this.formData.hasOwnProperty(subFormName)) {
|
|
@@ -26495,7 +26502,7 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
26495
26502
|
_: 3
|
|
26496
26503
|
}, 8, ["label-position", "size", "class", "label-width", "model"]);
|
|
26497
26504
|
}
|
|
26498
|
-
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$y, [["render", _sfc_render$y], ["__scopeId", "data-v-
|
|
26505
|
+
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$y, [["render", _sfc_render$y], ["__scopeId", "data-v-7129091e"]]);
|
|
26499
26506
|
function registerIcon(app) {
|
|
26500
26507
|
app.component("el-icon-edit", edit);
|
|
26501
26508
|
app.component("el-icon-minus", minus);
|
|
@@ -26510,13 +26517,13 @@ function registerIcon(app) {
|
|
|
26510
26517
|
if (typeof window !== "undefined") {
|
|
26511
26518
|
let loadSvg = function() {
|
|
26512
26519
|
var body = document.body;
|
|
26513
|
-
var svgDom = document.getElementById("
|
|
26520
|
+
var svgDom = document.getElementById("__svg__icons__dom__1780624794319__");
|
|
26514
26521
|
if (!svgDom) {
|
|
26515
26522
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
26516
26523
|
svgDom.style.position = "absolute";
|
|
26517
26524
|
svgDom.style.width = "0";
|
|
26518
26525
|
svgDom.style.height = "0";
|
|
26519
|
-
svgDom.id = "
|
|
26526
|
+
svgDom.id = "__svg__icons__dom__1780624794319__";
|
|
26520
26527
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
26521
26528
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
26522
26529
|
}
|
|
@@ -36277,15 +36284,25 @@ const _sfc_main$d = {
|
|
|
36277
36284
|
},
|
|
36278
36285
|
created() {
|
|
36279
36286
|
this.initRefList();
|
|
36280
|
-
this.
|
|
36281
|
-
},
|
|
36282
|
-
mounted() {
|
|
36283
|
-
this.initTableData();
|
|
36287
|
+
this.initEventHandler();
|
|
36284
36288
|
},
|
|
36285
36289
|
beforeUnmount() {
|
|
36286
36290
|
this.unregisterFromRefList();
|
|
36287
36291
|
},
|
|
36288
36292
|
methods: {
|
|
36293
|
+
initEventHandler() {
|
|
36294
|
+
this.on$("setFormData", (newFormData) => {
|
|
36295
|
+
var _a, _b;
|
|
36296
|
+
const fieldName = (_b = (_a = this.widget) == null ? void 0 : _a.options) == null ? void 0 : _b.name;
|
|
36297
|
+
if (!fieldName || !newFormData) {
|
|
36298
|
+
return;
|
|
36299
|
+
}
|
|
36300
|
+
const value2 = newFormData[fieldName];
|
|
36301
|
+
if (Array.isArray(value2)) {
|
|
36302
|
+
this.setValue(value2);
|
|
36303
|
+
}
|
|
36304
|
+
});
|
|
36305
|
+
},
|
|
36289
36306
|
updateFormModel(data2) {
|
|
36290
36307
|
if (this.globalModel && this.globalModel.formModel) {
|
|
36291
36308
|
this.globalModel.formModel[this.widget.options.name] = deepClone(data2);
|
|
@@ -36296,17 +36313,6 @@ const _sfc_main$d = {
|
|
|
36296
36313
|
]);
|
|
36297
36314
|
}
|
|
36298
36315
|
},
|
|
36299
|
-
initTableData() {
|
|
36300
|
-
if (this.fieldModel && Array.isArray(this.fieldModel)) {
|
|
36301
|
-
this.tableData = deepClone(this.fieldModel);
|
|
36302
|
-
} else if (this.widget.options.defaultValue && Array.isArray(this.widget.options.defaultValue)) {
|
|
36303
|
-
this.tableData = deepClone(this.widget.options.defaultValue);
|
|
36304
|
-
this.updateFormModel(this.tableData);
|
|
36305
|
-
} else {
|
|
36306
|
-
this.tableData = [];
|
|
36307
|
-
this.updateFormModel([]);
|
|
36308
|
-
}
|
|
36309
|
-
},
|
|
36310
36316
|
handleAddRow() {
|
|
36311
36317
|
this.editingIndex = -1;
|
|
36312
36318
|
this.dialogTitle = "\u65B0\u589E";
|
|
@@ -36632,7 +36638,6 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
36632
36638
|
}, toDisplayString($props.widget.options.label), 3),
|
|
36633
36639
|
$props.widget.options.required ? (openBlock(), createElementBlock("span", _hoisted_2$8, "*")) : createCommentVNode("", true)
|
|
36634
36640
|
])) : createCommentVNode("", true),
|
|
36635
|
-
createTextVNode(" " + toDisplayString($data.tableData) + " ", 1),
|
|
36636
36641
|
createElementVNode("div", _hoisted_3$6, [
|
|
36637
36642
|
!$props.widget.options.disabled ? (openBlock(), createBlock(_component_el_button, {
|
|
36638
36643
|
key: 0,
|
|
@@ -36862,7 +36867,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
36862
36867
|
_: 1
|
|
36863
36868
|
}, 8, ["widget"]);
|
|
36864
36869
|
}
|
|
36865
|
-
var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-
|
|
36870
|
+
var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-407a6f2b"]]);
|
|
36866
36871
|
var ace$2 = { exports: {} };
|
|
36867
36872
|
(function(module, exports) {
|
|
36868
36873
|
(function() {
|
|
@@ -63125,17 +63130,25 @@ const _sfc_main$7 = {
|
|
|
63125
63130
|
},
|
|
63126
63131
|
applyFormJsonToRender(parsed) {
|
|
63127
63132
|
this.formJson = parsed && parsed.widgetList && parsed.formConfig ? parsed : lodash.exports.cloneDeep(this.defaultFormJson);
|
|
63133
|
+
this.showForm = true;
|
|
63128
63134
|
this.$nextTick(() => {
|
|
63129
63135
|
const ref2 = this.$refs.detailFormRender;
|
|
63130
63136
|
if (ref2 && typeof ref2.setFormJson === "function") {
|
|
63131
63137
|
ref2.setFormJson(lodash.exports.cloneDeep(this.formJson));
|
|
63132
63138
|
this.$nextTick(() => {
|
|
63139
|
+
this.applyFormDataToRender();
|
|
63133
63140
|
this.flushPendingColHiddenOps();
|
|
63134
63141
|
this.syncFormDisabledStatus();
|
|
63135
63142
|
});
|
|
63136
63143
|
}
|
|
63137
63144
|
});
|
|
63138
63145
|
},
|
|
63146
|
+
applyFormDataToRender() {
|
|
63147
|
+
const ref2 = this.$refs.detailFormRender;
|
|
63148
|
+
if (ref2 && typeof ref2.setFormData === "function" && this.formData) {
|
|
63149
|
+
ref2.setFormData(lodash.exports.cloneDeep(this.formData));
|
|
63150
|
+
}
|
|
63151
|
+
},
|
|
63139
63152
|
setColHidden(colNames, hidden) {
|
|
63140
63153
|
const names = Array.isArray(colNames) ? colNames : [colNames];
|
|
63141
63154
|
this.pendingColHiddenOps.push({ names, hidden });
|
|
@@ -63173,20 +63186,11 @@ const _sfc_main$7 = {
|
|
|
63173
63186
|
let parsed;
|
|
63174
63187
|
try {
|
|
63175
63188
|
parsed = typeof data2.formJson === "string" ? JSON.parse(data2.formJson) : data2.formJson;
|
|
63176
|
-
this.showForm = true;
|
|
63177
63189
|
} catch (e) {
|
|
63178
63190
|
console.error(e);
|
|
63179
63191
|
parsed = null;
|
|
63180
63192
|
}
|
|
63181
63193
|
this.applyFormJsonToRender(parsed);
|
|
63182
|
-
this.showForm = true;
|
|
63183
|
-
setTimeout(() => {
|
|
63184
|
-
const ref2 = this.$refs.detailFormRender;
|
|
63185
|
-
if (!ref2) {
|
|
63186
|
-
return;
|
|
63187
|
-
}
|
|
63188
|
-
ref2.setFormData(__spreadValues({}, this.formData));
|
|
63189
|
-
}, 1e3);
|
|
63190
63194
|
}).catch((err) => {
|
|
63191
63195
|
console.error(err);
|
|
63192
63196
|
this.applyFormJsonToRender(null);
|
|
@@ -63287,7 +63291,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
63287
63291
|
_: 1
|
|
63288
63292
|
}, 8, ["modelValue", "onClose"]);
|
|
63289
63293
|
}
|
|
63290
|
-
var DetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-
|
|
63294
|
+
var DetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-a20a039c"]]);
|
|
63291
63295
|
var index_vue_vue_type_style_index_0_lang = "";
|
|
63292
63296
|
const _sfc_main$6 = {
|
|
63293
63297
|
name: "asset-table-widget",
|