bm-admin-ui 1.0.49-alpha → 1.0.51-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.
|
@@ -6,7 +6,7 @@ import Picture from 'bm-admin-ui/es/components/upload';
|
|
|
6
6
|
import BmStaffsSelector from 'bm-admin-ui/es/components/staffs-selector';
|
|
7
7
|
import { BmTagsDisplay, BmFloatTable } from 'bm-admin-ui/es/components';
|
|
8
8
|
import { SearchOutlined, CheckCircleFilled, PlusOutlined } from '@ant-design/icons-vue';
|
|
9
|
-
import { cloneDeep,
|
|
9
|
+
import { cloneDeep, floor, debounce } from 'lodash-es';
|
|
10
10
|
|
|
11
11
|
const fieldRatioMap = {
|
|
12
12
|
'25%': 6,
|
|
@@ -75,10 +75,18 @@ var input = {
|
|
|
75
75
|
value: row[field],
|
|
76
76
|
placeholder: data.props.placeholder,
|
|
77
77
|
disabled: data.disabled,
|
|
78
|
-
maxlength: 200,
|
|
78
|
+
maxlength: data.props.maxlength || 200,
|
|
79
79
|
'onUpdate:value': (value) => {
|
|
80
80
|
row[field] = value;
|
|
81
81
|
},
|
|
82
|
+
onBlur() {
|
|
83
|
+
var _a;
|
|
84
|
+
const value = row[field];
|
|
85
|
+
const txtFormatFn = (_a = data === null || data === void 0 ? void 0 : data.config) === null || _a === void 0 ? void 0 : _a.txtFormatFn;
|
|
86
|
+
if (txtFormatFn && !txtFormatFn(value)) {
|
|
87
|
+
row[field] = '';
|
|
88
|
+
}
|
|
89
|
+
},
|
|
82
90
|
});
|
|
83
91
|
},
|
|
84
92
|
},
|
|
@@ -210,6 +218,8 @@ var numInput = {
|
|
|
210
218
|
return h(InputNumber, {
|
|
211
219
|
value: row[field],
|
|
212
220
|
placeholder: data.props.placeholder,
|
|
221
|
+
parser: data.props.parser,
|
|
222
|
+
formatter: data.props.formatter,
|
|
213
223
|
'onUpdate:value': (value) => {
|
|
214
224
|
row[field] = value;
|
|
215
225
|
},
|
|
@@ -774,7 +784,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
774
784
|
"defaultSelected",
|
|
775
785
|
"load",
|
|
776
786
|
"disabled",
|
|
777
|
-
"fieldNames"
|
|
787
|
+
"fieldNames",
|
|
788
|
+
"immediateFetch"
|
|
778
789
|
],
|
|
779
790
|
emits: ["change"],
|
|
780
791
|
setup(__props, { emit: emits }) {
|
|
@@ -827,8 +838,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
827
838
|
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => visible.value = $event),
|
|
828
839
|
title: __props.title,
|
|
829
840
|
mode: __props.mode,
|
|
830
|
-
load: __props.load
|
|
831
|
-
|
|
841
|
+
load: __props.load,
|
|
842
|
+
"immediate-fetch": __props.immediateFetch
|
|
843
|
+
}, null, 8, ["select", "visible", "title", "mode", "load", "immediate-fetch"])
|
|
832
844
|
]);
|
|
833
845
|
};
|
|
834
846
|
}
|
|
@@ -926,9 +938,21 @@ var people = {
|
|
|
926
938
|
minWidth: data.config.fieldRatio,
|
|
927
939
|
slots: {
|
|
928
940
|
default({ row }) {
|
|
929
|
-
return h(StaffSelector,
|
|
941
|
+
return h(StaffSelector, {
|
|
942
|
+
title: '添加员工',
|
|
943
|
+
mode: data.props.limit ? 'radio' : 'multiple',
|
|
944
|
+
placeholder: data.props.placeholder,
|
|
945
|
+
disabled: data.disabled,
|
|
946
|
+
onChange: (value) => {
|
|
930
947
|
row[field] = value;
|
|
931
|
-
},
|
|
948
|
+
},
|
|
949
|
+
defaultSelected: row[field],
|
|
950
|
+
load(params) {
|
|
951
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
952
|
+
return yield extraConfig.people.fetch(params);
|
|
953
|
+
});
|
|
954
|
+
},
|
|
955
|
+
});
|
|
932
956
|
},
|
|
933
957
|
},
|
|
934
958
|
};
|
|
@@ -988,8 +1012,8 @@ const _hoisted_5$4 = {
|
|
|
988
1012
|
key: 1,
|
|
989
1013
|
class: "bm-fc-select-material-temp__content__circle"
|
|
990
1014
|
};
|
|
991
|
-
const _hoisted_6$
|
|
992
|
-
const _hoisted_7$
|
|
1015
|
+
const _hoisted_6$3 = ["title"];
|
|
1016
|
+
const _hoisted_7$3 = { class: "bm-fc-select-material-temp__content__item-time" };
|
|
993
1017
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
994
1018
|
__name: "select-material-temp",
|
|
995
1019
|
props: [
|
|
@@ -1204,9 +1228,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1204
1228
|
createElementVNode("span", {
|
|
1205
1229
|
class: "bm-fc-select-material-temp__content__name",
|
|
1206
1230
|
title: item.templateName
|
|
1207
|
-
}, toDisplayString(item.templateName), 9, _hoisted_6$
|
|
1231
|
+
}, toDisplayString(item.templateName), 9, _hoisted_6$3)
|
|
1208
1232
|
], 8, _hoisted_4$4),
|
|
1209
|
-
createElementVNode("div", _hoisted_7$
|
|
1233
|
+
createElementVNode("div", _hoisted_7$3, toDisplayString(unref(dayjs)(item.lastUpdateTime).format("YYYY/MM/DD")), 1)
|
|
1210
1234
|
])
|
|
1211
1235
|
]),
|
|
1212
1236
|
_: 2
|
|
@@ -1243,11 +1267,15 @@ const _hoisted_2$4 = { class: "bm-dc-table-widget__title" };
|
|
|
1243
1267
|
const _hoisted_3$3 = { class: "bm-dc-table-widget__title-samll" };
|
|
1244
1268
|
const _hoisted_4$3 = { class: "bm-dc-table-widget__top-bar" };
|
|
1245
1269
|
const _hoisted_5$3 = { class: "bm-dc-table-widget__table" };
|
|
1246
|
-
const _hoisted_6$3 = ["onClick"];
|
|
1247
|
-
const _hoisted_7$3 = ["onClick"];
|
|
1248
1270
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1249
1271
|
__name: "table-widget",
|
|
1250
|
-
props: [
|
|
1272
|
+
props: [
|
|
1273
|
+
"rule",
|
|
1274
|
+
"extraConfig",
|
|
1275
|
+
"disabled",
|
|
1276
|
+
"disabledTable",
|
|
1277
|
+
"hidden"
|
|
1278
|
+
],
|
|
1251
1279
|
emits: ["change"],
|
|
1252
1280
|
setup(__props, { emit: emits }) {
|
|
1253
1281
|
const props = __props;
|
|
@@ -1270,7 +1298,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1270
1298
|
columns: [...columns],
|
|
1271
1299
|
data: [...data],
|
|
1272
1300
|
checkboxConfig: {
|
|
1273
|
-
trigger: "cell"
|
|
1301
|
+
trigger: "cell",
|
|
1302
|
+
checkMethod() {
|
|
1303
|
+
return !props.disabled;
|
|
1304
|
+
}
|
|
1274
1305
|
}
|
|
1275
1306
|
}));
|
|
1276
1307
|
const countText = computed(() => {
|
|
@@ -1306,13 +1337,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1306
1337
|
data.splice(0, data.length);
|
|
1307
1338
|
const childRules = cloneDeep(props.rule.config.childRules);
|
|
1308
1339
|
const value = props.rule.value;
|
|
1309
|
-
if (deleteFeature.value) {
|
|
1340
|
+
if (deleteFeature.value && !props.hidden) {
|
|
1310
1341
|
columns.push({
|
|
1311
1342
|
type: "checkbox",
|
|
1312
1343
|
width: "54px"
|
|
1313
1344
|
});
|
|
1314
1345
|
}
|
|
1315
|
-
if (props.
|
|
1346
|
+
if (props.disabledTable) {
|
|
1316
1347
|
childRules.forEach((rule) => {
|
|
1317
1348
|
rule.disabled = true;
|
|
1318
1349
|
});
|
|
@@ -1331,15 +1362,16 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1331
1362
|
return pre;
|
|
1332
1363
|
}, [])
|
|
1333
1364
|
);
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1365
|
+
if (!props.hidden)
|
|
1366
|
+
columns.push({
|
|
1367
|
+
field: oper,
|
|
1368
|
+
title: "\u64CD\u4F5C",
|
|
1369
|
+
minWidth: "140px",
|
|
1370
|
+
fixed: "right",
|
|
1371
|
+
slots: {
|
|
1372
|
+
default: "floatHandle"
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1343
1375
|
handleAdd(value);
|
|
1344
1376
|
}
|
|
1345
1377
|
function getRowData() {
|
|
@@ -1504,19 +1536,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1504
1536
|
createTextVNode(toDisplayString(__props.rule.title.title) + " ", 1),
|
|
1505
1537
|
createElementVNode("span", _hoisted_3$3, toDisplayString(unref(countText)), 1),
|
|
1506
1538
|
createElementVNode("div", _hoisted_4$3, [
|
|
1507
|
-
unref(importFeature) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1508
|
-
createVNode(unref(Button), { onClick: handleDownload }, {
|
|
1509
|
-
default: withCtx(() => [
|
|
1510
|
-
createTextVNode("\u4E0B\u8F7D\u6A21\u677F")
|
|
1511
|
-
]),
|
|
1512
|
-
_: 1
|
|
1513
|
-
}),
|
|
1514
|
-
createVNode(unref(Button), { onClick: handleImport }, {
|
|
1515
|
-
default: withCtx(() => [
|
|
1516
|
-
createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
1517
|
-
]),
|
|
1518
|
-
_: 1
|
|
1519
|
-
}),
|
|
1539
|
+
unref(importFeature) && !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1520
1540
|
createElementVNode("input", {
|
|
1521
1541
|
ref_key: "inputRef",
|
|
1522
1542
|
ref: inputRef,
|
|
@@ -1525,19 +1545,40 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1525
1545
|
type: "file",
|
|
1526
1546
|
accept: "text/csv",
|
|
1527
1547
|
onChange: handleChange
|
|
1528
|
-
}, null, 544)
|
|
1548
|
+
}, null, 544),
|
|
1549
|
+
createVNode(unref(Button), {
|
|
1550
|
+
disabled: __props.disabled,
|
|
1551
|
+
onClick: handleDownload
|
|
1552
|
+
}, {
|
|
1553
|
+
default: withCtx(() => [
|
|
1554
|
+
createTextVNode("\u4E0B\u8F7D\u6A21\u677F")
|
|
1555
|
+
]),
|
|
1556
|
+
_: 1
|
|
1557
|
+
}, 8, ["disabled"]),
|
|
1558
|
+
createVNode(unref(Button), {
|
|
1559
|
+
disabled: __props.disabled,
|
|
1560
|
+
onClick: handleImport
|
|
1561
|
+
}, {
|
|
1562
|
+
default: withCtx(() => [
|
|
1563
|
+
createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
1564
|
+
]),
|
|
1565
|
+
_: 1
|
|
1566
|
+
}, 8, ["disabled"])
|
|
1529
1567
|
], 64)) : createCommentVNode("v-if", true),
|
|
1530
|
-
unref(deleteFeature) ? (openBlock(), createBlock(unref(Button), {
|
|
1568
|
+
unref(deleteFeature) && !__props.hidden ? (openBlock(), createBlock(unref(Button), {
|
|
1531
1569
|
key: 1,
|
|
1570
|
+
disabled: __props.disabled,
|
|
1532
1571
|
onClick: handleBatchDelete
|
|
1533
1572
|
}, {
|
|
1534
1573
|
default: withCtx(() => [
|
|
1535
1574
|
createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
1536
1575
|
]),
|
|
1537
1576
|
_: 1
|
|
1538
|
-
})) : createCommentVNode("v-if", true),
|
|
1539
|
-
|
|
1577
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
1578
|
+
!__props.hidden ? (openBlock(), createBlock(unref(Button), {
|
|
1579
|
+
key: 2,
|
|
1540
1580
|
type: "primary",
|
|
1581
|
+
disabled: __props.disabled,
|
|
1541
1582
|
onClick: handleAdd
|
|
1542
1583
|
}, {
|
|
1543
1584
|
default: withCtx(() => [
|
|
@@ -1545,7 +1586,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1545
1586
|
createTextVNode(" \u65B0\u589E ")
|
|
1546
1587
|
]),
|
|
1547
1588
|
_: 1
|
|
1548
|
-
})
|
|
1589
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true)
|
|
1549
1590
|
])
|
|
1550
1591
|
]),
|
|
1551
1592
|
createElementVNode("div", _hoisted_5$3, [
|
|
@@ -1558,14 +1599,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1558
1599
|
}, {
|
|
1559
1600
|
floatHandle: withCtx(({ row, rowIndex }) => [
|
|
1560
1601
|
unref(copyFeature) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1561
|
-
|
|
1602
|
+
createVNode(unref(Button), {
|
|
1603
|
+
type: "link",
|
|
1604
|
+
size: "small",
|
|
1605
|
+
disabled: __props.disabled,
|
|
1562
1606
|
onClick: ($event) => handleCopy(row)
|
|
1563
|
-
},
|
|
1607
|
+
}, {
|
|
1608
|
+
default: withCtx(() => [
|
|
1609
|
+
createTextVNode("\u590D\u5236")
|
|
1610
|
+
]),
|
|
1611
|
+
_: 2
|
|
1612
|
+
}, 1032, ["disabled", "onClick"]),
|
|
1564
1613
|
createVNode(unref(Divider), { type: "vertical" })
|
|
1565
1614
|
], 64)) : createCommentVNode("v-if", true),
|
|
1566
|
-
|
|
1615
|
+
createVNode(unref(Button), {
|
|
1616
|
+
type: "link",
|
|
1617
|
+
size: "small",
|
|
1618
|
+
disabled: __props.disabled,
|
|
1567
1619
|
onClick: ($event) => handleDelete(rowIndex)
|
|
1568
|
-
},
|
|
1620
|
+
}, {
|
|
1621
|
+
default: withCtx(() => [
|
|
1622
|
+
createTextVNode("\u5220\u9664")
|
|
1623
|
+
]),
|
|
1624
|
+
_: 2
|
|
1625
|
+
}, 1032, ["disabled", "onClick"])
|
|
1569
1626
|
]),
|
|
1570
1627
|
_: 1
|
|
1571
1628
|
}, 8, ["config"])
|
|
@@ -1622,7 +1679,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1622
1679
|
getTempDetail(tempId).then((result) => {
|
|
1623
1680
|
const activePane2 = getAcitvePane();
|
|
1624
1681
|
activePane2.tempSelected = result;
|
|
1625
|
-
activePane2.tableRule = getTableRule(result
|
|
1682
|
+
activePane2.tableRule = getTableRule(result);
|
|
1626
1683
|
});
|
|
1627
1684
|
}
|
|
1628
1685
|
function getAcitvePane() {
|
|
@@ -1663,44 +1720,97 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1663
1720
|
}
|
|
1664
1721
|
}
|
|
1665
1722
|
}
|
|
1666
|
-
function getTableRule(
|
|
1723
|
+
function getTableRule(tempResult) {
|
|
1724
|
+
const { coverageArr, preSetItems } = tempResult;
|
|
1667
1725
|
const fieldTypeMap = {
|
|
1668
1726
|
1: "input",
|
|
1669
1727
|
2: "numInput",
|
|
1670
1728
|
3: "date",
|
|
1671
|
-
4: "
|
|
1729
|
+
4: "product"
|
|
1672
1730
|
};
|
|
1673
1731
|
const formatMap = {
|
|
1674
1732
|
0: "YYYY-MM",
|
|
1675
1733
|
1: "YYYY-MM-DD",
|
|
1676
1734
|
2: "YYYY-MM-DD HH:mm"
|
|
1677
1735
|
};
|
|
1736
|
+
const txtFormatFnMap = {
|
|
1737
|
+
1: (txt) => /^\d{11}$/.test(txt),
|
|
1738
|
+
2: (txt) => /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/.test(txt),
|
|
1739
|
+
3: (txt) => /(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(txt),
|
|
1740
|
+
4: (txt) => /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(txt)
|
|
1741
|
+
};
|
|
1678
1742
|
const activePane2 = getAcitvePane();
|
|
1679
|
-
const childRules =
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1743
|
+
const childRules = preSetItems.split(",").map((preSetItem) => ({
|
|
1744
|
+
name: "product",
|
|
1745
|
+
title: {
|
|
1746
|
+
title: preSetItem
|
|
1747
|
+
},
|
|
1748
|
+
field: preSetItem,
|
|
1749
|
+
effect: {
|
|
1750
|
+
required: true
|
|
1751
|
+
},
|
|
1752
|
+
props: {
|
|
1753
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
1754
|
+
},
|
|
1755
|
+
config: {
|
|
1756
|
+
associatedFields: coverageArr.filter((coverage) => {
|
|
1757
|
+
if (coverage.fieldType === 4) {
|
|
1758
|
+
const extraValues = JSON.parse(coverage.extraValues);
|
|
1759
|
+
return extraValues.fieldName === preSetItem;
|
|
1760
|
+
} else {
|
|
1761
|
+
return false;
|
|
1762
|
+
}
|
|
1763
|
+
}).map((coverage) => {
|
|
1764
|
+
const extraValues = JSON.parse(coverage.extraValues);
|
|
1765
|
+
return {
|
|
1766
|
+
value: extraValues.presetFieldName,
|
|
1767
|
+
label: extraValues.presetFieldName
|
|
1768
|
+
};
|
|
1769
|
+
})
|
|
1701
1770
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1771
|
+
})).concat(
|
|
1772
|
+
coverageArr.filter((coverage) => coverage.isEdit).map((coverage) => {
|
|
1773
|
+
const extraValues = JSON.parse(coverage.extraValues);
|
|
1774
|
+
const value = {
|
|
1775
|
+
name: fieldTypeMap[coverage.fieldType],
|
|
1776
|
+
title: {
|
|
1777
|
+
title: coverage.name
|
|
1778
|
+
},
|
|
1779
|
+
field: coverage.name,
|
|
1780
|
+
effect: {
|
|
1781
|
+
required: coverage.isCheck
|
|
1782
|
+
},
|
|
1783
|
+
config: {
|
|
1784
|
+
fieldRatio: "140px"
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
if (coverage.fieldType === 1) {
|
|
1788
|
+
value.props = {
|
|
1789
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
1790
|
+
maxlength: extraValues.maxLength
|
|
1791
|
+
};
|
|
1792
|
+
value.config.txtFormatFn = txtFormatFnMap[extraValues.format];
|
|
1793
|
+
}
|
|
1794
|
+
if (coverage.fieldType === 2) {
|
|
1795
|
+
const decimalPlaces = extraValues.decimalPlaces || 0;
|
|
1796
|
+
value.props = {
|
|
1797
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
1798
|
+
};
|
|
1799
|
+
if (extraValues.format === 1) {
|
|
1800
|
+
value.props.parser = (value2) => floor(value2.replace("%", ""), decimalPlaces);
|
|
1801
|
+
value.props.formatter = (value2) => `${value2}%`;
|
|
1802
|
+
} else {
|
|
1803
|
+
value.props.parser = (value2) => floor(value2, decimalPlaces);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
if (coverage.fieldType === 3) {
|
|
1807
|
+
value.props = {
|
|
1808
|
+
format: formatMap[extraValues.format]
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
return value;
|
|
1812
|
+
})
|
|
1813
|
+
);
|
|
1704
1814
|
if (childRules.length)
|
|
1705
1815
|
return {
|
|
1706
1816
|
title: {
|
|
@@ -1725,6 +1835,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1725
1835
|
key: pane.key,
|
|
1726
1836
|
title: pane.title,
|
|
1727
1837
|
tempIdSelected: pane.tempSelected.templateCode || pane.tempIdSelected,
|
|
1838
|
+
templateName: pane.tempSelected?.templateName || pane.templateName,
|
|
1728
1839
|
tableData: pane.tableData,
|
|
1729
1840
|
uploadList: pane.uploadList
|
|
1730
1841
|
}))
|
|
@@ -1754,7 +1865,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1754
1865
|
props.extraConfig.getDict().then((data) => {
|
|
1755
1866
|
measrueDicts.value = data;
|
|
1756
1867
|
});
|
|
1757
|
-
watch(mainShopValue, (
|
|
1868
|
+
watch(mainShopValue, () => {
|
|
1758
1869
|
panes.splice(0);
|
|
1759
1870
|
activeKey.value = "\u7D20\u67501";
|
|
1760
1871
|
panes.push({
|
|
@@ -2008,9 +2119,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2008
2119
|
pane.tableRule ? (openBlock(), createBlock(TableWidget, {
|
|
2009
2120
|
key: 0,
|
|
2010
2121
|
rule: pane.tableRule,
|
|
2011
|
-
disabled: __props.disabled?.includes?.("editTable"),
|
|
2122
|
+
"disabled-table": __props.disabled?.includes?.("editTable"),
|
|
2012
2123
|
onChange: handleTableDataChange
|
|
2013
|
-
}, null, 8, ["rule", "disabled"])) : createCommentVNode("v-if", true)
|
|
2124
|
+
}, null, 8, ["rule", "disabled-table"])) : createCommentVNode("v-if", true)
|
|
2014
2125
|
]),
|
|
2015
2126
|
_: 2
|
|
2016
2127
|
}, 1024)
|
|
@@ -2427,7 +2538,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2427
2538
|
options.value = result;
|
|
2428
2539
|
return options.value;
|
|
2429
2540
|
}).then((options2) => {
|
|
2430
|
-
if (props.value
|
|
2541
|
+
if (props.value?.length) {
|
|
2431
2542
|
if (props.multiple) {
|
|
2432
2543
|
props.value.forEach((item) => loadValueOptions(item, options2));
|
|
2433
2544
|
} else {
|
|
@@ -2628,6 +2739,7 @@ var row = {
|
|
|
2628
2739
|
const children = [
|
|
2629
2740
|
{
|
|
2630
2741
|
type: 'row',
|
|
2742
|
+
field: data.field,
|
|
2631
2743
|
props: {
|
|
2632
2744
|
gutter: [0, 24],
|
|
2633
2745
|
},
|
|
@@ -2646,7 +2758,6 @@ var row = {
|
|
|
2646
2758
|
return {
|
|
2647
2759
|
native: true,
|
|
2648
2760
|
type: 'div',
|
|
2649
|
-
field: data.field,
|
|
2650
2761
|
children,
|
|
2651
2762
|
class: 'bm-fc-module-widget',
|
|
2652
2763
|
};
|
|
@@ -2748,9 +2859,23 @@ var department = {
|
|
|
2748
2859
|
minWidth: data.config.fieldRatio,
|
|
2749
2860
|
slots: {
|
|
2750
2861
|
default({ row }) {
|
|
2751
|
-
return h(StaffSelector,
|
|
2862
|
+
return h(StaffSelector, {
|
|
2863
|
+
title: '添加部门',
|
|
2864
|
+
mode: data.props.limit ? 'radio' : 'multiple',
|
|
2865
|
+
placeholder: data.props.placeholder,
|
|
2866
|
+
immediateFetch: true,
|
|
2867
|
+
unitStr: '个',
|
|
2868
|
+
disabled: data.disabled,
|
|
2869
|
+
onChange: (value) => {
|
|
2752
2870
|
row[field] = value;
|
|
2753
|
-
},
|
|
2871
|
+
},
|
|
2872
|
+
defaultSelected: row[field],
|
|
2873
|
+
load(params) {
|
|
2874
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2875
|
+
return yield extraConfig.department.fetch(params);
|
|
2876
|
+
});
|
|
2877
|
+
},
|
|
2878
|
+
});
|
|
2754
2879
|
},
|
|
2755
2880
|
},
|
|
2756
2881
|
};
|
|
@@ -2986,16 +3111,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2986
3111
|
const rule = ref([]);
|
|
2987
3112
|
const processFormPermissions = computed(
|
|
2988
3113
|
() => props.formPermissions ? props.formPermissions.reduce((result, item) => {
|
|
2989
|
-
if (item.disabled) {
|
|
2990
|
-
if (item.name === "picture") {
|
|
2991
|
-
((item.props = {}).uploadProps = {}).disabled = true;
|
|
2992
|
-
} else if (item.name === "materialTemp") {
|
|
2993
|
-
(item.props = {}).disabled = item.disabled;
|
|
2994
|
-
} else {
|
|
2995
|
-
(item.props = {}).disabled = true;
|
|
2996
|
-
}
|
|
2997
|
-
}
|
|
2998
|
-
delete item.disabled;
|
|
2999
3114
|
result[item.field] = item;
|
|
3000
3115
|
return result;
|
|
3001
3116
|
}, {}) : {}
|
|
@@ -3005,45 +3120,88 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3005
3120
|
);
|
|
3006
3121
|
provide("mainShopValue", mainShopValue);
|
|
3007
3122
|
function setRule(fdRule) {
|
|
3008
|
-
fdRule =
|
|
3009
|
-
|
|
3123
|
+
fdRule = setRuleValue(fdRule);
|
|
3124
|
+
fdRule = makeRule(fdRule);
|
|
3125
|
+
rule.value = setRulePermission(fdRule);
|
|
3126
|
+
}
|
|
3127
|
+
function makeRule(fdRule) {
|
|
3128
|
+
return fdRule.map((data) => {
|
|
3010
3129
|
const childRules = data?.config?.childRules;
|
|
3011
3130
|
const rule2 = ruleList[data.name].rule(data, props.extraConfig);
|
|
3012
3131
|
if (data.name === "row" && childRules?.length) {
|
|
3013
3132
|
const rowRule = rule2.children.find((item) => item.type === "row");
|
|
3014
3133
|
childRules.forEach((ruleItem) => {
|
|
3015
3134
|
rowRule.children.push(
|
|
3016
|
-
|
|
3017
|
-
ruleItem.field,
|
|
3018
|
-
ruleList[ruleItem.name].rowRule(ruleItem, props.extraConfig)
|
|
3019
|
-
)
|
|
3135
|
+
ruleList[ruleItem.name].rowRule(ruleItem, props.extraConfig)
|
|
3020
3136
|
);
|
|
3021
3137
|
});
|
|
3022
|
-
} else if (data.name === "table" && childRules?.length) {
|
|
3023
|
-
childRules.forEach((childRule) => {
|
|
3024
|
-
const rulePermission = processFormPermissions.value[childRule.field];
|
|
3025
|
-
if (rulePermission) {
|
|
3026
|
-
childRule.hidden = rulePermission.hidden;
|
|
3027
|
-
childRule.disabled = rulePermission.props?.disabled;
|
|
3028
|
-
}
|
|
3029
|
-
});
|
|
3030
|
-
} else if (data.name === "materialTemp") {
|
|
3031
|
-
rule2.children[1] = mergeFormPermission(data.field, rule2.children[1]);
|
|
3032
|
-
return rule2;
|
|
3033
3138
|
}
|
|
3034
|
-
return
|
|
3139
|
+
return rule2;
|
|
3035
3140
|
});
|
|
3036
3141
|
}
|
|
3037
|
-
function mergeFormPermission(
|
|
3038
|
-
|
|
3039
|
-
|
|
3142
|
+
function mergeFormPermission(rule2) {
|
|
3143
|
+
rule2 = getFormFeildRule(rule2);
|
|
3144
|
+
const formPermission = processFormPermissions.value[rule2.field];
|
|
3145
|
+
const childRules = rule2?.props?.rule?.config?.childRules;
|
|
3146
|
+
const children = rule2.children;
|
|
3147
|
+
if (formPermission) {
|
|
3148
|
+
const { name } = formPermission;
|
|
3149
|
+
if (formPermission.disabled) {
|
|
3150
|
+
if (name === "picture") {
|
|
3151
|
+
rule2.props.uploadProps.disabled = true;
|
|
3152
|
+
} else if (name === "materialTemp") {
|
|
3153
|
+
rule2.props.disabled = formPermission.disabled;
|
|
3154
|
+
} else {
|
|
3155
|
+
if (!rule2.props) {
|
|
3156
|
+
rule2.props = {
|
|
3157
|
+
disabled: true
|
|
3158
|
+
};
|
|
3159
|
+
} else {
|
|
3160
|
+
rule2.props.disabled = true;
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
if (formPermission.hidden) {
|
|
3165
|
+
if (name === "table") {
|
|
3166
|
+
rule2.props.hidden = true;
|
|
3167
|
+
} else {
|
|
3168
|
+
rule2.hidden = true;
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3040
3171
|
}
|
|
3041
|
-
|
|
3172
|
+
if (childRules?.length) {
|
|
3173
|
+
let allHidden = true;
|
|
3174
|
+
childRules.forEach((childRule) => {
|
|
3175
|
+
const innerFormPermission = processFormPermissions.value[childRule.field];
|
|
3176
|
+
if (innerFormPermission) {
|
|
3177
|
+
childRule.disabled = innerFormPermission.disabled;
|
|
3178
|
+
childRule.hidden = innerFormPermission.hidden;
|
|
3179
|
+
}
|
|
3180
|
+
if (!innerFormPermission || !childRule.hidden)
|
|
3181
|
+
allHidden = false;
|
|
3182
|
+
});
|
|
3183
|
+
if (formPermission?.hidden && allHidden) {
|
|
3184
|
+
rule2.hidden = true;
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
if (children?.length) {
|
|
3188
|
+
children.forEach((child) => mergeFormPermission(child));
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
function getFormFeildRule(rule2) {
|
|
3192
|
+
if (rule2.native) {
|
|
3193
|
+
return rule2.children.find((item) => item.field);
|
|
3194
|
+
} else
|
|
3195
|
+
return rule2;
|
|
3196
|
+
}
|
|
3197
|
+
function setRulePermission(fdRule) {
|
|
3198
|
+
fdRule.forEach((rule2) => mergeFormPermission(rule2));
|
|
3199
|
+
return fdRule;
|
|
3042
3200
|
}
|
|
3043
3201
|
function handleValue(value) {
|
|
3044
3202
|
emits("update:value", value);
|
|
3045
3203
|
}
|
|
3046
|
-
function
|
|
3204
|
+
function setRuleValue(fdRule) {
|
|
3047
3205
|
const ruleData = cloneDeep(fdRule);
|
|
3048
3206
|
ruleData.forEach((rule2) => {
|
|
3049
3207
|
if (rule2.name === "row") {
|