form-custom-test 3.0.161 → 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/render.es.js CHANGED
@@ -8790,11 +8790,29 @@ var fieldMixin = {
8790
8790
  this.fieldModel = this.field.options.defaultValue;
8791
8791
  }
8792
8792
  },
8793
+ clearFieldValidate() {
8794
+ var _a;
8795
+ if (this.designState || !((_a = this.field) == null ? void 0 : _a.formItemFlag)) {
8796
+ return;
8797
+ }
8798
+ const formRef = this.getFormRef();
8799
+ if (!formRef || typeof formRef.clearValidate !== "function") {
8800
+ return;
8801
+ }
8802
+ const prop = this.getPropName();
8803
+ if (!prop) {
8804
+ return;
8805
+ }
8806
+ this.$nextTick(() => {
8807
+ formRef.clearValidate(prop);
8808
+ });
8809
+ },
8793
8810
  clearFieldRules() {
8794
8811
  if (!this.field.formItemFlag) {
8795
8812
  return;
8796
8813
  }
8797
8814
  this.rules.splice(0, this.rules.length);
8815
+ this.clearFieldValidate();
8798
8816
  },
8799
8817
  buildFieldRules() {
8800
8818
  if (!this.field.formItemFlag) {
@@ -8802,6 +8820,7 @@ var fieldMixin = {
8802
8820
  }
8803
8821
  this.rules.splice(0, this.rules.length);
8804
8822
  if (!!this.field.options.hidden && !this.designState) {
8823
+ this.clearFieldValidate();
8805
8824
  return;
8806
8825
  }
8807
8826
  if (!!this.field.options.required) {
@@ -8841,6 +8860,7 @@ var fieldMixin = {
8841
8860
  label: this.field.options.label
8842
8861
  });
8843
8862
  }
8863
+ this.clearFieldValidate();
8844
8864
  },
8845
8865
  disableChangeValidate() {
8846
8866
  if (!this.rules) {
@@ -24499,6 +24519,8 @@ const _sfc_main$B = {
24499
24519
  if (!this.widget)
24500
24520
  return;
24501
24521
  const hiddenFlag = !!hidden;
24522
+ const propsToClear = [];
24523
+ const formRef = this.getFormRef();
24502
24524
  traverseFieldWidgetsOfContainer(this.widget, (fieldWidget) => {
24503
24525
  if (!fieldWidget.formItemFlag || !fieldWidget.options || !fieldWidget.options.name) {
24504
24526
  return;
@@ -24513,7 +24535,15 @@ const _sfc_main$B = {
24513
24535
  } else if (typeof fieldRef.buildFieldRules === "function") {
24514
24536
  fieldRef.buildFieldRules();
24515
24537
  }
24538
+ if (typeof fieldRef.getPropName === "function") {
24539
+ propsToClear.push(fieldRef.getPropName());
24540
+ }
24516
24541
  });
24542
+ if (propsToClear.length > 0 && formRef && typeof formRef.clearValidate === "function") {
24543
+ this.$nextTick(() => {
24544
+ formRef.clearValidate(propsToClear);
24545
+ });
24546
+ }
24517
24547
  },
24518
24548
  setHidden(flag) {
24519
24549
  if (this.widget && this.widget.options) {
@@ -24620,7 +24650,7 @@ function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
24620
24650
  [vShow, $options.colVisible]
24621
24651
  ]) : createCommentVNode("", true);
24622
24652
  }
24623
- var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["render", _sfc_render$B], ["__scopeId", "data-v-20705201"]]);
24653
+ var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["render", _sfc_render$B], ["__scopeId", "data-v-54aa37b2"]]);
24624
24654
  var __glob_0_1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24625
24655
  __proto__: null,
24626
24656
  "default": GridColItem
@@ -25913,9 +25943,6 @@ const _sfc_main$v = {
25913
25943
  const fieldRef = this.getWidgetRef(fieldName);
25914
25944
  if (fieldRef && typeof fieldRef.setRequired === "function") {
25915
25945
  fieldRef.setRequired(flag);
25916
- if (typeof fieldRef.buildFieldRules === "function") {
25917
- fieldRef.buildFieldRules();
25918
- }
25919
25946
  return true;
25920
25947
  }
25921
25948
  const fieldSchema = this.findFieldByName(fieldName);
@@ -25924,6 +25951,8 @@ const _sfc_main$v = {
25924
25951
  const refAfter = this.getWidgetRef(fieldName);
25925
25952
  if (refAfter && typeof refAfter.buildFieldRules === "function") {
25926
25953
  refAfter.buildFieldRules();
25954
+ } else {
25955
+ this.$nextTick(() => this.clearValidate(fieldName));
25927
25956
  }
25928
25957
  return true;
25929
25958
  }
@@ -26210,7 +26239,11 @@ const _sfc_main$v = {
26210
26239
  });
26211
26240
  },
26212
26241
  clearValidate(props) {
26213
- this.$refs.renderForm.clearValidate(props);
26242
+ const form = this.$refs.renderForm;
26243
+ if (!form || typeof form.clearValidate !== "function") {
26244
+ return;
26245
+ }
26246
+ form.clearValidate(props);
26214
26247
  },
26215
26248
  validateForm(callback2) {
26216
26249
  this.$refs["renderForm"].validate((valid) => {
@@ -26335,6 +26368,7 @@ const _sfc_main$v = {
26335
26368
  if (!col)
26336
26369
  return;
26337
26370
  const hiddenFlag = !!hidden;
26371
+ const propsToClear = [];
26338
26372
  traverseFieldWidgetsOfContainer(col, (fieldWidget) => {
26339
26373
  if (!fieldWidget.formItemFlag || !fieldWidget.options || !fieldWidget.options.name) {
26340
26374
  return;
@@ -26349,7 +26383,15 @@ const _sfc_main$v = {
26349
26383
  } else if (typeof fieldRef.buildFieldRules === "function") {
26350
26384
  fieldRef.buildFieldRules();
26351
26385
  }
26386
+ if (typeof fieldRef.getPropName === "function") {
26387
+ propsToClear.push(fieldRef.getPropName());
26388
+ }
26352
26389
  });
26390
+ if (propsToClear.length > 0) {
26391
+ this.$nextTick(() => {
26392
+ this.clearValidate(propsToClear);
26393
+ });
26394
+ }
26353
26395
  },
26354
26396
  setColHidden(colName, hidden) {
26355
26397
  if (Array.isArray(colName)) {
@@ -26426,7 +26468,7 @@ function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
26426
26468
  _: 3
26427
26469
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
26428
26470
  }
26429
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$v], ["__scopeId", "data-v-3d429201"]]);
26471
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$v], ["__scopeId", "data-v-6ba86904"]]);
26430
26472
  function registerIcon(app) {
26431
26473
  app.component("el-icon-edit", edit);
26432
26474
  app.component("el-icon-minus", minus);
@@ -26441,13 +26483,13 @@ function registerIcon(app) {
26441
26483
  if (typeof window !== "undefined") {
26442
26484
  let loadSvg = function() {
26443
26485
  var body = document.body;
26444
- var svgDom = document.getElementById("__svg__icons__dom__1779273154047__");
26486
+ var svgDom = document.getElementById("__svg__icons__dom__1779273901379__");
26445
26487
  if (!svgDom) {
26446
26488
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26447
26489
  svgDom.style.position = "absolute";
26448
26490
  svgDom.style.width = "0";
26449
26491
  svgDom.style.height = "0";
26450
- svgDom.id = "__svg__icons__dom__1779273154047__";
26492
+ svgDom.id = "__svg__icons__dom__1779273901379__";
26451
26493
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26452
26494
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26453
26495
  }
@@ -62208,6 +62250,7 @@ const _sfc_main$6 = {
62208
62250
  const tableRef = this.$refs.tableRef;
62209
62251
  const selection = tableRef && typeof tableRef.getSelectionRows === "function" ? tableRef.getSelectionRows() : [];
62210
62252
  if (!selection || selection.length === 0) {
62253
+ this.$message.error(`\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u8D44\u4EA7`);
62211
62254
  return;
62212
62255
  }
62213
62256
  const arr = [...this.selectedRows, ...selection].reduce((acc, item) => {
@@ -62592,7 +62635,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
62592
62635
  _: 1
62593
62636
  }, 8, ["modelValue", "onClose"]);
62594
62637
  }
62595
- var AssetDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-0c6d23e8"]]);
62638
+ var AssetDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-4c34c6a0"]]);
62596
62639
  var index_vue_vue_type_style_index_0_lang$1 = "";
62597
62640
  const _sfc_main$5 = {
62598
62641
  name: "asset-select-widget",