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