bm-admin-ui 1.0.45-alpha → 1.0.47-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 (79) 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/__test__/index.test.d.ts +1 -0
  4. package/es/components/editor/index.d.ts +3 -2
  5. package/es/components/editor/index.js +2 -1
  6. package/es/components/editor/src/editor.vue.d.ts +3 -2
  7. package/es/components/float-table/index.d.ts +3 -3
  8. package/es/components/float-table/index.js +22 -11
  9. package/es/components/float-table/src/float-table.vue.d.ts +3 -3
  10. package/es/components/form-create/index.js +126 -89
  11. package/es/components/form-designer/index.js +77 -93
  12. package/es/components/index.d.ts +1 -0
  13. package/es/components/index.js +1 -0
  14. package/es/components/search-filter/index.d.ts +3 -3
  15. package/es/components/search-filter/src/search-filter.vue.d.ts +3 -3
  16. package/es/components/select-all/index.d.ts +1 -1
  17. package/es/components/select-all/src/selectAll.vue.d.ts +1 -1
  18. package/es/components/staffs-selector/index.d.ts +2 -2
  19. package/es/components/staffs-selector/src/multipleCmp.vue.d.ts +2 -2
  20. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -2
  21. package/es/components/upload/index.d.ts +2 -1
  22. package/es/components/upload/index.js +2 -1
  23. package/es/components/upload/src/upload.vue.d.ts +2 -1
  24. package/es/components/videoView/__test__/index.test.d.ts +1 -0
  25. package/es/components/videoView/index.d.ts +37 -0
  26. package/es/components/videoView/index.js +100 -0
  27. package/es/components/videoView/src/videoView.vue.d.ts +36 -0
  28. package/lib/components/button/index.d.ts +1 -1
  29. package/lib/components/button/src/button.vue.d.ts +1 -1
  30. package/lib/components/editor/__test__/index.test.d.ts +1 -0
  31. package/lib/components/editor/index.d.ts +3 -2
  32. package/lib/components/editor/index.js +2 -1
  33. package/lib/components/editor/src/editor.vue.d.ts +3 -2
  34. package/lib/components/float-table/index.d.ts +3 -3
  35. package/lib/components/float-table/index.js +22 -11
  36. package/lib/components/float-table/src/float-table.vue.d.ts +3 -3
  37. package/lib/components/form-create/index.js +126 -90
  38. package/lib/components/form-designer/index.js +77 -93
  39. package/lib/components/index.d.ts +1 -0
  40. package/lib/components/index.js +7 -0
  41. package/lib/components/search-filter/index.d.ts +3 -3
  42. package/lib/components/search-filter/src/search-filter.vue.d.ts +3 -3
  43. package/lib/components/select-all/index.d.ts +1 -1
  44. package/lib/components/select-all/src/selectAll.vue.d.ts +1 -1
  45. package/lib/components/staffs-selector/index.d.ts +2 -2
  46. package/lib/components/staffs-selector/src/multipleCmp.vue.d.ts +2 -2
  47. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -2
  48. package/lib/components/upload/index.d.ts +2 -1
  49. package/lib/components/upload/index.js +2 -1
  50. package/lib/components/upload/src/upload.vue.d.ts +2 -1
  51. package/lib/components/videoView/__test__/index.test.d.ts +1 -0
  52. package/lib/components/videoView/index.d.ts +37 -0
  53. package/lib/components/videoView/index.js +105 -0
  54. package/lib/components/videoView/src/videoView.vue.d.ts +36 -0
  55. package/package.json +1 -1
  56. package/theme-chalk/index.css +1 -1
  57. package/theme-chalk/videoView.css +1 -0
  58. package/types/components/button/index.d.ts +1 -1
  59. package/types/components/button/src/button.vue.d.ts +1 -1
  60. package/types/components/editor/__test__/index.test.d.ts +1 -0
  61. package/types/components/editor/index.d.ts +3 -2
  62. package/types/components/editor/src/editor.vue.d.ts +3 -2
  63. package/types/components/float-table/index.d.ts +3 -3
  64. package/types/components/float-table/src/float-table.vue.d.ts +3 -3
  65. package/types/components/index.d.ts +1 -0
  66. package/types/components/search-filter/index.d.ts +3 -3
  67. package/types/components/search-filter/src/search-filter.vue.d.ts +3 -3
  68. package/types/components/select-all/index.d.ts +1 -1
  69. package/types/components/select-all/src/selectAll.vue.d.ts +1 -1
  70. package/types/components/staffs-selector/index.d.ts +2 -2
  71. package/types/components/staffs-selector/src/multipleCmp.vue.d.ts +2 -2
  72. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -2
  73. package/types/components/upload/index.d.ts +2 -1
  74. package/types/components/upload/src/upload.vue.d.ts +2 -1
  75. package/types/components/videoView/__test__/index.test.d.ts +1 -0
  76. package/types/components/videoView/index.d.ts +37 -0
  77. package/types/components/videoView/src/videoView.vue.d.ts +36 -0
  78. package/index.esm.js +0 -150081
  79. package/index.js +0 -150115
@@ -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" | "htmlType" | "loading" | "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" | "htmlType" | "loading" | "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
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -191,8 +191,9 @@ declare const BmEditor: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
191
191
  };
192
192
  };
193
193
  emits: string[];
194
- setup(props: any, { emit }: {
194
+ setup(props: any, { emit, expose }: {
195
195
  emit: any;
196
+ expose: any;
196
197
  }): {
197
198
  uploadDisabled: import("vue").ComputedRef<boolean>;
198
199
  updateUploadProgress(file: any, progress: any): void;
@@ -293,8 +294,8 @@ declare const BmEditor: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
293
294
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
294
295
  onGetCount?: ((...args: any[]) => any) | undefined;
295
296
  }, {
296
- value: string;
297
297
  disabled: boolean;
298
+ value: string;
298
299
  options: {
299
300
  [key: string]: any;
300
301
  };
@@ -11640,7 +11640,7 @@ const _sfc_main$1 = {
11640
11640
  "updateDisabledStatus",
11641
11641
  "updateIsUploadingStatus"
11642
11642
  ],
11643
- setup(props, { emit }) {
11643
+ setup(props, { emit, expose }) {
11644
11644
  let acceptList = [
11645
11645
  ".xlsx",
11646
11646
  ".XLSX",
@@ -11980,6 +11980,7 @@ const _sfc_main$1 = {
11980
11980
  immediate: true
11981
11981
  }
11982
11982
  );
11983
+ expose({ state, methods });
11983
11984
  return {
11984
11985
  ...toRefs(state),
11985
11986
  icons,
@@ -191,8 +191,9 @@ declare const _default: import("vue").DefineComponent<{
191
191
  };
192
192
  };
193
193
  emits: string[];
194
- setup(props: any, { emit }: {
194
+ setup(props: any, { emit, expose }: {
195
195
  emit: any;
196
+ expose: any;
196
197
  }): {
197
198
  uploadDisabled: import("vue").ComputedRef<boolean>;
198
199
  updateUploadProgress(file: any, progress: any): void;
@@ -293,8 +294,8 @@ declare const _default: import("vue").DefineComponent<{
293
294
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
294
295
  onGetCount?: ((...args: any[]) => any) | undefined;
295
296
  }, {
296
- value: string;
297
297
  disabled: boolean;
298
+ value: string;
298
299
  options: {
299
300
  [key: string]: any;
300
301
  };
@@ -42,9 +42,9 @@ declare const BmFloatTable: import("bm-admin-ui/es/utils/with-install").SFCWithI
42
42
  gridOptions: import("vue").ComputedRef<any>;
43
43
  gridEvents: import("vue").ComputedRef<any>;
44
44
  pager: import("vue").ComputedRef<any>;
45
- simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
45
+ simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
46
46
  [key: string]: any;
47
- }> | null | undefined) | JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
47
+ }> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
48
48
  [key: string]: any;
49
49
  }> | null | undefined)[]>;
50
50
  floatRefsId: import("vue").Ref<{}>;
@@ -58,7 +58,7 @@ declare const BmFloatTable: import("bm-admin-ui/es/utils/with-install").SFCWithI
58
58
  }>;
59
59
  trNodes: import("vue").Ref<any>;
60
60
  isInScroll: import("vue").Ref<boolean>;
61
- inMaxScorllX: import("vue").Ref<boolean>;
61
+ inMaxScrollX: import("vue").Ref<boolean>;
62
62
  floatRow: import("vue").Ref<{}>;
63
63
  floatRowIndex: import("vue").Ref<undefined>;
64
64
  floatHandleDomCol: import("vue").Ref<any>;
@@ -45,6 +45,7 @@ const _sfc_main = {
45
45
  "radioChange",
46
46
  "checkboxChange",
47
47
  "checkboxChangeAll",
48
+ "cellClick",
48
49
  "pageChange",
49
50
  "pageSizeChange"
50
51
  ],
@@ -76,7 +77,7 @@ const _sfc_main = {
76
77
  reserve: false,
77
78
  highlight: computed(function() {
78
79
  return props.config.columns.some(function(item) {
79
- return item.type === "checkbox" || item.type === "checkbox";
80
+ return item.type === "checkbox";
80
81
  });
81
82
  }),
82
83
  trigger: "row"
@@ -96,6 +97,16 @@ const _sfc_main = {
96
97
  },
97
98
  checkboxAll(val) {
98
99
  emit("checkboxChangeAll", val);
100
+ },
101
+ cellClick(data) {
102
+ let { row, column } = data;
103
+ if (column.type === "checkbox" || column.type === "radio" || column.field === "action" || column.slots?.default === "floatHandle")
104
+ return;
105
+ else {
106
+ xGrid.value.clearCheckboxRow();
107
+ xGrid.value.setCheckboxRow(row, true);
108
+ emit("cellClick", data);
109
+ }
99
110
  }
100
111
  },
101
112
  atVisible: false,
@@ -106,7 +117,7 @@ const _sfc_main = {
106
117
  },
107
118
  trNodes: [],
108
119
  isInScroll: false,
109
- inMaxScorllX: false,
120
+ inMaxScrollX: false,
110
121
  floatRow: {},
111
122
  floatRowIndex: void 0,
112
123
  floatHandleDomCol: null
@@ -117,7 +128,7 @@ const _sfc_main = {
117
128
  "bm-table",
118
129
  `table-${props.size}`,
119
130
  {
120
- floatHandleTable: props.isNeedFloatHandle && (!state.atVisible || state.inMaxScorllX) && state.floatHandleDomCol
131
+ floatHandleTable: props.isNeedFloatHandle && (!state.atVisible || state.inMaxScrollX) && state.floatHandleDomCol
121
132
  }
122
133
  ];
123
134
  });
@@ -131,14 +142,14 @@ const _sfc_main = {
131
142
  const gridEvents = computed(() => {
132
143
  let extraFn = {};
133
144
  if (props.isNeedFloatHandle) {
134
- let propscellMouseenter = props.events.cellMouseenter;
145
+ let propsCellMouseenter = props.events.cellMouseenter;
135
146
  extraFn.cellMouseenter = (e) => {
136
147
  if (props.isNeedFloatHandle) {
137
148
  if (state.isInScroll) {
138
149
  state.isShowFloatHandle = false;
139
150
  return;
140
151
  }
141
- if (state.inMaxScorllX) {
152
+ if (state.inMaxScrollX) {
142
153
  state.isShowFloatHandle = false;
143
154
  }
144
155
  let rowid = e.rowid;
@@ -167,7 +178,7 @@ const _sfc_main = {
167
178
  top,
168
179
  height: clientHeight
169
180
  };
170
- if (!state.atVisible && !state.inMaxScorllX) {
181
+ if (!state.atVisible && !state.inMaxScrollX) {
171
182
  state.isShowFloatHandle = true;
172
183
  }
173
184
  nextTick(() => {
@@ -178,23 +189,23 @@ const _sfc_main = {
178
189
  });
179
190
  }, 200);
180
191
  }
181
- propscellMouseenter && propscellMouseenter(e);
192
+ propsCellMouseenter && propsCellMouseenter(e);
182
193
  };
183
194
  extraFn.scroll = (e) => {
184
- let propsscroll = props.events.scroll;
195
+ let propsScroll = props.events.scroll;
185
196
  if (e.isY && props.isNeedFloatHandle) {
186
197
  methods.scrollNotShowFloat();
187
198
  }
188
199
  if (e.isX && props.isNeedFloatHandle && state.floatHandleDomCol && gridOptions.value.data && gridOptions.value.data.length > 0) {
189
200
  if (e.scrollLeft + e.$event.target.clientWidth >= e.$event.target.scrollWidth - state.floatHandleDomCol.clientWidth) {
190
- state.inMaxScorllX = true;
201
+ state.inMaxScrollX = true;
191
202
  state.isShowFloatHandle = false;
192
203
  } else {
193
- state.inMaxScorllX = false;
204
+ state.inMaxScrollX = false;
194
205
  state.isShowFloatHandle = true;
195
206
  }
196
207
  }
197
- propsscroll && propsscroll(e);
208
+ propsScroll && propsScroll(e);
198
209
  };
199
210
  extraFn.cellMouseleave = (e) => {
200
211
  let propsCellMouseLeave = props.events.cellMouseleave;
@@ -42,9 +42,9 @@ declare const _default: {
42
42
  gridOptions: import("vue").ComputedRef<any>;
43
43
  gridEvents: import("vue").ComputedRef<any>;
44
44
  pager: import("vue").ComputedRef<any>;
45
- simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
45
+ simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
46
46
  [key: string]: any;
47
- }> | null | undefined) | JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
47
+ }> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
48
48
  [key: string]: any;
49
49
  }> | null | undefined)[]>;
50
50
  floatRefsId: import("vue").Ref<{}>;
@@ -58,7 +58,7 @@ declare const _default: {
58
58
  }>;
59
59
  trNodes: import("vue").Ref<any>;
60
60
  isInScroll: import("vue").Ref<boolean>;
61
- inMaxScorllX: import("vue").Ref<boolean>;
61
+ inMaxScrollX: import("vue").Ref<boolean>;
62
62
  floatRow: import("vue").Ref<{}>;
63
63
  floatRowIndex: import("vue").Ref<undefined>;
64
64
  floatHandleDomCol: import("vue").Ref<any>;
@@ -7,7 +7,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
9
  import { cloneDeep, debounce, merge } from 'lodash-es';
10
- import FC from '@form-create/ant-design-vue';
11
10
 
12
11
  const fieldRatioMap = {
13
12
  '25%': 6,
@@ -774,15 +773,27 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
774
773
  "placeholder",
775
774
  "defaultSelected",
776
775
  "load",
777
- "disabled"
776
+ "disabled",
777
+ "fieldNames"
778
778
  ],
779
779
  emits: ["change"],
780
780
  setup(__props, { emit: emits }) {
781
781
  const props = __props;
782
+ const fieldNames = props.fieldNames || {
783
+ label: "name",
784
+ value: "code"
785
+ };
782
786
  const selected = ref([]);
783
787
  const visible = ref(false);
784
788
  function selectedChange(val) {
785
- emits("change", val);
789
+ emits(
790
+ "change",
791
+ val.map((item) => ({
792
+ [fieldNames.value]: item.key,
793
+ [fieldNames.label]: item.title,
794
+ ...item
795
+ }))
796
+ );
786
797
  }
787
798
  function handleAdd() {
788
799
  visible.value = true;
@@ -827,6 +838,7 @@ var StaffSelector = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "staff-
827
838
  var people = {
828
839
  name: 'people',
829
840
  rule(data, extraConfig) {
841
+ var _a;
830
842
  return {
831
843
  type: 'StaffSelector',
832
844
  component: StaffSelector,
@@ -842,6 +854,7 @@ var people = {
842
854
  return yield extraConfig.people.fetch(params);
843
855
  });
844
856
  },
857
+ fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
845
858
  },
846
859
  effect: {
847
860
  required: data.effect.required && '请选择',
@@ -866,6 +879,7 @@ var people = {
866
879
  };
867
880
  },
868
881
  rowRule(data, extraConfig) {
882
+ var _a;
869
883
  return {
870
884
  type: 'StaffSelector',
871
885
  component: StaffSelector,
@@ -881,6 +895,7 @@ var people = {
881
895
  return yield extraConfig.people.fetch(params);
882
896
  });
883
897
  },
898
+ fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
884
899
  },
885
900
  effect: {
886
901
  required: data.effect.required && '请选择',
@@ -1618,6 +1633,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1618
1633
  index++;
1619
1634
  }
1620
1635
  function handleDelete(targetKey) {
1636
+ if (panes.length === 1)
1637
+ return;
1621
1638
  panes.splice(
1622
1639
  panes.findIndex((pane) => pane.key === targetKey),
1623
1640
  1
@@ -2220,14 +2237,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2220
2237
  props: [
2221
2238
  "value",
2222
2239
  "extraConfig",
2223
- "rule",
2240
+ "dataFiltering",
2224
2241
  "disabled",
2225
2242
  "formCreateInject"
2226
2243
  ],
2227
2244
  emits: ["change"],
2228
2245
  setup(__props, { emit: emits }) {
2229
2246
  const props = __props;
2230
- const value = ref(props.value?.value);
2247
+ const fieldNames = props.extraConfig.fieldNames || {
2248
+ label: "name",
2249
+ value: "code"
2250
+ };
2251
+ const value = ref(props.value?.[fieldNames.value]);
2231
2252
  const options = ref([]);
2232
2253
  const keyword = ref("");
2233
2254
  const debounceFetch = debounce((value2) => {
@@ -2238,7 +2259,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2238
2259
  }, 300);
2239
2260
  const postData = computed(() => ({
2240
2261
  keyword: keyword.value,
2241
- filterByUser: props.rule.config.dataFiltering
2262
+ filterByUser: props.dataFiltering
2242
2263
  }));
2243
2264
  function initOptions() {
2244
2265
  props.extraConfig.fetch(postData.value).then((data) => {
@@ -2246,8 +2267,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2246
2267
  });
2247
2268
  }
2248
2269
  function handleChange(val, option) {
2249
- value.value = val;
2250
- emits("change", option);
2270
+ emits("change", {
2271
+ [fieldNames.value]: option.value,
2272
+ [fieldNames.label]: option.label,
2273
+ ...option
2274
+ });
2251
2275
  }
2252
2276
  function handleSearch(value2) {
2253
2277
  keyword.value = value2;
@@ -2277,6 +2301,7 @@ var ShopWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "shop-widg
2277
2301
  var shop = {
2278
2302
  name: 'shop',
2279
2303
  rule(data, extraConfig) {
2304
+ var _a;
2280
2305
  const shopExtraConfig = extraConfig.shop;
2281
2306
  return {
2282
2307
  type: 'ShopWidget',
@@ -2287,7 +2312,7 @@ var shop = {
2287
2312
  required: data.effect.required && '请选择店铺',
2288
2313
  },
2289
2314
  props: {
2290
- rule: data,
2315
+ dataFiltering: (_a = data.config) === null || _a === void 0 ? void 0 : _a.dataFiltering,
2291
2316
  extraConfig: shopExtraConfig,
2292
2317
  value: data.value,
2293
2318
  },
@@ -2308,6 +2333,7 @@ var shop = {
2308
2333
  };
2309
2334
  },
2310
2335
  rowRule(data, extraConfig) {
2336
+ var _a;
2311
2337
  const shopExtraConfig = extraConfig.shop;
2312
2338
  return {
2313
2339
  type: 'ShopWidget',
@@ -2318,7 +2344,7 @@ var shop = {
2318
2344
  required: data.effect.required && '请选择店铺',
2319
2345
  },
2320
2346
  props: {
2321
- rule: data,
2347
+ dataFiltering: (_a = data.config) === null || _a === void 0 ? void 0 : _a.dataFiltering,
2322
2348
  extraConfig: shopExtraConfig,
2323
2349
  value: data.value,
2324
2350
  },
@@ -2350,8 +2376,9 @@ var shop = {
2350
2376
  minWidth: '138px',
2351
2377
  slots: {
2352
2378
  default({ row }) {
2379
+ var _a;
2353
2380
  return h(ShopWidget, {
2354
- rule: data,
2381
+ dataFiltering: (_a = data.config) === null || _a === void 0 ? void 0 : _a.dataFiltering,
2355
2382
  extraConfig: extraConfig.shop,
2356
2383
  value: row[field],
2357
2384
  disabled: data.disabled,
@@ -2366,7 +2393,7 @@ var shop = {
2366
2393
  };
2367
2394
 
2368
2395
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2369
- __name: "material-type-in-table",
2396
+ __name: "material-type",
2370
2397
  props: ["config", "multiple", "format", "value"],
2371
2398
  emits: ["change"],
2372
2399
  setup(__props, { emit: emits }) {
@@ -2378,71 +2405,105 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2378
2405
  item.isLeaf = props.format === 1;
2379
2406
  });
2380
2407
  options.value = result;
2408
+ return options.value;
2409
+ }).then((options2) => {
2410
+ if (props.value.length) {
2411
+ if (props.multiple) {
2412
+ props.value.forEach((item) => loadValueOptions(item, options2));
2413
+ } else {
2414
+ loadValueOptions(props.value, options2);
2415
+ }
2416
+ }
2381
2417
  });
2382
2418
  }
2383
- function loadData(selectedOptions) {
2419
+ async function loadData(selectedOptions) {
2384
2420
  const optionLength = selectedOptions.length;
2385
2421
  const targetOption = selectedOptions[optionLength - 1];
2386
2422
  targetOption.loading = true;
2387
- props.config.fetch({
2423
+ return await props.config.fetch({
2388
2424
  level: optionLength + 1,
2389
2425
  relationCode: targetOption.value
2390
2426
  }).then((result) => {
2391
2427
  result.forEach((item) => {
2392
2428
  item.isLeaf = props.format === optionLength + 1;
2393
2429
  });
2394
- targetOption.children = result;
2430
+ if (result.length) {
2431
+ targetOption.children = result;
2432
+ } else {
2433
+ targetOption.isLeaf = true;
2434
+ }
2395
2435
  }).finally(() => {
2396
2436
  targetOption.loading = false;
2397
2437
  });
2398
2438
  }
2399
- function handleChange(v) {
2400
- emits("change", v);
2439
+ function handleChange(value, selectedOptions) {
2440
+ const result = cloneDeep(selectedOptions);
2441
+ processValue(result);
2442
+ emits("change", result);
2443
+ }
2444
+ function processValue(selectedOptions) {
2445
+ selectedOptions.forEach((item) => {
2446
+ if (Array.isArray(item))
2447
+ processValue(item);
2448
+ else {
2449
+ delete item.disabled;
2450
+ delete item.children;
2451
+ delete item.isLeaf;
2452
+ delete item.loading;
2453
+ }
2454
+ });
2455
+ }
2456
+ function formatValue(value) {
2457
+ value = value || [];
2458
+ return value.reduce((pre, cur) => {
2459
+ if (Array.isArray(cur)) {
2460
+ pre.push(cur.map((c) => c.value));
2461
+ } else {
2462
+ pre.push(cur.value);
2463
+ }
2464
+ return pre;
2465
+ }, []);
2466
+ }
2467
+ async function loadValueOptions(value, options2) {
2468
+ const selectedOptions = [];
2469
+ for (const option of value) {
2470
+ let cur;
2471
+ if (selectedOptions.length) {
2472
+ cur = selectedOptions[selectedOptions.length - 1].children.find(
2473
+ (item) => item.value === option.value
2474
+ );
2475
+ } else {
2476
+ cur = options2.find((item) => item.value === option.value);
2477
+ }
2478
+ if (!cur.isLeaf) {
2479
+ selectedOptions.push(cur);
2480
+ await loadData(selectedOptions);
2481
+ }
2482
+ }
2401
2483
  }
2402
2484
  initOptions();
2403
2485
  return (_ctx, _cache) => {
2404
2486
  return openBlock(), createBlock(unref(Cascader), {
2405
- value: __props.value,
2487
+ value: formatValue(__props.value),
2406
2488
  placeholder: "\u8BF7\u8F93\u5165",
2407
2489
  multiple: __props.multiple,
2408
2490
  options: options.value,
2409
2491
  "load-data": loadData,
2492
+ "change-on-select": "",
2410
2493
  "get-popup-container": unref(getContainer),
2411
- "onUpdate:value": handleChange
2494
+ onChange: handleChange
2412
2495
  }, null, 8, ["value", "multiple", "options", "get-popup-container"]);
2413
2496
  };
2414
2497
  }
2415
2498
  });
2416
- var materialTypeInTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "material-type-in-table.vue"]]);
2499
+ var materialType$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "material-type.vue"]]);
2417
2500
 
2418
- FC.register({
2419
- name: 'materialTypesOption',
2420
- init({ value }, rule) {
2421
- getOption(value, { level: 1, relationCode: '' }).then((data) => {
2422
- data = isLeaf(data, rule.config.format === 1);
2423
- if (rule.props) {
2424
- rule.props.options = data;
2425
- }
2426
- else {
2427
- (rule.props = {}).options = data;
2428
- }
2429
- });
2430
- },
2431
- });
2432
- function getOption(config, data) {
2433
- return config.fetch(data);
2434
- }
2435
- function isLeaf(data, value) {
2436
- data.forEach((item) => {
2437
- item.isLeaf = value;
2438
- });
2439
- return data;
2440
- }
2441
2501
  var materialType = {
2442
2502
  name: 'materialType',
2443
2503
  rule(data, extraConfig) {
2444
2504
  return {
2445
- type: 'cascader',
2505
+ type: 'materialType',
2506
+ component: materialType$1,
2446
2507
  field: data.field,
2447
2508
  title: '素材类型',
2448
2509
  validate: [
@@ -2454,38 +2515,22 @@ var materialType = {
2454
2515
  },
2455
2516
  ],
2456
2517
  props: {
2457
- placeholder: '请选择',
2518
+ value: data.value,
2458
2519
  multiple: data.props.multiple,
2459
- loadData(inject, selectedOptions) {
2460
- const optionLength = selectedOptions.length;
2461
- const targetOption = selectedOptions[optionLength - 1];
2462
- targetOption.loading = true;
2463
- getOption(extraConfig.materialType, {
2464
- level: optionLength + 1,
2465
- relationCode: targetOption.value,
2466
- })
2467
- .then((result) => {
2468
- result = isLeaf(result, inject.self.config.format === optionLength + 1);
2469
- targetOption.children = result;
2470
- })
2471
- .finally(() => {
2472
- targetOption.loading = false;
2473
- });
2474
- },
2475
- },
2476
- config: {
2477
2520
  format: data.config.format,
2478
- },
2479
- effect: {
2480
- materialTypesOption: extraConfig.materialType,
2521
+ config: extraConfig.materialType,
2522
+ disabled: data.disabled,
2481
2523
  },
2482
2524
  inject: true,
2483
2525
  on: {
2484
2526
  change(inject, list) {
2485
2527
  const rule = inject.self;
2486
2528
  rule.value = list;
2529
+ rule.props.value = list;
2487
2530
  nextTick(() => {
2488
- inject.api.validateField(rule.field);
2531
+ setTimeout(() => {
2532
+ inject.api.validateField(rule.field);
2533
+ });
2489
2534
  });
2490
2535
  },
2491
2536
  },
@@ -2494,7 +2539,8 @@ var materialType = {
2494
2539
  },
2495
2540
  rowRule(data, extraConfig) {
2496
2541
  return {
2497
- type: 'cascader',
2542
+ type: 'materialType',
2543
+ component: materialType$1,
2498
2544
  field: data.field,
2499
2545
  title: '素材类型',
2500
2546
  validate: [
@@ -2506,35 +2552,22 @@ var materialType = {
2506
2552
  },
2507
2553
  ],
2508
2554
  props: {
2509
- placeholder: '请选择',
2555
+ value: data.value,
2510
2556
  multiple: data.props.multiple,
2511
- loadData(inject, selectedOptions) {
2512
- const optionLength = selectedOptions.length;
2513
- const targetOption = selectedOptions[optionLength - 1];
2514
- targetOption.loading = true;
2515
- getOption(extraConfig.materialType, optionLength + 1)
2516
- .then((result) => {
2517
- result = isLeaf(result, inject.self.config.format === optionLength + 1);
2518
- targetOption.children = result;
2519
- })
2520
- .finally(() => {
2521
- targetOption.loading = false;
2522
- });
2523
- },
2524
- },
2525
- config: {
2526
2557
  format: data.config.format,
2527
- },
2528
- effect: {
2529
- materialTypesOption: extraConfig.materialType,
2558
+ config: extraConfig.materialType,
2559
+ disabled: data.disabled,
2530
2560
  },
2531
2561
  inject: true,
2532
2562
  on: {
2533
2563
  change(inject, list) {
2534
2564
  const rule = inject.self;
2535
2565
  rule.value = list;
2566
+ rule.props.value = list;
2536
2567
  nextTick(() => {
2537
- inject.api.validateField(rule.field);
2568
+ setTimeout(() => {
2569
+ inject.api.validateField(rule.field);
2570
+ });
2538
2571
  });
2539
2572
  },
2540
2573
  },
@@ -2553,7 +2586,7 @@ var materialType = {
2553
2586
  minWidth: '138px',
2554
2587
  slots: {
2555
2588
  default({ row }) {
2556
- return h(materialTypeInTable, {
2589
+ return h(materialType$1, {
2557
2590
  multiple: data.props.multiple,
2558
2591
  format: data.config.format,
2559
2592
  config: extraConfig.materialType,
@@ -2603,6 +2636,7 @@ var row = {
2603
2636
  var department = {
2604
2637
  name: 'department',
2605
2638
  rule(data, extraConfig) {
2639
+ var _a;
2606
2640
  return {
2607
2641
  type: 'StaffSelector',
2608
2642
  component: StaffSelector,
@@ -2620,6 +2654,7 @@ var department = {
2620
2654
  return yield extraConfig.department.fetch();
2621
2655
  });
2622
2656
  },
2657
+ fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
2623
2658
  },
2624
2659
  effect: {
2625
2660
  required: data.effect.required && '请选择',
@@ -2644,6 +2679,7 @@ var department = {
2644
2679
  };
2645
2680
  },
2646
2681
  rowRule(data, extraConfig) {
2682
+ var _a;
2647
2683
  return {
2648
2684
  type: 'StaffSelector',
2649
2685
  component: StaffSelector,
@@ -2661,6 +2697,7 @@ var department = {
2661
2697
  return yield extraConfig.department.fetch();
2662
2698
  });
2663
2699
  },
2700
+ fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
2664
2701
  },
2665
2702
  effect: {
2666
2703
  required: data.effect.required && '请选择',