mooho-base-admin-plus 2.5.31 → 2.5.33

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/history.md CHANGED
@@ -125,3 +125,5 @@ mooho-base-admin-plus@2.5.28 - form增加tables属性
125
125
  mooho-base-admin-plus@2.5.29 - 修复升级后出现的警告
126
126
  mooho-base-admin-plus@2.5.30 - 修复表格勾选后修改数据勾选消失的bug
127
127
  mooho-base-admin-plus@2.5.31 - 修复选择框筛选布尔值的bug
128
+ mooho-base-admin-plus@2.5.32 - 重新发布
129
+ mooho-base-admin-plus@2.5.33 - 表单内嵌套表格change事件增加参数
@@ -38101,7 +38101,7 @@ const modalTable = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
38101
38101
  }) : r.dataType == "Decimal" || r.dataType == "Float" || r.dataType == "Double" ? r.dataSource.push({
38102
38102
  id: parseFloat(o),
38103
38103
  name: s
38104
- }) : r.dataType == "Boolean" ? r.dataSource.push({
38104
+ }) : r.dataType == "Boolean" && (r.controlType == "Check" || r.controlType == "Switch") ? r.dataSource.push({
38105
38105
  id: o.toUpperCase() == "TRUE",
38106
38106
  name: s
38107
38107
  }) : r.dataSource.push({
@@ -39700,76 +39700,76 @@ const tableSetting = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_r
39700
39700
  this.onDataChange(r, s);
39701
39701
  },
39702
39702
  // 数据变化事件
39703
- async onDataChange(r, a) {
39704
- for (let o of this.columns) {
39705
- if ((o.showJson || "").trim()) {
39706
- let s = JSON.parse(o.showJson);
39707
- (s.type == "Condition" || s.type == "Expression") && (o.isShow = this.judgeCondition(s, this.data));
39708
- }
39709
- if ((o.readonlyJson || "").trim()) {
39710
- let s = JSON.parse(o.readonlyJson);
39711
- (s.type == "Condition" || s.type == "Expression") && (o.isReadonly = this.judgeCondition(s, this.data));
39712
- }
39713
- if ((o.requiredJson || "").trim()) {
39714
- let s = JSON.parse(o.requiredJson);
39715
- if (s.type == "Condition" || s.type == "Expression") {
39716
- let l = o.isRequired;
39717
- if (o.isRequired = this.judgeCondition(s, this.data), l != o.isRequired) {
39718
- let u = this.$refs.form.fields.find((c) => c.prop == o.code);
39719
- u != null && (u.isRequired = o.isRequired, o.isRequired || (u.validateState = "", u.validateMessage = ""));
39703
+ async onDataChange(r, a, o, s, l) {
39704
+ for (let u of this.columns) {
39705
+ if ((u.showJson || "").trim()) {
39706
+ let c = JSON.parse(u.showJson);
39707
+ (c.type == "Condition" || c.type == "Expression") && (u.isShow = this.judgeCondition(c, this.data));
39708
+ }
39709
+ if ((u.readonlyJson || "").trim()) {
39710
+ let c = JSON.parse(u.readonlyJson);
39711
+ (c.type == "Condition" || c.type == "Expression") && (u.isReadonly = this.judgeCondition(c, this.data));
39712
+ }
39713
+ if ((u.requiredJson || "").trim()) {
39714
+ let c = JSON.parse(u.requiredJson);
39715
+ if (c.type == "Condition" || c.type == "Expression") {
39716
+ let d = u.isRequired;
39717
+ if (u.isRequired = this.judgeCondition(c, this.data), d != u.isRequired) {
39718
+ let f = this.$refs.form.fields.find((p) => p.prop == u.code);
39719
+ f != null && (f.isRequired = u.isRequired, u.isRequired || (f.validateState = "", f.validateMessage = ""));
39720
39720
  }
39721
39721
  }
39722
39722
  }
39723
39723
  }
39724
39724
  if (r != null && r.controlType == "Table")
39725
- this.$emit("on-change", r, null, null, this.$refs["table_" + r.code][0].data);
39725
+ this.$emit("on-change", r, null, null, this.$refs["table_" + r.code][0].data, o, s, l);
39726
39726
  else if (r != null) {
39727
- let o = this.parseData(this.dataBefore, r.code), s = this.parseData(this.data, r.code);
39728
- o !== s && setTimeout(() => {
39729
- this.$emit("on-change", r, o, s, a);
39727
+ let u = this.parseData(this.dataBefore, r.code), c = this.parseData(this.data, r.code);
39728
+ u !== c && setTimeout(() => {
39729
+ this.$emit("on-change", r, u, c, a);
39730
39730
  });
39731
39731
  } else
39732
39732
  this.$emit("on-change", r, null, null, a);
39733
39733
  this.dataBefore = this.copy(this.data);
39734
- for (let o of this.columns)
39735
- if ((o.calculate || "").trim()) {
39736
- let s = o.calculate;
39737
- s = this.calcStat("sum", s), s = this.calcStat("min", s), s = this.calcStat("max", s), s = this.calcStat("avg", s);
39738
- let l = this.getTriggers(s);
39739
- (!r || l.some((u) => u == r.code) || o.calculate != s) && setTimeout(() => {
39740
- let u = this.calculate(s, this.data);
39741
- o.digit != null && (u = this.keepDecimal(u, o.digit, o.fixedDigit)), this.setData(this.data, o.code, u);
39734
+ for (let u of this.columns)
39735
+ if ((u.calculate || "").trim()) {
39736
+ let c = u.calculate;
39737
+ c = this.calcStat("sum", c), c = this.calcStat("min", c), c = this.calcStat("max", c), c = this.calcStat("avg", c);
39738
+ let d = this.getTriggers(c);
39739
+ (!r || d.some((f) => f == r.code) || u.calculate != c) && setTimeout(() => {
39740
+ let f = this.calculate(c, this.data);
39741
+ u.digit != null && (f = this.keepDecimal(f, u.digit, u.fixedDigit)), this.setData(this.data, u.code, f);
39742
39742
  });
39743
39743
  }
39744
- for ((r == null || r.triggers && r.triggers !== []) && this.columns.forEach(function(o) {
39745
- !o.isStaticItem && (o.source || "").trim() && !(o.dataType && o.dataType.startsWith("Enum:")) && (r == null || r.triggers.some((s) => s.code == o.code)) && (o.needRefresh = !0);
39744
+ for ((r == null || r.triggers && r.triggers !== []) && this.columns.forEach(function(u) {
39745
+ !u.isStaticItem && (u.source || "").trim() && !(u.dataType && u.dataType.startsWith("Enum:")) && (r == null || r.triggers.some((c) => c.code == u.code)) && (u.needRefresh = !0);
39746
39746
  }); ; ) {
39747
- let o = this.columns.filter((s) => s.needRefresh == !0 || s.needClear == !0)[0];
39748
- if (o == null)
39747
+ let u = this.columns.filter((c) => c.needRefresh == !0 || c.needClear == !0)[0];
39748
+ if (u == null)
39749
39749
  break;
39750
- if (o.needClear && this.parseData(this.data, o.code) != null)
39751
- this.setData(this.data, o.code, null), o.triggers.forEach((s) => {
39752
- s.needClear = !0;
39750
+ if (u.needClear && this.parseData(this.data, u.code) != null)
39751
+ this.setData(this.data, u.code, null), u.triggers.forEach((c) => {
39752
+ c.needClear = !0;
39753
39753
  });
39754
- else if (o.needRefresh && (o.source || "").trim() && !(o.dataType && o.dataType.startsWith("Enum:"))) {
39755
- let s = this.getParam(this.data, o);
39756
- if (o.controlType === "Select" || o.controlType === "MultiSelect" || o.controlType === "TreeSelect" || o.controlType === "MultiTreeSelect" || o.controlType === "SelectWithOther" || o.controlType === "ComboSelect" || o.controlType === "MultiComboSelect" || o.controlType === "Radio" || o.controlType === "CheckGroup")
39757
- s != null ? this.fillDataSource(this.data, o, s) : (o.dataSource = [], this.setData(this.data, o.code, null), o.triggers.forEach((l) => {
39758
- l.needClear = !0;
39754
+ else if (u.needRefresh && (u.source || "").trim() && !(u.dataType && u.dataType.startsWith("Enum:"))) {
39755
+ let c = this.getParam(this.data, u);
39756
+ if (u.controlType === "Select" || u.controlType === "MultiSelect" || u.controlType === "TreeSelect" || u.controlType === "MultiTreeSelect" || u.controlType === "SelectWithOther" || u.controlType === "ComboSelect" || u.controlType === "MultiComboSelect" || u.controlType === "Radio" || u.controlType === "CheckGroup")
39757
+ c != null ? this.fillDataSource(this.data, u, c) : (u.dataSource = [], this.setData(this.data, u.code, null), u.triggers.forEach((d) => {
39758
+ d.needClear = !0;
39759
39759
  }));
39760
- else if (r && (o.controlType === "DialogSelect" || o.controlType === "MultiDialogSelect"))
39761
- this.setData(this.data, o.code, null), o.triggers.forEach((l) => {
39762
- l.needClear = !0;
39760
+ else if (r && (u.controlType === "DialogSelect" || u.controlType === "MultiDialogSelect"))
39761
+ this.setData(this.data, u.code, null), u.triggers.forEach((d) => {
39762
+ d.needClear = !0;
39763
39763
  });
39764
- else if (o.controlType === "List" && s != null) {
39765
- let l, u = this.$refs["list_" + o.code][0].tableView, c = u.filtering;
39766
- (c || "").trim() && (s = {
39767
- ...s,
39768
- ...JSON.parse(c)
39769
- }), o.isSourceCustom ? l = await customModelApi.query(o.sourceModel, s) : l = await modelApi.query(o.sourceModel, s, u.functionName, u.functionType), this.$refs["list_" + o.code][0].loadData(l.data);
39764
+ else if (u.controlType === "List" && c != null) {
39765
+ let d, f = this.$refs["list_" + u.code][0].tableView, p = f.filtering;
39766
+ (p || "").trim() && (c = {
39767
+ ...c,
39768
+ ...JSON.parse(p)
39769
+ }), u.isSourceCustom ? d = await customModelApi.query(u.sourceModel, c) : d = await modelApi.query(u.sourceModel, c, f.functionName, f.functionType), this.$refs["list_" + u.code][0].loadData(d.data);
39770
39770
  }
39771
39771
  }
39772
- o.needClear = !1, o.needRefresh = !1;
39772
+ u.needClear = !1, u.needRefresh = !1;
39773
39773
  }
39774
39774
  },
39775
39775
  // 输入框失去焦点事件
@@ -39928,7 +39928,7 @@ function _sfc_render$o(r, a, o, s, l, u) {
39928
39928
  readonly: o.readonly || L.isReadonly,
39929
39929
  embedded: !0,
39930
39930
  "parent-data": l.data,
39931
- onOnChange: (H) => u.onDataChange(L)
39931
+ onOnChange: (H, Z, ae) => u.onDataChange(L, null, H, Z, ae)
39932
39932
  }, {
39933
39933
  column: withCtx((H) => [
39934
39934
  renderSlot(r.$slots, "tableColumn", {