form-custom-test 3.0.160 → 3.0.162
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 +137 -12
- package/dist/designer.style.css +1 -1
- package/dist/designer.umd.js +45 -45
- package/dist/render.es.js +137 -12
- package/dist/render.style.css +1 -1
- package/dist/render.umd.js +5 -5
- package/package.json +1 -1
package/dist/designer.es.js
CHANGED
|
@@ -4850,7 +4850,7 @@ const getRegExp = function(validatorName2) {
|
|
|
4850
4850
|
maxLen10Decimals2: "/^\\d{1,10}(\\.\\d{1,2})?$/",
|
|
4851
4851
|
maxLen12Decimals2: "/^\\d{1,12}(\\.\\d{1,2})?$/",
|
|
4852
4852
|
latitude: "/^-?(?:90(?:\\.0{1,6})?|[1-8]?\\d(?:\\.\\d{1,6})?|0(?:\\.\\d{1,6})?)$/",
|
|
4853
|
-
sixFigures: "
|
|
4853
|
+
sixFigures: "/^(0|[1-9]\\d{0,5})(\\.\\d{1,6})?$/",
|
|
4854
4854
|
percentage: "/^(?:100(?:\\.0{0,4})?|[1-9]?\\d(?:\\.\\d{0,4})?|0(?:\\.\\d{0,4})?)$/",
|
|
4855
4855
|
longitude: "/^-?(?:180(?:\\.0{1,6})?|1[0-7]\\d(?:\\.\\d{1,6})?|[1-9]?\\d(?:\\.\\d{1,6})?|0(?:\\.\\d{1,6})?)$/"
|
|
4856
4856
|
};
|
|
@@ -10561,17 +10561,39 @@ var fieldMixin = {
|
|
|
10561
10561
|
this.fieldModel = this.field.options.defaultValue;
|
|
10562
10562
|
}
|
|
10563
10563
|
},
|
|
10564
|
+
clearFieldValidate() {
|
|
10565
|
+
var _a2;
|
|
10566
|
+
if (this.designState || !((_a2 = this.field) == null ? void 0 : _a2.formItemFlag)) {
|
|
10567
|
+
return;
|
|
10568
|
+
}
|
|
10569
|
+
const formRef = this.getFormRef();
|
|
10570
|
+
if (!formRef || typeof formRef.clearValidate !== "function") {
|
|
10571
|
+
return;
|
|
10572
|
+
}
|
|
10573
|
+
const prop = this.getPropName();
|
|
10574
|
+
if (!prop) {
|
|
10575
|
+
return;
|
|
10576
|
+
}
|
|
10577
|
+
this.$nextTick(() => {
|
|
10578
|
+
formRef.clearValidate(prop);
|
|
10579
|
+
});
|
|
10580
|
+
},
|
|
10564
10581
|
clearFieldRules() {
|
|
10565
10582
|
if (!this.field.formItemFlag) {
|
|
10566
10583
|
return;
|
|
10567
10584
|
}
|
|
10568
10585
|
this.rules.splice(0, this.rules.length);
|
|
10586
|
+
this.clearFieldValidate();
|
|
10569
10587
|
},
|
|
10570
10588
|
buildFieldRules() {
|
|
10571
|
-
if (!this.field.formItemFlag
|
|
10589
|
+
if (!this.field.formItemFlag) {
|
|
10572
10590
|
return;
|
|
10573
10591
|
}
|
|
10574
10592
|
this.rules.splice(0, this.rules.length);
|
|
10593
|
+
if (!!this.field.options.hidden && !this.designState) {
|
|
10594
|
+
this.clearFieldValidate();
|
|
10595
|
+
return;
|
|
10596
|
+
}
|
|
10575
10597
|
if (!!this.field.options.required) {
|
|
10576
10598
|
this.rules.push({
|
|
10577
10599
|
required: true,
|
|
@@ -10609,6 +10631,7 @@ var fieldMixin = {
|
|
|
10609
10631
|
label: this.field.options.label
|
|
10610
10632
|
});
|
|
10611
10633
|
}
|
|
10634
|
+
this.clearFieldValidate();
|
|
10612
10635
|
},
|
|
10613
10636
|
disableChangeValidate() {
|
|
10614
10637
|
if (!this.rules) {
|
|
@@ -10743,6 +10766,10 @@ var fieldMixin = {
|
|
|
10743
10766
|
return formRef && typeof formRef.findColByName === "function" ? formRef.findColByName(null, colName) : null;
|
|
10744
10767
|
},
|
|
10745
10768
|
setColHidden(colName, hidden) {
|
|
10769
|
+
const formRef = this.getFormRef();
|
|
10770
|
+
if (formRef && typeof formRef.setColHidden === "function") {
|
|
10771
|
+
return formRef.setColHidden(colName, hidden);
|
|
10772
|
+
}
|
|
10746
10773
|
const hiddenVal = !!hidden;
|
|
10747
10774
|
if (Array.isArray(colName)) {
|
|
10748
10775
|
let anySet = false;
|
|
@@ -26231,6 +26258,12 @@ const _sfc_main$2Y = {
|
|
|
26231
26258
|
this.initLayoutProps();
|
|
26232
26259
|
this.initRefList();
|
|
26233
26260
|
},
|
|
26261
|
+
mounted() {
|
|
26262
|
+
var _a2, _b2;
|
|
26263
|
+
if (!this.designState && ((_b2 = (_a2 = this.widget) == null ? void 0 : _a2.options) == null ? void 0 : _b2.hidden)) {
|
|
26264
|
+
this.$nextTick(() => this.syncColFieldValidation(true));
|
|
26265
|
+
}
|
|
26266
|
+
},
|
|
26234
26267
|
beforeUnmount() {
|
|
26235
26268
|
var _a2, _b2;
|
|
26236
26269
|
if (this.refList != null && ((_b2 = (_a2 = this.widget) == null ? void 0 : _a2.options) == null ? void 0 : _b2.name)) {
|
|
@@ -26243,12 +26276,50 @@ const _sfc_main$2Y = {
|
|
|
26243
26276
|
this.layoutProps.span = val;
|
|
26244
26277
|
},
|
|
26245
26278
|
immediate: true
|
|
26279
|
+
},
|
|
26280
|
+
"widget.options.hidden": {
|
|
26281
|
+
handler(val) {
|
|
26282
|
+
if (this.designState)
|
|
26283
|
+
return;
|
|
26284
|
+
this.syncColFieldValidation(!!val);
|
|
26285
|
+
}
|
|
26246
26286
|
}
|
|
26247
26287
|
},
|
|
26248
26288
|
methods: {
|
|
26289
|
+
syncColFieldValidation(hidden) {
|
|
26290
|
+
if (!this.widget)
|
|
26291
|
+
return;
|
|
26292
|
+
const hiddenFlag = !!hidden;
|
|
26293
|
+
const propsToClear = [];
|
|
26294
|
+
const formRef = this.getFormRef();
|
|
26295
|
+
traverseFieldWidgetsOfContainer(this.widget, (fieldWidget2) => {
|
|
26296
|
+
if (!fieldWidget2.formItemFlag || !fieldWidget2.options || !fieldWidget2.options.name) {
|
|
26297
|
+
return;
|
|
26298
|
+
}
|
|
26299
|
+
const fieldRef = this.getWidgetRef(fieldWidget2.options.name);
|
|
26300
|
+
if (!fieldRef)
|
|
26301
|
+
return;
|
|
26302
|
+
if (hiddenFlag) {
|
|
26303
|
+
if (typeof fieldRef.clearFieldRules === "function") {
|
|
26304
|
+
fieldRef.clearFieldRules();
|
|
26305
|
+
}
|
|
26306
|
+
} else if (typeof fieldRef.buildFieldRules === "function") {
|
|
26307
|
+
fieldRef.buildFieldRules();
|
|
26308
|
+
}
|
|
26309
|
+
if (typeof fieldRef.getPropName === "function") {
|
|
26310
|
+
propsToClear.push(fieldRef.getPropName());
|
|
26311
|
+
}
|
|
26312
|
+
});
|
|
26313
|
+
if (propsToClear.length > 0 && formRef && typeof formRef.clearValidate === "function") {
|
|
26314
|
+
this.$nextTick(() => {
|
|
26315
|
+
formRef.clearValidate(propsToClear);
|
|
26316
|
+
});
|
|
26317
|
+
}
|
|
26318
|
+
},
|
|
26249
26319
|
setHidden(flag) {
|
|
26250
26320
|
if (this.widget && this.widget.options) {
|
|
26251
26321
|
this.widget.options.hidden = !!flag;
|
|
26322
|
+
this.syncColFieldValidation(flag);
|
|
26252
26323
|
this.$nextTick(() => this.$forceUpdate());
|
|
26253
26324
|
}
|
|
26254
26325
|
},
|
|
@@ -26350,7 +26421,7 @@ function _sfc_render$2Y(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
26350
26421
|
[vShow, $options.colVisible]
|
|
26351
26422
|
]) : createCommentVNode("", true);
|
|
26352
26423
|
}
|
|
26353
|
-
var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$2Y, [["render", _sfc_render$2Y], ["__scopeId", "data-v-
|
|
26424
|
+
var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$2Y, [["render", _sfc_render$2Y], ["__scopeId", "data-v-54aa37b2"]]);
|
|
26354
26425
|
var __glob_0_1$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26355
26426
|
__proto__: null,
|
|
26356
26427
|
"default": GridColItem
|
|
@@ -27622,7 +27693,18 @@ const _sfc_main$2S = {
|
|
|
27622
27693
|
const fieldSchema = this.findFieldByName(widgetName);
|
|
27623
27694
|
if (fieldSchema && fieldSchema.options) {
|
|
27624
27695
|
fieldSchema.options.hidden = !!hiddenFlag;
|
|
27625
|
-
this.$nextTick(() =>
|
|
27696
|
+
this.$nextTick(() => {
|
|
27697
|
+
const ref2 = this.getWidgetRef(widgetName);
|
|
27698
|
+
if (ref2) {
|
|
27699
|
+
if (hiddenFlag) {
|
|
27700
|
+
if (typeof ref2.clearFieldRules === "function")
|
|
27701
|
+
ref2.clearFieldRules();
|
|
27702
|
+
} else if (typeof ref2.buildFieldRules === "function") {
|
|
27703
|
+
ref2.buildFieldRules();
|
|
27704
|
+
}
|
|
27705
|
+
}
|
|
27706
|
+
this.$forceUpdate();
|
|
27707
|
+
});
|
|
27626
27708
|
return;
|
|
27627
27709
|
}
|
|
27628
27710
|
this.findWidgetOfSubFormAndSetHidden(widgetName, hiddenFlag);
|
|
@@ -27632,9 +27714,6 @@ const _sfc_main$2S = {
|
|
|
27632
27714
|
const fieldRef = this.getWidgetRef(fieldName);
|
|
27633
27715
|
if (fieldRef && typeof fieldRef.setRequired === "function") {
|
|
27634
27716
|
fieldRef.setRequired(flag);
|
|
27635
|
-
if (typeof fieldRef.buildFieldRules === "function") {
|
|
27636
|
-
fieldRef.buildFieldRules();
|
|
27637
|
-
}
|
|
27638
27717
|
return true;
|
|
27639
27718
|
}
|
|
27640
27719
|
const fieldSchema = this.findFieldByName(fieldName);
|
|
@@ -27643,6 +27722,8 @@ const _sfc_main$2S = {
|
|
|
27643
27722
|
const refAfter = this.getWidgetRef(fieldName);
|
|
27644
27723
|
if (refAfter && typeof refAfter.buildFieldRules === "function") {
|
|
27645
27724
|
refAfter.buildFieldRules();
|
|
27725
|
+
} else {
|
|
27726
|
+
this.$nextTick(() => this.clearValidate(fieldName));
|
|
27646
27727
|
}
|
|
27647
27728
|
return true;
|
|
27648
27729
|
}
|
|
@@ -27929,7 +28010,11 @@ const _sfc_main$2S = {
|
|
|
27929
28010
|
});
|
|
27930
28011
|
},
|
|
27931
28012
|
clearValidate(props) {
|
|
27932
|
-
this.$refs.renderForm
|
|
28013
|
+
const form = this.$refs.renderForm;
|
|
28014
|
+
if (!form || typeof form.clearValidate !== "function") {
|
|
28015
|
+
return;
|
|
28016
|
+
}
|
|
28017
|
+
form.clearValidate(props);
|
|
27933
28018
|
},
|
|
27934
28019
|
validateForm(callback2) {
|
|
27935
28020
|
this.$refs["renderForm"].validate((valid) => {
|
|
@@ -28050,11 +28135,50 @@ const _sfc_main$2S = {
|
|
|
28050
28135
|
}
|
|
28051
28136
|
return null;
|
|
28052
28137
|
},
|
|
28138
|
+
syncFieldRulesByCol(col, hidden) {
|
|
28139
|
+
if (!col)
|
|
28140
|
+
return;
|
|
28141
|
+
const hiddenFlag = !!hidden;
|
|
28142
|
+
const propsToClear = [];
|
|
28143
|
+
traverseFieldWidgetsOfContainer(col, (fieldWidget2) => {
|
|
28144
|
+
if (!fieldWidget2.formItemFlag || !fieldWidget2.options || !fieldWidget2.options.name) {
|
|
28145
|
+
return;
|
|
28146
|
+
}
|
|
28147
|
+
const fieldRef = this.getWidgetRef(fieldWidget2.options.name);
|
|
28148
|
+
if (!fieldRef)
|
|
28149
|
+
return;
|
|
28150
|
+
if (hiddenFlag) {
|
|
28151
|
+
if (typeof fieldRef.clearFieldRules === "function") {
|
|
28152
|
+
fieldRef.clearFieldRules();
|
|
28153
|
+
}
|
|
28154
|
+
} else if (typeof fieldRef.buildFieldRules === "function") {
|
|
28155
|
+
fieldRef.buildFieldRules();
|
|
28156
|
+
}
|
|
28157
|
+
if (typeof fieldRef.getPropName === "function") {
|
|
28158
|
+
propsToClear.push(fieldRef.getPropName());
|
|
28159
|
+
}
|
|
28160
|
+
});
|
|
28161
|
+
if (propsToClear.length > 0) {
|
|
28162
|
+
this.$nextTick(() => {
|
|
28163
|
+
this.clearValidate(propsToClear);
|
|
28164
|
+
});
|
|
28165
|
+
}
|
|
28166
|
+
},
|
|
28053
28167
|
setColHidden(colName, hidden) {
|
|
28168
|
+
if (Array.isArray(colName)) {
|
|
28169
|
+
let anySet = false;
|
|
28170
|
+
colName.forEach((name) => {
|
|
28171
|
+
if (this.setColHidden(name, hidden)) {
|
|
28172
|
+
anySet = true;
|
|
28173
|
+
}
|
|
28174
|
+
});
|
|
28175
|
+
return anySet;
|
|
28176
|
+
}
|
|
28054
28177
|
const col = this.findColByName(null, colName);
|
|
28055
28178
|
if (!col || !col.options)
|
|
28056
28179
|
return false;
|
|
28057
28180
|
col.options.hidden = !!hidden;
|
|
28181
|
+
this.syncFieldRulesByCol(col, hidden);
|
|
28058
28182
|
this.$nextTick(() => this.$forceUpdate());
|
|
28059
28183
|
return true;
|
|
28060
28184
|
}
|
|
@@ -28115,7 +28239,7 @@ function _sfc_render$2S(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
28115
28239
|
_: 3
|
|
28116
28240
|
}, 8, ["label-position", "size", "class", "label-width", "model"]);
|
|
28117
28241
|
}
|
|
28118
|
-
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2S, [["render", _sfc_render$2S], ["__scopeId", "data-v-
|
|
28242
|
+
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2S, [["render", _sfc_render$2S], ["__scopeId", "data-v-6ba86904"]]);
|
|
28119
28243
|
var ace$2 = { exports: {} };
|
|
28120
28244
|
(function(module, exports) {
|
|
28121
28245
|
(function() {
|
|
@@ -68681,13 +68805,13 @@ function registerIcon(app) {
|
|
|
68681
68805
|
if (typeof window !== "undefined") {
|
|
68682
68806
|
let loadSvg = function() {
|
|
68683
68807
|
var body = document.body;
|
|
68684
|
-
var svgDom = document.getElementById("
|
|
68808
|
+
var svgDom = document.getElementById("__svg__icons__dom__1779273892216__");
|
|
68685
68809
|
if (!svgDom) {
|
|
68686
68810
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
68687
68811
|
svgDom.style.position = "absolute";
|
|
68688
68812
|
svgDom.style.width = "0";
|
|
68689
68813
|
svgDom.style.height = "0";
|
|
68690
|
-
svgDom.id = "
|
|
68814
|
+
svgDom.id = "__svg__icons__dom__1779273892216__";
|
|
68691
68815
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
68692
68816
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
68693
68817
|
}
|
|
@@ -78901,6 +79025,7 @@ const _sfc_main$6 = {
|
|
|
78901
79025
|
const tableRef = this.$refs.tableRef;
|
|
78902
79026
|
const selection = tableRef && typeof tableRef.getSelectionRows === "function" ? tableRef.getSelectionRows() : [];
|
|
78903
79027
|
if (!selection || selection.length === 0) {
|
|
79028
|
+
this.$message.error(`\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u8D44\u4EA7`);
|
|
78904
79029
|
return;
|
|
78905
79030
|
}
|
|
78906
79031
|
const arr = [...this.selectedRows, ...selection].reduce((acc, item) => {
|
|
@@ -79285,7 +79410,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
79285
79410
|
_: 1
|
|
79286
79411
|
}, 8, ["modelValue", "onClose"]);
|
|
79287
79412
|
}
|
|
79288
|
-
var AssetDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-
|
|
79413
|
+
var AssetDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-4c34c6a0"]]);
|
|
79289
79414
|
var index_vue_vue_type_style_index_0_lang$1 = "";
|
|
79290
79415
|
const _sfc_main$5 = {
|
|
79291
79416
|
name: "asset-select-widget",
|