bm-admin-ui 1.2.29-alpha → 1.2.31-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 (82) 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/flow-designer/index.js +32 -10
  15. package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  16. package/es/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  17. package/es/components/form-create/index.js +748 -198
  18. package/es/components/form-designer/index.js +118 -22
  19. package/es/components/over-tooltips/index.d.ts +1 -1
  20. package/es/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  21. package/es/components/search-filter/index.js +4 -2
  22. package/es/components/staffs-selector/index.d.ts +8 -8
  23. package/es/components/staffs-selector/index.js +2 -2
  24. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  25. package/es/components/upload/index.d.ts +1 -1
  26. package/es/components/upload/src/upload.vue.d.ts +1 -1
  27. package/es/utils/index.d.ts +7 -0
  28. package/es/utils/index.js +62 -0
  29. package/es/utils/isNull.js +1 -1
  30. package/lib/components/attachment/index.d.ts +1 -1
  31. package/lib/components/attachment/src/attachment.vue.d.ts +1 -1
  32. package/lib/components/button/index.d.ts +1 -1
  33. package/lib/components/button/src/button.vue.d.ts +1 -1
  34. package/lib/components/cascader/index.d.ts +1 -1
  35. package/lib/components/cascader/src/cascader.vue.d.ts +1 -1
  36. package/lib/components/edit-form/index.d.ts +2 -2
  37. package/lib/components/edit-form/src/edit-form.vue.d.ts +2 -2
  38. package/lib/components/editor/index.d.ts +3 -3
  39. package/lib/components/editor/src/editor.vue.d.ts +3 -3
  40. package/lib/components/feedback/index.d.ts +12 -12
  41. package/lib/components/feedback/src/bmAlert.vue.d.ts +5 -5
  42. package/lib/components/feedback/src/bmModal.vue.d.ts +7 -7
  43. package/lib/components/flow-designer/index.js +32 -10
  44. package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  45. package/lib/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  46. package/lib/components/form-create/index.js +751 -198
  47. package/lib/components/form-designer/index.js +117 -21
  48. package/lib/components/over-tooltips/index.d.ts +1 -1
  49. package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  50. package/lib/components/search-filter/index.js +3 -1
  51. package/lib/components/staffs-selector/index.d.ts +8 -8
  52. package/lib/components/staffs-selector/index.js +2 -2
  53. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  54. package/lib/components/upload/index.d.ts +1 -1
  55. package/lib/components/upload/src/upload.vue.d.ts +1 -1
  56. package/lib/utils/index.d.ts +7 -0
  57. package/lib/utils/index.js +64 -0
  58. package/lib/utils/isNull.js +1 -1
  59. package/package.json +1 -1
  60. package/theme-chalk/index.css +1 -1
  61. package/types/components/attachment/index.d.ts +1 -1
  62. package/types/components/attachment/src/attachment.vue.d.ts +1 -1
  63. package/types/components/button/index.d.ts +1 -1
  64. package/types/components/button/src/button.vue.d.ts +1 -1
  65. package/types/components/cascader/index.d.ts +1 -1
  66. package/types/components/cascader/src/cascader.vue.d.ts +1 -1
  67. package/types/components/edit-form/index.d.ts +2 -2
  68. package/types/components/edit-form/src/edit-form.vue.d.ts +2 -2
  69. package/types/components/editor/index.d.ts +3 -3
  70. package/types/components/editor/src/editor.vue.d.ts +3 -3
  71. package/types/components/feedback/index.d.ts +12 -12
  72. package/types/components/feedback/src/bmAlert.vue.d.ts +5 -5
  73. package/types/components/feedback/src/bmModal.vue.d.ts +7 -7
  74. package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  75. package/types/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  76. package/types/components/over-tooltips/index.d.ts +1 -1
  77. package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  78. package/types/components/staffs-selector/index.d.ts +8 -8
  79. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  80. package/types/components/upload/index.d.ts +1 -1
  81. package/types/components/upload/src/upload.vue.d.ts +1 -1
  82. package/types/utils/index.d.ts +7 -0
@@ -5,7 +5,7 @@ import Draggable from 'vuedraggable';
5
5
  import { Tooltip, FormItemRest, Input, Button, RadioGroup, Radio, DatePicker, Checkbox, Tabs, TabPane, Row, Col, Dropdown, Menu, CheckboxGroup, MenuItem, Divider, Switch, Select, Layout, LayoutSider, LayoutContent, message } from 'ant-design-vue';
6
6
  import { HolderOutlined, EditOutlined, PlusOutlined, QuestionCircleOutlined, InfoCircleFilled, ExclamationCircleFilled } from '@ant-design/icons-vue';
7
7
  import { BmUpload } from 'bm-admin-ui/es/components';
8
- import { cloneDeep } from 'lodash-es';
8
+ import { isObject, cloneDeep } from 'lodash-es';
9
9
  import FC from '@form-create/ant-design-vue';
10
10
 
11
11
  var WidgetType;
@@ -672,6 +672,9 @@ const label$e = '数字输入框';
672
672
  const fieldsMap$e = {
673
673
  'title.title': 'title.title',
674
674
  'props.placeholder': 'props.placeholder',
675
+ 'props.precision': 'props.precision',
676
+ 'props.min': 'props.min',
677
+ 'props.addonAfter': 'props.addonAfter',
675
678
  value: 'value',
676
679
  'config.fieldRatio': 'config.fieldRatio',
677
680
  'config.count': 'config.count',
@@ -780,6 +783,9 @@ var numInput = {
780
783
  },
781
784
  props: {
782
785
  placeholder: rule.props.placeholder,
786
+ precision: rule.props.precision,
787
+ min: rule.props.min,
788
+ addonAfter: rule.props.addonAfter,
783
789
  },
784
790
  value: rule.value,
785
791
  config: {
@@ -1298,7 +1304,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1298
1304
  default: withCtx(() => [
1299
1305
  createVNode(unref(Radio), { value: 0 }, {
1300
1306
  default: withCtx(() => [
1301
- createTextVNode(" \u5F53\u524D\u65F6\u95F4(\u5E74/\u6708/\u65E5) "),
1307
+ createTextVNode(" \u5F53\u524D\u65F6\u95F4"),
1308
+ createCommentVNode(" (\u5E74/\u6708/\u65E5) "),
1302
1309
  createVNode(unref(Tooltip), null, {
1303
1310
  title: withCtx(() => [
1304
1311
  createTextVNode(" \u83B7\u53D6\u7528\u6237\u5B9E\u9645\u586B\u5199\u65F6\u7684\u65F6\u95F4 ")
@@ -1879,11 +1886,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1879
1886
  emits("mouseleave");
1880
1887
  }
1881
1888
  function emitSetActiveRuleEvt(rule) {
1889
+ if (rule?.config.immutable)
1890
+ return;
1882
1891
  emits("set-active-rule", rule, tableRule.value);
1883
1892
  }
1884
1893
  function handleClick(element) {
1885
- if (element?.config.immutable)
1886
- return;
1887
1894
  emitSetActiveRuleEvt(element);
1888
1895
  }
1889
1896
  function handleUpdate({ newIndex }) {
@@ -2785,7 +2792,7 @@ var materialTemp = {
2785
2792
  const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("div", { class: "bm-product-info-item__title" }, "\u5546\u54C1\u7F16\u53F7", -1);
2786
2793
  const _hoisted_2$5 = { class: "bm-product-info-item__content" };
2787
2794
  const _hoisted_3$4 = { class: "bm-product-info-item__title" };
2788
- const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u5E26\u51FA", -1);
2795
+ const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6", -1);
2789
2796
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2790
2797
  __name: "product-info",
2791
2798
  props: ["formCreateInject"],
@@ -3548,10 +3555,6 @@ const formDesignerProps = {
3548
3555
  type: Boolean,
3549
3556
  default: false,
3550
3557
  },
3551
- dragCheckFunc: {
3552
- type: Function,
3553
- default: (underlying_vm) => true,
3554
- },
3555
3558
  formRulePipe: {
3556
3559
  type: Function,
3557
3560
  default: (obj) => obj,
@@ -3560,9 +3563,13 @@ const formDesignerProps = {
3560
3563
  type: Function,
3561
3564
  default: (pushRuleWidget, pushRowWidget, pushTableWidget) => null,
3562
3565
  },
3563
- deleteFormItemCheck: {
3566
+ resetCmpRatio: {
3564
3567
  type: Function,
3565
- default: (targetRule, parentRule) => true,
3568
+ default: (ruleName, parentRuleName) => 0,
3569
+ },
3570
+ dragingCallback: {
3571
+ type: Object,
3572
+ default: () => ({}),
3566
3573
  },
3567
3574
  };
3568
3575
 
@@ -3634,6 +3641,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3634
3641
  });
3635
3642
  var CheckboxSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "checkbox-switch.vue"]]);
3636
3643
 
3644
+ function checkRuleConfigObj(obj) {
3645
+ if (!isObject(obj))
3646
+ return false;
3647
+ const parses = ['icon', 'label', 'name', 'parse', 'props', 'rule'];
3648
+ for (const parse of parses) {
3649
+ if (!obj[parse]) {
3650
+ console.error(`控件配置对象缺少【${parse}】字段,请补充完整`);
3651
+ return false;
3652
+ }
3653
+ }
3654
+ return true;
3655
+ }
3637
3656
  const widgetsTableAccept = {
3638
3657
  [input.name]: input,
3639
3658
  [textarea.name]: textarea,
@@ -3665,8 +3684,20 @@ const widgetNamesRowAccept = [
3665
3684
  shop.name,
3666
3685
  materialType.name,
3667
3686
  ];
3687
+ const tableWidgetsProxy = new Proxy(widgetsTableAccept, {
3688
+ get(target, prop) {
3689
+ return target[String(prop)];
3690
+ },
3691
+ set(target, prop, value) {
3692
+ if (!checkRuleConfigObj(value)) {
3693
+ return false;
3694
+ }
3695
+ target[String(prop)] = value;
3696
+ return true;
3697
+ },
3698
+ });
3668
3699
  function pushTableWidgets(key, config) {
3669
- widgetsTableAccept[key] = config;
3700
+ tableWidgetsProxy[key] = config;
3670
3701
  }
3671
3702
  function pushRowWidgets(key) {
3672
3703
  widgetNamesRowAccept.push(key);
@@ -3691,8 +3722,20 @@ const rules = {
3691
3722
  [shop.name]: shop,
3692
3723
  [materialType.name]: materialType,
3693
3724
  };
3725
+ const rulesProxy = new Proxy(rules, {
3726
+ get(target, prop) {
3727
+ return target[String(prop)];
3728
+ },
3729
+ set(target, prop, value) {
3730
+ if (!checkRuleConfigObj(value)) {
3731
+ return false;
3732
+ }
3733
+ target[String(prop)] = value;
3734
+ return true;
3735
+ },
3736
+ });
3694
3737
  function pushRuleWidgets(key, config) {
3695
- rules[key] = config;
3738
+ rulesProxy[key] = config;
3696
3739
  }
3697
3740
 
3698
3741
  const _hoisted_1$1 = {
@@ -3914,6 +3957,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3914
3957
  department: "\u9664\u201C\u5FC5\u586B\u3001\u9009\u9879\u201D\u5185\u5BB9\u8BBE\u7F6E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u5176\u4ED6\u4FE1\u606F\u53EF\u4FEE\u6539"
3915
3958
  };
3916
3959
  const tabData = typeof props.formRulePipe === "function" ? props.formRulePipe(createTab()) : [];
3960
+ (() => {
3961
+ if (!(tabData instanceof Array)) {
3962
+ console.error("formRulePipe\u5C5E\u6027\u8FD4\u56DE\u53C2\u6570\u7C7B\u578B\u5E94\u4E3AArray");
3963
+ }
3964
+ tabData.some((tab) => {
3965
+ if (!tab["key"] || !tab["tab"] || !tab["menuList"] || !(tab["menuList"] instanceof Array)) {
3966
+ console.error(
3967
+ "\u8BF7\u6B63\u786E\u914D\u7F6EformRulePipe\u8FD4\u56DE\u6570\u7EC4\u7C7B\u578B:{key:string, tab:string, menuList: {name:string, title: string, list: any[]}[]}[]"
3968
+ );
3969
+ return true;
3970
+ }
3971
+ });
3972
+ })();
3917
3973
  typeof props.addWidgetFunc === "function" && props.addWidgetFunc(pushRuleWidgets, pushRowWidgets, pushTableWidgets);
3918
3974
  const activeKey = ref("controlLibrary");
3919
3975
  const widgetFormRules = reactive([]);
@@ -3921,6 +3977,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3921
3977
  const cacheProps = reactive({});
3922
3978
  const fApi = ref();
3923
3979
  const activeParentRule = ref();
3980
+ const defaultCallbackfun = {
3981
+ movingCallback: (config) => true,
3982
+ deleteCallback: (targetRule, parentRule) => true,
3983
+ afterAdded: (targetRule, parentRule) => null,
3984
+ rearrangeCallback: (config) => true
3985
+ };
3986
+ function executeCallback(func) {
3987
+ if (!props.dragingCallback[func] || typeof props.dragingCallback[func] !== "function") {
3988
+ return defaultCallbackfun[func];
3989
+ }
3990
+ return props.dragingCallback[func];
3991
+ }
3924
3992
  const menuList = computed(
3925
3993
  () => tabData.find((tab) => tab.key === activeKey.value)?.menuList
3926
3994
  );
@@ -3953,10 +4021,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3953
4021
  }
3954
4022
  }
3955
4023
  function moveMenuItem(evt) {
3956
- return props?.dragCheckFunc(evt?.dragged?._underlying_vm_) && checkDragMove(evt);
4024
+ return executeCallback("movingCallback")(
4025
+ evt?.dragged?._underlying_vm_?.config?.config
4026
+ ) && checkDragMove(evt);
3957
4027
  }
3958
4028
  function moveFormItem(evt) {
3959
- return props?.dragCheckFunc(evt?.dragged?._underlying_vm_) && checkDragMove(evt);
4029
+ return executeCallback("rearrangeCallback")(
4030
+ evt?.dragged?._underlying_vm_?.config?.config
4031
+ ) && checkDragMove(evt);
3960
4032
  }
3961
4033
  function handleMenuItemDragStart(evt) {
3962
4034
  const item = evt.item.children[0];
@@ -3980,7 +4052,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3980
4052
  const rule = makeRule(config);
3981
4053
  const activeParentRuleName = activeParentRule.value?.config?.config?.name;
3982
4054
  if (!widgetNamesRowAccept.includes(config.name) && activeParentRuleName === "row" || !Object.keys(widgetsTableAccept).includes(config.name) && activeParentRuleName === "table") {
3983
- disabledTip(activeParentRule.value.config.config.name);
4055
+ disabledTip(activeParentRule.value?.config?.config?.name);
4056
+ } else if (!executeCallback("movingCallback")(config)) {
4057
+ return;
3984
4058
  } else {
3985
4059
  const index = activeRuleInList.value.findIndex(
3986
4060
  (item) => item.field === activeRule.value.field
@@ -4016,6 +4090,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4016
4090
  }
4017
4091
  function handleFormItemAdd({ newIndex }) {
4018
4092
  const rule = widgetFormRules[newIndex];
4093
+ executeCallback("afterAdded")(rule, void 0);
4019
4094
  dragAdd(rule);
4020
4095
  hideShowDragTip();
4021
4096
  }
@@ -4051,6 +4126,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4051
4126
  return newRule;
4052
4127
  }
4053
4128
  function handleFormItemCopy(rule, parentRule) {
4129
+ if (!executeCallback("movingCallback")(rule.config.config)) {
4130
+ return;
4131
+ }
4054
4132
  const newRule = copyRule(
4055
4133
  rule,
4056
4134
  rule.config.config,
@@ -4059,7 +4137,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4059
4137
  setActiveRule(newRule, parentRule);
4060
4138
  }
4061
4139
  function handleFormItemDelete(targetRule, parentRule) {
4062
- const customerCheck = props.deleteFormItemCheck(targetRule, parentRule);
4140
+ const customerCheck = executeCallback("deleteCallback")(
4141
+ targetRule,
4142
+ parentRule
4143
+ );
4063
4144
  if (!customerCheck) {
4064
4145
  return;
4065
4146
  }
@@ -4079,8 +4160,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4079
4160
  delete cacheProps[targetRule.field];
4080
4161
  if (targetRule.field === activeRule.value.field) {
4081
4162
  const newIndex = Math.min(parentList.length - 1, index);
4082
- if (newIndex >= 0) {
4083
- setActiveRule(parentList[newIndex]);
4163
+ const next = parentList[newIndex];
4164
+ if (newIndex >= 0 && !next?.config?.immutable) {
4165
+ setActiveRule(next);
4084
4166
  } else if (parentRule) {
4085
4167
  setActiveRule(parentRule);
4086
4168
  } else {
@@ -4155,6 +4237,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4155
4237
  });
4156
4238
  }
4157
4239
  function handleWidgetAdd(rule, parentRule) {
4240
+ executeCallback("afterAdded")(rule, parentRule);
4158
4241
  dragAdd(rule, parentRule);
4159
4242
  }
4160
4243
  function handlePropsSetActive(rule) {
@@ -4173,10 +4256,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4173
4256
  if (!parentRuleType) {
4174
4257
  rule.config.fieldRatio = "100%";
4175
4258
  } else if (parentRuleType === WidgetType.RowWidget) {
4176
- const ruleName = rule.config.config.name;
4177
- rule.config.fieldRatio = ruleName === "table" || ruleName === "product" ? 24 : 12;
4259
+ const customRadio = props.resetCmpRatio(
4260
+ rule.config.config.name,
4261
+ parentRuleType
4262
+ );
4263
+ if (customRadio) {
4264
+ rule.config.fieldRatio = customRadio;
4265
+ return;
4266
+ }
4267
+ rule.config.fieldRatio = ["table", "product"].includes(
4268
+ rule.config.config.name
4269
+ ) ? 24 : 12;
4178
4270
  } else if (parentRuleType === WidgetType.TableWidget) {
4179
- rule.config.fieldRatio = "140px";
4271
+ const customRadio = props.resetCmpRatio(
4272
+ rule.config.config.name,
4273
+ parentRuleType
4274
+ );
4275
+ rule.config.fieldRatio = customRadio || "140px";
4180
4276
  }
4181
4277
  }
4182
4278
  function getFormRule() {
@@ -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: {
@@ -1,7 +1,7 @@
1
1
  import { withInstall } from 'bm-admin-ui/es/utils/with-install';
2
2
  import { defineComponent, ref, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, toDisplayString, createCommentVNode, createTextVNode, createBlock, createElementVNode, createVNode, withCtx, getCurrentInstance, reactive, watch, mergeProps, isRef, withModifiers, h, onBeforeUnmount, nextTick, normalizeClass } from 'vue';
3
3
  import FormCreateCtr from '@form-create/ant-design-vue';
4
- import { UpOutlined, DownOutlined, SearchOutlined } from '@ant-design/icons-vue';
4
+ import { UpOutlined, DownOutlined, SearchOutlined, ExclamationCircleFilled } from '@ant-design/icons-vue';
5
5
  import ASelect from 'ant-design-vue/lib/select';
6
6
  import { cloneDeep } from 'lodash-es';
7
7
  import Modal from 'ant-design-vue/lib/modal';
@@ -438,7 +438,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
438
438
  let defaultConfig = {
439
439
  title: "\u786E\u5B9A\u8BBE\u7F6E\u5F53\u524D\u67E5\u8BE2\u6761\u4EF6\u4E3A\u9ED8\u8BA4\u67E5\u8BE2\u5417\uFF1F",
440
440
  okText: "\u786E\u8BA4",
441
- cancelText: "\u53D6\u6D88"
441
+ cancelText: "\u53D6\u6D88",
442
+ centered: true,
443
+ icon: createVNode(ExclamationCircleFilled)
442
444
  };
443
445
  Modal.confirm({
444
446
  ...defaultConfig,
@@ -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;
@@ -191,13 +191,13 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
191
191
  value: _ctx.searchVal,
192
192
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
193
193
  placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D",
194
- onBlur: _ctx.search
194
+ onChange: _ctx.search
195
195
  }, {
196
196
  suffix: withCtx(() => [
197
197
  createVNode(_component_search_outlined, { style: { color: "#9393A3" } })
198
198
  ]),
199
199
  _: 1
200
- }, 8, ["value", "onBlur"]),
200
+ }, 8, ["value", "onChange"]),
201
201
  createElementVNode("div", _hoisted_4$3, [
202
202
  createElementVNode("div", _hoisted_5$3, [
203
203
  withDirectives(createVNode(_component_Checkbox, {
@@ -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;
@@ -1,5 +1,5 @@
1
1
  export function isNull(value) {
2
- return (!value ||
2
+ return ([null, undefined, ''].includes(value) ||
3
3
  (Array.isArray(value) && !value.length) ||
4
4
  (value.constructor === Object && !Object.keys(value).length));
5
5
  }
@@ -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;