cnhis-design-vue 3.3.3-beta.1 → 3.3.3-beta.10
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/README.md +87 -87
- package/es/components/audio-sdk/src/Index.vue2.js +7 -7
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/recording.vue2.js +16 -2
- package/es/components/big-table/src/components/NoData.vue2.js +8 -1
- package/es/components/big-table/src/hooks/useTableParse.js +8 -1
- package/es/components/button-print/index.d.ts +2 -1
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +2 -1
- package/es/components/button-print/src/ButtonPrint.vue2.js +6 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +8 -5
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +4 -1
- package/es/components/button-print/src/utils/print.d.ts +2 -2
- package/es/components/button-print/src/utils/print.js +29 -20
- package/es/components/card-reader-sdk-cn/src/henan/index.js +8 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/expand-field/index.d.ts +639 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +639 -0
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +639 -0
- package/es/components/expand-field/src/components/form.vue.d.ts +639 -0
- package/es/components/expand-field/src/components/form.vue2.js +8 -1
- package/es/components/expand-field/src/index.vue.d.ts +639 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +8 -1
- package/es/components/form-render/src/components/renderer/formItem.js +8 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +8 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +8 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +16 -2
- package/es/components/scale-view/index.d.ts +26 -15
- package/es/components/scale-view/src/ScaleView.vue.d.ts +26 -15
- package/es/components/scale-view/src/ScaleView.vue2.js +13 -7
- package/es/components/scale-view/src/components/AnswerParse.vue.d.ts +5 -0
- package/es/components/scale-view/src/components/AnswerParse.vue2.js +74 -8
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +10 -7
- package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +28 -4
- package/es/components/scale-view/src/components/EvaluatePage.vue.d.ts +10 -7
- package/es/components/scale-view/src/components/EvaluatePage.vue2.js +29 -8
- package/es/components/scale-view/src/components/NoData.vue2.js +9 -3
- package/es/components/scale-view/src/components/ScaleScore.d.ts +1 -1
- package/es/components/scale-view/src/components/ScaleScore.js +47 -4
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +20 -2
- package/es/components/scale-view/src/components/formitem/r-radio.js +2 -0
- package/es/components/scale-view/src/components/formitem/r-sign.js +32 -4
- package/es/components/scale-view/src/components/formitem/r-upload.js +65 -7
- package/es/components/scale-view/src/components/formitem/sign-com.js +8 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +20 -5
- package/es/components/scale-view/src/hooks/scaleview-init.js +24 -3
- package/es/components/scale-view/src/hooks/scaleview-methods.js +40 -5
- package/es/components/scale-view/src/hooks/scaleview-submit.js +64 -8
- package/es/components/scale-view/src/hooks/scaleview-validate.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +157 -24
- package/es/components/scale-view/src/hooks/use-evaluate.js +16 -2
- package/es/components/scale-view/src/hooks/use-noData.js +33 -5
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-person/index.d.ts +639 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +305 -347
- package/es/components/select-person/src/SelectPerson.vue2.js +477 -678
- package/es/components/select-person/src/SelectPersonRole.vue.d.ts +630 -0
- package/es/components/select-person/src/SelectPersonRole.vue.js +6 -0
- package/es/components/select-person/src/SelectPersonRole.vue2.js +942 -0
- package/es/components/select-person/src/SelectPersonTest.vue.d.ts +555 -0
- package/es/components/select-person/src/components/SearchGroupList.vue.d.ts +132 -0
- package/es/components/select-person/src/components/SearchGroupList.vue.js +6 -0
- package/es/components/select-person/src/components/SearchGroupList.vue2.js +116 -0
- package/es/components/select-person/src/components/SearchMultiple.vue2.js +1 -1
- package/es/components/select-person/src/components/SearchOrgAndStaff.vue2.js +21 -12
- package/es/components/select-person/src/index.vue.d.ts +639 -0
- package/es/components/select-person/src/index.vue2.js +15 -2
- package/es/components/select-person/src/types/index.d.ts +35 -0
- package/es/components/select-person/src/types/index.js +1 -0
- package/es/components/select-person/src/utils/index.d.ts +1 -0
- package/es/components/select-person/src/utils/index.js +6 -8
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/vod-chunk-upload/index.d.ts +3 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.d.ts +1 -29
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +109 -11
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +15 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +72 -9
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +3 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +75 -9
- package/es/env.d.ts +25 -25
- package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import { defineComponent, inject, ref,
|
|
2
|
-
import { NGrid, NGi,
|
|
1
|
+
import { defineComponent, inject, ref, shallowRef, computed, watch, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, normalizeStyle, createCommentVNode, renderSlot, withKeys, createTextVNode, toDisplayString, withDirectives, vShow, createElementBlock, mergeProps, Fragment, renderList } from 'vue';
|
|
2
|
+
import { useMessage, NGrid, NGi, NInputGroup, NInput, NButton, NCheckbox, NTree, NSpace, NIcon } from 'naive-ui';
|
|
3
3
|
import { CloseCircleSharp } from '@vicons/ionicons5';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import SearchOrgAndStaff from './components/SearchOrgAndStaff.vue.js';
|
|
4
|
+
import { searchBasisTree } from './utils/index.js';
|
|
5
|
+
import { union, remove } from 'lodash-es';
|
|
6
|
+
import SearchGroupList from './components/SearchGroupList.vue.js';
|
|
7
|
+
import DefaultPage from '../../default-page/index.js';
|
|
9
8
|
import { InjectionSelectPersonEmits } from './constants/index.js';
|
|
10
9
|
|
|
11
10
|
const _hoisted_1 = {
|
|
12
11
|
class: "search-box"
|
|
13
12
|
};
|
|
14
13
|
const _hoisted_2 = {
|
|
15
|
-
key:
|
|
16
|
-
class: "select-
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "c-select-person__hide"
|
|
17
16
|
};
|
|
18
17
|
const _hoisted_3 = {
|
|
19
|
-
key:
|
|
20
|
-
class: "tree-content"
|
|
18
|
+
key: 0
|
|
21
19
|
};
|
|
22
20
|
const _hoisted_4 = {
|
|
23
|
-
|
|
21
|
+
class: "c-select-person__containerRight"
|
|
24
22
|
};
|
|
25
23
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
26
24
|
__name: "SelectPerson",
|
|
@@ -95,22 +93,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
95
93
|
type: Function,
|
|
96
94
|
default: () => Promise.resolve([])
|
|
97
95
|
},
|
|
98
|
-
showSelectType: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
default: false
|
|
101
|
-
},
|
|
102
|
-
roleData: {
|
|
103
|
-
type: Array,
|
|
104
|
-
default: () => []
|
|
105
|
-
},
|
|
106
|
-
roleFields: {
|
|
107
|
-
type: Object,
|
|
108
|
-
default: () => ({
|
|
109
|
-
label: "name",
|
|
110
|
-
key: "id",
|
|
111
|
-
children: "children"
|
|
112
|
-
})
|
|
113
|
-
},
|
|
114
96
|
forceShowSelectAll: {
|
|
115
97
|
type: Boolean
|
|
116
98
|
},
|
|
@@ -119,532 +101,336 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
119
101
|
},
|
|
120
102
|
onlyForwardCascade: {
|
|
121
103
|
type: Boolean
|
|
104
|
+
},
|
|
105
|
+
height: {
|
|
106
|
+
type: String
|
|
107
|
+
},
|
|
108
|
+
hideLeaf: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
112
|
+
itemKey: {
|
|
113
|
+
type: Function,
|
|
114
|
+
default: void 0
|
|
122
115
|
}
|
|
123
116
|
},
|
|
124
117
|
setup(__props, {
|
|
125
118
|
expose
|
|
126
119
|
}) {
|
|
127
120
|
const props = __props;
|
|
128
|
-
const
|
|
129
|
-
isOpen: false,
|
|
130
|
-
multiple: false,
|
|
131
|
-
customTitles: [function() {
|
|
132
|
-
var _a, _b, _c;
|
|
133
|
-
try {
|
|
134
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.510")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.510")) || "\u8054\u7CFB\u4EBA";
|
|
135
|
-
} catch (e) {
|
|
136
|
-
return "\u8054\u7CFB\u4EBA";
|
|
137
|
-
}
|
|
138
|
-
}(), function() {
|
|
139
|
-
var _a, _b, _c;
|
|
140
|
-
try {
|
|
141
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.511")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.511")) || "\u90E8\u95E8";
|
|
142
|
-
} catch (e) {
|
|
143
|
-
return "\u90E8\u95E8";
|
|
144
|
-
}
|
|
145
|
-
}()],
|
|
146
|
-
itemHeight: 250
|
|
147
|
-
};
|
|
148
|
-
const labelList = [{
|
|
149
|
-
key: "main",
|
|
150
|
-
label: function() {
|
|
151
|
-
var _a, _b, _c;
|
|
152
|
-
try {
|
|
153
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.512")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.512")) || "\u9009\u4EBA\u5458";
|
|
154
|
-
} catch (e) {
|
|
155
|
-
return "\u9009\u4EBA\u5458";
|
|
156
|
-
}
|
|
157
|
-
}()
|
|
158
|
-
}, {
|
|
159
|
-
key: "dept",
|
|
160
|
-
label: function() {
|
|
161
|
-
var _a, _b, _c;
|
|
162
|
-
try {
|
|
163
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.513")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.513")) || "\u9009\u79D1\u5BA4";
|
|
164
|
-
} catch (e) {
|
|
165
|
-
return "\u9009\u79D1\u5BA4";
|
|
166
|
-
}
|
|
167
|
-
}()
|
|
168
|
-
}, {
|
|
169
|
-
key: "role",
|
|
170
|
-
label: function() {
|
|
171
|
-
var _a, _b, _c;
|
|
172
|
-
try {
|
|
173
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.514")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.514")) || "\u9009\u89D2\u8272";
|
|
174
|
-
} catch (e) {
|
|
175
|
-
return "\u9009\u89D2\u8272";
|
|
176
|
-
}
|
|
177
|
-
}()
|
|
178
|
-
}];
|
|
179
|
-
const labelListName = {
|
|
180
|
-
dept: function() {
|
|
181
|
-
var _a, _b, _c;
|
|
182
|
-
try {
|
|
183
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.202")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.202")) || "\u79D1\u5BA4";
|
|
184
|
-
} catch (e) {
|
|
185
|
-
return "\u79D1\u5BA4";
|
|
186
|
-
}
|
|
187
|
-
}(),
|
|
188
|
-
role: function() {
|
|
189
|
-
var _a, _b, _c;
|
|
190
|
-
try {
|
|
191
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.515")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.515")) || "\u89D2\u8272";
|
|
192
|
-
} catch (e) {
|
|
193
|
-
return "\u89D2\u8272";
|
|
194
|
-
}
|
|
195
|
-
}()
|
|
196
|
-
};
|
|
121
|
+
const $message = useMessage();
|
|
197
122
|
const emit = inject(InjectionSelectPersonEmits);
|
|
198
123
|
const keyword = ref("");
|
|
199
124
|
const checkedAll = ref(false);
|
|
200
125
|
const checkedKeys = ref([]);
|
|
201
126
|
const expandedKeys = ref([]);
|
|
202
|
-
const treeData =
|
|
203
|
-
const
|
|
204
|
-
const
|
|
127
|
+
const treeData = shallowRef([]);
|
|
128
|
+
const treeAsyncData = ref([]);
|
|
129
|
+
const searchTreeData = shallowRef([]);
|
|
130
|
+
const searchData = shallowRef([]);
|
|
131
|
+
const treeMap = /* @__PURE__ */ new Map();
|
|
205
132
|
const isSearch = ref(false);
|
|
206
|
-
const
|
|
133
|
+
const remoteDefaultList = ref([]);
|
|
207
134
|
const isRemote = computed(() => props.queryLoadChildData ? true : false);
|
|
208
135
|
const checkStrategyResult = computed(() => {
|
|
209
136
|
var _a, _b;
|
|
210
137
|
return (_b = (_a = props == null ? void 0 : props.treeSetting) == null ? void 0 : _a.checkStrategy) != null ? _b : "child";
|
|
211
138
|
});
|
|
212
139
|
const isSearchFilter = computed(() => (props == null ? void 0 : props.searchFilter) && Object.keys(props == null ? void 0 : props.searchFilter).length > 0);
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return {
|
|
217
|
-
...cloneDeep(searchFilterBase),
|
|
218
|
-
...props.searchFilter
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return cloneDeep(searchFilterBase);
|
|
140
|
+
const isShowGroupList = computed(() => {
|
|
141
|
+
const isInnerMultiple = (props == null ? void 0 : props.searchInner) && (props == null ? void 0 : props.multiple);
|
|
142
|
+
return checkStrategyResult.value === "parent" && (isSearchFilter.value || isInnerMultiple);
|
|
222
143
|
});
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
return
|
|
226
|
-
});
|
|
227
|
-
const styleObject = computed(() => {
|
|
228
|
-
return {
|
|
229
|
-
height: props.multiple ? "342px" : "308px"
|
|
230
|
-
};
|
|
144
|
+
const showType = computed(() => {
|
|
145
|
+
const isInnerMultiple = (props == null ? void 0 : props.searchInner) && (props == null ? void 0 : props.multiple);
|
|
146
|
+
return isSearchFilter.value ? "searchGroup" : isInnerMultiple ? "searchChild" : "";
|
|
231
147
|
});
|
|
232
148
|
const caculateTagData = computed(() => {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
return item[attrType.value] == SelectRoleEnumsConfig.STAFF && !item[props.uncheckableField];
|
|
239
|
-
});
|
|
240
|
-
const deptItems = checkedTagsMiddle.dept.filter((item) => {
|
|
241
|
-
item.itemType = SelectItemTypesConfig.DEPT;
|
|
242
|
-
if (!props.uncheckableField)
|
|
243
|
-
return item[attrType.value] == SelectRoleEnumsConfig.DEPT;
|
|
244
|
-
return item[attrType.value] == SelectRoleEnumsConfig.DEPT && !item[props.uncheckableField];
|
|
245
|
-
});
|
|
246
|
-
const roleItems = checkedTagsMiddle.role.filter((item) => {
|
|
247
|
-
item.itemType = SelectItemTypesConfig.ROLE;
|
|
248
|
-
if (!props.uncheckableField)
|
|
249
|
-
return item;
|
|
250
|
-
return !item[props.uncheckableField];
|
|
251
|
-
});
|
|
252
|
-
return uniqArrObj([...mainItems, ...deptItems, ...roleItems], "key");
|
|
149
|
+
const re = checkedKeys.value.map((key) => {
|
|
150
|
+
return treeMap.get(key);
|
|
151
|
+
}).filter((tag) => !props.uncheckableField || props.uncheckableField && !tag.originItem[props.uncheckableField]);
|
|
152
|
+
if (isRemote.value) {
|
|
153
|
+
return [...remoteDefaultList.value, ...re];
|
|
253
154
|
}
|
|
254
|
-
|
|
255
|
-
checkedKeys.value.forEach((key) => {
|
|
256
|
-
for (let i = 0, len = tagData.value.length; i < len; i++) {
|
|
257
|
-
const tag = tagData.value[i];
|
|
258
|
-
if (tag.key == key) {
|
|
259
|
-
if (!props.uncheckableField || props.uncheckableField && !tag.originItem[props.uncheckableField])
|
|
260
|
-
lasetTagData.push(tag);
|
|
261
|
-
break;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
return lasetTagData;
|
|
266
|
-
});
|
|
267
|
-
const treeDataMiddle = reactive({
|
|
268
|
-
main: [],
|
|
269
|
-
dept: [],
|
|
270
|
-
role: [],
|
|
271
|
-
temp: []
|
|
272
|
-
});
|
|
273
|
-
const checkedKeysMiddle = reactive({
|
|
274
|
-
main: [],
|
|
275
|
-
dept: [],
|
|
276
|
-
role: []
|
|
155
|
+
return re;
|
|
277
156
|
});
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
157
|
+
const renderTreeData = computed(() => {
|
|
158
|
+
if (isRemote.value)
|
|
159
|
+
return treeAsyncData.value;
|
|
160
|
+
if (isSearch.value && !isShowGroupList.value)
|
|
161
|
+
return searchTreeData.value;
|
|
162
|
+
return treeData.value;
|
|
282
163
|
});
|
|
283
|
-
|
|
284
|
-
main: [],
|
|
285
|
-
dept: [],
|
|
286
|
-
role: []
|
|
287
|
-
});
|
|
288
|
-
const attrType = computed(() => {
|
|
164
|
+
function initTreeData() {
|
|
289
165
|
var _a;
|
|
290
|
-
|
|
291
|
-
});
|
|
292
|
-
const keyStr = computed(() => props.wordbookChild.user_id_obj || props.wordbook.parent_id_obj || Date.now());
|
|
293
|
-
function getTreeDataMiddleData() {
|
|
294
|
-
const tempData = cloneDeep(transformData(props.data));
|
|
295
|
-
treeDataMiddle.main = treeDataMiddle.temp = tempData;
|
|
296
|
-
getMainData(treeDataMiddle.temp, null, (tree) => {
|
|
297
|
-
allCheckedKeysMiddle.main.push(tree.key);
|
|
298
|
-
});
|
|
299
|
-
allCheckedTreeKeys.value = allCheckedKeysMiddle.main;
|
|
300
|
-
treeDataMiddle.dept = getDeptData(cloneDeep(tempData), (tree) => {
|
|
301
|
-
allCheckedKeysMiddle.dept.push(tree.key);
|
|
302
|
-
});
|
|
303
|
-
treeDataMiddle.role = getRoleData(cloneDeep(props.roleData), (tree) => {
|
|
304
|
-
allCheckedKeysMiddle.role.push(tree.key);
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
function getDeptData(list, cb) {
|
|
308
|
-
return list.filter((item) => {
|
|
309
|
-
var _a;
|
|
310
|
-
if (props.showSelectType && ((_a = item.children) == null ? void 0 : _a.length)) {
|
|
311
|
-
item.children = getDeptData(item.children, cb);
|
|
312
|
-
}
|
|
313
|
-
const isFilter = item[attrType.value] == SelectRoleEnumsConfig.DEPT;
|
|
314
|
-
if (isFilter) {
|
|
315
|
-
setAllCheckedKeys(item, cb);
|
|
316
|
-
}
|
|
317
|
-
return isFilter;
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
function getRoleData(list, cb) {
|
|
166
|
+
treeMap.clear();
|
|
321
167
|
const {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
168
|
+
itemKey,
|
|
169
|
+
hideLeaf
|
|
170
|
+
} = props;
|
|
171
|
+
const tempData = transformData(props.data, null, {
|
|
172
|
+
enter(node) {
|
|
173
|
+
node.key = itemKey ? itemKey(node.originItem) : node.key;
|
|
174
|
+
treeMap.set(node.key, node);
|
|
175
|
+
},
|
|
176
|
+
leave: hideLeaf ? (node) => {
|
|
177
|
+
var _a2;
|
|
178
|
+
if (!node.leaf && ((_a2 = node.children) == null ? void 0 : _a2.length)) {
|
|
179
|
+
const children = node.children.filter((val) => !val.leaf);
|
|
180
|
+
node.children = children.length ? children : void 0;
|
|
181
|
+
}
|
|
182
|
+
} : void 0
|
|
335
183
|
});
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
function setSelectTagData(tree, operatorType) {
|
|
344
|
-
var _a, _b;
|
|
345
|
-
const keyName = ["main", "dept"].includes(operatorType) ? keyStr.value : (_a = props.roleFields) == null ? void 0 : _a.key;
|
|
346
|
-
for (let i = 0, len = tree.length; i < len; i++) {
|
|
347
|
-
const item = tree[i];
|
|
348
|
-
const initTagKeys = initTagData.value.map((tag) => tag.key);
|
|
349
|
-
checkedKeysMiddle[operatorType].includes(item.key) && !initTagKeys.includes(item.key) && checkedTagsMiddle[operatorType].push({
|
|
350
|
-
...item,
|
|
351
|
-
key: item[keyName]
|
|
184
|
+
isRemote.value ? treeAsyncData.value = tempData.treeItems : treeData.value = tempData.treeItems;
|
|
185
|
+
if (isRemote.value) {
|
|
186
|
+
remoteDefaultList.value = (_a = props == null ? void 0 : props.defaultList) == null ? void 0 : _a.map((tag) => {
|
|
187
|
+
return {
|
|
188
|
+
...tag,
|
|
189
|
+
label: tag.name
|
|
190
|
+
};
|
|
352
191
|
});
|
|
353
|
-
((_b = item.children) == null ? void 0 : _b.length) && setSelectTagData(item.children, operatorType);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
function uniqArrObj(arr, name) {
|
|
357
|
-
let obj = {};
|
|
358
|
-
return arr.reduce((cur, next) => {
|
|
359
|
-
obj[next[name]] ? "" : obj[next[name]] = cur.push(next);
|
|
360
|
-
return cur;
|
|
361
|
-
}, []);
|
|
362
|
-
}
|
|
363
|
-
function init() {
|
|
364
|
-
getTreeDataMiddleData();
|
|
365
|
-
treeData.value = treeDataMiddle.temp;
|
|
366
|
-
if (props.defaultList.length > 0) {
|
|
367
|
-
if (isRemote.value) {
|
|
368
|
-
props.defaultList.forEach((key) => checkedKeys.value.push(key.key));
|
|
369
|
-
tagData.value = cloneDeep(props.defaultList);
|
|
370
|
-
initTagData.value = cloneDeep(props.defaultList);
|
|
371
|
-
} else {
|
|
372
|
-
if (props.showSelectType) {
|
|
373
|
-
const curType = curSelectKey.value;
|
|
374
|
-
props.defaultList.forEach((tag) => {
|
|
375
|
-
if (tag["itemType"] === SelectItemTypesConfig.PERSON) {
|
|
376
|
-
checkedKeysMiddle.main.push(tag[keyStr.value]);
|
|
377
|
-
checkedTagsMiddle.main.push(tag);
|
|
378
|
-
}
|
|
379
|
-
if (tag["itemType"] === SelectItemTypesConfig.DEPT) {
|
|
380
|
-
checkedKeysMiddle.dept.push(tag[keyStr.value]);
|
|
381
|
-
checkedTagsMiddle.dept.push(tag);
|
|
382
|
-
}
|
|
383
|
-
if (tag["itemType"] === SelectItemTypesConfig.ROLE) {
|
|
384
|
-
checkedKeysMiddle.role.push(tag[props.roleFields.key]);
|
|
385
|
-
checkedTagsMiddle.role.push(tag);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
checkedKeys.value = checkedKeysMiddle[curType];
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
props.defaultList.forEach((key) => checkedKeys.value.push(key));
|
|
392
|
-
setTagData(treeDataMiddle.temp);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
function getMainData(tree, parentNode, cb) {
|
|
397
|
-
var _a, _b;
|
|
398
|
-
for (let i = 0, len = tree.length; i < len; i++) {
|
|
399
|
-
const item = tree[i];
|
|
400
|
-
let title_expand_strs = wordbookChildExpandkeys.value.reduce((acc, current) => {
|
|
401
|
-
const currentValue = item[current] ? `${item[current]}\uFF0C` : "";
|
|
402
|
-
return acc + currentValue;
|
|
403
|
-
}, "");
|
|
404
|
-
item.title_expand_strs = title_expand_strs.slice(0, -1);
|
|
405
|
-
item.title = getLabelName(item);
|
|
406
|
-
item.label = getLabelName(item);
|
|
407
|
-
item.parentNode = parentNode;
|
|
408
|
-
if (!item.key)
|
|
409
|
-
item.key = item[props.wordbookChild.user_id_obj] || item[props.wordbook.parent_id_obj] || Date.now();
|
|
410
|
-
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
411
|
-
getMainData(item.children, item, cb);
|
|
412
|
-
setDisabled(item);
|
|
413
|
-
} else if (((_b = item.children) == null ? void 0 : _b.length) === 0) {
|
|
414
|
-
Reflect.deleteProperty(item, "children");
|
|
415
|
-
}
|
|
416
|
-
setAllCheckedKeys(item, cb);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
function setAllCheckedKeys(tree, cb) {
|
|
420
|
-
var _a, _b;
|
|
421
|
-
const checkStrategy = (_b = (_a = props == null ? void 0 : props.treeSetting) == null ? void 0 : _a.checkStrategy) != null ? _b : "child";
|
|
422
|
-
switch (checkStrategy) {
|
|
423
|
-
case "child":
|
|
424
|
-
setAllCheckedKeysWithChild(tree, cb);
|
|
425
|
-
break;
|
|
426
|
-
case "parent":
|
|
427
|
-
setAllCheckedKeysWithParent(tree, cb);
|
|
428
|
-
break;
|
|
429
|
-
case "all":
|
|
430
|
-
setAllCheckedKeysWithAll(tree, cb);
|
|
431
|
-
break;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
function setAllCheckedKeysWithChild(item, cb) {
|
|
435
|
-
if (!item.disabled && !item.children && item.key) {
|
|
436
|
-
cb && cb(item);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
function setAllCheckedKeysWithParent(item, cb) {
|
|
440
|
-
if (!item.disabled && !item.tempTitle && item.key) {
|
|
441
|
-
cb && cb(item);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
function setAllCheckedKeysWithAll(item, cb) {
|
|
445
|
-
if (!item.disabled && item.key) {
|
|
446
|
-
cb && cb(item);
|
|
447
192
|
}
|
|
193
|
+
checkedKeys.value = props.defaultList.filter((k) => treeMap.has(k));
|
|
448
194
|
}
|
|
449
195
|
async function queryLoadChildNode(node) {
|
|
196
|
+
var _a;
|
|
450
197
|
if (props.queryLoadChildData) {
|
|
198
|
+
const {
|
|
199
|
+
itemKey,
|
|
200
|
+
hideLeaf
|
|
201
|
+
} = props;
|
|
451
202
|
const curNode = await props.queryLoadChildData(node);
|
|
452
|
-
if (curNode.children) {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
}
|
|
203
|
+
if ((_a = curNode == null ? void 0 : curNode.children) == null ? void 0 : _a.length) {
|
|
204
|
+
const tempData = transformData(curNode.children, curNode, {
|
|
205
|
+
enter(node2) {
|
|
206
|
+
node2.key = itemKey ? itemKey(node2.originItem) : node2.key;
|
|
207
|
+
treeMap.set(node2.key, node2);
|
|
208
|
+
},
|
|
209
|
+
leave: hideLeaf ? (node2) => {
|
|
210
|
+
var _a2;
|
|
211
|
+
if (!node2.leaf && ((_a2 = node2.children) == null ? void 0 : _a2.length)) {
|
|
212
|
+
const children = node2.children.filter((val) => !val.leaf);
|
|
213
|
+
node2.children = children.length ? children : void 0;
|
|
214
|
+
}
|
|
215
|
+
} : void 0
|
|
458
216
|
});
|
|
217
|
+
curNode.children = tempData.treeItems;
|
|
459
218
|
}
|
|
460
219
|
return curNode;
|
|
461
220
|
}
|
|
462
221
|
return node;
|
|
463
222
|
}
|
|
464
|
-
function setDisabled(data) {
|
|
465
|
-
var _a;
|
|
466
|
-
const isDisabled = (_a = data.children) == null ? void 0 : _a.every((item) => item.disabled);
|
|
467
|
-
if (isDisabled)
|
|
468
|
-
data.disabled = true;
|
|
469
|
-
}
|
|
470
223
|
function renderLabel({
|
|
471
224
|
option
|
|
472
225
|
}) {
|
|
473
226
|
var _a, _b;
|
|
474
|
-
if (((_a = option.children) == null ? void 0 : _a.length) || isRemote.value && !(option == null ? void 0 : option.
|
|
475
|
-
const
|
|
476
|
-
const
|
|
477
|
-
const labelStr = `${option.title}${countText}`;
|
|
227
|
+
if (((_a = option.children) == null ? void 0 : _a.length) || isRemote.value && !(option == null ? void 0 : option.leaf)) {
|
|
228
|
+
const countText = option.count ? `(${option.count})` : "";
|
|
229
|
+
const labelStr = `${option.label}${countText}`;
|
|
478
230
|
return createVNode("span", {
|
|
479
231
|
"title": labelStr
|
|
480
232
|
}, [labelStr]);
|
|
481
233
|
} else {
|
|
482
|
-
const
|
|
234
|
+
const labelExpand = (_b = option.labelExpand) != null ? _b : "";
|
|
483
235
|
return createVNode("p", {
|
|
484
236
|
"class": "user_item"
|
|
485
237
|
}, [createVNode("span", {
|
|
486
|
-
"title": option.
|
|
487
|
-
}, [option.
|
|
238
|
+
"title": option.label
|
|
239
|
+
}, [option.label]), createVNode("span", {
|
|
488
240
|
"class": "user_item_expand",
|
|
489
|
-
"title":
|
|
490
|
-
}, [
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
function getLabelName(option) {
|
|
494
|
-
return option[props.wordbookChild.user_name_obj] || option[props.wordbook.parent_name_obj] || option["orgName"] || option["title"] || "";
|
|
495
|
-
}
|
|
496
|
-
function transformData(trees) {
|
|
497
|
-
var _a;
|
|
498
|
-
for (let index = 0, len = trees.length; index < len; index++) {
|
|
499
|
-
const tree = trees[index];
|
|
500
|
-
const childrenKey = props.wordbook.children || "children";
|
|
501
|
-
if ((_a = tree[childrenKey]) == null ? void 0 : _a.length) {
|
|
502
|
-
const items = calculateRootItems(tree[childrenKey], []);
|
|
503
|
-
tree.innerItemsNum = items.length;
|
|
504
|
-
tree.innerLeafs = items;
|
|
505
|
-
tree.children = transformData(tree[childrenKey]);
|
|
506
|
-
}
|
|
241
|
+
"title": labelExpand
|
|
242
|
+
}, [labelExpand])]);
|
|
507
243
|
}
|
|
508
|
-
if (!props.showSelectType)
|
|
509
|
-
return transformParentNodeName(trees, "");
|
|
510
|
-
return trees;
|
|
511
244
|
}
|
|
512
|
-
function
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
245
|
+
function transformData(trees, parentNode, visitor) {
|
|
246
|
+
const {
|
|
247
|
+
children: childrenKey = "children",
|
|
248
|
+
parent_id_obj = "key",
|
|
249
|
+
parent_name_obj = "label",
|
|
250
|
+
user_count_obj = "count",
|
|
251
|
+
empty_enable
|
|
252
|
+
} = props.wordbook;
|
|
253
|
+
const {
|
|
254
|
+
user_id_obj,
|
|
255
|
+
user_name_obj,
|
|
256
|
+
leaf_field,
|
|
257
|
+
leaf_value,
|
|
258
|
+
user_expand_keys
|
|
259
|
+
} = props.wordbookChild;
|
|
260
|
+
let leafCount = 0;
|
|
261
|
+
const {
|
|
262
|
+
label: parentLabel = "",
|
|
263
|
+
parentName = "",
|
|
264
|
+
disabled,
|
|
265
|
+
key: parentKey
|
|
266
|
+
} = parentNode || {};
|
|
267
|
+
const {
|
|
268
|
+
enter,
|
|
269
|
+
leave
|
|
270
|
+
} = visitor || {};
|
|
271
|
+
const treeItems = trees.map((item) => {
|
|
272
|
+
const children = item[childrenKey];
|
|
273
|
+
const isLeaf = item.isLeaf !== void 0 ? item.isLeaf : leaf_field && leaf_value ? item[leaf_field] === leaf_value : !Array.isArray(children) || (children == null ? void 0 : children.length) === 0;
|
|
274
|
+
const tree = {
|
|
275
|
+
key: item[parent_id_obj] || item[user_id_obj] || (item == null ? void 0 : item.key),
|
|
276
|
+
label: item[parent_name_obj] || item[user_name_obj] || (item == null ? void 0 : item.title),
|
|
277
|
+
name: item[parent_name_obj] || item[user_name_obj] || (item == null ? void 0 : item.title),
|
|
278
|
+
count: item[user_count_obj],
|
|
279
|
+
labelExpand: "",
|
|
280
|
+
parentKey,
|
|
281
|
+
parentName: parentLabel + (parentName ? parentLabel ? `/${parentName}` : parentName : ""),
|
|
282
|
+
innerItemsNum: 0,
|
|
283
|
+
children: void 0,
|
|
284
|
+
originItem: item,
|
|
285
|
+
leaf: isLeaf,
|
|
286
|
+
disabled: disabled || item.disabled
|
|
287
|
+
};
|
|
288
|
+
if (isRemote.value)
|
|
289
|
+
tree.isLeaf = isLeaf;
|
|
290
|
+
enter && enter(tree);
|
|
291
|
+
if (isLeaf) {
|
|
292
|
+
if (Array.isArray(user_expand_keys)) {
|
|
293
|
+
tree.labelExpand = user_expand_keys.reduce((acc, key) => {
|
|
294
|
+
const str = item[key];
|
|
295
|
+
return str ? acc ? `${acc}\uFF0C${str}` : str : acc;
|
|
296
|
+
}, "");
|
|
297
|
+
}
|
|
298
|
+
!tree.disabled && leafCount++;
|
|
518
299
|
} else {
|
|
519
|
-
|
|
300
|
+
if (children == null ? void 0 : children.length) {
|
|
301
|
+
const childData = transformData(children, tree, visitor);
|
|
302
|
+
if (childData.treeItems.length) {
|
|
303
|
+
tree.children = childData.treeItems;
|
|
304
|
+
}
|
|
305
|
+
tree.innerItemsNum += childData.leafCount;
|
|
306
|
+
leafCount += tree.innerItemsNum;
|
|
307
|
+
}
|
|
308
|
+
if (!empty_enable && tree.innerItemsNum == 0 && !isRemote.value)
|
|
309
|
+
tree.disabled = true;
|
|
520
310
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
function transformParentNodeName(trees, tempContent) {
|
|
525
|
-
if (!trees || trees.length === 0)
|
|
526
|
-
return [];
|
|
527
|
-
return trees.map((tree) => {
|
|
528
|
-
var _a;
|
|
529
|
-
const tempName = getLabelName(tree);
|
|
530
|
-
const tempTitle = tempContent ? `${tempName}/${tempContent}` : tempName;
|
|
531
|
-
return {
|
|
532
|
-
...tree,
|
|
533
|
-
tempTitle: tempContent,
|
|
534
|
-
children: ((_a = tree.children) == null ? void 0 : _a.length) ? transformParentNodeName(tree == null ? void 0 : tree.children, tempTitle) : []
|
|
535
|
-
};
|
|
311
|
+
leave && leave(tree);
|
|
312
|
+
return tree;
|
|
536
313
|
});
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
[SearchTypeConfig.SEARCH_ORG_STAFF]: isSearchFilter.value,
|
|
541
|
-
[SearchTypeConfig.SEARCH_ORG]: props.searchInner
|
|
314
|
+
return {
|
|
315
|
+
treeItems,
|
|
316
|
+
leafCount
|
|
542
317
|
};
|
|
543
|
-
const result = Object.keys(settings).find((attr) => settings[attr]);
|
|
544
|
-
return result != null ? result : "";
|
|
545
318
|
}
|
|
546
319
|
async function onSearch() {
|
|
547
|
-
var _a, _b;
|
|
320
|
+
var _a, _b, _c, _d;
|
|
548
321
|
const filterKey = (_b = (_a = props == null ? void 0 : props.wordbook) == null ? void 0 : _a.filter_key) != null ? _b : "keyword";
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
treeData.value = await props.queryTreeSearch(keyword.value);
|
|
555
|
-
}
|
|
556
|
-
expandedKeys.value = treeData.value.length && keyword.value ? getExpandedKeys(treeData.value) : [];
|
|
557
|
-
}
|
|
558
|
-
function setTreeCheckd(tree, checked) {
|
|
559
|
-
switch (checkStrategyResult.value) {
|
|
560
|
-
case "child":
|
|
561
|
-
setCheckdWithChild(tree, checked);
|
|
562
|
-
break;
|
|
563
|
-
case "parent":
|
|
564
|
-
setCheckdWithParent(tree, checked);
|
|
565
|
-
break;
|
|
566
|
-
case "all":
|
|
567
|
-
setCheckdWithAll(tree, checked);
|
|
568
|
-
break;
|
|
322
|
+
const kw = keyword.value.trim();
|
|
323
|
+
isSearch.value = !!kw;
|
|
324
|
+
if (!kw) {
|
|
325
|
+
searchData.value = [];
|
|
326
|
+
return;
|
|
569
327
|
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
328
|
+
function flatFilter(nodes) {
|
|
329
|
+
var _a2, _b2;
|
|
330
|
+
const result = [];
|
|
331
|
+
const stack = [...nodes];
|
|
332
|
+
while (stack.length) {
|
|
333
|
+
const node = stack.pop();
|
|
334
|
+
if (node.disabled)
|
|
335
|
+
continue;
|
|
336
|
+
const label = (_a2 = node.label) != null ? _a2 : "";
|
|
337
|
+
const labelExpand = (_b2 = node.labelExpand) != null ? _b2 : "";
|
|
338
|
+
const originItem = node.originItem;
|
|
339
|
+
const match = label.includes(kw) || labelExpand.includes(kw) || originItem && originItem[filterKey] && String(originItem[filterKey]).includes(kw);
|
|
340
|
+
if (match) {
|
|
341
|
+
result.push({
|
|
342
|
+
...node,
|
|
343
|
+
children: void 0
|
|
344
|
+
});
|
|
577
345
|
}
|
|
578
|
-
if (
|
|
579
|
-
|
|
580
|
-
checkedKeys.value.splice(keyIndex, 1);
|
|
346
|
+
if (node.children && node.children.length > 0) {
|
|
347
|
+
stack.push(...node.children);
|
|
581
348
|
}
|
|
582
349
|
}
|
|
583
|
-
|
|
350
|
+
return result;
|
|
351
|
+
}
|
|
352
|
+
if (!isRemote.value) {
|
|
353
|
+
if (isSearch.value && !isShowGroupList.value) {
|
|
354
|
+
const filterKey2 = (_d = (_c = props == null ? void 0 : props.wordbook) == null ? void 0 : _c.filter_key) != null ? _d : "keyword";
|
|
355
|
+
const data = searchBasisTree(treeData.value, kw, filterKey2);
|
|
356
|
+
searchTreeData.value = data;
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
const flatResult = flatFilter(treeData.value);
|
|
360
|
+
const parentList = [];
|
|
361
|
+
const childList = [];
|
|
362
|
+
flatResult.forEach((item) => item.leaf ? childList.push(item) : parentList.push(item));
|
|
363
|
+
const searchFilter = {
|
|
364
|
+
...props.searchFilter
|
|
365
|
+
};
|
|
366
|
+
const customTitles = searchFilter.customTitles || [""];
|
|
367
|
+
const values = [childList, parentList];
|
|
368
|
+
searchData.value = customTitles.map((title, i) => ({
|
|
369
|
+
title,
|
|
370
|
+
data: values[i] || []
|
|
371
|
+
})).filter((val) => val.data.length);
|
|
372
|
+
} else {
|
|
373
|
+
const {
|
|
374
|
+
itemKey,
|
|
375
|
+
hideLeaf
|
|
376
|
+
} = props;
|
|
377
|
+
const data = await props.queryTreeSearch(keyword.value);
|
|
378
|
+
const tempData = transformData(data || [], null, {
|
|
379
|
+
enter(node) {
|
|
380
|
+
node.key = itemKey ? itemKey(node.originItem) : node.key;
|
|
381
|
+
treeMap.set(node.key, node);
|
|
382
|
+
},
|
|
383
|
+
leave: hideLeaf ? (node) => {
|
|
384
|
+
var _a2;
|
|
385
|
+
if (!node.leaf && ((_a2 = node.children) == null ? void 0 : _a2.length)) {
|
|
386
|
+
const children = node.children.filter((val) => !val.leaf);
|
|
387
|
+
node.children = children.length ? children : void 0;
|
|
388
|
+
}
|
|
389
|
+
} : void 0
|
|
390
|
+
});
|
|
391
|
+
treeAsyncData.value = tempData.treeItems;
|
|
584
392
|
}
|
|
585
393
|
}
|
|
586
|
-
function
|
|
587
|
-
|
|
394
|
+
function getAllKeys(tree, strategy) {
|
|
395
|
+
const keys = [];
|
|
396
|
+
const recursion = strategy != "parent";
|
|
588
397
|
for (let i = 0, len = tree.length; i < len; i++) {
|
|
589
398
|
const item = tree[i];
|
|
590
|
-
if (!item.disabled &&
|
|
591
|
-
if (
|
|
592
|
-
|
|
399
|
+
if (!item.disabled && item.key) {
|
|
400
|
+
if (!recursion || strategy == "all" || !item.children) {
|
|
401
|
+
keys.push(item.key);
|
|
593
402
|
}
|
|
594
|
-
if (
|
|
595
|
-
|
|
596
|
-
checkedKeys.value.splice(keyIndex, 1);
|
|
403
|
+
if (recursion && item.children) {
|
|
404
|
+
keys.push(...getAllKeys(item.children, strategy));
|
|
597
405
|
}
|
|
598
406
|
}
|
|
599
407
|
}
|
|
408
|
+
return keys;
|
|
600
409
|
}
|
|
601
|
-
function
|
|
410
|
+
function getParentKeys(node, map) {
|
|
602
411
|
var _a;
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
newKeys = union(newKeys, [item.key]);
|
|
609
|
-
} else {
|
|
610
|
-
remove(newKeys, (key) => [item.key].includes(key));
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
614
|
-
const flattenKeys = getFlattenKeys(item.children);
|
|
615
|
-
if (checked) {
|
|
616
|
-
newKeys = union(newKeys, flattenKeys);
|
|
617
|
-
} else {
|
|
618
|
-
remove(newKeys, (key) => flattenKeys.includes(key));
|
|
619
|
-
}
|
|
620
|
-
}
|
|
412
|
+
const parents = [];
|
|
413
|
+
let parentKey = node.parentKey;
|
|
414
|
+
while (parentKey) {
|
|
415
|
+
parents.push(parentKey);
|
|
416
|
+
parentKey = (_a = map.get(parentKey)) == null ? void 0 : _a.parentKey;
|
|
621
417
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
418
|
+
return parents;
|
|
419
|
+
}
|
|
420
|
+
function getTopLevelCheckedKey(node, checked, map) {
|
|
421
|
+
const parent = map.get(node.parentKey);
|
|
422
|
+
if (parent) {
|
|
423
|
+
checked.add(node.key);
|
|
424
|
+
const children = parent.children || [];
|
|
425
|
+
const result = children.every((item) => item.disabled ? true : checked.has(item.key));
|
|
426
|
+
if (result) {
|
|
427
|
+
return getTopLevelCheckedKey(parent, checked, map);
|
|
428
|
+
}
|
|
628
429
|
}
|
|
430
|
+
return node.key;
|
|
629
431
|
}
|
|
630
432
|
function checkedAllChange(checked) {
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
function setTagData(tree) {
|
|
634
|
-
var _a;
|
|
635
|
-
for (let i = 0, len = tree.length; i < len; i++) {
|
|
636
|
-
const item = tree[i];
|
|
637
|
-
const initTagKeys = initTagData.value.map((tag) => tag.key);
|
|
638
|
-
checkedKeys.value.includes(item.key) && !initTagKeys.includes(item.key) && tagData.value.push({
|
|
639
|
-
key: item.key,
|
|
640
|
-
name: item.title,
|
|
641
|
-
parentName: item.tempTitle,
|
|
642
|
-
innerItemsNum: item.innerItemsNum,
|
|
643
|
-
innerLeafs: item.innerLeafs,
|
|
644
|
-
originItem: item
|
|
645
|
-
});
|
|
646
|
-
((_a = item.children) == null ? void 0 : _a.length) && setTagData(item.children);
|
|
647
|
-
}
|
|
433
|
+
checkedKeys.value = checked ? getAllKeys(treeData.value, checkStrategyResult.value) : [];
|
|
648
434
|
}
|
|
649
435
|
function getFlattenKeys(tree) {
|
|
650
436
|
const arr = [];
|
|
@@ -677,105 +463,154 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
677
463
|
}
|
|
678
464
|
}
|
|
679
465
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
return;
|
|
684
|
-
} else {
|
|
685
|
-
checkedKeys.value = newKeys;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
function setCheckedAll() {
|
|
689
|
-
if (props.showSelectType) {
|
|
690
|
-
checkedAll.value = allCheckedTreeKeys.value.every((key) => checkedKeys.value.findIndex((checkedKey) => checkedKey === key) > -1);
|
|
691
|
-
return;
|
|
466
|
+
checkedKeys.value = newKeys;
|
|
467
|
+
if (!keys.length) {
|
|
468
|
+
checkedAll.value = false;
|
|
692
469
|
}
|
|
693
|
-
checkedAll.value = allCheckedTreeKeys.value.every((key) => tagData.value.findIndex((tag) => tag.key === key) > -1);
|
|
694
470
|
}
|
|
695
471
|
function clearAll() {
|
|
696
|
-
|
|
697
|
-
checkedKeysMiddle[key] = checkedTagsMiddle[key] = [];
|
|
698
|
-
});
|
|
472
|
+
checkedAll.value = false;
|
|
699
473
|
checkedKeys.value = [];
|
|
474
|
+
remoteDefaultList.value = [];
|
|
700
475
|
}
|
|
701
|
-
function
|
|
702
|
-
if (
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
if (curSelectKey.value == tagType)
|
|
708
|
-
checkedKeys.value = checkedKeysMiddle[tagType];
|
|
476
|
+
function updateChecked(key, checked) {
|
|
477
|
+
if (isRemote.value) {
|
|
478
|
+
remoteDefaultList.value = remoteDefaultList.value.filter((item) => item.key !== key);
|
|
479
|
+
}
|
|
480
|
+
const node = treeMap.get(key);
|
|
481
|
+
if (!node)
|
|
709
482
|
return;
|
|
483
|
+
if (!props.multiple) {
|
|
484
|
+
return updateTreeChecked(checked ? [key] : [], void 0, {
|
|
485
|
+
node,
|
|
486
|
+
action: checked ? "check" : "uncheck"
|
|
487
|
+
});
|
|
710
488
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
489
|
+
const keys = checkedKeys.value;
|
|
490
|
+
const map = new Set(keys);
|
|
491
|
+
if (checked) {
|
|
492
|
+
const targetKey = getTopLevelCheckedKey(node, new Set(keys), treeMap);
|
|
493
|
+
const allKeys = getAllKeys([treeMap.get(targetKey)], "all");
|
|
494
|
+
if (checkStrategyResult.value === "all") {
|
|
495
|
+
allKeys.forEach((k) => map.add(k));
|
|
496
|
+
} else {
|
|
497
|
+
allKeys.forEach((k) => map.delete(k));
|
|
498
|
+
if (checkStrategyResult.value === "child") {
|
|
499
|
+
getAllKeys([treeMap.get(targetKey)], "child").forEach((k) => map.add(k));
|
|
500
|
+
} else {
|
|
501
|
+
map.add(targetKey);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
} else {
|
|
505
|
+
getParentKeys(node, treeMap).forEach((k) => map.delete(k));
|
|
506
|
+
getAllKeys([treeMap.get(key)], "all").forEach((k) => map.delete(k));
|
|
507
|
+
}
|
|
508
|
+
updateTreeChecked(Array.from(map), void 0, {
|
|
509
|
+
node,
|
|
510
|
+
action: checked ? "check" : "uncheck"
|
|
720
511
|
});
|
|
721
512
|
}
|
|
722
|
-
function
|
|
723
|
-
|
|
724
|
-
if (
|
|
725
|
-
return
|
|
513
|
+
function notifyCheck(key, isChecked = true) {
|
|
514
|
+
const node = treeMap.get(key);
|
|
515
|
+
if (!node)
|
|
516
|
+
return;
|
|
517
|
+
if (!isChecked) {
|
|
518
|
+
updateChecked(key, isChecked);
|
|
519
|
+
return;
|
|
726
520
|
}
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
521
|
+
const has = checkedKeys.value.includes(key);
|
|
522
|
+
if (has) {
|
|
523
|
+
$message.info(`${node.label}\u5DF2\u88AB\u9009\u62E9`);
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
if (node.disabled) {
|
|
527
|
+
$message.info(`${node.label}\u5DF2\u88AB\u7981\u7528`);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
const hasParent = props.multiple && getParentKeys(node, treeMap).find((key2) => checkedKeys.value.includes(key2));
|
|
531
|
+
if (hasParent) {
|
|
532
|
+
$message.info(`${node.label}\u5DF2\u5B58\u5728\u4E8E${treeMap.get(hasParent).label}\u4E2D`);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (!props.multiple) {
|
|
536
|
+
keyword.value = "";
|
|
537
|
+
checkSearchClear("");
|
|
538
|
+
}
|
|
539
|
+
updateChecked(key, isChecked);
|
|
540
|
+
}
|
|
541
|
+
function checkSearchClear(kw) {
|
|
542
|
+
if (!kw) {
|
|
543
|
+
isSearch.value = false;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
function getCheckWithLevel(strategy, hideLeaf) {
|
|
547
|
+
const getCheckedKeys = (map2, strategy2) => {
|
|
548
|
+
const visited = /* @__PURE__ */ new Set();
|
|
549
|
+
const checked = new Set(checkedKeys.value);
|
|
550
|
+
const result = [];
|
|
551
|
+
checkedKeys.value.forEach((k) => {
|
|
552
|
+
const node = !visited.has(k) && map2.get(k);
|
|
553
|
+
if (node) {
|
|
554
|
+
const key = getTopLevelCheckedKey(node, checked, map2);
|
|
555
|
+
const target = !visited.has(key) && map2.get(key);
|
|
556
|
+
visited.add(key);
|
|
557
|
+
if (target)
|
|
558
|
+
result.push(...getAllKeys([target], strategy2));
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
return result;
|
|
562
|
+
};
|
|
563
|
+
const createMap = (hideLeaf2) => {
|
|
564
|
+
const itemKey = props.itemKey;
|
|
565
|
+
const result = /* @__PURE__ */ new Map();
|
|
566
|
+
transformData(props.data, null, {
|
|
567
|
+
enter(node) {
|
|
568
|
+
node.key = itemKey ? itemKey(node.originItem) : node.key;
|
|
569
|
+
result.set(node.key, node);
|
|
570
|
+
},
|
|
571
|
+
leave: hideLeaf2 ? (node) => {
|
|
572
|
+
var _a;
|
|
573
|
+
if (!node.leaf && ((_a = node.children) == null ? void 0 : _a.length)) {
|
|
574
|
+
const children = node.children.filter((val) => !val.leaf);
|
|
575
|
+
node.children = children.length ? children : void 0;
|
|
576
|
+
}
|
|
577
|
+
} : void 0
|
|
578
|
+
});
|
|
579
|
+
return result;
|
|
580
|
+
};
|
|
581
|
+
strategy = strategy || checkStrategyResult.value;
|
|
582
|
+
hideLeaf = hideLeaf != null ? hideLeaf : props.hideLeaf;
|
|
583
|
+
const same = hideLeaf === props.hideLeaf && strategy === checkStrategyResult.value;
|
|
584
|
+
const map = same ? treeMap : createMap(hideLeaf);
|
|
585
|
+
const keys = same ? checkedKeys.value : getCheckedKeys(map, strategy);
|
|
586
|
+
return keys.map((k) => {
|
|
587
|
+
const node = map.get(k);
|
|
588
|
+
const parent = node.parentKey ? map.get(node.parentKey) : void 0;
|
|
589
|
+
return {
|
|
590
|
+
...node,
|
|
591
|
+
parentNode: parent
|
|
592
|
+
};
|
|
593
|
+
}).filter((tag) => !props.uncheckableField || props.uncheckableField && !tag.originItem[props.uncheckableField]);
|
|
734
594
|
}
|
|
735
595
|
function resetParams() {
|
|
736
596
|
keyword.value = "";
|
|
737
597
|
checkedAll.value = isSearch.value = false;
|
|
738
598
|
checkedKeys.value = [];
|
|
739
599
|
expandedKeys.value = [];
|
|
740
|
-
treeData.value = [];
|
|
741
|
-
tagData.value = [];
|
|
742
|
-
initTagData.value = [];
|
|
743
|
-
allCheckedTreeKeys.value = [];
|
|
600
|
+
treeData.value = treeAsyncData.value = [];
|
|
744
601
|
}
|
|
745
602
|
watch(() => props.data, (value) => {
|
|
746
603
|
resetParams();
|
|
747
|
-
|
|
604
|
+
initTreeData();
|
|
748
605
|
}, {
|
|
749
606
|
immediate: true
|
|
750
607
|
});
|
|
751
608
|
watch(() => checkedKeys, (value) => {
|
|
752
|
-
if (props.showSelectType) {
|
|
753
|
-
const curType = curSelectKey.value;
|
|
754
|
-
checkedTagsMiddle[curType] = initTagData.value.filter((tag) => value.value.includes(tag.key));
|
|
755
|
-
setSelectTagData(treeDataMiddle[curType], curType);
|
|
756
|
-
setCheckedAll();
|
|
757
|
-
const checkTagKeys = caculateTagData.value.map((tag) => tag.key);
|
|
758
|
-
emit("check", checkTagKeys);
|
|
759
|
-
emit("checkWithLevel", caculateTagData.value);
|
|
760
|
-
return;
|
|
761
|
-
}
|
|
762
|
-
tagData.value = initTagData.value.filter((tag) => value.value.includes(tag.key));
|
|
763
|
-
setTagData(isRemote.value ? treeData.value : treeDataMiddle.temp);
|
|
764
|
-
const checkResult = tagData.value.filter((tree) => {
|
|
765
|
-
if (!props.uncheckableField)
|
|
766
|
-
return value.value.includes(tree.key);
|
|
767
|
-
return value.value.includes(tree.key) && !tree.originItem[props.uncheckableField];
|
|
768
|
-
});
|
|
769
609
|
emit("check", value.value);
|
|
770
|
-
emit("checkWithLevel",
|
|
610
|
+
emit("checkWithLevel", caculateTagData.value);
|
|
771
611
|
}, {
|
|
772
612
|
deep: true
|
|
773
613
|
});
|
|
774
|
-
watch(() => keyword.value, (searchValue) => {
|
|
775
|
-
if (!searchValue) {
|
|
776
|
-
notifySearchClear();
|
|
777
|
-
}
|
|
778
|
-
});
|
|
779
614
|
expose({
|
|
780
615
|
getCheckWithLevel
|
|
781
616
|
});
|
|
@@ -785,78 +620,69 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
785
620
|
class: "c-select-person"
|
|
786
621
|
}, {
|
|
787
622
|
default: withCtx(() => [createVNode(unref(NGi), null, {
|
|
788
|
-
default: withCtx(() => [
|
|
789
|
-
|
|
790
|
-
style: {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}, {
|
|
803
|
-
suffix: withCtx(() => [keyword.value ? (openBlock(), createBlock(unref(NIcon), {
|
|
804
|
-
key: 0,
|
|
805
|
-
class: "search-clear",
|
|
806
|
-
component: unref(CloseCircleSharp),
|
|
807
|
-
size: "16",
|
|
808
|
-
onClick: notifySearchClear
|
|
809
|
-
}, null, 8, ["component"])) : createCommentVNode("v-if", true)]),
|
|
810
|
-
_: 1
|
|
811
|
-
}, 8, ["value", "placeholder", "onKeyup"]), createVNode(unref(NButton), {
|
|
812
|
-
type: "primary",
|
|
813
|
-
onClick: onSearch
|
|
814
|
-
}, {
|
|
815
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchButtonText), 1)]),
|
|
816
|
-
_: 1
|
|
817
|
-
})]),
|
|
818
|
-
_: 1
|
|
819
|
-
})]), __props.showSelectType ? (openBlock(), createElementBlock("div", _hoisted_2, [(openBlock(), createElementBlock(Fragment, null, renderList(labelList, (item) => {
|
|
820
|
-
return createVNode(unref(NTag), {
|
|
821
|
-
round: "",
|
|
822
|
-
checkable: "",
|
|
823
|
-
checked: curSelectKey.value === item.key,
|
|
824
|
-
key: item.key,
|
|
825
|
-
"onUpdate:checked": ($event) => onHandleLabelChange(item)
|
|
826
|
-
}, {
|
|
827
|
-
default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
|
|
828
|
-
_: 2
|
|
829
|
-
}, 1032, ["checked", "onUpdate:checked"]);
|
|
830
|
-
}), 64))])) : createCommentVNode("v-if", true), __props.multiple && !isSearch.value ? withDirectives((openBlock(), createBlock(unref(NCheckbox), {
|
|
831
|
-
key: 1,
|
|
832
|
-
checked: checkedAll.value,
|
|
833
|
-
"onUpdate:checked": [_cache[1] || (_cache[1] = ($event) => checkedAll.value = $event), checkedAllChange]
|
|
623
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
624
|
+
class: "c-select-person__container",
|
|
625
|
+
style: normalizeStyle(`padding-right: 12px;border-right: 1px solid #e8e8e8;height: ${__props.height}`)
|
|
626
|
+
}, [createElementVNode("div", _hoisted_1, [createCommentVNode(" \u641C\u7D22\u5DE6\u4FA7\u8FC7\u6EE4\u7B5B\u9009\u63D2\u69FD "), renderSlot(_ctx.$slots, "filter"), createVNode(unref(NInputGroup), null, {
|
|
627
|
+
default: withCtx(() => [createVNode(unref(NInput), {
|
|
628
|
+
class: "search-input",
|
|
629
|
+
clearable: "",
|
|
630
|
+
value: keyword.value,
|
|
631
|
+
"onUpdate:value": [_cache[0] || (_cache[0] = ($event) => keyword.value = $event), checkSearchClear],
|
|
632
|
+
placeholder: __props.searchPlaceholder,
|
|
633
|
+
onKeyup: withKeys(onSearch, ["enter"])
|
|
634
|
+
}, null, 8, ["value", "placeholder", "onKeyup"]), createVNode(unref(NButton), {
|
|
635
|
+
type: "primary",
|
|
636
|
+
onClick: onSearch
|
|
834
637
|
}, {
|
|
835
|
-
default: withCtx(() => [createTextVNode(
|
|
836
|
-
var _a, _b, _c;
|
|
837
|
-
try {
|
|
838
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.37")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.37")) || "\u5168\u9009";
|
|
839
|
-
} catch (e) {
|
|
840
|
-
return "\u5168\u9009";
|
|
841
|
-
}
|
|
842
|
-
}())]),
|
|
638
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchButtonText), 1)]),
|
|
843
639
|
_: 1
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
}
|
|
859
|
-
|
|
640
|
+
})]),
|
|
641
|
+
_: 1
|
|
642
|
+
})]), __props.multiple && !isSearch.value && unref(treeData).length > 0 ? withDirectives((openBlock(), createBlock(unref(NCheckbox), {
|
|
643
|
+
key: 0,
|
|
644
|
+
checked: checkedAll.value,
|
|
645
|
+
"onUpdate:checked": [_cache[1] || (_cache[1] = ($event) => checkedAll.value = $event), checkedAllChange]
|
|
646
|
+
}, {
|
|
647
|
+
default: withCtx(() => [createTextVNode(function() {
|
|
648
|
+
var _a, _b, _c;
|
|
649
|
+
try {
|
|
650
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.37")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.37")) || "\u5168\u9009";
|
|
651
|
+
} catch (e) {
|
|
652
|
+
return "\u5168\u9009";
|
|
653
|
+
}
|
|
654
|
+
}())]),
|
|
655
|
+
_: 1
|
|
656
|
+
}, 8, ["checked"])), [[vShow, __props.forceShowSelectAll]]) : createCommentVNode("v-if", true), createCommentVNode(" \u540C\u65F6\u517C\u5BB9\u9009\u4EBA\u548C\u9009\u90E8\u95E8 "), isSearch.value && unref(isShowGroupList) ? (openBlock(), createBlock(SearchGroupList, {
|
|
657
|
+
key: 1,
|
|
658
|
+
class: "c-select-person__hide",
|
|
659
|
+
type: unref(showType),
|
|
660
|
+
data: unref(searchData),
|
|
661
|
+
onChecked: notifyCheck
|
|
662
|
+
}, null, 8, ["type", "data"])) : (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(NTree), mergeProps({
|
|
663
|
+
"expanded-keys": expandedKeys.value,
|
|
664
|
+
"onUpdate:expanded-keys": _cache[2] || (_cache[2] = ($event) => expandedKeys.value = $event),
|
|
665
|
+
"selected-keys": checkedKeys.value,
|
|
666
|
+
"onUpdate:selected-keys": _cache[3] || (_cache[3] = ($event) => checkedKeys.value = $event),
|
|
667
|
+
style: {
|
|
668
|
+
"height": "100%"
|
|
669
|
+
},
|
|
670
|
+
"checked-keys": checkedKeys.value,
|
|
671
|
+
checkable: __props.multiple,
|
|
672
|
+
selectable: !__props.multiple,
|
|
673
|
+
data: unref(renderTreeData),
|
|
674
|
+
"render-label": renderLabel,
|
|
675
|
+
"virtual-scroll": "",
|
|
676
|
+
cascade: !__props.onlyForwardCascade,
|
|
677
|
+
"allow-checking-not-loaded": "",
|
|
678
|
+
"check-strategy": "child"
|
|
679
|
+
}, __props.treeSetting, {
|
|
680
|
+
class: "c-select-person__scroll",
|
|
681
|
+
"onUpdate:checkedKeys": updateTreeChecked,
|
|
682
|
+
onLoad: queryLoadChildNode
|
|
683
|
+
}), {
|
|
684
|
+
empty: withCtx(() => [createVNode(unref(DefaultPage), {
|
|
685
|
+
type: "16",
|
|
860
686
|
description: function() {
|
|
861
687
|
var _a, _b, _c;
|
|
862
688
|
try {
|
|
@@ -865,72 +691,45 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
865
691
|
return "\u6682\u65E0\u6570\u636E";
|
|
866
692
|
}
|
|
867
693
|
}()
|
|
868
|
-
}))
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
class: "c-select-person__scroll",
|
|
872
|
-
"checked-keys": checkedKeys.value,
|
|
873
|
-
"expanded-keys": expandedKeys.value,
|
|
874
|
-
"onUpdate:expanded-keys": _cache[2] || (_cache[2] = ($event) => expandedKeys.value = $event),
|
|
875
|
-
checkable: __props.multiple,
|
|
876
|
-
cascade: !__props.onlyForwardCascade,
|
|
877
|
-
"allow-checking-not-loaded": "",
|
|
878
|
-
selectable: !__props.multiple,
|
|
879
|
-
"selected-keys": checkedKeys.value,
|
|
880
|
-
"onUpdate:selected-keys": _cache[3] || (_cache[3] = ($event) => checkedKeys.value = $event),
|
|
881
|
-
data: treeData.value,
|
|
882
|
-
"check-strategy": "child",
|
|
883
|
-
"render-label": renderLabel
|
|
884
|
-
}, __props.treeSetting, {
|
|
885
|
-
"onUpdate:checkedKeys": updateTreeChecked,
|
|
886
|
-
onLoad: queryLoadChildNode
|
|
887
|
-
}), null, 16, ["checked-keys", "expanded-keys", "checkable", "cascade", "selectable", "selected-keys", "data"]))]))]),
|
|
888
|
-
_: 3
|
|
889
|
-
})]),
|
|
694
|
+
})]),
|
|
695
|
+
_: 1
|
|
696
|
+
}, 16, ["expanded-keys", "selected-keys", "checked-keys", "checkable", "selectable", "data", "cascade"])]))], 4)]),
|
|
890
697
|
_: 3
|
|
891
698
|
}), createVNode(unref(NGi), null, {
|
|
892
|
-
default: withCtx(() => [
|
|
893
|
-
|
|
699
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
700
|
+
class: "c-select-person__container",
|
|
701
|
+
style: normalizeStyle(`padding-left: 12px;height:${__props.height}`)
|
|
702
|
+
}, [createVNode(unref(NSpace), {
|
|
703
|
+
justify: "space-between",
|
|
894
704
|
style: {
|
|
895
|
-
"
|
|
705
|
+
"margin-bottom": "20px"
|
|
896
706
|
}
|
|
897
707
|
}, {
|
|
898
|
-
default: withCtx(() => [
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
708
|
+
default: withCtx(() => [__props.showCount ? (openBlock(), createElementBlock("span", _hoisted_3, "\u5DF2\u9009\u62E9\uFF1A" + toDisplayString(unref(caculateTagData).length), 1)) : createCommentVNode("v-if", true), __props.showClear ? (openBlock(), createElementBlock("span", {
|
|
709
|
+
key: 1,
|
|
710
|
+
class: "c-select-person__clear-btn",
|
|
711
|
+
onClick: clearAll
|
|
712
|
+
}, function() {
|
|
713
|
+
var _a, _b, _c;
|
|
714
|
+
try {
|
|
715
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.509")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.509")) || "\u6E05\u7A7A";
|
|
716
|
+
} catch (e) {
|
|
717
|
+
return "\u6E05\u7A7A";
|
|
902
718
|
}
|
|
903
|
-
},
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
}), createElementVNode("div", {
|
|
918
|
-
class: "c-select-person__scroll",
|
|
919
|
-
style: normalizeStyle(unref(styleObject))
|
|
920
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(caculateTagData), (tag) => {
|
|
921
|
-
return openBlock(), createElementBlock("span", {
|
|
922
|
-
class: "c-select-person__tag-item",
|
|
923
|
-
key: tag.key
|
|
924
|
-
}, [createCommentVNode(" \u6807\u7B7E\u63D2\u69FD "), renderSlot(_ctx.$slots, "tag", {
|
|
925
|
-
tag
|
|
926
|
-
}, () => [createTextVNode(toDisplayString(tag.name) + " " + toDisplayString(tag.parentName ? `(${tag.parentName})` : "") + " " + toDisplayString(tag.innerItemsNum ? `(${tag.innerItemsNum}\u4EBA)` : "") + " " + toDisplayString(__props.showSelectType && labelListName[tag.itemType] ? `(${labelListName[tag.itemType]})` : ""), 1)]), createVNode(unref(NIcon), {
|
|
927
|
-
class: "tag-close",
|
|
928
|
-
component: unref(CloseCircleSharp),
|
|
929
|
-
onClick: ($event) => closeTag(tag)
|
|
930
|
-
}, null, 8, ["component", "onClick"])]);
|
|
931
|
-
}), 128))], 4)]),
|
|
932
|
-
_: 3
|
|
933
|
-
})]),
|
|
719
|
+
}())) : createCommentVNode("v-if", true)]),
|
|
720
|
+
_: 1
|
|
721
|
+
}), createElementVNode("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(caculateTagData), (tag) => {
|
|
722
|
+
return openBlock(), createElementBlock("span", {
|
|
723
|
+
class: "c-select-person__tag-item",
|
|
724
|
+
key: tag.key
|
|
725
|
+
}, [createCommentVNode(" \u6807\u7B7E\u63D2\u69FD "), renderSlot(_ctx.$slots, "tag", {
|
|
726
|
+
tag
|
|
727
|
+
}, () => [createTextVNode(toDisplayString(tag.label) + " " + toDisplayString(tag.parentName ? `(${tag.parentName})` : "") + " " + toDisplayString(tag.innerItemsNum ? `(${tag.innerItemsNum}\u4EBA)` : ""), 1)]), createVNode(unref(NIcon), {
|
|
728
|
+
class: "tag-close",
|
|
729
|
+
component: unref(CloseCircleSharp),
|
|
730
|
+
onClick: ($event) => updateChecked(tag.key, false)
|
|
731
|
+
}, null, 8, ["component", "onClick"])]);
|
|
732
|
+
}), 128))])], 4)]),
|
|
934
733
|
_: 3
|
|
935
734
|
})]),
|
|
936
735
|
_: 3
|