bm-admin-ui 1.0.75-alpha → 1.0.76-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.
|
@@ -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
|
|
8
|
+
import { cloneDeep } from 'lodash-es';
|
|
9
9
|
import FC from '@form-create/ant-design-vue';
|
|
10
10
|
|
|
11
11
|
var WidgetType;
|
|
@@ -3238,9 +3238,6 @@ var shop = {
|
|
|
3238
3238
|
name: name$1,
|
|
3239
3239
|
label: label$1,
|
|
3240
3240
|
rule() {
|
|
3241
|
-
console.log('---------------');
|
|
3242
|
-
console.log(`第${i + 1}次添加店铺控件`);
|
|
3243
|
-
console.log('---------------');
|
|
3244
3241
|
return {
|
|
3245
3242
|
type: 'Select',
|
|
3246
3243
|
field: uniqueId(),
|
|
@@ -3987,19 +3984,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3987
3984
|
function handleFormItemClick(rule) {
|
|
3988
3985
|
setActiveRule(rule);
|
|
3989
3986
|
}
|
|
3990
|
-
function copyRule(rule,
|
|
3991
|
-
const newRule = makeRule(
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3987
|
+
function copyRule(rule, ruleConfig, ruleHost, isCopyChildRule = false) {
|
|
3988
|
+
const newRule = makeRule(ruleConfig);
|
|
3989
|
+
if (isCopyChildRule) {
|
|
3990
|
+
ruleHost.push(newRule);
|
|
3991
|
+
} else {
|
|
3992
|
+
const index = ruleHost.findIndex(
|
|
3993
|
+
(ruleItem) => ruleItem.field === rule.field
|
|
3994
|
+
);
|
|
3995
|
+
ruleHost.splice(index + 1, 0, newRule);
|
|
3996
|
+
}
|
|
3995
3997
|
copyPropValue(rule, newRule);
|
|
3996
|
-
if (rule
|
|
3997
|
-
rule.config.childRules.forEach((cRule) =>
|
|
3998
|
+
if (rule?.config?.childRules?.length) {
|
|
3999
|
+
rule.config.childRules.forEach((cRule) => {
|
|
4000
|
+
const config = cRule?.config?.config || ruleList[cRule.name];
|
|
4001
|
+
copyRule(cRule, config, newRule.config.childRules, true);
|
|
4002
|
+
});
|
|
3998
4003
|
}
|
|
3999
4004
|
return newRule;
|
|
4000
4005
|
}
|
|
4001
4006
|
function handleFormItemCopy(rule, parentRule) {
|
|
4002
|
-
const newRule = copyRule(
|
|
4007
|
+
const newRule = copyRule(
|
|
4008
|
+
rule,
|
|
4009
|
+
rule.config.config,
|
|
4010
|
+
parentRule?.config?.childRules || widgetFormRules
|
|
4011
|
+
);
|
|
4003
4012
|
setActiveRule(newRule, parentRule);
|
|
4004
4013
|
}
|
|
4005
4014
|
function handleFormItemDelete(targetRule, parentRule) {
|
|
@@ -4132,22 +4141,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4132
4141
|
}
|
|
4133
4142
|
function edit(formRules) {
|
|
4134
4143
|
widgetFormRules.splice(0);
|
|
4135
|
-
formRules.forEach(
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
}
|
|
4139
|
-
function recursiveMakeRule(item) {
|
|
4140
|
-
const rule = makeRule(ruleList[item.name]);
|
|
4141
|
-
delete item.name;
|
|
4142
|
-
if (item?.config?.childRules?.length) {
|
|
4143
|
-
rule.config.childRules = item.config.childRules.map((childItem) => {
|
|
4144
|
-
const childRule = recursiveMakeRule(childItem);
|
|
4145
|
-
delete childItem.name;
|
|
4146
|
-
return childRule;
|
|
4147
|
-
});
|
|
4148
|
-
}
|
|
4149
|
-
merge(rule, item);
|
|
4150
|
-
return rule;
|
|
4144
|
+
formRules.forEach(
|
|
4145
|
+
(item) => copyRule(item, ruleList[item.name], widgetFormRules, true)
|
|
4146
|
+
);
|
|
4151
4147
|
}
|
|
4152
4148
|
function getRule(name) {
|
|
4153
4149
|
return makeRule(ruleList[name]);
|
|
@@ -3248,9 +3248,6 @@ var shop = {
|
|
|
3248
3248
|
name: name$1,
|
|
3249
3249
|
label: label$1,
|
|
3250
3250
|
rule() {
|
|
3251
|
-
console.log('---------------');
|
|
3252
|
-
console.log(`第${i + 1}次添加店铺控件`);
|
|
3253
|
-
console.log('---------------');
|
|
3254
3251
|
return {
|
|
3255
3252
|
type: 'Select',
|
|
3256
3253
|
field: uniqueId__default["default"](),
|
|
@@ -3997,19 +3994,31 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
3997
3994
|
function handleFormItemClick(rule) {
|
|
3998
3995
|
setActiveRule(rule);
|
|
3999
3996
|
}
|
|
4000
|
-
function copyRule(rule,
|
|
4001
|
-
const newRule = makeRule(
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
3997
|
+
function copyRule(rule, ruleConfig, ruleHost, isCopyChildRule = false) {
|
|
3998
|
+
const newRule = makeRule(ruleConfig);
|
|
3999
|
+
if (isCopyChildRule) {
|
|
4000
|
+
ruleHost.push(newRule);
|
|
4001
|
+
} else {
|
|
4002
|
+
const index = ruleHost.findIndex(
|
|
4003
|
+
(ruleItem) => ruleItem.field === rule.field
|
|
4004
|
+
);
|
|
4005
|
+
ruleHost.splice(index + 1, 0, newRule);
|
|
4006
|
+
}
|
|
4005
4007
|
copyPropValue(rule, newRule);
|
|
4006
|
-
if (rule
|
|
4007
|
-
rule.config.childRules.forEach((cRule) =>
|
|
4008
|
+
if (rule?.config?.childRules?.length) {
|
|
4009
|
+
rule.config.childRules.forEach((cRule) => {
|
|
4010
|
+
const config = cRule?.config?.config || ruleList[cRule.name];
|
|
4011
|
+
copyRule(cRule, config, newRule.config.childRules, true);
|
|
4012
|
+
});
|
|
4008
4013
|
}
|
|
4009
4014
|
return newRule;
|
|
4010
4015
|
}
|
|
4011
4016
|
function handleFormItemCopy(rule, parentRule) {
|
|
4012
|
-
const newRule = copyRule(
|
|
4017
|
+
const newRule = copyRule(
|
|
4018
|
+
rule,
|
|
4019
|
+
rule.config.config,
|
|
4020
|
+
parentRule?.config?.childRules || widgetFormRules
|
|
4021
|
+
);
|
|
4013
4022
|
setActiveRule(newRule, parentRule);
|
|
4014
4023
|
}
|
|
4015
4024
|
function handleFormItemDelete(targetRule, parentRule) {
|
|
@@ -4142,22 +4151,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4142
4151
|
}
|
|
4143
4152
|
function edit(formRules) {
|
|
4144
4153
|
widgetFormRules.splice(0);
|
|
4145
|
-
formRules.forEach(
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
}
|
|
4149
|
-
function recursiveMakeRule(item) {
|
|
4150
|
-
const rule = makeRule(ruleList[item.name]);
|
|
4151
|
-
delete item.name;
|
|
4152
|
-
if (item?.config?.childRules?.length) {
|
|
4153
|
-
rule.config.childRules = item.config.childRules.map((childItem) => {
|
|
4154
|
-
const childRule = recursiveMakeRule(childItem);
|
|
4155
|
-
delete childItem.name;
|
|
4156
|
-
return childRule;
|
|
4157
|
-
});
|
|
4158
|
-
}
|
|
4159
|
-
lodashEs.merge(rule, item);
|
|
4160
|
-
return rule;
|
|
4154
|
+
formRules.forEach(
|
|
4155
|
+
(item) => copyRule(item, ruleList[item.name], widgetFormRules, true)
|
|
4156
|
+
);
|
|
4161
4157
|
}
|
|
4162
4158
|
function getRule(name) {
|
|
4163
4159
|
return makeRule(ruleList[name]);
|