mooho-base-admin-plus 2.4.27 → 2.4.29

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
@@ -59,3 +59,7 @@
59
59
  2.4.25 - 增加上传文件大小限制
60
60
  2.4.26 - 优化计算列,避免转换对象
61
61
  2.4.27 - 优化标题默认样式
62
+ 2.4.28 - 修复可筛选下拉框选中内容会跳回原值的bug
63
+ 2.4.29 - 修复新增、修改开放接口用户密码未加密的bug
64
+ 2.4.30 - 批量选择支持默认值
65
+ 2.4.31 - 增加自定义功能导入导出
@@ -22597,6 +22597,20 @@ var customPageApi = {
22597
22597
  id
22598
22598
  }
22599
22599
  });
22600
+ },
22601
+ async exportFile(ids) {
22602
+ const result2 = await service({
22603
+ url: `api/${res$j}/exportFile`,
22604
+ method: "post",
22605
+ responseType: "blob",
22606
+ data: {
22607
+ ids
22608
+ }
22609
+ });
22610
+ const blob = new Blob([result2], {
22611
+ type: "application/octet-stream"
22612
+ });
22613
+ saveAs(blob, "CustomPage-" + format$3(new Date(), "yyyyMMddHHmmss") + ".cp");
22600
22614
  }
22601
22615
  };
22602
22616
  var viewPage$1 = {
@@ -25776,11 +25790,33 @@ const _sfc_main$1i = {
25776
25790
  computed: {},
25777
25791
  created() {
25778
25792
  },
25779
- methods: {}
25793
+ methods: {
25794
+ exportFile() {
25795
+ let ids = this.$refs.table.getSelected().map((x2) => {
25796
+ return x2.id;
25797
+ });
25798
+ if (ids.length > 0) {
25799
+ customPageApi.exportFile(ids);
25800
+ } else {
25801
+ this.error("Front_Msg_Please_Select_Export_Item");
25802
+ }
25803
+ },
25804
+ importFileSuccess(res2) {
25805
+ if (res2.code == 0) {
25806
+ this.success("Front_Msg_Success", () => {
25807
+ this.$refs.table.loadData();
25808
+ });
25809
+ } else {
25810
+ this.error(res2.message);
25811
+ }
25812
+ }
25813
+ }
25780
25814
  };
25781
25815
  const _hoisted_1$12 = { class: "i-layout-page-header" };
25782
25816
  function _sfc_render$1i(_ctx, _cache, $props, $setup, $data, $options) {
25783
25817
  const _component_PageHeader = resolveComponent("PageHeader");
25818
+ const _component_Button = resolveComponent("Button");
25819
+ const _component_file_upload = resolveComponent("file-upload");
25784
25820
  const _component_view_table = resolveComponent("view-table");
25785
25821
  const _component_Card = resolveComponent("Card");
25786
25822
  const _component_modal_form = resolveComponent("modal-form");
@@ -25801,9 +25837,42 @@ function _sfc_render$1i(_ctx, _cache, $props, $setup, $data, $options) {
25801
25837
  createVNode$1(_component_view_table, {
25802
25838
  ref: "table",
25803
25839
  "view-code": "CustomPage",
25804
- onCreate: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.form.open()),
25805
- onEdit: _cache[1] || (_cache[1] = ({ row, index: index2 }) => _ctx.$refs.form.open(row))
25840
+ selectEnable: true,
25841
+ onCreate: _cache[1] || (_cache[1] = ($event) => _ctx.$refs.form.open()),
25842
+ onEdit: _cache[2] || (_cache[2] = ({ row, index: index2 }) => _ctx.$refs.form.open(row))
25806
25843
  }, {
25844
+ filterCommand: withCtx(() => [
25845
+ createVNode$1(_component_Button, {
25846
+ size: "small",
25847
+ type: "info",
25848
+ "custom-icon": "fa fa-cloud-download-alt",
25849
+ onClick: _cache[0] || (_cache[0] = ($event) => $options.exportFile())
25850
+ }, {
25851
+ default: withCtx(() => [
25852
+ createTextVNode(toDisplayString$1(_ctx.$t("Front_Btn_Export")), 1)
25853
+ ]),
25854
+ _: 1
25855
+ }),
25856
+ createVNode$1(_component_file_upload, {
25857
+ url: "api/CustomPage/importFile",
25858
+ accept: ".cp",
25859
+ onOnSuccess: $options.importFileSuccess
25860
+ }, {
25861
+ default: withCtx(() => [
25862
+ createVNode$1(_component_Button, {
25863
+ type: "primary",
25864
+ "custom-icon": "fa fa-cloud-upload-alt",
25865
+ size: "small"
25866
+ }, {
25867
+ default: withCtx(() => [
25868
+ createTextVNode(toDisplayString$1(_ctx.$t("Front_Btn_Import")), 1)
25869
+ ]),
25870
+ _: 1
25871
+ })
25872
+ ]),
25873
+ _: 1
25874
+ }, 8, ["onOnSuccess"])
25875
+ ]),
25807
25876
  command: withCtx(({}) => [
25808
25877
  createCommentVNode(' <Button size="small"\r\n title="\u9875\u9762\u7EC4\u4EF6"\r\n type="info"\r\n custom-icon="fa fa-window-maximize"\r\n @click="$refs.componentTable.open({customPageID: row.id})"></Button>\r\n <Button size="small"\r\n title="\u9875\u9762\u63A7\u4EF6"\r\n type="info"\r\n custom-icon="fa fa-clone"\r\n @click="$refs.controlTable.open({customPageID: row.id})"></Button> ')
25809
25878
  ]),
@@ -25815,7 +25884,7 @@ function _sfc_render$1i(_ctx, _cache, $props, $setup, $data, $options) {
25815
25884
  createVNode$1(_component_modal_form, {
25816
25885
  ref: "form",
25817
25886
  "view-code": "CustomPageEdit",
25818
- onOnAfterSave: _cache[2] || (_cache[2] = ($event) => _ctx.$refs.table.loadData())
25887
+ onOnAfterSave: _cache[3] || (_cache[3] = ($event) => _ctx.$refs.table.loadData())
25819
25888
  }, null, 512),
25820
25889
  createCommentVNode(' <modal-table ref="componentTable"\r\n view-code="CustomPageComponent"\r\n @create="(param)=>$refs.componentForm.openDefault(param)"\r\n @edit="({row, index})=>$refs.componentForm.open(row)">\r\n <template slot-scope="{ row }"\r\n slot="command">\r\n <Button size="small"\r\n title="\u9875\u9762\u63A7\u4EF6"\r\n type="info"\r\n custom-icon="fa fa-clone"\r\n @click="$refs.controlTable.open({customPageID: row.customPageID, customPageComponentID: row.id})"></Button>\r\n </template>\r\n </modal-table>\r\n <modal-form ref="componentForm"\r\n view-code="CustomPageComponentEdit"\r\n @on-after-save="$refs.componentTable.loadData()" />\r\n <modal-table ref="controlTable"\r\n view-code="CustomPageControl"\r\n @create="(param)=>$refs.controlForm.openDefault(param)"\r\n @edit="({row, index})=>$refs.controlForm.open(row)" />\r\n <modal-form ref="controlForm"\r\n view-code="CustomPageControlEdit"\r\n @on-after-save="$refs.controlTable.loadData()" /> ')
25821
25890
  ]);
@@ -27116,6 +27185,10 @@ const _sfc_main$16 = {
27116
27185
  created() {
27117
27186
  },
27118
27187
  methods: {
27188
+ edit({ row, index: index2 }) {
27189
+ row.password = "$$$$$$$$";
27190
+ this.$refs.form.open(row);
27191
+ },
27119
27192
  async openApiTableOpen(row) {
27120
27193
  this.openUserID = row.id;
27121
27194
  let openApis = await openApiPermissionApi.queryForCheck(row.id);
@@ -27147,6 +27220,7 @@ function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
27147
27220
  const _component_Button = resolveComponent("Button");
27148
27221
  const _component_view_table = resolveComponent("view-table");
27149
27222
  const _component_Card = resolveComponent("Card");
27223
+ const _component_Input = resolveComponent("Input");
27150
27224
  const _component_modal_form = resolveComponent("modal-form");
27151
27225
  const _component_modal_table = resolveComponent("modal-table");
27152
27226
  return openBlock(), createElementBlock("div", null, [
@@ -27167,7 +27241,7 @@ function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
27167
27241
  ref: "table",
27168
27242
  "view-code": "OpenUser",
27169
27243
  onCreate: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.form.open()),
27170
- onEdit: _cache[1] || (_cache[1] = ({ row, index: index2 }) => _ctx.$refs.form.open(row))
27244
+ onEdit: $options.edit
27171
27245
  }, {
27172
27246
  command: withCtx(({ row }) => [
27173
27247
  createVNode$1(_component_Button, {
@@ -27179,15 +27253,28 @@ function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
27179
27253
  }, null, 8, ["title", "onClick"])
27180
27254
  ]),
27181
27255
  _: 1
27182
- }, 512)
27256
+ }, 8, ["onEdit"])
27183
27257
  ]),
27184
27258
  _: 1
27185
27259
  }),
27186
27260
  createVNode$1(_component_modal_form, {
27187
27261
  ref: "form",
27188
27262
  "view-code": "OpenUserEdit",
27189
- onOnAfterSave: _cache[2] || (_cache[2] = ($event) => _ctx.$refs.table.loadData())
27190
- }, null, 512),
27263
+ onOnAfterSave: _cache[1] || (_cache[1] = ($event) => _ctx.$refs.table.loadData())
27264
+ }, {
27265
+ column: withCtx(({ data: data2, column, code: code2 }) => [
27266
+ code2 == "password" ? (openBlock(), createBlock(_component_Input, {
27267
+ key: 0,
27268
+ type: "password",
27269
+ "model-value": _ctx.parseData(data2, column.code),
27270
+ "onUpdate:modelValue": ($event) => _ctx.setData(data2, column.code, $event),
27271
+ readonly: _ctx.readonly || column.isReadonly,
27272
+ style: normalizeStyle$1({ width: column.controlWidth == null ? null : column.controlWidth + "px" }),
27273
+ maxlength: column.maxLength
27274
+ }, null, 8, ["model-value", "onUpdate:modelValue", "readonly", "style", "maxlength"])) : createCommentVNode("v-if", true)
27275
+ ]),
27276
+ _: 1
27277
+ }, 512),
27191
27278
  createVNode$1(_component_modal_table, {
27192
27279
  ref: "openApiTable",
27193
27280
  "view-code": "OpenApiCheck",
@@ -27199,7 +27286,7 @@ function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
27199
27286
  createVNode$1(_component_Button, {
27200
27287
  type: "primary",
27201
27288
  "custom-icon": "fa fa-save",
27202
- onClick: _cache[3] || (_cache[3] = ($event) => $options.saveOpenApiPermission())
27289
+ onClick: _cache[2] || (_cache[2] = ($event) => $options.saveOpenApiPermission())
27203
27290
  }, {
27204
27291
  default: withCtx(() => [
27205
27292
  createTextVNode(toDisplayString$1(_ctx.$t("Front_Btn_Save")), 1)
@@ -27209,7 +27296,7 @@ function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
27209
27296
  createVNode$1(_component_Button, {
27210
27297
  type: "default",
27211
27298
  "custom-icon": "fa fa-times",
27212
- onClick: _cache[4] || (_cache[4] = ($event) => _ctx.$refs.openApiTable.close())
27299
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$refs.openApiTable.close())
27213
27300
  }, {
27214
27301
  default: withCtx(() => [
27215
27302
  createTextVNode(toDisplayString$1(_ctx.$t("Front_Btn_Close")), 1)
@@ -37670,9 +37757,8 @@ const _sfc_main$w = {
37670
37757
  res2.data.forEach((item) => {
37671
37758
  let v = this.parseData(item, column.sourceDataCode);
37672
37759
  let label = this.parseData(item, column.sourceDisplayCode);
37673
- if (column.controlType == "ComboSelect") {
37674
- this.$refs["control_" + column.code][0].$data.query = label;
37675
- }
37760
+ if (column.controlType == "ComboSelect")
37761
+ ;
37676
37762
  let newValue = pendings.find((i3) => i3.value == v);
37677
37763
  if (newValue) {
37678
37764
  newValue.label = label;
@@ -42167,9 +42253,8 @@ const _sfc_main$r = {
42167
42253
  res2.data.forEach((item) => {
42168
42254
  let v = this.parseData(item, column.sourceDataCode);
42169
42255
  let label = this.parseData(item, column.sourceDisplayCode);
42170
- if (column.controlType == "ComboSelect") {
42171
- this.$refs["control_" + column.code][0].$data.query = label;
42172
- }
42256
+ if (column.controlType == "ComboSelect")
42257
+ ;
42173
42258
  let newValue = pendings.find((i3) => i3.value == v);
42174
42259
  if (newValue) {
42175
42260
  newValue.label = label;
@@ -42187,7 +42272,7 @@ const _hoisted_2$f = {
42187
42272
  class: "label"
42188
42273
  };
42189
42274
  const _hoisted_3$d = {
42190
- key: 15,
42275
+ key: 16,
42191
42276
  style: { "line-height": "24px" }
42192
42277
  };
42193
42278
  function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
@@ -42397,10 +42482,40 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
42397
42482
  }), 128))
42398
42483
  ]),
42399
42484
  _: 2
42400
- }, 1032, ["model-value", "onUpdate:modelValue", "remote-method", "style", "placeholder", "onOnChange"])) : column.controlType === "MultiComboSelect" ? (openBlock(), createBlock(_component_Select, {
42485
+ }, 1032, ["model-value", "onUpdate:modelValue", "remote-method", "style", "placeholder", "onOnChange"])) : column.controlType === "ComboSelect" ? (openBlock(), createBlock(_component_Select, {
42401
42486
  key: 10,
42402
42487
  ref_for: true,
42403
42488
  ref: "control_" + column.code,
42489
+ "model-value": $options.parseComboData($data.data, column),
42490
+ "onUpdate:modelValue": ($event) => _ctx.setData($data.data, column.code, $event),
42491
+ disabled: _ctx.readonly || column.isReadonly,
42492
+ clearable: true,
42493
+ filterable: "",
42494
+ remote: "",
42495
+ "remote-method": (search) => $options.loadOption($data.data, column, search),
42496
+ style: normalizeStyle$1({ width: column.controlWidth == null ? null : column.controlWidth + "px" }),
42497
+ placeholder: column.description,
42498
+ transfer: true,
42499
+ onOnChange: (selected) => $options.onSelectDataChange(column, selected)
42500
+ }, {
42501
+ default: withCtx(() => [
42502
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.getDataSource($data.data, column), (item) => {
42503
+ return openBlock(), createBlock(_component_Option, {
42504
+ key: item.id,
42505
+ value: item.id
42506
+ }, {
42507
+ default: withCtx(() => [
42508
+ createTextVNode(toDisplayString$1(item.name), 1)
42509
+ ]),
42510
+ _: 2
42511
+ }, 1032, ["value"]);
42512
+ }), 128))
42513
+ ]),
42514
+ _: 2
42515
+ }, 1032, ["model-value", "onUpdate:modelValue", "disabled", "remote-method", "style", "placeholder", "onOnChange"])) : column.controlType === "MultiComboSelect" ? (openBlock(), createBlock(_component_Select, {
42516
+ key: 11,
42517
+ ref_for: true,
42518
+ ref: "control_" + column.code,
42404
42519
  size: "small",
42405
42520
  "model-value": $options.parseMultiComboData($data.data, column),
42406
42521
  "onUpdate:modelValue": ($event) => $options.setArrayFilterData($data.data, column, $event),
@@ -42429,7 +42544,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
42429
42544
  ]),
42430
42545
  _: 2
42431
42546
  }, 1032, ["model-value", "onUpdate:modelValue", "remote-method", "style", "placeholder", "onOnChange"])) : column.controlType === "DialogSelect" ? (openBlock(), createBlock(_component_dialog_select, {
42432
- key: 11,
42547
+ key: 12,
42433
42548
  size: "small",
42434
42549
  "model-value": $options.parseFilterData($data.data, column),
42435
42550
  "onUpdate:modelValue": ($event) => $options.setFilterData($data.data, column, $event),
@@ -42440,7 +42555,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
42440
42555
  controlWidth: column.controlWidth,
42441
42556
  onOnChange: (selected) => $options.onSelectDataChange(column, selected)
42442
42557
  }, null, 8, ["model-value", "onUpdate:modelValue", "source", "source-data-code", "source-display-code", "param", "controlWidth", "onOnChange"])) : column.controlType === "Date" || column.controlType === "DateTime" || column.controlType === "Year" || column.controlType === "Month" || column.controlType === "DateRange" ? (openBlock(), createBlock(_component_DatePicker, {
42443
- key: 12,
42558
+ key: 13,
42444
42559
  size: "small",
42445
42560
  type: column.controlType.toLowerCase(),
42446
42561
  "model-value": $options.parseFilterData($data.data, column),
@@ -42452,7 +42567,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
42452
42567
  $options.onDataChange(column);
42453
42568
  }
42454
42569
  }, null, 8, ["type", "model-value", "placeholder", "style", "onOnChange"])) : column.controlType === "Time" ? (openBlock(), createBlock(_component_TimePicker, {
42455
- key: 13,
42570
+ key: 14,
42456
42571
  size: "small",
42457
42572
  type: "time",
42458
42573
  "model-value": $options.parseFilterData($data.data, column),
@@ -42462,7 +42577,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
42462
42577
  style: normalizeStyle$1({ width: column.controlWidth == null ? null : column.controlWidth + "px" }),
42463
42578
  onOnChange: ($event) => $options.onDataChange(column)
42464
42579
  }, null, 8, ["model-value", "onUpdate:modelValue", "placeholder", "style", "onOnChange"])) : column.controlType === "Check" ? (openBlock(), createBlock(_component_Checkbox, {
42465
- key: 14,
42580
+ key: 15,
42466
42581
  size: "small",
42467
42582
  style: { "line-height": "26px" },
42468
42583
  "model-value": !!$options.parseFilterData($data.data, column),
@@ -42476,7 +42591,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
42476
42591
  onOnChange: ($event) => $options.onDataChange(column)
42477
42592
  }, null, 8, ["model-value", "onUpdate:modelValue", "onOnChange"])
42478
42593
  ])) : column.controlType === "Radio" ? (openBlock(), createBlock(_component_RadioGroup, {
42479
- key: 16,
42594
+ key: 17,
42480
42595
  size: "small",
42481
42596
  style: { "line-height": "22px" },
42482
42597
  "model-value": $options.parseFilterData($data.data, column),
@@ -42498,14 +42613,14 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
42498
42613
  ]),
42499
42614
  _: 2
42500
42615
  }, 1032, ["model-value", "onUpdate:modelValue", "onOnChange"])) : column.controlType === "TextArea" ? (openBlock(), createBlock(_component_Input, {
42501
- key: 17,
42616
+ key: 18,
42502
42617
  type: "textarea",
42503
42618
  "model-value": $options.parseFilterData($data.data, column.code),
42504
42619
  "onUpdate:modelValue": ($event) => $options.setFilterData($data.data, column.code, $event),
42505
42620
  style: normalizeStyle$1({ width: column.controlWidth == null ? null : column.controlWidth + "px" }),
42506
42621
  rows: column.controlHeight / 20,
42507
42622
  placeholder: column.description
42508
- }, null, 8, ["model-value", "onUpdate:modelValue", "style", "rows", "placeholder"])) : (openBlock(), createElementBlock(Fragment, { key: 18 }, [
42623
+ }, null, 8, ["model-value", "onUpdate:modelValue", "style", "rows", "placeholder"])) : (openBlock(), createElementBlock(Fragment, { key: 19 }, [
42509
42624
  createTextVNode(toDisplayString$1(_ctx.$t("Front_Label_Control_Type_Not_Supported")) + " " + toDisplayString$1(column.controlType), 1)
42510
42625
  ], 64))
42511
42626
  ]),
@@ -43746,7 +43861,7 @@ const _sfc_main$q = {
43746
43861
  if (!this.staticData.some((item) => {
43747
43862
  return item[batchSelectDataCode] == selected[i3].id;
43748
43863
  })) {
43749
- let item = {};
43864
+ let item = this.getDefaultData();
43750
43865
  item[batchSelectDataCode] = selected[i3].id;
43751
43866
  item[key] = selected[i3];
43752
43867
  this.staticData.push(item);
@@ -44025,9 +44140,8 @@ const _sfc_main$q = {
44025
44140
  res2.data.forEach((item) => {
44026
44141
  let v = this.parseData(item, column.sourceDataCode);
44027
44142
  let label = this.parseData(item, column.sourceDisplayCode);
44028
- if (column.controlType == "ComboSelect") {
44029
- this.$refs["control_" + column.code + "_" + index2].$data.query = label;
44030
- }
44143
+ if (column.controlType == "ComboSelect")
44144
+ ;
44031
44145
  let newValue = pendings.find((i3) => i3.value == v);
44032
44146
  if (newValue) {
44033
44147
  newValue.label = label;
@@ -52070,9 +52184,8 @@ const _sfc_main$o = {
52070
52184
  res2.data.forEach((item) => {
52071
52185
  let v = this.parseData(item, column.sourceDataCode);
52072
52186
  let label = this.parseData(item, column.sourceDisplayCode);
52073
- if (column.controlType == "ComboSelect") {
52074
- this.$refs["control_" + column.code][0].$data.query = label;
52075
- }
52187
+ if (column.controlType == "ComboSelect")
52188
+ ;
52076
52189
  let newValue = pendings.find((i3) => i3.value == v);
52077
52190
  if (newValue) {
52078
52191
  newValue.label = label;