bm-admin-ui 1.0.52-alpha → 1.0.54-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 (35) hide show
  1. package/es/components/button/index.d.ts +1 -1
  2. package/es/components/button/src/button.vue.d.ts +1 -1
  3. package/es/components/editor/index.d.ts +1 -1
  4. package/es/components/editor/src/editor.vue.d.ts +1 -1
  5. package/es/components/form-create/index.js +169 -21
  6. package/es/components/form-designer/index.js +10 -10
  7. package/es/components/search-filter/index.d.ts +1 -1
  8. package/es/components/search-filter/src/search-filter.vue.d.ts +1 -1
  9. package/es/components/select-all/index.d.ts +1 -1
  10. package/es/components/select-all/src/selectAll.vue.d.ts +1 -1
  11. package/es/components/staffs-selector/index.d.ts +1 -1
  12. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +1 -1
  13. package/lib/components/button/index.d.ts +1 -1
  14. package/lib/components/button/src/button.vue.d.ts +1 -1
  15. package/lib/components/editor/index.d.ts +1 -1
  16. package/lib/components/editor/src/editor.vue.d.ts +1 -1
  17. package/lib/components/form-create/index.js +170 -21
  18. package/lib/components/form-designer/index.js +1 -1
  19. package/lib/components/search-filter/index.d.ts +1 -1
  20. package/lib/components/search-filter/src/search-filter.vue.d.ts +1 -1
  21. package/lib/components/select-all/index.d.ts +1 -1
  22. package/lib/components/select-all/src/selectAll.vue.d.ts +1 -1
  23. package/lib/components/staffs-selector/index.d.ts +1 -1
  24. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/types/components/button/index.d.ts +1 -1
  27. package/types/components/button/src/button.vue.d.ts +1 -1
  28. package/types/components/editor/index.d.ts +1 -1
  29. package/types/components/editor/src/editor.vue.d.ts +1 -1
  30. package/types/components/search-filter/index.d.ts +1 -1
  31. package/types/components/search-filter/src/search-filter.vue.d.ts +1 -1
  32. package/types/components/select-all/index.d.ts +1 -1
  33. package/types/components/select-all/src/selectAll.vue.d.ts +1 -1
  34. package/types/components/staffs-selector/index.d.ts +1 -1
  35. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +1 -1
@@ -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, "disabled" | "loading" | "htmlType" | "ghost" | "block" | "danger">;
81
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
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, "disabled" | "loading" | "htmlType" | "ghost" | "block" | "danger">;
83
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
84
84
  $attrs: {
85
85
  [x: string]: unknown;
86
86
  };
@@ -294,8 +294,8 @@ declare const BmEditor: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
294
294
  onReady?: ((...args: any[]) => any) | undefined;
295
295
  onGetCount?: ((...args: any[]) => any) | undefined;
296
296
  }, {
297
- value: string;
298
297
  disabled: boolean;
298
+ value: string;
299
299
  options: {
300
300
  [key: string]: any;
301
301
  };
@@ -294,8 +294,8 @@ declare const _default: import("vue").DefineComponent<{
294
294
  onReady?: ((...args: any[]) => any) | undefined;
295
295
  onGetCount?: ((...args: any[]) => any) | undefined;
296
296
  }, {
297
- value: string;
298
297
  disabled: boolean;
298
+ value: string;
299
299
  options: {
300
300
  [key: string]: any;
301
301
  };
@@ -7,6 +7,7 @@ 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
9
  import { cloneDeep, floor, debounce } from 'lodash-es';
10
+ import customParseFormat from 'dayjs/plugin/customParseFormat';
10
11
 
11
12
  const fieldRatioMap = {
12
13
  '25%': 6,
@@ -802,7 +803,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
802
803
  val.map((item) => ({
803
804
  [fieldNames.value]: item.key,
804
805
  [fieldNames.label]: item.title,
805
- ...item
806
+ key: item.key,
807
+ title: item.title
806
808
  }))
807
809
  );
808
810
  }
@@ -938,6 +940,7 @@ var people = {
938
940
  minWidth: data.config.fieldRatio,
939
941
  slots: {
940
942
  default({ row }) {
943
+ var _a;
941
944
  return h(StaffSelector, {
942
945
  title: '添加员工',
943
946
  mode: data.props.limit ? 'radio' : 'multiple',
@@ -952,6 +955,7 @@ var people = {
952
955
  return yield extraConfig.people.fetch(params);
953
956
  });
954
957
  },
958
+ fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
955
959
  });
956
960
  },
957
961
  },
@@ -1279,6 +1283,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1279
1283
  emits: ["change"],
1280
1284
  setup(__props, { emit: emits }) {
1281
1285
  const props = __props;
1286
+ dayjs.extend(customParseFormat);
1282
1287
  const productInfoKeyMap = {
1283
1288
  \u5546\u54C1\u540D\u79F0: "productName",
1284
1289
  \u5546\u54C1\u7B80\u79F0: "productShortName",
@@ -1287,6 +1292,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1287
1292
  \u5546\u54C1\u7BB1\u89C4: "carton",
1288
1293
  \u5546\u54C1\u5355\u4F4D: "unit"
1289
1294
  };
1295
+ let productIndex = 0;
1290
1296
  const oper = "oper";
1291
1297
  const bmFloatTableRef = ref();
1292
1298
  const importFeature = computed(() => isShow("import"));
@@ -1329,6 +1335,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1329
1335
  });
1330
1336
  const xGrid = computed(() => bmFloatTableRef.value.xGrid || {});
1331
1337
  const inputRef = ref();
1338
+ const childRulesMap = computed(
1339
+ () => props.rule?.config?.childRules.reduce((result, item) => {
1340
+ result[item.field] = item;
1341
+ return result;
1342
+ }, {}) || {}
1343
+ );
1332
1344
  function isShow(key) {
1333
1345
  return props.rule.config.tableAdvancedFeatures.includes(key);
1334
1346
  }
@@ -1385,12 +1397,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1385
1397
  }, {});
1386
1398
  }
1387
1399
  function getProductColumn(rule) {
1400
+ const productName = `\u5546\u54C1${String(++productIndex).padStart(2, "0")}`;
1388
1401
  const field = rule.field;
1389
1402
  const associatedFields = rule.config.associatedFields;
1390
1403
  const columns2 = [
1391
1404
  {
1392
1405
  field,
1393
- title: "\u5546\u54C1\u7F16\u7801",
1406
+ title: `\u5546\u54C1\u7F16\u7801-${productName}`,
1394
1407
  headerClassName: rule.effect.required ? "is-required" : "",
1395
1408
  minWidth: "138px",
1396
1409
  slots: {
@@ -1402,7 +1415,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1402
1415
  "onUpdate:value": (value) => {
1403
1416
  row[field] = value;
1404
1417
  },
1405
- onChange() {
1418
+ onPressEnter() {
1406
1419
  queryProductInfo(rule, row);
1407
1420
  }
1408
1421
  });
@@ -1415,7 +1428,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1415
1428
  const childField = field + item.value;
1416
1429
  columns2.push({
1417
1430
  field: childField,
1418
- title: item.label,
1431
+ title: `${item.label}-${productName}`,
1419
1432
  minWidth: "138px",
1420
1433
  slots: {
1421
1434
  default({ row }) {
@@ -1478,13 +1491,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1478
1491
  function emitChange() {
1479
1492
  emits("change", data);
1480
1493
  }
1481
- function queryProductInfo(rule, row) {
1494
+ async function queryProductInfo(rule, row) {
1482
1495
  const field = rule.field;
1483
1496
  const associatedFields = rule?.config?.associatedFields;
1484
- associatedFields.length && props.extraConfig.product.fetch({ productCode: row[field] }).then((data2) => {
1485
- associatedFields.forEach((item) => {
1486
- row[field + item.value] = data2[productInfoKeyMap[item.value]];
1487
- });
1497
+ return await props.extraConfig.product.fetch({ productCode: row[field] }).then((data2) => {
1498
+ if (data2 && associatedFields.length)
1499
+ associatedFields.forEach((item) => {
1500
+ row[field + item.value] = data2[productInfoKeyMap[item.value]];
1501
+ });
1502
+ return data2;
1488
1503
  });
1489
1504
  }
1490
1505
  function handleChange(e) {
@@ -1493,12 +1508,21 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1493
1508
  reader.onload = (fr) => {
1494
1509
  const rows = parseCsv(fr?.target?.result);
1495
1510
  const validColumns = columns.filter((c) => isValidColumn(c));
1511
+ const result = [];
1496
1512
  rows.forEach((row) => {
1497
1513
  const rowData = {};
1498
1514
  row.forEach((item, index) => {
1499
1515
  rowData[validColumns[index].field] = item;
1500
1516
  });
1501
- data.push(rowData);
1517
+ result.push(rowData);
1518
+ });
1519
+ result.length && validate(result).then((result2) => {
1520
+ data.splice(0, data.length, ...result2);
1521
+ }).catch((error) => {
1522
+ message.error("\u5B58\u5728\u9519\u8BEF\u6570\u636E\uFF0C\u5BFC\u5165\u5931\u8D25");
1523
+ console.log("---------------");
1524
+ console.log(error);
1525
+ console.log("---------------");
1502
1526
  });
1503
1527
  e.target.value = "";
1504
1528
  };
@@ -1510,10 +1534,127 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1510
1534
  function parseCsv(result) {
1511
1535
  let data2 = [];
1512
1536
  if (result) {
1513
- data2 = result.split("\r\n").slice(1).filter((item) => item).map((item) => item.split(","));
1537
+ const rows = result.split("\r\n");
1538
+ const columnsTxt = rows[0];
1539
+ const columnArr = columnsTxt.includes(" ") ? columnsTxt.split(" ") : columnsTxt.split(",");
1540
+ if (columnArr.length !== columns.filter((c) => isValidColumn(c)).length) {
1541
+ message.error("\u5BFC\u5165\u7684\u6A21\u677F\u51FA\u9519");
1542
+ } else {
1543
+ data2 = rows.slice(1).filter((item) => item).map(
1544
+ (item) => item.includes(" ") ? item.split(" ") : item.split(",")
1545
+ );
1546
+ }
1514
1547
  }
1515
1548
  return data2;
1516
1549
  }
1550
+ async function validate(rowData) {
1551
+ let error = "";
1552
+ const validColumns = columns.filter((c) => isValidColumn(c));
1553
+ for (const row of rowData) {
1554
+ for (const { field } of validColumns) {
1555
+ const rule = childRulesMap.value[field];
1556
+ const title = rule?.title?.title;
1557
+ if (!rule)
1558
+ break;
1559
+ let value = row[field] || "";
1560
+ const txtFormatFn = rule.config?.txtFormatFn;
1561
+ if (rule.effect.required && !value) {
1562
+ error = `${title}\u4E0D\u80FD\u4E3A\u7A7A`;
1563
+ break;
1564
+ }
1565
+ if (txtFormatFn && !txtFormatFn(value)) {
1566
+ error = `${title}\u586B\u5199\u89C4\u5219\u4E0D\u6B63\u786E`;
1567
+ break;
1568
+ }
1569
+ if (rule.name === "input") {
1570
+ const maxlength = rule.props.maxlength || 200;
1571
+ if (value.length > maxlength) {
1572
+ error = `${title}\u5B57\u6570\u8D85\u51FA`;
1573
+ break;
1574
+ }
1575
+ }
1576
+ if (rule.name === "textarea") {
1577
+ if (value.length > 5e3) {
1578
+ error = `${title}\u5B57\u6570\u8D85\u51FA`;
1579
+ break;
1580
+ }
1581
+ }
1582
+ if (rule.name === "numInput") {
1583
+ if (rule.config.format === 1) {
1584
+ if (!value.includes("%")) {
1585
+ error = `${title}\u4E0D\u4E3A\u767E\u5206\u6570`;
1586
+ break;
1587
+ } else {
1588
+ value = value.replaceAll("%", "");
1589
+ }
1590
+ } else {
1591
+ if (isNaN(value)) {
1592
+ error = `${title}\u4E0D\u4E3A\u6570\u5B57\u7C7B\u578B`;
1593
+ break;
1594
+ }
1595
+ }
1596
+ if (rule.config.decimalPlaces !== void 0 && value.split(".")[1]?.length > rule.config.decimalPlaces) {
1597
+ error = `${title}\u4FDD\u7559\u7684\u5C0F\u6570\u70B9\u4E3A\u4E0D\u6B63\u786E`;
1598
+ break;
1599
+ }
1600
+ }
1601
+ if (rule.name === "radio") {
1602
+ if (rule.options.every((item) => item.value !== value)) {
1603
+ error = `${title}\u4E0D\u5B58\u5728\u8BE5\u9009\u9879`;
1604
+ break;
1605
+ }
1606
+ }
1607
+ if (rule.name === "checkbox") {
1608
+ value = value.split("\u3001");
1609
+ if (value.some((item) => rule.options.every((r) => r.value !== item))) {
1610
+ error = `${title}\u5B58\u5728\u4E0D\u5B58\u5728\u7684\u9009\u9879\u503C`;
1611
+ break;
1612
+ }
1613
+ }
1614
+ if (rule.name === "date") {
1615
+ if (!dayjs(value, rule.props.format, true).isValid()) {
1616
+ error = `${title}\u4E0D\u4E3A\u6709\u6548\u65F6\u671F\u6216\u4E0D\u7B26\u5408\u65E5\u671F\u683C\u5F0F`;
1617
+ break;
1618
+ }
1619
+ }
1620
+ if (rule.name === "dateRange") {
1621
+ value = value.split("~");
1622
+ if (value.some((item) => !dayjs(item, rule.props.format, true).isValid())) {
1623
+ error = `${title}\u4E0D\u4E3A\u6709\u6548\u65F6\u671F\u6216\u4E0D\u7B26\u5408\u65E5\u671F\u683C\u5F0F`;
1624
+ break;
1625
+ }
1626
+ }
1627
+ if (rule.name === "people" || rule.name === "department") {
1628
+ const limit = rule.props.limit;
1629
+ value = value.split("\u3001").map((item) => ({}));
1630
+ if (limit === 1 && value.length > limit) {
1631
+ error = `${title}\u6700\u591A\u53EA\u80FD\u9009\u4E00\u4E2A`;
1632
+ break;
1633
+ }
1634
+ }
1635
+ if (rule.name === "product") {
1636
+ const productInfo = await queryProductInfo(rule, row);
1637
+ if (!productInfo) {
1638
+ error = `${title}\u67E5\u8BE2\u7684\u5546\u54C1\u4E0D\u5B58\u5728`;
1639
+ break;
1640
+ }
1641
+ }
1642
+ if (rule.name === "shop") {
1643
+ value = {
1644
+ value: Number(value)
1645
+ };
1646
+ }
1647
+ row[field] = value;
1648
+ }
1649
+ if (error)
1650
+ break;
1651
+ }
1652
+ if (error) {
1653
+ return Promise.reject(error);
1654
+ } else {
1655
+ return Promise.resolve(rowData);
1656
+ }
1657
+ }
1517
1658
  watch(
1518
1659
  () => props.rule,
1519
1660
  () => {
@@ -1686,7 +1827,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1686
1827
  return panes.find((pane) => pane.key === activeKey.value);
1687
1828
  }
1688
1829
  function getTempDetail(templateCode) {
1689
- return props.extraConfig.fetchMaterialTempDetail({ templateCode });
1830
+ return props.extraConfig.materialTemp.fetchMaterialTempDetail({
1831
+ templateCode
1832
+ });
1690
1833
  }
1691
1834
  function handleUpload(list) {
1692
1835
  getAcitvePane().uploadList = list;
@@ -1793,9 +1936,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1793
1936
  }
1794
1937
  if (coverage.fieldType === 2) {
1795
1938
  const decimalPlaces = extraValues.decimalPlaces || 0;
1939
+ value.config.decimalPlaces = decimalPlaces;
1796
1940
  value.props = {
1797
1941
  placeholder: "\u8BF7\u8F93\u5165"
1798
1942
  };
1943
+ value.config.format = extraValues.format;
1799
1944
  if (extraValues.format === 1) {
1800
1945
  value.props.parser = (value2) => floor(value2.replace("%", ""), decimalPlaces);
1801
1946
  value.props.formatter = (value2) => `${value2}%`;
@@ -1862,7 +2007,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1862
2007
  }
1863
2008
  }
1864
2009
  props.value && initValue(props.value);
1865
- props.extraConfig.getDict().then((data) => {
2010
+ props.extraConfig.materialTemp.getDict().then((data) => {
1866
2011
  measrueDicts.value = data;
1867
2012
  });
1868
2013
  watch(mainShopValue, () => {
@@ -2100,7 +2245,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2100
2245
  "extra-props": {
2101
2246
  maxCount: 9
2102
2247
  },
2103
- "upload-request": __props.extraConfig.uploadRequest,
2248
+ "upload-request": __props.extraConfig.materialTemp.uploadRequest,
2104
2249
  "default-list": pane.uploadList,
2105
2250
  onUpdate: handleUpload
2106
2251
  }, null, 8, ["upload-props", "upload-request", "default-list"])
@@ -2120,8 +2265,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2120
2265
  key: 0,
2121
2266
  rule: pane.tableRule,
2122
2267
  "disabled-table": __props.disabled?.includes?.("editTable"),
2268
+ "extra-config": __props.extraConfig,
2123
2269
  onChange: handleTableDataChange
2124
- }, null, 8, ["rule", "disabled-table"])) : createCommentVNode("v-if", true)
2270
+ }, null, 8, ["rule", "disabled-table", "extra-config"])) : createCommentVNode("v-if", true)
2125
2271
  ]),
2126
2272
  _: 2
2127
2273
  }, 1024)
@@ -2136,8 +2282,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2136
2282
  visible: visible.value,
2137
2283
  "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
2138
2284
  "main-shop-value": unref(mainShopValue),
2139
- "fetch-material-type": __props.extraConfig.fetchMaterialType,
2140
- "fetch-material-temp": __props.extraConfig.fetchMaterialTemp,
2285
+ "fetch-material-type": __props.extraConfig.materialTemp.fetchMaterialType,
2286
+ "fetch-material-temp": __props.extraConfig.materialTemp.fetchMaterialTemp,
2141
2287
  onSelect: handleSelect
2142
2288
  }, null, 8, ["visible", "main-shop-value", "fetch-material-type", "fetch-material-temp"])
2143
2289
  ], 64);
@@ -2165,7 +2311,7 @@ var materialTemp = {
2165
2311
  field: data.field,
2166
2312
  props: {
2167
2313
  uploadPictureRule: data.config.uploadPictureRule,
2168
- extraConfig: extraConfig.materialTemp,
2314
+ extraConfig: extraConfig,
2169
2315
  value: data.value,
2170
2316
  },
2171
2317
  inject: true,
@@ -2256,7 +2402,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2256
2402
  placeholder: "\u8BF7\u8F93\u5165",
2257
2403
  value: __props.defalutValue,
2258
2404
  disabled: __props.disabled,
2259
- onBlur: handleBlur
2405
+ onPressEnter: handleBlur
2260
2406
  }, null, 8, ["value", "disabled"])
2261
2407
  ]),
2262
2408
  _: 1
@@ -2785,7 +2931,7 @@ var department = {
2785
2931
  return yield extraConfig.department.fetch();
2786
2932
  });
2787
2933
  },
2788
- fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
2934
+ fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
2789
2935
  },
2790
2936
  effect: {
2791
2937
  required: data.effect.required && '请选择',
@@ -2828,7 +2974,7 @@ var department = {
2828
2974
  return yield extraConfig.department.fetch();
2829
2975
  });
2830
2976
  },
2831
- fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
2977
+ fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
2832
2978
  },
2833
2979
  effect: {
2834
2980
  required: data.effect.required && '请选择',
@@ -2859,6 +3005,7 @@ var department = {
2859
3005
  minWidth: data.config.fieldRatio,
2860
3006
  slots: {
2861
3007
  default({ row }) {
3008
+ var _a;
2862
3009
  return h(StaffSelector, {
2863
3010
  title: '添加部门',
2864
3011
  mode: data.props.limit ? 'radio' : 'multiple',
@@ -2875,6 +3022,7 @@ var department = {
2875
3022
  return yield extraConfig.department.fetch(params);
2876
3023
  });
2877
3024
  },
3025
+ fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
2878
3026
  });
2879
3027
  },
2880
3028
  },
@@ -1,5 +1,5 @@
1
1
  import { withInstall } from 'bm-admin-ui/es/utils/with-install';
2
- import { defineComponent, openBlock, createElementBlock, normalizeStyle, toDisplayString, computed, resolveComponent, normalizeClass, unref, createBlock, createCommentVNode, withCtx, createVNode, createTextVNode, withModifiers, ref, watch as watch$1, createElementVNode, nextTick, Fragment, isRef, renderList, renderSlot, createStaticVNode, reactive, onBeforeUnmount, resolveDynamicComponent } from 'vue';
2
+ import { defineComponent, openBlock, createElementBlock, normalizeStyle, toDisplayString, computed, resolveComponent, normalizeClass, unref, createBlock, createCommentVNode, withCtx, createVNode, createTextVNode, withModifiers, ref, watch, createElementVNode, nextTick, Fragment, isRef, renderList, renderSlot, createStaticVNode, reactive, onBeforeUnmount, resolveDynamicComponent } from 'vue';
3
3
  import uniqueId from 'bm-admin-ui/es/utils/uniqueId';
4
4
  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';
@@ -848,7 +848,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
848
848
  function emitSetValue(val) {
849
849
  emits("setValue", val);
850
850
  }
851
- watch$1(
851
+ watch(
852
852
  props.options,
853
853
  (val) => {
854
854
  handleRepeatOption(val);
@@ -2525,7 +2525,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2525
2525
  uploadPicRule.hidden = uploadPictureRule.hidden;
2526
2526
  rules.value = [...rules.value];
2527
2527
  }
2528
- watch$1(
2528
+ watch(
2529
2529
  () => props.formCreateInject.rule.config.uploadPictureRule,
2530
2530
  handleUploadPicRule,
2531
2531
  {
@@ -2849,7 +2849,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2849
2849
  emitChangeEvt();
2850
2850
  }
2851
2851
  init();
2852
- watch$1(visible, (val) => {
2852
+ watch(visible, (val) => {
2853
2853
  visibleChange(val);
2854
2854
  });
2855
2855
  return (_ctx, _cache) => {
@@ -3016,10 +3016,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3016
3016
  }
3017
3017
  });
3018
3018
  }
3019
- watch$1(checkedValue, (checkedValue2) => {
3019
+ watch(checkedValue, (checkedValue2) => {
3020
3020
  checkedValueChange(checkedValue2);
3021
3021
  });
3022
- watch$1(selectValue, (selectValue2, oldSelectValue) => {
3022
+ watch(selectValue, (selectValue2, oldSelectValue) => {
3023
3023
  selectValueChange(selectValue2);
3024
3024
  shopLinkProduct(selectValue2, oldSelectValue);
3025
3025
  handleChange(selectValue2);
@@ -3672,7 +3672,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3672
3672
  function getPopupContainer() {
3673
3673
  return document.body;
3674
3674
  }
3675
- watch$1(
3675
+ watch(
3676
3676
  childRules,
3677
3677
  (val) => {
3678
3678
  emits("change", val);
@@ -4145,7 +4145,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4145
4145
  requiredRule.props.disabled = !!flowCondition[activeRule.value.field];
4146
4146
  }
4147
4147
  }
4148
- watch$1(
4148
+ watch(
4149
4149
  () => props.formRules,
4150
4150
  (formRules) => {
4151
4151
  formRules && edit(formRules);
@@ -4154,10 +4154,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4154
4154
  immediate: true
4155
4155
  }
4156
4156
  );
4157
- watch$1(activeProps, (activeProps2) => {
4157
+ watch(activeProps, (activeProps2) => {
4158
4158
  flowConditionEffect(activeProps2, props.flowCondition);
4159
4159
  });
4160
- watch$1(
4160
+ watch(
4161
4161
  () => props.flowCondition,
4162
4162
  (flowCondition) => {
4163
4163
  flowConditionEffect(activeProps.value, flowCondition);
@@ -217,9 +217,9 @@ declare const BmSearchFilter: import("bm-admin-ui/es/utils/with-install").SFCWit
217
217
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
218
218
  onExpand?: ((...args: any[]) => any) | undefined;
219
219
  }, {
220
+ loading: boolean;
220
221
  labelCol: Record<string, any>;
221
222
  value: Record<string, any>;
222
- loading: boolean;
223
223
  showExpandBtn: boolean;
224
224
  showSearchIcon: boolean;
225
225
  expandPlacement: "left" | "right";
@@ -217,9 +217,9 @@ declare const _default: import("vue").DefineComponent<{
217
217
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
218
218
  onExpand?: ((...args: any[]) => any) | undefined;
219
219
  }, {
220
+ loading: boolean;
220
221
  labelCol: Record<string, any>;
221
222
  value: Record<string, any>;
222
- loading: boolean;
223
223
  showExpandBtn: boolean;
224
224
  showSearchIcon: boolean;
225
225
  expandPlacement: "left" | "right";
@@ -210,7 +210,7 @@ declare const BmSelectAll: import("bm-admin-ui/es/utils/with-install").SFCWithIn
210
210
  type: BooleanConstructor;
211
211
  default: any;
212
212
  };
213
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "bordered" | "choiceTransitionName" | "open" | "disabled" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "loading" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
213
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
214
214
  $attrs: {
215
215
  [x: string]: unknown;
216
216
  };
@@ -210,7 +210,7 @@ declare const _default: import("vue").DefineComponent<{
210
210
  type: BooleanConstructor;
211
211
  default: any;
212
212
  };
213
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "bordered" | "choiceTransitionName" | "open" | "disabled" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "loading" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
213
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
214
214
  $attrs: {
215
215
  [x: string]: unknown;
216
216
  };
@@ -1083,9 +1083,9 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
1083
1083
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1084
1084
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1085
1085
  }, {
1086
+ title: string;
1086
1087
  mode: string;
1087
1088
  showCount: boolean;
1088
- title: string;
1089
1089
  visible: boolean;
1090
1090
  unitStr: string;
1091
1091
  limit: number;
@@ -1083,9 +1083,9 @@ declare const _default: import("vue").DefineComponent<{
1083
1083
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1084
1084
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1085
1085
  }, {
1086
+ title: string;
1086
1087
  mode: string;
1087
1088
  showCount: boolean;
1088
- title: string;
1089
1089
  visible: boolean;
1090
1090
  unitStr: string;
1091
1091
  limit: number;
@@ -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, "disabled" | "loading" | "htmlType" | "ghost" | "block" | "danger">;
81
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
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, "disabled" | "loading" | "htmlType" | "ghost" | "block" | "danger">;
83
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
84
84
  $attrs: {
85
85
  [x: string]: unknown;
86
86
  };
@@ -294,8 +294,8 @@ declare const BmEditor: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
294
294
  onReady?: ((...args: any[]) => any) | undefined;
295
295
  onGetCount?: ((...args: any[]) => any) | undefined;
296
296
  }, {
297
- value: string;
298
297
  disabled: boolean;
298
+ value: string;
299
299
  options: {
300
300
  [key: string]: any;
301
301
  };
@@ -294,8 +294,8 @@ declare const _default: import("vue").DefineComponent<{
294
294
  onReady?: ((...args: any[]) => any) | undefined;
295
295
  onGetCount?: ((...args: any[]) => any) | undefined;
296
296
  }, {
297
- value: string;
298
297
  disabled: boolean;
298
+ value: string;
299
299
  options: {
300
300
  [key: string]: any;
301
301
  };
@@ -11,12 +11,14 @@ var BmStaffsSelector = require('bm-admin-ui/lib/components/staffs-selector');
11
11
  var components = require('bm-admin-ui/lib/components');
12
12
  var iconsVue = require('@ant-design/icons-vue');
13
13
  var lodashEs = require('lodash-es');
14
+ var customParseFormat = require('dayjs/plugin/customParseFormat');
14
15
 
15
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
17
 
17
18
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
18
19
  var Picture__default = /*#__PURE__*/_interopDefaultLegacy(Picture);
19
20
  var BmStaffsSelector__default = /*#__PURE__*/_interopDefaultLegacy(BmStaffsSelector);
21
+ var customParseFormat__default = /*#__PURE__*/_interopDefaultLegacy(customParseFormat);
20
22
 
21
23
  const fieldRatioMap = {
22
24
  '25%': 6,
@@ -812,7 +814,8 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
812
814
  val.map((item) => ({
813
815
  [fieldNames.value]: item.key,
814
816
  [fieldNames.label]: item.title,
815
- ...item
817
+ key: item.key,
818
+ title: item.title
816
819
  }))
817
820
  );
818
821
  }
@@ -948,6 +951,7 @@ var people = {
948
951
  minWidth: data.config.fieldRatio,
949
952
  slots: {
950
953
  default({ row }) {
954
+ var _a;
951
955
  return vue.h(StaffSelector, {
952
956
  title: '添加员工',
953
957
  mode: data.props.limit ? 'radio' : 'multiple',
@@ -962,6 +966,7 @@ var people = {
962
966
  return yield extraConfig.people.fetch(params);
963
967
  });
964
968
  },
969
+ fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
965
970
  });
966
971
  },
967
972
  },
@@ -1289,6 +1294,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1289
1294
  emits: ["change"],
1290
1295
  setup(__props, { emit: emits }) {
1291
1296
  const props = __props;
1297
+ dayjs__default["default"].extend(customParseFormat__default["default"]);
1292
1298
  const productInfoKeyMap = {
1293
1299
  \u5546\u54C1\u540D\u79F0: "productName",
1294
1300
  \u5546\u54C1\u7B80\u79F0: "productShortName",
@@ -1297,6 +1303,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1297
1303
  \u5546\u54C1\u7BB1\u89C4: "carton",
1298
1304
  \u5546\u54C1\u5355\u4F4D: "unit"
1299
1305
  };
1306
+ let productIndex = 0;
1300
1307
  const oper = "oper";
1301
1308
  const bmFloatTableRef = vue.ref();
1302
1309
  const importFeature = vue.computed(() => isShow("import"));
@@ -1339,6 +1346,12 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1339
1346
  });
1340
1347
  const xGrid = vue.computed(() => bmFloatTableRef.value.xGrid || {});
1341
1348
  const inputRef = vue.ref();
1349
+ const childRulesMap = vue.computed(
1350
+ () => props.rule?.config?.childRules.reduce((result, item) => {
1351
+ result[item.field] = item;
1352
+ return result;
1353
+ }, {}) || {}
1354
+ );
1342
1355
  function isShow(key) {
1343
1356
  return props.rule.config.tableAdvancedFeatures.includes(key);
1344
1357
  }
@@ -1395,12 +1408,13 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1395
1408
  }, {});
1396
1409
  }
1397
1410
  function getProductColumn(rule) {
1411
+ const productName = `\u5546\u54C1${String(++productIndex).padStart(2, "0")}`;
1398
1412
  const field = rule.field;
1399
1413
  const associatedFields = rule.config.associatedFields;
1400
1414
  const columns2 = [
1401
1415
  {
1402
1416
  field,
1403
- title: "\u5546\u54C1\u7F16\u7801",
1417
+ title: `\u5546\u54C1\u7F16\u7801-${productName}`,
1404
1418
  headerClassName: rule.effect.required ? "is-required" : "",
1405
1419
  minWidth: "138px",
1406
1420
  slots: {
@@ -1412,7 +1426,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1412
1426
  "onUpdate:value": (value) => {
1413
1427
  row[field] = value;
1414
1428
  },
1415
- onChange() {
1429
+ onPressEnter() {
1416
1430
  queryProductInfo(rule, row);
1417
1431
  }
1418
1432
  });
@@ -1425,7 +1439,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1425
1439
  const childField = field + item.value;
1426
1440
  columns2.push({
1427
1441
  field: childField,
1428
- title: item.label,
1442
+ title: `${item.label}-${productName}`,
1429
1443
  minWidth: "138px",
1430
1444
  slots: {
1431
1445
  default({ row }) {
@@ -1488,13 +1502,15 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1488
1502
  function emitChange() {
1489
1503
  emits("change", data);
1490
1504
  }
1491
- function queryProductInfo(rule, row) {
1505
+ async function queryProductInfo(rule, row) {
1492
1506
  const field = rule.field;
1493
1507
  const associatedFields = rule?.config?.associatedFields;
1494
- associatedFields.length && props.extraConfig.product.fetch({ productCode: row[field] }).then((data2) => {
1495
- associatedFields.forEach((item) => {
1496
- row[field + item.value] = data2[productInfoKeyMap[item.value]];
1497
- });
1508
+ return await props.extraConfig.product.fetch({ productCode: row[field] }).then((data2) => {
1509
+ if (data2 && associatedFields.length)
1510
+ associatedFields.forEach((item) => {
1511
+ row[field + item.value] = data2[productInfoKeyMap[item.value]];
1512
+ });
1513
+ return data2;
1498
1514
  });
1499
1515
  }
1500
1516
  function handleChange(e) {
@@ -1503,12 +1519,21 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1503
1519
  reader.onload = (fr) => {
1504
1520
  const rows = parseCsv(fr?.target?.result);
1505
1521
  const validColumns = columns.filter((c) => isValidColumn(c));
1522
+ const result = [];
1506
1523
  rows.forEach((row) => {
1507
1524
  const rowData = {};
1508
1525
  row.forEach((item, index) => {
1509
1526
  rowData[validColumns[index].field] = item;
1510
1527
  });
1511
- data.push(rowData);
1528
+ result.push(rowData);
1529
+ });
1530
+ result.length && validate(result).then((result2) => {
1531
+ data.splice(0, data.length, ...result2);
1532
+ }).catch((error) => {
1533
+ antDesignVue.message.error("\u5B58\u5728\u9519\u8BEF\u6570\u636E\uFF0C\u5BFC\u5165\u5931\u8D25");
1534
+ console.log("---------------");
1535
+ console.log(error);
1536
+ console.log("---------------");
1512
1537
  });
1513
1538
  e.target.value = "";
1514
1539
  };
@@ -1520,10 +1545,127 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1520
1545
  function parseCsv(result) {
1521
1546
  let data2 = [];
1522
1547
  if (result) {
1523
- data2 = result.split("\r\n").slice(1).filter((item) => item).map((item) => item.split(","));
1548
+ const rows = result.split("\r\n");
1549
+ const columnsTxt = rows[0];
1550
+ const columnArr = columnsTxt.includes(" ") ? columnsTxt.split(" ") : columnsTxt.split(",");
1551
+ if (columnArr.length !== columns.filter((c) => isValidColumn(c)).length) {
1552
+ antDesignVue.message.error("\u5BFC\u5165\u7684\u6A21\u677F\u51FA\u9519");
1553
+ } else {
1554
+ data2 = rows.slice(1).filter((item) => item).map(
1555
+ (item) => item.includes(" ") ? item.split(" ") : item.split(",")
1556
+ );
1557
+ }
1524
1558
  }
1525
1559
  return data2;
1526
1560
  }
1561
+ async function validate(rowData) {
1562
+ let error = "";
1563
+ const validColumns = columns.filter((c) => isValidColumn(c));
1564
+ for (const row of rowData) {
1565
+ for (const { field } of validColumns) {
1566
+ const rule = childRulesMap.value[field];
1567
+ const title = rule?.title?.title;
1568
+ if (!rule)
1569
+ break;
1570
+ let value = row[field] || "";
1571
+ const txtFormatFn = rule.config?.txtFormatFn;
1572
+ if (rule.effect.required && !value) {
1573
+ error = `${title}\u4E0D\u80FD\u4E3A\u7A7A`;
1574
+ break;
1575
+ }
1576
+ if (txtFormatFn && !txtFormatFn(value)) {
1577
+ error = `${title}\u586B\u5199\u89C4\u5219\u4E0D\u6B63\u786E`;
1578
+ break;
1579
+ }
1580
+ if (rule.name === "input") {
1581
+ const maxlength = rule.props.maxlength || 200;
1582
+ if (value.length > maxlength) {
1583
+ error = `${title}\u5B57\u6570\u8D85\u51FA`;
1584
+ break;
1585
+ }
1586
+ }
1587
+ if (rule.name === "textarea") {
1588
+ if (value.length > 5e3) {
1589
+ error = `${title}\u5B57\u6570\u8D85\u51FA`;
1590
+ break;
1591
+ }
1592
+ }
1593
+ if (rule.name === "numInput") {
1594
+ if (rule.config.format === 1) {
1595
+ if (!value.includes("%")) {
1596
+ error = `${title}\u4E0D\u4E3A\u767E\u5206\u6570`;
1597
+ break;
1598
+ } else {
1599
+ value = value.replaceAll("%", "");
1600
+ }
1601
+ } else {
1602
+ if (isNaN(value)) {
1603
+ error = `${title}\u4E0D\u4E3A\u6570\u5B57\u7C7B\u578B`;
1604
+ break;
1605
+ }
1606
+ }
1607
+ if (rule.config.decimalPlaces !== void 0 && value.split(".")[1]?.length > rule.config.decimalPlaces) {
1608
+ error = `${title}\u4FDD\u7559\u7684\u5C0F\u6570\u70B9\u4E3A\u4E0D\u6B63\u786E`;
1609
+ break;
1610
+ }
1611
+ }
1612
+ if (rule.name === "radio") {
1613
+ if (rule.options.every((item) => item.value !== value)) {
1614
+ error = `${title}\u4E0D\u5B58\u5728\u8BE5\u9009\u9879`;
1615
+ break;
1616
+ }
1617
+ }
1618
+ if (rule.name === "checkbox") {
1619
+ value = value.split("\u3001");
1620
+ if (value.some((item) => rule.options.every((r) => r.value !== item))) {
1621
+ error = `${title}\u5B58\u5728\u4E0D\u5B58\u5728\u7684\u9009\u9879\u503C`;
1622
+ break;
1623
+ }
1624
+ }
1625
+ if (rule.name === "date") {
1626
+ if (!dayjs__default["default"](value, rule.props.format, true).isValid()) {
1627
+ error = `${title}\u4E0D\u4E3A\u6709\u6548\u65F6\u671F\u6216\u4E0D\u7B26\u5408\u65E5\u671F\u683C\u5F0F`;
1628
+ break;
1629
+ }
1630
+ }
1631
+ if (rule.name === "dateRange") {
1632
+ value = value.split("~");
1633
+ if (value.some((item) => !dayjs__default["default"](item, rule.props.format, true).isValid())) {
1634
+ error = `${title}\u4E0D\u4E3A\u6709\u6548\u65F6\u671F\u6216\u4E0D\u7B26\u5408\u65E5\u671F\u683C\u5F0F`;
1635
+ break;
1636
+ }
1637
+ }
1638
+ if (rule.name === "people" || rule.name === "department") {
1639
+ const limit = rule.props.limit;
1640
+ value = value.split("\u3001").map((item) => ({}));
1641
+ if (limit === 1 && value.length > limit) {
1642
+ error = `${title}\u6700\u591A\u53EA\u80FD\u9009\u4E00\u4E2A`;
1643
+ break;
1644
+ }
1645
+ }
1646
+ if (rule.name === "product") {
1647
+ const productInfo = await queryProductInfo(rule, row);
1648
+ if (!productInfo) {
1649
+ error = `${title}\u67E5\u8BE2\u7684\u5546\u54C1\u4E0D\u5B58\u5728`;
1650
+ break;
1651
+ }
1652
+ }
1653
+ if (rule.name === "shop") {
1654
+ value = {
1655
+ value: Number(value)
1656
+ };
1657
+ }
1658
+ row[field] = value;
1659
+ }
1660
+ if (error)
1661
+ break;
1662
+ }
1663
+ if (error) {
1664
+ return Promise.reject(error);
1665
+ } else {
1666
+ return Promise.resolve(rowData);
1667
+ }
1668
+ }
1527
1669
  vue.watch(
1528
1670
  () => props.rule,
1529
1671
  () => {
@@ -1696,7 +1838,9 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
1696
1838
  return panes.find((pane) => pane.key === activeKey.value);
1697
1839
  }
1698
1840
  function getTempDetail(templateCode) {
1699
- return props.extraConfig.fetchMaterialTempDetail({ templateCode });
1841
+ return props.extraConfig.materialTemp.fetchMaterialTempDetail({
1842
+ templateCode
1843
+ });
1700
1844
  }
1701
1845
  function handleUpload(list) {
1702
1846
  getAcitvePane().uploadList = list;
@@ -1803,9 +1947,11 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
1803
1947
  }
1804
1948
  if (coverage.fieldType === 2) {
1805
1949
  const decimalPlaces = extraValues.decimalPlaces || 0;
1950
+ value.config.decimalPlaces = decimalPlaces;
1806
1951
  value.props = {
1807
1952
  placeholder: "\u8BF7\u8F93\u5165"
1808
1953
  };
1954
+ value.config.format = extraValues.format;
1809
1955
  if (extraValues.format === 1) {
1810
1956
  value.props.parser = (value2) => lodashEs.floor(value2.replace("%", ""), decimalPlaces);
1811
1957
  value.props.formatter = (value2) => `${value2}%`;
@@ -1872,7 +2018,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
1872
2018
  }
1873
2019
  }
1874
2020
  props.value && initValue(props.value);
1875
- props.extraConfig.getDict().then((data) => {
2021
+ props.extraConfig.materialTemp.getDict().then((data) => {
1876
2022
  measrueDicts.value = data;
1877
2023
  });
1878
2024
  vue.watch(mainShopValue, () => {
@@ -2110,7 +2256,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
2110
2256
  "extra-props": {
2111
2257
  maxCount: 9
2112
2258
  },
2113
- "upload-request": __props.extraConfig.uploadRequest,
2259
+ "upload-request": __props.extraConfig.materialTemp.uploadRequest,
2114
2260
  "default-list": pane.uploadList,
2115
2261
  onUpdate: handleUpload
2116
2262
  }, null, 8, ["upload-props", "upload-request", "default-list"])
@@ -2130,8 +2276,9 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
2130
2276
  key: 0,
2131
2277
  rule: pane.tableRule,
2132
2278
  "disabled-table": __props.disabled?.includes?.("editTable"),
2279
+ "extra-config": __props.extraConfig,
2133
2280
  onChange: handleTableDataChange
2134
- }, null, 8, ["rule", "disabled-table"])) : vue.createCommentVNode("v-if", true)
2281
+ }, null, 8, ["rule", "disabled-table", "extra-config"])) : vue.createCommentVNode("v-if", true)
2135
2282
  ]),
2136
2283
  _: 2
2137
2284
  }, 1024)
@@ -2146,8 +2293,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
2146
2293
  visible: visible.value,
2147
2294
  "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
2148
2295
  "main-shop-value": vue.unref(mainShopValue),
2149
- "fetch-material-type": __props.extraConfig.fetchMaterialType,
2150
- "fetch-material-temp": __props.extraConfig.fetchMaterialTemp,
2296
+ "fetch-material-type": __props.extraConfig.materialTemp.fetchMaterialType,
2297
+ "fetch-material-temp": __props.extraConfig.materialTemp.fetchMaterialTemp,
2151
2298
  onSelect: handleSelect
2152
2299
  }, null, 8, ["visible", "main-shop-value", "fetch-material-type", "fetch-material-temp"])
2153
2300
  ], 64);
@@ -2175,7 +2322,7 @@ var materialTemp = {
2175
2322
  field: data.field,
2176
2323
  props: {
2177
2324
  uploadPictureRule: data.config.uploadPictureRule,
2178
- extraConfig: extraConfig.materialTemp,
2325
+ extraConfig: extraConfig,
2179
2326
  value: data.value,
2180
2327
  },
2181
2328
  inject: true,
@@ -2266,7 +2413,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
2266
2413
  placeholder: "\u8BF7\u8F93\u5165",
2267
2414
  value: __props.defalutValue,
2268
2415
  disabled: __props.disabled,
2269
- onBlur: handleBlur
2416
+ onPressEnter: handleBlur
2270
2417
  }, null, 8, ["value", "disabled"])
2271
2418
  ]),
2272
2419
  _: 1
@@ -2795,7 +2942,7 @@ var department = {
2795
2942
  return yield extraConfig.department.fetch();
2796
2943
  });
2797
2944
  },
2798
- fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
2945
+ fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
2799
2946
  },
2800
2947
  effect: {
2801
2948
  required: data.effect.required && '请选择',
@@ -2838,7 +2985,7 @@ var department = {
2838
2985
  return yield extraConfig.department.fetch();
2839
2986
  });
2840
2987
  },
2841
- fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
2988
+ fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
2842
2989
  },
2843
2990
  effect: {
2844
2991
  required: data.effect.required && '请选择',
@@ -2869,6 +3016,7 @@ var department = {
2869
3016
  minWidth: data.config.fieldRatio,
2870
3017
  slots: {
2871
3018
  default({ row }) {
3019
+ var _a;
2872
3020
  return vue.h(StaffSelector, {
2873
3021
  title: '添加部门',
2874
3022
  mode: data.props.limit ? 'radio' : 'multiple',
@@ -2885,6 +3033,7 @@ var department = {
2885
3033
  return yield extraConfig.department.fetch(params);
2886
3034
  });
2887
3035
  },
3036
+ fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
2888
3037
  });
2889
3038
  },
2890
3039
  },
@@ -1274,7 +1274,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
1274
1274
  dateValue.value = date;
1275
1275
  emitChange(date);
1276
1276
  }
1277
- watch(format, () => {
1277
+ vue.watch(format, () => {
1278
1278
  handleDateChange("");
1279
1279
  });
1280
1280
  return (_ctx, _cache) => {
@@ -217,9 +217,9 @@ declare const BmSearchFilter: import("bm-admin-ui/es/utils/with-install").SFCWit
217
217
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
218
218
  onExpand?: ((...args: any[]) => any) | undefined;
219
219
  }, {
220
+ loading: boolean;
220
221
  labelCol: Record<string, any>;
221
222
  value: Record<string, any>;
222
- loading: boolean;
223
223
  showExpandBtn: boolean;
224
224
  showSearchIcon: boolean;
225
225
  expandPlacement: "left" | "right";
@@ -217,9 +217,9 @@ declare const _default: import("vue").DefineComponent<{
217
217
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
218
218
  onExpand?: ((...args: any[]) => any) | undefined;
219
219
  }, {
220
+ loading: boolean;
220
221
  labelCol: Record<string, any>;
221
222
  value: Record<string, any>;
222
- loading: boolean;
223
223
  showExpandBtn: boolean;
224
224
  showSearchIcon: boolean;
225
225
  expandPlacement: "left" | "right";
@@ -210,7 +210,7 @@ declare const BmSelectAll: import("bm-admin-ui/es/utils/with-install").SFCWithIn
210
210
  type: BooleanConstructor;
211
211
  default: any;
212
212
  };
213
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "bordered" | "choiceTransitionName" | "open" | "disabled" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "loading" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
213
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
214
214
  $attrs: {
215
215
  [x: string]: unknown;
216
216
  };
@@ -210,7 +210,7 @@ declare const _default: import("vue").DefineComponent<{
210
210
  type: BooleanConstructor;
211
211
  default: any;
212
212
  };
213
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "bordered" | "choiceTransitionName" | "open" | "disabled" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "loading" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
213
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
214
214
  $attrs: {
215
215
  [x: string]: unknown;
216
216
  };
@@ -1083,9 +1083,9 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
1083
1083
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1084
1084
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1085
1085
  }, {
1086
+ title: string;
1086
1087
  mode: string;
1087
1088
  showCount: boolean;
1088
- title: string;
1089
1089
  visible: boolean;
1090
1090
  unitStr: string;
1091
1091
  limit: number;
@@ -1083,9 +1083,9 @@ declare const _default: import("vue").DefineComponent<{
1083
1083
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1084
1084
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1085
1085
  }, {
1086
+ title: string;
1086
1087
  mode: string;
1087
1088
  showCount: boolean;
1088
- title: string;
1089
1089
  visible: boolean;
1090
1090
  unitStr: string;
1091
1091
  limit: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bm-admin-ui",
3
- "version": "1.0.52-alpha",
3
+ "version": "1.0.54-alpha",
4
4
  "private": false,
5
5
  "description": "An Admin Component Library for Bm",
6
6
  "license": "UNLICENSED",
@@ -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, "disabled" | "loading" | "htmlType" | "ghost" | "block" | "danger">;
81
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
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, "disabled" | "loading" | "htmlType" | "ghost" | "block" | "danger">;
83
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
84
84
  $attrs: {
85
85
  [x: string]: unknown;
86
86
  };
@@ -294,8 +294,8 @@ declare const BmEditor: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
294
294
  onReady?: ((...args: any[]) => any) | undefined;
295
295
  onGetCount?: ((...args: any[]) => any) | undefined;
296
296
  }, {
297
- value: string;
298
297
  disabled: boolean;
298
+ value: string;
299
299
  options: {
300
300
  [key: string]: any;
301
301
  };
@@ -294,8 +294,8 @@ declare const _default: import("vue").DefineComponent<{
294
294
  onReady?: ((...args: any[]) => any) | undefined;
295
295
  onGetCount?: ((...args: any[]) => any) | undefined;
296
296
  }, {
297
- value: string;
298
297
  disabled: boolean;
298
+ value: string;
299
299
  options: {
300
300
  [key: string]: any;
301
301
  };
@@ -217,9 +217,9 @@ declare const BmSearchFilter: import("bm-admin-ui/es/utils/with-install").SFCWit
217
217
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
218
218
  onExpand?: ((...args: any[]) => any) | undefined;
219
219
  }, {
220
+ loading: boolean;
220
221
  labelCol: Record<string, any>;
221
222
  value: Record<string, any>;
222
- loading: boolean;
223
223
  showExpandBtn: boolean;
224
224
  showSearchIcon: boolean;
225
225
  expandPlacement: "left" | "right";
@@ -217,9 +217,9 @@ declare const _default: import("vue").DefineComponent<{
217
217
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
218
218
  onExpand?: ((...args: any[]) => any) | undefined;
219
219
  }, {
220
+ loading: boolean;
220
221
  labelCol: Record<string, any>;
221
222
  value: Record<string, any>;
222
- loading: boolean;
223
223
  showExpandBtn: boolean;
224
224
  showSearchIcon: boolean;
225
225
  expandPlacement: "left" | "right";
@@ -210,7 +210,7 @@ declare const BmSelectAll: import("bm-admin-ui/es/utils/with-install").SFCWithIn
210
210
  type: BooleanConstructor;
211
211
  default: any;
212
212
  };
213
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "bordered" | "choiceTransitionName" | "open" | "disabled" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "loading" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
213
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
214
214
  $attrs: {
215
215
  [x: string]: unknown;
216
216
  };
@@ -210,7 +210,7 @@ declare const _default: import("vue").DefineComponent<{
210
210
  type: BooleanConstructor;
211
211
  default: any;
212
212
  };
213
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "bordered" | "choiceTransitionName" | "open" | "disabled" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "loading" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
213
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
214
214
  $attrs: {
215
215
  [x: string]: unknown;
216
216
  };
@@ -1083,9 +1083,9 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
1083
1083
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1084
1084
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1085
1085
  }, {
1086
+ title: string;
1086
1087
  mode: string;
1087
1088
  showCount: boolean;
1088
- title: string;
1089
1089
  visible: boolean;
1090
1090
  unitStr: string;
1091
1091
  limit: number;
@@ -1083,9 +1083,9 @@ declare const _default: import("vue").DefineComponent<{
1083
1083
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1084
1084
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1085
1085
  }, {
1086
+ title: string;
1086
1087
  mode: string;
1087
1088
  showCount: boolean;
1088
- title: string;
1089
1089
  visible: boolean;
1090
1090
  unitStr: string;
1091
1091
  limit: number;