bm-admin-ui 1.0.61-alpha → 1.0.63-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.
|
@@ -593,11 +593,15 @@ var picture = {
|
|
|
593
593
|
listType: 'picture-card',
|
|
594
594
|
text: '请选择',
|
|
595
595
|
multiple: maxCount > 1,
|
|
596
|
+
accept: '.jpg,.png',
|
|
596
597
|
},
|
|
597
598
|
extraProps: {
|
|
598
599
|
maxSize: 10,
|
|
599
600
|
maxCount,
|
|
600
601
|
},
|
|
602
|
+
customErrors: {
|
|
603
|
+
format: '请上传jpg、png格式的图片',
|
|
604
|
+
},
|
|
601
605
|
defaultList: data.value,
|
|
602
606
|
uploadRequest(inject, file) {
|
|
603
607
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -623,7 +627,7 @@ var picture = {
|
|
|
623
627
|
});
|
|
624
628
|
},
|
|
625
629
|
error(inject, error) {
|
|
626
|
-
message.error(error.message);
|
|
630
|
+
message.error(error === null || error === void 0 ? void 0 : error.message);
|
|
627
631
|
},
|
|
628
632
|
},
|
|
629
633
|
};
|
|
@@ -1506,14 +1510,25 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1506
1510
|
const field = rule.field;
|
|
1507
1511
|
const associatedFields = rule?.config?.associatedFields;
|
|
1508
1512
|
let result = void 0;
|
|
1509
|
-
|
|
1510
|
-
|
|
1513
|
+
try {
|
|
1514
|
+
if (row[field]) {
|
|
1515
|
+
result = await props.extraConfig.product.fetch({
|
|
1516
|
+
productCode: row[field]
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
1520
|
+
return result;
|
|
1521
|
+
} catch (e) {
|
|
1522
|
+
row[field] = "";
|
|
1523
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
1524
|
+
return Promise.resolve(result);
|
|
1511
1525
|
}
|
|
1526
|
+
}
|
|
1527
|
+
function processAssociatedFields(field, associatedFields, row, result) {
|
|
1512
1528
|
if (associatedFields.length)
|
|
1513
1529
|
associatedFields.forEach((item) => {
|
|
1514
1530
|
row[productPicName(item.value, field)] = result ? result[productInfoKeyMap[item.value]] : void 0;
|
|
1515
1531
|
});
|
|
1516
|
-
return result;
|
|
1517
1532
|
}
|
|
1518
1533
|
function handleChange(e) {
|
|
1519
1534
|
const file = e.target.files[0];
|
|
@@ -1696,11 +1711,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1696
1711
|
return !formData.value[shopField];
|
|
1697
1712
|
}
|
|
1698
1713
|
function handlePressEnter(rule, row) {
|
|
1699
|
-
queryProductInfo(rule, row)
|
|
1700
|
-
if (!data2) {
|
|
1701
|
-
row[rule.field] = "";
|
|
1702
|
-
}
|
|
1703
|
-
});
|
|
1714
|
+
queryProductInfo(rule, row);
|
|
1704
1715
|
}
|
|
1705
1716
|
function handleProductInputChange(rule, row) {
|
|
1706
1717
|
queryProductInfoDebounce(rule, row);
|
|
@@ -2090,6 +2101,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2090
2101
|
tempSelected: {}
|
|
2091
2102
|
};
|
|
2092
2103
|
}
|
|
2104
|
+
function handleError(e) {
|
|
2105
|
+
message.error(e?.message);
|
|
2106
|
+
}
|
|
2093
2107
|
props.value && initValue(props.value);
|
|
2094
2108
|
props.extraConfig.materialTemp.getDict().then((data) => {
|
|
2095
2109
|
measrueDicts.value = data;
|
|
@@ -2320,14 +2334,19 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2320
2334
|
listType: "picture-card",
|
|
2321
2335
|
text: "\u4E0A\u4F20\u56FE\u7247",
|
|
2322
2336
|
multiple: true,
|
|
2323
|
-
disabled: __props.disabled?.includes?.("uploadPic")
|
|
2337
|
+
disabled: __props.disabled?.includes?.("uploadPic"),
|
|
2338
|
+
accept: ".jpg,.png"
|
|
2324
2339
|
},
|
|
2325
2340
|
"extra-props": {
|
|
2326
2341
|
maxCount: 9
|
|
2327
2342
|
},
|
|
2328
2343
|
"upload-request": __props.extraConfig.materialTemp.uploadRequest,
|
|
2329
2344
|
"default-list": pane.uploadList,
|
|
2330
|
-
|
|
2345
|
+
"custom-errors": {
|
|
2346
|
+
format: "\u8BF7\u4E0A\u4F20jpg\u3001png\u683C\u5F0F\u7684\u56FE\u7247"
|
|
2347
|
+
},
|
|
2348
|
+
onUpdate: handleUpload,
|
|
2349
|
+
onError: handleError
|
|
2331
2350
|
}, null, 8, ["upload-props", "upload-request", "default-list"])
|
|
2332
2351
|
]),
|
|
2333
2352
|
_: 2
|
|
@@ -2613,6 +2632,7 @@ var product = {
|
|
|
2613
2632
|
on: {
|
|
2614
2633
|
change(inject, value) {
|
|
2615
2634
|
inject.self.value = value;
|
|
2635
|
+
inject.self.props.defalutValue = value;
|
|
2616
2636
|
nextTick(() => {
|
|
2617
2637
|
inject.api.validateField(inject.self.field);
|
|
2618
2638
|
});
|
|
@@ -2639,6 +2659,10 @@ var product = {
|
|
|
2639
2659
|
on: {
|
|
2640
2660
|
change(inject, value) {
|
|
2641
2661
|
inject.self.value = value;
|
|
2662
|
+
inject.self.props.defalutValue = value;
|
|
2663
|
+
nextTick(() => {
|
|
2664
|
+
inject.api.validateField(inject.self.field);
|
|
2665
|
+
});
|
|
2642
2666
|
},
|
|
2643
2667
|
},
|
|
2644
2668
|
};
|
|
@@ -3286,21 +3286,6 @@ var shop = {
|
|
|
3286
3286
|
value: rule.config.isMain,
|
|
3287
3287
|
hidden: !!parentRule,
|
|
3288
3288
|
inject: true,
|
|
3289
|
-
on: {
|
|
3290
|
-
change({ api, self }, value) {
|
|
3291
|
-
if (value) {
|
|
3292
|
-
api.mergeRule(fieldsMap$1['effect.required'], {
|
|
3293
|
-
value: true,
|
|
3294
|
-
props: { disabled: true },
|
|
3295
|
-
});
|
|
3296
|
-
}
|
|
3297
|
-
else {
|
|
3298
|
-
api.mergeRule(fieldsMap$1['effect.required'], {
|
|
3299
|
-
props: { disabled: false },
|
|
3300
|
-
});
|
|
3301
|
-
}
|
|
3302
|
-
},
|
|
3303
|
-
},
|
|
3304
3289
|
},
|
|
3305
3290
|
{
|
|
3306
3291
|
type: 'switch',
|
|
@@ -3997,7 +3982,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3997
3982
|
message.error("\u8BE5\u63A7\u4EF6\u5DF2\u88AB\u8BBE\u4E3A\u6570\u636E\u8FC7\u6EE4\u6761\u4EF6\uFF0C\u4E0D\u53EF\u5220\u9664\u3002");
|
|
3998
3983
|
return;
|
|
3999
3984
|
}
|
|
4000
|
-
if (props.flowCondition[targetRule.field]) {
|
|
3985
|
+
if (props.flowCondition?.[targetRule.field]) {
|
|
4001
3986
|
message.error(
|
|
4002
3987
|
`\u8BE5\u7EC4\u4EF6\u5728\u201C${props.flowCondition[targetRule.field]}\u201D\u5DF2\u88AB\u8BBE\u4E3A\u5BA1\u6279\u6761\u4EF6\uFF0C\u4E0D\u53EF\u5220\u9664\u3002`
|
|
4003
3988
|
);
|
|
@@ -4036,9 +4021,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4036
4021
|
if (!cacheProps[rule.field]) {
|
|
4037
4022
|
cacheProps[rule.field] = makePropRule(rule, parentRule);
|
|
4038
4023
|
}
|
|
4024
|
+
flowConditionEffect(props.flowCondition);
|
|
4039
4025
|
}
|
|
4040
4026
|
function propChange(field, value) {
|
|
4041
4027
|
setRulePropValue(field, value, activeRule.value);
|
|
4028
|
+
processShopProps(field, value);
|
|
4029
|
+
}
|
|
4030
|
+
function processShopProps(field, value) {
|
|
4031
|
+
if (activeRule.value?.config?.config.name === "shop") {
|
|
4032
|
+
if (field === "config.isMain") {
|
|
4033
|
+
const shopProps = cacheProps[activeRule.value.field];
|
|
4034
|
+
const requiredRule = shopProps.find(
|
|
4035
|
+
(rule) => rule.field === "effect.required"
|
|
4036
|
+
);
|
|
4037
|
+
if (value) {
|
|
4038
|
+
requiredRule.value = true;
|
|
4039
|
+
}
|
|
4040
|
+
flowConditionEffect(props.flowCondition);
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4042
4043
|
}
|
|
4043
4044
|
function setRulePropValue(field, value, rule) {
|
|
4044
4045
|
field.split(".").reduce((pre, cur, index, arr) => {
|
|
@@ -4161,48 +4162,53 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4161
4162
|
}
|
|
4162
4163
|
return pass;
|
|
4163
4164
|
}
|
|
4164
|
-
function flowConditionEffect(
|
|
4165
|
+
function flowConditionEffect(flowCondition) {
|
|
4165
4166
|
if (activeRule.value.config) {
|
|
4166
|
-
const
|
|
4167
|
+
const activeProps2 = cacheProps[activeRule.value.field];
|
|
4167
4168
|
const ruleName = activeRule.value.config.config.name;
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
}
|
|
4184
|
-
if (ruleName === "materialType") {
|
|
4185
|
-
const formatRule = activeProps2?.find(
|
|
4186
|
-
(rule) => rule.field === "config.format"
|
|
4187
|
-
);
|
|
4188
|
-
const multipleRule = activeProps2?.find(
|
|
4189
|
-
(rule) => rule.field === "props.multiple"
|
|
4190
|
-
);
|
|
4191
|
-
formatRule.props = {
|
|
4192
|
-
disabled: true
|
|
4193
|
-
};
|
|
4194
|
-
multipleRule.props = {
|
|
4195
|
-
disabled: true
|
|
4196
|
-
};
|
|
4197
|
-
}
|
|
4198
|
-
if (["people", "department"].includes(ruleName)) {
|
|
4199
|
-
const limitRule = activeProps2?.find(
|
|
4200
|
-
(rule) => rule.field === "props.limit"
|
|
4201
|
-
);
|
|
4202
|
-
limitRule.props = {
|
|
4203
|
-
disabled: true
|
|
4204
|
-
};
|
|
4169
|
+
let disabled;
|
|
4170
|
+
if (ruleName === "shop") {
|
|
4171
|
+
const isMainValue = activeProps2.find(
|
|
4172
|
+
(rule) => rule.field === "config.isMain"
|
|
4173
|
+
)?.value;
|
|
4174
|
+
disabled = !!flowCondition[activeRule.value.field] || isMainValue;
|
|
4175
|
+
} else {
|
|
4176
|
+
disabled = !!flowCondition[activeRule.value.field];
|
|
4177
|
+
}
|
|
4178
|
+
const requiredRule = activeProps2?.find(
|
|
4179
|
+
(rule) => rule.field === "effect.required"
|
|
4180
|
+
);
|
|
4181
|
+
if (requiredRule) {
|
|
4182
|
+
if (!requiredRule.props) {
|
|
4183
|
+
requiredRule.props = {};
|
|
4205
4184
|
}
|
|
4185
|
+
requiredRule.props.disabled = disabled;
|
|
4186
|
+
}
|
|
4187
|
+
if (["radio", "checkbox"].includes(ruleName)) {
|
|
4188
|
+
const optionsRule = activeProps2?.find((rule) => rule.field === "options");
|
|
4189
|
+
optionsRule.props.disabled = disabled;
|
|
4190
|
+
}
|
|
4191
|
+
if (ruleName === "materialType") {
|
|
4192
|
+
const formatRule = activeProps2?.find(
|
|
4193
|
+
(rule) => rule.field === "config.format"
|
|
4194
|
+
);
|
|
4195
|
+
const multipleRule = activeProps2?.find(
|
|
4196
|
+
(rule) => rule.field === "props.multiple"
|
|
4197
|
+
);
|
|
4198
|
+
formatRule.props = {
|
|
4199
|
+
disabled
|
|
4200
|
+
};
|
|
4201
|
+
multipleRule.props = {
|
|
4202
|
+
disabled
|
|
4203
|
+
};
|
|
4204
|
+
}
|
|
4205
|
+
if (["people", "department"].includes(ruleName)) {
|
|
4206
|
+
const limitRule = activeProps2?.find(
|
|
4207
|
+
(rule) => rule.field === "props.limit"
|
|
4208
|
+
);
|
|
4209
|
+
limitRule.props = {
|
|
4210
|
+
disabled
|
|
4211
|
+
};
|
|
4206
4212
|
}
|
|
4207
4213
|
}
|
|
4208
4214
|
}
|
|
@@ -4222,13 +4228,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4222
4228
|
immediate: true
|
|
4223
4229
|
}
|
|
4224
4230
|
);
|
|
4225
|
-
watch(activeProps, (activeProps2) => {
|
|
4226
|
-
flowConditionEffect(activeProps2, props.flowCondition);
|
|
4227
|
-
});
|
|
4228
4231
|
watch(
|
|
4229
4232
|
() => props.flowCondition,
|
|
4230
4233
|
(flowCondition) => {
|
|
4231
|
-
flowConditionEffect(
|
|
4234
|
+
flowConditionEffect(flowCondition);
|
|
4232
4235
|
},
|
|
4233
4236
|
{
|
|
4234
4237
|
deep: true
|
|
@@ -4375,7 +4378,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4375
4378
|
})) : createCommentVNode("v-if", true)
|
|
4376
4379
|
])) : createCommentVNode("v-if", true),
|
|
4377
4380
|
createElementVNode("div", _hoisted_6, [
|
|
4378
|
-
_ctx.flowCondition[activeRule.value.field] ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
4381
|
+
_ctx.flowCondition?.[activeRule.value.field] ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
4379
4382
|
createVNode(unref(ExclamationCircleFilled), { style: { "color": "#2f4eed" } }),
|
|
4380
4383
|
createTextVNode(" \u8BE5\u7EC4\u4EF6\u5728\u201C" + toDisplayString(_ctx.flowCondition[activeRule.value.field]) + "\u201D\u5DF2\u88AB\u8BBE\u4E3A\u5BA1\u6279\u6761\u4EF6\uFF0C" + toDisplayString(flowConditionTipMap[activeRule.value?.config?.config?.name]), 1)
|
|
4381
4384
|
])) : createCommentVNode("v-if", true),
|
|
@@ -604,11 +604,15 @@ var picture = {
|
|
|
604
604
|
listType: 'picture-card',
|
|
605
605
|
text: '请选择',
|
|
606
606
|
multiple: maxCount > 1,
|
|
607
|
+
accept: '.jpg,.png',
|
|
607
608
|
},
|
|
608
609
|
extraProps: {
|
|
609
610
|
maxSize: 10,
|
|
610
611
|
maxCount,
|
|
611
612
|
},
|
|
613
|
+
customErrors: {
|
|
614
|
+
format: '请上传jpg、png格式的图片',
|
|
615
|
+
},
|
|
612
616
|
defaultList: data.value,
|
|
613
617
|
uploadRequest(inject, file) {
|
|
614
618
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -634,7 +638,7 @@ var picture = {
|
|
|
634
638
|
});
|
|
635
639
|
},
|
|
636
640
|
error(inject, error) {
|
|
637
|
-
antDesignVue.message.error(error.message);
|
|
641
|
+
antDesignVue.message.error(error === null || error === void 0 ? void 0 : error.message);
|
|
638
642
|
},
|
|
639
643
|
},
|
|
640
644
|
};
|
|
@@ -1517,14 +1521,25 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1517
1521
|
const field = rule.field;
|
|
1518
1522
|
const associatedFields = rule?.config?.associatedFields;
|
|
1519
1523
|
let result = void 0;
|
|
1520
|
-
|
|
1521
|
-
|
|
1524
|
+
try {
|
|
1525
|
+
if (row[field]) {
|
|
1526
|
+
result = await props.extraConfig.product.fetch({
|
|
1527
|
+
productCode: row[field]
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
1531
|
+
return result;
|
|
1532
|
+
} catch (e) {
|
|
1533
|
+
row[field] = "";
|
|
1534
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
1535
|
+
return Promise.resolve(result);
|
|
1522
1536
|
}
|
|
1537
|
+
}
|
|
1538
|
+
function processAssociatedFields(field, associatedFields, row, result) {
|
|
1523
1539
|
if (associatedFields.length)
|
|
1524
1540
|
associatedFields.forEach((item) => {
|
|
1525
1541
|
row[productPicName(item.value, field)] = result ? result[productInfoKeyMap[item.value]] : void 0;
|
|
1526
1542
|
});
|
|
1527
|
-
return result;
|
|
1528
1543
|
}
|
|
1529
1544
|
function handleChange(e) {
|
|
1530
1545
|
const file = e.target.files[0];
|
|
@@ -1707,11 +1722,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1707
1722
|
return !formData.value[shopField];
|
|
1708
1723
|
}
|
|
1709
1724
|
function handlePressEnter(rule, row) {
|
|
1710
|
-
queryProductInfo(rule, row)
|
|
1711
|
-
if (!data2) {
|
|
1712
|
-
row[rule.field] = "";
|
|
1713
|
-
}
|
|
1714
|
-
});
|
|
1725
|
+
queryProductInfo(rule, row);
|
|
1715
1726
|
}
|
|
1716
1727
|
function handleProductInputChange(rule, row) {
|
|
1717
1728
|
queryProductInfoDebounce(rule, row);
|
|
@@ -2101,6 +2112,9 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2101
2112
|
tempSelected: {}
|
|
2102
2113
|
};
|
|
2103
2114
|
}
|
|
2115
|
+
function handleError(e) {
|
|
2116
|
+
antDesignVue.message.error(e?.message);
|
|
2117
|
+
}
|
|
2104
2118
|
props.value && initValue(props.value);
|
|
2105
2119
|
props.extraConfig.materialTemp.getDict().then((data) => {
|
|
2106
2120
|
measrueDicts.value = data;
|
|
@@ -2331,14 +2345,19 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2331
2345
|
listType: "picture-card",
|
|
2332
2346
|
text: "\u4E0A\u4F20\u56FE\u7247",
|
|
2333
2347
|
multiple: true,
|
|
2334
|
-
disabled: __props.disabled?.includes?.("uploadPic")
|
|
2348
|
+
disabled: __props.disabled?.includes?.("uploadPic"),
|
|
2349
|
+
accept: ".jpg,.png"
|
|
2335
2350
|
},
|
|
2336
2351
|
"extra-props": {
|
|
2337
2352
|
maxCount: 9
|
|
2338
2353
|
},
|
|
2339
2354
|
"upload-request": __props.extraConfig.materialTemp.uploadRequest,
|
|
2340
2355
|
"default-list": pane.uploadList,
|
|
2341
|
-
|
|
2356
|
+
"custom-errors": {
|
|
2357
|
+
format: "\u8BF7\u4E0A\u4F20jpg\u3001png\u683C\u5F0F\u7684\u56FE\u7247"
|
|
2358
|
+
},
|
|
2359
|
+
onUpdate: handleUpload,
|
|
2360
|
+
onError: handleError
|
|
2342
2361
|
}, null, 8, ["upload-props", "upload-request", "default-list"])
|
|
2343
2362
|
]),
|
|
2344
2363
|
_: 2
|
|
@@ -2624,6 +2643,7 @@ var product = {
|
|
|
2624
2643
|
on: {
|
|
2625
2644
|
change(inject, value) {
|
|
2626
2645
|
inject.self.value = value;
|
|
2646
|
+
inject.self.props.defalutValue = value;
|
|
2627
2647
|
vue.nextTick(() => {
|
|
2628
2648
|
inject.api.validateField(inject.self.field);
|
|
2629
2649
|
});
|
|
@@ -2650,6 +2670,10 @@ var product = {
|
|
|
2650
2670
|
on: {
|
|
2651
2671
|
change(inject, value) {
|
|
2652
2672
|
inject.self.value = value;
|
|
2673
|
+
inject.self.props.defalutValue = value;
|
|
2674
|
+
vue.nextTick(() => {
|
|
2675
|
+
inject.api.validateField(inject.self.field);
|
|
2676
|
+
});
|
|
2653
2677
|
},
|
|
2654
2678
|
},
|
|
2655
2679
|
};
|
|
@@ -3296,21 +3296,6 @@ var shop = {
|
|
|
3296
3296
|
value: rule.config.isMain,
|
|
3297
3297
|
hidden: !!parentRule,
|
|
3298
3298
|
inject: true,
|
|
3299
|
-
on: {
|
|
3300
|
-
change({ api, self }, value) {
|
|
3301
|
-
if (value) {
|
|
3302
|
-
api.mergeRule(fieldsMap$1['effect.required'], {
|
|
3303
|
-
value: true,
|
|
3304
|
-
props: { disabled: true },
|
|
3305
|
-
});
|
|
3306
|
-
}
|
|
3307
|
-
else {
|
|
3308
|
-
api.mergeRule(fieldsMap$1['effect.required'], {
|
|
3309
|
-
props: { disabled: false },
|
|
3310
|
-
});
|
|
3311
|
-
}
|
|
3312
|
-
},
|
|
3313
|
-
},
|
|
3314
3299
|
},
|
|
3315
3300
|
{
|
|
3316
3301
|
type: 'switch',
|
|
@@ -4007,7 +3992,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4007
3992
|
antDesignVue.message.error("\u8BE5\u63A7\u4EF6\u5DF2\u88AB\u8BBE\u4E3A\u6570\u636E\u8FC7\u6EE4\u6761\u4EF6\uFF0C\u4E0D\u53EF\u5220\u9664\u3002");
|
|
4008
3993
|
return;
|
|
4009
3994
|
}
|
|
4010
|
-
if (props.flowCondition[targetRule.field]) {
|
|
3995
|
+
if (props.flowCondition?.[targetRule.field]) {
|
|
4011
3996
|
antDesignVue.message.error(
|
|
4012
3997
|
`\u8BE5\u7EC4\u4EF6\u5728\u201C${props.flowCondition[targetRule.field]}\u201D\u5DF2\u88AB\u8BBE\u4E3A\u5BA1\u6279\u6761\u4EF6\uFF0C\u4E0D\u53EF\u5220\u9664\u3002`
|
|
4013
3998
|
);
|
|
@@ -4046,9 +4031,25 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4046
4031
|
if (!cacheProps[rule.field]) {
|
|
4047
4032
|
cacheProps[rule.field] = makePropRule(rule, parentRule);
|
|
4048
4033
|
}
|
|
4034
|
+
flowConditionEffect(props.flowCondition);
|
|
4049
4035
|
}
|
|
4050
4036
|
function propChange(field, value) {
|
|
4051
4037
|
setRulePropValue(field, value, activeRule.value);
|
|
4038
|
+
processShopProps(field, value);
|
|
4039
|
+
}
|
|
4040
|
+
function processShopProps(field, value) {
|
|
4041
|
+
if (activeRule.value?.config?.config.name === "shop") {
|
|
4042
|
+
if (field === "config.isMain") {
|
|
4043
|
+
const shopProps = cacheProps[activeRule.value.field];
|
|
4044
|
+
const requiredRule = shopProps.find(
|
|
4045
|
+
(rule) => rule.field === "effect.required"
|
|
4046
|
+
);
|
|
4047
|
+
if (value) {
|
|
4048
|
+
requiredRule.value = true;
|
|
4049
|
+
}
|
|
4050
|
+
flowConditionEffect(props.flowCondition);
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4052
4053
|
}
|
|
4053
4054
|
function setRulePropValue(field, value, rule) {
|
|
4054
4055
|
field.split(".").reduce((pre, cur, index, arr) => {
|
|
@@ -4171,48 +4172,53 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4171
4172
|
}
|
|
4172
4173
|
return pass;
|
|
4173
4174
|
}
|
|
4174
|
-
function flowConditionEffect(
|
|
4175
|
+
function flowConditionEffect(flowCondition) {
|
|
4175
4176
|
if (activeRule.value.config) {
|
|
4176
|
-
const
|
|
4177
|
+
const activeProps2 = cacheProps[activeRule.value.field];
|
|
4177
4178
|
const ruleName = activeRule.value.config.config.name;
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
}
|
|
4194
|
-
if (ruleName === "materialType") {
|
|
4195
|
-
const formatRule = activeProps2?.find(
|
|
4196
|
-
(rule) => rule.field === "config.format"
|
|
4197
|
-
);
|
|
4198
|
-
const multipleRule = activeProps2?.find(
|
|
4199
|
-
(rule) => rule.field === "props.multiple"
|
|
4200
|
-
);
|
|
4201
|
-
formatRule.props = {
|
|
4202
|
-
disabled: true
|
|
4203
|
-
};
|
|
4204
|
-
multipleRule.props = {
|
|
4205
|
-
disabled: true
|
|
4206
|
-
};
|
|
4207
|
-
}
|
|
4208
|
-
if (["people", "department"].includes(ruleName)) {
|
|
4209
|
-
const limitRule = activeProps2?.find(
|
|
4210
|
-
(rule) => rule.field === "props.limit"
|
|
4211
|
-
);
|
|
4212
|
-
limitRule.props = {
|
|
4213
|
-
disabled: true
|
|
4214
|
-
};
|
|
4179
|
+
let disabled;
|
|
4180
|
+
if (ruleName === "shop") {
|
|
4181
|
+
const isMainValue = activeProps2.find(
|
|
4182
|
+
(rule) => rule.field === "config.isMain"
|
|
4183
|
+
)?.value;
|
|
4184
|
+
disabled = !!flowCondition[activeRule.value.field] || isMainValue;
|
|
4185
|
+
} else {
|
|
4186
|
+
disabled = !!flowCondition[activeRule.value.field];
|
|
4187
|
+
}
|
|
4188
|
+
const requiredRule = activeProps2?.find(
|
|
4189
|
+
(rule) => rule.field === "effect.required"
|
|
4190
|
+
);
|
|
4191
|
+
if (requiredRule) {
|
|
4192
|
+
if (!requiredRule.props) {
|
|
4193
|
+
requiredRule.props = {};
|
|
4215
4194
|
}
|
|
4195
|
+
requiredRule.props.disabled = disabled;
|
|
4196
|
+
}
|
|
4197
|
+
if (["radio", "checkbox"].includes(ruleName)) {
|
|
4198
|
+
const optionsRule = activeProps2?.find((rule) => rule.field === "options");
|
|
4199
|
+
optionsRule.props.disabled = disabled;
|
|
4200
|
+
}
|
|
4201
|
+
if (ruleName === "materialType") {
|
|
4202
|
+
const formatRule = activeProps2?.find(
|
|
4203
|
+
(rule) => rule.field === "config.format"
|
|
4204
|
+
);
|
|
4205
|
+
const multipleRule = activeProps2?.find(
|
|
4206
|
+
(rule) => rule.field === "props.multiple"
|
|
4207
|
+
);
|
|
4208
|
+
formatRule.props = {
|
|
4209
|
+
disabled
|
|
4210
|
+
};
|
|
4211
|
+
multipleRule.props = {
|
|
4212
|
+
disabled
|
|
4213
|
+
};
|
|
4214
|
+
}
|
|
4215
|
+
if (["people", "department"].includes(ruleName)) {
|
|
4216
|
+
const limitRule = activeProps2?.find(
|
|
4217
|
+
(rule) => rule.field === "props.limit"
|
|
4218
|
+
);
|
|
4219
|
+
limitRule.props = {
|
|
4220
|
+
disabled
|
|
4221
|
+
};
|
|
4216
4222
|
}
|
|
4217
4223
|
}
|
|
4218
4224
|
}
|
|
@@ -4232,13 +4238,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4232
4238
|
immediate: true
|
|
4233
4239
|
}
|
|
4234
4240
|
);
|
|
4235
|
-
vue.watch(activeProps, (activeProps2) => {
|
|
4236
|
-
flowConditionEffect(activeProps2, props.flowCondition);
|
|
4237
|
-
});
|
|
4238
4241
|
vue.watch(
|
|
4239
4242
|
() => props.flowCondition,
|
|
4240
4243
|
(flowCondition) => {
|
|
4241
|
-
flowConditionEffect(
|
|
4244
|
+
flowConditionEffect(flowCondition);
|
|
4242
4245
|
},
|
|
4243
4246
|
{
|
|
4244
4247
|
deep: true
|
|
@@ -4385,7 +4388,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4385
4388
|
})) : vue.createCommentVNode("v-if", true)
|
|
4386
4389
|
])) : vue.createCommentVNode("v-if", true),
|
|
4387
4390
|
vue.createElementVNode("div", _hoisted_6, [
|
|
4388
|
-
_ctx.flowCondition[activeRule.value.field] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
4391
|
+
_ctx.flowCondition?.[activeRule.value.field] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
4389
4392
|
vue.createVNode(vue.unref(iconsVue.ExclamationCircleFilled), { style: { "color": "#2f4eed" } }),
|
|
4390
4393
|
vue.createTextVNode(" \u8BE5\u7EC4\u4EF6\u5728\u201C" + vue.toDisplayString(_ctx.flowCondition[activeRule.value.field]) + "\u201D\u5DF2\u88AB\u8BBE\u4E3A\u5BA1\u6279\u6761\u4EF6\uFF0C" + vue.toDisplayString(flowConditionTipMap[activeRule.value?.config?.config?.name]), 1)
|
|
4391
4394
|
])) : vue.createCommentVNode("v-if", true),
|