cnhis-design-vue 3.3.3-release.0 → 3.3.3-release.7
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/index.d.ts +13 -11
- package/es/components/audio-sdk/src/Index.vue.d.ts +13 -11
- package/es/components/audio-sdk/src/Index.vue2.js +43 -11
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +1 -1
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +1 -1
- package/es/components/audio-sdk/src/components/recording.vue2.js +17 -3
- package/es/components/base-search/index.d.ts +3 -0
- package/es/components/base-search/src/index.vue.d.ts +3 -0
- 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 +11 -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/callback/src/components/render/popupMaps.d.ts +13 -0
- package/es/components/card-reader-sdk-cn/src/henan/index.js +8 -1
- package/es/components/classification/index.d.ts +56 -6
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +56 -6
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +56 -6
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +56 -6
- package/es/components/expand-field/index.d.ts +792 -1
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +792 -1
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +792 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +792 -1
- package/es/components/expand-field/src/components/form.vue2.js +8 -1
- package/es/components/expand-field/src/index.vue.d.ts +792 -1
- package/es/components/field-editor/index.d.ts +13 -0
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +13 -0
- package/es/components/field-editor/src/FieldEditor.vue2.js +2 -1
- package/es/components/field-editor/src/fields.d.ts +1 -0
- package/es/components/field-editor/src/fields.js +6 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +32 -1
- package/es/components/field-set/src/FieldSet.vue2.js +112 -65
- package/es/components/field-set/src/Index.vue2.js +8 -3
- package/es/components/field-set/src/TableStyle.vue2.js +2 -2
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/field-set/src/constants/index.d.ts +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +39 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +39 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +13 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +13 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +8 -1
- package/es/components/form-render/index.d.ts +13 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +13 -0
- package/es/components/form-render/src/FormRender.vue2.js +4 -0
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +13 -0
- package/es/components/form-render/src/components/renderer/formItem.js +8 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +12 -3
- package/es/components/form-render/src/hooks/useBusinessBinding.js +7 -7
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +8 -1
- package/es/components/form-render/src/utils/business.d.ts +3 -1
- package/es/components/form-render/src/utils/business.js +7 -1
- package/es/components/iho-chat/index.d.ts +18 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +18 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +2 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +22 -10
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +3 -2
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +16 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +112 -53
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/index.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/index.js +1 -0
- package/es/components/iho-chat/src/hooks/useDraggable.d.ts +25 -0
- package/es/components/iho-chat/src/hooks/useDraggable.js +151 -0
- 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/index.d.ts +26 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +26 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +13 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +13 -0
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +16 -2
- package/es/components/quick-search/index.d.ts +2 -0
- package/es/components/quick-search/src/index.vue.d.ts +2 -0
- package/es/components/scale-view/index.d.ts +67 -17
- package/es/components/scale-view/src/ScaleView.vue.d.ts +70 -19
- package/es/components/scale-view/src/ScaleView.vue2.js +84 -10
- 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-props.d.ts +8 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +8 -0
- package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +2 -1
- 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/src/utils/judge-types.d.ts +2 -1
- package/es/components/scale-view/src/utils/judge-types.js +10 -10
- package/es/components/scale-view/src/utils/watch-form-change.d.ts +13 -0
- package/es/components/scale-view/src/utils/watch-form-change.js +71 -0
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-person/index.d.ts +792 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +434 -341
- package/es/components/select-person/src/SelectPerson.vue2.js +521 -675
- 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/components/GroupItem.vue.d.ts +19 -0
- package/es/components/select-person/src/components/GroupItem.vue.js +6 -0
- package/es/components/select-person/src/components/GroupItem.vue2.js +37 -0
- package/es/components/select-person/src/components/SearchGroupList.vue.d.ts +214 -0
- package/es/components/select-person/src/components/SearchGroupList.vue.js +6 -0
- package/es/components/select-person/src/components/SearchGroupList.vue2.js +145 -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/components/TagItem.vue.d.ts +43 -0
- package/es/components/select-person/src/components/TagItem.vue.js +6 -0
- package/es/components/select-person/src/components/TagItem.vue2.js +40 -0
- package/es/components/select-person/src/index.vue.d.ts +793 -1
- package/es/components/select-person/src/index.vue2.js +21 -4
- 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 +3 -0
- package/es/components/select-person/src/utils/index.js +29 -8
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +13 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +1 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +54 -6
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +26 -10
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +17 -2
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +37 -2
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +18 -2
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +44 -1
- package/es/components/table-filter/src/components/classify-filter/components/SelectFilter.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +36 -4
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +2 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +55 -6
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +6 -3
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +12 -1
- package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue2.js +25 -6
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +12 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +2 -2
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +2 -2
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +20 -3
- package/es/components/table-filter/src/hooks/useRenderWidget.js +4 -0
- package/es/components/table-filter/src/tool/date.d.ts +3 -0
- package/es/components/table-filter/src/tool/date.js +139 -0
- package/es/components/table-filter/src/tool/transformData.d.ts +1 -0
- package/es/components/table-filter/src/tool/transformData.js +11 -8
- package/es/components/table-filter/src/types/enums.d.ts +1 -0
- package/es/components/table-filter/src/types/enums.js +2 -1
- package/es/components/table-filter/src/types/index.d.ts +12 -0
- 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,27 @@
|
|
1
|
-
import { defineComponent, inject, ref,
|
2
|
-
import { NGrid, NGi,
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import SearchOrgAndStaff from './components/SearchOrgAndStaff.vue.js';
|
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, normalizeProps, guardReactiveProps } from 'vue';
|
2
|
+
import { useMessage, NGrid, NGi, NInputGroup, NInput, NButton, NCheckbox, NTree, NSpace, NPopover } from 'naive-ui';
|
3
|
+
import { getAllChildren, searchBasisTree, getExpandedKeys } from './utils/index.js';
|
4
|
+
import { union, remove } from 'lodash-es';
|
5
|
+
import SearchGroupList from './components/SearchGroupList.vue.js';
|
6
|
+
import TagItem from './components/TagItem.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"
|
22
|
+
};
|
23
|
+
const _hoisted_5 = {
|
24
|
+
class: "c-select-person__popover"
|
24
25
|
};
|
25
26
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
26
27
|
__name: "SelectPerson",
|
@@ -95,22 +96,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
95
96
|
type: Function,
|
96
97
|
default: () => Promise.resolve([])
|
97
98
|
},
|
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
99
|
forceShowSelectAll: {
|
115
100
|
type: Boolean
|
116
101
|
},
|
@@ -119,532 +104,359 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
119
104
|
},
|
120
105
|
onlyForwardCascade: {
|
121
106
|
type: Boolean
|
107
|
+
},
|
108
|
+
height: {
|
109
|
+
type: String
|
110
|
+
},
|
111
|
+
hideLeaf: {
|
112
|
+
type: Boolean,
|
113
|
+
default: false
|
114
|
+
},
|
115
|
+
itemKey: {
|
116
|
+
type: Function,
|
117
|
+
default: void 0
|
118
|
+
},
|
119
|
+
showTagHover: {
|
120
|
+
type: Boolean,
|
121
|
+
default: false
|
122
122
|
}
|
123
123
|
},
|
124
124
|
setup(__props, {
|
125
125
|
expose
|
126
126
|
}) {
|
127
127
|
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
|
-
};
|
128
|
+
const $message = useMessage();
|
197
129
|
const emit = inject(InjectionSelectPersonEmits);
|
198
130
|
const keyword = ref("");
|
199
131
|
const checkedAll = ref(false);
|
200
132
|
const checkedKeys = ref([]);
|
201
133
|
const expandedKeys = ref([]);
|
202
|
-
const treeData =
|
203
|
-
const
|
204
|
-
const
|
134
|
+
const treeData = shallowRef([]);
|
135
|
+
const treeAsyncData = ref([]);
|
136
|
+
const searchTreeData = shallowRef([]);
|
137
|
+
const searchData = shallowRef([]);
|
138
|
+
const treeMap = /* @__PURE__ */ new Map();
|
205
139
|
const isSearch = ref(false);
|
206
|
-
const
|
140
|
+
const remoteDefaultList = ref([]);
|
207
141
|
const isRemote = computed(() => props.queryLoadChildData ? true : false);
|
208
142
|
const checkStrategyResult = computed(() => {
|
209
143
|
var _a, _b;
|
210
144
|
return (_b = (_a = props == null ? void 0 : props.treeSetting) == null ? void 0 : _a.checkStrategy) != null ? _b : "child";
|
211
145
|
});
|
212
146
|
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);
|
147
|
+
const isShowGroupList = computed(() => {
|
148
|
+
const isInnerMultiple = (props == null ? void 0 : props.searchInner) && (props == null ? void 0 : props.multiple);
|
149
|
+
return checkStrategyResult.value === "parent" && (isSearchFilter.value || isInnerMultiple);
|
222
150
|
});
|
223
|
-
const
|
224
|
-
|
225
|
-
return
|
226
|
-
});
|
227
|
-
const styleObject = computed(() => {
|
228
|
-
return {
|
229
|
-
height: props.multiple ? "342px" : "308px"
|
230
|
-
};
|
151
|
+
const showType = computed(() => {
|
152
|
+
const isInnerMultiple = (props == null ? void 0 : props.searchInner) && (props == null ? void 0 : props.multiple);
|
153
|
+
return isSearchFilter.value ? "searchGroup" : isInnerMultiple ? "searchChild" : "";
|
231
154
|
});
|
232
155
|
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");
|
156
|
+
const re = checkedKeys.value.map((key) => {
|
157
|
+
return treeMap.get(key);
|
158
|
+
}).filter((tag) => !props.uncheckableField || props.uncheckableField && !tag.originItem[props.uncheckableField]);
|
159
|
+
if (isRemote.value) {
|
160
|
+
return [...remoteDefaultList.value, ...re];
|
253
161
|
}
|
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: []
|
277
|
-
});
|
278
|
-
const checkedTagsMiddle = reactive({
|
279
|
-
main: [],
|
280
|
-
dept: [],
|
281
|
-
role: []
|
162
|
+
return re;
|
282
163
|
});
|
283
|
-
const
|
284
|
-
|
285
|
-
|
286
|
-
|
164
|
+
const renderTreeData = computed(() => {
|
165
|
+
if (isRemote.value)
|
166
|
+
return treeAsyncData.value;
|
167
|
+
if (isSearch.value && !isShowGroupList.value)
|
168
|
+
return searchTreeData.value;
|
169
|
+
return treeData.value;
|
287
170
|
});
|
288
|
-
|
171
|
+
function initTreeData() {
|
289
172
|
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) {
|
173
|
+
treeMap.clear();
|
321
174
|
const {
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
175
|
+
itemKey,
|
176
|
+
hideLeaf
|
177
|
+
} = props;
|
178
|
+
const tempData = transformData(props.data, null, {
|
179
|
+
enter(node) {
|
180
|
+
node.key = itemKey ? itemKey(node.originItem) : node.key;
|
181
|
+
treeMap.set(node.key, node);
|
182
|
+
},
|
183
|
+
leave: hideLeaf ? (node) => {
|
184
|
+
var _a2;
|
185
|
+
if (!node.leaf && ((_a2 = node.children) == null ? void 0 : _a2.length)) {
|
186
|
+
const children = node.children.filter((val) => !val.leaf);
|
187
|
+
node.children = children.length ? children : void 0;
|
188
|
+
}
|
189
|
+
} : void 0
|
335
190
|
});
|
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]
|
191
|
+
isRemote.value ? treeAsyncData.value = tempData.treeItems : treeData.value = tempData.treeItems;
|
192
|
+
if (isRemote.value) {
|
193
|
+
remoteDefaultList.value = (_a = props == null ? void 0 : props.defaultList) == null ? void 0 : _a.map((tag) => {
|
194
|
+
return {
|
195
|
+
...tag,
|
196
|
+
label: tag.name
|
197
|
+
};
|
352
198
|
});
|
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
199
|
}
|
200
|
+
checkedKeys.value = props.defaultList.filter((k) => treeMap.has(k));
|
448
201
|
}
|
449
202
|
async function queryLoadChildNode(node) {
|
203
|
+
var _a;
|
450
204
|
if (props.queryLoadChildData) {
|
205
|
+
const {
|
206
|
+
itemKey,
|
207
|
+
hideLeaf
|
208
|
+
} = props;
|
451
209
|
const curNode = await props.queryLoadChildData(node);
|
452
|
-
if (curNode.children) {
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
}
|
210
|
+
if ((_a = curNode == null ? void 0 : curNode.children) == null ? void 0 : _a.length) {
|
211
|
+
const tempData = transformData(curNode.children, curNode, {
|
212
|
+
enter(node2) {
|
213
|
+
node2.key = itemKey ? itemKey(node2.originItem) : node2.key;
|
214
|
+
treeMap.set(node2.key, node2);
|
215
|
+
},
|
216
|
+
leave: hideLeaf ? (node2) => {
|
217
|
+
var _a2;
|
218
|
+
if (!node2.leaf && ((_a2 = node2.children) == null ? void 0 : _a2.length)) {
|
219
|
+
const children = node2.children.filter((val) => !val.leaf);
|
220
|
+
node2.children = children.length ? children : void 0;
|
221
|
+
}
|
222
|
+
} : void 0
|
458
223
|
});
|
224
|
+
curNode.children = tempData.treeItems;
|
459
225
|
}
|
460
226
|
return curNode;
|
461
227
|
}
|
462
228
|
return node;
|
463
229
|
}
|
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
230
|
function renderLabel({
|
471
231
|
option
|
472
232
|
}) {
|
473
233
|
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}`;
|
234
|
+
if (((_a = option.children) == null ? void 0 : _a.length) || isRemote.value && !(option == null ? void 0 : option.leaf)) {
|
235
|
+
const countText = option.count ? `(${option.count})` : "";
|
236
|
+
const labelStr = `${option.label}${countText}`;
|
478
237
|
return createVNode("span", {
|
479
238
|
"title": labelStr
|
480
239
|
}, [labelStr]);
|
481
240
|
} else {
|
482
|
-
const
|
241
|
+
const labelExpand = (_b = option.labelExpand) != null ? _b : "";
|
483
242
|
return createVNode("p", {
|
484
243
|
"class": "user_item"
|
485
244
|
}, [createVNode("span", {
|
486
|
-
"title": option.
|
487
|
-
}, [option.
|
245
|
+
"title": option.label
|
246
|
+
}, [option.label]), createVNode("span", {
|
488
247
|
"class": "user_item_expand",
|
489
|
-
"title":
|
490
|
-
}, [
|
248
|
+
"title": labelExpand
|
249
|
+
}, [labelExpand])]);
|
491
250
|
}
|
492
251
|
}
|
493
|
-
function
|
494
|
-
return option[props.wordbookChild.user_name_obj] || option[props.wordbook.parent_name_obj] || option["orgName"] || option["title"] || "";
|
495
|
-
}
|
496
|
-
function transformData(trees) {
|
252
|
+
function getChildren(tag) {
|
497
253
|
var _a;
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
254
|
+
const {
|
255
|
+
children: childrenKey = "children"
|
256
|
+
} = props.wordbook;
|
257
|
+
if (!tag || !(tag == null ? void 0 : tag.originItem) || !((_a = tag == null ? void 0 : tag.originItem[childrenKey]) == null ? void 0 : _a.length))
|
258
|
+
return [];
|
259
|
+
const {
|
260
|
+
itemKey,
|
261
|
+
hideLeaf
|
262
|
+
} = props;
|
263
|
+
const tempData = transformData(tag.originItem[childrenKey], tag, {
|
264
|
+
enter(node) {
|
265
|
+
node.key = itemKey ? itemKey(node.originItem) : node.key;
|
266
|
+
treeMap.set(node.key, node);
|
506
267
|
}
|
507
|
-
}
|
508
|
-
|
509
|
-
return transformParentNodeName(trees, "");
|
510
|
-
return trees;
|
268
|
+
});
|
269
|
+
return getAllChildren(tempData.treeItems, childrenKey);
|
511
270
|
}
|
512
|
-
function
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
271
|
+
function transformData(trees, parentNode, visitor) {
|
272
|
+
const {
|
273
|
+
children: childrenKey = "children",
|
274
|
+
parent_id_obj = "key",
|
275
|
+
parent_name_obj = "label",
|
276
|
+
user_count_obj = "count",
|
277
|
+
empty_enable
|
278
|
+
} = props.wordbook;
|
279
|
+
const {
|
280
|
+
user_id_obj,
|
281
|
+
user_name_obj,
|
282
|
+
leaf_field,
|
283
|
+
leaf_value,
|
284
|
+
user_expand_keys
|
285
|
+
} = props.wordbookChild;
|
286
|
+
let leafCount = 0;
|
287
|
+
const {
|
288
|
+
label: parentLabel = "",
|
289
|
+
parentName = "",
|
290
|
+
disabled,
|
291
|
+
key: parentKey
|
292
|
+
} = parentNode || {};
|
293
|
+
const {
|
294
|
+
enter,
|
295
|
+
leave
|
296
|
+
} = visitor || {};
|
297
|
+
const treeItems = trees.map((item) => {
|
298
|
+
const children = item[childrenKey];
|
299
|
+
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;
|
300
|
+
const tree = {
|
301
|
+
key: item[parent_id_obj] || item[user_id_obj] || (item == null ? void 0 : item.key),
|
302
|
+
label: item[parent_name_obj] || item[user_name_obj] || (item == null ? void 0 : item.title),
|
303
|
+
name: item[parent_name_obj] || item[user_name_obj] || (item == null ? void 0 : item.title),
|
304
|
+
count: item[user_count_obj],
|
305
|
+
labelExpand: "",
|
306
|
+
parentKey,
|
307
|
+
parentName: parentLabel + (parentName ? parentLabel ? `/${parentName}` : parentName : ""),
|
308
|
+
innerItemsNum: 0,
|
309
|
+
children: void 0,
|
310
|
+
originItem: item,
|
311
|
+
leaf: isLeaf,
|
312
|
+
disabled: disabled || item.disabled
|
313
|
+
};
|
314
|
+
if (isRemote.value)
|
315
|
+
tree.isLeaf = isLeaf;
|
316
|
+
enter && enter(tree);
|
317
|
+
if (isLeaf) {
|
318
|
+
if (Array.isArray(user_expand_keys)) {
|
319
|
+
tree.labelExpand = user_expand_keys.reduce((acc, key) => {
|
320
|
+
const str = item[key];
|
321
|
+
return str ? acc ? `${acc}\uFF0C${str}` : str : acc;
|
322
|
+
}, "");
|
323
|
+
}
|
324
|
+
if (!tree.disabled) {
|
325
|
+
leafCount++;
|
326
|
+
}
|
518
327
|
} else {
|
519
|
-
|
328
|
+
if (children == null ? void 0 : children.length) {
|
329
|
+
const childData = transformData(children, tree, visitor);
|
330
|
+
if (childData.treeItems.length) {
|
331
|
+
tree.children = childData.treeItems;
|
332
|
+
}
|
333
|
+
tree.innerItemsNum += childData.leafCount;
|
334
|
+
leafCount += tree.innerItemsNum;
|
335
|
+
}
|
336
|
+
if (!empty_enable && tree.innerItemsNum == 0 && !isRemote.value)
|
337
|
+
tree.disabled = true;
|
520
338
|
}
|
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
|
-
};
|
339
|
+
leave && leave(tree);
|
340
|
+
return tree;
|
536
341
|
});
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
[SearchTypeConfig.SEARCH_ORG_STAFF]: isSearchFilter.value,
|
541
|
-
[SearchTypeConfig.SEARCH_ORG]: props.searchInner
|
342
|
+
return {
|
343
|
+
treeItems,
|
344
|
+
leafCount
|
542
345
|
};
|
543
|
-
const result = Object.keys(settings).find((attr) => settings[attr]);
|
544
|
-
return result != null ? result : "";
|
545
346
|
}
|
546
347
|
async function onSearch() {
|
547
|
-
var _a, _b;
|
348
|
+
var _a, _b, _c, _d;
|
548
349
|
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;
|
350
|
+
const kw = keyword.value.trim();
|
351
|
+
isSearch.value = !!kw;
|
352
|
+
if (!kw) {
|
353
|
+
searchData.value = [];
|
354
|
+
return;
|
569
355
|
}
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
const
|
574
|
-
|
575
|
-
|
576
|
-
|
356
|
+
function flatFilter(nodes) {
|
357
|
+
var _a2, _b2;
|
358
|
+
const result = [];
|
359
|
+
const stack = [...nodes];
|
360
|
+
while (stack.length) {
|
361
|
+
const node = stack.pop();
|
362
|
+
if (node.disabled)
|
363
|
+
continue;
|
364
|
+
const label = (_a2 = node.label) != null ? _a2 : "";
|
365
|
+
const labelExpand = (_b2 = node.labelExpand) != null ? _b2 : "";
|
366
|
+
const originItem = node.originItem;
|
367
|
+
const match = label.includes(kw) || labelExpand.includes(kw) || originItem && originItem[filterKey] && String(originItem[filterKey]).includes(kw);
|
368
|
+
if (match) {
|
369
|
+
result.push(node);
|
577
370
|
}
|
578
|
-
if (
|
579
|
-
|
580
|
-
checkedKeys.value.splice(keyIndex, 1);
|
371
|
+
if (node.children && node.children.length > 0) {
|
372
|
+
stack.push(...node.children);
|
581
373
|
}
|
582
374
|
}
|
583
|
-
|
375
|
+
return result;
|
376
|
+
}
|
377
|
+
if (!isRemote.value) {
|
378
|
+
if (isSearch.value && !isShowGroupList.value) {
|
379
|
+
const filterKey2 = (_d = (_c = props == null ? void 0 : props.wordbook) == null ? void 0 : _c.filter_key) != null ? _d : "keyword";
|
380
|
+
const data = searchBasisTree(treeData.value, kw, filterKey2);
|
381
|
+
searchTreeData.value = data;
|
382
|
+
expandedKeys.value = searchTreeData.value.length ? getExpandedKeys(searchTreeData.value) : [];
|
383
|
+
return;
|
384
|
+
}
|
385
|
+
const flatResult = flatFilter(treeData.value);
|
386
|
+
const parentList = [];
|
387
|
+
const childList = [];
|
388
|
+
flatResult.forEach((item) => item.leaf ? childList.push(item) : parentList.push(item));
|
389
|
+
const searchFilter = {
|
390
|
+
...props.searchFilter
|
391
|
+
};
|
392
|
+
const customTitles = searchFilter.customTitles || [""];
|
393
|
+
const values = [childList, parentList];
|
394
|
+
searchData.value = customTitles.map((title, i) => ({
|
395
|
+
title,
|
396
|
+
data: values[i] || []
|
397
|
+
})).filter((val) => val.data.length);
|
398
|
+
} else {
|
399
|
+
const {
|
400
|
+
itemKey,
|
401
|
+
hideLeaf
|
402
|
+
} = props;
|
403
|
+
const data = await props.queryTreeSearch(keyword.value);
|
404
|
+
const tempData = transformData(data || [], null, {
|
405
|
+
enter(node) {
|
406
|
+
node.key = itemKey ? itemKey(node.originItem) : node.key;
|
407
|
+
treeMap.set(node.key, node);
|
408
|
+
},
|
409
|
+
leave: hideLeaf ? (node) => {
|
410
|
+
var _a2;
|
411
|
+
if (!node.leaf && ((_a2 = node.children) == null ? void 0 : _a2.length)) {
|
412
|
+
const children = node.children.filter((val) => !val.leaf);
|
413
|
+
node.children = children.length ? children : void 0;
|
414
|
+
}
|
415
|
+
} : void 0
|
416
|
+
});
|
417
|
+
treeAsyncData.value = tempData.treeItems;
|
584
418
|
}
|
585
419
|
}
|
586
|
-
function
|
587
|
-
|
420
|
+
function getAllKeys(tree, strategy) {
|
421
|
+
const keys = [];
|
422
|
+
const recursion = strategy != "parent";
|
588
423
|
for (let i = 0, len = tree.length; i < len; i++) {
|
589
424
|
const item = tree[i];
|
590
|
-
if (!item.disabled &&
|
591
|
-
if (
|
592
|
-
|
425
|
+
if (!item.disabled && item.key) {
|
426
|
+
if (!recursion || strategy == "all" || !item.children) {
|
427
|
+
keys.push(item.key);
|
593
428
|
}
|
594
|
-
if (
|
595
|
-
|
596
|
-
checkedKeys.value.splice(keyIndex, 1);
|
429
|
+
if (recursion && item.children) {
|
430
|
+
keys.push(...getAllKeys(item.children, strategy));
|
597
431
|
}
|
598
432
|
}
|
599
433
|
}
|
434
|
+
return keys;
|
600
435
|
}
|
601
|
-
function
|
436
|
+
function getParentKeys(node, map) {
|
602
437
|
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
|
-
}
|
438
|
+
const parents = [];
|
439
|
+
let parentKey = node.parentKey;
|
440
|
+
while (parentKey) {
|
441
|
+
parents.push(parentKey);
|
442
|
+
parentKey = (_a = map.get(parentKey)) == null ? void 0 : _a.parentKey;
|
621
443
|
}
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
444
|
+
return parents;
|
445
|
+
}
|
446
|
+
function getTopLevelCheckedKey(node, checked, map) {
|
447
|
+
const parent = map.get(node.parentKey);
|
448
|
+
if (parent) {
|
449
|
+
checked.add(node.key);
|
450
|
+
const children = parent.children || [];
|
451
|
+
const result = children.every((item) => item.disabled ? true : checked.has(item.key));
|
452
|
+
if (result) {
|
453
|
+
return getTopLevelCheckedKey(parent, checked, map);
|
454
|
+
}
|
628
455
|
}
|
456
|
+
return node.key;
|
629
457
|
}
|
630
458
|
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
|
-
}
|
459
|
+
checkedKeys.value = checked ? getAllKeys(treeData.value, checkStrategyResult.value) : [];
|
648
460
|
}
|
649
461
|
function getFlattenKeys(tree) {
|
650
462
|
const arr = [];
|
@@ -677,105 +489,154 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
677
489
|
}
|
678
490
|
}
|
679
491
|
}
|
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;
|
492
|
+
checkedKeys.value = newKeys;
|
493
|
+
if (!keys.length) {
|
494
|
+
checkedAll.value = false;
|
692
495
|
}
|
693
|
-
checkedAll.value = allCheckedTreeKeys.value.every((key) => tagData.value.findIndex((tag) => tag.key === key) > -1);
|
694
496
|
}
|
695
497
|
function clearAll() {
|
696
|
-
|
697
|
-
checkedKeysMiddle[key] = checkedTagsMiddle[key] = [];
|
698
|
-
});
|
498
|
+
checkedAll.value = false;
|
699
499
|
checkedKeys.value = [];
|
500
|
+
remoteDefaultList.value = [];
|
700
501
|
}
|
701
|
-
function
|
702
|
-
if (
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
if (curSelectKey.value == tagType)
|
708
|
-
checkedKeys.value = checkedKeysMiddle[tagType];
|
502
|
+
function updateChecked(key, checked) {
|
503
|
+
if (isRemote.value) {
|
504
|
+
remoteDefaultList.value = remoteDefaultList.value.filter((item) => item.key !== key);
|
505
|
+
}
|
506
|
+
const node = treeMap.get(key);
|
507
|
+
if (!node)
|
709
508
|
return;
|
509
|
+
if (!props.multiple) {
|
510
|
+
return updateTreeChecked(checked ? [key] : [], void 0, {
|
511
|
+
node,
|
512
|
+
action: checked ? "check" : "uncheck"
|
513
|
+
});
|
710
514
|
}
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
515
|
+
const keys = checkedKeys.value;
|
516
|
+
const map = new Set(keys);
|
517
|
+
if (checked) {
|
518
|
+
const targetKey = getTopLevelCheckedKey(node, new Set(keys), treeMap);
|
519
|
+
const allKeys = getAllKeys([treeMap.get(targetKey)], "all");
|
520
|
+
if (checkStrategyResult.value === "all") {
|
521
|
+
allKeys.forEach((k) => map.add(k));
|
522
|
+
} else {
|
523
|
+
allKeys.forEach((k) => map.delete(k));
|
524
|
+
if (checkStrategyResult.value === "child") {
|
525
|
+
getAllKeys([treeMap.get(targetKey)], "child").forEach((k) => map.add(k));
|
526
|
+
} else {
|
527
|
+
map.add(targetKey);
|
528
|
+
}
|
529
|
+
}
|
530
|
+
} else {
|
531
|
+
getParentKeys(node, treeMap).forEach((k) => map.delete(k));
|
532
|
+
getAllKeys([treeMap.get(key)], "all").forEach((k) => map.delete(k));
|
533
|
+
}
|
534
|
+
updateTreeChecked(Array.from(map), void 0, {
|
535
|
+
node,
|
536
|
+
action: checked ? "check" : "uncheck"
|
720
537
|
});
|
721
538
|
}
|
722
|
-
function
|
723
|
-
|
724
|
-
if (
|
725
|
-
return
|
539
|
+
function notifyCheck(key, isChecked = true) {
|
540
|
+
const node = treeMap.get(key);
|
541
|
+
if (!node)
|
542
|
+
return;
|
543
|
+
if (!isChecked) {
|
544
|
+
updateChecked(key, isChecked);
|
545
|
+
return;
|
726
546
|
}
|
727
|
-
const
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
547
|
+
const has = checkedKeys.value.includes(key);
|
548
|
+
if (has) {
|
549
|
+
$message.info(`${node.label}\u5DF2\u88AB\u9009\u62E9`);
|
550
|
+
return;
|
551
|
+
}
|
552
|
+
if (node.disabled) {
|
553
|
+
$message.info(`${node.label}\u5DF2\u88AB\u7981\u7528`);
|
554
|
+
return;
|
555
|
+
}
|
556
|
+
const hasParent = props.multiple && getParentKeys(node, treeMap).find((key2) => checkedKeys.value.includes(key2));
|
557
|
+
if (hasParent) {
|
558
|
+
$message.info(`${node.label}\u5DF2\u5B58\u5728\u4E8E${treeMap.get(hasParent).label}\u4E2D`);
|
559
|
+
return;
|
560
|
+
}
|
561
|
+
if (!props.multiple) {
|
562
|
+
keyword.value = "";
|
563
|
+
checkSearchClear("");
|
564
|
+
}
|
565
|
+
updateChecked(key, isChecked);
|
566
|
+
}
|
567
|
+
function checkSearchClear(kw) {
|
568
|
+
if (!kw) {
|
569
|
+
isSearch.value = false;
|
570
|
+
}
|
571
|
+
}
|
572
|
+
function getCheckWithLevel(strategy, hideLeaf) {
|
573
|
+
const getCheckedKeys = (map2, strategy2) => {
|
574
|
+
const visited = /* @__PURE__ */ new Set();
|
575
|
+
const checked = new Set(checkedKeys.value);
|
576
|
+
const result = [];
|
577
|
+
checkedKeys.value.forEach((k) => {
|
578
|
+
const node = !visited.has(k) && map2.get(k);
|
579
|
+
if (node) {
|
580
|
+
const key = getTopLevelCheckedKey(node, checked, map2);
|
581
|
+
const target = !visited.has(key) && map2.get(key);
|
582
|
+
visited.add(key);
|
583
|
+
if (target)
|
584
|
+
result.push(...getAllKeys([target], strategy2));
|
585
|
+
}
|
586
|
+
});
|
587
|
+
return result;
|
588
|
+
};
|
589
|
+
const createMap = (hideLeaf2) => {
|
590
|
+
const itemKey = props.itemKey;
|
591
|
+
const result = /* @__PURE__ */ new Map();
|
592
|
+
transformData(props.data, null, {
|
593
|
+
enter(node) {
|
594
|
+
node.key = itemKey ? itemKey(node.originItem) : node.key;
|
595
|
+
result.set(node.key, node);
|
596
|
+
},
|
597
|
+
leave: hideLeaf2 ? (node) => {
|
598
|
+
var _a;
|
599
|
+
if (!node.leaf && ((_a = node.children) == null ? void 0 : _a.length)) {
|
600
|
+
const children = node.children.filter((val) => !val.leaf);
|
601
|
+
node.children = children.length ? children : void 0;
|
602
|
+
}
|
603
|
+
} : void 0
|
604
|
+
});
|
605
|
+
return result;
|
606
|
+
};
|
607
|
+
strategy = strategy || checkStrategyResult.value;
|
608
|
+
hideLeaf = hideLeaf != null ? hideLeaf : props.hideLeaf;
|
609
|
+
const same = hideLeaf === props.hideLeaf && strategy === checkStrategyResult.value;
|
610
|
+
const map = same ? treeMap : createMap(hideLeaf);
|
611
|
+
const keys = same ? checkedKeys.value : getCheckedKeys(map, strategy);
|
612
|
+
return keys.map((k) => {
|
613
|
+
const node = map.get(k);
|
614
|
+
const parent = node.parentKey ? map.get(node.parentKey) : void 0;
|
615
|
+
return {
|
616
|
+
...node,
|
617
|
+
parentNode: parent
|
618
|
+
};
|
619
|
+
}).filter((tag) => !props.uncheckableField || props.uncheckableField && !tag.originItem[props.uncheckableField]);
|
734
620
|
}
|
735
621
|
function resetParams() {
|
736
622
|
keyword.value = "";
|
737
623
|
checkedAll.value = isSearch.value = false;
|
738
624
|
checkedKeys.value = [];
|
739
625
|
expandedKeys.value = [];
|
740
|
-
treeData.value = [];
|
741
|
-
tagData.value = [];
|
742
|
-
initTagData.value = [];
|
743
|
-
allCheckedTreeKeys.value = [];
|
626
|
+
treeData.value = treeAsyncData.value = [];
|
744
627
|
}
|
745
628
|
watch(() => props.data, (value) => {
|
746
629
|
resetParams();
|
747
|
-
|
630
|
+
initTreeData();
|
748
631
|
}, {
|
749
632
|
immediate: true
|
750
633
|
});
|
751
634
|
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
635
|
emit("check", value.value);
|
770
|
-
emit("checkWithLevel",
|
636
|
+
emit("checkWithLevel", caculateTagData.value);
|
771
637
|
}, {
|
772
638
|
deep: true
|
773
639
|
});
|
774
|
-
watch(() => keyword.value, (searchValue) => {
|
775
|
-
if (!searchValue) {
|
776
|
-
notifySearchClear();
|
777
|
-
}
|
778
|
-
});
|
779
640
|
expose({
|
780
641
|
getCheckWithLevel
|
781
642
|
});
|
@@ -785,78 +646,71 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
785
646
|
class: "c-select-person"
|
786
647
|
}, {
|
787
648
|
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]
|
649
|
+
default: withCtx(() => [createElementVNode("div", {
|
650
|
+
class: "c-select-person__container",
|
651
|
+
style: normalizeStyle(`padding-right: 12px;border-right: 1px solid #e8e8e8;height: ${__props.height}`)
|
652
|
+
}, [createElementVNode("div", _hoisted_1, [createCommentVNode(" \u641C\u7D22\u5DE6\u4FA7\u8FC7\u6EE4\u7B5B\u9009\u63D2\u69FD "), renderSlot(_ctx.$slots, "filter"), createVNode(unref(NInputGroup), null, {
|
653
|
+
default: withCtx(() => [createVNode(unref(NInput), {
|
654
|
+
class: "search-input",
|
655
|
+
clearable: "",
|
656
|
+
value: keyword.value,
|
657
|
+
"onUpdate:value": [_cache[0] || (_cache[0] = ($event) => keyword.value = $event), checkSearchClear],
|
658
|
+
placeholder: __props.searchPlaceholder,
|
659
|
+
onKeyup: withKeys(onSearch, ["enter"])
|
660
|
+
}, null, 8, ["value", "placeholder", "onKeyup"]), createVNode(unref(NButton), {
|
661
|
+
type: "primary",
|
662
|
+
onClick: onSearch
|
834
663
|
}, {
|
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
|
-
}())]),
|
664
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchButtonText), 1)]),
|
843
665
|
_: 1
|
844
|
-
}
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
}
|
859
|
-
|
666
|
+
})]),
|
667
|
+
_: 1
|
668
|
+
})]), __props.multiple && !isSearch.value && unref(treeData).length > 0 ? withDirectives((openBlock(), createBlock(unref(NCheckbox), {
|
669
|
+
key: 0,
|
670
|
+
checked: checkedAll.value,
|
671
|
+
"onUpdate:checked": [_cache[1] || (_cache[1] = ($event) => checkedAll.value = $event), checkedAllChange]
|
672
|
+
}, {
|
673
|
+
default: withCtx(() => [createTextVNode(function() {
|
674
|
+
var _a, _b, _c;
|
675
|
+
try {
|
676
|
+
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";
|
677
|
+
} catch (e) {
|
678
|
+
return "\u5168\u9009";
|
679
|
+
}
|
680
|
+
}())]),
|
681
|
+
_: 1
|
682
|
+
}, 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, {
|
683
|
+
key: 1,
|
684
|
+
class: "c-select-person__hide",
|
685
|
+
type: unref(showType),
|
686
|
+
data: unref(searchData),
|
687
|
+
showTagHover: __props.showTagHover,
|
688
|
+
getChildren,
|
689
|
+
onChecked: notifyCheck
|
690
|
+
}, null, 8, ["type", "data", "showTagHover"])) : (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(NTree), mergeProps({
|
691
|
+
"expanded-keys": expandedKeys.value,
|
692
|
+
"onUpdate:expanded-keys": _cache[2] || (_cache[2] = ($event) => expandedKeys.value = $event),
|
693
|
+
"selected-keys": checkedKeys.value,
|
694
|
+
"onUpdate:selected-keys": _cache[3] || (_cache[3] = ($event) => checkedKeys.value = $event),
|
695
|
+
style: {
|
696
|
+
"height": "100%"
|
697
|
+
},
|
698
|
+
"checked-keys": checkedKeys.value,
|
699
|
+
checkable: __props.multiple,
|
700
|
+
selectable: !__props.multiple,
|
701
|
+
data: unref(renderTreeData),
|
702
|
+
"render-label": renderLabel,
|
703
|
+
"virtual-scroll": "",
|
704
|
+
cascade: !__props.onlyForwardCascade,
|
705
|
+
"allow-checking-not-loaded": "",
|
706
|
+
"check-strategy": "child"
|
707
|
+
}, __props.treeSetting, {
|
708
|
+
class: "c-select-person__scroll",
|
709
|
+
"onUpdate:checkedKeys": updateTreeChecked,
|
710
|
+
onLoad: queryLoadChildNode
|
711
|
+
}), {
|
712
|
+
empty: withCtx(() => [createVNode(unref(DefaultPage), {
|
713
|
+
type: "16",
|
860
714
|
description: function() {
|
861
715
|
var _a, _b, _c;
|
862
716
|
try {
|
@@ -865,72 +719,64 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
865
719
|
return "\u6682\u65E0\u6570\u636E";
|
866
720
|
}
|
867
721
|
}()
|
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
|
-
})]),
|
722
|
+
})]),
|
723
|
+
_: 1
|
724
|
+
}, 16, ["expanded-keys", "selected-keys", "checked-keys", "checkable", "selectable", "data", "cascade"])]))], 4)]),
|
890
725
|
_: 3
|
891
726
|
}), createVNode(unref(NGi), null, {
|
892
|
-
default: withCtx(() => [
|
893
|
-
|
727
|
+
default: withCtx(() => [createElementVNode("div", {
|
728
|
+
class: "c-select-person__container",
|
729
|
+
style: normalizeStyle(`padding-left: 12px;height:${__props.height}`)
|
730
|
+
}, [createVNode(unref(NSpace), {
|
731
|
+
justify: "space-between",
|
894
732
|
style: {
|
895
|
-
"
|
733
|
+
"margin-bottom": "20px"
|
896
734
|
}
|
897
735
|
}, {
|
898
|
-
default: withCtx(() => [
|
899
|
-
|
900
|
-
|
901
|
-
|
736
|
+
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", {
|
737
|
+
key: 1,
|
738
|
+
class: "c-select-person__clear-btn",
|
739
|
+
onClick: clearAll
|
740
|
+
}, function() {
|
741
|
+
var _a, _b, _c;
|
742
|
+
try {
|
743
|
+
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";
|
744
|
+
} catch (e) {
|
745
|
+
return "\u6E05\u7A7A";
|
902
746
|
}
|
747
|
+
}())) : createCommentVNode("v-if", true)]),
|
748
|
+
_: 1
|
749
|
+
}), createElementVNode("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(caculateTagData), (tag) => {
|
750
|
+
return openBlock(), createElementBlock(Fragment, {
|
751
|
+
key: tag.key
|
752
|
+
}, [__props.showTagHover && tag.innerItemsNum > 0 ? (openBlock(), createBlock(unref(NPopover), {
|
753
|
+
key: 0,
|
754
|
+
trigger: "hover"
|
903
755
|
}, {
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
component: unref(CloseCircleSharp),
|
929
|
-
onClick: ($event) => closeTag(tag)
|
930
|
-
}, null, 8, ["component", "onClick"])]);
|
931
|
-
}), 128))], 4)]),
|
932
|
-
_: 3
|
933
|
-
})]),
|
756
|
+
trigger: withCtx(() => [createVNode(TagItem, {
|
757
|
+
tag,
|
758
|
+
onUnchecked: updateChecked
|
759
|
+
}, {
|
760
|
+
tag: withCtx((filterProps) => [renderSlot(_ctx.$slots, "tag", normalizeProps(guardReactiveProps(filterProps)))]),
|
761
|
+
_: 2
|
762
|
+
}, 1032, ["tag"])]),
|
763
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(getChildren(tag), (childTag) => {
|
764
|
+
return openBlock(), createBlock(TagItem, {
|
765
|
+
key: childTag.key,
|
766
|
+
tag: childTag,
|
767
|
+
showClose: false
|
768
|
+
}, null, 8, ["tag"]);
|
769
|
+
}), 128))])]),
|
770
|
+
_: 2
|
771
|
+
}, 1024)) : (openBlock(), createBlock(TagItem, {
|
772
|
+
key: 1,
|
773
|
+
tag,
|
774
|
+
onUnchecked: updateChecked
|
775
|
+
}, {
|
776
|
+
tag: withCtx((filterProps) => [renderSlot(_ctx.$slots, "tag", normalizeProps(guardReactiveProps(filterProps)))]),
|
777
|
+
_: 2
|
778
|
+
}, 1032, ["tag"]))], 64);
|
779
|
+
}), 128))])], 4)]),
|
934
780
|
_: 3
|
935
781
|
})]),
|
936
782
|
_: 3
|