hy-dispatch-ui-v3 0.1.5 → 0.2.0
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 +47 -0
- package/dist/tailwind.css +408 -4
- package/es/components/appAudioPlayer/appAudioPlayer.vue.mjs +462 -0
- package/es/components/appAudioPlayer/index.mjs +6 -0
- package/es/components/appAudioPlayer/js/index.mjs +327 -0
- package/es/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
- package/es/components/appButton/style/appButton.scss +0 -1
- package/es/components/appConfigProvider/appConfigProvider.vue.mjs +25 -4
- package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
- package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
- package/es/components/appCutter/appCutter.vue.mjs +358 -0
- package/es/components/appCutter/index.mjs +6 -0
- package/es/components/appCutter/style/appCutter.scss +51 -0
- package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
- package/es/components/appDialog/appDialog.vue.mjs +205 -0
- package/es/components/appDialog/index.mjs +6 -0
- package/es/components/appDialog/style/appDialog.scss +0 -0
- package/es/components/appForm/appForm.vue.mjs +132 -209
- package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
- package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
- package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
- package/es/components/appForm/js/index.mjs +46 -24
- package/es/components/appForm/js/useAppForm.mjs +30 -6
- package/es/components/appForm/style/appForm.scss +53 -0
- package/es/components/appIcon/appIcon.vue.mjs +2 -1
- package/es/components/appIconBox/style/appIconBox.scss +0 -1
- package/es/components/appInput/appInput.vue.mjs +99 -0
- package/es/components/appInput/index.mjs +6 -0
- package/es/components/appMenu/appMenu.vue.mjs +129 -0
- package/es/components/appMenu/index.mjs +6 -0
- package/es/components/appMenu/style/appMenu.scss +145 -0
- package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
- package/es/components/appSearch/appSearch.vue.mjs +55 -211
- package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
- package/es/components/appSearch/js/index.mjs +20 -8
- package/es/components/appSearch/js/useAppSearch.mjs +10 -5
- package/es/components/appSearch/style/appSearch.scss +10 -0
- package/es/components/appTable/appTable.vue.mjs +313 -159
- package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
- package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
- package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
- package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
- package/es/components/appTable/js/index.mjs +46 -20
- package/es/components/appTable/js/search.mjs +1 -2
- package/es/components/appTable/js/useAppTable.mjs +58 -14
- package/es/components/appTable/style/appTable.scss +16 -0
- package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
- package/es/components/appTree/appTree.vue.mjs +304 -0
- package/es/components/appTree/index.mjs +6 -0
- package/es/components/appTree/js/index.mjs +531 -0
- package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
- package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
- package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
- package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
- package/es/components/appVideoPlayer/index.mjs +6 -0
- package/es/components/appVideoPlayer/js/index.mjs +426 -0
- package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
- package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
- package/es/components/index.mjs +7 -0
- package/es/hooks/index.mjs +3 -0
- package/es/hooks/useApi.mjs +7 -3
- package/es/hooks/useAudioPlayerConfig.mjs +12 -0
- package/es/hooks/useGlobalConfig.mjs +20 -9
- package/es/hooks/useLocale.mjs +10 -8
- package/es/hooks/useMixins.mjs +1 -1
- package/es/hooks/usePermissionMap.mjs +12 -0
- package/es/hooks/useUserAvatarMap.mjs +6 -3
- package/es/hooks/useVideoPlayerConfig.mjs +12 -0
- package/es/index.mjs +16 -3
- package/es/locale/en.mjs +58 -4
- package/es/locale/zh_CN.mjs +56 -6
- package/es/make-installer.mjs +2 -0
- package/es/static/hy-svg-icons.js +462 -0
- package/es/static/protocolcheck.js +247 -0
- package/es/style/element/element.scss +9 -0
- package/es/style/element/index.scss +6 -3
- package/es/style/index.scss +11 -0
- package/es/style/theme.scss +73 -0
- package/es/utils/date.mjs +25 -1
- package/es/utils/file.mjs +69 -0
- package/es/utils/form.mjs +52 -0
- package/es/utils/handler.mjs +22 -2
- package/es/utils/index.mjs +6 -3
- package/es/utils/is.mjs +26 -2
- package/es/utils/loadScript.mjs +33 -0
- package/es/version.mjs +1 -1
- package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
- package/lib/components/appAudioPlayer/index.js +11 -0
- package/lib/components/appAudioPlayer/js/index.js +329 -0
- package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
- package/lib/components/appButton/style/appButton.scss +0 -1
- package/lib/components/appConfigProvider/appConfigProvider.vue.js +23 -2
- package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
- package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
- package/lib/components/appCutter/appCutter.vue.js +362 -0
- package/lib/components/appCutter/index.js +11 -0
- package/lib/components/appCutter/style/appCutter.scss +51 -0
- package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
- package/lib/components/appDialog/appDialog.vue.js +209 -0
- package/lib/components/appDialog/index.js +11 -0
- package/lib/components/appDialog/style/appDialog.scss +0 -0
- package/lib/components/appForm/appForm.vue.js +129 -206
- package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
- package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
- package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
- package/lib/components/appForm/js/index.js +48 -23
- package/lib/components/appForm/js/useAppForm.js +30 -6
- package/lib/components/appForm/style/appForm.scss +53 -0
- package/lib/components/appIcon/appIcon.vue.js +2 -1
- package/lib/components/appIconBox/style/appIconBox.scss +0 -1
- package/lib/components/appInput/appInput.vue.js +103 -0
- package/lib/components/appInput/index.js +11 -0
- package/lib/components/appMenu/appMenu.vue.js +133 -0
- package/lib/components/appMenu/index.js +11 -0
- package/lib/components/appMenu/style/appMenu.scss +145 -0
- package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
- package/lib/components/appSearch/appSearch.vue.js +51 -207
- package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
- package/lib/components/appSearch/js/index.js +20 -7
- package/lib/components/appSearch/js/useAppSearch.js +10 -5
- package/lib/components/appSearch/style/appSearch.scss +10 -0
- package/lib/components/appTable/appTable.vue.js +320 -166
- package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
- package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
- package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
- package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
- package/lib/components/appTable/js/index.js +47 -19
- package/lib/components/appTable/js/search.js +1 -2
- package/lib/components/appTable/js/useAppTable.js +57 -13
- package/lib/components/appTable/style/appTable.scss +16 -0
- package/lib/components/appTooltip/appTooltip.vue.js +23 -12
- package/lib/components/appTree/appTree.vue.js +308 -0
- package/lib/components/appTree/index.js +11 -0
- package/lib/components/appTree/js/index.js +533 -0
- package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
- package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
- package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
- package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
- package/lib/components/appVideoPlayer/index.js +11 -0
- package/lib/components/appVideoPlayer/js/index.js +429 -0
- package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
- package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
- package/lib/components/index.js +42 -28
- package/lib/hooks/index.js +9 -0
- package/lib/hooks/useApi.js +7 -3
- package/lib/hooks/useAudioPlayerConfig.js +15 -0
- package/lib/hooks/useGlobalConfig.js +18 -7
- package/lib/hooks/useLocale.js +9 -7
- package/lib/hooks/useMixins.js +1 -1
- package/lib/hooks/usePermissionMap.js +15 -0
- package/lib/hooks/useUserAvatarMap.js +5 -2
- package/lib/hooks/useVideoPlayerConfig.js +15 -0
- package/lib/index.js +70 -28
- package/lib/locale/en.js +58 -4
- package/lib/locale/zh_CN.js +56 -6
- package/lib/make-installer.js +2 -0
- package/lib/static/hy-svg-icons.js +459 -8
- package/lib/static/protocolcheck.js +249 -0
- package/lib/style/element/element.scss +9 -0
- package/lib/style/element/index.scss +6 -3
- package/lib/style/index.scss +11 -0
- package/lib/style/theme.scss +73 -0
- package/lib/utils/date.js +25 -0
- package/lib/utils/file.js +76 -0
- package/lib/utils/form.js +57 -0
- package/lib/utils/handler.js +22 -1
- package/lib/utils/index.js +19 -0
- package/lib/utils/is.js +27 -1
- package/lib/utils/loadScript.js +37 -0
- package/lib/version.js +1 -1
- package/package.json +13 -12
- package/es/config/index.mjs +0 -1
- package/es/static/hy-svg-icons.mjs +0 -11
- package/lib/config/index.js +0 -2
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* 二级导航栏 */
|
|
2
|
+
.operator-menu-box {
|
|
3
|
+
width: 57px;
|
|
4
|
+
height: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
color: rgba(var(--hy-main));
|
|
8
|
+
overflow: auto;
|
|
9
|
+
padding-top: 4px;
|
|
10
|
+
transition: all 0.3s linear;
|
|
11
|
+
background:
|
|
12
|
+
linear-gradient(180deg, rgba(33, 58, 84, 0.3) 0.08%, #213a54 100%),
|
|
13
|
+
radial-gradient(
|
|
14
|
+
21% 31% at 150% 40%,
|
|
15
|
+
rgba(61, 98, 134, 0.5) 0%,
|
|
16
|
+
rgba(61, 98, 134, 0) 100%
|
|
17
|
+
);
|
|
18
|
+
border-right: 1px solid rgba(var(--hy-border));
|
|
19
|
+
|
|
20
|
+
.operator-menu-list {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 0;
|
|
23
|
+
flex: 1;
|
|
24
|
+
overflow-y: auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.operator-menu-box-expand {
|
|
28
|
+
width: 240px;
|
|
29
|
+
|
|
30
|
+
.operator-menu-item {
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 58px;
|
|
33
|
+
padding: 0 16px;
|
|
34
|
+
font-size: 16px;
|
|
35
|
+
position: relative;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
|
|
38
|
+
.operator-label {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.operator-menu-item-active {
|
|
47
|
+
&::after {
|
|
48
|
+
content: '';
|
|
49
|
+
display: block;
|
|
50
|
+
width: 2px;
|
|
51
|
+
height: 16px;
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 0;
|
|
54
|
+
top: 50%;
|
|
55
|
+
transform: translateY(-50%);
|
|
56
|
+
background-color: rgba(var(--hy-theme));
|
|
57
|
+
}
|
|
58
|
+
.operator-label {
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.operator-menu-item-active,
|
|
65
|
+
.operator-menu-item:hover {
|
|
66
|
+
&::before {
|
|
67
|
+
content: '';
|
|
68
|
+
display: block;
|
|
69
|
+
width: calc(100% - 4px);
|
|
70
|
+
height: calc(100% - 6px);
|
|
71
|
+
position: absolute;
|
|
72
|
+
left: 0;
|
|
73
|
+
top: 3px;
|
|
74
|
+
background: linear-gradient(
|
|
75
|
+
90deg,
|
|
76
|
+
rgba(var(--hy-theme), 0) 2%,
|
|
77
|
+
rgba(var(--hy-theme), 0.4) 100%
|
|
78
|
+
);
|
|
79
|
+
border-radius: 0px 4px 4px 0px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:not(.operator-menu-box-expand) {
|
|
85
|
+
.operator-menu-item {
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 68px;
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
position: relative;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
margin-top: 2px;
|
|
92
|
+
|
|
93
|
+
&:first-child {
|
|
94
|
+
margin-top: 0px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.operator-label {
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 100%;
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
grid: 4px;
|
|
105
|
+
color: rgb(var(--hy-main));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.operator-menu-item-active {
|
|
109
|
+
&::after {
|
|
110
|
+
content: '';
|
|
111
|
+
display: block;
|
|
112
|
+
width: 2px;
|
|
113
|
+
height: 100%;
|
|
114
|
+
position: absolute;
|
|
115
|
+
left: 0;
|
|
116
|
+
top: 50%;
|
|
117
|
+
transform: translateY(-50%);
|
|
118
|
+
background-color: rgba(var(--hy-theme));
|
|
119
|
+
}
|
|
120
|
+
.operator-label {
|
|
121
|
+
font-weight: bold;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.operator-menu-item-active,
|
|
127
|
+
.operator-menu-item:hover {
|
|
128
|
+
&::before {
|
|
129
|
+
content: '';
|
|
130
|
+
display: block;
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: 100%;
|
|
133
|
+
position: absolute;
|
|
134
|
+
left: 0;
|
|
135
|
+
top: 0;
|
|
136
|
+
background: linear-gradient(
|
|
137
|
+
90deg,
|
|
138
|
+
rgba(var(--hy-theme), 0) 2%,
|
|
139
|
+
rgba(var(--hy-theme), 0.4) 100%
|
|
140
|
+
);
|
|
141
|
+
border-radius: 0px 4px 4px 0px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -23,7 +23,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
placeholder: {
|
|
26
|
-
type: String
|
|
26
|
+
type: String,
|
|
27
|
+
default: () => {
|
|
28
|
+
const { t } = useLocale();
|
|
29
|
+
return t("cascader.pleaseSelectDepartment");
|
|
30
|
+
}
|
|
27
31
|
},
|
|
28
32
|
/*
|
|
29
33
|
* false 直接显示输入框
|
|
@@ -77,7 +81,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
77
81
|
setup(__props, { emit: __emit }) {
|
|
78
82
|
const props = __props;
|
|
79
83
|
const emits = __emit;
|
|
80
|
-
const { t } = useLocale();
|
|
81
84
|
const { api } = useApi();
|
|
82
85
|
const modelValue = useModel(__props, "modelValue");
|
|
83
86
|
const cascaderRef = useTemplateRef("cascaderRef");
|
|
@@ -87,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
87
90
|
const cascaderValueMap = ref(/* @__PURE__ */ new Map());
|
|
88
91
|
const currentCompanyName = computed(() => {
|
|
89
92
|
const target = cascaderValueMap.value.get(modelValue.value);
|
|
90
|
-
return target
|
|
93
|
+
return target?.companyName;
|
|
91
94
|
});
|
|
92
95
|
function getCascaderData() {
|
|
93
96
|
unref(api).post("organization/orgTreeSimple").then((res) => {
|
|
@@ -96,8 +99,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
96
99
|
}
|
|
97
100
|
function handlerData(data) {
|
|
98
101
|
const cascaderMap = /* @__PURE__ */ new Map();
|
|
99
|
-
const handler = (list, parentIdsList = []) => {
|
|
100
|
-
list.forEach((item) => {
|
|
102
|
+
const handler = (list = [], parentIdsList = []) => {
|
|
103
|
+
(list || []).forEach((item) => {
|
|
101
104
|
item.label = item.companyName;
|
|
102
105
|
item.value = item.id;
|
|
103
106
|
item.parentIdsList = [...parentIdsList, item.id];
|
|
@@ -127,7 +130,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
127
130
|
function onChangeHanlder(value) {
|
|
128
131
|
cascaderRef.value.dropDownVisible = false;
|
|
129
132
|
onVisibleChangeHandler(false);
|
|
130
|
-
modelValue.value = value
|
|
133
|
+
modelValue.value = value?.[value.length - 1];
|
|
131
134
|
if (props.changeLastLayer) {
|
|
132
135
|
emits("change", modelValue.value);
|
|
133
136
|
} else {
|
|
@@ -143,8 +146,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
143
146
|
watch(
|
|
144
147
|
() => props.options,
|
|
145
148
|
() => {
|
|
146
|
-
|
|
147
|
-
if ((_a = props.options) == null ? void 0 : _a.length) {
|
|
149
|
+
if (props.options?.length) {
|
|
148
150
|
handlerData(props.options);
|
|
149
151
|
}
|
|
150
152
|
},
|
|
@@ -184,9 +186,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
184
186
|
disabled: __props.disabled,
|
|
185
187
|
props: { checkStrictly: true },
|
|
186
188
|
clearable: __props.clearable,
|
|
187
|
-
placeholder: __props.placeholder
|
|
189
|
+
placeholder: __props.placeholder,
|
|
188
190
|
filterable: "",
|
|
189
191
|
"show-all-levels": false,
|
|
192
|
+
"virtual-scroll": "",
|
|
190
193
|
onChange: onChangeHanlder,
|
|
191
194
|
onVisibleChange: ($event) => onVisibleChangeHandler($event)
|
|
192
195
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "size", "options", "disabled", "clearable", "placeholder", "onVisibleChange"])
|
|
@@ -223,9 +226,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
223
226
|
props: { checkStrictly: true },
|
|
224
227
|
clearable: __props.clearable,
|
|
225
228
|
disabled: __props.disabled,
|
|
226
|
-
placeholder: __props.placeholder
|
|
229
|
+
placeholder: __props.placeholder,
|
|
227
230
|
filterable: "",
|
|
228
231
|
"show-all-levels": false,
|
|
232
|
+
"virtual-scroll": "",
|
|
229
233
|
onChange: onChangeHanlder
|
|
230
234
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder"]))
|
|
231
235
|
]);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, computed, unref, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, toDisplayString, Fragment, createCommentVNode, normalizeStyle, mergeProps, renderList, createBlock,
|
|
2
|
-
import { ElIcon, ElForm
|
|
1
|
+
import { defineComponent, useTemplateRef, computed, unref, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, toDisplayString, Fragment, createCommentVNode, withDirectives, normalizeStyle, vShow, mergeProps, renderList, createBlock, createSlots, renderSlot } from 'vue';
|
|
2
|
+
import { ElIcon, ElForm } from 'element-plus';
|
|
3
3
|
import { Filter, ArrowDown } from '@element-plus/icons-vue';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { useShrink, isEmptyValue, columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, isSelectedTimeRange, timeRangeHandler } from './js/index.mjs';
|
|
4
|
+
import _sfc_main$1 from './cpns/appSearchItem.vue.mjs';
|
|
5
|
+
import { useShrink, isEmptyValue } from './js/index.mjs';
|
|
7
6
|
import { resetAppSearchValue } from './js/useAppSearch.mjs';
|
|
8
7
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
9
|
-
import { isArray } from '../../utils/is.mjs';
|
|
8
|
+
import { isArray, isObject } from '../../utils/is.mjs';
|
|
10
9
|
|
|
11
10
|
import "./style/appSearch.scss";
|
|
12
11
|
|
|
@@ -46,10 +45,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
46
45
|
const emits = __emit;
|
|
47
46
|
const { t } = useLocale();
|
|
48
47
|
const formItemWrapper = useTemplateRef("formItemWrapper");
|
|
49
|
-
const { isExpand, containerHeight, switchShrink, shrinkDestroy } = useShrink(
|
|
50
|
-
props,
|
|
51
|
-
formItemWrapper
|
|
52
|
-
);
|
|
48
|
+
const { showShrink, isExpand, containerHeight, switchShrink, shrinkDestroy } = useShrink(props, formItemWrapper);
|
|
53
49
|
const formColumnMap = computed(() => {
|
|
54
50
|
return (props.columns || []).reduce((map, column) => {
|
|
55
51
|
if (isArray(column.field)) {
|
|
@@ -62,17 +58,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
62
58
|
});
|
|
63
59
|
const filterCount = computed(() => {
|
|
64
60
|
const defaultValue = resetAppSearchValue(props.columns);
|
|
65
|
-
|
|
66
|
-
if (!(keys == null ? void 0 : keys.length)) return 0;
|
|
67
|
-
const keySet = keys.reduce((keySet2, key) => {
|
|
68
|
-
if (isEmptyValue(defaultValue[key]) ? !isEmptyValue(props.model[key]) : defaultValue[key] !== props.model[key]) {
|
|
69
|
-
if (unref(formColumnMap).has(key)) {
|
|
70
|
-
keySet2.add(unref(formColumnMap).get(key).key);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return keySet2;
|
|
74
|
-
}, /* @__PURE__ */ new Set());
|
|
75
|
-
return keySet.size;
|
|
61
|
+
return getFilterCount(props.model, defaultValue);
|
|
76
62
|
});
|
|
77
63
|
const appClass = computed(() => {
|
|
78
64
|
return [props.class, { "app-search-hidden": props.hidden }].filter(Boolean);
|
|
@@ -89,16 +75,37 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
89
75
|
onUnmounted(() => {
|
|
90
76
|
shrinkDestroy();
|
|
91
77
|
});
|
|
92
|
-
function
|
|
93
|
-
|
|
78
|
+
function getFilterCount(model, defaultValue, prop) {
|
|
79
|
+
let count = 0;
|
|
80
|
+
const keys = Object.keys(defaultValue);
|
|
81
|
+
if (!keys?.length) return count;
|
|
82
|
+
const keySet = keys.reduce((keySet2, key) => {
|
|
83
|
+
const newVal = model[key];
|
|
84
|
+
const oldVal = defaultValue[key];
|
|
85
|
+
const targetProp = prop ? `${prop}.${key}` : key;
|
|
86
|
+
if (isObject(oldVal)) {
|
|
87
|
+
count += getFilterCount(newVal, oldVal, targetProp);
|
|
88
|
+
} else if (isArray(oldVal)) {
|
|
89
|
+
if (oldVal.length > 0 && !oldVal.every((t2, i) => t2 === newVal[i])) {
|
|
90
|
+
keySet2.add(unref(formColumnMap).get(key).key);
|
|
91
|
+
}
|
|
92
|
+
} else if (isEmptyValue(oldVal) ? !isEmptyValue(newVal) : oldVal !== newVal) {
|
|
93
|
+
const column = unref(formColumnMap).get(targetProp);
|
|
94
|
+
if (column) {
|
|
95
|
+
keySet2.add(column.key);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return keySet2;
|
|
99
|
+
}, /* @__PURE__ */ new Set());
|
|
100
|
+
return count + keySet.size;
|
|
94
101
|
}
|
|
95
|
-
function
|
|
102
|
+
function onSearchHandler() {
|
|
96
103
|
emits("search");
|
|
97
104
|
}
|
|
98
105
|
function resetFields(fields) {
|
|
99
106
|
let columns = props.columns || [];
|
|
100
|
-
if (fields &&
|
|
101
|
-
columns = fields.map((key) => formColumnMap.get(key)).filter(Boolean);
|
|
107
|
+
if (fields && fields?.length) {
|
|
108
|
+
columns = fields.map((key) => formColumnMap.value.get(key)).filter(Boolean);
|
|
102
109
|
}
|
|
103
110
|
resetAppSearchValue(columns, props.model);
|
|
104
111
|
}
|
|
@@ -106,17 +113,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
106
113
|
resetFields();
|
|
107
114
|
emits("search");
|
|
108
115
|
}
|
|
109
|
-
function onTimeRangeClickHandler(column, options) {
|
|
110
|
-
const { field } = column;
|
|
111
|
-
const dateValue = timeRangeHandler(column, options);
|
|
112
|
-
if (isArray(field)) {
|
|
113
|
-
props.model[field[0]] = dateValue[0];
|
|
114
|
-
props.model[field[1]] = dateValue[1];
|
|
115
|
-
} else {
|
|
116
|
-
props.model[field] = dateValue;
|
|
117
|
-
}
|
|
118
|
-
emits("search");
|
|
119
|
-
}
|
|
120
116
|
__expose({
|
|
121
117
|
resetFields
|
|
122
118
|
});
|
|
@@ -174,7 +170,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
174
170
|
/* STABLE_FRAGMENT */
|
|
175
171
|
)) : createCommentVNode("v-if", true)
|
|
176
172
|
]),
|
|
177
|
-
createElementVNode("div", {
|
|
173
|
+
withDirectives(createElementVNode("div", {
|
|
178
174
|
class: "ml-auto flex items-center gap-4 cursor-pointer select-none",
|
|
179
175
|
onClick: unref(switchShrink)
|
|
180
176
|
}, [
|
|
@@ -196,7 +192,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
196
192
|
_: 1
|
|
197
193
|
/* STABLE */
|
|
198
194
|
}, 8, ["style"])
|
|
199
|
-
], 8, ["onClick"])
|
|
195
|
+
], 8, ["onClick"]), [
|
|
196
|
+
[vShow, unref(showShrink)]
|
|
197
|
+
])
|
|
200
198
|
],
|
|
201
199
|
2
|
|
202
200
|
/* CLASS */
|
|
@@ -221,178 +219,24 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
221
219
|
Fragment,
|
|
222
220
|
null,
|
|
223
221
|
renderList(__props.columns, (column) => {
|
|
224
|
-
return openBlock(),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
style: normalizeStyle(unref(columnItemStyle)(props, column))
|
|
243
|
-
},
|
|
244
|
-
[
|
|
245
|
-
createCommentVNode(" \u8868\u5355label "),
|
|
246
|
-
createElementVNode("div", { class: "flex items-center text-auxiliary text-xs px-3 whitespace-nowrap border-r border-border" }, [
|
|
247
|
-
column.labelSlot && _ctx.$slots[column.labelSlot] ? renderSlot(_ctx.$slots, column.labelSlot, {
|
|
248
|
-
key: 0,
|
|
249
|
-
column
|
|
250
|
-
}) : (openBlock(), createElementBlock(
|
|
251
|
-
"span",
|
|
252
|
-
{ key: 1 },
|
|
253
|
-
toDisplayString(column.label),
|
|
254
|
-
1
|
|
255
|
-
/* TEXT */
|
|
256
|
-
))
|
|
257
|
-
]),
|
|
258
|
-
createCommentVNode(" \u8868\u5355\u7EC4\u4EF6 "),
|
|
259
|
-
createElementVNode(
|
|
260
|
-
"div",
|
|
261
|
-
{
|
|
262
|
-
style: normalizeStyle(unref(columnItemInputStyle)(props, column))
|
|
263
|
-
},
|
|
264
|
-
[
|
|
265
|
-
createCommentVNode(" \u81EA\u5B9A\u4E49\u5177\u540D\u63D2\u69FD "),
|
|
266
|
-
column.slot ? renderSlot(_ctx.$slots, column.slot, {
|
|
267
|
-
key: 0,
|
|
268
|
-
column
|
|
269
|
-
}) : column.type === "input" ? (openBlock(), createElementBlock(
|
|
270
|
-
Fragment,
|
|
271
|
-
{ key: 1 },
|
|
272
|
-
[
|
|
273
|
-
createCommentVNode(" \u8F93\u5165\u6846 "),
|
|
274
|
-
createVNode(unref(ElInput), mergeProps({
|
|
275
|
-
modelValue: __props.model[column.field],
|
|
276
|
-
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event
|
|
277
|
-
}, { ref_for: true }, column.attrs, {
|
|
278
|
-
disabled: unref(isDisabled)(props, column),
|
|
279
|
-
onKeydown: withKeys(($event) => onKeydownEnterHander(), ["enter"]),
|
|
280
|
-
onChange: ($event) => onChangeHandler()
|
|
281
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onKeydown", "onChange"])
|
|
282
|
-
],
|
|
283
|
-
2112
|
|
284
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
285
|
-
)) : column.type === "select" ? (openBlock(), createElementBlock(
|
|
286
|
-
Fragment,
|
|
287
|
-
{ key: 2 },
|
|
288
|
-
[
|
|
289
|
-
createCommentVNode(" \u9009\u62E9\u6846 "),
|
|
290
|
-
createVNode(unref(ElSelect), mergeProps({
|
|
291
|
-
modelValue: __props.model[column.field],
|
|
292
|
-
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event
|
|
293
|
-
}, { ref_for: true }, column.attrs, {
|
|
294
|
-
disabled: unref(isDisabled)(props, column),
|
|
295
|
-
onChange: ($event) => onChangeHandler()
|
|
296
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])
|
|
297
|
-
],
|
|
298
|
-
2112
|
|
299
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
300
|
-
)) : column.type === "date-picker" ? (openBlock(), createElementBlock(
|
|
301
|
-
Fragment,
|
|
302
|
-
{ key: 3 },
|
|
303
|
-
[
|
|
304
|
-
createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
|
|
305
|
-
[
|
|
306
|
-
"datetimerange",
|
|
307
|
-
"daterange",
|
|
308
|
-
"monthrange",
|
|
309
|
-
"yearrange"
|
|
310
|
-
].includes((_a = column.attrs) == null ? void 0 : _a.type) && unref(isArray)(column.field) ? (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
311
|
-
key: 0,
|
|
312
|
-
start: __props.model[column.field[0]],
|
|
313
|
-
"onUpdate:start": ($event) => __props.model[column.field[0]] = $event,
|
|
314
|
-
end: __props.model[column.field[1]],
|
|
315
|
-
"onUpdate:end": ($event) => __props.model[column.field[1]] = $event,
|
|
316
|
-
"is-range": true,
|
|
317
|
-
style: { "width": "100%" }
|
|
318
|
-
}, { ref_for: true }, column.attrs, {
|
|
319
|
-
disabled: unref(isDisabled)(props, column),
|
|
320
|
-
timeRangeFill: column.timeRangeFill,
|
|
321
|
-
onChange: ($event) => onChangeHandler()
|
|
322
|
-
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
323
|
-
key: 1,
|
|
324
|
-
modelValue: __props.model[column.field],
|
|
325
|
-
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
326
|
-
"is-range": false,
|
|
327
|
-
style: { "width": "100%" }
|
|
328
|
-
}, { ref_for: true }, column.attrs, {
|
|
329
|
-
disabled: unref(isDisabled)(props, column),
|
|
330
|
-
timeRangeFill: column.timeRangeFill,
|
|
331
|
-
onChange: ($event) => onChangeHandler()
|
|
332
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "timeRangeFill", "onChange"]))
|
|
333
|
-
],
|
|
334
|
-
64
|
|
335
|
-
/* STABLE_FRAGMENT */
|
|
336
|
-
)) : column.type === "org-cascader" ? (openBlock(), createElementBlock(
|
|
337
|
-
Fragment,
|
|
338
|
-
{ key: 4 },
|
|
339
|
-
[
|
|
340
|
-
createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
341
|
-
createVNode(unref(AppOrgCascader), mergeProps({
|
|
342
|
-
modelValue: __props.model[column.field],
|
|
343
|
-
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
344
|
-
disabled: unref(isDisabled)(props, column)
|
|
345
|
-
}, { ref_for: true }, column.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
346
|
-
],
|
|
347
|
-
2112
|
|
348
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
349
|
-
)) : createCommentVNode("v-if", true)
|
|
350
|
-
],
|
|
351
|
-
4
|
|
352
|
-
/* STYLE */
|
|
353
|
-
)
|
|
354
|
-
],
|
|
355
|
-
4
|
|
356
|
-
/* STYLE */
|
|
357
|
-
),
|
|
358
|
-
column.type === "date-picker" && ["daterange", "datetimerange"].includes((_b = column.attrs) == null ? void 0 : _b.type) && ((_c = column.timeRangeOptions) == null ? void 0 : _c.length) ? (openBlock(), createElementBlock("div", {
|
|
359
|
-
key: 0,
|
|
360
|
-
class: "flex text-main"
|
|
361
|
-
}, [
|
|
362
|
-
(openBlock(true), createElementBlock(
|
|
363
|
-
Fragment,
|
|
364
|
-
null,
|
|
365
|
-
renderList(column.timeRangeOptions, (item, index) => {
|
|
366
|
-
return openBlock(), createElementBlock("div", {
|
|
367
|
-
key: index,
|
|
368
|
-
class: normalizeClass(["border-l border-border px-[10px] cursor-pointer", {
|
|
369
|
-
"bg-[rgba(var(--hy-theme),0.2)] text-theme font-bold": unref(isSelectedTimeRange)(column, item, __props.model)
|
|
370
|
-
}]),
|
|
371
|
-
onClick: ($event) => onTimeRangeClickHandler(column, item)
|
|
372
|
-
}, [
|
|
373
|
-
createElementVNode(
|
|
374
|
-
"span",
|
|
375
|
-
null,
|
|
376
|
-
toDisplayString(item.label),
|
|
377
|
-
1
|
|
378
|
-
/* TEXT */
|
|
379
|
-
)
|
|
380
|
-
], 10, ["onClick"]);
|
|
381
|
-
}),
|
|
382
|
-
128
|
|
383
|
-
/* KEYED_FRAGMENT */
|
|
384
|
-
))
|
|
385
|
-
])) : createCommentVNode("v-if", true)
|
|
386
|
-
])
|
|
387
|
-
];
|
|
388
|
-
}),
|
|
389
|
-
_: 2
|
|
390
|
-
/* DYNAMIC */
|
|
391
|
-
}, 1032, ["prop"])) : createCommentVNode("v-if", true)
|
|
392
|
-
],
|
|
393
|
-
64
|
|
394
|
-
/* STABLE_FRAGMENT */
|
|
395
|
-
);
|
|
222
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
223
|
+
key: column.key,
|
|
224
|
+
model: __props.model,
|
|
225
|
+
column,
|
|
226
|
+
onSearch: onSearchHandler
|
|
227
|
+
}, createSlots({
|
|
228
|
+
_: 2
|
|
229
|
+
/* DYNAMIC */
|
|
230
|
+
}, [
|
|
231
|
+
renderList(_ctx.$slots, (_, slotName) => {
|
|
232
|
+
return {
|
|
233
|
+
name: slotName,
|
|
234
|
+
fn: withCtx((scope) => [
|
|
235
|
+
renderSlot(_ctx.$slots, slotName, mergeProps({ ref_for: true }, scope))
|
|
236
|
+
])
|
|
237
|
+
};
|
|
238
|
+
})
|
|
239
|
+
]), 1032, ["model", "column"]);
|
|
396
240
|
}),
|
|
397
241
|
128
|
|
398
242
|
/* KEYED_FRAGMENT */
|