bm-admin-ui 1.0.65-alpha → 1.0.67-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 (33) hide show
  1. package/es/components/editor/index.js +8 -4
  2. package/es/components/form-create/index.js +47 -31
  3. package/es/components/form-designer/index.js +3 -2
  4. package/es/components/input-tags-display/index.js +3 -3
  5. package/es/components/staffs-selector/index.d.ts +51 -11
  6. package/es/components/staffs-selector/index.js +293 -223
  7. package/es/components/staffs-selector/src/action.d.ts +2 -0
  8. package/es/components/staffs-selector/src/departmentCmp.vue.d.ts +49 -0
  9. package/es/components/staffs-selector/src/multipleCmp.vue.d.ts +1 -10
  10. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +51 -11
  11. package/es/components/staffs-selector/src/variedCmp.vue.d.ts +1 -0
  12. package/es/components/upload/index.js +8 -4
  13. package/lib/components/editor/index.js +8 -4
  14. package/lib/components/form-create/index.js +47 -31
  15. package/lib/components/form-designer/index.js +3 -2
  16. package/lib/components/input-tags-display/index.js +2 -2
  17. package/lib/components/staffs-selector/index.d.ts +51 -11
  18. package/lib/components/staffs-selector/index.js +291 -221
  19. package/lib/components/staffs-selector/src/action.d.ts +2 -0
  20. package/lib/components/staffs-selector/src/departmentCmp.vue.d.ts +49 -0
  21. package/lib/components/staffs-selector/src/multipleCmp.vue.d.ts +1 -10
  22. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +51 -11
  23. package/lib/components/staffs-selector/src/variedCmp.vue.d.ts +1 -0
  24. package/lib/components/upload/index.js +8 -4
  25. package/package.json +1 -1
  26. package/theme-chalk/index.css +1 -1
  27. package/theme-chalk/input-tags-display.css +1 -1
  28. package/types/components/staffs-selector/index.d.ts +51 -11
  29. package/types/components/staffs-selector/src/action.d.ts +2 -0
  30. package/types/components/staffs-selector/src/departmentCmp.vue.d.ts +49 -0
  31. package/types/components/staffs-selector/src/multipleCmp.vue.d.ts +1 -10
  32. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +51 -11
  33. package/types/components/staffs-selector/src/variedCmp.vue.d.ts +1 -0
@@ -11,6 +11,7 @@ const MODE = {
11
11
  RADIO: 'radio',
12
12
  MULTIPLE: 'multiple',
13
13
  VARIED: 'varied',
14
+ DEPARTMENT: 'department',
14
15
  };
15
16
  const selectProps = {
16
17
  visible: {
@@ -73,6 +74,7 @@ const selectState = vue.reactive({
73
74
  dataMap: new Map(),
74
75
  curlistKeys: new Set(),
75
76
  activeKey: 0,
77
+ fetchLoading: false,
76
78
  });
77
79
  const list = vue.ref([]);
78
80
  const departNative = vue.ref([]);
@@ -85,8 +87,8 @@ var _export_sfc = (sfc, props) => {
85
87
  return target;
86
88
  };
87
89
 
88
- const _sfc_main$3 = vue.defineComponent({
89
- components: { SearchOutlined: iconsVue.SearchOutlined, Checkbox: antDesignVue.Checkbox, Empty: antDesignVue.Empty, ATree: antDesignVue.Tree },
90
+ const _sfc_main$4 = vue.defineComponent({
91
+ components: { SearchOutlined: iconsVue.SearchOutlined, Checkbox: antDesignVue.Checkbox, Empty: antDesignVue.Empty },
90
92
  props: {
91
93
  limit: {
92
94
  type: Number,
@@ -95,10 +97,6 @@ const _sfc_main$3 = vue.defineComponent({
95
97
  selected: {
96
98
  type: Array,
97
99
  default: () => []
98
- },
99
- isTree: {
100
- type: Boolean,
101
- default: false
102
100
  }
103
101
  },
104
102
  emits: ["fetchList", "update:selected"],
@@ -121,7 +119,7 @@ const _sfc_main$3 = vue.defineComponent({
121
119
  });
122
120
  },
123
121
  search() {
124
- let data = state.searchVal ? { searchVal: state.searchVal } : false;
122
+ let data = { searchVal: state.searchVal || "" };
125
123
  emit("fetchList", data);
126
124
  },
127
125
  setState() {
@@ -156,35 +154,11 @@ const _sfc_main$3 = vue.defineComponent({
156
154
  vue.watch(
157
155
  () => list,
158
156
  () => {
159
- !props.isTree && methods.setState();
157
+ methods.setState();
160
158
  },
161
159
  { deep: true }
162
160
  );
163
- function changeTreeCheck(checkedKeys) {
164
- let flatMap = selectState.dataMap;
165
- let curlistKeys = selectState.curlistKeys;
166
- let hadselected = new Set(selectState.multipDepartment);
167
- let curselect = new Set(checkedKeys);
168
- for (let key of hadselected) {
169
- if (curlistKeys.has(String(key)) && (!curselect.has(String(key)) || curselect.has(String(key)) && curselect.has(flatMap.get(String(key))["parent"]))) {
170
- hadselected.delete(String(key));
171
- }
172
- }
173
- for (let key of curselect) {
174
- let obj = flatMap.get(String(key));
175
- if (obj && !curselect.has(obj["parent"])) {
176
- hadselected.add(String(key));
177
- }
178
- }
179
- let arr = Array.from(hadselected) || [];
180
- if (props.limit && props.limit > 0 && arr.length > props.limit) {
181
- antDesignVue.message.error("\u52FE\u9009\u540E\u5C06\u8D85\u8FC7\u4EBA\u5458\u9650\u5236");
182
- return;
183
- }
184
- selectState.multipDepartment = Array.from(hadselected) || [];
185
- }
186
161
  return {
187
- changeTreeCheck,
188
162
  ...vue.toRefs(state),
189
163
  ...vue.toRefs(selectState),
190
164
  list,
@@ -192,31 +166,25 @@ const _sfc_main$3 = vue.defineComponent({
192
166
  };
193
167
  }
194
168
  });
195
- const _hoisted_1$3 = { class: "multiple-selector" };
196
- const _hoisted_2$3 = { class: "__selector-modal-panel" };
197
- const _hoisted_3$3 = { class: "__search-panel" };
198
- const _hoisted_4$3 = { class: "__selector-modal-options" };
199
- const _hoisted_5$3 = { class: "__selector-modal-options-item fixed-option" };
200
- const _hoisted_6$2 = { class: "department-option-item" };
201
- const _hoisted_7$1 = {
169
+ const _hoisted_1$4 = { class: "multiple-selector" };
170
+ const _hoisted_2$4 = { class: "__selector-modal-panel" };
171
+ const _hoisted_3$4 = { class: "__search-panel" };
172
+ const _hoisted_4$4 = { class: "__selector-modal-options" };
173
+ const _hoisted_5$4 = { class: "__selector-modal-options-item fixed-option" };
174
+ const _hoisted_6$3 = {
202
175
  key: 0,
203
- class: "department-desc"
204
- };
205
- const _hoisted_8$1 = {
206
- key: 2,
207
176
  class: "noData",
208
177
  style: { "height": "280px" }
209
178
  };
210
- const _hoisted_9$1 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
211
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
179
+ const _hoisted_7$2 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
180
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
212
181
  const _component_search_outlined = vue.resolveComponent("search-outlined");
213
182
  const _component_AInput = vue.resolveComponent("AInput");
214
183
  const _component_Checkbox = vue.resolveComponent("Checkbox");
215
- const _component_ATree = vue.resolveComponent("ATree");
216
184
  const _component_Empty = vue.resolveComponent("Empty");
217
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
218
- vue.createElementVNode("div", _hoisted_2$3, [
219
- vue.createElementVNode("div", _hoisted_3$3, [
185
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
186
+ vue.createElementVNode("div", _hoisted_2$4, [
187
+ vue.createElementVNode("div", _hoisted_3$4, [
220
188
  vue.createVNode(_component_AInput, {
221
189
  value: _ctx.searchVal,
222
190
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
@@ -228,60 +196,44 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
228
196
  ]),
229
197
  _: 1
230
198
  }, 8, ["value", "onChange"]),
231
- vue.createElementVNode("div", _hoisted_4$3, [
232
- !_ctx.isTree ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
233
- vue.createElementVNode("div", _hoisted_5$3, [
234
- vue.withDirectives(vue.createVNode(_component_Checkbox, {
235
- checked: _ctx.selectAll,
236
- "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => _ctx.selectAll = $event),
237
- indeterminate: _ctx.indeterminate,
238
- onChange: _ctx.changeAllOption
199
+ vue.createElementVNode("div", _hoisted_4$4, [
200
+ vue.createElementVNode("div", _hoisted_5$4, [
201
+ vue.withDirectives(vue.createVNode(_component_Checkbox, {
202
+ checked: _ctx.selectAll,
203
+ "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => _ctx.selectAll = $event),
204
+ indeterminate: _ctx.indeterminate,
205
+ onChange: _ctx.changeAllOption
206
+ }, {
207
+ default: vue.withCtx(() => [
208
+ vue.createTextVNode("\u5168\u9009")
209
+ ]),
210
+ _: 1
211
+ }, 8, ["checked", "indeterminate", "onChange"]), [
212
+ [vue.vShow, _ctx.list.length]
213
+ ])
214
+ ]),
215
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item) => {
216
+ return vue.openBlock(), vue.createElementBlock("div", {
217
+ key: item.key,
218
+ class: "__selector-modal-options-item"
219
+ }, [
220
+ vue.createVNode(_component_Checkbox, {
221
+ checked: _ctx.multipleChecked[item.key],
222
+ "onUpdate:checked": ($event) => _ctx.multipleChecked[item.key] = $event,
223
+ class: "__selector-modal-option-check",
224
+ disabled: _ctx.isFulfill
239
225
  }, {
240
226
  default: vue.withCtx(() => [
241
- vue.createTextVNode("\u5168\u9009")
227
+ vue.createTextVNode(vue.toDisplayString(item?.fullTitle || item.title), 1)
242
228
  ]),
243
- _: 1
244
- }, 8, ["checked", "indeterminate", "onChange"]), [
245
- [vue.vShow, _ctx.list.length]
246
- ])
247
- ]),
248
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item) => {
249
- return vue.openBlock(), vue.createElementBlock("div", {
250
- key: item.key,
251
- class: "__selector-modal-options-item"
252
- }, [
253
- vue.createVNode(_component_Checkbox, {
254
- checked: _ctx.multipleChecked[item.key],
255
- "onUpdate:checked": ($event) => _ctx.multipleChecked[item.key] = $event,
256
- class: "__selector-modal-option-check",
257
- disabled: _ctx.isFulfill
258
- }, {
259
- default: vue.withCtx(() => [
260
- vue.createTextVNode(vue.toDisplayString(item?.fullTitle || item.title), 1)
261
- ]),
262
- _: 2
263
- }, 1032, ["checked", "onUpdate:checked", "disabled"])
264
- ]);
265
- }), 128))
266
- ], 64)) : _ctx.isTree ? (vue.openBlock(), vue.createBlock(_component_ATree, {
267
- key: 1,
268
- "checked-keys": _ctx.multipDepartment,
269
- checkable: "",
270
- "tree-data": _ctx.list,
271
- onCheck: _ctx.changeTreeCheck
272
- }, {
273
- title: vue.withCtx(({ title, key, description }) => [
274
- vue.createElementVNode("div", _hoisted_6$2, [
275
- vue.createElementVNode("span", null, vue.toDisplayString(title) + vue.toDisplayString(key ? `(${key})` : ""), 1),
276
- description ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_7$1, vue.toDisplayString(description), 1)) : vue.createCommentVNode("v-if", true)
277
- ])
278
- ]),
279
- _: 1
280
- }, 8, ["checked-keys", "tree-data", "onCheck"])) : vue.createCommentVNode("v-if", true),
281
- _ctx.list && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, [
229
+ _: 2
230
+ }, 1032, ["checked", "onUpdate:checked", "disabled"])
231
+ ]);
232
+ }), 128)),
233
+ _ctx.list && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$3, [
282
234
  vue.createVNode(_component_Empty, { image: _ctx.emptyPic }, {
283
235
  description: vue.withCtx(() => [
284
- vue.createElementVNode("span", _hoisted_9$1, vue.toDisplayString(!!_ctx.searchVal ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
236
+ vue.createElementVNode("span", _hoisted_7$2, vue.toDisplayString(!!_ctx.searchVal ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
285
237
  ]),
286
238
  _: 1
287
239
  }, 8, ["image"])
@@ -291,9 +243,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
291
243
  ])
292
244
  ]);
293
245
  }
294
- var multipleCmp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "multipleCmp.vue"]]);
246
+ var multipleCmp = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__file", "multipleCmp.vue"]]);
295
247
 
296
- const _sfc_main$2 = vue.defineComponent({
248
+ const _sfc_main$3 = vue.defineComponent({
297
249
  name: "RadioCmp",
298
250
  components: { ARadio: antDesignVue.Radio, AInput: antDesignVue.Input, ARadioGroup: antDesignVue.RadioGroup, Empty: antDesignVue.Empty, SearchOutlined: iconsVue.SearchOutlined },
299
251
  props: {
@@ -311,11 +263,11 @@ const _sfc_main$2 = vue.defineComponent({
311
263
  const searchVal = vue.ref("");
312
264
  const emptyPic = antDesignVue.Empty.PRESENTED_IMAGE_SIMPLE;
313
265
  function search() {
314
- let data = searchVal.value ? { searchVal: searchVal.value } : false;
266
+ let data = { searchVal: searchVal.value || "" };
315
267
  emit("fetchList", data);
316
268
  }
317
269
  function radioChange(e) {
318
- emit("update:selected", e.target.value);
270
+ emit("update:selected", String(e.target.value));
319
271
  }
320
272
  return {
321
273
  searchVal,
@@ -325,25 +277,25 @@ const _sfc_main$2 = vue.defineComponent({
325
277
  };
326
278
  }
327
279
  });
328
- const _hoisted_1$2 = { class: "radio-selector-panel" };
329
- const _hoisted_2$2 = { class: "__search-panel withoutpad" };
330
- const _hoisted_3$2 = {
280
+ const _hoisted_1$3 = { class: "radio-selector-panel" };
281
+ const _hoisted_2$3 = { class: "__search-panel withoutpad" };
282
+ const _hoisted_3$3 = {
331
283
  key: 0,
332
284
  class: "__selector-modal-options __radio-panel"
333
285
  };
334
- const _hoisted_4$2 = {
286
+ const _hoisted_4$3 = {
335
287
  key: 1,
336
288
  class: "noData"
337
289
  };
338
- const _hoisted_5$2 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
339
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
290
+ const _hoisted_5$3 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
291
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
340
292
  const _component_search_outlined = vue.resolveComponent("search-outlined");
341
293
  const _component_a_input = vue.resolveComponent("a-input");
342
294
  const _component_ARadio = vue.resolveComponent("ARadio");
343
295
  const _component_ARadioGroup = vue.resolveComponent("ARadioGroup");
344
296
  const _component_Empty = vue.resolveComponent("Empty");
345
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
346
- vue.createElementVNode("div", _hoisted_2$2, [
297
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
298
+ vue.createElementVNode("div", _hoisted_2$3, [
347
299
  vue.createVNode(_component_a_input, {
348
300
  value: _ctx.searchVal,
349
301
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
@@ -355,7 +307,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
355
307
  ]),
356
308
  _: 1
357
309
  }, 8, ["value", "onChange"]),
358
- _ctx.list && _ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
310
+ _ctx.list && _ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
359
311
  vue.createVNode(_component_ARadioGroup, {
360
312
  value: _ctx.selected,
361
313
  style: { width: "100%" },
@@ -378,10 +330,10 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
378
330
  _: 1
379
331
  }, 8, ["value", "onChange"])
380
332
  ])) : vue.createCommentVNode("v-if", true),
381
- _ctx.list && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [
333
+ _ctx.list && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
382
334
  vue.createVNode(_component_Empty, { image: _ctx.emptyPic }, {
383
335
  description: vue.withCtx(() => [
384
- vue.createElementVNode("span", _hoisted_5$2, vue.toDisplayString(!!_ctx.searchVal ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
336
+ vue.createElementVNode("span", _hoisted_5$3, vue.toDisplayString(!!_ctx.searchVal ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
385
337
  ]),
386
338
  _: 1
387
339
  }, 8, ["image"])
@@ -389,9 +341,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
389
341
  ])
390
342
  ]);
391
343
  }
392
- var radioCmp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "radioCmp.vue"]]);
344
+ var radioCmp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "radioCmp.vue"]]);
393
345
 
394
- const _sfc_main$1 = vue.defineComponent({
346
+ const _sfc_main$2 = vue.defineComponent({
395
347
  props: {
396
348
  list: {
397
349
  type: Array,
@@ -437,7 +389,7 @@ const _sfc_main$1 = vue.defineComponent({
437
389
  }
438
390
  function search() {
439
391
  emit("fetchList", {
440
- searchVal: searchVal.value,
392
+ searchVal: searchVal.value || "",
441
393
  area: areas[selectState.activeKey].paramStr
442
394
  });
443
395
  }
@@ -483,17 +435,17 @@ const _sfc_main$1 = vue.defineComponent({
483
435
  };
484
436
  }
485
437
  });
486
- const _hoisted_1$1 = { class: "varied-selector-panel" };
487
- const _hoisted_2$1 = { class: "__selector-modal-panel-withGroup" };
488
- const _hoisted_3$1 = { class: "varied-area-tabs" };
489
- const _hoisted_4$1 = ["onClick"];
490
- const _hoisted_5$1 = { class: "area-panel" };
491
- const _hoisted_6$1 = {
438
+ const _hoisted_1$2 = { class: "varied-selector-panel" };
439
+ const _hoisted_2$2 = { class: "__selector-modal-panel-withGroup" };
440
+ const _hoisted_3$2 = { class: "varied-area-tabs" };
441
+ const _hoisted_4$2 = ["onClick"];
442
+ const _hoisted_5$2 = { class: "area-panel" };
443
+ const _hoisted_6$2 = {
492
444
  key: 0,
493
445
  class: "noData"
494
446
  };
495
- const _hoisted_7 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
496
- const _hoisted_8 = {
447
+ const _hoisted_7$1 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
448
+ const _hoisted_8$1 = {
497
449
  key: 0,
498
450
  class: "__selector-modal-options"
499
451
  };
@@ -515,22 +467,22 @@ const _hoisted_13 = {
515
467
  key: 3,
516
468
  class: "__selector-modal-options"
517
469
  };
518
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
470
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
519
471
  const _component_search_outlined = vue.resolveComponent("search-outlined");
520
472
  const _component_a_input = vue.resolveComponent("a-input");
521
473
  const _component_Empty = vue.resolveComponent("Empty");
522
474
  const _component_Checkbox = vue.resolveComponent("Checkbox");
523
475
  const _component_Spin = vue.resolveComponent("Spin");
524
476
  const _component_a_tree = vue.resolveComponent("a-tree");
525
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
526
- vue.createElementVNode("div", _hoisted_2$1, [
527
- vue.createElementVNode("div", _hoisted_3$1, [
477
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
478
+ vue.createElementVNode("div", _hoisted_2$2, [
479
+ vue.createElementVNode("div", _hoisted_3$2, [
528
480
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.areas, (item) => {
529
481
  return vue.openBlock(), vue.createElementBlock("div", {
530
482
  key: item.key,
531
483
  class: vue.normalizeClass(["area-tabs-item", { active: item.key === _ctx.activeKey }]),
532
484
  onClick: vue.withModifiers(($event) => _ctx.changeArea(item), ["stop"])
533
- }, vue.toDisplayString(item.title), 11, _hoisted_4$1);
485
+ }, vue.toDisplayString(item.title), 11, _hoisted_4$2);
534
486
  }), 128))
535
487
  ]),
536
488
  vue.createVNode(_component_a_input, {
@@ -544,16 +496,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
544
496
  ]),
545
497
  _: 1
546
498
  }, 8, ["value", "placeholder", "onChange"]),
547
- vue.createElementVNode("div", _hoisted_5$1, [
548
- _ctx.list && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
499
+ vue.createElementVNode("div", _hoisted_5$2, [
500
+ _ctx.list && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
549
501
  vue.createVNode(_component_Empty, { image: _ctx.emptyPic }, {
550
502
  description: vue.withCtx(() => [
551
- vue.createElementVNode("span", _hoisted_7, vue.toDisplayString(!!_ctx.searchVal ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
503
+ vue.createElementVNode("span", _hoisted_7$1, vue.toDisplayString(!!_ctx.searchVal ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
552
504
  ]),
553
505
  _: 1
554
506
  }, 8, ["image"])
555
507
  ])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
556
- _ctx.activeKey === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
508
+ _ctx.activeKey === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, [
557
509
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item) => {
558
510
  return vue.openBlock(), vue.createElementBlock("div", {
559
511
  key: item.key,
@@ -634,11 +586,136 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
634
586
  ])
635
587
  ]);
636
588
  }
637
- var VariedCmp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "variedCmp.vue"]]);
589
+ var VariedCmp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "variedCmp.vue"]]);
590
+
591
+ const _sfc_main$1 = vue.defineComponent({
592
+ components: { SearchOutlined: iconsVue.SearchOutlined, Empty: antDesignVue.Empty, ATree: antDesignVue.Tree },
593
+ props: {
594
+ limit: {
595
+ type: Number,
596
+ default: 0
597
+ },
598
+ selected: {
599
+ type: Array,
600
+ default: () => []
601
+ }
602
+ },
603
+ emits: ["fetchList", "update:selected"],
604
+ setup(props, { emit }) {
605
+ const state = vue.reactive({
606
+ searchVal: "",
607
+ selectAll: false,
608
+ indeterminate: false,
609
+ emptyPic: antDesignVue.Empty.PRESENTED_IMAGE_SIMPLE,
610
+ isFulfill: false
611
+ });
612
+ const methods = {
613
+ search() {
614
+ let data = state.searchVal ? { searchVal: state.searchVal } : { searchVal: "" };
615
+ emit("fetchList", data);
616
+ }
617
+ };
618
+ function changeTreeCheck(checkedKeys) {
619
+ let flatMap = selectState.dataMap;
620
+ let curlistKeys = selectState.curlistKeys;
621
+ let hadselected = new Set(selectState.multipDepartment);
622
+ let curselect = new Set(checkedKeys);
623
+ console.log(hadselected, curselect);
624
+ for (let key of hadselected) {
625
+ if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
626
+ hadselected.delete(key);
627
+ }
628
+ }
629
+ for (let key of curselect) {
630
+ let obj = flatMap.get(key);
631
+ if (obj && !curselect.has(obj["parent"])) {
632
+ hadselected.add(key);
633
+ }
634
+ }
635
+ let arr = Array.from(hadselected) || [];
636
+ if (props.limit && props.limit > 0 && arr.length > props.limit) {
637
+ antDesignVue.message.error("\u52FE\u9009\u540E\u5C06\u8D85\u8FC7\u4EBA\u5458\u9650\u5236");
638
+ return;
639
+ }
640
+ selectState.multipDepartment = Array.from(hadselected) || [];
641
+ console.log(selectState.multipDepartment);
642
+ }
643
+ return {
644
+ changeTreeCheck,
645
+ ...vue.toRefs(state),
646
+ ...vue.toRefs(selectState),
647
+ list,
648
+ ...methods
649
+ };
650
+ }
651
+ });
652
+ const _hoisted_1$1 = { class: "multiple-selector" };
653
+ const _hoisted_2$1 = { class: "__selector-modal-panel" };
654
+ const _hoisted_3$1 = { class: "__search-panel" };
655
+ const _hoisted_4$1 = { class: "__selector-modal-options" };
656
+ const _hoisted_5$1 = { class: "department-option-item" };
657
+ const _hoisted_6$1 = {
658
+ key: 0,
659
+ class: "department-desc"
660
+ };
661
+ const _hoisted_7 = {
662
+ key: 0,
663
+ class: "noData",
664
+ style: { "height": "280px" }
665
+ };
666
+ const _hoisted_8 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
667
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
668
+ const _component_search_outlined = vue.resolveComponent("search-outlined");
669
+ const _component_AInput = vue.resolveComponent("AInput");
670
+ const _component_ATree = vue.resolveComponent("ATree");
671
+ const _component_Empty = vue.resolveComponent("Empty");
672
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
673
+ vue.createElementVNode("div", _hoisted_2$1, [
674
+ vue.createElementVNode("div", _hoisted_3$1, [
675
+ vue.createVNode(_component_AInput, {
676
+ value: _ctx.searchVal,
677
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
678
+ placeholder: "\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0",
679
+ onBlur: _ctx.search
680
+ }, {
681
+ suffix: vue.withCtx(() => [
682
+ vue.createVNode(_component_search_outlined, { style: { color: "#9393A3" } })
683
+ ]),
684
+ _: 1
685
+ }, 8, ["value", "onBlur"]),
686
+ vue.createElementVNode("div", _hoisted_4$1, [
687
+ vue.createVNode(_component_ATree, {
688
+ "checked-keys": _ctx.multipDepartment,
689
+ checkable: "",
690
+ "tree-data": _ctx.list,
691
+ onCheck: _ctx.changeTreeCheck
692
+ }, {
693
+ title: vue.withCtx(({ title, key, description }) => [
694
+ vue.createElementVNode("div", _hoisted_5$1, [
695
+ vue.createElementVNode("span", null, vue.toDisplayString(title) + vue.toDisplayString(key ? `(${key})` : ""), 1),
696
+ description ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$1, vue.toDisplayString(description), 1)) : vue.createCommentVNode("v-if", true)
697
+ ])
698
+ ]),
699
+ _: 1
700
+ }, 8, ["checked-keys", "tree-data", "onCheck"]),
701
+ _ctx.list && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
702
+ vue.createVNode(_component_Empty, { image: _ctx.emptyPic }, {
703
+ description: vue.withCtx(() => [
704
+ vue.createElementVNode("span", _hoisted_8, vue.toDisplayString(!!_ctx.searchVal ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
705
+ ]),
706
+ _: 1
707
+ }, 8, ["image"])
708
+ ])) : vue.createCommentVNode("v-if", true)
709
+ ])
710
+ ])
711
+ ])
712
+ ]);
713
+ }
714
+ var departmentCmp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "departmentCmp.vue"]]);
638
715
 
639
716
  const _hoisted_1 = { class: "selector-content" };
640
717
  const _hoisted_2 = {
641
- key: 3,
718
+ key: 4,
642
719
  class: "__selector-chosen-panel"
643
720
  };
644
721
  const _hoisted_3 = {
@@ -661,13 +738,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
661
738
  const computeSelected = vue.computed(() => {
662
739
  let list2 = [];
663
740
  if (props.mode === MODE.MULTIPLE) {
664
- if (multipTree.value) {
665
- return [...selectState.multipDepartment];
666
- }
667
741
  for (let [key, value] of Object.entries(selectState.multipleChecked)) {
668
742
  value && list2.push(String(key));
669
743
  }
670
744
  return list2;
745
+ } else if (props.mode === MODE.DEPARTMENT) {
746
+ return [...selectState.multipDepartment];
671
747
  } else if (props.mode === MODE.VARIED) {
672
748
  list2 = list2.concat(selectState.departmentChecked);
673
749
  for (let [key, value] of Object.entries(selectState.staffsChecked)) {
@@ -703,50 +779,42 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
703
779
  activeKey = area === "shop" ? 3 : activeKey;
704
780
  return selectState.activeKey === activeKey;
705
781
  }
706
- function fetch(params) {
782
+ async function fetch(params) {
707
783
  list.value = [];
708
- if (typeof params !== "boolean") {
709
- let isDepartTree = params.area === "department" || props.mode === MODE.MULTIPLE && multipTree.value;
710
- if (isDepartTree && departNative.value.length) {
711
- if (props.mode === MODE.VARIED && !params.searchVal || params.searchVal === "") {
712
- list.value = isCurrentFetch(params.area || "") ? [...departNative.value] : [];
713
- return;
714
- } else {
715
- let result = [];
716
- let queues = [...departNative.value];
717
- while (queues.length) {
718
- let node = queues.shift();
719
- if (node["title"] && node["title"].includes(params?.searchVal || "")) {
720
- result.push({ ...node });
721
- }
722
- if (node.children)
723
- queues.push(...node.children);
724
- }
725
- list.value = isCurrentFetch(params?.area || "") ? result : [];
726
- return;
727
- }
784
+ let isDepartTree = params.area === "department" || props.mode === MODE.DEPARTMENT;
785
+ if (isDepartTree) {
786
+ if (!departNative.value.length) {
787
+ departNative.value = await props.load(params);
788
+ selectState.dataMap = flatListFunc([...departNative.value]);
728
789
  }
729
- props.load(params).then((data) => {
730
- if (data && data.length) {
731
- if (params.area && params.area === "department") {
732
- departNative.value = data;
733
- fetch(params);
734
- } else {
735
- let result = data.map((item) => {
736
- return item;
737
- });
738
- list.value = isCurrentFetch(params.area) ? result : [];
790
+ if (params.searchVal) {
791
+ let result = [];
792
+ let queues = [...departNative.value];
793
+ while (queues.length) {
794
+ let node = queues.shift();
795
+ if (node["title"] && node["title"].includes(params?.searchVal || "")) {
796
+ result.push({ ...node });
739
797
  }
740
- selectState.dataMap = flatListFunc(data);
741
- } else {
742
- list.value = [];
798
+ if (node.children)
799
+ queues.push(...node.children);
743
800
  }
744
- });
745
- } else {
746
- if (props.mode === MODE.MULTIPLE && multipTree.value) {
747
- list.value = [...departNative.value];
801
+ list.value = result;
802
+ } else {
803
+ list.value = departNative.value;
748
804
  }
805
+ return;
749
806
  }
807
+ await props.load(params).then((data) => {
808
+ if (data && data.length) {
809
+ let result = data.map((item) => {
810
+ return item;
811
+ });
812
+ list.value = isCurrentFetch(params.area) ? result : [];
813
+ selectState.dataMap = flatListFunc(data);
814
+ } else {
815
+ list.value = [];
816
+ }
817
+ });
750
818
  }
751
819
  function flatListFunc(list2) {
752
820
  let queue = [...list2];
@@ -785,7 +853,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
785
853
  let data = selectState.dataMap.get(String(selected.value));
786
854
  emit("update:select", [data]);
787
855
  emit("change", [data]);
788
- } else if (props.mode === MODE.MULTIPLE) {
856
+ } else if (props.mode === MODE.MULTIPLE || props.mode === MODE.DEPARTMENT) {
789
857
  let arr = computeSelected.value.map((key) => findDataByKey(key));
790
858
  emit("update:select", arr);
791
859
  emit("change", arr);
@@ -831,12 +899,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
831
899
  if (props.mode === MODE.MULTIPLE) {
832
900
  if (selectState.multipleChecked[String(key)]) {
833
901
  selectState.multipleChecked[String(key)] = false;
834
- } else {
835
- let index = selectState.multipDepartment.findIndex(
836
- (item) => String(item) === String(key)
837
- );
838
- index > -1 && selectState.multipDepartment.splice(index, 1);
839
902
  }
903
+ } else if (props.mode === MODE.DEPARTMENT) {
904
+ let index = selectState.multipDepartment.findIndex(
905
+ (item) => String(item) === String(key)
906
+ );
907
+ index > -1 && selectState.multipDepartment.splice(index, 1);
840
908
  } else if (props.mode === MODE.VARIED) {
841
909
  if (selectState.staffsChecked[String(key)]) {
842
910
  selectState.staffsChecked[String(key)] = false;
@@ -856,43 +924,42 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
856
924
  () => props.visible,
857
925
  (val) => {
858
926
  if (val) {
859
- if (props.mode === "radio") {
927
+ if (props.mode === MODE.RADIO) {
860
928
  selected.value = "";
929
+ } else if (props.mode === MODE.DEPARTMENT) {
930
+ let arr = props.select;
931
+ selected.value = arr.length ? arr.map((item) => String(item?.key)) : [];
932
+ const multipDepartment = [];
933
+ arr.forEach((item) => multipDepartment.push(String(item?.key)));
934
+ selectState.multipDepartment = multipDepartment;
935
+ fetch({});
936
+ } else if (props.mode === MODE.MULTIPLE) {
937
+ let arr = props.select;
938
+ selected.value = arr.length ? arr.map((item) => String(item?.key)) : [];
939
+ let multipleChecked = {};
940
+ arr.forEach((item) => multipleChecked[String(item?.key)] = true);
941
+ selectState.multipleChecked = multipleChecked;
861
942
  } else {
862
943
  let arr = props.select;
863
944
  selected.value = arr.length ? arr.map((item) => String(item?.key)) : [];
864
- if (props.mode === MODE.MULTIPLE) {
865
- if (props.immediateFetch) {
866
- const multipDepartment = [];
867
- arr.forEach((item) => multipDepartment.push(String(item?.key)));
868
- selectState.multipDepartment = multipDepartment;
869
- } else {
870
- let multipleChecked = {};
871
- arr.forEach(
872
- (item) => multipleChecked[String(item?.key)] = true
873
- );
874
- selectState.multipleChecked = multipleChecked;
875
- }
876
- } else if (props.mode === MODE.VARIED) {
877
- let department = [];
878
- let shop = {};
879
- let staff = {};
880
- let group = {};
881
- arr.forEach((item) => {
882
- if (item["area"] && item["area"] === "department")
883
- department.push(String(item?.key));
884
- else if (item["area"] && item["area"] === "shop")
885
- shop[String(item?.key)] = true;
886
- else if (item["area"] && item["area"] === "staff")
887
- staff[String(item?.key)] = true;
888
- else if (item["area"] && item["area"] === "group")
889
- group[String(item?.key)] = true;
890
- });
891
- selectState.departmentChecked = department;
892
- selectState.shopChecked = shop;
893
- selectState.staffsChecked = staff;
894
- selectState.groupChecked = group;
895
- }
945
+ let department = [];
946
+ let shop = {};
947
+ let staff = {};
948
+ let group = {};
949
+ arr.forEach((item) => {
950
+ if (item["area"] && item["area"] === "department")
951
+ department.push(String(item?.key));
952
+ else if (item["area"] && item["area"] === "shop")
953
+ shop[String(item?.key)] = true;
954
+ else if (item["area"] && item["area"] === "staff")
955
+ staff[String(item?.key)] = true;
956
+ else if (item["area"] && item["area"] === "group")
957
+ group[String(item?.key)] = true;
958
+ });
959
+ selectState.departmentChecked = department;
960
+ selectState.shopChecked = shop;
961
+ selectState.staffsChecked = staff;
962
+ selectState.groupChecked = group;
896
963
  }
897
964
  } else {
898
965
  selected.value = [];
@@ -903,9 +970,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
903
970
  selectState.groupChecked = {};
904
971
  selectState.activeKey = 0;
905
972
  }
906
- if (val && props.mode === MODE.MULTIPLE && props.immediateFetch) {
907
- fetch({});
908
- }
909
973
  },
910
974
  { immediate: true, deep: true }
911
975
  );
@@ -936,17 +1000,23 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
936
1000
  list: vue.unref(list),
937
1001
  "show-count": _ctx.showCount,
938
1002
  onFetchList: fetch
939
- }, null, 8, ["selected", "list", "show-count"])) : (vue.openBlock(), vue.createBlock(multipleCmp, {
1003
+ }, null, 8, ["selected", "list", "show-count"])) : _ctx.mode === "department" ? (vue.openBlock(), vue.createBlock(departmentCmp, {
940
1004
  key: 2,
941
1005
  selected: selected.value,
942
1006
  "onUpdate:selected": _cache[2] || (_cache[2] = ($event) => selected.value = $event),
943
1007
  limit: _ctx.limit,
1008
+ onFetchList: fetch
1009
+ }, null, 8, ["selected", "limit"])) : (vue.openBlock(), vue.createBlock(multipleCmp, {
1010
+ key: 3,
1011
+ selected: selected.value,
1012
+ "onUpdate:selected": _cache[3] || (_cache[3] = ($event) => selected.value = $event),
1013
+ limit: _ctx.limit,
944
1014
  list: vue.unref(list),
945
1015
  "is-tree": multipTree.value,
946
1016
  onFetchList: fetch
947
1017
  }, null, 8, ["selected", "limit", "list", "is-tree"])),
948
- ["multiple", "varied"].includes(_ctx.mode) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
949
- _ctx.showCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
1018
+ ["multiple", "varied", "department"].includes(_ctx.mode) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
1019
+ ["multiple", "varied"].includes(_ctx.mode) && _ctx.showCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
950
1020
  vue.createElementVNode("span", null, "\u5DF2\u9009\u62E9" + vue.toDisplayString(vue.unref(computeSelected) && vue.unref(computeSelected).length || 0) + vue.toDisplayString(_ctx.$props.unitStr), 1),
951
1021
  _ctx.limit ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, "\u6700\u591A\u9009\u62E9" + vue.toDisplayString(_ctx.limit) + vue.toDisplayString(_ctx.$props.unitStr), 1)) : vue.createCommentVNode("v-if", true)
952
1022
  ])) : vue.createCommentVNode("v-if", true),