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.
- package/es/components/attachment/index.d.ts +1 -1
- package/es/components/attachment/src/attachment.vue.d.ts +1 -1
- package/es/components/button/index.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +1 -1
- package/es/components/cascader/index.d.ts +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +1 -1
- package/es/components/edit-form/index.d.ts +2 -2
- package/es/components/edit-form/src/edit-form.vue.d.ts +2 -2
- package/es/components/editor/index.d.ts +3 -3
- package/es/components/editor/src/editor.vue.d.ts +3 -3
- package/es/components/feedback/index.d.ts +12 -12
- package/es/components/feedback/src/bmAlert.vue.d.ts +5 -5
- package/es/components/feedback/src/bmModal.vue.d.ts +7 -7
- package/es/components/flow-designer/index.js +32 -10
- package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
- package/es/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
- package/es/components/form-create/index.js +743 -197
- package/es/components/form-designer/index.js +116 -21
- package/es/components/over-tooltips/index.d.ts +1 -1
- package/es/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
- package/es/components/staffs-selector/index.d.ts +8 -8
- package/es/components/staffs-selector/index.js +2 -2
- package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
- package/es/components/upload/index.d.ts +1 -1
- package/es/components/upload/src/upload.vue.d.ts +1 -1
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +62 -0
- package/es/utils/isNull.js +1 -1
- package/lib/components/attachment/index.d.ts +1 -1
- package/lib/components/attachment/src/attachment.vue.d.ts +1 -1
- package/lib/components/button/index.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +1 -1
- package/lib/components/cascader/index.d.ts +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +1 -1
- package/lib/components/edit-form/index.d.ts +2 -2
- package/lib/components/edit-form/src/edit-form.vue.d.ts +2 -2
- package/lib/components/editor/index.d.ts +3 -3
- package/lib/components/editor/src/editor.vue.d.ts +3 -3
- package/lib/components/feedback/index.d.ts +12 -12
- package/lib/components/feedback/src/bmAlert.vue.d.ts +5 -5
- package/lib/components/feedback/src/bmModal.vue.d.ts +7 -7
- package/lib/components/flow-designer/index.js +32 -10
- package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
- package/lib/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
- package/lib/components/form-create/index.js +746 -197
- package/lib/components/form-designer/index.js +115 -20
- package/lib/components/over-tooltips/index.d.ts +1 -1
- package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
- package/lib/components/staffs-selector/index.d.ts +8 -8
- package/lib/components/staffs-selector/index.js +2 -2
- package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
- package/lib/components/upload/index.d.ts +1 -1
- package/lib/components/upload/src/upload.vue.d.ts +1 -1
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +64 -0
- package/lib/utils/isNull.js +1 -1
- package/package.json +1 -1
- package/theme-chalk/attachment.css +1 -1
- package/theme-chalk/index.css +2 -2
- package/types/components/attachment/index.d.ts +1 -1
- package/types/components/attachment/src/attachment.vue.d.ts +1 -1
- package/types/components/button/index.d.ts +1 -1
- package/types/components/button/src/button.vue.d.ts +1 -1
- package/types/components/cascader/index.d.ts +1 -1
- package/types/components/cascader/src/cascader.vue.d.ts +1 -1
- package/types/components/edit-form/index.d.ts +2 -2
- package/types/components/edit-form/src/edit-form.vue.d.ts +2 -2
- package/types/components/editor/index.d.ts +3 -3
- package/types/components/editor/src/editor.vue.d.ts +3 -3
- package/types/components/feedback/index.d.ts +12 -12
- package/types/components/feedback/src/bmAlert.vue.d.ts +5 -5
- package/types/components/feedback/src/bmModal.vue.d.ts +7 -7
- package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
- package/types/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
- package/types/components/over-tooltips/index.d.ts +1 -1
- package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
- package/types/components/staffs-selector/index.d.ts +8 -8
- package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
- package/types/components/upload/index.d.ts +1 -1
- package/types/components/upload/src/upload.vue.d.ts +1 -1
- package/types/utils/index.d.ts +7 -0
- package/es/index.js +0 -13
- package/lib/index.js +0 -42
|
@@ -682,6 +682,9 @@ const label$e = '数字输入框';
|
|
|
682
682
|
const fieldsMap$e = {
|
|
683
683
|
'title.title': 'title.title',
|
|
684
684
|
'props.placeholder': 'props.placeholder',
|
|
685
|
+
'props.precision': 'props.precision',
|
|
686
|
+
'props.min': 'props.min',
|
|
687
|
+
'props.addonAfter': 'props.addonAfter',
|
|
685
688
|
value: 'value',
|
|
686
689
|
'config.fieldRatio': 'config.fieldRatio',
|
|
687
690
|
'config.count': 'config.count',
|
|
@@ -790,6 +793,9 @@ var numInput = {
|
|
|
790
793
|
},
|
|
791
794
|
props: {
|
|
792
795
|
placeholder: rule.props.placeholder,
|
|
796
|
+
precision: rule.props.precision,
|
|
797
|
+
min: rule.props.min,
|
|
798
|
+
addonAfter: rule.props.addonAfter,
|
|
793
799
|
},
|
|
794
800
|
value: rule.value,
|
|
795
801
|
config: {
|
|
@@ -1889,11 +1895,11 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
1889
1895
|
emits("mouseleave");
|
|
1890
1896
|
}
|
|
1891
1897
|
function emitSetActiveRuleEvt(rule) {
|
|
1898
|
+
if (rule?.config.immutable)
|
|
1899
|
+
return;
|
|
1892
1900
|
emits("set-active-rule", rule, tableRule.value);
|
|
1893
1901
|
}
|
|
1894
1902
|
function handleClick(element) {
|
|
1895
|
-
if (element?.config.immutable)
|
|
1896
|
-
return;
|
|
1897
1903
|
emitSetActiveRuleEvt(element);
|
|
1898
1904
|
}
|
|
1899
1905
|
function handleUpdate({ newIndex }) {
|
|
@@ -2795,7 +2801,7 @@ var materialTemp = {
|
|
|
2795
2801
|
const _hoisted_1$7 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__title" }, "\u5546\u54C1\u7F16\u53F7", -1);
|
|
2796
2802
|
const _hoisted_2$5 = { class: "bm-product-info-item__content" };
|
|
2797
2803
|
const _hoisted_3$4 = { class: "bm-product-info-item__title" };
|
|
2798
|
-
const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\
|
|
2804
|
+
const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6", -1);
|
|
2799
2805
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
2800
2806
|
__name: "product-info",
|
|
2801
2807
|
props: ["formCreateInject"],
|
|
@@ -3558,10 +3564,6 @@ const formDesignerProps = {
|
|
|
3558
3564
|
type: Boolean,
|
|
3559
3565
|
default: false,
|
|
3560
3566
|
},
|
|
3561
|
-
dragCheckFunc: {
|
|
3562
|
-
type: Function,
|
|
3563
|
-
default: (underlying_vm) => true,
|
|
3564
|
-
},
|
|
3565
3567
|
formRulePipe: {
|
|
3566
3568
|
type: Function,
|
|
3567
3569
|
default: (obj) => obj,
|
|
@@ -3570,9 +3572,13 @@ const formDesignerProps = {
|
|
|
3570
3572
|
type: Function,
|
|
3571
3573
|
default: (pushRuleWidget, pushRowWidget, pushTableWidget) => null,
|
|
3572
3574
|
},
|
|
3573
|
-
|
|
3575
|
+
resetCmpRatio: {
|
|
3574
3576
|
type: Function,
|
|
3575
|
-
default: (
|
|
3577
|
+
default: (ruleName, parentRuleName) => 0,
|
|
3578
|
+
},
|
|
3579
|
+
dragingCallback: {
|
|
3580
|
+
type: Object,
|
|
3581
|
+
default: () => ({}),
|
|
3576
3582
|
},
|
|
3577
3583
|
};
|
|
3578
3584
|
|
|
@@ -3644,6 +3650,18 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3644
3650
|
});
|
|
3645
3651
|
var CheckboxSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "checkbox-switch.vue"]]);
|
|
3646
3652
|
|
|
3653
|
+
function checkRuleConfigObj(obj) {
|
|
3654
|
+
if (!lodashEs.isObject(obj))
|
|
3655
|
+
return false;
|
|
3656
|
+
const parses = ['icon', 'label', 'name', 'parse', 'props', 'rule'];
|
|
3657
|
+
for (const parse of parses) {
|
|
3658
|
+
if (!obj[parse]) {
|
|
3659
|
+
console.error(`控件配置对象缺少【${parse}】字段,请补充完整`);
|
|
3660
|
+
return false;
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
return true;
|
|
3664
|
+
}
|
|
3647
3665
|
const widgetsTableAccept = {
|
|
3648
3666
|
[input.name]: input,
|
|
3649
3667
|
[textarea.name]: textarea,
|
|
@@ -3675,8 +3693,20 @@ const widgetNamesRowAccept = [
|
|
|
3675
3693
|
shop.name,
|
|
3676
3694
|
materialType.name,
|
|
3677
3695
|
];
|
|
3696
|
+
const tableWidgetsProxy = new Proxy(widgetsTableAccept, {
|
|
3697
|
+
get(target, prop) {
|
|
3698
|
+
return target[String(prop)];
|
|
3699
|
+
},
|
|
3700
|
+
set(target, prop, value) {
|
|
3701
|
+
if (!checkRuleConfigObj(value)) {
|
|
3702
|
+
return false;
|
|
3703
|
+
}
|
|
3704
|
+
target[String(prop)] = value;
|
|
3705
|
+
return true;
|
|
3706
|
+
},
|
|
3707
|
+
});
|
|
3678
3708
|
function pushTableWidgets(key, config) {
|
|
3679
|
-
|
|
3709
|
+
tableWidgetsProxy[key] = config;
|
|
3680
3710
|
}
|
|
3681
3711
|
function pushRowWidgets(key) {
|
|
3682
3712
|
widgetNamesRowAccept.push(key);
|
|
@@ -3701,8 +3731,20 @@ const rules = {
|
|
|
3701
3731
|
[shop.name]: shop,
|
|
3702
3732
|
[materialType.name]: materialType,
|
|
3703
3733
|
};
|
|
3734
|
+
const rulesProxy = new Proxy(rules, {
|
|
3735
|
+
get(target, prop) {
|
|
3736
|
+
return target[String(prop)];
|
|
3737
|
+
},
|
|
3738
|
+
set(target, prop, value) {
|
|
3739
|
+
if (!checkRuleConfigObj(value)) {
|
|
3740
|
+
return false;
|
|
3741
|
+
}
|
|
3742
|
+
target[String(prop)] = value;
|
|
3743
|
+
return true;
|
|
3744
|
+
},
|
|
3745
|
+
});
|
|
3704
3746
|
function pushRuleWidgets(key, config) {
|
|
3705
|
-
|
|
3747
|
+
rulesProxy[key] = config;
|
|
3706
3748
|
}
|
|
3707
3749
|
|
|
3708
3750
|
const _hoisted_1$1 = {
|
|
@@ -3924,6 +3966,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
3924
3966
|
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"
|
|
3925
3967
|
};
|
|
3926
3968
|
const tabData = typeof props.formRulePipe === "function" ? props.formRulePipe(createTab()) : [];
|
|
3969
|
+
(() => {
|
|
3970
|
+
if (!(tabData instanceof Array)) {
|
|
3971
|
+
console.error("formRulePipe\u5C5E\u6027\u8FD4\u56DE\u53C2\u6570\u7C7B\u578B\u5E94\u4E3AArray");
|
|
3972
|
+
}
|
|
3973
|
+
tabData.some((tab) => {
|
|
3974
|
+
if (!tab["key"] || !tab["tab"] || !tab["menuList"] || !(tab["menuList"] instanceof Array)) {
|
|
3975
|
+
console.error(
|
|
3976
|
+
"\u8BF7\u6B63\u786E\u914D\u7F6EformRulePipe\u8FD4\u56DE\u6570\u7EC4\u7C7B\u578B:{key:string, tab:string, menuList: {name:string, title: string, list: any[]}[]}[]"
|
|
3977
|
+
);
|
|
3978
|
+
return true;
|
|
3979
|
+
}
|
|
3980
|
+
});
|
|
3981
|
+
})();
|
|
3927
3982
|
typeof props.addWidgetFunc === "function" && props.addWidgetFunc(pushRuleWidgets, pushRowWidgets, pushTableWidgets);
|
|
3928
3983
|
const activeKey = vue.ref("controlLibrary");
|
|
3929
3984
|
const widgetFormRules = vue.reactive([]);
|
|
@@ -3931,6 +3986,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
3931
3986
|
const cacheProps = vue.reactive({});
|
|
3932
3987
|
const fApi = vue.ref();
|
|
3933
3988
|
const activeParentRule = vue.ref();
|
|
3989
|
+
const defaultCallbackfun = {
|
|
3990
|
+
movingCallback: (config) => true,
|
|
3991
|
+
deleteCallback: (targetRule, parentRule) => true,
|
|
3992
|
+
afterAdded: (targetRule, parentRule) => null,
|
|
3993
|
+
rearrangeCallback: (config) => true
|
|
3994
|
+
};
|
|
3995
|
+
function executeCallback(func) {
|
|
3996
|
+
if (!props.dragingCallback[func] || typeof props.dragingCallback[func] !== "function") {
|
|
3997
|
+
return defaultCallbackfun[func];
|
|
3998
|
+
}
|
|
3999
|
+
return props.dragingCallback[func];
|
|
4000
|
+
}
|
|
3934
4001
|
const menuList = vue.computed(
|
|
3935
4002
|
() => tabData.find((tab) => tab.key === activeKey.value)?.menuList
|
|
3936
4003
|
);
|
|
@@ -3963,10 +4030,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
3963
4030
|
}
|
|
3964
4031
|
}
|
|
3965
4032
|
function moveMenuItem(evt) {
|
|
3966
|
-
return
|
|
4033
|
+
return executeCallback("movingCallback")(
|
|
4034
|
+
evt?.dragged?._underlying_vm_?.config?.config
|
|
4035
|
+
) && checkDragMove(evt);
|
|
3967
4036
|
}
|
|
3968
4037
|
function moveFormItem(evt) {
|
|
3969
|
-
return
|
|
4038
|
+
return executeCallback("rearrangeCallback")(
|
|
4039
|
+
evt?.dragged?._underlying_vm_?.config?.config
|
|
4040
|
+
) && checkDragMove(evt);
|
|
3970
4041
|
}
|
|
3971
4042
|
function handleMenuItemDragStart(evt) {
|
|
3972
4043
|
const item = evt.item.children[0];
|
|
@@ -3990,7 +4061,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
3990
4061
|
const rule = makeRule(config);
|
|
3991
4062
|
const activeParentRuleName = activeParentRule.value?.config?.config?.name;
|
|
3992
4063
|
if (!widgetNamesRowAccept.includes(config.name) && activeParentRuleName === "row" || !Object.keys(widgetsTableAccept).includes(config.name) && activeParentRuleName === "table") {
|
|
3993
|
-
disabledTip(activeParentRule.value
|
|
4064
|
+
disabledTip(activeParentRule.value?.config?.config?.name);
|
|
4065
|
+
} else if (!executeCallback("movingCallback")(config)) {
|
|
4066
|
+
return;
|
|
3994
4067
|
} else {
|
|
3995
4068
|
const index = activeRuleInList.value.findIndex(
|
|
3996
4069
|
(item) => item.field === activeRule.value.field
|
|
@@ -4026,6 +4099,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4026
4099
|
}
|
|
4027
4100
|
function handleFormItemAdd({ newIndex }) {
|
|
4028
4101
|
const rule = widgetFormRules[newIndex];
|
|
4102
|
+
executeCallback("afterAdded")(rule, void 0);
|
|
4029
4103
|
dragAdd(rule);
|
|
4030
4104
|
hideShowDragTip();
|
|
4031
4105
|
}
|
|
@@ -4061,6 +4135,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4061
4135
|
return newRule;
|
|
4062
4136
|
}
|
|
4063
4137
|
function handleFormItemCopy(rule, parentRule) {
|
|
4138
|
+
if (!executeCallback("movingCallback")(rule.config.config)) {
|
|
4139
|
+
return;
|
|
4140
|
+
}
|
|
4064
4141
|
const newRule = copyRule(
|
|
4065
4142
|
rule,
|
|
4066
4143
|
rule.config.config,
|
|
@@ -4069,7 +4146,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4069
4146
|
setActiveRule(newRule, parentRule);
|
|
4070
4147
|
}
|
|
4071
4148
|
function handleFormItemDelete(targetRule, parentRule) {
|
|
4072
|
-
const customerCheck =
|
|
4149
|
+
const customerCheck = executeCallback("deleteCallback")(
|
|
4150
|
+
targetRule,
|
|
4151
|
+
parentRule
|
|
4152
|
+
);
|
|
4073
4153
|
if (!customerCheck) {
|
|
4074
4154
|
return;
|
|
4075
4155
|
}
|
|
@@ -4089,8 +4169,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4089
4169
|
delete cacheProps[targetRule.field];
|
|
4090
4170
|
if (targetRule.field === activeRule.value.field) {
|
|
4091
4171
|
const newIndex = Math.min(parentList.length - 1, index);
|
|
4092
|
-
|
|
4093
|
-
|
|
4172
|
+
const next = parentList[newIndex];
|
|
4173
|
+
if (newIndex >= 0 && !next?.config?.immutable) {
|
|
4174
|
+
setActiveRule(next);
|
|
4094
4175
|
} else if (parentRule) {
|
|
4095
4176
|
setActiveRule(parentRule);
|
|
4096
4177
|
} else {
|
|
@@ -4165,6 +4246,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4165
4246
|
});
|
|
4166
4247
|
}
|
|
4167
4248
|
function handleWidgetAdd(rule, parentRule) {
|
|
4249
|
+
executeCallback("afterAdded")(rule, parentRule);
|
|
4168
4250
|
dragAdd(rule, parentRule);
|
|
4169
4251
|
}
|
|
4170
4252
|
function handlePropsSetActive(rule) {
|
|
@@ -4183,10 +4265,23 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4183
4265
|
if (!parentRuleType) {
|
|
4184
4266
|
rule.config.fieldRatio = "100%";
|
|
4185
4267
|
} else if (parentRuleType === WidgetType.RowWidget) {
|
|
4186
|
-
const
|
|
4187
|
-
|
|
4268
|
+
const customRadio = props.resetCmpRatio(
|
|
4269
|
+
rule.config.config.name,
|
|
4270
|
+
parentRuleType
|
|
4271
|
+
);
|
|
4272
|
+
if (customRadio) {
|
|
4273
|
+
rule.config.fieldRatio = customRadio;
|
|
4274
|
+
return;
|
|
4275
|
+
}
|
|
4276
|
+
rule.config.fieldRatio = ["table", "product"].includes(
|
|
4277
|
+
rule.config.config.name
|
|
4278
|
+
) ? 24 : 12;
|
|
4188
4279
|
} else if (parentRuleType === WidgetType.TableWidget) {
|
|
4189
|
-
|
|
4280
|
+
const customRadio = props.resetCmpRatio(
|
|
4281
|
+
rule.config.config.name,
|
|
4282
|
+
parentRuleType
|
|
4283
|
+
);
|
|
4284
|
+
rule.config.fieldRatio = customRadio || "140px";
|
|
4190
4285
|
}
|
|
4191
4286
|
}
|
|
4192
4287
|
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: (
|
|
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: (
|
|
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" | "
|
|
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: (
|
|
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: (
|
|
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: (
|
|
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;
|
|
@@ -195,13 +195,13 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
195
195
|
value: _ctx.searchVal,
|
|
196
196
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
|
|
197
197
|
placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D",
|
|
198
|
-
|
|
198
|
+
onChange: _ctx.search
|
|
199
199
|
}, {
|
|
200
200
|
suffix: vue.withCtx(() => [
|
|
201
201
|
vue.createVNode(_component_search_outlined, { style: { color: "#9393A3" } })
|
|
202
202
|
]),
|
|
203
203
|
_: 1
|
|
204
|
-
}, 8, ["value", "
|
|
204
|
+
}, 8, ["value", "onChange"]),
|
|
205
205
|
vue.createElementVNode("div", _hoisted_4$3, [
|
|
206
206
|
vue.createElementVNode("div", _hoisted_5$3, [
|
|
207
207
|
vue.withDirectives(vue.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: (
|
|
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" | "
|
|
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: (
|
|
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: (
|
|
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: (
|
|
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: (
|
|
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,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ant_design_vue_1 = require("ant-design-vue");
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const icons_vue_1 = require("@ant-design/icons-vue");
|
|
6
|
+
const utils = {
|
|
7
|
+
confirmModal(content, title = '提示', type = 'info', config = {}, cate = 'confirm') {
|
|
8
|
+
content = content || '确定提交吗?';
|
|
9
|
+
const icon = {
|
|
10
|
+
info: icons_vue_1.InfoCircleFilled,
|
|
11
|
+
warning: icons_vue_1.ExclamationCircleFilled,
|
|
12
|
+
success: icons_vue_1.CheckCircleFilled,
|
|
13
|
+
error: icons_vue_1.CloseCircleFilled,
|
|
14
|
+
};
|
|
15
|
+
const iconStyles = {
|
|
16
|
+
info: 'color:#FF9019;',
|
|
17
|
+
warning: 'color:#FF9019;',
|
|
18
|
+
success: 'color:#29CC7A;',
|
|
19
|
+
error: 'color:#E64C2E;',
|
|
20
|
+
};
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
ant_design_vue_1.Modal[cate](Object.assign(Object.assign({ class: `bm-confirm-modal bm-confirm-modal-${type}`, closable: false, title, centered: true, icon: (0, vue_1.createVNode)(icon[type], { style: iconStyles[type] }), content: typeof content === 'object'
|
|
23
|
+
? (0, vue_1.h)('div', { style: 'color:#555;' }, content.map((ele) => {
|
|
24
|
+
return (0, vue_1.h)('p', ele);
|
|
25
|
+
}))
|
|
26
|
+
: (0, vue_1.createVNode)('div', { style: 'color:#555;' }, content) }, config), { onOk() {
|
|
27
|
+
resolve(true);
|
|
28
|
+
},
|
|
29
|
+
onCancel() {
|
|
30
|
+
resolve(false);
|
|
31
|
+
} }));
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
toThousands(num) {
|
|
35
|
+
num = String(num);
|
|
36
|
+
if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(num)) {
|
|
37
|
+
return num;
|
|
38
|
+
}
|
|
39
|
+
let a = RegExp.$1;
|
|
40
|
+
let b = RegExp.$2;
|
|
41
|
+
let c = RegExp.$3;
|
|
42
|
+
let re = /(\\d)(\\d{3})(,|$)/;
|
|
43
|
+
re.compile('(\\d)(\\d{3})(,|$)');
|
|
44
|
+
while (re.test(b)) {
|
|
45
|
+
b = b.replace(re, '$1,$2$3');
|
|
46
|
+
}
|
|
47
|
+
return a + '' + b + '' + c;
|
|
48
|
+
},
|
|
49
|
+
toFixNumHasDefault(value, num = 0, isMoney = false, defaultValue = '-') {
|
|
50
|
+
if (value === 0 || value === '0' || value) {
|
|
51
|
+
return ((isMoney ? '¥' : '') +
|
|
52
|
+
(value === 0 || value === '0'
|
|
53
|
+
? 0
|
|
54
|
+
: this.toThousands(Number(value).toFixed(num))));
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return defaultValue;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
wait(ms = 0) {
|
|
61
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
exports.default = utils;
|
package/lib/utils/isNull.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isNull = void 0;
|
|
4
4
|
function isNull(value) {
|
|
5
|
-
return (
|
|
5
|
+
return ([null, undefined, ''].includes(value) ||
|
|
6
6
|
(Array.isArray(value) && !value.length) ||
|
|
7
7
|
(value.constructor === Object && !Object.keys(value).length));
|
|
8
8
|
}
|