bm-admin-ui 1.0.78-alpha → 1.0.80-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 (37) hide show
  1. package/es/components/float-table/index.js +3077 -1
  2. package/es/components/float-table/src/rowDrag.d.ts +1 -0
  3. package/es/components/form-designer/index.js +1 -1
  4. package/es/components/search-filter/index.js +161 -5
  5. package/es/components/search-filter/src/form-select-all.vue.d.ts +741 -0
  6. package/es/components/select-all/index.js +1 -1
  7. package/es/components/staffs-selector/index.d.ts +1 -81
  8. package/es/components/staffs-selector/index.js +52 -377
  9. package/es/components/staffs-selector/src/action.d.ts +8 -3
  10. package/es/components/staffs-selector/src/departmentCmp.vue.d.ts +1 -5
  11. package/es/components/staffs-selector/src/multipleCmp.vue.d.ts +0 -5
  12. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +1 -81
  13. package/es/components/staffs-selector/src/variedCmp.vue.d.ts +1 -4
  14. package/lib/components/float-table/index.js +3076 -0
  15. package/lib/components/float-table/src/rowDrag.d.ts +1 -0
  16. package/lib/components/form-designer/index.js +1 -1
  17. package/lib/components/search-filter/index.js +161 -4
  18. package/lib/components/search-filter/src/form-select-all.vue.d.ts +741 -0
  19. package/lib/components/select-all/index.js +1 -1
  20. package/lib/components/staffs-selector/index.d.ts +1 -81
  21. package/lib/components/staffs-selector/index.js +50 -375
  22. package/lib/components/staffs-selector/src/action.d.ts +8 -3
  23. package/lib/components/staffs-selector/src/departmentCmp.vue.d.ts +1 -5
  24. package/lib/components/staffs-selector/src/multipleCmp.vue.d.ts +0 -5
  25. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +1 -81
  26. package/lib/components/staffs-selector/src/variedCmp.vue.d.ts +1 -4
  27. package/package.json +1 -1
  28. package/theme-chalk/float-table.css +1 -1
  29. package/theme-chalk/index.css +1 -1
  30. package/types/components/float-table/src/rowDrag.d.ts +1 -0
  31. package/types/components/search-filter/src/form-select-all.vue.d.ts +741 -0
  32. package/types/components/staffs-selector/index.d.ts +1 -81
  33. package/types/components/staffs-selector/src/action.d.ts +8 -3
  34. package/types/components/staffs-selector/src/departmentCmp.vue.d.ts +1 -5
  35. package/types/components/staffs-selector/src/multipleCmp.vue.d.ts +0 -5
  36. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +1 -81
  37. package/types/components/staffs-selector/src/variedCmp.vue.d.ts +1 -4
@@ -1,7 +1,7 @@
1
1
  import { withInstall } from 'bm-admin-ui/es/utils/with-install';
2
- import { readonly, ref, reactive, defineComponent, watch, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, withDirectives, createTextVNode, vShow, Fragment, renderList, toDisplayString, createCommentVNode, computed, createBlock, h, normalizeClass, withModifiers, unref } from 'vue';
2
+ import { readonly, ref, reactive, defineComponent, watch, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, withDirectives, createTextVNode, vShow, Fragment, renderList, toDisplayString, createCommentVNode, computed, createBlock, unref, withModifiers } from 'vue';
3
3
  import { Checkbox, Empty, Radio, Input, RadioGroup, Tree, message, Modal } from 'ant-design-vue';
4
- import { SearchOutlined, LoadingOutlined, CloseCircleFilled } from '@ant-design/icons-vue';
4
+ import { SearchOutlined, CloseCircleFilled } from '@ant-design/icons-vue';
5
5
 
6
6
  const MODE = {
7
7
  RADIO: 'radio',
@@ -62,16 +62,21 @@ readonly([
62
62
  ref('');
63
63
  const selectState = reactive({
64
64
  multipleChecked: {},
65
- departmentChecked: [],
66
65
  multipDepartment: [],
66
+ dataMap: new Map(),
67
+ curlistKeys: new Set(),
68
+ fetchLoading: false,
69
+ searched: false,
70
+ });
71
+ reactive({
72
+ departmentChecked: [],
67
73
  staffsChecked: {},
68
74
  shopChecked: {},
69
75
  groupChecked: {},
70
76
  dataMap: new Map(),
71
- curlistKeys: new Set(),
72
77
  activeKey: 0,
73
- fetchLoading: false,
74
- searched: false
78
+ curlistKeys: new Set(),
79
+ searched: false,
75
80
  });
76
81
  const list = ref([]);
77
82
  const departNative = ref([]);
@@ -84,7 +89,7 @@ var _export_sfc = (sfc, props) => {
84
89
  return target;
85
90
  };
86
91
 
87
- const _sfc_main$4 = defineComponent({
92
+ const _sfc_main$3 = defineComponent({
88
93
  components: { SearchOutlined, Checkbox, Empty },
89
94
  props: {
90
95
  limit: {
@@ -163,25 +168,25 @@ const _sfc_main$4 = defineComponent({
163
168
  };
164
169
  }
165
170
  });
166
- const _hoisted_1$4 = { class: "multiple-selector" };
167
- const _hoisted_2$4 = { class: "__selector-modal-panel" };
168
- const _hoisted_3$4 = { class: "__search-panel" };
169
- const _hoisted_4$4 = { class: "__selector-modal-options" };
170
- const _hoisted_5$4 = { class: "__selector-modal-options-item fixed-option" };
171
- const _hoisted_6$3 = {
171
+ const _hoisted_1$3 = { class: "multiple-selector" };
172
+ const _hoisted_2$3 = { class: "__selector-modal-panel" };
173
+ const _hoisted_3$3 = { class: "__search-panel" };
174
+ const _hoisted_4$3 = { class: "__selector-modal-options" };
175
+ const _hoisted_5$3 = { class: "__selector-modal-options-item fixed-option" };
176
+ const _hoisted_6$2 = {
172
177
  key: 0,
173
178
  class: "noData",
174
179
  style: { "height": "280px" }
175
180
  };
176
- const _hoisted_7$2 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
177
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
181
+ const _hoisted_7$1 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
182
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
178
183
  const _component_search_outlined = resolveComponent("search-outlined");
179
184
  const _component_AInput = resolveComponent("AInput");
180
185
  const _component_Checkbox = resolveComponent("Checkbox");
181
186
  const _component_Empty = resolveComponent("Empty");
182
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
183
- createElementVNode("div", _hoisted_2$4, [
184
- createElementVNode("div", _hoisted_3$4, [
187
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
188
+ createElementVNode("div", _hoisted_2$3, [
189
+ createElementVNode("div", _hoisted_3$3, [
185
190
  createVNode(_component_AInput, {
186
191
  value: _ctx.searchVal,
187
192
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
@@ -193,8 +198,8 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
193
198
  ]),
194
199
  _: 1
195
200
  }, 8, ["value", "onBlur"]),
196
- createElementVNode("div", _hoisted_4$4, [
197
- createElementVNode("div", _hoisted_5$4, [
201
+ createElementVNode("div", _hoisted_4$3, [
202
+ createElementVNode("div", _hoisted_5$3, [
198
203
  withDirectives(createVNode(_component_Checkbox, {
199
204
  checked: _ctx.selectAll,
200
205
  "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => _ctx.selectAll = $event),
@@ -227,10 +232,10 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
227
232
  }, 1032, ["checked", "onUpdate:checked", "disabled"])
228
233
  ]);
229
234
  }), 128)),
230
- _ctx.list && !_ctx.list.length ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
235
+ _ctx.list && !_ctx.list.length ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
231
236
  createVNode(_component_Empty, { image: _ctx.emptyPic }, {
232
237
  description: withCtx(() => [
233
- createElementVNode("span", _hoisted_7$2, toDisplayString(!!_ctx.searched ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
238
+ createElementVNode("span", _hoisted_7$1, toDisplayString(!!_ctx.searched ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
234
239
  ]),
235
240
  _: 1
236
241
  }, 8, ["image"])
@@ -240,9 +245,9 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
240
245
  ])
241
246
  ]);
242
247
  }
243
- var multipleCmp = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__file", "multipleCmp.vue"]]);
248
+ var multipleCmp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "multipleCmp.vue"]]);
244
249
 
245
- const _sfc_main$3 = defineComponent({
250
+ const _sfc_main$2 = defineComponent({
246
251
  name: "RadioCmp",
247
252
  components: { ARadio: Radio, AInput: Input, ARadioGroup: RadioGroup, Empty, SearchOutlined },
248
253
  props: {
@@ -276,25 +281,25 @@ const _sfc_main$3 = defineComponent({
276
281
  };
277
282
  }
278
283
  });
279
- const _hoisted_1$3 = { class: "radio-selector-panel" };
280
- const _hoisted_2$3 = { class: "__search-panel withoutpad" };
281
- const _hoisted_3$3 = {
284
+ const _hoisted_1$2 = { class: "radio-selector-panel" };
285
+ const _hoisted_2$2 = { class: "__search-panel withoutpad" };
286
+ const _hoisted_3$2 = {
282
287
  key: 0,
283
288
  class: "__selector-modal-options __radio-panel"
284
289
  };
285
- const _hoisted_4$3 = {
290
+ const _hoisted_4$2 = {
286
291
  key: 1,
287
292
  class: "noData"
288
293
  };
289
- const _hoisted_5$3 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
290
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
294
+ const _hoisted_5$2 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
295
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
291
296
  const _component_search_outlined = resolveComponent("search-outlined");
292
297
  const _component_a_input = resolveComponent("a-input");
293
298
  const _component_ARadio = resolveComponent("ARadio");
294
299
  const _component_ARadioGroup = resolveComponent("ARadioGroup");
295
300
  const _component_Empty = resolveComponent("Empty");
296
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
297
- createElementVNode("div", _hoisted_2$3, [
301
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
302
+ createElementVNode("div", _hoisted_2$2, [
298
303
  createVNode(_component_a_input, {
299
304
  value: _ctx.searchVal,
300
305
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
@@ -306,7 +311,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
306
311
  ]),
307
312
  _: 1
308
313
  }, 8, ["value", "onBlur"]),
309
- _ctx.list && _ctx.list.length ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
314
+ _ctx.list && _ctx.list.length ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
310
315
  createVNode(_component_ARadioGroup, {
311
316
  value: _ctx.selected,
312
317
  style: { width: "100%" },
@@ -329,10 +334,10 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
329
334
  _: 1
330
335
  }, 8, ["value", "onChange"])
331
336
  ])) : createCommentVNode("v-if", true),
332
- _ctx.list && !_ctx.list.length ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
337
+ _ctx.list && !_ctx.list.length ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
333
338
  createVNode(_component_Empty, { image: _ctx.emptyPic }, {
334
339
  description: withCtx(() => [
335
- createElementVNode("span", _hoisted_5$3, toDisplayString(!!_ctx.searched ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
340
+ createElementVNode("span", _hoisted_5$2, toDisplayString(!!_ctx.searched ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
336
341
  ]),
337
342
  _: 1
338
343
  }, 8, ["image"])
@@ -340,252 +345,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
340
345
  ])
341
346
  ]);
342
347
  }
343
- var radioCmp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "radioCmp.vue"]]);
344
-
345
- const _sfc_main$2 = defineComponent({
346
- props: {
347
- list: {
348
- type: Array,
349
- default: () => []
350
- },
351
- selected: {
352
- type: Array,
353
- default: () => []
354
- },
355
- dataMap: {
356
- type: Map,
357
- default: () => /* @__PURE__ */ new Map()
358
- },
359
- curlistKeys: {
360
- type: Set,
361
- default: () => /* @__PURE__ */ new Set()
362
- }
363
- },
364
- emits: ["fetchList", "update:selected"],
365
- setup(props, { emit }) {
366
- const indicator = h(LoadingOutlined, {
367
- style: {
368
- fontSize: "24px"
369
- },
370
- spin: true
371
- });
372
- const loading = ref(false);
373
- const emptyPic = Empty.PRESENTED_IMAGE_SIMPLE;
374
- const areas = readonly([
375
- { title: "\u6210\u5458", key: 0, paramStr: "staff" },
376
- { title: "\u90E8\u95E8", key: 1, paramStr: "department" },
377
- { title: "\u5DE5\u4F5C\u7EC4", key: 2, paramStr: "group" },
378
- { title: "\u5E97\u94FA", key: 3, paramStr: "shop" }
379
- ]);
380
- const searchVal = ref("");
381
- function changeArea(item) {
382
- selectState.activeKey = item.key;
383
- searchVal.value = "";
384
- if (selectState.activeKey === 1) {
385
- search();
386
- } else
387
- emit("fetchList", false);
388
- }
389
- function search() {
390
- emit("fetchList", {
391
- searchVal: searchVal.value || "",
392
- area: areas[selectState.activeKey].paramStr
393
- });
394
- }
395
- const inputPlaceHolder = computed(() => {
396
- if (selectState.activeKey === 1) {
397
- return "\u8BF7\u8F93\u5165\u90E8\u95E8\u641C\u7D22";
398
- } else if (selectState.activeKey === 2) {
399
- return "\u8BF7\u8F93\u5165\u5DE5\u4F5C\u7EC4\u641C\u7D22";
400
- } else if (selectState.activeKey === 3) {
401
- return "\u8BF7\u8F93\u5165\u5E97\u94FA\u641C\u7D22";
402
- }
403
- return "\u8BF7\u8F93\u5165\u4EBA\u540D\u641C\u7D22";
404
- });
405
- function changeTreeCheck(checkedKeys) {
406
- let flatMap = selectState.dataMap;
407
- let curlistKeys = selectState.curlistKeys;
408
- let hadselected = new Set(selectState.departmentChecked);
409
- let curselect = new Set(checkedKeys);
410
- for (let key of hadselected) {
411
- if (curlistKeys.has(String(key)) && (!curselect.has(String(key)) || curselect.has(String(key)) && curselect.has(flatMap.get(String(key))["parent"]))) {
412
- hadselected.delete(key);
413
- }
414
- }
415
- for (let key of curselect) {
416
- let obj = flatMap.get(String(key));
417
- if (obj && !curselect.has(obj["parent"])) {
418
- hadselected.add(String(key));
419
- }
420
- }
421
- selectState.departmentChecked = Array.from(hadselected) || [];
422
- }
423
- return {
424
- indicator,
425
- loading,
426
- emptyPic,
427
- areas,
428
- searchVal,
429
- search,
430
- changeArea,
431
- inputPlaceHolder,
432
- changeTreeCheck,
433
- ...toRefs(selectState)
434
- };
435
- }
436
- });
437
- const _hoisted_1$2 = { class: "varied-selector-panel" };
438
- const _hoisted_2$2 = { class: "__selector-modal-panel-withGroup" };
439
- const _hoisted_3$2 = { class: "varied-area-tabs" };
440
- const _hoisted_4$2 = ["onClick"];
441
- const _hoisted_5$2 = { class: "area-panel" };
442
- const _hoisted_6$2 = {
443
- key: 0,
444
- class: "noData"
445
- };
446
- const _hoisted_7$1 = { style: { "color": "#9393a3", "font-size": "12px", "font-weight": "400" } };
447
- const _hoisted_8$1 = {
448
- key: 0,
449
- class: "__selector-modal-options"
450
- };
451
- const _hoisted_9 = {
452
- key: 1,
453
- class: "__selector-modal-options",
454
- style: { "overflow": "auto" }
455
- };
456
- const _hoisted_10 = { class: "department-option-item" };
457
- const _hoisted_11 = {
458
- key: 0,
459
- class: "department-desc"
460
- };
461
- const _hoisted_12 = {
462
- key: 2,
463
- class: "__selector-modal-options"
464
- };
465
- const _hoisted_13 = {
466
- key: 3,
467
- class: "__selector-modal-options"
468
- };
469
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
470
- const _component_search_outlined = resolveComponent("search-outlined");
471
- const _component_a_input = resolveComponent("a-input");
472
- const _component_Empty = resolveComponent("Empty");
473
- const _component_Checkbox = resolveComponent("Checkbox");
474
- const _component_Spin = resolveComponent("Spin");
475
- const _component_a_tree = resolveComponent("a-tree");
476
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
477
- createElementVNode("div", _hoisted_2$2, [
478
- createElementVNode("div", _hoisted_3$2, [
479
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.areas, (item) => {
480
- return openBlock(), createElementBlock("div", {
481
- key: item.key,
482
- class: normalizeClass(["area-tabs-item", { active: item.key === _ctx.activeKey }]),
483
- onClick: withModifiers(($event) => _ctx.changeArea(item), ["stop"])
484
- }, toDisplayString(item.title), 11, _hoisted_4$2);
485
- }), 128))
486
- ]),
487
- createVNode(_component_a_input, {
488
- value: _ctx.searchVal,
489
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
490
- placeholder: _ctx.inputPlaceHolder,
491
- onBlur: _ctx.search
492
- }, {
493
- suffix: withCtx(() => [
494
- createVNode(_component_search_outlined, { style: { color: "#9393A3" } })
495
- ]),
496
- _: 1
497
- }, 8, ["value", "placeholder", "onBlur"]),
498
- createElementVNode("div", _hoisted_5$2, [
499
- _ctx.list && !_ctx.list.length ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
500
- createVNode(_component_Empty, { image: _ctx.emptyPic }, {
501
- description: withCtx(() => [
502
- createElementVNode("span", _hoisted_7$1, toDisplayString(!!_ctx.searched ? "\u6682\u65E0\u6570\u636E" : "\u8BF7\u5148\u641C\u7D22\u4EBA\u5458\u5173\u952E\u5B57"), 1)
503
- ]),
504
- _: 1
505
- }, 8, ["image"])
506
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
507
- _ctx.activeKey === 0 ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
508
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item) => {
509
- return openBlock(), createElementBlock("div", {
510
- key: item.key,
511
- class: "__selector-modal-options-item"
512
- }, [
513
- createVNode(_component_Checkbox, {
514
- checked: _ctx.staffsChecked[item.key],
515
- "onUpdate:checked": ($event) => _ctx.staffsChecked[item.key] = $event,
516
- class: "__selector-modal-option-check"
517
- }, {
518
- default: withCtx(() => [
519
- createTextVNode(toDisplayString(item.fullTitle || item.title), 1)
520
- ]),
521
- _: 2
522
- }, 1032, ["checked", "onUpdate:checked"])
523
- ]);
524
- }), 128))
525
- ])) : _ctx.activeKey === 1 ? (openBlock(), createElementBlock("div", _hoisted_9, [
526
- createVNode(_component_Spin, {
527
- indicator: _ctx.indicator,
528
- spinning: _ctx.loading
529
- }, null, 8, ["indicator", "spinning"]),
530
- createCommentVNode(" "),
531
- createVNode(_component_a_tree, {
532
- "checked-keys": _ctx.departmentChecked,
533
- "default-expand-all": false,
534
- checkable: "",
535
- "tree-data": _ctx.list,
536
- onCheck: _ctx.changeTreeCheck
537
- }, {
538
- title: withCtx(({ title, description }) => [
539
- createElementVNode("div", _hoisted_10, [
540
- createElementVNode("span", null, toDisplayString(title), 1),
541
- description ? (openBlock(), createElementBlock("p", _hoisted_11, toDisplayString(description), 1)) : createCommentVNode("v-if", true)
542
- ])
543
- ]),
544
- _: 1
545
- }, 8, ["checked-keys", "tree-data", "onCheck"])
546
- ])) : _ctx.activeKey === 2 ? (openBlock(), createElementBlock("div", _hoisted_12, [
547
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item) => {
548
- return openBlock(), createElementBlock("div", {
549
- key: item.key,
550
- class: "__selector-modal-options-item"
551
- }, [
552
- createVNode(_component_Checkbox, {
553
- checked: _ctx.groupChecked[item.key],
554
- "onUpdate:checked": ($event) => _ctx.groupChecked[item.key] = $event,
555
- class: "__selector-modal-option-check"
556
- }, {
557
- default: withCtx(() => [
558
- createTextVNode(toDisplayString(item.fullTitle || item.title), 1)
559
- ]),
560
- _: 2
561
- }, 1032, ["checked", "onUpdate:checked"])
562
- ]);
563
- }), 128))
564
- ])) : _ctx.activeKey === 3 ? (openBlock(), createElementBlock("div", _hoisted_13, [
565
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item) => {
566
- return openBlock(), createElementBlock("div", {
567
- key: item.key,
568
- class: "__selector-modal-options-item"
569
- }, [
570
- createVNode(_component_Checkbox, {
571
- checked: _ctx.shopChecked[item.key],
572
- "onUpdate:checked": ($event) => _ctx.shopChecked[item.key] = $event,
573
- class: "__selector-modal-option-check"
574
- }, {
575
- default: withCtx(() => [
576
- createTextVNode(toDisplayString(item.fullTitle || item.title), 1)
577
- ]),
578
- _: 2
579
- }, 1032, ["checked", "onUpdate:checked"])
580
- ]);
581
- }), 128))
582
- ])) : createCommentVNode("v-if", true)
583
- ], 64))
584
- ])
585
- ])
586
- ]);
587
- }
588
- var VariedCmp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "variedCmp.vue"]]);
348
+ var radioCmp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "radioCmp.vue"]]);
589
349
 
590
350
  const _sfc_main$1 = defineComponent({
591
351
  components: { SearchOutlined, Empty, ATree: Tree },
@@ -601,6 +361,7 @@ const _sfc_main$1 = defineComponent({
601
361
  },
602
362
  emits: ["fetchList", "update:selected"],
603
363
  setup(props, { emit }) {
364
+ const treeRef = ref();
604
365
  const state = reactive({
605
366
  searchVal: "",
606
367
  selectAll: false,
@@ -643,6 +404,7 @@ const _sfc_main$1 = defineComponent({
643
404
  changeTreeCheck,
644
405
  ...toRefs(state),
645
406
  ...toRefs(selectState),
407
+ treeRef,
646
408
  list,
647
409
  ...methods
648
410
  };
@@ -684,6 +446,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
684
446
  }, 8, ["value", "onBlur"]),
685
447
  createElementVNode("div", _hoisted_4$1, [
686
448
  createVNode(_component_ATree, {
449
+ ref: "treeRef",
687
450
  "checked-keys": _ctx.multipDepartment,
688
451
  checkable: "",
689
452
  "tree-data": _ctx.list,
@@ -714,7 +477,7 @@ var departmentCmp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_re
714
477
 
715
478
  const _hoisted_1 = { class: "selector-content" };
716
479
  const _hoisted_2 = {
717
- key: 4,
480
+ key: 3,
718
481
  class: "__selector-chosen-panel"
719
482
  };
720
483
  const _hoisted_3 = {
@@ -743,18 +506,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
743
506
  return list2;
744
507
  } else if (props.mode === MODE.DEPARTMENT) {
745
508
  return [...selectState.multipDepartment];
746
- } else if (props.mode === MODE.VARIED) {
747
- list2 = list2.concat(selectState.departmentChecked);
748
- for (let [key, value] of Object.entries(selectState.staffsChecked)) {
749
- value && list2.push(String(key));
750
- }
751
- for (let [key, value] of Object.entries(selectState.shopChecked)) {
752
- value && list2.push(String(key));
753
- }
754
- for (let [key, value] of Object.entries(selectState.groupChecked)) {
755
- value && list2.push(String(key));
756
- }
757
- return list2;
758
509
  }
759
510
  return [];
760
511
  });
@@ -771,17 +522,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
771
522
  emit("update:visible", !props.visible);
772
523
  list.value = [];
773
524
  }
774
- function isCurrentFetch(area) {
775
- let activeKey = 0;
776
- activeKey = area === "department" ? 1 : activeKey;
777
- activeKey = area === "group" ? 2 : activeKey;
778
- activeKey = area === "shop" ? 3 : activeKey;
779
- return selectState.activeKey === activeKey;
780
- }
781
525
  async function fetch(params) {
782
526
  list.value = [];
783
527
  selectState.searched = !!params?.searchVal;
784
- let isDepartTree = params.area === "department" || props.mode === MODE.DEPARTMENT;
528
+ let isDepartTree = props.mode === MODE.DEPARTMENT;
785
529
  if (isDepartTree) {
786
530
  if (!departNative.value.length) {
787
531
  departNative.value = await props.load(params);
@@ -804,13 +548,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
804
548
  }
805
549
  return;
806
550
  }
807
- if (!!params.searchVal) {
551
+ if (params.searchVal) {
808
552
  await props.load(params).then((data) => {
809
553
  if (data && data.length) {
810
554
  let result = data.map((item) => {
811
555
  return item;
812
556
  });
813
- list.value = isCurrentFetch(params.area) ? result : [];
557
+ list.value = result;
814
558
  selectState.dataMap = flatListFunc(data);
815
559
  } else {
816
560
  list.value = [];
@@ -861,29 +605,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
861
605
  let arr = computeSelected.value.map((key) => findDataByKey(key));
862
606
  emit("update:select", arr);
863
607
  emit("change", arr);
864
- } else if (props.mode === MODE.VARIED) {
865
- let department = selectState.departmentChecked.map((key) => {
866
- let data = findDataByKey(key);
867
- return { ...data, area: "department" };
868
- });
869
- let group = [];
870
- for (let key in selectState.groupChecked) {
871
- let data = findDataByKey(key);
872
- group.push({ ...data, area: "group" });
873
- }
874
- let shop = [];
875
- for (let key in selectState.shopChecked) {
876
- let data = findDataByKey(key);
877
- shop.push({ ...data, area: "shop" });
878
- }
879
- let staff = [];
880
- for (let key in selectState.staffsChecked) {
881
- let data = findDataByKey(key);
882
- staff.push({ ...data, area: "staff" });
883
- }
884
- let arr = [...department, ...group, ...shop, ...staff];
885
- emit("update:select", arr);
886
- emit("change", arr);
887
608
  }
888
609
  list.value = [];
889
610
  modalCancel();
@@ -909,19 +630,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
909
630
  (item) => String(item) === String(key)
910
631
  );
911
632
  index > -1 && selectState.multipDepartment.splice(index, 1);
912
- } else if (props.mode === MODE.VARIED) {
913
- if (selectState.staffsChecked[String(key)]) {
914
- selectState.staffsChecked[String(key)] = false;
915
- } else if (selectState.shopChecked[String(key)]) {
916
- selectState.shopChecked[String(key)] = false;
917
- } else if (selectState.groupChecked[String(key)]) {
918
- selectState.groupChecked[String(key)] = false;
919
- } else {
920
- let index = selectState.departmentChecked.findIndex(
921
- (item) => String(item) === String(key)
922
- );
923
- index > -1 && selectState.departmentChecked.splice(index, 1);
924
- }
925
633
  }
926
634
  }
927
635
  watch(
@@ -943,36 +651,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
943
651
  let multipleChecked = {};
944
652
  arr.forEach((item) => multipleChecked[String(item?.key)] = true);
945
653
  selectState.multipleChecked = multipleChecked;
946
- } else {
947
- let arr = props.select;
948
- selected.value = arr.length ? arr.map((item) => String(item?.key)) : [];
949
- let department = [];
950
- let shop = {};
951
- let staff = {};
952
- let group = {};
953
- arr.forEach((item) => {
954
- if (item["area"] && item["area"] === "department")
955
- department.push(String(item?.key));
956
- else if (item["area"] && item["area"] === "shop")
957
- shop[String(item?.key)] = true;
958
- else if (item["area"] && item["area"] === "staff")
959
- staff[String(item?.key)] = true;
960
- else if (item["area"] && item["area"] === "group")
961
- group[String(item?.key)] = true;
962
- });
963
- selectState.departmentChecked = department;
964
- selectState.shopChecked = shop;
965
- selectState.staffsChecked = staff;
966
- selectState.groupChecked = group;
967
654
  }
968
655
  } else {
969
656
  selected.value = [];
970
657
  selectState.multipleChecked = {};
971
- selectState.departmentChecked = [];
972
- selectState.shopChecked = {};
973
- selectState.staffsChecked = {};
974
- selectState.groupChecked = {};
975
- selectState.activeKey = 0;
976
658
  }
977
659
  },
978
660
  { immediate: true, deep: true }
@@ -997,29 +679,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
997
679
  "onUpdate:selected": _cache[0] || (_cache[0] = ($event) => selected.value = $event),
998
680
  list: unref(list),
999
681
  onFetchList: fetch
1000
- }, null, 8, ["selected", "list"])) : _ctx.mode === "varied" ? (openBlock(), createBlock(VariedCmp, {
682
+ }, null, 8, ["selected", "list"])) : _ctx.mode === "department" ? (openBlock(), createBlock(departmentCmp, {
1001
683
  key: 1,
1002
684
  selected: selected.value,
1003
685
  "onUpdate:selected": _cache[1] || (_cache[1] = ($event) => selected.value = $event),
1004
- list: unref(list),
1005
- "show-count": _ctx.showCount,
1006
- onFetchList: fetch
1007
- }, null, 8, ["selected", "list", "show-count"])) : _ctx.mode === "department" ? (openBlock(), createBlock(departmentCmp, {
1008
- key: 2,
1009
- selected: selected.value,
1010
- "onUpdate:selected": _cache[2] || (_cache[2] = ($event) => selected.value = $event),
1011
686
  limit: _ctx.limit,
1012
687
  onFetchList: fetch
1013
688
  }, null, 8, ["selected", "limit"])) : (openBlock(), createBlock(multipleCmp, {
1014
- key: 3,
689
+ key: 2,
1015
690
  selected: selected.value,
1016
- "onUpdate:selected": _cache[3] || (_cache[3] = ($event) => selected.value = $event),
691
+ "onUpdate:selected": _cache[2] || (_cache[2] = ($event) => selected.value = $event),
1017
692
  limit: _ctx.limit,
1018
693
  list: unref(list),
1019
694
  "is-tree": multipTree.value,
1020
695
  onFetchList: fetch
1021
696
  }, null, 8, ["selected", "limit", "list", "is-tree"])),
1022
- ["multiple", "varied", "department"].includes(_ctx.mode) ? (openBlock(), createElementBlock("div", _hoisted_2, [
697
+ ["multiple", "department"].includes(_ctx.mode) ? (openBlock(), createElementBlock("div", _hoisted_2, [
1023
698
  ["multiple", "varied"].includes(_ctx.mode) && _ctx.showCount ? (openBlock(), createElementBlock("div", _hoisted_3, [
1024
699
  createElementVNode("span", null, "\u5DF2\u9009\u62E9" + toDisplayString(unref(computeSelected) && unref(computeSelected).length || 0) + toDisplayString(_ctx.$props.unitStr), 1),
1025
700
  _ctx.limit ? (openBlock(), createElementBlock("span", _hoisted_4, "\u6700\u591A\u9009\u62E9" + toDisplayString(_ctx.limit) + toDisplayString(_ctx.$props.unitStr), 1)) : createCommentVNode("v-if", true)
@@ -54,15 +54,20 @@ export declare const areas: readonly {
54
54
  export declare const searchVal: import("vue").Ref<string>;
55
55
  export declare const selectState: {
56
56
  multipleChecked: any;
57
- departmentChecked: string[];
58
57
  multipDepartment: string[];
58
+ dataMap: Map<string, any>;
59
+ curlistKeys: Set<string>;
60
+ fetchLoading: boolean;
61
+ searched: boolean;
62
+ };
63
+ export declare const vairedState: {
64
+ departmentChecked: string[];
59
65
  staffsChecked: any;
60
66
  shopChecked: any;
61
67
  groupChecked: any;
62
68
  dataMap: Map<string, any>;
63
- curlistKeys: Set<string>;
64
69
  activeKey: number;
65
- fetchLoading: boolean;
70
+ curlistKeys: Set<string>;
66
71
  searched: boolean;
67
72
  };
68
73
  export declare const list: any;
@@ -9,16 +9,12 @@ declare const _default: import("vue").DefineComponent<{
9
9
  };
10
10
  }, {
11
11
  search(): void;
12
+ treeRef: import("vue").Ref<any>;
12
13
  list: any;
13
14
  multipleChecked: import("vue").Ref<any>;
14
- departmentChecked: import("vue").Ref<string[]>;
15
15
  multipDepartment: import("vue").Ref<string[]>;
16
- staffsChecked: import("vue").Ref<any>;
17
- shopChecked: import("vue").Ref<any>;
18
- groupChecked: import("vue").Ref<any>;
19
16
  dataMap: import("vue").Ref<Map<string, any>>;
20
17
  curlistKeys: import("vue").Ref<Set<string>>;
21
- activeKey: import("vue").Ref<number>;
22
18
  fetchLoading: import("vue").Ref<boolean>;
23
19
  searched: import("vue").Ref<boolean>;
24
20
  searchVal: import("vue").Ref<string>;