cnhis-design-vue 3.3.3-beta.7 → 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 +36 -4
- 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/src/components/NewPrintComponent.vue2.js +3 -0
- 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 +3 -3
- package/es/components/field-set/src/FieldFilter.vue.d.ts +3 -3
- package/es/components/field-set/src/FieldSet.vue.d.ts +35 -4
- 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 +3 -3
- 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/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 +53 -3
- package/es/components/scale-view/src/ScaleView.vue.d.ts +56 -5
- package/es/components/scale-view/src/ScaleView.vue2.js +79 -4
- 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 +3 -0
- package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +26 -2
- package/es/components/scale-view/src/components/EvaluatePage.vue.d.ts +3 -0
- package/es/components/scale-view/src/components/EvaluatePage.vue2.js +27 -6
- 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 +45 -3
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +16 -2
- 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 +18 -3
- 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/select-person/index.d.ts +792 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +433 -273
- package/es/components/select-person/src/SelectPerson.vue.js +6 -0
- package/es/components/select-person/src/SelectPerson.vue2.js +788 -0
- package/es/components/select-person/src/SelectPersonRole.vue.js +2 -2
- 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 +25 -2
- 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
@@ -0,0 +1,788 @@
|
|
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';
|
8
|
+
import { InjectionSelectPersonEmits } from './constants/index.js';
|
9
|
+
|
10
|
+
const _hoisted_1 = {
|
11
|
+
class: "search-box"
|
12
|
+
};
|
13
|
+
const _hoisted_2 = {
|
14
|
+
key: 2,
|
15
|
+
class: "c-select-person__hide"
|
16
|
+
};
|
17
|
+
const _hoisted_3 = {
|
18
|
+
key: 0
|
19
|
+
};
|
20
|
+
const _hoisted_4 = {
|
21
|
+
class: "c-select-person__containerRight"
|
22
|
+
};
|
23
|
+
const _hoisted_5 = {
|
24
|
+
class: "c-select-person__popover"
|
25
|
+
};
|
26
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
27
|
+
__name: "SelectPerson",
|
28
|
+
props: {
|
29
|
+
defaultList: {
|
30
|
+
type: Array,
|
31
|
+
default: () => []
|
32
|
+
},
|
33
|
+
data: {
|
34
|
+
type: Array,
|
35
|
+
default: () => []
|
36
|
+
},
|
37
|
+
searchPlaceholder: {
|
38
|
+
type: String,
|
39
|
+
default: function() {
|
40
|
+
var _a, _b, _c;
|
41
|
+
try {
|
42
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.508")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.508")) || "\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22";
|
43
|
+
} catch (e) {
|
44
|
+
return "\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22";
|
45
|
+
}
|
46
|
+
}()
|
47
|
+
},
|
48
|
+
searchButtonText: {
|
49
|
+
type: String,
|
50
|
+
default: function() {
|
51
|
+
var _a, _b, _c;
|
52
|
+
try {
|
53
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.36")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.36")) || "\u641C\u7D22";
|
54
|
+
} catch (e) {
|
55
|
+
return "\u641C\u7D22";
|
56
|
+
}
|
57
|
+
}()
|
58
|
+
},
|
59
|
+
wordbook: {
|
60
|
+
type: Object,
|
61
|
+
default: () => ({})
|
62
|
+
},
|
63
|
+
wordbookChild: {
|
64
|
+
type: Object,
|
65
|
+
default: () => ({})
|
66
|
+
},
|
67
|
+
showCount: {
|
68
|
+
type: Boolean,
|
69
|
+
default: true
|
70
|
+
},
|
71
|
+
showClear: {
|
72
|
+
type: Boolean,
|
73
|
+
default: true
|
74
|
+
},
|
75
|
+
multiple: {
|
76
|
+
type: Boolean,
|
77
|
+
default: true
|
78
|
+
},
|
79
|
+
searchInner: {
|
80
|
+
type: Boolean,
|
81
|
+
default: false
|
82
|
+
},
|
83
|
+
searchFilter: {
|
84
|
+
type: Object,
|
85
|
+
default: () => ({})
|
86
|
+
},
|
87
|
+
treeSetting: {
|
88
|
+
type: Object,
|
89
|
+
default: () => ({})
|
90
|
+
},
|
91
|
+
queryLoadChildData: {
|
92
|
+
type: Function,
|
93
|
+
default: void 0
|
94
|
+
},
|
95
|
+
queryTreeSearch: {
|
96
|
+
type: Function,
|
97
|
+
default: () => Promise.resolve([])
|
98
|
+
},
|
99
|
+
forceShowSelectAll: {
|
100
|
+
type: Boolean
|
101
|
+
},
|
102
|
+
uncheckableField: {
|
103
|
+
type: String
|
104
|
+
},
|
105
|
+
onlyForwardCascade: {
|
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
|
+
}
|
123
|
+
},
|
124
|
+
setup(__props, {
|
125
|
+
expose
|
126
|
+
}) {
|
127
|
+
const props = __props;
|
128
|
+
const $message = useMessage();
|
129
|
+
const emit = inject(InjectionSelectPersonEmits);
|
130
|
+
const keyword = ref("");
|
131
|
+
const checkedAll = ref(false);
|
132
|
+
const checkedKeys = ref([]);
|
133
|
+
const expandedKeys = ref([]);
|
134
|
+
const treeData = shallowRef([]);
|
135
|
+
const treeAsyncData = ref([]);
|
136
|
+
const searchTreeData = shallowRef([]);
|
137
|
+
const searchData = shallowRef([]);
|
138
|
+
const treeMap = /* @__PURE__ */ new Map();
|
139
|
+
const isSearch = ref(false);
|
140
|
+
const remoteDefaultList = ref([]);
|
141
|
+
const isRemote = computed(() => props.queryLoadChildData ? true : false);
|
142
|
+
const checkStrategyResult = computed(() => {
|
143
|
+
var _a, _b;
|
144
|
+
return (_b = (_a = props == null ? void 0 : props.treeSetting) == null ? void 0 : _a.checkStrategy) != null ? _b : "child";
|
145
|
+
});
|
146
|
+
const isSearchFilter = computed(() => (props == null ? void 0 : props.searchFilter) && Object.keys(props == null ? void 0 : props.searchFilter).length > 0);
|
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);
|
150
|
+
});
|
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" : "";
|
154
|
+
});
|
155
|
+
const caculateTagData = computed(() => {
|
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];
|
161
|
+
}
|
162
|
+
return re;
|
163
|
+
});
|
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;
|
170
|
+
});
|
171
|
+
function initTreeData() {
|
172
|
+
var _a;
|
173
|
+
treeMap.clear();
|
174
|
+
const {
|
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
|
190
|
+
});
|
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
|
+
};
|
198
|
+
});
|
199
|
+
}
|
200
|
+
checkedKeys.value = props.defaultList.filter((k) => treeMap.has(k));
|
201
|
+
}
|
202
|
+
async function queryLoadChildNode(node) {
|
203
|
+
var _a;
|
204
|
+
if (props.queryLoadChildData) {
|
205
|
+
const {
|
206
|
+
itemKey,
|
207
|
+
hideLeaf
|
208
|
+
} = props;
|
209
|
+
const curNode = await props.queryLoadChildData(node);
|
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
|
223
|
+
});
|
224
|
+
curNode.children = tempData.treeItems;
|
225
|
+
}
|
226
|
+
return curNode;
|
227
|
+
}
|
228
|
+
return node;
|
229
|
+
}
|
230
|
+
function renderLabel({
|
231
|
+
option
|
232
|
+
}) {
|
233
|
+
var _a, _b;
|
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}`;
|
237
|
+
return createVNode("span", {
|
238
|
+
"title": labelStr
|
239
|
+
}, [labelStr]);
|
240
|
+
} else {
|
241
|
+
const labelExpand = (_b = option.labelExpand) != null ? _b : "";
|
242
|
+
return createVNode("p", {
|
243
|
+
"class": "user_item"
|
244
|
+
}, [createVNode("span", {
|
245
|
+
"title": option.label
|
246
|
+
}, [option.label]), createVNode("span", {
|
247
|
+
"class": "user_item_expand",
|
248
|
+
"title": labelExpand
|
249
|
+
}, [labelExpand])]);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
function getChildren(tag) {
|
253
|
+
var _a;
|
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);
|
267
|
+
}
|
268
|
+
});
|
269
|
+
return getAllChildren(tempData.treeItems, childrenKey);
|
270
|
+
}
|
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
|
+
}
|
327
|
+
} else {
|
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;
|
338
|
+
}
|
339
|
+
leave && leave(tree);
|
340
|
+
return tree;
|
341
|
+
});
|
342
|
+
return {
|
343
|
+
treeItems,
|
344
|
+
leafCount
|
345
|
+
};
|
346
|
+
}
|
347
|
+
async function onSearch() {
|
348
|
+
var _a, _b, _c, _d;
|
349
|
+
const filterKey = (_b = (_a = props == null ? void 0 : props.wordbook) == null ? void 0 : _a.filter_key) != null ? _b : "keyword";
|
350
|
+
const kw = keyword.value.trim();
|
351
|
+
isSearch.value = !!kw;
|
352
|
+
if (!kw) {
|
353
|
+
searchData.value = [];
|
354
|
+
return;
|
355
|
+
}
|
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);
|
370
|
+
}
|
371
|
+
if (node.children && node.children.length > 0) {
|
372
|
+
stack.push(...node.children);
|
373
|
+
}
|
374
|
+
}
|
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;
|
418
|
+
}
|
419
|
+
}
|
420
|
+
function getAllKeys(tree, strategy) {
|
421
|
+
const keys = [];
|
422
|
+
const recursion = strategy != "parent";
|
423
|
+
for (let i = 0, len = tree.length; i < len; i++) {
|
424
|
+
const item = tree[i];
|
425
|
+
if (!item.disabled && item.key) {
|
426
|
+
if (!recursion || strategy == "all" || !item.children) {
|
427
|
+
keys.push(item.key);
|
428
|
+
}
|
429
|
+
if (recursion && item.children) {
|
430
|
+
keys.push(...getAllKeys(item.children, strategy));
|
431
|
+
}
|
432
|
+
}
|
433
|
+
}
|
434
|
+
return keys;
|
435
|
+
}
|
436
|
+
function getParentKeys(node, map) {
|
437
|
+
var _a;
|
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;
|
443
|
+
}
|
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
|
+
}
|
455
|
+
}
|
456
|
+
return node.key;
|
457
|
+
}
|
458
|
+
function checkedAllChange(checked) {
|
459
|
+
checkedKeys.value = checked ? getAllKeys(treeData.value, checkStrategyResult.value) : [];
|
460
|
+
}
|
461
|
+
function getFlattenKeys(tree) {
|
462
|
+
const arr = [];
|
463
|
+
tree.forEach((item) => {
|
464
|
+
var _a;
|
465
|
+
if (!item.disabled && item.key) {
|
466
|
+
arr.push(item.key);
|
467
|
+
}
|
468
|
+
if ((_a = item.children) == null ? void 0 : _a.length) {
|
469
|
+
const _arr = getFlattenKeys(item.children);
|
470
|
+
arr.push(..._arr);
|
471
|
+
}
|
472
|
+
});
|
473
|
+
return arr;
|
474
|
+
}
|
475
|
+
function updateTreeChecked(keys, _, meta) {
|
476
|
+
var _a;
|
477
|
+
let newKeys = keys;
|
478
|
+
if (props.onlyForwardCascade && checkStrategyResult.value === "all") {
|
479
|
+
const {
|
480
|
+
node,
|
481
|
+
action
|
482
|
+
} = meta;
|
483
|
+
if ((_a = node == null ? void 0 : node.children) == null ? void 0 : _a.length) {
|
484
|
+
const flattenKeys = getFlattenKeys(node.children);
|
485
|
+
if (action === "check") {
|
486
|
+
newKeys = union(keys, flattenKeys);
|
487
|
+
} else {
|
488
|
+
remove(newKeys, (key) => flattenKeys.includes(key));
|
489
|
+
}
|
490
|
+
}
|
491
|
+
}
|
492
|
+
checkedKeys.value = newKeys;
|
493
|
+
if (!keys.length) {
|
494
|
+
checkedAll.value = false;
|
495
|
+
}
|
496
|
+
}
|
497
|
+
function clearAll() {
|
498
|
+
checkedAll.value = false;
|
499
|
+
checkedKeys.value = [];
|
500
|
+
remoteDefaultList.value = [];
|
501
|
+
}
|
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)
|
508
|
+
return;
|
509
|
+
if (!props.multiple) {
|
510
|
+
return updateTreeChecked(checked ? [key] : [], void 0, {
|
511
|
+
node,
|
512
|
+
action: checked ? "check" : "uncheck"
|
513
|
+
});
|
514
|
+
}
|
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"
|
537
|
+
});
|
538
|
+
}
|
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;
|
546
|
+
}
|
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]);
|
620
|
+
}
|
621
|
+
function resetParams() {
|
622
|
+
keyword.value = "";
|
623
|
+
checkedAll.value = isSearch.value = false;
|
624
|
+
checkedKeys.value = [];
|
625
|
+
expandedKeys.value = [];
|
626
|
+
treeData.value = treeAsyncData.value = [];
|
627
|
+
}
|
628
|
+
watch(() => props.data, (value) => {
|
629
|
+
resetParams();
|
630
|
+
initTreeData();
|
631
|
+
}, {
|
632
|
+
immediate: true
|
633
|
+
});
|
634
|
+
watch(() => checkedKeys, (value) => {
|
635
|
+
emit("check", value.value);
|
636
|
+
emit("checkWithLevel", caculateTagData.value);
|
637
|
+
}, {
|
638
|
+
deep: true
|
639
|
+
});
|
640
|
+
expose({
|
641
|
+
getCheckWithLevel
|
642
|
+
});
|
643
|
+
return (_ctx, _cache) => {
|
644
|
+
return openBlock(), createBlock(unref(NGrid), {
|
645
|
+
cols: 2,
|
646
|
+
class: "c-select-person"
|
647
|
+
}, {
|
648
|
+
default: withCtx(() => [createVNode(unref(NGi), null, {
|
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
|
663
|
+
}, {
|
664
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchButtonText), 1)]),
|
665
|
+
_: 1
|
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",
|
714
|
+
description: function() {
|
715
|
+
var _a, _b, _c;
|
716
|
+
try {
|
717
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.445")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.445")) || "\u6682\u65E0\u6570\u636E";
|
718
|
+
} catch (e) {
|
719
|
+
return "\u6682\u65E0\u6570\u636E";
|
720
|
+
}
|
721
|
+
}()
|
722
|
+
})]),
|
723
|
+
_: 1
|
724
|
+
}, 16, ["expanded-keys", "selected-keys", "checked-keys", "checkable", "selectable", "data", "cascade"])]))], 4)]),
|
725
|
+
_: 3
|
726
|
+
}), createVNode(unref(NGi), null, {
|
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",
|
732
|
+
style: {
|
733
|
+
"margin-bottom": "20px"
|
734
|
+
}
|
735
|
+
}, {
|
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";
|
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"
|
755
|
+
}, {
|
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)]),
|
780
|
+
_: 3
|
781
|
+
})]),
|
782
|
+
_: 3
|
783
|
+
});
|
784
|
+
};
|
785
|
+
}
|
786
|
+
});
|
787
|
+
|
788
|
+
export { _sfc_main as default };
|