bm-admin-ui 1.2.29-alpha → 1.2.30-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 (83) 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 +743 -197
  18. package/es/components/form-designer/index.js +116 -21
  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/staffs-selector/index.d.ts +8 -8
  22. package/es/components/staffs-selector/index.js +2 -2
  23. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  24. package/es/components/upload/index.d.ts +1 -1
  25. package/es/components/upload/src/upload.vue.d.ts +1 -1
  26. package/es/utils/index.d.ts +7 -0
  27. package/es/utils/index.js +62 -0
  28. package/es/utils/isNull.js +1 -1
  29. package/lib/components/attachment/index.d.ts +1 -1
  30. package/lib/components/attachment/src/attachment.vue.d.ts +1 -1
  31. package/lib/components/button/index.d.ts +1 -1
  32. package/lib/components/button/src/button.vue.d.ts +1 -1
  33. package/lib/components/cascader/index.d.ts +1 -1
  34. package/lib/components/cascader/src/cascader.vue.d.ts +1 -1
  35. package/lib/components/edit-form/index.d.ts +2 -2
  36. package/lib/components/edit-form/src/edit-form.vue.d.ts +2 -2
  37. package/lib/components/editor/index.d.ts +3 -3
  38. package/lib/components/editor/src/editor.vue.d.ts +3 -3
  39. package/lib/components/feedback/index.d.ts +12 -12
  40. package/lib/components/feedback/src/bmAlert.vue.d.ts +5 -5
  41. package/lib/components/feedback/src/bmModal.vue.d.ts +7 -7
  42. package/lib/components/flow-designer/index.js +32 -10
  43. package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  44. package/lib/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  45. package/lib/components/form-create/index.js +746 -197
  46. package/lib/components/form-designer/index.js +115 -20
  47. package/lib/components/over-tooltips/index.d.ts +1 -1
  48. package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  49. package/lib/components/staffs-selector/index.d.ts +8 -8
  50. package/lib/components/staffs-selector/index.js +2 -2
  51. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  52. package/lib/components/upload/index.d.ts +1 -1
  53. package/lib/components/upload/src/upload.vue.d.ts +1 -1
  54. package/lib/utils/index.d.ts +7 -0
  55. package/lib/utils/index.js +64 -0
  56. package/lib/utils/isNull.js +1 -1
  57. package/package.json +1 -1
  58. package/theme-chalk/attachment.css +1 -1
  59. package/theme-chalk/index.css +2 -2
  60. package/types/components/attachment/index.d.ts +1 -1
  61. package/types/components/attachment/src/attachment.vue.d.ts +1 -1
  62. package/types/components/button/index.d.ts +1 -1
  63. package/types/components/button/src/button.vue.d.ts +1 -1
  64. package/types/components/cascader/index.d.ts +1 -1
  65. package/types/components/cascader/src/cascader.vue.d.ts +1 -1
  66. package/types/components/edit-form/index.d.ts +2 -2
  67. package/types/components/edit-form/src/edit-form.vue.d.ts +2 -2
  68. package/types/components/editor/index.d.ts +3 -3
  69. package/types/components/editor/src/editor.vue.d.ts +3 -3
  70. package/types/components/feedback/index.d.ts +12 -12
  71. package/types/components/feedback/src/bmAlert.vue.d.ts +5 -5
  72. package/types/components/feedback/src/bmModal.vue.d.ts +7 -7
  73. package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  74. package/types/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  75. package/types/components/over-tooltips/index.d.ts +1 -1
  76. package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  77. package/types/components/staffs-selector/index.d.ts +8 -8
  78. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  79. package/types/components/upload/index.d.ts +1 -1
  80. package/types/components/upload/src/upload.vue.d.ts +1 -1
  81. package/types/utils/index.d.ts +7 -0
  82. package/es/index.js +0 -13
  83. package/lib/index.js +0 -42
@@ -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: {
@@ -1879,11 +1885,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1879
1885
  emits("mouseleave");
1880
1886
  }
1881
1887
  function emitSetActiveRuleEvt(rule) {
1888
+ if (rule?.config.immutable)
1889
+ return;
1882
1890
  emits("set-active-rule", rule, tableRule.value);
1883
1891
  }
1884
1892
  function handleClick(element) {
1885
- if (element?.config.immutable)
1886
- return;
1887
1893
  emitSetActiveRuleEvt(element);
1888
1894
  }
1889
1895
  function handleUpdate({ newIndex }) {
@@ -2785,7 +2791,7 @@ var materialTemp = {
2785
2791
  const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("div", { class: "bm-product-info-item__title" }, "\u5546\u54C1\u7F16\u53F7", -1);
2786
2792
  const _hoisted_2$5 = { class: "bm-product-info-item__content" };
2787
2793
  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);
2794
+ const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6", -1);
2789
2795
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2790
2796
  __name: "product-info",
2791
2797
  props: ["formCreateInject"],
@@ -3548,10 +3554,6 @@ const formDesignerProps = {
3548
3554
  type: Boolean,
3549
3555
  default: false,
3550
3556
  },
3551
- dragCheckFunc: {
3552
- type: Function,
3553
- default: (underlying_vm) => true,
3554
- },
3555
3557
  formRulePipe: {
3556
3558
  type: Function,
3557
3559
  default: (obj) => obj,
@@ -3560,9 +3562,13 @@ const formDesignerProps = {
3560
3562
  type: Function,
3561
3563
  default: (pushRuleWidget, pushRowWidget, pushTableWidget) => null,
3562
3564
  },
3563
- deleteFormItemCheck: {
3565
+ resetCmpRatio: {
3564
3566
  type: Function,
3565
- default: (targetRule, parentRule) => true,
3567
+ default: (ruleName, parentRuleName) => 0,
3568
+ },
3569
+ dragingCallback: {
3570
+ type: Object,
3571
+ default: () => ({}),
3566
3572
  },
3567
3573
  };
3568
3574
 
@@ -3634,6 +3640,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3634
3640
  });
3635
3641
  var CheckboxSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "checkbox-switch.vue"]]);
3636
3642
 
3643
+ function checkRuleConfigObj(obj) {
3644
+ if (!isObject(obj))
3645
+ return false;
3646
+ const parses = ['icon', 'label', 'name', 'parse', 'props', 'rule'];
3647
+ for (const parse of parses) {
3648
+ if (!obj[parse]) {
3649
+ console.error(`控件配置对象缺少【${parse}】字段,请补充完整`);
3650
+ return false;
3651
+ }
3652
+ }
3653
+ return true;
3654
+ }
3637
3655
  const widgetsTableAccept = {
3638
3656
  [input.name]: input,
3639
3657
  [textarea.name]: textarea,
@@ -3665,8 +3683,20 @@ const widgetNamesRowAccept = [
3665
3683
  shop.name,
3666
3684
  materialType.name,
3667
3685
  ];
3686
+ const tableWidgetsProxy = new Proxy(widgetsTableAccept, {
3687
+ get(target, prop) {
3688
+ return target[String(prop)];
3689
+ },
3690
+ set(target, prop, value) {
3691
+ if (!checkRuleConfigObj(value)) {
3692
+ return false;
3693
+ }
3694
+ target[String(prop)] = value;
3695
+ return true;
3696
+ },
3697
+ });
3668
3698
  function pushTableWidgets(key, config) {
3669
- widgetsTableAccept[key] = config;
3699
+ tableWidgetsProxy[key] = config;
3670
3700
  }
3671
3701
  function pushRowWidgets(key) {
3672
3702
  widgetNamesRowAccept.push(key);
@@ -3691,8 +3721,20 @@ const rules = {
3691
3721
  [shop.name]: shop,
3692
3722
  [materialType.name]: materialType,
3693
3723
  };
3724
+ const rulesProxy = new Proxy(rules, {
3725
+ get(target, prop) {
3726
+ return target[String(prop)];
3727
+ },
3728
+ set(target, prop, value) {
3729
+ if (!checkRuleConfigObj(value)) {
3730
+ return false;
3731
+ }
3732
+ target[String(prop)] = value;
3733
+ return true;
3734
+ },
3735
+ });
3694
3736
  function pushRuleWidgets(key, config) {
3695
- rules[key] = config;
3737
+ rulesProxy[key] = config;
3696
3738
  }
3697
3739
 
3698
3740
  const _hoisted_1$1 = {
@@ -3914,6 +3956,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3914
3956
  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
3957
  };
3916
3958
  const tabData = typeof props.formRulePipe === "function" ? props.formRulePipe(createTab()) : [];
3959
+ (() => {
3960
+ if (!(tabData instanceof Array)) {
3961
+ console.error("formRulePipe\u5C5E\u6027\u8FD4\u56DE\u53C2\u6570\u7C7B\u578B\u5E94\u4E3AArray");
3962
+ }
3963
+ tabData.some((tab) => {
3964
+ if (!tab["key"] || !tab["tab"] || !tab["menuList"] || !(tab["menuList"] instanceof Array)) {
3965
+ console.error(
3966
+ "\u8BF7\u6B63\u786E\u914D\u7F6EformRulePipe\u8FD4\u56DE\u6570\u7EC4\u7C7B\u578B:{key:string, tab:string, menuList: {name:string, title: string, list: any[]}[]}[]"
3967
+ );
3968
+ return true;
3969
+ }
3970
+ });
3971
+ })();
3917
3972
  typeof props.addWidgetFunc === "function" && props.addWidgetFunc(pushRuleWidgets, pushRowWidgets, pushTableWidgets);
3918
3973
  const activeKey = ref("controlLibrary");
3919
3974
  const widgetFormRules = reactive([]);
@@ -3921,6 +3976,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3921
3976
  const cacheProps = reactive({});
3922
3977
  const fApi = ref();
3923
3978
  const activeParentRule = ref();
3979
+ const defaultCallbackfun = {
3980
+ movingCallback: (config) => true,
3981
+ deleteCallback: (targetRule, parentRule) => true,
3982
+ afterAdded: (targetRule, parentRule) => null,
3983
+ rearrangeCallback: (config) => true
3984
+ };
3985
+ function executeCallback(func) {
3986
+ if (!props.dragingCallback[func] || typeof props.dragingCallback[func] !== "function") {
3987
+ return defaultCallbackfun[func];
3988
+ }
3989
+ return props.dragingCallback[func];
3990
+ }
3924
3991
  const menuList = computed(
3925
3992
  () => tabData.find((tab) => tab.key === activeKey.value)?.menuList
3926
3993
  );
@@ -3953,10 +4020,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3953
4020
  }
3954
4021
  }
3955
4022
  function moveMenuItem(evt) {
3956
- return props?.dragCheckFunc(evt?.dragged?._underlying_vm_) && checkDragMove(evt);
4023
+ return executeCallback("movingCallback")(
4024
+ evt?.dragged?._underlying_vm_?.config?.config
4025
+ ) && checkDragMove(evt);
3957
4026
  }
3958
4027
  function moveFormItem(evt) {
3959
- return props?.dragCheckFunc(evt?.dragged?._underlying_vm_) && checkDragMove(evt);
4028
+ return executeCallback("rearrangeCallback")(
4029
+ evt?.dragged?._underlying_vm_?.config?.config
4030
+ ) && checkDragMove(evt);
3960
4031
  }
3961
4032
  function handleMenuItemDragStart(evt) {
3962
4033
  const item = evt.item.children[0];
@@ -3980,7 +4051,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3980
4051
  const rule = makeRule(config);
3981
4052
  const activeParentRuleName = activeParentRule.value?.config?.config?.name;
3982
4053
  if (!widgetNamesRowAccept.includes(config.name) && activeParentRuleName === "row" || !Object.keys(widgetsTableAccept).includes(config.name) && activeParentRuleName === "table") {
3983
- disabledTip(activeParentRule.value.config.config.name);
4054
+ disabledTip(activeParentRule.value?.config?.config?.name);
4055
+ } else if (!executeCallback("movingCallback")(config)) {
4056
+ return;
3984
4057
  } else {
3985
4058
  const index = activeRuleInList.value.findIndex(
3986
4059
  (item) => item.field === activeRule.value.field
@@ -4016,6 +4089,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4016
4089
  }
4017
4090
  function handleFormItemAdd({ newIndex }) {
4018
4091
  const rule = widgetFormRules[newIndex];
4092
+ executeCallback("afterAdded")(rule, void 0);
4019
4093
  dragAdd(rule);
4020
4094
  hideShowDragTip();
4021
4095
  }
@@ -4051,6 +4125,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4051
4125
  return newRule;
4052
4126
  }
4053
4127
  function handleFormItemCopy(rule, parentRule) {
4128
+ if (!executeCallback("movingCallback")(rule.config.config)) {
4129
+ return;
4130
+ }
4054
4131
  const newRule = copyRule(
4055
4132
  rule,
4056
4133
  rule.config.config,
@@ -4059,7 +4136,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4059
4136
  setActiveRule(newRule, parentRule);
4060
4137
  }
4061
4138
  function handleFormItemDelete(targetRule, parentRule) {
4062
- const customerCheck = props.deleteFormItemCheck(targetRule, parentRule);
4139
+ const customerCheck = executeCallback("deleteCallback")(
4140
+ targetRule,
4141
+ parentRule
4142
+ );
4063
4143
  if (!customerCheck) {
4064
4144
  return;
4065
4145
  }
@@ -4079,8 +4159,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4079
4159
  delete cacheProps[targetRule.field];
4080
4160
  if (targetRule.field === activeRule.value.field) {
4081
4161
  const newIndex = Math.min(parentList.length - 1, index);
4082
- if (newIndex >= 0) {
4083
- setActiveRule(parentList[newIndex]);
4162
+ const next = parentList[newIndex];
4163
+ if (newIndex >= 0 && !next?.config?.immutable) {
4164
+ setActiveRule(next);
4084
4165
  } else if (parentRule) {
4085
4166
  setActiveRule(parentRule);
4086
4167
  } else {
@@ -4155,6 +4236,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4155
4236
  });
4156
4237
  }
4157
4238
  function handleWidgetAdd(rule, parentRule) {
4239
+ executeCallback("afterAdded")(rule, parentRule);
4158
4240
  dragAdd(rule, parentRule);
4159
4241
  }
4160
4242
  function handlePropsSetActive(rule) {
@@ -4173,10 +4255,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4173
4255
  if (!parentRuleType) {
4174
4256
  rule.config.fieldRatio = "100%";
4175
4257
  } else if (parentRuleType === WidgetType.RowWidget) {
4176
- const ruleName = rule.config.config.name;
4177
- rule.config.fieldRatio = ruleName === "table" || ruleName === "product" ? 24 : 12;
4258
+ const customRadio = props.resetCmpRatio(
4259
+ rule.config.config.name,
4260
+ parentRuleType
4261
+ );
4262
+ if (customRadio) {
4263
+ rule.config.fieldRatio = customRadio;
4264
+ return;
4265
+ }
4266
+ rule.config.fieldRatio = ["table", "product"].includes(
4267
+ rule.config.config.name
4268
+ ) ? 24 : 12;
4178
4269
  } else if (parentRuleType === WidgetType.TableWidget) {
4179
- rule.config.fieldRatio = "140px";
4270
+ const customRadio = props.resetCmpRatio(
4271
+ rule.config.config.name,
4272
+ parentRuleType
4273
+ );
4274
+ rule.config.fieldRatio = customRadio || "140px";
4180
4275
  }
4181
4276
  }
4182
4277
  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: {
@@ -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;
@@ -47,7 +47,7 @@ declare const BmEditForm: import("bm-admin-ui/es/utils/with-install").SFCWithIns
47
47
  };
48
48
  tmpForm: import("vue").Ref<Record<string, any>>;
49
49
  formRef: import("vue").Ref<import("ant-design-vue").FormInstance | null>;
50
- colCount: import("vue").ComputedRef<2 | 3 | 1>;
50
+ colCount: import("vue").ComputedRef<2 | 1 | 3>;
51
51
  getValueOfOption: (key: string | undefined, defaultKey: "label" | "value", option: any) => string;
52
52
  getPopupContainer: (e: any) => any;
53
53
  getColsConfig: (type: "labelCol" | "wrapperCol", item: import("./src/types").Control, index?: number | undefined) => {
@@ -103,7 +103,7 @@ declare const BmEditForm: import("bm-admin-ui/es/utils/with-install").SFCWithIns
103
103
  default: number;
104
104
  };
105
105
  width: {
106
- type: (NumberConstructor | StringConstructor)[];
106
+ type: (StringConstructor | NumberConstructor)[];
107
107
  default: number;
108
108
  };
109
109
  showAlways: {
@@ -46,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{
46
46
  };
47
47
  tmpForm: import("vue").Ref<Record<string, any>>;
48
48
  formRef: import("vue").Ref<FormInstance | null>;
49
- colCount: import("vue").ComputedRef<2 | 3 | 1>;
49
+ colCount: import("vue").ComputedRef<2 | 1 | 3>;
50
50
  getValueOfOption: (key: string | undefined, defaultKey: "label" | "value", option: any) => string;
51
51
  getPopupContainer: (e: any) => any;
52
52
  getColsConfig: (type: "labelCol" | "wrapperCol", item: import("./types").Control, index?: number | undefined) => {
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{
102
102
  default: number;
103
103
  };
104
104
  width: {
105
- type: (NumberConstructor | StringConstructor)[];
105
+ type: (StringConstructor | NumberConstructor)[];
106
106
  default: number;
107
107
  };
108
108
  showAlways: {