mooho-base-admin-plus 2.10.50 → 2.10.52

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
@@ -221,3 +221,5 @@ mooho-base-admin-plus@2.10.47 - Excel表格验证等
221
221
  mooho-base-admin-plus@2.10.48 - int类型可以显示千分位
222
222
  mooho-base-admin-plus@2.10.49 - Excel表格bug修复
223
223
  mooho-base-admin-plus@2.10.50 - 修复Excel表格验证功能
224
+ mooho-base-admin-plus@2.10.51 - Excel表格增加Refresh方法,组件增加事件声明
225
+ mooho-base-admin-plus@2.10.52 - 修复上一版本的bug
@@ -39282,6 +39282,7 @@ const formSetting = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_re
39282
39282
  }, Symbol.toStringTag, { value: "Module" })), _sfc_main$t = {
39283
39283
  mixins: [mixinPage],
39284
39284
  components: { formSetting, formSettingLayout },
39285
+ emits: ["on-after-save", "on-before-save", "on-blur", "on-change", "on-close"],
39285
39286
  data() {
39286
39287
  return {
39287
39288
  opened: !1,
@@ -39510,6 +39511,10 @@ const formSetting = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_re
39510
39511
  onReady(a) {
39511
39512
  this.formView = a;
39512
39513
  },
39514
+ // 输入框失去焦点事件
39515
+ onBlur(a) {
39516
+ this.$emit("on-blur", a);
39517
+ },
39513
39518
  onVisibleChange(a) {
39514
39519
  a || (this.$refs.form.reset(), this.$emit("on-close"));
39515
39520
  },
@@ -39670,7 +39675,8 @@ function _sfc_render$t(a, r, o, s, l, c) {
39670
39675
  defaultData: o.defaultData,
39671
39676
  "setting-enable": o.settingEnable,
39672
39677
  onOnChange: c.onChange,
39673
- onOnReady: c.onReady
39678
+ onOnReady: c.onReady,
39679
+ onOnBlur: c.onBlur
39674
39680
  }, {
39675
39681
  top: withCtx(({ form: y }) => [
39676
39682
  renderSlot(a.$slots, "top", { form: y })
@@ -39713,7 +39719,7 @@ function _sfc_render$t(a, r, o, s, l, c) {
39713
39719
  renderSlot(a.$slots, "bottom", { form: y })
39714
39720
  ]),
39715
39721
  _: 3
39716
- }, 8, ["view-code", "readonly", "defaultData", "setting-enable", "onOnChange", "onOnReady"])
39722
+ }, 8, ["view-code", "readonly", "defaultData", "setting-enable", "onOnChange", "onOnReady", "onOnBlur"])
39717
39723
  ])
39718
39724
  ]),
39719
39725
  _: 3
@@ -39740,6 +39746,7 @@ const modalForm = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_rend
39740
39746
  }, Symbol.toStringTag, { value: "Module" })), _sfc_main$s = {
39741
39747
  mixins: [mixinPage],
39742
39748
  components: {},
39749
+ emits: ["after-init", "create", "on-close", "edit", "on-blur", "on-cell-click", "on-change", "on-load-data", "on-row-click", "on-row-dblclick", "on-select-change", "show"],
39743
39750
  data() {
39744
39751
  return {
39745
39752
  opened: !1,
@@ -40145,6 +40152,18 @@ const modalForm = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_rend
40145
40152
  },
40146
40153
  setFullscreen(a) {
40147
40154
  this.$refs.table.isMaxHight = a, this.isFullscreen = a;
40155
+ },
40156
+ // 失去焦点事件
40157
+ onBlur(a, r) {
40158
+ this.$emit("on-blur", a, r);
40159
+ },
40160
+ // 变更事件
40161
+ onChange(a, r, o) {
40162
+ this.$emit("on-change", a, r, o);
40163
+ },
40164
+ // 选中项变化事件
40165
+ onSelectChange() {
40166
+ this.$emit("on-select-change");
40148
40167
  }
40149
40168
  }
40150
40169
  }, _hoisted_1$k = { class: "title" }, _hoisted_2$f = { class: "description" }, _hoisted_3$d = { class: "ivu-ml-8 ivu-mr-8" };
@@ -40234,6 +40253,8 @@ function _sfc_render$s(a, r, o, s, l, c) {
40234
40253
  onCreate: c.create,
40235
40254
  onEdit: c.edit,
40236
40255
  onShow: c.show,
40256
+ onOnBlur: c.onBlur,
40257
+ onOnChange: c.onChange,
40237
40258
  onOnReady: c.onReady,
40238
40259
  onOnLoadData: c.onLoadData,
40239
40260
  onAfterInit: c.afterInit,
@@ -40241,7 +40262,8 @@ function _sfc_render$s(a, r, o, s, l, c) {
40241
40262
  onOnCurrentChange: r[5] || (r[5] = (p, g) => a.$emit("on-current-change", p, g)),
40242
40263
  onOnRowClick: c.onRowClick,
40243
40264
  onOnRowDblclick: c.onRowDblclick,
40244
- onOnCellClick: c.onCellClick
40265
+ onOnCellClick: c.onCellClick,
40266
+ onOnSelectChange: c.onSelectChange
40245
40267
  }, {
40246
40268
  top: withCtx(() => [
40247
40269
  renderSlot(a.$slots, "top")
@@ -40287,7 +40309,7 @@ function _sfc_render$s(a, r, o, s, l, c) {
40287
40309
  })
40288
40310
  ]),
40289
40311
  _: 3
40290
- }, 8, ["view-code", "static", "setting-enable", "select-enable", "check-cross-page", "tree-enable", "tree-load", "has-children", "create-enable", "edit-enable", "show-enable", "remove-enable", "draggable", "filter-enable", "page-enable", "embedded", "before-load-data", "on-search", "summary-method", "page-size-opts", "span-method", "load-data-enable", "row-class-name", "highlight-row", "returnColumns", "onCreate", "onEdit", "onShow", "onOnReady", "onOnLoadData", "onAfterInit", "onOnRowClick", "onOnRowDblclick", "onOnCellClick"])
40312
+ }, 8, ["view-code", "static", "setting-enable", "select-enable", "check-cross-page", "tree-enable", "tree-load", "has-children", "create-enable", "edit-enable", "show-enable", "remove-enable", "draggable", "filter-enable", "page-enable", "embedded", "before-load-data", "on-search", "summary-method", "page-size-opts", "span-method", "load-data-enable", "row-class-name", "highlight-row", "returnColumns", "onCreate", "onEdit", "onShow", "onOnBlur", "onOnChange", "onOnReady", "onOnLoadData", "onAfterInit", "onOnRowClick", "onOnRowDblclick", "onOnCellClick", "onOnSelectChange"])
40291
40313
  ])
40292
40314
  ]),
40293
40315
  _: 3
@@ -41484,6 +41506,7 @@ const tableSetting = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_r
41484
41506
  }, Symbol.toStringTag, { value: "Module" })), _sfc_main$p = {
41485
41507
  mixins: [mixin$2, mixinPage],
41486
41508
  components: { richEditor, uploadAttachment, uploadImage, CheckGroup },
41509
+ emits: ["on-blur", "on-change", "on-ready"],
41487
41510
  data() {
41488
41511
  return {
41489
41512
  formView: {},
@@ -103640,7 +103663,7 @@ registerAllModules();
103640
103663
  const _sfc_main$o = {
103641
103664
  mixins: [mixin$2, mixinPage],
103642
103665
  components: { HotTable, tableSetting },
103643
- emits: ["onChange"],
103666
+ emits: ["after-init", "on-change", "on-load-data"],
103644
103667
  data() {
103645
103668
  return {
103646
103669
  inited: !1,
@@ -103668,7 +103691,6 @@ const _sfc_main$o = {
103668
103691
  licenseKey: "non-commercial-and-evaluation"
103669
103692
  },
103670
103693
  coords: {},
103671
- data: [],
103672
103694
  staticData: [],
103673
103695
  setting: !1,
103674
103696
  tableSettingActive: !1,
@@ -103735,7 +103757,11 @@ const _sfc_main$o = {
103735
103757
  default: null
103736
103758
  }
103737
103759
  },
103738
- computed: {},
103760
+ computed: {
103761
+ data() {
103762
+ return this.staticData;
103763
+ }
103764
+ },
103739
103765
  watch: {
103740
103766
  // value() {
103741
103767
  // if (this.embedded) {
@@ -103768,11 +103794,11 @@ const _sfc_main$o = {
103768
103794
  typeof o == "function" ? o() : this.error("Front_Msg_View_Code_Not_Exist|" + a);
103769
103795
  return;
103770
103796
  }
103771
- if (this.tableView = s.dataView, this.tableView.columns = s.viewColumns, console.log("this.$refs.table.hotInstance", this.$refs.table.hotInstance), Handsontable.validators.registerValidator("text-required", (l, c) => {
103797
+ if (this.tableView = s.dataView, this.tableView.columns = s.viewColumns, Handsontable.validators.registerValidator("text-required", (l, c) => {
103772
103798
  (l || "").trim() ? c(!0) : c(!1);
103773
103799
  }), Handsontable.validators.registerValidator("numeric-required", (l, c) => {
103774
103800
  l == null ? c(!1) : Handsontable.validators.NumericValidator(l, c);
103775
- }), console.log("Handsontable.validators.NumericValidator", Handsontable.validators.DateValidator), Handsontable.validators.registerValidator("date-required", (l, c) => {
103801
+ }), Handsontable.validators.registerValidator("date-required", (l, c) => {
103776
103802
  (l || "").trim() ? Handsontable.validators.DateValidator.apply({ instance: this.$refs.table.hotInstance }, [l, c]) : c(!1);
103777
103803
  }), Handsontable.validators.registerValidator("select-required", (l, c) => {
103778
103804
  (l || "").trim() ? Handsontable.validators.AutocompleteValidator(l, c) : c(!1);
@@ -103863,7 +103889,7 @@ const _sfc_main$o = {
103863
103889
  let d = c[0].start.row;
103864
103890
  if (d > 0) {
103865
103891
  let f = this.$refs.table.hotInstance.getSourceData(), p = f.splice(d, 1);
103866
- f.splice(d - 1, 0, p[0]), this.$refs.table.hotInstance.loadData(f);
103892
+ f.splice(d - 1, 0, p[0]), this.$refs.table.hotInstance.updateData(f);
103867
103893
  }
103868
103894
  }
103869
103895
  }, this.hotSetting.contextMenu.items.move_down = {
@@ -103872,33 +103898,28 @@ const _sfc_main$o = {
103872
103898
  let d = c[0].start.row, f = this.$refs.table.hotInstance.getSourceData();
103873
103899
  if (d < f.length - 1) {
103874
103900
  let p = f.splice(d, 1);
103875
- f.splice(d + 1, 0, p[0]), this.$refs.table.hotInstance.loadData(f);
103901
+ f.splice(d + 1, 0, p[0]), this.$refs.table.hotInstance.updateData(f);
103876
103902
  }
103877
103903
  }
103878
103904
  }), this.tableView.removeEnable && (this.hotSetting.contextMenu.items.remove_row = {
103879
103905
  name: "整行删除",
103880
103906
  callback: (l, c, u) => {
103881
- let d = [], f = [], p = [], g = this.$refs.table.hotInstance.getSourceData();
103882
- for (const v of c) {
103883
- let y = v.start.row, _ = v.end.row;
103884
- d.push([y, _ - y + 1]);
103885
- for (let S = y; S <= _; S++)
103886
- p.push(S);
103887
- for (let S = y; S < _; S++)
103888
- g[S].id && f.push(g[S].id);
103907
+ let d = [], f = [], p = this.$refs.table.hotInstance.getSourceData();
103908
+ for (const g of c) {
103909
+ let v = g.start.row, y = g.end.row;
103910
+ d.push([v, y - v + 1]);
103911
+ for (let _ = v; _ < y; _++)
103912
+ p[_].id && f.push(p[_].id);
103889
103913
  }
103890
103914
  this.confirm("确定要删除该行吗?", async () => {
103891
- let v = !0;
103892
- this.$emit("on-remove", p, (y) => {
103893
- v = y;
103894
- }), v && this.$refs.table.hotInstance.alter("remove_row", d);
103915
+ this.$refs.table.hotInstance.alter("remove_row", d);
103895
103916
  });
103896
103917
  }
103897
103918
  })), this.$refs.table.hotInstance.addHook("afterChange", (l) => {
103898
103919
  l && l.forEach(([c, u, d, f]) => {
103899
- !this.readonly && this.tableView.createEnable && c == this.data.length - 1 && (d ?? "") != (f ?? "") && this.data.push(this.getDefaultData());
103920
+ !this.readonly && this.tableView.createEnable && c == this.staticData.length - 1 && (d ?? "") != (f ?? "") && this.staticData.push(this.getDefaultData());
103900
103921
  let p = this.columns.find((g) => g.code == u);
103901
- 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);
103922
+ p.controlType != "DialogSelect" && this.onDataChange(this.staticData[c], p), p.controlType == "Select" && (p.selectOptions.some((g) => g == f) || (this.staticData[c][p.code] = null)), this.calc(this.staticData[c]), this.$refs.table.hotInstance.updateData(this.staticData);
103902
103923
  });
103903
103924
  }), this.$refs.table.hotInstance.addHook("beforePaste", (l, c) => {
103904
103925
  let u = this.columns.filter((d) => !!(d.parentCode || "").trim() || this.columns.filter((f) => f.parentCode == d.code).length == 0);
@@ -103921,16 +103942,24 @@ const _sfc_main$o = {
103921
103942
  a && (this.staticData = this.copy(a), this.staticData.forEach((r) => {
103922
103943
  for (let o in r)
103923
103944
  r[o] != null && this.columns.some((s) => s.code === o && s.controlType === "Date") && (r[o] = format$6(new Date(r[o]), "yyyy-MM-dd"));
103924
- })), this.data = this.staticData, !this.readonly && a && this.tableView.createEnable && this.data.push(this.getDefaultData());
103925
- for (let r = 0; r < this.data.length; r++)
103926
- this.calc(this.data[r]);
103927
- this.$refs.table.hotInstance.loadData(this.data), setTimeout(() => {
103945
+ })), !this.readonly && a && this.tableView.createEnable && this.staticData.push(this.getDefaultData());
103946
+ for (let r = 0; r < this.staticData.length; r++)
103947
+ this.calc(this.staticData[r]);
103948
+ this.$refs.table.hotInstance.loadData(this.staticData), setTimeout(() => {
103928
103949
  this.$refs.table.hotInstance.render();
103929
103950
  }), this.$emit("on-load-data"), a && this.$emit("on-change", null, null, null);
103930
103951
  }
103931
103952
  },
103932
103953
  /**
103933
- * 必填验证
103954
+ * 刷新
103955
+ *
103956
+ * @public
103957
+ */
103958
+ refresh() {
103959
+ this.$refs.table.hotInstance.updateData(this.staticData);
103960
+ },
103961
+ /**
103962
+ * 验证
103934
103963
  *
103935
103964
  * @public
103936
103965
  */
@@ -103938,8 +103967,7 @@ const _sfc_main$o = {
103938
103967
  let a = [];
103939
103968
  for (let o = 0; o < this.staticData.length - 1; o++)
103940
103969
  a.push(o);
103941
- return console.log("rows", a), this.$refs.table.hotInstance.validateRows(a, (o) => {
103942
- console.log("valid", o);
103970
+ return this.$refs.table.hotInstance.validateRows(a, (o) => {
103943
103971
  }) ? !0 : (this.error("Front_Msg_Form_Validate_Fail"), !1);
103944
103972
  },
103945
103973
  /**
@@ -103984,7 +104012,7 @@ const _sfc_main$o = {
103984
104012
  },
103985
104013
  // 行数据
103986
104014
  rowData(a, r) {
103987
- return this.data[r];
104015
+ return this.staticData[r];
103988
104016
  },
103989
104017
  // 获取多语言名称
103990
104018
  getNameI18n(a) {
@@ -103999,7 +104027,7 @@ const _sfc_main$o = {
103999
104027
  },
104000
104028
  // 清空数据
104001
104029
  clear() {
104002
- this.staticData = [], this.data = [];
104030
+ this.staticData = [];
104003
104031
  },
104004
104032
  // 弹出选择框选中
104005
104033
  dialogCheck(a) {
@@ -104087,6 +104115,21 @@ var getColumns = (a, r, o) => {
104087
104115
  const _sfc_main$n = {
104088
104116
  mixins: [mixin$2, mixinPage],
104089
104117
  components: { tableFilter, tableSetting, filterSetting },
104118
+ emits: [
104119
+ "after-init",
104120
+ "create",
104121
+ "edit",
104122
+ "on-blur",
104123
+ "on-cell-click",
104124
+ "on-change",
104125
+ "on-load-data",
104126
+ "on-ready",
104127
+ "on-remove",
104128
+ "on-row-click",
104129
+ "on-row-dblclick",
104130
+ "on-select-change",
104131
+ "show"
104132
+ ],
104090
104133
  data() {
104091
104134
  return {
104092
104135
  inited: !1,
@@ -106007,7 +106050,7 @@ function _sfc_render$n(a, r, o, s, l, c) {
106007
106050
  ], 2)
106008
106051
  ], 2);
106009
106052
  }
106010
- const viewTable = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-11022622"]]), __vite_glob_1_33 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
106053
+ const viewTable = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-930f280f"]]), __vite_glob_1_33 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
106011
106054
  __proto__: null,
106012
106055
  default: viewTable
106013
106056
  }, Symbol.toStringTag, { value: "Module" })), _sfc_main$m = {