mooho-base-admin-plus 2.10.45 → 2.10.47

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
@@ -216,3 +216,5 @@ mooho-base-admin-plus@2.10.42 - Excel表格只读
216
216
  mooho-base-admin-plus@2.10.43 - 修复上一版本的bug
217
217
  mooho-base-admin-plus@2.10.44 - 修复上一版本的bug
218
218
  mooho-base-admin-plus@2.10.45 - 修复上一版本的bug
219
+ mooho-base-admin-plus@2.10.46 - 修复上一版本的bug
220
+ mooho-base-admin-plus@2.10.47 - Excel表格验证等
@@ -41886,7 +41886,6 @@ const tableSetting = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_r
41886
41886
  },
41887
41887
  // 数据变化事件
41888
41888
  async onDataChange(a, r, o, s, l) {
41889
- console.log("onDataChange", a, r, o, s, l);
41890
41889
  for (let c of this.columns) {
41891
41890
  if ((c.showJson || "").trim()) {
41892
41891
  let u = JSON.parse(c.showJson);
@@ -103210,7 +103209,7 @@ const _sfc_main$o = {
103210
103209
  if (this.coords = r, a.detail === 2 && r.row >= 0 && !this.readonly) {
103211
103210
  let o = this.hotSetting.columns[r.col], s = this.$refs.table.hotInstance.getSourceData();
103212
103211
  o.controlType === "DialogSelect" && !o.readonly && this.$refs.dialogTable.init(o.source, () => {
103213
- this.$refs.dialogTable.open(this.getParam(s[r.row], o));
103212
+ this.$refs.dialogTable.open(this.getParam(s[r.row], o, this.parentData));
103214
103213
  });
103215
103214
  }
103216
103215
  });
@@ -103307,7 +103306,7 @@ const _sfc_main$o = {
103307
103306
  if (l.controlType === "Label" || l.isReadonly == !0)
103308
103307
  c.readOnly = !0;
103309
103308
  else if (l.controlType === "NumberInput")
103310
- c.type = "numeric", c.numericFormat = "0%";
103309
+ c.type = "numeric";
103311
103310
  else if (l.controlType === "Check")
103312
103311
  c.type = "checkbox";
103313
103312
  else if (l.controlType === "Select") {
@@ -103406,16 +103405,20 @@ const _sfc_main$o = {
103406
103405
  let v = !0;
103407
103406
  this.$emit("on-remove", p, (y) => {
103408
103407
  v = y;
103409
- }), console.log(v), v && this.$refs.table.hotInstance.alter("remove_row", d);
103408
+ }), v && this.$refs.table.hotInstance.alter("remove_row", d);
103410
103409
  });
103411
103410
  }
103412
103411
  })), this.$refs.table.hotInstance.addHook("afterChange", (l) => {
103413
- l && (l.forEach(([c, u, d, f]) => {
103414
- !this.readonly && this.tableView.createEnable && c == this.data.length - 1 && (d ?? "") != (f ?? "") && (this.data.push(this.getDefaultData()), this.$refs.table.hotInstance.loadData(this.data)), this.onDataChange(
103415
- this.data[c],
103416
- this.columns.find((p) => p.code == u)
103417
- );
103418
- }), this.loadData());
103412
+ l && l.forEach(([c, u, d, f]) => {
103413
+ !this.readonly && this.tableView.createEnable && c == this.data.length - 1 && (d ?? "") != (f ?? "") && this.data.push(this.getDefaultData());
103414
+ let p = this.columns.find((g) => g.code == u);
103415
+ p.controlType != "DialogSelect" && this.onDataChange(this.data[c], p), p.controlType == "Select" && (p.selectOptions.some((g) => g == f) || (this.data[c][p.code] = null)), this.calc(this.data[c]), this.$refs.table.hotInstance.updateData(this.data);
103416
+ });
103417
+ }), this.$refs.table.hotInstance.addHook("beforePaste", (l, c) => {
103418
+ let u = this.columns.filter((d) => !!(d.parentCode || "").trim() || this.columns.filter((f) => f.parentCode == d.code).length == 0);
103419
+ for (let d = c[0].startCol; d < c[0].startCol + l[0].length; d++)
103420
+ for (let f = c[0].startRow; f < c[0].startRow + l.length; f++)
103421
+ l[f - c[0].startRow][d - c[0].startCol] != null && (l[f - c[0].startRow][d - c[0].startCol] = l[f - c[0].startRow][d - c[0].startCol].trim(), u[d].controlType == "NumberInput" && (l[f - c[0].startRow][d - c[0].startCol] = l[f - c[0].startRow][d - c[0].startCol].replace(/,/g, "")));
103419
103422
  }), this.loadData([]), this.inited = !0, setTimeout(() => {
103420
103423
  typeof r == "function" && r();
103421
103424
  });
@@ -103446,19 +103449,19 @@ const _sfc_main$o = {
103446
103449
  * @public
103447
103450
  */
103448
103451
  validate() {
103449
- for (let a = 0; a < this.staticData.length; a++) {
103452
+ for (let a = 0; a < this.staticData.length - 1; a++) {
103450
103453
  let r = this.staticData[a];
103451
103454
  for (let o = 0; o < this.columns.length; o++) {
103452
103455
  let s = this.columns[o], l = this.parseData(r, s.code);
103453
- if (s.slot == "normal" && !(r._isShow && r._isShow[s.code] == !1) && s.isShow != !1) {
103456
+ if (s.isShow != !1) {
103454
103457
  if (s.isRequired && (l == null || !(String(l) || "").trim()))
103455
- return this.error("Front_Msg_Row_Column_Required|" + (a + 1) + "|" + name), !1;
103458
+ return this.error("Front_Msg_Row_Column_Required|" + (a + 1) + "|" + s.name), !1;
103456
103459
  if (s.maxValue != null && !isNaN(l) && l > s.maxValue)
103457
- return this.error("Front_Msg_Row_Validation_Max_Value|" + (a + 1) + "|" + name + "|" + s.maxValue.toString()), !1;
103460
+ return this.error("Front_Msg_Row_Validation_Max_Value|" + (a + 1) + "|" + s.name + "|" + s.maxValue.toString()), !1;
103458
103461
  if (s.minValue != null && !isNaN(l) && l < s.minValue)
103459
- return this.error("Front_Msg_Row_Validation_Min_Value|" + (a + 1) + "|" + name + "|" + s.minValue.toString()), !1;
103462
+ return this.error("Front_Msg_Row_Validation_Min_Value|" + (a + 1) + "|" + s.name + "|" + s.minValue.toString()), !1;
103460
103463
  if ((s.pattern || "").trim() && l != null && new RegExp(s.pattern).test(l) == !1)
103461
- return this.error("Front_Msg_Row_Validation_Pattern|" + (a + 1) + "|" + name + "|" + s.pattern), !1;
103464
+ return this.error("Front_Msg_Row_Validation_Pattern|" + (a + 1) + "|" + s.name + "|" + s.pattern), !1;
103462
103465
  }
103463
103466
  }
103464
103467
  }