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
|
@@ -252,13 +252,27 @@ const useAppTableWrapper = (hy) => {
|
|
|
252
252
|
emits("on-select-checkbox", selectedList.value, row);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function onTableSelectHandler(selectList = [], row) {
|
|
256
256
|
if (selectList.length === 0 && tableDataSource.value.length === 0) {
|
|
257
|
-
|
|
257
|
+
clearSelection();
|
|
258
258
|
}
|
|
259
259
|
selectedList.value = [...selectList];
|
|
260
260
|
emits("on-select-checkbox", [...selectList], row);
|
|
261
261
|
}
|
|
262
|
+
function clearSelectedList(list = []) {
|
|
263
|
+
selectedList.value = list || [];
|
|
264
|
+
clearSelection();
|
|
265
|
+
list.forEach((row) => {
|
|
266
|
+
const item = tableDataSource.value.find(
|
|
267
|
+
(v) => getRowKey(row) === getRowKey(v)
|
|
268
|
+
);
|
|
269
|
+
if (item) {
|
|
270
|
+
tableRef.value.toggleRowSelection(item, true);
|
|
271
|
+
} else {
|
|
272
|
+
tableRef.value.toggleRowSelection(row, true);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
262
276
|
function setTableRowClassName(obj) {
|
|
263
277
|
const row = obj.row;
|
|
264
278
|
let className = [];
|
|
@@ -295,12 +309,13 @@ const useAppTableWrapper = (hy) => {
|
|
|
295
309
|
selectedList,
|
|
296
310
|
tableTriggerRef,
|
|
297
311
|
setTableRowClassName,
|
|
298
|
-
|
|
312
|
+
getSelectedList,
|
|
313
|
+
clearSelection,
|
|
314
|
+
clearSelectedList,
|
|
315
|
+
onTableSelectHandler,
|
|
299
316
|
onTableRowContextmenuHandler,
|
|
300
317
|
onTableRowClickHandler,
|
|
301
|
-
onTableColumnsSelectHandler
|
|
302
|
-
getSelectedList,
|
|
303
|
-
clearSelection
|
|
318
|
+
onTableColumnsSelectHandler
|
|
304
319
|
};
|
|
305
320
|
};
|
|
306
321
|
|
|
@@ -42,13 +42,11 @@ function useAppTableSearch(hy) {
|
|
|
42
42
|
vue.unref(api).post(`${props.controller}/page`, params, options).then(successFun).finally(() => {
|
|
43
43
|
resolve();
|
|
44
44
|
closeAppTableLoading();
|
|
45
|
-
clearSelection();
|
|
46
45
|
});
|
|
47
46
|
} else if (props.url) {
|
|
48
47
|
vue.unref(api).post(props.url, params, options).then(successFun).finally(() => {
|
|
49
48
|
resolve();
|
|
50
49
|
closeAppTableLoading();
|
|
51
|
-
clearSelection();
|
|
52
50
|
});
|
|
53
51
|
} else {
|
|
54
52
|
closeAppTableLoading();
|
|
@@ -4,6 +4,22 @@ var vue = require('vue');
|
|
|
4
4
|
var is = require('../../../utils/is.js');
|
|
5
5
|
var useLocale = require('../../../hooks/useLocale.js');
|
|
6
6
|
|
|
7
|
+
function getColumnDefaultConfig(column) {
|
|
8
|
+
switch (column.type) {
|
|
9
|
+
case "selection":
|
|
10
|
+
return {
|
|
11
|
+
prop: `${column.type}_prop`,
|
|
12
|
+
reserveSelection: true
|
|
13
|
+
};
|
|
14
|
+
case "index":
|
|
15
|
+
case "expand":
|
|
16
|
+
return {
|
|
17
|
+
prop: `${column.type}_prop`
|
|
18
|
+
};
|
|
19
|
+
default:
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
7
23
|
function getColumnDefaultWidth(column) {
|
|
8
24
|
if (column.width) return column.width;
|
|
9
25
|
if (column.type === "index") return 80;
|
|
@@ -48,7 +64,7 @@ const useAppTable = (config = {}) => {
|
|
|
48
64
|
throw Error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
|
|
49
65
|
}
|
|
50
66
|
tableColumns.push({
|
|
51
|
-
|
|
67
|
+
...getColumnDefaultConfig(column),
|
|
52
68
|
...column,
|
|
53
69
|
type: column.type || "default",
|
|
54
70
|
width: getColumnDefaultWidth(column),
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index = require('../appIcon/index.js');
|
|
7
|
+
var useUserAvatarMap = require('../../hooks/useUserAvatarMap.js');
|
|
8
|
+
var adaptive = require('../../utils/adaptive.js');
|
|
9
|
+
var useLocale = require('../../hooks/useLocale.js');
|
|
10
|
+
|
|
11
|
+
import "./style/appUserAvatar.scss";
|
|
12
|
+
|
|
13
|
+
const __default__ = vue.defineComponent({
|
|
14
|
+
name: "AppUserAvatar"
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
17
|
+
props: {
|
|
18
|
+
initSelectSvgName: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: () => {
|
|
21
|
+
return "user_online-2";
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
initSvgName: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: () => {
|
|
27
|
+
return "user_offline-2";
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
device: Object,
|
|
31
|
+
// 设备信息
|
|
32
|
+
audioContextType: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: () => {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
iconType: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: () => {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
width: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: () => {
|
|
47
|
+
return "54px";
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
height: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: () => {
|
|
53
|
+
return "54px";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
emits: [],
|
|
58
|
+
setup(__props, { emit: __emit }) {
|
|
59
|
+
const props = __props;
|
|
60
|
+
const { t } = useLocale.useLocale();
|
|
61
|
+
const { userAvatarMap } = useUserAvatarMap.useUserAvatarMap();
|
|
62
|
+
const headImg = vue.computed(() => {
|
|
63
|
+
var _a;
|
|
64
|
+
return props.device && ((_a = vue.unref(userAvatarMap)) == null ? void 0 : _a.get(props.device.deviceId));
|
|
65
|
+
});
|
|
66
|
+
function parseRem(res) {
|
|
67
|
+
let px = res;
|
|
68
|
+
if (px) {
|
|
69
|
+
px = parseInt(px, 10);
|
|
70
|
+
if (isNaN(px)) {
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
return adaptive.pxTorem(px);
|
|
74
|
+
}
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
return (_ctx, _cache) => {
|
|
78
|
+
var _a, _b, _c, _d, _e, _f;
|
|
79
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
style: vue.normalizeStyle({
|
|
83
|
+
width: `${parseRem(__props.width)}rem`,
|
|
84
|
+
height: `${parseRem(__props.height)}rem`,
|
|
85
|
+
"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))"
|
|
86
|
+
}),
|
|
87
|
+
class: "app-user-avatar"
|
|
88
|
+
},
|
|
89
|
+
[
|
|
90
|
+
((_c = __props.device) == null ? void 0 : _c.gbDevice) === 1 ? (vue.openBlock(), vue.createElementBlock(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
key: 0,
|
|
94
|
+
style: vue.normalizeStyle(
|
|
95
|
+
((_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));"
|
|
96
|
+
),
|
|
97
|
+
class: "user-avatar font-[600] text-base"
|
|
98
|
+
},
|
|
99
|
+
" GB ",
|
|
100
|
+
4
|
|
101
|
+
/* STYLE */
|
|
102
|
+
)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
103
|
+
key: 1,
|
|
104
|
+
class: "user-avatar"
|
|
105
|
+
}, [
|
|
106
|
+
headImg.value ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
107
|
+
key: 0,
|
|
108
|
+
src: headImg.value,
|
|
109
|
+
alt: vue.unref(t)("userAvatar.userAvatar")
|
|
110
|
+
}, null, 8, ["src", "alt"])) : ((_e = __props.device) == null ? void 0 : _e.onlineState) === 1 ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppIcon), {
|
|
111
|
+
key: 1,
|
|
112
|
+
"svg-name": __props.initSelectSvgName,
|
|
113
|
+
className: "svgBox"
|
|
114
|
+
}, null, 8, ["svg-name"])) : (vue.openBlock(), vue.createBlock(vue.unref(index.AppIcon), {
|
|
115
|
+
key: 2,
|
|
116
|
+
"svg-name": __props.initSvgName,
|
|
117
|
+
className: "svgBox"
|
|
118
|
+
}, null, 8, ["svg-name"]))
|
|
119
|
+
])),
|
|
120
|
+
__props.iconType ? (vue.openBlock(), vue.createElementBlock(
|
|
121
|
+
"span",
|
|
122
|
+
{
|
|
123
|
+
key: 2,
|
|
124
|
+
class: vue.normalizeClass(
|
|
125
|
+
((_f = __props.device) == null ? void 0 : _f.onlineState) === 1 ? "bg-success shadow-[0_0_4px_0] shadow-success" : "bg-info"
|
|
126
|
+
)
|
|
127
|
+
},
|
|
128
|
+
null,
|
|
129
|
+
2
|
|
130
|
+
/* CLASS */
|
|
131
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
132
|
+
],
|
|
133
|
+
4
|
|
134
|
+
/* STYLE */
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var appUserAvatar = require('./appUserAvatar.vue.js');
|
|
6
|
+
var handler = require('../../utils/handler.js');
|
|
7
|
+
|
|
8
|
+
const AppUserAvatar = handler.withInstall(appUserAvatar.default);
|
|
9
|
+
|
|
10
|
+
exports.AppUserAvatar = AppUserAvatar;
|
|
11
|
+
exports.default = AppUserAvatar;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.app-user-avatar {
|
|
2
|
+
background: rgb(var(--hy-background-2));
|
|
3
|
+
position: relative;
|
|
4
|
+
border: 1px solid rgb(var(--hy-main));
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
flex-shrink: 0;
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
.user-avatar {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
img {
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
.svgBox {
|
|
20
|
+
width: 90%;
|
|
21
|
+
height: 90%;
|
|
22
|
+
color: rgb(var(--hy-main));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
span {
|
|
26
|
+
width: 32%;
|
|
27
|
+
height: 32%;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
position: absolute;
|
|
30
|
+
bottom: -4%;
|
|
31
|
+
right: -2%;
|
|
32
|
+
}
|
|
33
|
+
}
|
package/lib/components/index.js
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$
|
|
3
|
+
var index$9 = require('./appOrgCascader/index.js');
|
|
4
4
|
var index$2 = require('./appConfirmDialog/index.js');
|
|
5
5
|
var index$3 = require('./appDatePicker/index.js');
|
|
6
6
|
var index$4 = require('./appForm/index.js');
|
|
7
7
|
var index$5 = require('./appIcon/index.js');
|
|
8
|
-
var index$
|
|
9
|
-
var index$
|
|
10
|
-
var index$
|
|
8
|
+
var index$6 = require('./appIconBox/index.js');
|
|
9
|
+
var index$a = require('./appSearch/index.js');
|
|
10
|
+
var index$b = require('./appTable/index.js');
|
|
11
|
+
var index$c = require('./appTooltip/index.js');
|
|
11
12
|
var index$1 = require('./appConfigProvider/index.js');
|
|
12
13
|
var index = require('./appButton/index.js');
|
|
14
|
+
var index$d = require('./appUserAvatar/index.js');
|
|
15
|
+
var index$7 = require('./appNoPermissions/index.js');
|
|
16
|
+
var index$8 = require('./appNoPermissionsMap/index.js');
|
|
13
17
|
var useAppForm = require('./appForm/js/useAppForm.js');
|
|
14
18
|
var useAppSearch = require('./appSearch/js/useAppSearch.js');
|
|
15
19
|
var useAppTable = require('./appTable/js/useAppTable.js');
|
|
16
20
|
|
|
17
21
|
|
|
18
22
|
|
|
19
|
-
exports.AppOrgCascader = index$
|
|
23
|
+
exports.AppOrgCascader = index$9.AppOrgCascader;
|
|
20
24
|
exports.AppConfirmDialog = index$2.AppConfirmDialog;
|
|
21
25
|
exports.AppDatePicker = index$3.AppDatePicker;
|
|
22
26
|
exports.AppForm = index$4.AppForm;
|
|
23
27
|
exports.AppIcon = index$5.AppIcon;
|
|
24
|
-
exports.
|
|
25
|
-
exports.AppSearch = index$
|
|
26
|
-
exports.AppTable = index$
|
|
27
|
-
exports.AppTooltip = index$
|
|
28
|
+
exports.AppIconBox = index$6.AppIconBox;
|
|
29
|
+
exports.AppSearch = index$a.AppSearch;
|
|
30
|
+
exports.AppTable = index$b.AppTable;
|
|
31
|
+
exports.AppTooltip = index$c.AppTooltip;
|
|
28
32
|
exports.AppConfigProvider = index$1.AppConfigProvider;
|
|
29
33
|
exports.AppButton = index.AppButton;
|
|
34
|
+
exports.AppUserAvatar = index$d.AppUserAvatar;
|
|
35
|
+
exports.AppNoPermissions = index$7.AppNoPermissions;
|
|
36
|
+
exports.AppNoPermissionsMap = index$8.AppNoPermissionsMap;
|
|
30
37
|
exports.useAppForm = useAppForm.useAppForm;
|
|
31
38
|
exports.useAppSearch = useAppSearch.useAppSearch;
|
|
32
39
|
exports.useAppTable = useAppTable.useAppTable;
|
package/lib/hooks/index.js
CHANGED
|
@@ -4,6 +4,8 @@ var useApi = require('./useApi.js');
|
|
|
4
4
|
var useLocale = require('./useLocale.js');
|
|
5
5
|
var useGlobalConfig = require('./useGlobalConfig.js');
|
|
6
6
|
var useMixins = require('./useMixins.js');
|
|
7
|
+
var useUserAvatarMap = require('./useUserAvatarMap.js');
|
|
8
|
+
var useResizeHandler = require('./useResizeHandler.js');
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
|
|
@@ -20,3 +22,6 @@ exports.configProviderContextKey = useGlobalConfig.configProviderContextKey;
|
|
|
20
22
|
exports.provideGlobalConfig = useGlobalConfig.provideGlobalConfig;
|
|
21
23
|
exports.useGlobalConfig = useGlobalConfig.useGlobalConfig;
|
|
22
24
|
exports.useMixins = useMixins.useMixins;
|
|
25
|
+
exports.localUserAvatarMapKey = useUserAvatarMap.localUserAvatarMapKey;
|
|
26
|
+
exports.useUserAvatarMap = useUserAvatarMap.useUserAvatarMap;
|
|
27
|
+
exports.useResizeHandler = useResizeHandler.useResizeHandler;
|
package/lib/hooks/useApi.js
CHANGED
|
@@ -10,6 +10,15 @@ const defaultAxios = vue.ref(
|
|
|
10
10
|
timeout: 6e4
|
|
11
11
|
})
|
|
12
12
|
);
|
|
13
|
+
defaultAxios.value.interceptors.response.use(
|
|
14
|
+
(response) => {
|
|
15
|
+
const data = response == null ? void 0 : response.data;
|
|
16
|
+
return Promise.resolve(data);
|
|
17
|
+
},
|
|
18
|
+
(error) => {
|
|
19
|
+
return Promise.reject(error);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
13
22
|
const useApi = () => {
|
|
14
23
|
const api = vue.inject(localApiKey, defaultAxios);
|
|
15
24
|
return { api: vue.unref(api) ? api : defaultAxios };
|
|
@@ -4,6 +4,7 @@ var vue = require('vue');
|
|
|
4
4
|
var index = require('../locale/index.js');
|
|
5
5
|
var useLocale = require('./useLocale.js');
|
|
6
6
|
var useApi = require('./useApi.js');
|
|
7
|
+
var useUserAvatarMap = require('./useUserAvatarMap.js');
|
|
7
8
|
var zh_CN = require('../locale/zh_CN.js');
|
|
8
9
|
|
|
9
10
|
const globalConfig = vue.ref();
|
|
@@ -53,6 +54,10 @@ const provideGlobalConfig = (config, app, global = false) => {
|
|
|
53
54
|
useApi.localApiKey,
|
|
54
55
|
vue.computed(() => context.value.api)
|
|
55
56
|
);
|
|
57
|
+
provideFn(
|
|
58
|
+
useUserAvatarMap.localUserAvatarMapKey,
|
|
59
|
+
vue.computed(() => context.value.userAvatarMap)
|
|
60
|
+
);
|
|
56
61
|
if (global || !globalConfig.value) {
|
|
57
62
|
globalConfig.value = context.value;
|
|
58
63
|
}
|
|
@@ -1,47 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
-
var pinia = require('pinia');
|
|
5
4
|
var is = require('../utils/is.js');
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
const useMaintainStore = pinia.defineStore(MAINTAIN_STORE, {
|
|
9
|
-
state: () => ({
|
|
10
|
-
// resize集合
|
|
11
|
-
resizeMap: {}
|
|
12
|
-
}),
|
|
13
|
-
getters: {},
|
|
14
|
-
actions: {
|
|
15
|
-
/**
|
|
16
|
-
* @function setResize 添加统一重置
|
|
17
|
-
* @param {Function} callback 回调函数
|
|
18
|
-
* @param {Symbol | string} key
|
|
19
|
-
*/
|
|
20
|
-
addResize(callback, key) {
|
|
21
|
-
if (!callback) return;
|
|
22
|
-
if (!key) {
|
|
23
|
-
key = Symbol(key);
|
|
24
|
-
}
|
|
25
|
-
this.resizeMap[key] = callback;
|
|
26
|
-
addResizeListener();
|
|
27
|
-
return key;
|
|
28
|
-
},
|
|
29
|
-
/**
|
|
30
|
-
* @function removeResize 删除重置属性
|
|
31
|
-
* @param {Symbol} key
|
|
32
|
-
*/
|
|
33
|
-
removeResize(key) {
|
|
34
|
-
if (key) {
|
|
35
|
-
delete this.resizeMap[key];
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
// 清除所有resize事件
|
|
39
|
-
clearResize() {
|
|
40
|
-
this.resizeMap = {};
|
|
41
|
-
removeResizeListener();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
6
|
+
let resizeMap = {};
|
|
45
7
|
const resizeConfig = {
|
|
46
8
|
init: false,
|
|
47
9
|
animationId: void 0,
|
|
@@ -50,7 +12,6 @@ const resizeConfig = {
|
|
|
50
12
|
// timeout实例
|
|
51
13
|
};
|
|
52
14
|
function onResizeHandler() {
|
|
53
|
-
const maintainStore = useMaintainStore();
|
|
54
15
|
if (resizeConfig.animationId) {
|
|
55
16
|
resizeConfig.timerList.forEach((timeout) => {
|
|
56
17
|
timeout && clearTimeout(timeout);
|
|
@@ -59,7 +20,7 @@ function onResizeHandler() {
|
|
|
59
20
|
}
|
|
60
21
|
resizeConfig.animationId = window.requestAnimationFrame(() => {
|
|
61
22
|
try {
|
|
62
|
-
let symbolKeys = Object.getOwnPropertySymbols(
|
|
23
|
+
let symbolKeys = Object.getOwnPropertySymbols(resizeMap);
|
|
63
24
|
symbolKeys = [
|
|
64
25
|
...symbolKeys.slice(resizeConfig.resizeIndex),
|
|
65
26
|
...symbolKeys
|
|
@@ -67,7 +28,7 @@ function onResizeHandler() {
|
|
|
67
28
|
symbolKeys.forEach((key, index, list) => {
|
|
68
29
|
const timeout = setTimeout(() => {
|
|
69
30
|
resizeConfig.resizeIndex = list.length - 1 == index ? 0 : index;
|
|
70
|
-
const fun =
|
|
31
|
+
const fun = resizeMap[key];
|
|
71
32
|
is.isFunction(fun) && fun();
|
|
72
33
|
}, 1);
|
|
73
34
|
resizeConfig.timerList.push(timeout);
|
|
@@ -87,5 +48,30 @@ function removeResizeListener() {
|
|
|
87
48
|
window.removeEventListener("resize", onResizeHandler);
|
|
88
49
|
resizeConfig.init = false;
|
|
89
50
|
}
|
|
51
|
+
function useResizeHandler() {
|
|
52
|
+
function addResize(key, callback) {
|
|
53
|
+
if (!callback) return;
|
|
54
|
+
if (!key) {
|
|
55
|
+
key = /* @__PURE__ */ Symbol("resize");
|
|
56
|
+
}
|
|
57
|
+
resizeMap[key] = callback;
|
|
58
|
+
addResizeListener();
|
|
59
|
+
return key;
|
|
60
|
+
}
|
|
61
|
+
function removeResize(key) {
|
|
62
|
+
if (key) {
|
|
63
|
+
delete resizeMap[key];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function clearResize() {
|
|
67
|
+
resizeMap = {};
|
|
68
|
+
removeResizeListener();
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
addResize,
|
|
72
|
+
removeResize,
|
|
73
|
+
clearResize
|
|
74
|
+
};
|
|
75
|
+
}
|
|
90
76
|
|
|
91
|
-
exports.
|
|
77
|
+
exports.useResizeHandler = useResizeHandler;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
|
|
5
|
+
const localUserAvatarMapKey = /* @__PURE__ */ Symbol("userAvatarMap");
|
|
6
|
+
const useUserAvatarMap = () => {
|
|
7
|
+
const userAvatarMap = vue.inject(localUserAvatarMapKey, vue.ref(/* @__PURE__ */ new Map()));
|
|
8
|
+
return { userAvatarMap };
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.localUserAvatarMapKey = localUserAvatarMapKey;
|
|
12
|
+
exports.useUserAvatarMap = useUserAvatarMap;
|
package/lib/index.js
CHANGED
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var makeInstaller = require('./make-installer.js');
|
|
6
|
-
var index$a = require('./store/index.js');
|
|
7
6
|
var index = require('./components/appButton/index.js');
|
|
8
7
|
var index$1 = require('./components/appConfigProvider/index.js');
|
|
9
8
|
var index$2 = require('./components/appConfirmDialog/index.js');
|
|
10
9
|
var index$3 = require('./components/appDatePicker/index.js');
|
|
11
10
|
var index$4 = require('./components/appForm/index.js');
|
|
12
11
|
var index$5 = require('./components/appIcon/index.js');
|
|
13
|
-
var index$6 = require('./components/
|
|
14
|
-
var index$7 = require('./components/
|
|
15
|
-
var index$8 = require('./components/
|
|
16
|
-
var index$9 = require('./components/
|
|
12
|
+
var index$6 = require('./components/appIconBox/index.js');
|
|
13
|
+
var index$7 = require('./components/appNoPermissions/index.js');
|
|
14
|
+
var index$8 = require('./components/appNoPermissionsMap/index.js');
|
|
15
|
+
var index$9 = require('./components/appOrgCascader/index.js');
|
|
16
|
+
var index$a = require('./components/appSearch/index.js');
|
|
17
|
+
var index$b = require('./components/appTable/index.js');
|
|
18
|
+
var index$c = require('./components/appTooltip/index.js');
|
|
19
|
+
var index$d = require('./components/appUserAvatar/index.js');
|
|
17
20
|
var crypto = require('./utils/crypto.js');
|
|
18
21
|
var useLocale = require('./hooks/useLocale.js');
|
|
19
22
|
var bus = require('./utils/bus.js');
|
|
@@ -22,29 +25,32 @@ var useGlobalConfig = require('./hooks/useGlobalConfig.js');
|
|
|
22
25
|
var useApi = require('./hooks/useApi.js');
|
|
23
26
|
var date = require('./utils/date.js');
|
|
24
27
|
var is = require('./utils/is.js');
|
|
28
|
+
var useUserAvatarMap = require('./hooks/useUserAvatarMap.js');
|
|
25
29
|
var adaptive = require('./utils/adaptive.js');
|
|
26
30
|
var useAppForm = require('./components/appForm/js/useAppForm.js');
|
|
27
31
|
var useAppSearch = require('./components/appSearch/js/useAppSearch.js');
|
|
28
32
|
var useAppTable = require('./components/appTable/js/useAppTable.js');
|
|
29
|
-
var maintain = require('./store/maintain.js');
|
|
30
33
|
var useMixins = require('./hooks/useMixins.js');
|
|
34
|
+
var useResizeHandler = require('./hooks/useResizeHandler.js');
|
|
31
35
|
|
|
32
36
|
import "./style/index.scss";
|
|
33
37
|
|
|
34
38
|
|
|
35
39
|
exports.default = makeInstaller.default;
|
|
36
|
-
exports.store = index$a.store;
|
|
37
40
|
exports.AppButton = index.AppButton;
|
|
38
41
|
exports.AppConfigProvider = index$1.AppConfigProvider;
|
|
39
42
|
exports.AppConfirmDialog = index$2.AppConfirmDialog;
|
|
40
43
|
exports.AppDatePicker = index$3.AppDatePicker;
|
|
41
44
|
exports.AppForm = index$4.AppForm;
|
|
42
45
|
exports.AppIcon = index$5.AppIcon;
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
46
|
+
exports.AppIconBox = index$6.AppIconBox;
|
|
47
|
+
exports.AppNoPermissions = index$7.AppNoPermissions;
|
|
48
|
+
exports.AppNoPermissionsMap = index$8.AppNoPermissionsMap;
|
|
49
|
+
exports.AppOrgCascader = index$9.AppOrgCascader;
|
|
50
|
+
exports.AppSearch = index$a.AppSearch;
|
|
51
|
+
exports.AppTable = index$b.AppTable;
|
|
52
|
+
exports.AppTooltip = index$c.AppTooltip;
|
|
53
|
+
exports.AppUserAvatar = index$d.AppUserAvatar;
|
|
48
54
|
exports.base64Decrypt = crypto.base64Decrypt;
|
|
49
55
|
exports.encryptToBase64 = crypto.encryptToBase64;
|
|
50
56
|
exports.generateRandomCode = crypto.generateRandomCode;
|
|
@@ -79,6 +85,8 @@ exports.isString = is.isString;
|
|
|
79
85
|
exports.isSymbol = is.isSymbol;
|
|
80
86
|
exports.isUndefined = is.isUndefined;
|
|
81
87
|
exports.isVueProxy = is.isVueProxy;
|
|
88
|
+
exports.localUserAvatarMapKey = useUserAvatarMap.localUserAvatarMapKey;
|
|
89
|
+
exports.useUserAvatarMap = useUserAvatarMap.useUserAvatarMap;
|
|
82
90
|
exports.parseRem = adaptive.parseRem;
|
|
83
91
|
exports.pxTorem = adaptive.pxTorem;
|
|
84
92
|
exports.remToPx = adaptive.remToPx;
|
|
@@ -86,5 +94,5 @@ exports.vwToPx = adaptive.vwToPx;
|
|
|
86
94
|
exports.useAppForm = useAppForm.useAppForm;
|
|
87
95
|
exports.useAppSearch = useAppSearch.useAppSearch;
|
|
88
96
|
exports.useAppTable = useAppTable.useAppTable;
|
|
89
|
-
exports.useMaintainStore = maintain.useMaintainStore;
|
|
90
97
|
exports.useMixins = useMixins.useMixins;
|
|
98
|
+
exports.useResizeHandler = useResizeHandler.useResizeHandler;
|
package/lib/locale/en.js
CHANGED
|
@@ -35,6 +35,9 @@ var en = {
|
|
|
35
35
|
confirm: "Confirm",
|
|
36
36
|
loading: "Loading"
|
|
37
37
|
},
|
|
38
|
+
form: {
|
|
39
|
+
department: "Department"
|
|
40
|
+
},
|
|
38
41
|
table: {
|
|
39
42
|
hideFilter: "Hide filter",
|
|
40
43
|
displayFilter: "Display filter",
|
|
@@ -65,6 +68,15 @@ var en = {
|
|
|
65
68
|
},
|
|
66
69
|
cascader: {
|
|
67
70
|
pleaseSelectDepartment: "Please Select Department"
|
|
71
|
+
},
|
|
72
|
+
userAvatar: {
|
|
73
|
+
userAvatar: "User Avatar"
|
|
74
|
+
},
|
|
75
|
+
permissino: {
|
|
76
|
+
youDoNotHaveSubordinatePermissionsForThisModule: "You Do Not Have Subordinate Permissions For This Module",
|
|
77
|
+
pleaseContactTheAdministrator: "Please Contact The Administrator",
|
|
78
|
+
youDoNotHaveAMapConfigurationForThisModule: "You Do Not Have A Map Configuration For This Module",
|
|
79
|
+
pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "Please Contact The Administrator To Go To The Settings Center For Configuration"
|
|
68
80
|
}
|
|
69
81
|
};
|
|
70
82
|
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -35,6 +35,9 @@ var Chinese = {
|
|
|
35
35
|
confirm: "\u786E\u8BA4",
|
|
36
36
|
loading: "\u52A0\u8F7D\u4E2D"
|
|
37
37
|
},
|
|
38
|
+
form: {
|
|
39
|
+
department: "\u6240\u5C5E\u90E8\u95E8"
|
|
40
|
+
},
|
|
38
41
|
table: {
|
|
39
42
|
hideFilter: "\u9690\u85CF\u7B5B\u9009\u5668",
|
|
40
43
|
displayFilter: "\u663E\u793A\u7B5B\u9009\u5668",
|
|
@@ -64,7 +67,16 @@ var Chinese = {
|
|
|
64
67
|
dangerousOperation: "\u5371\u9669\u64CD\u4F5C"
|
|
65
68
|
},
|
|
66
69
|
cascader: {
|
|
67
|
-
pleaseSelectDepartment: "\u8BF7\u9009\u62E9\u90E8\u95E8"
|
|
70
|
+
pleaseSelectDepartment: "\u8BF7\u9009\u62E9\u6240\u5C5E\u90E8\u95E8"
|
|
71
|
+
},
|
|
72
|
+
userAvatar: {
|
|
73
|
+
userAvatar: "\u7528\u6237\u5934\u50CF"
|
|
74
|
+
},
|
|
75
|
+
permissino: {
|
|
76
|
+
youDoNotHaveSubordinatePermissionsForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u4E0B\u7EA7\u6743\u9650",
|
|
77
|
+
pleaseContactTheAdministrator: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458",
|
|
78
|
+
youDoNotHaveAMapConfigurationForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u7684\u5730\u56FE\u914D\u7F6E",
|
|
79
|
+
pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u524D\u5F80\u8BBE\u7F6E\u4E2D\u5FC3\u8FDB\u884C\u914D\u7F6E"
|
|
68
80
|
}
|
|
69
81
|
};
|
|
70
82
|
|
package/lib/make-installer.js
CHANGED
|
@@ -5,12 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var index = require('./constants/index.js');
|
|
6
6
|
var index$1 = require('./components/index.js');
|
|
7
7
|
var version = require('./version.js');
|
|
8
|
-
var index$2 = require('./store/index.js');
|
|
9
8
|
var useGlobalConfig = require('./hooks/useGlobalConfig.js');
|
|
10
9
|
|
|
11
10
|
const makeInstaller = () => {
|
|
12
11
|
const install = (app, options) => {
|
|
13
|
-
var _a, _b;
|
|
14
12
|
if (app[index.INSTALLED_KEY]) return;
|
|
15
13
|
app[index.INSTALLED_KEY] = true;
|
|
16
14
|
Object.values(index$1).forEach((component) => {
|
|
@@ -18,9 +16,6 @@ const makeInstaller = () => {
|
|
|
18
16
|
app.use(component);
|
|
19
17
|
});
|
|
20
18
|
if (options) useGlobalConfig.provideGlobalConfig(options, app, true);
|
|
21
|
-
if (!((_b = (_a = app.config) == null ? void 0 : _a.globalProperties) == null ? void 0 : _b.$pinia)) {
|
|
22
|
-
app.use(index$2.store);
|
|
23
|
-
}
|
|
24
19
|
};
|
|
25
20
|
return {
|
|
26
21
|
version: version.version,
|
package/lib/style/index.scss
CHANGED
package/lib/version.js
CHANGED