hy-dispatch-ui-v3 0.1.1 → 0.1.2
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/dist/tailwind.css +40 -6
- package/es/components/appButton/appButton.vue.mjs +2 -2
- package/es/components/appConfigProvider/appConfigProvider.vue.mjs +26 -10
- package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +42 -18
- package/es/components/appConfirmDialog/appConfirmMethod.mjs +15 -9
- package/es/components/appIcon/index.mjs +1 -3
- package/es/components/{appIcon → appIconBox}/appIconBox.vue.mjs +3 -3
- package/es/components/appIconBox/index.mjs +6 -0
- package/es/components/appSearch/js/index.mjs +5 -5
- package/es/components/appTable/appTable.vue.mjs +4 -4
- package/es/components/appTable/js/search.mjs +1 -0
- package/es/components/appUserAvatar/appUserAvatar.vue.mjs +136 -0
- package/es/components/appUserAvatar/index.mjs +6 -0
- package/es/components/appUserAvatar/style/appUserAvatar.scss +33 -0
- package/es/components/index.mjs +3 -1
- package/es/hooks/index.mjs +2 -0
- package/es/hooks/useApi.mjs +9 -0
- package/es/hooks/useGlobalConfig.mjs +5 -0
- package/es/{store/maintain.mjs → hooks/useResizeHandler.mjs} +29 -43
- package/es/hooks/useUserAvatarMap.mjs +9 -0
- package/es/index.mjs +5 -3
- package/es/locale/en.mjs +3 -0
- package/es/locale/zh_CN.mjs +3 -0
- package/es/make-installer.mjs +0 -5
- package/es/version.mjs +1 -1
- package/lib/components/appButton/appButton.vue.js +2 -2
- package/lib/components/appConfigProvider/appConfigProvider.vue.js +26 -10
- package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +41 -17
- package/lib/components/appConfirmDialog/appConfirmMethod.js +14 -8
- package/lib/components/appIcon/index.js +0 -3
- package/lib/components/{appIcon → appIconBox}/appIconBox.vue.js +3 -3
- package/lib/components/appIconBox/index.js +11 -0
- package/lib/components/appSearch/js/index.js +5 -5
- package/lib/components/appTable/appTable.vue.js +4 -4
- package/lib/components/appTable/js/search.js +1 -0
- package/lib/components/appUserAvatar/appUserAvatar.vue.js +140 -0
- package/lib/components/appUserAvatar/index.js +11 -0
- package/lib/components/appUserAvatar/style/appUserAvatar.scss +33 -0
- package/lib/components/index.js +12 -9
- package/lib/hooks/index.js +5 -0
- package/lib/hooks/useApi.js +9 -0
- package/lib/hooks/useGlobalConfig.js +5 -0
- package/lib/{store/maintain.js → hooks/useResizeHandler.js} +29 -43
- package/lib/hooks/useUserAvatarMap.js +12 -0
- package/lib/index.js +17 -13
- package/lib/locale/en.js +3 -0
- package/lib/locale/zh_CN.js +3 -0
- package/lib/make-installer.js +0 -5
- package/lib/version.js +1 -1
- package/package.json +11 -2
- package/es/store/index.mjs +0 -6
- package/lib/store/index.js +0 -9
- /package/es/components/{appIcon → appIconBox}/style/appIconBox.scss +0 -0
- /package/lib/components/{appIcon → appIconBox}/style/appIconBox.scss +0 -0
package/dist/tailwind.css
CHANGED
|
@@ -716,10 +716,6 @@ video {
|
|
|
716
716
|
height: 0px;
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
-
.h-\[253px\] {
|
|
720
|
-
height: 253px;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
719
|
.h-\[364px\] {
|
|
724
720
|
height: 364px;
|
|
725
721
|
}
|
|
@@ -760,8 +756,8 @@ video {
|
|
|
760
756
|
width: 1.25rem;
|
|
761
757
|
}
|
|
762
758
|
|
|
763
|
-
.w-\[
|
|
764
|
-
width:
|
|
759
|
+
.w-\[160px\] {
|
|
760
|
+
width: 160px;
|
|
765
761
|
}
|
|
766
762
|
|
|
767
763
|
.w-\[200px\] {
|
|
@@ -958,6 +954,16 @@ video {
|
|
|
958
954
|
background-color: rgb(var(--hy-background-2), var(--tw-bg-opacity, 1));
|
|
959
955
|
}
|
|
960
956
|
|
|
957
|
+
.bg-info {
|
|
958
|
+
--tw-bg-opacity: 1;
|
|
959
|
+
background-color: rgb(var(--hy-info), var(--tw-bg-opacity, 1));
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.bg-success {
|
|
963
|
+
--tw-bg-opacity: 1;
|
|
964
|
+
background-color: rgb(var(--hy-success), var(--tw-bg-opacity, 1));
|
|
965
|
+
}
|
|
966
|
+
|
|
961
967
|
.bg-success\/50 {
|
|
962
968
|
background-color: rgb(var(--hy-success), 0.5);
|
|
963
969
|
}
|
|
@@ -1064,6 +1070,10 @@ video {
|
|
|
1064
1070
|
padding-top: 11px;
|
|
1065
1071
|
}
|
|
1066
1072
|
|
|
1073
|
+
.pt-\[32px\] {
|
|
1074
|
+
padding-top: 32px;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1067
1077
|
.pt-\[37px\] {
|
|
1068
1078
|
padding-top: 37px;
|
|
1069
1079
|
}
|
|
@@ -1072,6 +1082,10 @@ video {
|
|
|
1072
1082
|
padding-top: 5px;
|
|
1073
1083
|
}
|
|
1074
1084
|
|
|
1085
|
+
.text-center {
|
|
1086
|
+
text-align: center;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1075
1089
|
.text-base {
|
|
1076
1090
|
font-size: 1rem;
|
|
1077
1091
|
line-height: 1.5rem;
|
|
@@ -1087,6 +1101,10 @@ video {
|
|
|
1087
1101
|
line-height: 1rem;
|
|
1088
1102
|
}
|
|
1089
1103
|
|
|
1104
|
+
.font-\[600\] {
|
|
1105
|
+
font-weight: 600;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1090
1108
|
.font-bold {
|
|
1091
1109
|
font-weight: 700;
|
|
1092
1110
|
}
|
|
@@ -1108,6 +1126,11 @@ video {
|
|
|
1108
1126
|
color: rgb(var(--hy-auxiliary), var(--tw-text-opacity, 1));
|
|
1109
1127
|
}
|
|
1110
1128
|
|
|
1129
|
+
.text-danger {
|
|
1130
|
+
--tw-text-opacity: 1;
|
|
1131
|
+
color: rgb(var(--hy-danger), var(--tw-text-opacity, 1));
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1111
1134
|
.text-danger-2 {
|
|
1112
1135
|
--tw-text-opacity: 1;
|
|
1113
1136
|
color: rgb(var(--hy-danger-2), var(--tw-text-opacity, 1));
|
|
@@ -1133,6 +1156,17 @@ video {
|
|
|
1133
1156
|
color: rgb(var(--hy-warning), var(--tw-text-opacity, 1));
|
|
1134
1157
|
}
|
|
1135
1158
|
|
|
1159
|
+
.shadow-\[0_0_4px_0\] {
|
|
1160
|
+
--tw-shadow: 0 0 4px 0;
|
|
1161
|
+
--tw-shadow-colored: 0 0 4px 0 var(--tw-shadow-color);
|
|
1162
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
.shadow-success {
|
|
1166
|
+
--tw-shadow-color: rgb(var(--hy-success), 1);
|
|
1167
|
+
--tw-shadow: var(--tw-shadow-colored);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1136
1170
|
.outline {
|
|
1137
1171
|
outline-style: solid;
|
|
1138
1172
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, renderSlot, createBlock, unref, withCtx, createVNode, Fragment } from 'vue';
|
|
2
2
|
import { ElIcon } from 'element-plus';
|
|
3
3
|
import { Loading, ArrowDown } from '@element-plus/icons-vue';
|
|
4
|
-
import
|
|
4
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
5
5
|
|
|
6
6
|
import "./style/appButton.scss";
|
|
7
7
|
|
|
@@ -80,7 +80,7 @@ const _sfc_main = {
|
|
|
80
80
|
},
|
|
81
81
|
[
|
|
82
82
|
!__props.loading ? renderSlot(_ctx.$slots, "svg", { key: 0 }, () => [
|
|
83
|
-
__props.svgName ? (openBlock(), createBlock(
|
|
83
|
+
__props.svgName ? (openBlock(), createBlock(unref(AppIcon), {
|
|
84
84
|
key: 0,
|
|
85
85
|
"svg-name": __props.svgName,
|
|
86
86
|
"class-name": "!w-3 !h-3 text-main mr-2"
|
|
@@ -10,45 +10,61 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
10
10
|
props: {
|
|
11
11
|
locale: {
|
|
12
12
|
type: String,
|
|
13
|
+
required: false,
|
|
13
14
|
default: "zhCn"
|
|
14
15
|
},
|
|
15
16
|
api: {
|
|
16
|
-
type: Object
|
|
17
|
+
type: [Object, Function],
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
userAvatarMap: {
|
|
21
|
+
type: Map,
|
|
22
|
+
required: false,
|
|
23
|
+
default: () => /* @__PURE__ */ new Map()
|
|
17
24
|
},
|
|
18
25
|
size: {
|
|
19
26
|
type: String,
|
|
27
|
+
required: false,
|
|
20
28
|
default: "default"
|
|
21
29
|
},
|
|
22
30
|
zIndex: {
|
|
23
|
-
type: Number
|
|
31
|
+
type: Number,
|
|
32
|
+
required: false
|
|
24
33
|
},
|
|
25
34
|
button: {
|
|
26
|
-
type: Object
|
|
35
|
+
type: Object,
|
|
36
|
+
required: false
|
|
27
37
|
},
|
|
28
38
|
link: {
|
|
29
|
-
type: Object
|
|
39
|
+
type: Object,
|
|
40
|
+
required: false
|
|
30
41
|
},
|
|
31
42
|
dialog: {
|
|
32
|
-
type: Object
|
|
43
|
+
type: Object,
|
|
44
|
+
required: false
|
|
33
45
|
},
|
|
34
46
|
message: {
|
|
35
|
-
type: Object
|
|
47
|
+
type: Object,
|
|
48
|
+
required: false
|
|
36
49
|
},
|
|
37
50
|
emptyValues: {
|
|
38
|
-
type: String
|
|
51
|
+
type: String,
|
|
52
|
+
required: false
|
|
39
53
|
},
|
|
40
54
|
valueOnClear: {
|
|
41
|
-
type: [String, Number, null]
|
|
55
|
+
type: [String, Number, null],
|
|
56
|
+
required: false
|
|
42
57
|
},
|
|
43
58
|
table: {
|
|
44
|
-
type: Object
|
|
59
|
+
type: Object,
|
|
60
|
+
required: false
|
|
45
61
|
}
|
|
46
62
|
},
|
|
47
63
|
setup(__props) {
|
|
48
64
|
const props = __props;
|
|
49
65
|
const globalConfig = provideGlobalConfig(props);
|
|
50
66
|
const config = computed(() => {
|
|
51
|
-
const { locale, api, ...config2 } = globalConfig.value;
|
|
67
|
+
const { locale, api, userAvatarMap, ...config2 } = globalConfig.value;
|
|
52
68
|
return {
|
|
53
69
|
locale: ElementLocale[locale] || ElementLocale["zhCn"],
|
|
54
70
|
...config2
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useModel, ref, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, createVNode, normalizeClass, toDisplayString, createElementBlock, createTextVNode, createCommentVNode, mergeModels } from 'vue';
|
|
1
|
+
import { defineComponent, useModel, ref, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, createVNode, normalizeClass, toDisplayString, createElementBlock, createTextVNode, createCommentVNode, withModifiers, mergeModels } from 'vue';
|
|
2
2
|
import { ElDialog, ElIcon } from 'element-plus';
|
|
3
3
|
import { Warning, CircleClose } from '@element-plus/icons-vue';
|
|
4
4
|
import { AppButton } from '../appButton/index.mjs';
|
|
@@ -27,7 +27,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
27
27
|
},
|
|
28
28
|
showClose: {
|
|
29
29
|
type: Boolean,
|
|
30
|
-
default:
|
|
30
|
+
default: false
|
|
31
31
|
},
|
|
32
32
|
showCancel: {
|
|
33
33
|
type: Boolean,
|
|
@@ -51,19 +51,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
51
51
|
submitText: {
|
|
52
52
|
type: String
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
type:
|
|
54
|
+
iconColor: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "rgb(var(--hy-main))"
|
|
56
57
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
onClose: Function,
|
|
59
|
+
onCancel: Function,
|
|
60
|
+
onSubmit: Function
|
|
60
61
|
}, {
|
|
61
62
|
"modelValue": { type: Boolean, default: false },
|
|
62
63
|
"modelModifiers": {}
|
|
63
64
|
}),
|
|
64
|
-
emits: /* @__PURE__ */ mergeModels(["
|
|
65
|
+
emits: /* @__PURE__ */ mergeModels(["hide"], ["update:modelValue"]),
|
|
65
66
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
66
67
|
const props = __props;
|
|
68
|
+
const emits = __emit;
|
|
67
69
|
const { t } = useLocale();
|
|
68
70
|
const visible = useModel(__props, "modelValue");
|
|
69
71
|
const loading = ref(false);
|
|
@@ -81,8 +83,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
81
83
|
}
|
|
82
84
|
visible.value = false;
|
|
83
85
|
loading.value = false;
|
|
86
|
+
emits("hide");
|
|
84
87
|
}
|
|
85
|
-
async function
|
|
88
|
+
async function onCancelHandler() {
|
|
86
89
|
if (loading.value) return;
|
|
87
90
|
loading.value = true;
|
|
88
91
|
if (props.onCancel) {
|
|
@@ -96,6 +99,23 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
96
99
|
}
|
|
97
100
|
visible.value = false;
|
|
98
101
|
loading.value = false;
|
|
102
|
+
emits("hide");
|
|
103
|
+
}
|
|
104
|
+
async function onCloseHandler() {
|
|
105
|
+
if (loading.value) return;
|
|
106
|
+
loading.value = true;
|
|
107
|
+
if (props.onClose) {
|
|
108
|
+
try {
|
|
109
|
+
await props.onClose();
|
|
110
|
+
} catch (err) {
|
|
111
|
+
console.error(err);
|
|
112
|
+
loading.value = false;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
visible.value = false;
|
|
117
|
+
loading.value = false;
|
|
118
|
+
emits("hide");
|
|
99
119
|
}
|
|
100
120
|
__expose({
|
|
101
121
|
show: () => {
|
|
@@ -117,7 +137,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
117
137
|
top: "15%"
|
|
118
138
|
}, _ctx.$attrs), {
|
|
119
139
|
header: withCtx(() => [
|
|
120
|
-
createElementVNode("div", {
|
|
140
|
+
createElementVNode("div", {
|
|
141
|
+
class: "h-[38px] flex items-center justify-between border-b border-border pl-4 pr-[10px]",
|
|
142
|
+
onClick: withModifiers(() => {
|
|
143
|
+
}, ["stop"])
|
|
144
|
+
}, [
|
|
121
145
|
createElementVNode(
|
|
122
146
|
"span",
|
|
123
147
|
{ class: "text-sm text-main font-bold" },
|
|
@@ -147,44 +171,44 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
147
171
|
2
|
|
148
172
|
/* CLASS */
|
|
149
173
|
)) : createCommentVNode("v-if", true)
|
|
150
|
-
])
|
|
174
|
+
], 8, ["onClick"])
|
|
151
175
|
]),
|
|
152
176
|
default: withCtx(() => [
|
|
153
|
-
createElementVNode("div", { class: "
|
|
177
|
+
createElementVNode("div", { class: "flex flex-col items-center justify-between pt-[37px] pb-[27px]" }, [
|
|
154
178
|
createElementVNode("div", { class: "flex flex-col items-center text-main" }, [
|
|
155
179
|
createVNode(unref(ElIcon), {
|
|
156
180
|
size: "40",
|
|
157
|
-
color:
|
|
181
|
+
color: __props.iconColor
|
|
158
182
|
}, {
|
|
159
183
|
default: withCtx(() => [
|
|
160
184
|
createVNode(unref(Warning))
|
|
161
185
|
]),
|
|
162
186
|
_: 1
|
|
163
187
|
/* STABLE */
|
|
164
|
-
}),
|
|
188
|
+
}, 8, ["color"]),
|
|
165
189
|
createElementVNode(
|
|
166
190
|
"div",
|
|
167
191
|
{
|
|
168
|
-
class: normalizeClass(["text-base font-bold mt-[10px] mb-[26px]", __props.titleClass])
|
|
192
|
+
class: normalizeClass(["text-base text-center font-bold mt-[10px] mb-[26px]", __props.titleClass])
|
|
169
193
|
},
|
|
170
194
|
toDisplayString(__props.title),
|
|
171
195
|
3
|
|
172
196
|
/* TEXT, CLASS */
|
|
173
197
|
),
|
|
174
198
|
createElementVNode("div", {
|
|
175
|
-
class: "max-w-[300px] text-smword-break",
|
|
199
|
+
class: "max-w-[300px] text-smword-break text-center break-all",
|
|
176
200
|
innerHTML: __props.content
|
|
177
201
|
}, null, 8, ["innerHTML"])
|
|
178
202
|
]),
|
|
179
203
|
__props.showSubmit || __props.showCancel ? (openBlock(), createElementBlock("div", {
|
|
180
204
|
key: 0,
|
|
181
|
-
class: "
|
|
205
|
+
class: "pt-[32px]"
|
|
182
206
|
}, [
|
|
183
207
|
__props.showCancel ? (openBlock(), createBlock(unref(AppButton), {
|
|
184
208
|
key: 0,
|
|
185
209
|
type: __props.cancelType,
|
|
186
210
|
disabled: loading.value,
|
|
187
|
-
onClick:
|
|
211
|
+
onClick: onCancelHandler
|
|
188
212
|
}, {
|
|
189
213
|
default: withCtx(() => [
|
|
190
214
|
createTextVNode(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unref, createVNode, render } from 'vue';
|
|
2
|
+
import { defaultAxios } from '../../hooks/useApi.mjs';
|
|
2
3
|
import { AppConfigProvider } from '../appConfigProvider/index.mjs';
|
|
3
4
|
import _sfc_main from './appConfirmDialog.vue.mjs';
|
|
4
5
|
import { useGlobalConfig } from '../../hooks/useGlobalConfig.mjs';
|
|
@@ -8,22 +9,25 @@ function appConfirmMethod(config) {
|
|
|
8
9
|
let container = document.createDocumentFragment();
|
|
9
10
|
const currentConfig = {
|
|
10
11
|
...config,
|
|
11
|
-
|
|
12
|
-
if (config.onClose) {
|
|
13
|
-
config.onClose();
|
|
14
|
-
}
|
|
12
|
+
onHide: () => {
|
|
15
13
|
destroy();
|
|
16
14
|
}
|
|
17
15
|
};
|
|
18
16
|
let confirmDialogInstance = null;
|
|
19
17
|
function render$1(props) {
|
|
20
18
|
const globalConfig = useGlobalConfig();
|
|
19
|
+
const {
|
|
20
|
+
locale = "zhCn",
|
|
21
|
+
api = defaultAxios,
|
|
22
|
+
...args
|
|
23
|
+
} = unref(globalConfig) || {};
|
|
21
24
|
const vm = createVNode(_sfc_main, props);
|
|
22
25
|
const configProvider = createVNode(
|
|
23
26
|
AppConfigProvider,
|
|
24
27
|
{
|
|
25
|
-
locale
|
|
26
|
-
api
|
|
28
|
+
locale,
|
|
29
|
+
api,
|
|
30
|
+
...args
|
|
27
31
|
},
|
|
28
32
|
() => [vm]
|
|
29
33
|
);
|
|
@@ -48,10 +52,10 @@ function appConfirmMethod(config) {
|
|
|
48
52
|
_sfc_main.tip = (props) => {
|
|
49
53
|
const { t } = useLocale();
|
|
50
54
|
return appConfirmMethod({
|
|
51
|
-
showCancel: false,
|
|
52
55
|
dialogTitle: t("confirmDialog.prompt"),
|
|
53
56
|
title: t("confirmDialog.prompt"),
|
|
54
57
|
content: t("confirmDialog.content"),
|
|
58
|
+
showCancel: false,
|
|
55
59
|
...props
|
|
56
60
|
});
|
|
57
61
|
};
|
|
@@ -71,6 +75,7 @@ _sfc_main.warning = (props) => {
|
|
|
71
75
|
title: t("confirmDialog.prompt"),
|
|
72
76
|
titleClass: "text-warning",
|
|
73
77
|
content: t("confirmDialog.content"),
|
|
78
|
+
iconColor: "rgb(var(--hy-warning))",
|
|
74
79
|
...props
|
|
75
80
|
});
|
|
76
81
|
};
|
|
@@ -78,10 +83,11 @@ _sfc_main.danger = (props) => {
|
|
|
78
83
|
const { t } = useLocale();
|
|
79
84
|
return appConfirmMethod({
|
|
80
85
|
dialogTitle: t("confirmDialog.dangerousOperation"),
|
|
81
|
-
titleClass: "text-danger
|
|
86
|
+
titleClass: "text-danger",
|
|
82
87
|
title: t("confirmDialog.prompt"),
|
|
83
88
|
content: t("confirmDialog.content"),
|
|
84
89
|
submitType: "danger",
|
|
90
|
+
iconColor: "rgb(var(--hy-danger))",
|
|
85
91
|
...props
|
|
86
92
|
});
|
|
87
93
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _sfc_main from './appIcon.vue.mjs';
|
|
2
|
-
import _sfc_main$1 from './appIconBox.vue.mjs';
|
|
3
2
|
import { withInstall } from '../../utils/handler.mjs';
|
|
4
3
|
|
|
5
4
|
const AppIcon = withInstall(_sfc_main);
|
|
6
|
-
const appIconBox = withInstall(_sfc_main$1);
|
|
7
5
|
|
|
8
|
-
export { AppIcon,
|
|
6
|
+
export { AppIcon, AppIcon as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, createVNode, unref, createSlots, withCtx, createElementVNode, normalizeStyle, normalizeClass, renderSlot } from 'vue';
|
|
2
2
|
import { ElTooltip } from 'element-plus';
|
|
3
|
-
import
|
|
3
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
4
4
|
|
|
5
5
|
import "./style/appIconBox.scss";
|
|
6
6
|
|
|
7
7
|
const __default__ = defineComponent({
|
|
8
|
-
name: "
|
|
8
|
+
name: "AppIconBox"
|
|
9
9
|
});
|
|
10
10
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
11
11
|
props: {
|
|
@@ -69,7 +69,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
69
69
|
style: normalizeStyle(style.value)
|
|
70
70
|
},
|
|
71
71
|
[
|
|
72
|
-
createVNode(
|
|
72
|
+
createVNode(unref(AppIcon), {
|
|
73
73
|
prefix: __props.prefix,
|
|
74
74
|
"svg-name": __props.svgName,
|
|
75
75
|
style: { width: "100%", height: "100%" }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
2
|
import { ref, watch, nextTick, unref } from 'vue';
|
|
3
|
-
import { useMaintainStore } from '../../../store/maintain.mjs';
|
|
4
3
|
import { isEmpty, isArray, isBoolean, isFunction, isNumber, isString } from '../../../utils/is.mjs';
|
|
4
|
+
import { useResizeHandler } from '../../../hooks/useResizeHandler.mjs';
|
|
5
5
|
|
|
6
6
|
function columnItemStyle(props, column) {
|
|
7
7
|
const { width } = column;
|
|
@@ -42,10 +42,10 @@ function isEmptyValue(e) {
|
|
|
42
42
|
return isEmpty(e) || isArray(e) && !e.length;
|
|
43
43
|
}
|
|
44
44
|
function useShrink(props, templateRef) {
|
|
45
|
+
const { addResize, removeResize } = useResizeHandler();
|
|
46
|
+
const resizeExpandKey = /* @__PURE__ */ Symbol("appSearchExpand");
|
|
45
47
|
const isExpand = ref(false);
|
|
46
48
|
const containerHeight = ref(getContainerPickUpHeight());
|
|
47
|
-
const maintainStore = useMaintainStore();
|
|
48
|
-
const resizeExpandKey = /* @__PURE__ */ Symbol("appSearchExpand");
|
|
49
49
|
function getContainerPickUpHeight() {
|
|
50
50
|
switch (props.size) {
|
|
51
51
|
case "large":
|
|
@@ -71,7 +71,7 @@ function useShrink(props, templateRef) {
|
|
|
71
71
|
() => {
|
|
72
72
|
nextTick(() => {
|
|
73
73
|
shrinkResizeHandler();
|
|
74
|
-
|
|
74
|
+
addResize(resizeExpandKey, shrinkResizeHandler);
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
77
|
{ immediate: true, deep: true }
|
|
@@ -82,7 +82,7 @@ function useShrink(props, templateRef) {
|
|
|
82
82
|
switchShrink,
|
|
83
83
|
shrinkResizeHandler,
|
|
84
84
|
shrinkDestroy() {
|
|
85
|
-
|
|
85
|
+
removeResize(resizeExpandKey);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}
|
|
@@ -8,7 +8,7 @@ import _sfc_main$1 from './cpns/columnSelect.vue.mjs';
|
|
|
8
8
|
import { useMixins } from '../../hooks/useMixins.mjs';
|
|
9
9
|
import { AppSearch } from '../appSearch/index.mjs';
|
|
10
10
|
import { parseRem } from '../../utils/adaptive.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { AppIconBox } from '../appIconBox/index.mjs';
|
|
12
12
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
13
13
|
import { isEmpty } from '../../utils/is.mjs';
|
|
14
14
|
|
|
@@ -254,7 +254,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
254
254
|
key: 2,
|
|
255
255
|
modelValue: unref(formModel).query,
|
|
256
256
|
"onUpdate:modelValue": ($event) => unref(formModel).query = $event,
|
|
257
|
-
class: "w-[
|
|
257
|
+
class: "w-[160px]",
|
|
258
258
|
placeholder: unref(t)("table.searchFor", [unref(searchPlaceholder)]),
|
|
259
259
|
onKeydown: withKeys(unref(onSearchQueryHandler), ["enter"])
|
|
260
260
|
}, {
|
|
@@ -365,7 +365,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
365
365
|
scope,
|
|
366
366
|
"default"
|
|
367
367
|
), (citem, cindex) => {
|
|
368
|
-
return openBlock(), createBlock(unref(
|
|
368
|
+
return openBlock(), createBlock(unref(AppIconBox), {
|
|
369
369
|
key: cindex,
|
|
370
370
|
"svg-name": citem.svgName,
|
|
371
371
|
altText: citem.label,
|
|
@@ -442,7 +442,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
442
442
|
)
|
|
443
443
|
]),
|
|
444
444
|
default: withCtx(() => [
|
|
445
|
-
createVNode(unref(
|
|
445
|
+
createVNode(unref(AppIconBox), {
|
|
446
446
|
key: "more",
|
|
447
447
|
"svg-name": "system-burst_analysis_select_option",
|
|
448
448
|
altText: unref(t)("table.moreOperations"),
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineComponent, computed, unref, openBlock, createElementBlock, normalizeStyle, createBlock, normalizeClass, createCommentVNode } from 'vue';
|
|
2
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
3
|
+
import { useUserAvatarMap } from '../../hooks/useUserAvatarMap.mjs';
|
|
4
|
+
import { pxTorem } from '../../utils/adaptive.mjs';
|
|
5
|
+
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
6
|
+
|
|
7
|
+
import "./style/appUserAvatar.scss";
|
|
8
|
+
|
|
9
|
+
const __default__ = defineComponent({
|
|
10
|
+
name: "AppUserAvatar"
|
|
11
|
+
});
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
13
|
+
props: {
|
|
14
|
+
initSelectSvgName: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: () => {
|
|
17
|
+
return "user_online-2";
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
initSvgName: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: () => {
|
|
23
|
+
return "user_offline-2";
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
device: Object,
|
|
27
|
+
// 设备信息
|
|
28
|
+
audioContextType: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: () => {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
iconType: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: () => {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
width: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: () => {
|
|
43
|
+
return "54px";
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
height: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: () => {
|
|
49
|
+
return "54px";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
emits: [],
|
|
54
|
+
setup(__props, { emit: __emit }) {
|
|
55
|
+
const props = __props;
|
|
56
|
+
const { t } = useLocale();
|
|
57
|
+
const { userAvatarMap } = useUserAvatarMap();
|
|
58
|
+
const headImg = computed(() => {
|
|
59
|
+
var _a;
|
|
60
|
+
return props.device && ((_a = unref(userAvatarMap)) == null ? void 0 : _a.get(props.device.deviceId));
|
|
61
|
+
});
|
|
62
|
+
function parseRem(res) {
|
|
63
|
+
let px = res;
|
|
64
|
+
if (px) {
|
|
65
|
+
px = parseInt(px, 10);
|
|
66
|
+
if (isNaN(px)) {
|
|
67
|
+
return "";
|
|
68
|
+
}
|
|
69
|
+
return pxTorem(px);
|
|
70
|
+
}
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
return (_ctx, _cache) => {
|
|
74
|
+
var _a, _b, _c, _d, _e, _f;
|
|
75
|
+
return openBlock(), createElementBlock(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
style: normalizeStyle({
|
|
79
|
+
width: `${parseRem(__props.width)}rem`,
|
|
80
|
+
height: `${parseRem(__props.height)}rem`,
|
|
81
|
+
"border-color": ((_a = __props.device) == null ? void 0 : _a.onlineState) === 1 ? __props.audioContextType ? "rgb(var(--hy-theme))" : ((_b = __props.device) == null ? void 0 : _b.gbDevice) === 1 ? "#FDE777" : "rgb(var(--hy-auxiliary))" : "rgb(var(--hy-info))"
|
|
82
|
+
}),
|
|
83
|
+
class: "app-user-avatar"
|
|
84
|
+
},
|
|
85
|
+
[
|
|
86
|
+
((_c = __props.device) == null ? void 0 : _c.gbDevice) === 1 ? (openBlock(), createElementBlock(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
key: 0,
|
|
90
|
+
style: normalizeStyle(
|
|
91
|
+
((_d = __props.device) == null ? void 0 : _d.onlineState) === 1 ? "background:linear-gradient(180deg, #5A2120 0%, #C81F12 100%); color:#FDE777;" : "background: rgb(var(--hy-background-2)); color: rgb(var(--hy-auxiliary));"
|
|
92
|
+
),
|
|
93
|
+
class: "user-avatar font-[600] text-base"
|
|
94
|
+
},
|
|
95
|
+
" GB ",
|
|
96
|
+
4
|
|
97
|
+
/* STYLE */
|
|
98
|
+
)) : (openBlock(), createElementBlock("div", {
|
|
99
|
+
key: 1,
|
|
100
|
+
class: "user-avatar"
|
|
101
|
+
}, [
|
|
102
|
+
headImg.value ? (openBlock(), createElementBlock("img", {
|
|
103
|
+
key: 0,
|
|
104
|
+
src: headImg.value,
|
|
105
|
+
alt: unref(t)("userAvatar.userAvatar")
|
|
106
|
+
}, null, 8, ["src", "alt"])) : ((_e = __props.device) == null ? void 0 : _e.onlineState) === 1 ? (openBlock(), createBlock(unref(AppIcon), {
|
|
107
|
+
key: 1,
|
|
108
|
+
"svg-name": __props.initSelectSvgName,
|
|
109
|
+
className: "svgBox"
|
|
110
|
+
}, null, 8, ["svg-name"])) : (openBlock(), createBlock(unref(AppIcon), {
|
|
111
|
+
key: 2,
|
|
112
|
+
"svg-name": __props.initSvgName,
|
|
113
|
+
className: "svgBox"
|
|
114
|
+
}, null, 8, ["svg-name"]))
|
|
115
|
+
])),
|
|
116
|
+
__props.iconType ? (openBlock(), createElementBlock(
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
key: 2,
|
|
120
|
+
class: normalizeClass(
|
|
121
|
+
((_f = __props.device) == null ? void 0 : _f.onlineState) === 1 ? "bg-success shadow-[0_0_4px_0] shadow-success" : "bg-info"
|
|
122
|
+
)
|
|
123
|
+
},
|
|
124
|
+
null,
|
|
125
|
+
2
|
|
126
|
+
/* CLASS */
|
|
127
|
+
)) : createCommentVNode("v-if", true)
|
|
128
|
+
],
|
|
129
|
+
4
|
|
130
|
+
/* STYLE */
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export { _sfc_main as default };
|