bm-admin-ui 1.1.5-alpha → 1.1.7-alpha

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.
Files changed (66) hide show
  1. package/es/components/attachment/index.d.ts +1 -1
  2. package/es/components/attachment/src/attachment.vue.d.ts +1 -1
  3. package/es/components/button/index.d.ts +1 -1
  4. package/es/components/button/src/button.vue.d.ts +1 -1
  5. package/es/components/cascader/index.d.ts +1 -1
  6. package/es/components/cascader/src/cascader.vue.d.ts +1 -1
  7. package/es/components/edit-form/index.d.ts +2 -2
  8. package/es/components/edit-form/src/edit-form.vue.d.ts +2 -2
  9. package/es/components/editor/index.d.ts +3 -3
  10. package/es/components/editor/src/editor.vue.d.ts +3 -3
  11. package/es/components/feedback/index.d.ts +12 -12
  12. package/es/components/feedback/src/bmAlert.vue.d.ts +5 -5
  13. package/es/components/feedback/src/bmModal.vue.d.ts +7 -7
  14. package/es/components/form-create/index.js +219 -22
  15. package/es/components/over-tooltips/index.d.ts +1 -1
  16. package/es/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  17. package/es/components/staffs-selector/index.d.ts +8 -8
  18. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  19. package/es/components/upload/index.d.ts +1 -1
  20. package/es/components/upload/src/upload.vue.d.ts +1 -1
  21. package/es/utils/index.d.ts +7 -0
  22. package/es/utils/index.js +62 -0
  23. package/lib/components/attachment/index.d.ts +1 -1
  24. package/lib/components/attachment/src/attachment.vue.d.ts +1 -1
  25. package/lib/components/button/index.d.ts +1 -1
  26. package/lib/components/button/src/button.vue.d.ts +1 -1
  27. package/lib/components/cascader/index.d.ts +1 -1
  28. package/lib/components/cascader/src/cascader.vue.d.ts +1 -1
  29. package/lib/components/edit-form/index.d.ts +2 -2
  30. package/lib/components/edit-form/src/edit-form.vue.d.ts +2 -2
  31. package/lib/components/editor/index.d.ts +3 -3
  32. package/lib/components/editor/src/editor.vue.d.ts +3 -3
  33. package/lib/components/feedback/index.d.ts +12 -12
  34. package/lib/components/feedback/src/bmAlert.vue.d.ts +5 -5
  35. package/lib/components/feedback/src/bmModal.vue.d.ts +7 -7
  36. package/lib/components/form-create/index.js +220 -22
  37. package/lib/components/over-tooltips/index.d.ts +1 -1
  38. package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  39. package/lib/components/staffs-selector/index.d.ts +8 -8
  40. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  41. package/lib/components/upload/index.d.ts +1 -1
  42. package/lib/components/upload/src/upload.vue.d.ts +1 -1
  43. package/lib/utils/index.d.ts +7 -0
  44. package/lib/utils/index.js +64 -0
  45. package/package.json +1 -1
  46. package/theme-chalk/index.css +1 -1
  47. package/types/components/attachment/index.d.ts +1 -1
  48. package/types/components/attachment/src/attachment.vue.d.ts +1 -1
  49. package/types/components/button/index.d.ts +1 -1
  50. package/types/components/button/src/button.vue.d.ts +1 -1
  51. package/types/components/cascader/index.d.ts +1 -1
  52. package/types/components/cascader/src/cascader.vue.d.ts +1 -1
  53. package/types/components/edit-form/index.d.ts +2 -2
  54. package/types/components/edit-form/src/edit-form.vue.d.ts +2 -2
  55. package/types/components/editor/index.d.ts +3 -3
  56. package/types/components/editor/src/editor.vue.d.ts +3 -3
  57. package/types/components/feedback/index.d.ts +12 -12
  58. package/types/components/feedback/src/bmAlert.vue.d.ts +5 -5
  59. package/types/components/feedback/src/bmModal.vue.d.ts +7 -7
  60. package/types/components/over-tooltips/index.d.ts +1 -1
  61. package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  62. package/types/components/staffs-selector/index.d.ts +8 -8
  63. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  64. package/types/components/upload/index.d.ts +1 -1
  65. package/types/components/upload/src/upload.vue.d.ts +1 -1
  66. package/types/utils/index.d.ts +7 -0
@@ -8,6 +8,7 @@ import { BmTagsDisplay, BmFloatTable } from 'bm-admin-ui/es/components';
8
8
  import { EyeOutlined, SearchOutlined, CheckCircleFilled, PlusOutlined } from '@ant-design/icons-vue';
9
9
  import { cloneDeep, floor, debounce } from 'lodash-es';
10
10
  import customParseFormat from 'dayjs/plugin/customParseFormat';
11
+ import utils from 'bm-admin-ui/es/utils';
11
12
  import { isNull } from 'bm-admin-ui/es/utils/isNull';
12
13
 
13
14
  const fieldRatioMap = {
@@ -163,8 +164,8 @@ var textarea = {
163
164
  },
164
165
  };
165
166
 
166
- function generateRowRule(data) {
167
- return {
167
+ function generateRowRule(data, InRow = false) {
168
+ const config = {
168
169
  type: 'inputNumber',
169
170
  field: data.field,
170
171
  title: data.title.title,
@@ -176,15 +177,23 @@ function generateRowRule(data) {
176
177
  effect: {
177
178
  required: data.effect.required && '请输入',
178
179
  },
179
- wrap: {
180
- wrapperCol: {
181
- span: fieldRatioMap[data.config.fieldRatio],
182
- },
183
- },
184
180
  style: {
185
181
  width: '100%',
186
182
  },
187
183
  };
184
+ if (InRow) {
185
+ config['col'] = {
186
+ span: fieldRatioMap[data.config.fieldRatio],
187
+ };
188
+ }
189
+ else {
190
+ config['wrap'] = {
191
+ wrapperCol: {
192
+ span: fieldRatioMap[data.config.fieldRatio],
193
+ },
194
+ };
195
+ }
196
+ return config;
188
197
  }
189
198
  var numInput = {
190
199
  name: 'numInput',
@@ -192,7 +201,7 @@ var numInput = {
192
201
  return generateRowRule(data);
193
202
  },
194
203
  rowRule(data) {
195
- return generateRowRule(data);
204
+ return generateRowRule(data, true);
196
205
  },
197
206
  tableRule(data) {
198
207
  const field = data.field;
@@ -1107,8 +1116,8 @@ const _hoisted_5$4 = {
1107
1116
  key: 1,
1108
1117
  class: "bm-fc-select-material-temp__content__circle"
1109
1118
  };
1110
- const _hoisted_6$3 = ["title"];
1111
- const _hoisted_7$3 = { class: "bm-fc-select-material-temp__content__item-time" };
1119
+ const _hoisted_6$4 = ["title"];
1120
+ const _hoisted_7$4 = { class: "bm-fc-select-material-temp__content__item-time" };
1112
1121
  const _sfc_main$b = /* @__PURE__ */ defineComponent({
1113
1122
  __name: "select-material-temp",
1114
1123
  props: [
@@ -1323,9 +1332,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1323
1332
  createElementVNode("span", {
1324
1333
  class: "bm-fc-select-material-temp__content__name",
1325
1334
  title: item.templateName
1326
- }, toDisplayString(item.templateName), 9, _hoisted_6$3)
1335
+ }, toDisplayString(item.templateName), 9, _hoisted_6$4)
1327
1336
  ], 8, _hoisted_4$4),
1328
- createElementVNode("div", _hoisted_7$3, toDisplayString(unref(dayjs)(item.lastUpdateTime).format("YYYY/MM/DD")), 1)
1337
+ createElementVNode("div", _hoisted_7$4, toDisplayString(unref(dayjs)(item.lastUpdateTime).format("YYYY/MM/DD")), 1)
1329
1338
  ])
1330
1339
  ]),
1331
1340
  _: 2
@@ -18720,9 +18729,17 @@ var ShopInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "shop-input
18720
18729
  const _hoisted_1$5 = { class: "bm-dc-table-widget" };
18721
18730
  const _hoisted_2$4 = { class: "bm-dc-table-widget__title" };
18722
18731
  const _hoisted_3$3 = { class: "bm-dc-table-widget__title-samll" };
18723
- const _hoisted_4$3 = { class: "bm-dc-table-widget__top-bar" };
18724
- const _hoisted_5$3 = { class: "bm-dc-table-widget__table" };
18725
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18732
+ const _hoisted_4$3 = {
18733
+ key: 0,
18734
+ class: "bm-dc-table-widget__top-bar"
18735
+ };
18736
+ const _hoisted_5$3 = ["accept"];
18737
+ const _hoisted_6$3 = {
18738
+ key: 1,
18739
+ class: "bm-dc-table-widget__top-bar"
18740
+ };
18741
+ const _hoisted_7$3 = { class: "bm-dc-table-widget__table" };
18742
+ const _sfc_main$7 = defineComponent({
18726
18743
  __name: "table-widget",
18727
18744
  props: [
18728
18745
  "rule",
@@ -18817,6 +18834,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18817
18834
  const formData = computed(
18818
18835
  () => props.formData || props.formCreateInject.api.bind()
18819
18836
  );
18837
+ const tableConfig = computed(() => props.rule?.config?.tableConfig || {});
18838
+ const validColumns = computed(() => columns.filter((c) => isValidColumn(c)));
18820
18839
  function isShow(key) {
18821
18840
  return props.rule.config.tableAdvancedFeatures.includes(key);
18822
18841
  }
@@ -19013,12 +19032,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19013
19032
  const reader = new FileReader();
19014
19033
  reader.onload = (fr) => {
19015
19034
  const rows = parseCsv(fr?.target?.result);
19016
- const validColumns = columns.filter((c) => isValidColumn(c));
19035
+ const validColumns2 = columns.filter((c) => isValidColumn(c));
19017
19036
  const result = [];
19018
19037
  rows.forEach((row) => {
19019
19038
  const rowData = {};
19020
19039
  row.forEach((item, index) => {
19021
- rowData[validColumns[index].field] = item;
19040
+ rowData[validColumns2[index].field] = item;
19022
19041
  });
19023
19042
  result.push(rowData);
19024
19043
  });
@@ -19055,9 +19074,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19055
19074
  }
19056
19075
  async function validate(rowData) {
19057
19076
  let error = "";
19058
- const validColumns = columns.filter((c) => isValidColumn(c));
19077
+ const validColumns2 = columns.filter((c) => isValidColumn(c));
19059
19078
  for (const row of rowData) {
19060
- for (const { field } of validColumns) {
19079
+ for (const { field } of validColumns2) {
19061
19080
  const rule = childRulesMap.value[`${field}`];
19062
19081
  const title = rule?.title?.title;
19063
19082
  if (!rule)
@@ -19269,12 +19288,190 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19269
19288
  deep: true
19270
19289
  }
19271
19290
  );
19291
+ const buttonLoadingForProductCenter = ref({
19292
+ export: false,
19293
+ download: false,
19294
+ import: false
19295
+ });
19296
+ async function exportForProductCenter() {
19297
+ if (!tableConfig.value.template || tableConfig.value.template === "table") {
19298
+ return handleExport();
19299
+ }
19300
+ try {
19301
+ buttonLoadingForProductCenter.value.export = true;
19302
+ const selected = xGrid.value?.getCheckboxRecords?.();
19303
+ await props.extraConfig.table?.exportFetch?.({
19304
+ tableConfig: tableConfig.value,
19305
+ columns: validColumns.value,
19306
+ data: selected
19307
+ });
19308
+ } catch (error) {
19309
+ console.log("\u{1F680} ~ error:", error);
19310
+ } finally {
19311
+ buttonLoadingForProductCenter.value.export = false;
19312
+ }
19313
+ }
19314
+ async function downloadTemplateForProductCenter() {
19315
+ if (!tableConfig.value.template || tableConfig.value.template === "table") {
19316
+ return handleDownload();
19317
+ }
19318
+ try {
19319
+ buttonLoadingForProductCenter.value.download = true;
19320
+ await props.extraConfig.table?.downloadTemplateFetch?.({
19321
+ tableConfig: tableConfig.value,
19322
+ columns: validColumns.value
19323
+ });
19324
+ } catch (error) {
19325
+ console.log("\u{1F680} ~ error:", error);
19326
+ } finally {
19327
+ buttonLoadingForProductCenter.value.download = false;
19328
+ }
19329
+ }
19330
+ async function importHandleForProductCenter(e) {
19331
+ if (!tableConfig.value.template || tableConfig.value.template === "table") {
19332
+ return handleChange(e);
19333
+ }
19334
+ try {
19335
+ buttonLoadingForProductCenter.value.import = true;
19336
+ let res = await props.extraConfig.table?.importFetch?.({
19337
+ tableConfig: tableConfig.value,
19338
+ columns: validColumns.value
19339
+ }) || {};
19340
+ if (res.promptMessage && !await utils.confirmModal(res.promptMessage)) {
19341
+ return;
19342
+ }
19343
+ if (res.templateDataList?.length) {
19344
+ data.push(...res.templateDataList);
19345
+ }
19346
+ const numFormatter = (value) => utils.toFixNumHasDefault(value, 0, false, "0");
19347
+ if (!res.successNum) {
19348
+ let confirmRet = await utils.confirmModal(
19349
+ `\u5BFC\u5165\u5931\u8D25\uFF0C\u5171${numFormatter(res.errorNum)}\u6761`,
19350
+ "\u63D0\u793A",
19351
+ "error",
19352
+ {
19353
+ okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
19354
+ },
19355
+ "error"
19356
+ );
19357
+ if (confirmRet) {
19358
+ props.extraConfig.table?.downloadErrorFetch?.({
19359
+ tableConfig: tableConfig.value,
19360
+ columns: validColumns.value,
19361
+ data: res
19362
+ });
19363
+ }
19364
+ } else if (res.successNum === res.importNum) {
19365
+ let confirmRet = await utils.confirmModal(
19366
+ `\u5BFC\u5165\u6210\u529F\uFF0C\u5171${numFormatter(res.successNum)}\u6761`,
19367
+ "\u63D0\u793A",
19368
+ "success",
19369
+ {
19370
+ okText: "\u77E5\u9053\u4E86"
19371
+ },
19372
+ "success"
19373
+ );
19374
+ } else {
19375
+ let confirmRet = await utils.confirmModal(
19376
+ `\u5BFC\u5165\u6210\u529F${numFormatter(res.successNum)}\u6761\uFF0C\u5931\u8D25${numFormatter(
19377
+ res.errorNum
19378
+ )}\u6761`,
19379
+ "\u63D0\u793A",
19380
+ "warning",
19381
+ {
19382
+ okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
19383
+ },
19384
+ "warning"
19385
+ );
19386
+ if (confirmRet) {
19387
+ props.extraConfig.table?.downloadErrorFetch?.({
19388
+ tableConfig: tableConfig.value,
19389
+ columns: validColumns.value,
19390
+ data: res
19391
+ });
19392
+ }
19393
+ }
19394
+ } catch (error) {
19395
+ console.log("\u{1F680} ~ error:", error);
19396
+ } finally {
19397
+ buttonLoadingForProductCenter.value.import = false;
19398
+ }
19399
+ }
19272
19400
  return (_ctx, _cache) => {
19273
19401
  return openBlock(), createElementBlock("div", _hoisted_1$5, [
19274
19402
  createElementVNode("div", _hoisted_2$4, [
19275
19403
  createTextVNode(toDisplayString(__props.rule.title.title) + " ", 1),
19276
19404
  createElementVNode("span", _hoisted_3$3, toDisplayString(unref(countText)), 1),
19277
- createElementVNode("div", _hoisted_4$3, [
19405
+ createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
19406
+ unref(tableConfig).system === "productCenter" ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
19407
+ !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
19408
+ unref(tableConfig).buttons?.includes("import") ? (openBlock(), createElementBlock("input", {
19409
+ key: 0,
19410
+ ref_key: "inputRef",
19411
+ ref: inputRef,
19412
+ style: { "display": "none" },
19413
+ name: "file",
19414
+ type: "file",
19415
+ accept: unref(tableConfig).template === "table" ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, .xlsx, .xls, .XLSX, .XLS",
19416
+ onChange: importHandleForProductCenter
19417
+ }, null, 40, _hoisted_5$3)) : createCommentVNode("v-if", true),
19418
+ unref(tableConfig).buttons?.includes("export") ? (openBlock(), createBlock(unref(Button), {
19419
+ key: 1,
19420
+ disabled: __props.disabled,
19421
+ loading: buttonLoadingForProductCenter.value.export,
19422
+ onClick: exportForProductCenter
19423
+ }, {
19424
+ default: withCtx(() => [
19425
+ createTextVNode("\u5BFC\u51FA")
19426
+ ]),
19427
+ _: 1
19428
+ }, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
19429
+ unref(tableConfig).buttons?.includes("downloadTemplate") ? (openBlock(), createBlock(unref(Button), {
19430
+ key: 2,
19431
+ disabled: __props.disabled,
19432
+ loading: buttonLoadingForProductCenter.value.download,
19433
+ onClick: downloadTemplateForProductCenter
19434
+ }, {
19435
+ default: withCtx(() => [
19436
+ createTextVNode("\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F")
19437
+ ]),
19438
+ _: 1
19439
+ }, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
19440
+ unref(tableConfig).buttons?.includes("import") ? (openBlock(), createBlock(unref(Button), {
19441
+ key: 3,
19442
+ disabled: __props.disabled,
19443
+ loading: buttonLoadingForProductCenter.value.import,
19444
+ onClick: handleImport
19445
+ }, {
19446
+ default: withCtx(() => [
19447
+ createTextVNode("\u6279\u91CF\u5BFC\u5165")
19448
+ ]),
19449
+ _: 1
19450
+ }, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
19451
+ unref(tableConfig).buttons?.includes("delete") ? (openBlock(), createBlock(unref(Button), {
19452
+ key: 4,
19453
+ disabled: __props.disabled,
19454
+ onClick: handleBatchDelete
19455
+ }, {
19456
+ default: withCtx(() => [
19457
+ createTextVNode("\u6279\u91CF\u5220\u9664")
19458
+ ]),
19459
+ _: 1
19460
+ }, 8, ["disabled"])) : createCommentVNode("v-if", true),
19461
+ unref(tableConfig).buttons?.includes("add") ? (openBlock(), createBlock(unref(Button), {
19462
+ key: 5,
19463
+ type: "primary",
19464
+ disabled: __props.disabled,
19465
+ onClick: handleAdd
19466
+ }, {
19467
+ default: withCtx(() => [
19468
+ createVNode(unref(PlusOutlined)),
19469
+ createTextVNode(" \u65B0\u589E")
19470
+ ]),
19471
+ _: 1
19472
+ }, 8, ["disabled"])) : createCommentVNode("v-if", true)
19473
+ ], 64)) : createCommentVNode("v-if", true)
19474
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6$3, [
19278
19475
  !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
19279
19476
  unref(exportFeature) ? (openBlock(), createBlock(unref(Button), {
19280
19477
  key: 0,
@@ -19338,9 +19535,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19338
19535
  _: 1
19339
19536
  }, 8, ["disabled"])
19340
19537
  ], 64)) : createCommentVNode("v-if", true)
19341
- ])
19538
+ ]))
19342
19539
  ]),
19343
- createElementVNode("div", _hoisted_5$3, [
19540
+ createElementVNode("div", _hoisted_7$3, [
19344
19541
  createVNode(unref(FormItemRest), null, {
19345
19542
  default: withCtx(() => [
19346
19543
  createVNode(unref(BmFloatTable), {
@@ -14,7 +14,7 @@ declare const BmOverTooltips: import("bm-admin-ui/es/utils/with-install").SFCWit
14
14
  default: number;
15
15
  };
16
16
  width: {
17
- type: (NumberConstructor | StringConstructor)[];
17
+ type: (StringConstructor | NumberConstructor)[];
18
18
  default: number;
19
19
  };
20
20
  showAlways: {
@@ -14,7 +14,7 @@ declare const _default: {
14
14
  default: number;
15
15
  };
16
16
  width: {
17
- type: (NumberConstructor | StringConstructor)[];
17
+ type: (StringConstructor | NumberConstructor)[];
18
18
  default: number;
19
19
  };
20
20
  showAlways: {
@@ -82,8 +82,8 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
82
82
  default: string;
83
83
  };
84
84
  }>> & {
85
- onChange?: ((...args: any[]) => any) | undefined;
86
85
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
86
+ onChange?: ((...args: any[]) => any) | undefined;
87
87
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
88
88
  }>>;
89
89
  emit: (event: "change" | "update:visible" | "update:select", ...args: any[]) => void;
@@ -144,7 +144,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
144
144
  type: BooleanConstructor;
145
145
  default: any;
146
146
  };
147
- width: (NumberConstructor | StringConstructor)[];
147
+ width: (StringConstructor | NumberConstructor)[];
148
148
  footer: import("vue-types").VueTypeValidableDef<any>;
149
149
  okText: import("vue-types").VueTypeValidableDef<any>;
150
150
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -290,7 +290,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
290
290
  modalRender: import("vue").PropType<(arg: {
291
291
  originVNode: import("ant-design-vue/lib/_util/type").VueNode;
292
292
  }) => import("ant-design-vue/lib/_util/type").VueNode>;
293
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "keyboard" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "focusTriggerAfterClose">;
293
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "keyboard" | "focusTriggerAfterClose">;
294
294
  $attrs: {
295
295
  [x: string]: unknown;
296
296
  };
@@ -329,7 +329,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
329
329
  type: BooleanConstructor;
330
330
  default: any;
331
331
  };
332
- width: (NumberConstructor | StringConstructor)[];
332
+ width: (StringConstructor | NumberConstructor)[];
333
333
  footer: import("vue-types").VueTypeValidableDef<any>;
334
334
  okText: import("vue-types").VueTypeValidableDef<any>;
335
335
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -534,7 +534,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
534
534
  type: BooleanConstructor;
535
535
  default: any;
536
536
  };
537
- width: (NumberConstructor | StringConstructor)[];
537
+ width: (StringConstructor | NumberConstructor)[];
538
538
  footer: import("vue-types").VueTypeValidableDef<any>;
539
539
  okText: import("vue-types").VueTypeValidableDef<any>;
540
540
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -709,7 +709,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
709
709
  type: BooleanConstructor;
710
710
  default: any;
711
711
  };
712
- width: (NumberConstructor | StringConstructor)[];
712
+ width: (StringConstructor | NumberConstructor)[];
713
713
  footer: import("vue-types").VueTypeValidableDef<any>;
714
714
  okText: import("vue-types").VueTypeValidableDef<any>;
715
715
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -1043,12 +1043,12 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
1043
1043
  default: string;
1044
1044
  };
1045
1045
  }>> & {
1046
- onChange?: ((...args: any[]) => any) | undefined;
1047
1046
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1047
+ onChange?: ((...args: any[]) => any) | undefined;
1048
1048
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1049
1049
  }, {
1050
- title: string;
1051
1050
  visible: boolean;
1051
+ title: string;
1052
1052
  mode: string;
1053
1053
  showCount: boolean;
1054
1054
  unitStr: string;
@@ -82,8 +82,8 @@ declare const _default: import("vue").DefineComponent<{
82
82
  default: string;
83
83
  };
84
84
  }>> & {
85
- onChange?: ((...args: any[]) => any) | undefined;
86
85
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
86
+ onChange?: ((...args: any[]) => any) | undefined;
87
87
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
88
88
  }>>;
89
89
  emit: (event: "change" | "update:visible" | "update:select", ...args: any[]) => void;
@@ -144,7 +144,7 @@ declare const _default: import("vue").DefineComponent<{
144
144
  type: BooleanConstructor;
145
145
  default: any;
146
146
  };
147
- width: (NumberConstructor | StringConstructor)[];
147
+ width: (StringConstructor | NumberConstructor)[];
148
148
  footer: import("vue-types").VueTypeValidableDef<any>;
149
149
  okText: import("vue-types").VueTypeValidableDef<any>;
150
150
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -290,7 +290,7 @@ declare const _default: import("vue").DefineComponent<{
290
290
  modalRender: import("vue").PropType<(arg: {
291
291
  originVNode: import("ant-design-vue/lib/_util/type").VueNode;
292
292
  }) => import("ant-design-vue/lib/_util/type").VueNode>;
293
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "keyboard" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "focusTriggerAfterClose">;
293
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "keyboard" | "focusTriggerAfterClose">;
294
294
  $attrs: {
295
295
  [x: string]: unknown;
296
296
  };
@@ -329,7 +329,7 @@ declare const _default: import("vue").DefineComponent<{
329
329
  type: BooleanConstructor;
330
330
  default: any;
331
331
  };
332
- width: (NumberConstructor | StringConstructor)[];
332
+ width: (StringConstructor | NumberConstructor)[];
333
333
  footer: import("vue-types").VueTypeValidableDef<any>;
334
334
  okText: import("vue-types").VueTypeValidableDef<any>;
335
335
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -534,7 +534,7 @@ declare const _default: import("vue").DefineComponent<{
534
534
  type: BooleanConstructor;
535
535
  default: any;
536
536
  };
537
- width: (NumberConstructor | StringConstructor)[];
537
+ width: (StringConstructor | NumberConstructor)[];
538
538
  footer: import("vue-types").VueTypeValidableDef<any>;
539
539
  okText: import("vue-types").VueTypeValidableDef<any>;
540
540
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -709,7 +709,7 @@ declare const _default: import("vue").DefineComponent<{
709
709
  type: BooleanConstructor;
710
710
  default: any;
711
711
  };
712
- width: (NumberConstructor | StringConstructor)[];
712
+ width: (StringConstructor | NumberConstructor)[];
713
713
  footer: import("vue-types").VueTypeValidableDef<any>;
714
714
  okText: import("vue-types").VueTypeValidableDef<any>;
715
715
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -1043,12 +1043,12 @@ declare const _default: import("vue").DefineComponent<{
1043
1043
  default: string;
1044
1044
  };
1045
1045
  }>> & {
1046
- onChange?: ((...args: any[]) => any) | undefined;
1047
1046
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1047
+ onChange?: ((...args: any[]) => any) | undefined;
1048
1048
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1049
1049
  }, {
1050
- title: string;
1051
1050
  visible: boolean;
1051
+ title: string;
1052
1052
  mode: string;
1053
1053
  showCount: boolean;
1054
1054
  unitStr: string;
@@ -19,7 +19,7 @@ declare const BmUpload: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
19
19
  default: number;
20
20
  };
21
21
  width: {
22
- type: (NumberConstructor | StringConstructor)[];
22
+ type: (StringConstructor | NumberConstructor)[];
23
23
  default: number;
24
24
  };
25
25
  showAlways: {
@@ -19,7 +19,7 @@ declare const _default: {
19
19
  default: number;
20
20
  };
21
21
  width: {
22
- type: (NumberConstructor | StringConstructor)[];
22
+ type: (StringConstructor | NumberConstructor)[];
23
23
  default: number;
24
24
  };
25
25
  showAlways: {
@@ -0,0 +1,7 @@
1
+ declare const utils: {
2
+ confirmModal(content: string | string[], title?: string, type?: string, config?: {}, cate?: string): Promise<unknown>;
3
+ toThousands(num: string | number): string;
4
+ toFixNumHasDefault(value: string | number | undefined, num?: number, isMoney?: boolean, defaultValue?: string): string;
5
+ wait(ms?: number): Promise<void>;
6
+ };
7
+ export default utils;
@@ -0,0 +1,62 @@
1
+ import { Modal as AModal } from 'ant-design-vue';
2
+ import { createVNode, h } from 'vue';
3
+ import { InfoCircleFilled, ExclamationCircleFilled, CheckCircleFilled, CloseCircleFilled, } from '@ant-design/icons-vue';
4
+ const utils = {
5
+ confirmModal(content, title = '提示', type = 'info', config = {}, cate = 'confirm') {
6
+ content = content || '确定提交吗?';
7
+ const icon = {
8
+ info: InfoCircleFilled,
9
+ warning: ExclamationCircleFilled,
10
+ success: CheckCircleFilled,
11
+ error: CloseCircleFilled,
12
+ };
13
+ const iconStyles = {
14
+ info: 'color:#FF9019;',
15
+ warning: 'color:#FF9019;',
16
+ success: 'color:#29CC7A;',
17
+ error: 'color:#E64C2E;',
18
+ };
19
+ return new Promise((resolve) => {
20
+ AModal[cate](Object.assign(Object.assign({ class: `bm-confirm-modal bm-confirm-modal-${type}`, closable: false, title, centered: true, icon: createVNode(icon[type], { style: iconStyles[type] }), content: typeof content === 'object'
21
+ ? h('div', { style: 'color:#555;' }, content.map((ele) => {
22
+ return h('p', ele);
23
+ }))
24
+ : createVNode('div', { style: 'color:#555;' }, content) }, config), { onOk() {
25
+ resolve(true);
26
+ },
27
+ onCancel() {
28
+ resolve(false);
29
+ } }));
30
+ });
31
+ },
32
+ toThousands(num) {
33
+ num = String(num);
34
+ if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(num)) {
35
+ return num;
36
+ }
37
+ let a = RegExp.$1;
38
+ let b = RegExp.$2;
39
+ let c = RegExp.$3;
40
+ let re = /(\\d)(\\d{3})(,|$)/;
41
+ re.compile('(\\d)(\\d{3})(,|$)');
42
+ while (re.test(b)) {
43
+ b = b.replace(re, '$1,$2$3');
44
+ }
45
+ return a + '' + b + '' + c;
46
+ },
47
+ toFixNumHasDefault(value, num = 0, isMoney = false, defaultValue = '-') {
48
+ if (value === 0 || value === '0' || value) {
49
+ return ((isMoney ? '¥' : '') +
50
+ (value === 0 || value === '0'
51
+ ? 0
52
+ : this.toThousands(Number(value).toFixed(num))));
53
+ }
54
+ else {
55
+ return defaultValue;
56
+ }
57
+ },
58
+ wait(ms = 0) {
59
+ return new Promise((resolve) => setTimeout(resolve, ms));
60
+ },
61
+ };
62
+ export default utils;
@@ -36,7 +36,7 @@ declare const BmAttachment: import("bm-admin-ui/es/utils/with-install").SFCWithI
36
36
  default: number;
37
37
  };
38
38
  width: {
39
- type: (NumberConstructor | StringConstructor)[];
39
+ type: (StringConstructor | NumberConstructor)[];
40
40
  default: number;
41
41
  };
42
42
  showAlways: {
@@ -36,7 +36,7 @@ declare const _default: import("vue").DefineComponent<{
36
36
  default: number;
37
37
  };
38
38
  width: {
39
- type: (NumberConstructor | StringConstructor)[];
39
+ type: (StringConstructor | NumberConstructor)[];
40
40
  default: number;
41
41
  };
42
42
  showAlways: {
@@ -78,7 +78,7 @@ declare const BmButton: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
78
78
  onMousedown: {
79
79
  type: import("vue").PropType<(event: MouseEvent) => void>;
80
80
  };
81
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
81
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "ghost" | "danger" | "htmlType" | "loading" | "disabled" | "block">;
82
82
  $attrs: {
83
83
  [x: string]: unknown;
84
84
  };
@@ -80,7 +80,7 @@ declare const _default: import("vue").DefineComponent<{
80
80
  onMousedown: {
81
81
  type: import("vue").PropType<(event: MouseEvent) => void>;
82
82
  };
83
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
83
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "ghost" | "danger" | "htmlType" | "loading" | "disabled" | "block">;
84
84
  $attrs: {
85
85
  [x: string]: unknown;
86
86
  };
@@ -23,8 +23,8 @@ declare const BmCascader: import("bm-admin-ui/es/utils/with-install").SFCWithIns
23
23
  default: () => number;
24
24
  };
25
25
  }>>, {
26
- tipType: string;
27
26
  width: number;
27
+ tipType: string;
28
28
  }>>;
29
29
  export { BmCascader };
30
30
  export default BmCascader;
@@ -23,7 +23,7 @@ declare var _default: import("vue").DefineComponent<{
23
23
  default: () => number;
24
24
  };
25
25
  }>>, {
26
- tipType: string;
27
26
  width: number;
27
+ tipType: string;
28
28
  }>;
29
29
  export default _default;