form-custom-test 3.0.53 → 3.0.55
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 +124 -21
- package/dist/designer.style.css +1 -1
- package/dist/designer.umd.js +7 -7
- package/dist/render.es.js +41 -6
- package/dist/render.style.css +1 -1
- package/dist/render.umd.js +76 -76
- package/package.json +1 -1
package/dist/designer.es.js
CHANGED
|
@@ -2872,7 +2872,9 @@ function getDefaultFormConfig() {
|
|
|
2872
2872
|
jsonVersion: 3,
|
|
2873
2873
|
onFormCreated: "",
|
|
2874
2874
|
onFormMounted: "",
|
|
2875
|
-
onFormDataChange: ""
|
|
2875
|
+
onFormDataChange: "",
|
|
2876
|
+
onFormValidate: "",
|
|
2877
|
+
onFormValidateSuccess: ""
|
|
2876
2878
|
};
|
|
2877
2879
|
}
|
|
2878
2880
|
function buildDefaultFormJson() {
|
|
@@ -10502,8 +10504,27 @@ var fieldMixin = {
|
|
|
10502
10504
|
return formRef && typeof formRef.findColByName === "function" ? formRef.findColByName(null, colName) : null;
|
|
10503
10505
|
},
|
|
10504
10506
|
setColHidden(colName, hidden) {
|
|
10505
|
-
const
|
|
10506
|
-
|
|
10507
|
+
const hiddenVal = !!hidden;
|
|
10508
|
+
console.log("colName", colName);
|
|
10509
|
+
if (Array.isArray(colName)) {
|
|
10510
|
+
let anySet = false;
|
|
10511
|
+
colName.forEach((cName) => {
|
|
10512
|
+
console.log("cName", cName);
|
|
10513
|
+
const col2 = this.findColByName(cName);
|
|
10514
|
+
console.log("col", col2);
|
|
10515
|
+
if (col2 && col2.options) {
|
|
10516
|
+
col2.options.hidden = hiddenVal;
|
|
10517
|
+
console.log("col.options.hidden", col2.options.hidden);
|
|
10518
|
+
anySet = true;
|
|
10519
|
+
}
|
|
10520
|
+
});
|
|
10521
|
+
return anySet;
|
|
10522
|
+
}
|
|
10523
|
+
const col = this.findColByName(colName);
|
|
10524
|
+
if (!col || !col.options)
|
|
10525
|
+
return false;
|
|
10526
|
+
col.options.hidden = hiddenVal;
|
|
10527
|
+
return true;
|
|
10507
10528
|
},
|
|
10508
10529
|
getWidgetRef(widgetName, showError, rowId) {
|
|
10509
10530
|
let foundRef = null;
|
|
@@ -27197,6 +27218,7 @@ const _sfc_main$2L = {
|
|
|
27197
27218
|
});
|
|
27198
27219
|
this.$refs["renderForm"].validate((valid) => {
|
|
27199
27220
|
if (valid) {
|
|
27221
|
+
this.emitFormValidateSuccess(this.formDataModel);
|
|
27200
27222
|
callback2(this.formDataModel);
|
|
27201
27223
|
} else {
|
|
27202
27224
|
callback2(this.formDataModel, this.i18nt("render.hint.validationFailed"));
|
|
@@ -27302,9 +27324,22 @@ const _sfc_main$2L = {
|
|
|
27302
27324
|
},
|
|
27303
27325
|
validateForm(callback2) {
|
|
27304
27326
|
this.$refs["renderForm"].validate((valid) => {
|
|
27327
|
+
if (valid && !!this.formConfig && !!this.formConfig.onFormValidateSuccess) {
|
|
27328
|
+
this.emitFormValidateSuccess(this.formDataModel);
|
|
27329
|
+
}
|
|
27305
27330
|
callback2(valid);
|
|
27306
27331
|
});
|
|
27307
27332
|
},
|
|
27333
|
+
emitFormValidateSuccess(formData) {
|
|
27334
|
+
if (!this.formConfig || !this.formConfig.onFormValidateSuccess)
|
|
27335
|
+
return;
|
|
27336
|
+
try {
|
|
27337
|
+
let customFunc = new Function("formData", this.formConfig.onFormValidateSuccess);
|
|
27338
|
+
customFunc.call(this, formData);
|
|
27339
|
+
} catch (e) {
|
|
27340
|
+
console.error("onFormValidateSuccess", e);
|
|
27341
|
+
}
|
|
27342
|
+
},
|
|
27308
27343
|
validateFields() {
|
|
27309
27344
|
},
|
|
27310
27345
|
disableWidgets(widgetNames) {
|
|
@@ -27471,7 +27506,7 @@ function _sfc_render$2L(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
27471
27506
|
_: 3
|
|
27472
27507
|
}, 8, ["label-position", "size", "class", "label-width", "model"]);
|
|
27473
27508
|
}
|
|
27474
|
-
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2L, [["render", _sfc_render$2L], ["__scopeId", "data-v-
|
|
27509
|
+
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2L, [["render", _sfc_render$2L], ["__scopeId", "data-v-7dcf7602"]]);
|
|
27475
27510
|
var ace$2 = { exports: {} };
|
|
27476
27511
|
(function(module, exports) {
|
|
27477
27512
|
(function() {
|
|
@@ -60573,7 +60608,9 @@ const _sfc_main$q = {
|
|
|
60573
60608
|
eventParamsMap: {
|
|
60574
60609
|
onFormCreated: "onFormCreated() {",
|
|
60575
60610
|
onFormMounted: "onFormMounted() {",
|
|
60576
|
-
onFormDataChange: "onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex) {"
|
|
60611
|
+
onFormDataChange: "onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex) {",
|
|
60612
|
+
onFormValidate: "onFormValidate() {",
|
|
60613
|
+
onFormValidateSuccess: "onFormValidateSuccess(formData) {"
|
|
60577
60614
|
}
|
|
60578
60615
|
};
|
|
60579
60616
|
},
|
|
@@ -60719,6 +60756,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
60719
60756
|
const _component_el_divider = resolveComponent("el-divider");
|
|
60720
60757
|
const _component_el_input = resolveComponent("el-input");
|
|
60721
60758
|
const _component_el_collapse_item = resolveComponent("el-collapse-item");
|
|
60759
|
+
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
60722
60760
|
const _component_el_collapse = resolveComponent("el-collapse");
|
|
60723
60761
|
const _component_el_form = resolveComponent("el-form");
|
|
60724
60762
|
const _component_el_alert = resolveComponent("el-alert");
|
|
@@ -60732,13 +60770,13 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
60732
60770
|
"label-position": "left",
|
|
60733
60771
|
"label-width": "120px",
|
|
60734
60772
|
class: "setting-form",
|
|
60735
|
-
onSubmit: _cache[
|
|
60773
|
+
onSubmit: _cache[14] || (_cache[14] = withModifiers(() => {
|
|
60736
60774
|
}, ["prevent"]))
|
|
60737
60775
|
}, {
|
|
60738
60776
|
default: withCtx(() => [
|
|
60739
60777
|
createVNode(_component_el_collapse, {
|
|
60740
60778
|
modelValue: $data.formActiveCollapseNames,
|
|
60741
|
-
"onUpdate:modelValue": _cache[
|
|
60779
|
+
"onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.formActiveCollapseNames = $event),
|
|
60742
60780
|
class: "setting-collapse"
|
|
60743
60781
|
}, {
|
|
60744
60782
|
default: withCtx(() => [
|
|
@@ -61023,6 +61061,54 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61023
61061
|
})
|
|
61024
61062
|
]),
|
|
61025
61063
|
_: 1
|
|
61064
|
+
}),
|
|
61065
|
+
createVNode(_component_el_form_item, {
|
|
61066
|
+
label: "onFormValidate",
|
|
61067
|
+
"label-width": "150px"
|
|
61068
|
+
}, {
|
|
61069
|
+
default: withCtx(() => [
|
|
61070
|
+
createVNode(_component_el_button, {
|
|
61071
|
+
type: "info",
|
|
61072
|
+
icon: "el-icon-edit",
|
|
61073
|
+
plain: "",
|
|
61074
|
+
round: "",
|
|
61075
|
+
onClick: _cache[11] || (_cache[11] = ($event) => $options.editFormEventHandler("onFormValidate"))
|
|
61076
|
+
}, {
|
|
61077
|
+
default: withCtx(() => [
|
|
61078
|
+
createTextVNode(toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
|
|
61079
|
+
]),
|
|
61080
|
+
_: 1
|
|
61081
|
+
})
|
|
61082
|
+
]),
|
|
61083
|
+
_: 1
|
|
61084
|
+
}),
|
|
61085
|
+
createVNode(_component_el_form_item, {
|
|
61086
|
+
label: "onFormValidateSuccess",
|
|
61087
|
+
"label-width": "150px"
|
|
61088
|
+
}, {
|
|
61089
|
+
default: withCtx(() => [
|
|
61090
|
+
createVNode(_component_el_tooltip, {
|
|
61091
|
+
content: "\u8868\u5355\u6821\u9A8C\u901A\u8FC7\u540E\u89E6\u53D1",
|
|
61092
|
+
placement: "top"
|
|
61093
|
+
}, {
|
|
61094
|
+
default: withCtx(() => [
|
|
61095
|
+
createVNode(_component_el_button, {
|
|
61096
|
+
type: "info",
|
|
61097
|
+
icon: "el-icon-edit",
|
|
61098
|
+
plain: "",
|
|
61099
|
+
round: "",
|
|
61100
|
+
onClick: _cache[12] || (_cache[12] = ($event) => $options.editFormEventHandler("onFormValidateSuccess"))
|
|
61101
|
+
}, {
|
|
61102
|
+
default: withCtx(() => [
|
|
61103
|
+
createTextVNode(toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
|
|
61104
|
+
]),
|
|
61105
|
+
_: 1
|
|
61106
|
+
})
|
|
61107
|
+
]),
|
|
61108
|
+
_: 1
|
|
61109
|
+
})
|
|
61110
|
+
]),
|
|
61111
|
+
_: 1
|
|
61026
61112
|
})
|
|
61027
61113
|
]),
|
|
61028
61114
|
_: 1
|
|
@@ -61037,7 +61123,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61037
61123
|
createVNode(_component_el_dialog, {
|
|
61038
61124
|
title: _ctx.i18nt("designer.setting.editFormEventHandler"),
|
|
61039
61125
|
modelValue: $data.showFormEventDialogFlag,
|
|
61040
|
-
"onUpdate:modelValue": _cache[
|
|
61126
|
+
"onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.showFormEventDialogFlag = $event),
|
|
61041
61127
|
"show-close": true,
|
|
61042
61128
|
class: "drag-dialog small-padding-dialog",
|
|
61043
61129
|
"append-to-body": "",
|
|
@@ -61048,7 +61134,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61048
61134
|
footer: withCtx(() => [
|
|
61049
61135
|
createElementVNode("div", _hoisted_2$f, [
|
|
61050
61136
|
createVNode(_component_el_button, {
|
|
61051
|
-
onClick: _cache[
|
|
61137
|
+
onClick: _cache[16] || (_cache[16] = ($event) => $data.showFormEventDialogFlag = false)
|
|
61052
61138
|
}, {
|
|
61053
61139
|
default: withCtx(() => [
|
|
61054
61140
|
createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
|
|
@@ -61076,7 +61162,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61076
61162
|
mode: "javascript",
|
|
61077
61163
|
readonly: false,
|
|
61078
61164
|
modelValue: $data.formEventHandlerCode,
|
|
61079
|
-
"onUpdate:modelValue": _cache[
|
|
61165
|
+
"onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.formEventHandlerCode = $event),
|
|
61080
61166
|
ref: "ecEditor"
|
|
61081
61167
|
}, null, 8, ["modelValue"]),
|
|
61082
61168
|
createVNode(_component_el_alert, {
|
|
@@ -61094,7 +61180,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61094
61180
|
createVNode(_component_el_dialog, {
|
|
61095
61181
|
title: _ctx.i18nt("designer.setting.formCss"),
|
|
61096
61182
|
modelValue: $data.showEditFormCssDialogFlag,
|
|
61097
|
-
"onUpdate:modelValue": _cache[
|
|
61183
|
+
"onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.showEditFormCssDialogFlag = $event),
|
|
61098
61184
|
"show-close": true,
|
|
61099
61185
|
class: "drag-dialog small-padding-dialog",
|
|
61100
61186
|
"append-to-body": "",
|
|
@@ -61105,7 +61191,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61105
61191
|
footer: withCtx(() => [
|
|
61106
61192
|
createElementVNode("div", _hoisted_4$b, [
|
|
61107
61193
|
createVNode(_component_el_button, {
|
|
61108
|
-
onClick: _cache[
|
|
61194
|
+
onClick: _cache[19] || (_cache[19] = ($event) => $data.showEditFormCssDialogFlag = false)
|
|
61109
61195
|
}, {
|
|
61110
61196
|
default: withCtx(() => [
|
|
61111
61197
|
createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
|
|
@@ -61128,7 +61214,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61128
61214
|
mode: "css",
|
|
61129
61215
|
readonly: false,
|
|
61130
61216
|
modelValue: $data.formCssCode,
|
|
61131
|
-
"onUpdate:modelValue": _cache[
|
|
61217
|
+
"onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.formCssCode = $event)
|
|
61132
61218
|
}, null, 8, ["modelValue"])
|
|
61133
61219
|
]),
|
|
61134
61220
|
_: 1
|
|
@@ -61140,7 +61226,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61140
61226
|
createVNode(_component_el_dialog, {
|
|
61141
61227
|
title: _ctx.i18nt("designer.setting.globalFunctions"),
|
|
61142
61228
|
modelValue: $data.showEditFunctionsDialogFlag,
|
|
61143
|
-
"onUpdate:modelValue": _cache[
|
|
61229
|
+
"onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.showEditFunctionsDialogFlag = $event),
|
|
61144
61230
|
"show-close": true,
|
|
61145
61231
|
class: "drag-dialog small-padding-dialog",
|
|
61146
61232
|
"append-to-body": "",
|
|
@@ -61151,7 +61237,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61151
61237
|
footer: withCtx(() => [
|
|
61152
61238
|
createElementVNode("div", _hoisted_6$8, [
|
|
61153
61239
|
createVNode(_component_el_button, {
|
|
61154
|
-
onClick: _cache[
|
|
61240
|
+
onClick: _cache[22] || (_cache[22] = ($event) => $data.showEditFunctionsDialogFlag = false)
|
|
61155
61241
|
}, {
|
|
61156
61242
|
default: withCtx(() => [
|
|
61157
61243
|
createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
|
|
@@ -61174,7 +61260,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61174
61260
|
mode: "javascript",
|
|
61175
61261
|
readonly: false,
|
|
61176
61262
|
modelValue: $data.functionsCode,
|
|
61177
|
-
"onUpdate:modelValue": _cache[
|
|
61263
|
+
"onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.functionsCode = $event),
|
|
61178
61264
|
ref: "gfEditor"
|
|
61179
61265
|
}, null, 8, ["modelValue"])
|
|
61180
61266
|
]),
|
|
@@ -61185,7 +61271,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61185
61271
|
]) : createCommentVNode("", true)
|
|
61186
61272
|
]);
|
|
61187
61273
|
}
|
|
61188
|
-
var FormSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-
|
|
61274
|
+
var FormSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-3e6c7ca2"]]);
|
|
61189
61275
|
const COMMON_PROPERTIES$1 = {
|
|
61190
61276
|
"name": "name-editor",
|
|
61191
61277
|
"label": "label-editor",
|
|
@@ -63740,10 +63826,27 @@ function createDesigner(vueInstance) {
|
|
|
63740
63826
|
return null;
|
|
63741
63827
|
},
|
|
63742
63828
|
setColHidden(colName, hidden) {
|
|
63743
|
-
const
|
|
63829
|
+
const hiddenVal = !!hidden;
|
|
63830
|
+
console.log("colName", colName);
|
|
63831
|
+
if (Array.isArray(colName)) {
|
|
63832
|
+
let anySet = false;
|
|
63833
|
+
colName.forEach((cName) => {
|
|
63834
|
+
console.log("cName", cName);
|
|
63835
|
+
const col2 = this.findColByName(cName);
|
|
63836
|
+
console.log("col", col2);
|
|
63837
|
+
if (col2 && col2.options) {
|
|
63838
|
+
col2.options.hidden = hiddenVal;
|
|
63839
|
+
anySet = true;
|
|
63840
|
+
}
|
|
63841
|
+
});
|
|
63842
|
+
if (anySet)
|
|
63843
|
+
this.saveCurrentHistoryStep();
|
|
63844
|
+
return anySet;
|
|
63845
|
+
}
|
|
63846
|
+
const col = this.findColByName(colName);
|
|
63744
63847
|
if (!col || !col.options)
|
|
63745
63848
|
return false;
|
|
63746
|
-
col.options.hidden =
|
|
63849
|
+
col.options.hidden = hiddenVal;
|
|
63747
63850
|
this.saveCurrentHistoryStep();
|
|
63748
63851
|
return true;
|
|
63749
63852
|
},
|
|
@@ -67929,13 +68032,13 @@ function registerIcon(app) {
|
|
|
67929
68032
|
if (typeof window !== "undefined") {
|
|
67930
68033
|
let loadSvg = function() {
|
|
67931
68034
|
var body = document.body;
|
|
67932
|
-
var svgDom = document.getElementById("
|
|
68035
|
+
var svgDom = document.getElementById("__svg__icons__dom__1772680950330__");
|
|
67933
68036
|
if (!svgDom) {
|
|
67934
68037
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
67935
68038
|
svgDom.style.position = "absolute";
|
|
67936
68039
|
svgDom.style.width = "0";
|
|
67937
68040
|
svgDom.style.height = "0";
|
|
67938
|
-
svgDom.id = "
|
|
68041
|
+
svgDom.id = "__svg__icons__dom__1772680950330__";
|
|
67939
68042
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
67940
68043
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
67941
68044
|
}
|