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
|
|
39705
|
-
if ((
|
|
39706
|
-
let
|
|
39707
|
-
(
|
|
39708
|
-
}
|
|
39709
|
-
if ((
|
|
39710
|
-
let
|
|
39711
|
-
(
|
|
39712
|
-
}
|
|
39713
|
-
if ((
|
|
39714
|
-
let
|
|
39715
|
-
if (
|
|
39716
|
-
let
|
|
39717
|
-
if (
|
|
39718
|
-
let
|
|
39719
|
-
|
|
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
|
|
39728
|
-
|
|
39729
|
-
this.$emit("on-change", r,
|
|
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
|
|
39735
|
-
if ((
|
|
39736
|
-
let
|
|
39737
|
-
|
|
39738
|
-
let
|
|
39739
|
-
(!r ||
|
|
39740
|
-
let
|
|
39741
|
-
|
|
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(
|
|
39745
|
-
!
|
|
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
|
|
39748
|
-
if (
|
|
39747
|
+
let u = this.columns.filter((c) => c.needRefresh == !0 || c.needClear == !0)[0];
|
|
39748
|
+
if (u == null)
|
|
39749
39749
|
break;
|
|
39750
|
-
if (
|
|
39751
|
-
this.setData(this.data,
|
|
39752
|
-
|
|
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 (
|
|
39755
|
-
let
|
|
39756
|
-
if (
|
|
39757
|
-
|
|
39758
|
-
|
|
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 && (
|
|
39761
|
-
this.setData(this.data,
|
|
39762
|
-
|
|
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 (
|
|
39765
|
-
let
|
|
39766
|
-
(
|
|
39767
|
-
...
|
|
39768
|
-
...JSON.parse(
|
|
39769
|
-
}),
|
|
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
|
-
|
|
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", {
|