bm-admin-ui 1.0.54-alpha → 1.0.56-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 (47) 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 +167 -86
  6. package/es/components/form-designer/index.js +11 -0
  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 +2 -1
  12. package/es/components/staffs-selector/index.js +4 -1
  13. package/es/components/staffs-selector/src/multipleCmp.vue.d.ts +1 -0
  14. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -1
  15. package/es/utils/isNull.d.ts +1 -0
  16. package/es/utils/isNull.js +5 -0
  17. package/lib/components/button/index.d.ts +1 -1
  18. package/lib/components/button/src/button.vue.d.ts +1 -1
  19. package/lib/components/editor/index.d.ts +1 -1
  20. package/lib/components/editor/src/editor.vue.d.ts +1 -1
  21. package/lib/components/form-create/index.js +165 -84
  22. package/lib/components/form-designer/index.js +11 -0
  23. package/lib/components/search-filter/index.d.ts +1 -1
  24. package/lib/components/search-filter/src/search-filter.vue.d.ts +1 -1
  25. package/lib/components/select-all/index.d.ts +1 -1
  26. package/lib/components/select-all/src/selectAll.vue.d.ts +1 -1
  27. package/lib/components/staffs-selector/index.d.ts +2 -1
  28. package/lib/components/staffs-selector/index.js +4 -1
  29. package/lib/components/staffs-selector/src/multipleCmp.vue.d.ts +1 -0
  30. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -1
  31. package/lib/utils/isNull.d.ts +1 -0
  32. package/lib/utils/isNull.js +9 -0
  33. package/package.json +1 -1
  34. package/theme-chalk/form-create.css +1 -1
  35. package/theme-chalk/index.css +1 -1
  36. package/types/components/button/index.d.ts +1 -1
  37. package/types/components/button/src/button.vue.d.ts +1 -1
  38. package/types/components/editor/index.d.ts +1 -1
  39. package/types/components/editor/src/editor.vue.d.ts +1 -1
  40. package/types/components/search-filter/index.d.ts +1 -1
  41. package/types/components/search-filter/src/search-filter.vue.d.ts +1 -1
  42. package/types/components/select-all/index.d.ts +1 -1
  43. package/types/components/select-all/src/selectAll.vue.d.ts +1 -1
  44. package/types/components/staffs-selector/index.d.ts +2 -1
  45. package/types/components/staffs-selector/src/multipleCmp.vue.d.ts +1 -0
  46. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -1
  47. package/types/utils/isNull.d.ts +1 -0
@@ -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, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
81
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "loading" | "htmlType" | "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, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
83
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "loading" | "htmlType" | "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
- disabled: boolean;
298
297
  value: string;
298
+ disabled: boolean;
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
- disabled: boolean;
298
297
  value: string;
298
+ disabled: boolean;
299
299
  options: {
300
300
  [key: string]: any;
301
301
  };
@@ -1,13 +1,14 @@
1
1
  import { withInstall } from 'bm-admin-ui/es/utils/with-install';
2
- import { h, nextTick, defineComponent, ref, watch, openBlock, createElementBlock, createVNode, unref, computed, normalizeStyle, Fragment, renderList, normalizeClass, reactive, createBlock, withCtx, createTextVNode, createElementVNode, toDisplayString, createCommentVNode, inject, createStaticVNode, provide, resolveComponent } from 'vue';
2
+ import { h, nextTick, defineComponent, ref, watch, openBlock, createElementBlock, createVNode, unref, computed, normalizeStyle, Fragment, renderList, normalizeClass, reactive, createBlock, withCtx, createTextVNode, createElementVNode, toDisplayString, createCommentVNode, createSlots, inject, createStaticVNode, provide, resolveComponent } from 'vue';
3
3
  import { Input, InputNumber, Select, DatePicker, RangePicker, message, Modal, Layout, LayoutSider, Tree, LayoutContent, Button, Row, Col, Pagination, FormItemRest, Divider, Tabs, TabPane, Cascader } from 'ant-design-vue';
4
4
  import dayjs from 'dayjs';
5
5
  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, floor, debounce } from 'lodash-es';
9
+ import { debounce, cloneDeep, floor } from 'lodash-es';
10
10
  import customParseFormat from 'dayjs/plugin/customParseFormat';
11
+ import { isNull } from 'bm-admin-ui/es/utils/isNull';
11
12
 
12
13
  const fieldRatioMap = {
13
14
  '25%': 6,
@@ -811,6 +812,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
811
812
  function handleAdd() {
812
813
  visible.value = true;
813
814
  }
815
+ function getPopupContainer() {
816
+ return document.body;
817
+ }
814
818
  watch(
815
819
  () => props.defaultSelected,
816
820
  (val) => {
@@ -830,9 +834,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
830
834
  "onUpdate:list": _cache[0] || (_cache[0] = ($event) => selected.value = $event),
831
835
  "show-empty-btn": false,
832
836
  disabled: __props.disabled,
837
+ "tool-tip-props": {
838
+ getPopupContainer
839
+ },
833
840
  "show-empty": "",
834
841
  onAddClick: handleAdd
835
- }, null, 8, ["list", "disabled"]),
842
+ }, null, 8, ["list", "disabled", "tool-tip-props"]),
836
843
  createVNode(unref(BmStaffsSelector), {
837
844
  select: selected.value,
838
845
  "onUpdate:select": _cache[1] || (_cache[1] = ($event) => selected.value = $event),
@@ -1278,7 +1285,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1278
1285
  "extraConfig",
1279
1286
  "disabled",
1280
1287
  "disabledTable",
1281
- "hidden"
1288
+ "hidden",
1289
+ "formCreateInject"
1282
1290
  ],
1283
1291
  emits: ["change"],
1284
1292
  setup(__props, { emit: emits }) {
@@ -1303,6 +1311,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1303
1311
  const config = computed(() => ({
1304
1312
  columns: [...columns],
1305
1313
  data: [...data],
1314
+ columnConfig: {
1315
+ resizable: true
1316
+ },
1306
1317
  checkboxConfig: {
1307
1318
  trigger: "cell",
1308
1319
  checkMethod() {
@@ -1341,12 +1352,16 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1341
1352
  return result;
1342
1353
  }, {}) || {}
1343
1354
  );
1355
+ const productInputSlots = reactive([]);
1356
+ const formData = computed(() => props.formCreateInject.api.bind());
1357
+ const queryProductInfoDebounce = debounce(handlePressEnter, 300);
1344
1358
  function isShow(key) {
1345
1359
  return props.rule.config.tableAdvancedFeatures.includes(key);
1346
1360
  }
1347
1361
  function initConfig() {
1348
1362
  columns.splice(0, columns.length);
1349
1363
  data.splice(0, data.length);
1364
+ productInputSlots.splice(0, productInputSlots.length);
1350
1365
  const childRules = cloneDeep(props.rule.config.childRules);
1351
1366
  const value = props.rule.value;
1352
1367
  if (deleteFeature.value && !props.hidden) {
@@ -1400,6 +1415,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1400
1415
  const productName = `\u5546\u54C1${String(++productIndex).padStart(2, "0")}`;
1401
1416
  const field = rule.field;
1402
1417
  const associatedFields = rule.config.associatedFields;
1418
+ productInputSlots.push(rule);
1403
1419
  const columns2 = [
1404
1420
  {
1405
1421
  field,
@@ -1407,19 +1423,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1407
1423
  headerClassName: rule.effect.required ? "is-required" : "",
1408
1424
  minWidth: "138px",
1409
1425
  slots: {
1410
- default({ row }) {
1411
- return h(Input, {
1412
- value: row[field],
1413
- placeholder: "\u8BF7\u8F93\u5165",
1414
- disabled: rule.disabled,
1415
- "onUpdate:value": (value) => {
1416
- row[field] = value;
1417
- },
1418
- onPressEnter() {
1419
- queryProductInfo(rule, row);
1420
- }
1421
- });
1422
- }
1426
+ default: rule.field
1423
1427
  }
1424
1428
  }
1425
1429
  ];
@@ -1434,7 +1438,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1434
1438
  default({ row }) {
1435
1439
  if (item.value === "\u5546\u54C1\u56FE\u7247" && row[childField]) {
1436
1440
  return h("img", {
1437
- src: "/cloudStorage/read/read?p=" + row[childField],
1441
+ src: props.extraConfig.common.previewImg(row[childField]),
1438
1442
  style: {
1439
1443
  width: "86px",
1440
1444
  height: "86px",
@@ -1495,9 +1499,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1495
1499
  const field = rule.field;
1496
1500
  const associatedFields = rule?.config?.associatedFields;
1497
1501
  return await props.extraConfig.product.fetch({ productCode: row[field] }).then((data2) => {
1498
- if (data2 && associatedFields.length)
1502
+ if (associatedFields.length)
1499
1503
  associatedFields.forEach((item) => {
1500
- row[field + item.value] = data2[productInfoKeyMap[item.value]];
1504
+ row[field + item.value] = data2 ? data2[productInfoKeyMap[item.value]] : void 0;
1501
1505
  });
1502
1506
  return data2;
1503
1507
  });
@@ -1655,6 +1659,21 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1655
1659
  return Promise.resolve(rowData);
1656
1660
  }
1657
1661
  }
1662
+ function pruductInputDisabled(shopField) {
1663
+ if (!shopField)
1664
+ return false;
1665
+ return !formData.value[shopField];
1666
+ }
1667
+ function handlePressEnter(rule, row) {
1668
+ queryProductInfo(rule, row).then((data2) => {
1669
+ if (!data2) {
1670
+ row[rule.field] = "";
1671
+ }
1672
+ });
1673
+ }
1674
+ function handleProductInputChange(rule, row) {
1675
+ queryProductInfoDebounce(rule, row);
1676
+ }
1658
1677
  watch(
1659
1678
  () => props.rule,
1660
1679
  () => {
@@ -1737,7 +1756,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1737
1756
  ref_key: "bmFloatTableRef",
1738
1757
  ref: bmFloatTableRef,
1739
1758
  config: unref(config)
1740
- }, {
1759
+ }, createSlots({
1741
1760
  floatHandle: withCtx(({ row, rowIndex }) => [
1742
1761
  unref(copyFeature) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1743
1762
  createVNode(unref(Button), {
@@ -1765,8 +1784,24 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1765
1784
  _: 2
1766
1785
  }, 1032, ["disabled", "onClick"])
1767
1786
  ]),
1768
- _: 1
1769
- }, 8, ["config"])
1787
+ _: 2
1788
+ }, [
1789
+ renderList(productInputSlots, (item) => {
1790
+ return {
1791
+ name: item.field,
1792
+ fn: withCtx(({ row }) => [
1793
+ createVNode(unref(Input), {
1794
+ value: row[item.field],
1795
+ "onUpdate:value": ($event) => row[item.field] = $event,
1796
+ placeholder: "\u8BF7\u8F93\u5165",
1797
+ disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
1798
+ onPressEnter: ($event) => handlePressEnter(item, row),
1799
+ onChange: ($event) => handleProductInputChange(item, row)
1800
+ }, null, 8, ["value", "onUpdate:value", "disabled", "onPressEnter", "onChange"])
1801
+ ])
1802
+ };
1803
+ })
1804
+ ]), 1032, ["config"])
1770
1805
  ]),
1771
1806
  _: 1
1772
1807
  })
@@ -1971,7 +2006,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1971
2006
  return void 0;
1972
2007
  }
1973
2008
  function handleTableDataChange(value) {
1974
- getAcitvePane().tableData = value;
2009
+ const activePane2 = getAcitvePane();
2010
+ activePane2.tableData = value;
1975
2011
  }
1976
2012
  function emitChange() {
1977
2013
  emits("change", {
@@ -1982,7 +2018,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1982
2018
  tempIdSelected: pane.tempSelected.templateCode || pane.tempIdSelected,
1983
2019
  templateName: pane.tempSelected?.templateName || pane.templateName,
1984
2020
  tableData: pane.tableData,
1985
- uploadList: pane.uploadList
2021
+ uploadList: pane.uploadList,
2022
+ tableRequiredFields: pane.tableRule?.config?.childRules?.filter((rule) => rule.effect?.required).map((rule) => rule.field)
1986
2023
  }))
1987
2024
  });
1988
2025
  }
@@ -2320,6 +2357,30 @@ var materialTemp = {
2320
2357
  inject.self.value = value;
2321
2358
  },
2322
2359
  },
2360
+ validate: [
2361
+ {
2362
+ validator(rule, value) {
2363
+ if (isNull(value)) {
2364
+ return Promise.reject();
2365
+ }
2366
+ const panes = value.panes;
2367
+ for (const pane of panes) {
2368
+ if (!pane.tempIdSelected) {
2369
+ return Promise.reject();
2370
+ }
2371
+ if (pane.tableRequiredFields) {
2372
+ for (const field of pane.tableRequiredFields) {
2373
+ if (pane.tableData.some((row) => isNull(row[field]))) {
2374
+ return Promise.reject();
2375
+ }
2376
+ }
2377
+ }
2378
+ }
2379
+ return Promise.resolve();
2380
+ },
2381
+ message: '请检查必填项',
2382
+ },
2383
+ ],
2323
2384
  },
2324
2385
  ],
2325
2386
  class: 'bm-fc-module-widget',
@@ -2337,7 +2398,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2337
2398
  "required",
2338
2399
  "extraConfig",
2339
2400
  "defalutValue",
2340
- "disabled"
2401
+ "disabled",
2402
+ "formCreateInject"
2341
2403
  ],
2342
2404
  emits: ["change"],
2343
2405
  setup(__props, { emit: emits }) {
@@ -2352,16 +2414,28 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2352
2414
  \u5546\u54C1\u5355\u4F4D: "unit"
2353
2415
  };
2354
2416
  const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
2417
+ const formData = computed(() => props.formCreateInject.api.bind());
2418
+ const debounceFn = debounce(handleBlur, 300);
2419
+ const inputValue = ref(props.defalutValue);
2355
2420
  async function fetch(value) {
2356
- productInfo.value = await props.extraConfig.fetch({
2421
+ return productInfo.value = await props.extraConfig.product.fetch({
2357
2422
  productCode: value,
2358
2423
  filterByShopcode: props.dataFiltering
2359
2424
  }) || {};
2360
2425
  }
2361
2426
  function handleBlur(evt) {
2362
2427
  const value = evt.target.value;
2363
- emitChange(value);
2364
- fetch(value);
2428
+ fetch(value).then((result) => {
2429
+ if (Object.keys(result).length) {
2430
+ emitChange(value);
2431
+ } else {
2432
+ emitChange();
2433
+ inputValue.value = "";
2434
+ }
2435
+ });
2436
+ }
2437
+ function handleChange(evt) {
2438
+ debounceFn(evt);
2365
2439
  }
2366
2440
  function getValue(value) {
2367
2441
  return productInfo.value[productInfoKeyMap[value]];
@@ -2369,6 +2443,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2369
2443
  function emitChange(value) {
2370
2444
  emits("change", value);
2371
2445
  }
2446
+ function inputDisbale(shopField) {
2447
+ return shopField && !formData.value[shopField];
2448
+ }
2372
2449
  watch(
2373
2450
  () => props.defalutValue,
2374
2451
  (val) => {
@@ -2399,10 +2476,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2399
2476
  createVNode(unref(Col), { flex: 1 }, {
2400
2477
  default: withCtx(() => [
2401
2478
  createVNode(unref(Input), {
2479
+ value: inputValue.value,
2480
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
2402
2481
  placeholder: "\u8BF7\u8F93\u5165",
2403
- value: __props.defalutValue,
2404
- disabled: __props.disabled,
2405
- onPressEnter: handleBlur
2482
+ disabled: __props.disabled || inputDisbale(__props.dataFiltering),
2483
+ onPressEnter: handleBlur,
2484
+ onChange: handleChange
2406
2485
  }, null, 8, ["value", "disabled"])
2407
2486
  ]),
2408
2487
  _: 1
@@ -2435,7 +2514,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2435
2514
  getValue(field.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2436
2515
  field.value === "\u5546\u54C1\u56FE\u7247" ? (openBlock(), createElementBlock("img", {
2437
2516
  key: 0,
2438
- src: getValue(field.value)
2517
+ class: "bm-fc-form-item__img",
2518
+ src: __props.extraConfig.common.previewImg(getValue(field.value))
2439
2519
  }, null, 8, _hoisted_2$2)) : field.value === "\u5546\u54C1\u5355\u4F4D" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2440
2520
  createTextVNode(toDisplayString(unitMap[getValue(field.value)]), 1)
2441
2521
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
@@ -2476,7 +2556,7 @@ var product = {
2476
2556
  required: data.effect.required,
2477
2557
  associatedFields: data.config.associatedFields,
2478
2558
  dataFiltering: data.config.dataFiltering,
2479
- extraConfig: extraConfig.product,
2559
+ extraConfig: extraConfig,
2480
2560
  defalutValue: data.value,
2481
2561
  },
2482
2562
  inject: true,
@@ -2490,7 +2570,7 @@ var product = {
2490
2570
  },
2491
2571
  };
2492
2572
  },
2493
- rowRule(data) {
2573
+ rowRule(data, extraConfig) {
2494
2574
  return {
2495
2575
  type: 'ProductInfo',
2496
2576
  component: ProductInfo,
@@ -2503,6 +2583,7 @@ var product = {
2503
2583
  associatedFields: data.config.associatedFields,
2504
2584
  dataFiltering: data.config.dataFiltering,
2505
2585
  defalutValue: data.value,
2586
+ extraConfig: extraConfig,
2506
2587
  },
2507
2588
  inject: true,
2508
2589
  on: {
@@ -2677,45 +2758,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2677
2758
  const props = __props;
2678
2759
  const options = ref([]);
2679
2760
  function initOptions() {
2680
- props.config.fetch({ level: 1, relationCode: "" }).then((result) => {
2681
- result.forEach((item) => {
2682
- item.isLeaf = props.format === 1;
2683
- });
2761
+ props.config.fetch().then((result) => {
2762
+ processOptions(result, 1);
2684
2763
  options.value = result;
2685
- return options.value;
2686
- }).then((options2) => {
2687
- if (props.value?.length) {
2688
- if (props.multiple) {
2689
- props.value.forEach((item) => loadValueOptions(item, options2));
2690
- } else {
2691
- loadValueOptions(props.value, options2);
2692
- }
2693
- }
2694
2764
  });
2695
2765
  }
2696
- async function loadData(selectedOptions) {
2697
- const optionLength = selectedOptions.length;
2698
- const targetOption = selectedOptions[optionLength - 1];
2699
- targetOption.loading = true;
2700
- return await props.config.fetch({
2701
- level: optionLength + 1,
2702
- relationCode: targetOption.value
2703
- }).then((result) => {
2704
- result.forEach((item) => {
2705
- item.isLeaf = props.format === optionLength + 1;
2706
- });
2707
- if (result.length) {
2708
- targetOption.children = result;
2709
- } else {
2710
- targetOption.isLeaf = true;
2766
+ function processOptions(options2, level) {
2767
+ options2.forEach((option) => {
2768
+ option.value = option[props.config.fieldNames.value];
2769
+ option.label = option[props.config.fieldNames.label];
2770
+ option.children = option[props.config.fieldNames.children];
2771
+ if (level === props.format) {
2772
+ delete option.children;
2773
+ }
2774
+ if (option.children?.length) {
2775
+ processOptions(option.children, level + 1);
2711
2776
  }
2712
- }).finally(() => {
2713
- targetOption.loading = false;
2714
2777
  });
2715
2778
  }
2716
2779
  function handleChange(value, selectedOptions) {
2717
2780
  const result = cloneDeep(selectedOptions);
2718
- processValue(result);
2781
+ result && processValue(result);
2719
2782
  emits("change", result);
2720
2783
  }
2721
2784
  function processValue(selectedOptions) {
@@ -2741,23 +2804,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2741
2804
  return pre;
2742
2805
  }, []);
2743
2806
  }
2744
- async function loadValueOptions(value, options2) {
2745
- const selectedOptions = [];
2746
- for (const option of value) {
2747
- let cur;
2748
- if (selectedOptions.length) {
2749
- cur = selectedOptions[selectedOptions.length - 1].children.find(
2750
- (item) => item.value === option.value
2751
- );
2752
- } else {
2753
- cur = options2.find((item) => item.value === option.value);
2754
- }
2755
- if (!cur.isLeaf) {
2756
- selectedOptions.push(cur);
2757
- await loadData(selectedOptions);
2758
- }
2759
- }
2760
- }
2761
2807
  initOptions();
2762
2808
  return (_ctx, _cache) => {
2763
2809
  return openBlock(), createBlock(unref(Cascader), {
@@ -2765,7 +2811,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2765
2811
  placeholder: "\u8BF7\u8F93\u5165",
2766
2812
  multiple: __props.multiple,
2767
2813
  options: options.value,
2768
- "load-data": loadData,
2769
2814
  "change-on-select": "",
2770
2815
  "get-popup-container": unref(getContainer),
2771
2816
  onChange: handleChange
@@ -2804,6 +2849,7 @@ var materialType = {
2804
2849
  const rule = inject.self;
2805
2850
  rule.value = list;
2806
2851
  rule.props.value = list;
2852
+ inject.api.emit('value-change', inject.api.bind());
2807
2853
  nextTick(() => {
2808
2854
  setTimeout(() => {
2809
2855
  inject.api.validateField(rule.field);
@@ -2841,6 +2887,7 @@ var materialType = {
2841
2887
  const rule = inject.self;
2842
2888
  rule.value = list;
2843
2889
  rule.props.value = list;
2890
+ inject.api.emit('value-change', inject.api.bind());
2844
2891
  nextTick(() => {
2845
2892
  setTimeout(() => {
2846
2893
  inject.api.validateField(rule.field);
@@ -3030,6 +3077,20 @@ var department = {
3030
3077
  },
3031
3078
  };
3032
3079
 
3080
+ function validator(rule, value) {
3081
+ var _a;
3082
+ const childRules = ((_a = rule.config) === null || _a === void 0 ? void 0 : _a.childRules) || [];
3083
+ const requiredRules = childRules.filter((rule) => { var _a; return (_a = rule === null || rule === void 0 ? void 0 : rule.effect) === null || _a === void 0 ? void 0 : _a.required; });
3084
+ if (requiredRules.length && isNull(value)) {
3085
+ return Promise.reject();
3086
+ }
3087
+ for (const rule of requiredRules) {
3088
+ if (value.some((item) => isNull(item[rule.field]))) {
3089
+ return Promise.reject();
3090
+ }
3091
+ }
3092
+ return Promise.resolve();
3093
+ }
3033
3094
  var table = {
3034
3095
  name: 'table',
3035
3096
  rule(data, extraConfig) {
@@ -3044,9 +3105,19 @@ var table = {
3044
3105
  inject: true,
3045
3106
  on: {
3046
3107
  change(inject, value) {
3047
- inject.self.value = value;
3108
+ const rule = inject.self;
3109
+ rule.value = value;
3110
+ inject.api.emit('value-change', inject.api.bind());
3048
3111
  },
3049
3112
  },
3113
+ validate: [
3114
+ {
3115
+ validator(rule, value) {
3116
+ return validator(data, value);
3117
+ },
3118
+ message: '请检查必填项',
3119
+ },
3120
+ ],
3050
3121
  };
3051
3122
  },
3052
3123
  rowRule(data, extraConfig) {
@@ -3062,8 +3133,17 @@ var table = {
3062
3133
  on: {
3063
3134
  change(inject, value) {
3064
3135
  inject.self.value = value;
3136
+ inject.api.emit('value-change', inject.api.bind());
3065
3137
  },
3066
3138
  },
3139
+ validate: [
3140
+ {
3141
+ validator(rule, value) {
3142
+ return validator(data, value);
3143
+ },
3144
+ message: '请检查必填项',
3145
+ },
3146
+ ],
3067
3147
  col: {
3068
3148
  span: 24,
3069
3149
  },
@@ -3384,7 +3464,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3384
3464
  "model-value": __props.value,
3385
3465
  option,
3386
3466
  rule: rule.value,
3387
- "onUpdate:modelValue": handleValue
3467
+ "onUpdate:modelValue": handleValue,
3468
+ onValueChange: handleValue
3388
3469
  }, null, 8, ["api", "model-value", "rule"])
3389
3470
  ], 64);
3390
3471
  };
@@ -1264,6 +1264,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1264
1264
  dateValue.value = date;
1265
1265
  emitChange(date);
1266
1266
  }
1267
+ function getPopupContainer() {
1268
+ return document.body;
1269
+ }
1267
1270
  watch(format, () => {
1268
1271
  handleDateChange("");
1269
1272
  });
@@ -1309,6 +1312,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1309
1312
  picker: unref(extraProps).picker,
1310
1313
  "show-time": unref(extraProps).showTime,
1311
1314
  placeholder: "\u8BF7\u9009\u62E9",
1315
+ "get-popup-container": getPopupContainer,
1312
1316
  onChange: handleDateChange
1313
1317
  }, null, 8, ["value", "format", "value-format", "picker", "show-time"])) : createCommentVNode("v-if", true)
1314
1318
  ]),
@@ -1354,6 +1358,7 @@ var date = {
1354
1358
  props: {
1355
1359
  placeholder: '请选择',
1356
1360
  format: 'YYYY-MM',
1361
+ valueFormat: 'YYYY-MM',
1357
1362
  },
1358
1363
  config: {
1359
1364
  propsFields: Object.values(fieldsMap$b),
@@ -1404,6 +1409,12 @@ var date = {
1404
1409
  },
1405
1410
  ],
1406
1411
  value: rule.props.format,
1412
+ inject: true,
1413
+ on: {
1414
+ change({ api, self }, format) {
1415
+ api.emit('props.valueFormat', format.value);
1416
+ },
1417
+ },
1407
1418
  },
1408
1419
  {
1409
1420
  type: 'input',
@@ -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;
221
220
  labelCol: Record<string, any>;
222
221
  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;
221
220
  labelCol: Record<string, any>;
222
221
  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, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
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">;
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, "loading" | "disabled" | "bordered" | "choiceTransitionName" | "open" | "virtual" | "dropdownMatchSelectWidth" | "autofocus" | "showSearch" | "defaultOpen" | "allowClear" | "showArrow" | "autoClearSearchValue" | "filterOption" | "defaultActiveFirstOption" | "labelInValue">;
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">;
214
214
  $attrs: {
215
215
  [x: string]: unknown;
216
216
  };
@@ -917,6 +917,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
917
917
  }> | null | undefined)[]>;
918
918
  isFulfill: import("vue").Ref<boolean>;
919
919
  changeTreeCheck: (checkedKeys: any) => void;
920
+ departmentSelect: import("vue").Ref<never[]>;
920
921
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:selected" | "fetchList")[], "update:selected" | "fetchList", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
921
922
  limit: {
922
923
  type: NumberConstructor;
@@ -1083,9 +1084,9 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
1083
1084
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1084
1085
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1085
1086
  }, {
1086
- title: string;
1087
1087
  mode: string;
1088
1088
  showCount: boolean;
1089
+ title: string;
1089
1090
  visible: boolean;
1090
1091
  unitStr: string;
1091
1092
  limit: number;