hy-dispatch-ui-v3 0.1.1 → 0.1.3
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 +56 -6
- package/es/components/appButton/appButton.vue.mjs +6 -6
- package/es/components/appButton/style/appButton.scss +4 -4
- 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/appForm/appForm.vue.mjs +17 -3
- package/es/components/appForm/js/useAppForm.mjs +15 -1
- package/es/components/appIcon/index.mjs +1 -3
- package/es/components/appIcon/style/appIcon.scss +2 -2
- package/es/components/{appIcon → appIconBox}/appIconBox.vue.mjs +3 -3
- package/es/components/appIconBox/index.mjs +6 -0
- package/es/components/appNoPermissions/appNoPermissions.vue.mjs +48 -0
- package/es/components/appNoPermissions/index.mjs +6 -0
- package/es/components/appNoPermissions/style/appNoPermissions.scss +0 -0
- package/es/components/appNoPermissionsMap/appNoPermissionsMap.vue.mjs +50 -0
- package/es/components/appNoPermissionsMap/index.mjs +6 -0
- package/es/components/appNoPermissionsMap/style/appNoPermissionsMap.scss +0 -0
- package/es/components/appOrgCascader/appOrgCascader.vue.mjs +1 -1
- package/es/components/appSearch/appSearch.vue.mjs +22 -6
- package/es/components/appSearch/js/index.mjs +17 -8
- package/es/components/appSearch/js/useAppSearch.mjs +12 -1
- package/es/components/appTable/appTable.vue.mjs +27 -10
- package/es/components/appTable/js/index.mjs +21 -6
- package/es/components/appTable/js/search.mjs +0 -2
- package/es/components/appTable/js/useAppTable.mjs +17 -1
- 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 +5 -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 +7 -3
- package/es/locale/en.mjs +12 -0
- package/es/locale/zh_CN.mjs +13 -1
- package/es/make-installer.mjs +0 -5
- package/es/style/index.scss +0 -2
- package/es/version.mjs +1 -1
- package/lib/components/appButton/appButton.vue.js +6 -6
- package/lib/components/appButton/style/appButton.scss +4 -4
- 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/appForm/appForm.vue.js +17 -3
- package/lib/components/appForm/js/useAppForm.js +15 -1
- package/lib/components/appIcon/index.js +0 -3
- package/lib/components/appIcon/style/appIcon.scss +2 -2
- package/lib/components/{appIcon → appIconBox}/appIconBox.vue.js +3 -3
- package/lib/components/appIconBox/index.js +11 -0
- package/lib/components/appNoPermissions/appNoPermissions.vue.js +52 -0
- package/lib/components/appNoPermissions/index.js +11 -0
- package/lib/components/appNoPermissions/style/appNoPermissions.scss +0 -0
- package/lib/components/appNoPermissionsMap/appNoPermissionsMap.vue.js +54 -0
- package/lib/components/appNoPermissionsMap/index.js +11 -0
- package/lib/components/appNoPermissionsMap/style/appNoPermissionsMap.scss +0 -0
- package/lib/components/appOrgCascader/appOrgCascader.vue.js +1 -1
- package/lib/components/appSearch/appSearch.vue.js +23 -7
- package/lib/components/appSearch/js/index.js +17 -7
- package/lib/components/appSearch/js/useAppSearch.js +12 -1
- package/lib/components/appTable/appTable.vue.js +26 -9
- package/lib/components/appTable/js/index.js +21 -6
- package/lib/components/appTable/js/search.js +0 -2
- package/lib/components/appTable/js/useAppTable.js +17 -1
- 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 +16 -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 +21 -13
- package/lib/locale/en.js +12 -0
- package/lib/locale/zh_CN.js +13 -1
- package/lib/make-installer.js +0 -5
- package/lib/style/index.scss +0 -2
- package/lib/version.js +1 -1
- package/package.json +21 -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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createVNode, unref, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
3
|
+
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
4
|
+
|
|
5
|
+
import "./style/appNoPermissions.scss";
|
|
6
|
+
|
|
7
|
+
const __default__ = defineComponent({
|
|
8
|
+
name: "AppNoPermissions"
|
|
9
|
+
});
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
11
|
+
props: {
|
|
12
|
+
svgName: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "2-v3-base-no-data-noData"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: [],
|
|
18
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
19
|
+
const { t } = useLocale();
|
|
20
|
+
__expose({});
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(), createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
|
|
23
|
+
createVNode(unref(AppIcon), {
|
|
24
|
+
"svg-name": __props.svgName,
|
|
25
|
+
"class-name": "!w-[46px] !h-[46px]"
|
|
26
|
+
}, null, 8, ["svg-name"]),
|
|
27
|
+
createElementVNode("div", { class: "text-center mt-[12px]" }, [
|
|
28
|
+
createElementVNode(
|
|
29
|
+
"p",
|
|
30
|
+
null,
|
|
31
|
+
toDisplayString(unref(t)("permissino.youDoNotHaveSubordinatePermissionsForThisModule")),
|
|
32
|
+
1
|
|
33
|
+
/* TEXT */
|
|
34
|
+
),
|
|
35
|
+
createElementVNode(
|
|
36
|
+
"p",
|
|
37
|
+
null,
|
|
38
|
+
toDisplayString(unref(t)("permissino.pleaseContactTheAdministrator")),
|
|
39
|
+
1
|
|
40
|
+
/* TEXT */
|
|
41
|
+
)
|
|
42
|
+
])
|
|
43
|
+
]);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { _sfc_main as default };
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createVNode, unref, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
3
|
+
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
4
|
+
|
|
5
|
+
import "./style/appNoPermissionsMap.scss";
|
|
6
|
+
|
|
7
|
+
const __default__ = defineComponent({
|
|
8
|
+
name: "AppNoPermissionsMap"
|
|
9
|
+
});
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
11
|
+
props: {
|
|
12
|
+
svgName: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "2-v3-base-no-data-noData"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: [],
|
|
18
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
19
|
+
const { t } = useLocale();
|
|
20
|
+
__expose({});
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(), createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
|
|
23
|
+
createVNode(unref(AppIcon), {
|
|
24
|
+
"svg-name": __props.svgName,
|
|
25
|
+
"class-name": "!w-[46px] !h-[46px]"
|
|
26
|
+
}, null, 8, ["svg-name"]),
|
|
27
|
+
createElementVNode("div", { class: "text-center mt-[12px]" }, [
|
|
28
|
+
createElementVNode(
|
|
29
|
+
"p",
|
|
30
|
+
null,
|
|
31
|
+
toDisplayString(unref(t)("permissino.youDoNotHaveAMapConfigurationForThisModule")),
|
|
32
|
+
1
|
|
33
|
+
/* TEXT */
|
|
34
|
+
),
|
|
35
|
+
createElementVNode(
|
|
36
|
+
"p",
|
|
37
|
+
null,
|
|
38
|
+
toDisplayString(unref(t)(
|
|
39
|
+
"permissino.pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration"
|
|
40
|
+
)),
|
|
41
|
+
1
|
|
42
|
+
/* TEXT */
|
|
43
|
+
)
|
|
44
|
+
])
|
|
45
|
+
]);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { _sfc_main as default };
|
|
File without changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { defineComponent, useTemplateRef, computed, unref, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, toDisplayString, Fragment, createCommentVNode, normalizeStyle, mergeProps, renderList, createBlock, renderSlot, withKeys } from 'vue';
|
|
2
2
|
import { ElIcon, ElForm, ElFormItem, ElInput, ElSelect } from 'element-plus';
|
|
3
3
|
import { Filter, ArrowDown } from '@element-plus/icons-vue';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { AppDatePicker } from '../appDatePicker/index.mjs';
|
|
5
|
+
import { AppOrgCascader } from '../appOrgCascader/index.mjs';
|
|
6
|
+
import { useShrink, isEmptyValue, columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, isSelectedTimeRange, timeRangeHandler } from './js/index.mjs';
|
|
6
7
|
import { resetAppSearchValue } from './js/useAppSearch.mjs';
|
|
7
8
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
8
9
|
import { isArray } from '../../utils/is.mjs';
|
|
@@ -310,7 +311,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
310
311
|
"daterange",
|
|
311
312
|
"monthrange",
|
|
312
313
|
"yearrange"
|
|
313
|
-
].includes((_a = column.attrs) == null ? void 0 : _a.type) && unref(isArray)(column.field) ? (openBlock(), createBlock(
|
|
314
|
+
].includes((_a = column.attrs) == null ? void 0 : _a.type) && unref(isArray)(column.field) ? (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
314
315
|
key: 0,
|
|
315
316
|
start: __props.model[column.field[0]],
|
|
316
317
|
"onUpdate:start": ($event) => __props.model[column.field[0]] = $event,
|
|
@@ -322,7 +323,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
322
323
|
disabled: unref(isDisabled)(props, column),
|
|
323
324
|
timeRangeFill: column.timeRangeFill,
|
|
324
325
|
onChange: ($event) => onChangeHandler($event, column)
|
|
325
|
-
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (openBlock(), createBlock(
|
|
326
|
+
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
326
327
|
key: 1,
|
|
327
328
|
modelValue: __props.model[column.field],
|
|
328
329
|
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
@@ -336,6 +337,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
336
337
|
],
|
|
337
338
|
64
|
|
338
339
|
/* STABLE_FRAGMENT */
|
|
340
|
+
)) : column.type === "org-cascader" ? (openBlock(), createElementBlock(
|
|
341
|
+
Fragment,
|
|
342
|
+
{ key: 4 },
|
|
343
|
+
[
|
|
344
|
+
createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
345
|
+
createVNode(unref(AppOrgCascader), mergeProps({
|
|
346
|
+
modelValue: __props.model[column.field],
|
|
347
|
+
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
348
|
+
disabled: unref(isDisabled)(props, column)
|
|
349
|
+
}, { ref_for: true }, column.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
350
|
+
],
|
|
351
|
+
2112
|
|
352
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
339
353
|
)) : createCommentVNode("v-if", true)
|
|
340
354
|
],
|
|
341
355
|
4
|
|
@@ -355,7 +369,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
355
369
|
renderList(column.timeRangeOptions, (item, index) => {
|
|
356
370
|
return openBlock(), createElementBlock("div", {
|
|
357
371
|
key: index,
|
|
358
|
-
class: "border-l border-border px-[10px] cursor-pointer",
|
|
372
|
+
class: normalizeClass(["border-l border-border px-[10px] cursor-pointer", {
|
|
373
|
+
"bg-[rgba(var(--hy-theme),0.2)] text-theme font-bold": unref(isSelectedTimeRange)(column, item, __props.model)
|
|
374
|
+
}]),
|
|
359
375
|
onClick: ($event) => onTimeRangeClickHandler(column, item)
|
|
360
376
|
}, [
|
|
361
377
|
createElementVNode(
|
|
@@ -365,7 +381,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
365
381
|
1
|
|
366
382
|
/* TEXT */
|
|
367
383
|
)
|
|
368
|
-
],
|
|
384
|
+
], 10, ["onClick"]);
|
|
369
385
|
}),
|
|
370
386
|
128
|
|
371
387
|
/* KEYED_FRAGMENT */
|
|
@@ -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,15 +82,16 @@ function useShrink(props, templateRef) {
|
|
|
82
82
|
switchShrink,
|
|
83
83
|
shrinkResizeHandler,
|
|
84
84
|
shrinkDestroy() {
|
|
85
|
-
|
|
85
|
+
removeResize(resizeExpandKey);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
function timeRangeHandler(column, options) {
|
|
90
90
|
const { value, unit } = options;
|
|
91
|
-
|
|
92
|
-
const format =
|
|
91
|
+
let { timeRangeFill, attrs } = column;
|
|
92
|
+
const format = "YYYY-MM-DD";
|
|
93
93
|
const date = dayjs(Date.now());
|
|
94
|
+
timeRangeFill = timeRangeFill || attrs.type === "datetimerange";
|
|
94
95
|
switch (unit) {
|
|
95
96
|
case "year":
|
|
96
97
|
case "month":
|
|
@@ -109,5 +110,13 @@ function timeRangeHandler(column, options) {
|
|
|
109
110
|
];
|
|
110
111
|
}
|
|
111
112
|
}
|
|
113
|
+
function isSelectedTimeRange(column, options, model = {}) {
|
|
114
|
+
const [start, end] = timeRangeHandler(column, options);
|
|
115
|
+
const { field } = column;
|
|
116
|
+
if (Array.isArray(field)) {
|
|
117
|
+
return start === model[field[0]] && end === model[field[1]];
|
|
118
|
+
}
|
|
119
|
+
return start === model[field][0] && end === model[field][1];
|
|
120
|
+
}
|
|
112
121
|
|
|
113
|
-
export { columnItemInputStyle, columnItemStyle, columnShowHandler, isDisabled, isEmptyValue, timeRangeHandler, useShrink };
|
|
122
|
+
export { columnItemInputStyle, columnItemStyle, columnShowHandler, isDisabled, isEmptyValue, isSelectedTimeRange, timeRangeHandler, useShrink };
|
|
@@ -4,6 +4,15 @@ import { getDefaultValueFormatByType } from '../../../utils/date.mjs';
|
|
|
4
4
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
5
5
|
import { isNumber } from '../../../utils/is.mjs';
|
|
6
6
|
|
|
7
|
+
const genDefaultLabel = (config) => {
|
|
8
|
+
if (config.label) return config.label;
|
|
9
|
+
const { t } = useLocale();
|
|
10
|
+
switch (config.type) {
|
|
11
|
+
// 部门级联选择框
|
|
12
|
+
case "org-cascader":
|
|
13
|
+
return t("form.department");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
7
16
|
const genPlaceholderHandler = (config) => {
|
|
8
17
|
const { t } = useLocale();
|
|
9
18
|
const { type, label, attrs = {} } = config || {};
|
|
@@ -94,7 +103,8 @@ const timeRangeOptionsHandler = (config) => {
|
|
|
94
103
|
}, []);
|
|
95
104
|
};
|
|
96
105
|
function appSearchItemHandler(column = {}) {
|
|
97
|
-
const
|
|
106
|
+
const label = genDefaultLabel(column);
|
|
107
|
+
const { placeholder, startPlaceholder, endPlaceholder } = genPlaceholderHandler({ ...column, label });
|
|
98
108
|
const attrs = {
|
|
99
109
|
clearable: true,
|
|
100
110
|
...column.attrs || {},
|
|
@@ -106,6 +116,7 @@ function appSearchItemHandler(column = {}) {
|
|
|
106
116
|
{
|
|
107
117
|
key: /* @__PURE__ */ Symbol("appFormItemKey"),
|
|
108
118
|
field: column.prop,
|
|
119
|
+
label,
|
|
109
120
|
readonly: column.readonly || false,
|
|
110
121
|
width,
|
|
111
122
|
inputWidth,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, withCtx, toDisplayString, withKeys, renderSlot, normalizeClass, mergeProps, Fragment,
|
|
1
|
+
import { defineComponent, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, withCtx, toDisplayString, withKeys, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers } from 'vue';
|
|
2
2
|
import { ElIcon, ElInput, ElButton, ElTable, ElTableColumn, ElDropdown, ElDropdownMenu, ElDropdownItem, ElPagination } from 'element-plus';
|
|
3
3
|
import { Filter, Search } from '@element-plus/icons-vue';
|
|
4
4
|
import { AppTooltip } from '../appTooltip/index.mjs';
|
|
@@ -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
|
|
|
@@ -170,9 +170,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
170
170
|
tableTriggerRef,
|
|
171
171
|
getSelectedList,
|
|
172
172
|
setTableRowClassName,
|
|
173
|
+
clearSelection,
|
|
174
|
+
clearSelectedList,
|
|
173
175
|
onTableRowClickHandler,
|
|
174
176
|
onTableRowContextmenuHandler,
|
|
175
|
-
|
|
177
|
+
onTableSelectHandler,
|
|
176
178
|
// useAppTableSearch
|
|
177
179
|
// 表单查询
|
|
178
180
|
formModel,
|
|
@@ -209,7 +211,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
209
211
|
resetFn,
|
|
210
212
|
getSelectedList,
|
|
211
213
|
getTotalElements,
|
|
212
|
-
getTableDataSource
|
|
214
|
+
getTableDataSource,
|
|
215
|
+
clearSelection,
|
|
216
|
+
clearSelectedList
|
|
213
217
|
});
|
|
214
218
|
return (_ctx, _cache) => {
|
|
215
219
|
return openBlock(), createElementBlock(
|
|
@@ -254,7 +258,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
254
258
|
key: 2,
|
|
255
259
|
modelValue: unref(formModel).query,
|
|
256
260
|
"onUpdate:modelValue": ($event) => unref(formModel).query = $event,
|
|
257
|
-
class: "w-[
|
|
261
|
+
class: "w-[160px]",
|
|
258
262
|
placeholder: unref(t)("table.searchFor", [unref(searchPlaceholder)]),
|
|
259
263
|
onKeydown: withKeys(unref(onSearchQueryHandler), ["enter"])
|
|
260
264
|
}, {
|
|
@@ -285,7 +289,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
285
289
|
hidden: !unref(showFilter),
|
|
286
290
|
class: normalizeClass({ "mb-4": unref(showFilter) }),
|
|
287
291
|
onSearch: ($event) => unref(getData)(1)
|
|
288
|
-
},
|
|
292
|
+
}, createSlots({
|
|
293
|
+
_: 2
|
|
294
|
+
/* DYNAMIC */
|
|
295
|
+
}, [
|
|
296
|
+
renderList(_ctx.$slots, (_, slotName) => {
|
|
297
|
+
return {
|
|
298
|
+
name: slotName,
|
|
299
|
+
fn: withCtx((scope) => [
|
|
300
|
+
renderSlot(_ctx.$slots, slotName, normalizeProps(guardReactiveProps(scope)))
|
|
301
|
+
])
|
|
302
|
+
};
|
|
303
|
+
})
|
|
304
|
+
]), 1032, ["model", "columns", "hidden", "class", "onSearch"])) : createCommentVNode("v-if", true),
|
|
289
305
|
createCommentVNode(" \u4E3B\u5185\u5BB9 "),
|
|
290
306
|
createElementVNode("div", { class: "h-0 flex-1 flex flex-col border border-border rounded pb-5 overflow-hidden" }, [
|
|
291
307
|
renderSlot(_ctx.$slots, "table", { data: unref(tableDataSource) }, () => [
|
|
@@ -301,7 +317,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
301
317
|
style: {
|
|
302
318
|
"font-size": `${unref(parseRem)(__props.fontSize)}rem`
|
|
303
319
|
},
|
|
304
|
-
|
|
320
|
+
onSelect: unref(onTableSelectHandler),
|
|
321
|
+
onSelectAll: unref(onTableSelectHandler),
|
|
305
322
|
onRowClick: unref(onTableRowClickHandler),
|
|
306
323
|
onRowContextmenu: unref(onTableRowContextmenuHandler)
|
|
307
324
|
}, _ctx.$attrs), {
|
|
@@ -365,7 +382,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
365
382
|
scope,
|
|
366
383
|
"default"
|
|
367
384
|
), (citem, cindex) => {
|
|
368
|
-
return openBlock(), createBlock(unref(
|
|
385
|
+
return openBlock(), createBlock(unref(AppIconBox), {
|
|
369
386
|
key: cindex,
|
|
370
387
|
"svg-name": citem.svgName,
|
|
371
388
|
altText: citem.label,
|
|
@@ -442,7 +459,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
442
459
|
)
|
|
443
460
|
]),
|
|
444
461
|
default: withCtx(() => [
|
|
445
|
-
createVNode(unref(
|
|
462
|
+
createVNode(unref(AppIconBox), {
|
|
446
463
|
key: "more",
|
|
447
464
|
"svg-name": "system-burst_analysis_select_option",
|
|
448
465
|
altText: unref(t)("table.moreOperations"),
|
|
@@ -491,7 +508,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
491
508
|
]),
|
|
492
509
|
_: 3
|
|
493
510
|
/* FORWARDED */
|
|
494
|
-
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelectAll", "onRowClick", "onRowContextmenu"])
|
|
511
|
+
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu"])
|
|
495
512
|
]),
|
|
496
513
|
createCommentVNode(" \u5206\u9875 "),
|
|
497
514
|
__props.showPagination ? (openBlock(), createElementBlock("div", {
|
|
@@ -250,13 +250,27 @@ const useAppTableWrapper = (hy) => {
|
|
|
250
250
|
emits("on-select-checkbox", selectedList.value, row);
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function onTableSelectHandler(selectList = [], row) {
|
|
254
254
|
if (selectList.length === 0 && tableDataSource.value.length === 0) {
|
|
255
|
-
|
|
255
|
+
clearSelection();
|
|
256
256
|
}
|
|
257
257
|
selectedList.value = [...selectList];
|
|
258
258
|
emits("on-select-checkbox", [...selectList], row);
|
|
259
259
|
}
|
|
260
|
+
function clearSelectedList(list = []) {
|
|
261
|
+
selectedList.value = list || [];
|
|
262
|
+
clearSelection();
|
|
263
|
+
list.forEach((row) => {
|
|
264
|
+
const item = tableDataSource.value.find(
|
|
265
|
+
(v) => getRowKey(row) === getRowKey(v)
|
|
266
|
+
);
|
|
267
|
+
if (item) {
|
|
268
|
+
tableRef.value.toggleRowSelection(item, true);
|
|
269
|
+
} else {
|
|
270
|
+
tableRef.value.toggleRowSelection(row, true);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
260
274
|
function setTableRowClassName(obj) {
|
|
261
275
|
const row = obj.row;
|
|
262
276
|
let className = [];
|
|
@@ -293,12 +307,13 @@ const useAppTableWrapper = (hy) => {
|
|
|
293
307
|
selectedList,
|
|
294
308
|
tableTriggerRef,
|
|
295
309
|
setTableRowClassName,
|
|
296
|
-
|
|
310
|
+
getSelectedList,
|
|
311
|
+
clearSelection,
|
|
312
|
+
clearSelectedList,
|
|
313
|
+
onTableSelectHandler,
|
|
297
314
|
onTableRowContextmenuHandler,
|
|
298
315
|
onTableRowClickHandler,
|
|
299
|
-
onTableColumnsSelectHandler
|
|
300
|
-
getSelectedList,
|
|
301
|
-
clearSelection
|
|
316
|
+
onTableColumnsSelectHandler
|
|
302
317
|
};
|
|
303
318
|
};
|
|
304
319
|
|
|
@@ -40,13 +40,11 @@ function useAppTableSearch(hy) {
|
|
|
40
40
|
unref(api).post(`${props.controller}/page`, params, options).then(successFun).finally(() => {
|
|
41
41
|
resolve();
|
|
42
42
|
closeAppTableLoading();
|
|
43
|
-
clearSelection();
|
|
44
43
|
});
|
|
45
44
|
} else if (props.url) {
|
|
46
45
|
unref(api).post(props.url, params, options).then(successFun).finally(() => {
|
|
47
46
|
resolve();
|
|
48
47
|
closeAppTableLoading();
|
|
49
|
-
clearSelection();
|
|
50
48
|
});
|
|
51
49
|
} else {
|
|
52
50
|
closeAppTableLoading();
|
|
@@ -2,6 +2,22 @@ import { toRef } from 'vue';
|
|
|
2
2
|
import { isEmpty, isBoolean } from '../../../utils/is.mjs';
|
|
3
3
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
4
4
|
|
|
5
|
+
function getColumnDefaultConfig(column) {
|
|
6
|
+
switch (column.type) {
|
|
7
|
+
case "selection":
|
|
8
|
+
return {
|
|
9
|
+
prop: `${column.type}_prop`,
|
|
10
|
+
reserveSelection: true
|
|
11
|
+
};
|
|
12
|
+
case "index":
|
|
13
|
+
case "expand":
|
|
14
|
+
return {
|
|
15
|
+
prop: `${column.type}_prop`
|
|
16
|
+
};
|
|
17
|
+
default:
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
5
21
|
function getColumnDefaultWidth(column) {
|
|
6
22
|
if (column.width) return column.width;
|
|
7
23
|
if (column.type === "index") return 80;
|
|
@@ -46,7 +62,7 @@ const useAppTable = (config = {}) => {
|
|
|
46
62
|
throw Error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
|
|
47
63
|
}
|
|
48
64
|
tableColumns.push({
|
|
49
|
-
|
|
65
|
+
...getColumnDefaultConfig(column),
|
|
50
66
|
...column,
|
|
51
67
|
type: column.type || "default",
|
|
52
68
|
width: getColumnDefaultWidth(column),
|
|
@@ -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 };
|