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,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/es/components/index.mjs
CHANGED
|
@@ -2,12 +2,16 @@ export { AppOrgCascader } from './appOrgCascader/index.mjs';
|
|
|
2
2
|
export { AppConfirmDialog } from './appConfirmDialog/index.mjs';
|
|
3
3
|
export { AppDatePicker } from './appDatePicker/index.mjs';
|
|
4
4
|
export { AppForm } from './appForm/index.mjs';
|
|
5
|
-
export { AppIcon
|
|
5
|
+
export { AppIcon } from './appIcon/index.mjs';
|
|
6
|
+
export { AppIconBox } from './appIconBox/index.mjs';
|
|
6
7
|
export { AppSearch } from './appSearch/index.mjs';
|
|
7
8
|
export { AppTable } from './appTable/index.mjs';
|
|
8
9
|
export { AppTooltip } from './appTooltip/index.mjs';
|
|
9
10
|
export { AppConfigProvider } from './appConfigProvider/index.mjs';
|
|
10
11
|
export { AppButton } from './appButton/index.mjs';
|
|
12
|
+
export { AppUserAvatar } from './appUserAvatar/index.mjs';
|
|
13
|
+
export { AppNoPermissions } from './appNoPermissions/index.mjs';
|
|
14
|
+
export { AppNoPermissionsMap } from './appNoPermissionsMap/index.mjs';
|
|
11
15
|
export { useAppForm } from './appForm/js/useAppForm.mjs';
|
|
12
16
|
export { useAppSearch } from './appSearch/js/useAppSearch.mjs';
|
|
13
17
|
export { useAppTable } from './appTable/js/useAppTable.mjs';
|
package/es/hooks/index.mjs
CHANGED
|
@@ -2,3 +2,5 @@ export { defaultAxios, localApiKey, useApi } from './useApi.mjs';
|
|
|
2
2
|
export { buildLocaleContext, buildTranslator, getLanguage, localeContextKey, translate, useLocale } from './useLocale.mjs';
|
|
3
3
|
export { configProviderContextKey, provideGlobalConfig, useGlobalConfig } from './useGlobalConfig.mjs';
|
|
4
4
|
export { useMixins } from './useMixins.mjs';
|
|
5
|
+
export { localUserAvatarMapKey, useUserAvatarMap } from './useUserAvatarMap.mjs';
|
|
6
|
+
export { useResizeHandler } from './useResizeHandler.mjs';
|
package/es/hooks/useApi.mjs
CHANGED
|
@@ -8,6 +8,15 @@ const defaultAxios = ref(
|
|
|
8
8
|
timeout: 6e4
|
|
9
9
|
})
|
|
10
10
|
);
|
|
11
|
+
defaultAxios.value.interceptors.response.use(
|
|
12
|
+
(response) => {
|
|
13
|
+
const data = response == null ? void 0 : response.data;
|
|
14
|
+
return Promise.resolve(data);
|
|
15
|
+
},
|
|
16
|
+
(error) => {
|
|
17
|
+
return Promise.reject(error);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
11
20
|
const useApi = () => {
|
|
12
21
|
const api = inject(localApiKey, defaultAxios);
|
|
13
22
|
return { api: unref(api) ? api : defaultAxios };
|
|
@@ -2,6 +2,7 @@ import { ref, getCurrentInstance, computed, unref, inject, provide } from 'vue';
|
|
|
2
2
|
import * as index from '../locale/index.mjs';
|
|
3
3
|
import { localeContextKey } from './useLocale.mjs';
|
|
4
4
|
import { localApiKey } from './useApi.mjs';
|
|
5
|
+
import { localUserAvatarMapKey } from './useUserAvatarMap.mjs';
|
|
5
6
|
import Chinese from '../locale/zh_CN.mjs';
|
|
6
7
|
|
|
7
8
|
const globalConfig = ref();
|
|
@@ -51,6 +52,10 @@ const provideGlobalConfig = (config, app, global = false) => {
|
|
|
51
52
|
localApiKey,
|
|
52
53
|
computed(() => context.value.api)
|
|
53
54
|
);
|
|
55
|
+
provideFn(
|
|
56
|
+
localUserAvatarMapKey,
|
|
57
|
+
computed(() => context.value.userAvatarMap)
|
|
58
|
+
);
|
|
54
59
|
if (global || !globalConfig.value) {
|
|
55
60
|
globalConfig.value = context.value;
|
|
56
61
|
}
|
|
@@ -1,45 +1,7 @@
|
|
|
1
1
|
import { nextTick } from 'vue';
|
|
2
|
-
import { defineStore } from 'pinia';
|
|
3
2
|
import { isFunction } from '../utils/is.mjs';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
const useMaintainStore = defineStore(MAINTAIN_STORE, {
|
|
7
|
-
state: () => ({
|
|
8
|
-
// resize集合
|
|
9
|
-
resizeMap: {}
|
|
10
|
-
}),
|
|
11
|
-
getters: {},
|
|
12
|
-
actions: {
|
|
13
|
-
/**
|
|
14
|
-
* @function setResize 添加统一重置
|
|
15
|
-
* @param {Function} callback 回调函数
|
|
16
|
-
* @param {Symbol | string} key
|
|
17
|
-
*/
|
|
18
|
-
addResize(callback, key) {
|
|
19
|
-
if (!callback) return;
|
|
20
|
-
if (!key) {
|
|
21
|
-
key = Symbol(key);
|
|
22
|
-
}
|
|
23
|
-
this.resizeMap[key] = callback;
|
|
24
|
-
addResizeListener();
|
|
25
|
-
return key;
|
|
26
|
-
},
|
|
27
|
-
/**
|
|
28
|
-
* @function removeResize 删除重置属性
|
|
29
|
-
* @param {Symbol} key
|
|
30
|
-
*/
|
|
31
|
-
removeResize(key) {
|
|
32
|
-
if (key) {
|
|
33
|
-
delete this.resizeMap[key];
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
// 清除所有resize事件
|
|
37
|
-
clearResize() {
|
|
38
|
-
this.resizeMap = {};
|
|
39
|
-
removeResizeListener();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
4
|
+
let resizeMap = {};
|
|
43
5
|
const resizeConfig = {
|
|
44
6
|
init: false,
|
|
45
7
|
animationId: void 0,
|
|
@@ -48,7 +10,6 @@ const resizeConfig = {
|
|
|
48
10
|
// timeout实例
|
|
49
11
|
};
|
|
50
12
|
function onResizeHandler() {
|
|
51
|
-
const maintainStore = useMaintainStore();
|
|
52
13
|
if (resizeConfig.animationId) {
|
|
53
14
|
resizeConfig.timerList.forEach((timeout) => {
|
|
54
15
|
timeout && clearTimeout(timeout);
|
|
@@ -57,7 +18,7 @@ function onResizeHandler() {
|
|
|
57
18
|
}
|
|
58
19
|
resizeConfig.animationId = window.requestAnimationFrame(() => {
|
|
59
20
|
try {
|
|
60
|
-
let symbolKeys = Object.getOwnPropertySymbols(
|
|
21
|
+
let symbolKeys = Object.getOwnPropertySymbols(resizeMap);
|
|
61
22
|
symbolKeys = [
|
|
62
23
|
...symbolKeys.slice(resizeConfig.resizeIndex),
|
|
63
24
|
...symbolKeys
|
|
@@ -65,7 +26,7 @@ function onResizeHandler() {
|
|
|
65
26
|
symbolKeys.forEach((key, index, list) => {
|
|
66
27
|
const timeout = setTimeout(() => {
|
|
67
28
|
resizeConfig.resizeIndex = list.length - 1 == index ? 0 : index;
|
|
68
|
-
const fun =
|
|
29
|
+
const fun = resizeMap[key];
|
|
69
30
|
isFunction(fun) && fun();
|
|
70
31
|
}, 1);
|
|
71
32
|
resizeConfig.timerList.push(timeout);
|
|
@@ -85,5 +46,30 @@ function removeResizeListener() {
|
|
|
85
46
|
window.removeEventListener("resize", onResizeHandler);
|
|
86
47
|
resizeConfig.init = false;
|
|
87
48
|
}
|
|
49
|
+
function useResizeHandler() {
|
|
50
|
+
function addResize(key, callback) {
|
|
51
|
+
if (!callback) return;
|
|
52
|
+
if (!key) {
|
|
53
|
+
key = /* @__PURE__ */ Symbol("resize");
|
|
54
|
+
}
|
|
55
|
+
resizeMap[key] = callback;
|
|
56
|
+
addResizeListener();
|
|
57
|
+
return key;
|
|
58
|
+
}
|
|
59
|
+
function removeResize(key) {
|
|
60
|
+
if (key) {
|
|
61
|
+
delete resizeMap[key];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function clearResize() {
|
|
65
|
+
resizeMap = {};
|
|
66
|
+
removeResizeListener();
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
addResize,
|
|
70
|
+
removeResize,
|
|
71
|
+
clearResize
|
|
72
|
+
};
|
|
73
|
+
}
|
|
88
74
|
|
|
89
|
-
export {
|
|
75
|
+
export { useResizeHandler };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { inject, ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
const localUserAvatarMapKey = /* @__PURE__ */ Symbol("userAvatarMap");
|
|
4
|
+
const useUserAvatarMap = () => {
|
|
5
|
+
const userAvatarMap = inject(localUserAvatarMapKey, ref(/* @__PURE__ */ new Map()));
|
|
6
|
+
return { userAvatarMap };
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { localUserAvatarMapKey, useUserAvatarMap };
|
package/es/index.mjs
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import installer from './make-installer.mjs';
|
|
2
|
-
export { store } from './store/index.mjs';
|
|
3
2
|
export { AppButton } from './components/appButton/index.mjs';
|
|
4
3
|
export { AppConfigProvider } from './components/appConfigProvider/index.mjs';
|
|
5
4
|
export { AppConfirmDialog } from './components/appConfirmDialog/index.mjs';
|
|
6
5
|
export { AppDatePicker } from './components/appDatePicker/index.mjs';
|
|
7
6
|
export { AppForm } from './components/appForm/index.mjs';
|
|
8
|
-
export { AppIcon
|
|
7
|
+
export { AppIcon } from './components/appIcon/index.mjs';
|
|
8
|
+
export { AppIconBox } from './components/appIconBox/index.mjs';
|
|
9
|
+
export { AppNoPermissions } from './components/appNoPermissions/index.mjs';
|
|
10
|
+
export { AppNoPermissionsMap } from './components/appNoPermissionsMap/index.mjs';
|
|
9
11
|
export { AppOrgCascader } from './components/appOrgCascader/index.mjs';
|
|
10
12
|
export { AppSearch } from './components/appSearch/index.mjs';
|
|
11
13
|
export { AppTable } from './components/appTable/index.mjs';
|
|
12
14
|
export { AppTooltip } from './components/appTooltip/index.mjs';
|
|
15
|
+
export { AppUserAvatar } from './components/appUserAvatar/index.mjs';
|
|
13
16
|
export { base64Decrypt, encryptToBase64, generateRandomCode } from './utils/crypto.mjs';
|
|
14
17
|
export { buildLocaleContext, buildTranslator, getLanguage, localeContextKey, translate, useLocale } from './hooks/useLocale.mjs';
|
|
15
18
|
export { bus } from './utils/bus.mjs';
|
|
@@ -18,12 +21,13 @@ export { configProviderContextKey, provideGlobalConfig, useGlobalConfig } from '
|
|
|
18
21
|
export { defaultAxios, localApiKey, useApi } from './hooks/useApi.mjs';
|
|
19
22
|
export { getDefaultValueFormatByType } from './utils/date.mjs';
|
|
20
23
|
export { isArray, isBoolean, isEmpty, isFunction, isNull, isNumber, isObject, isOverflowing, isString, isSymbol, isUndefined, isVueProxy } from './utils/is.mjs';
|
|
24
|
+
export { localUserAvatarMapKey, useUserAvatarMap } from './hooks/useUserAvatarMap.mjs';
|
|
21
25
|
export { parseRem, pxTorem, remToPx, vwToPx } from './utils/adaptive.mjs';
|
|
22
26
|
export { useAppForm } from './components/appForm/js/useAppForm.mjs';
|
|
23
27
|
export { useAppSearch } from './components/appSearch/js/useAppSearch.mjs';
|
|
24
28
|
export { useAppTable } from './components/appTable/js/useAppTable.mjs';
|
|
25
|
-
export { useMaintainStore } from './store/maintain.mjs';
|
|
26
29
|
export { useMixins } from './hooks/useMixins.mjs';
|
|
30
|
+
export { useResizeHandler } from './hooks/useResizeHandler.mjs';
|
|
27
31
|
|
|
28
32
|
import "./style/index.scss";
|
|
29
33
|
|
package/es/locale/en.mjs
CHANGED
|
@@ -31,6 +31,9 @@ var en = {
|
|
|
31
31
|
confirm: "Confirm",
|
|
32
32
|
loading: "Loading"
|
|
33
33
|
},
|
|
34
|
+
form: {
|
|
35
|
+
department: "Department"
|
|
36
|
+
},
|
|
34
37
|
table: {
|
|
35
38
|
hideFilter: "Hide filter",
|
|
36
39
|
displayFilter: "Display filter",
|
|
@@ -61,6 +64,15 @@ var en = {
|
|
|
61
64
|
},
|
|
62
65
|
cascader: {
|
|
63
66
|
pleaseSelectDepartment: "Please Select Department"
|
|
67
|
+
},
|
|
68
|
+
userAvatar: {
|
|
69
|
+
userAvatar: "User Avatar"
|
|
70
|
+
},
|
|
71
|
+
permissino: {
|
|
72
|
+
youDoNotHaveSubordinatePermissionsForThisModule: "You Do Not Have Subordinate Permissions For This Module",
|
|
73
|
+
pleaseContactTheAdministrator: "Please Contact The Administrator",
|
|
74
|
+
youDoNotHaveAMapConfigurationForThisModule: "You Do Not Have A Map Configuration For This Module",
|
|
75
|
+
pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "Please Contact The Administrator To Go To The Settings Center For Configuration"
|
|
64
76
|
}
|
|
65
77
|
};
|
|
66
78
|
|
package/es/locale/zh_CN.mjs
CHANGED
|
@@ -31,6 +31,9 @@ var Chinese = {
|
|
|
31
31
|
confirm: "\u786E\u8BA4",
|
|
32
32
|
loading: "\u52A0\u8F7D\u4E2D"
|
|
33
33
|
},
|
|
34
|
+
form: {
|
|
35
|
+
department: "\u6240\u5C5E\u90E8\u95E8"
|
|
36
|
+
},
|
|
34
37
|
table: {
|
|
35
38
|
hideFilter: "\u9690\u85CF\u7B5B\u9009\u5668",
|
|
36
39
|
displayFilter: "\u663E\u793A\u7B5B\u9009\u5668",
|
|
@@ -60,7 +63,16 @@ var Chinese = {
|
|
|
60
63
|
dangerousOperation: "\u5371\u9669\u64CD\u4F5C"
|
|
61
64
|
},
|
|
62
65
|
cascader: {
|
|
63
|
-
pleaseSelectDepartment: "\u8BF7\u9009\u62E9\u90E8\u95E8"
|
|
66
|
+
pleaseSelectDepartment: "\u8BF7\u9009\u62E9\u6240\u5C5E\u90E8\u95E8"
|
|
67
|
+
},
|
|
68
|
+
userAvatar: {
|
|
69
|
+
userAvatar: "\u7528\u6237\u5934\u50CF"
|
|
70
|
+
},
|
|
71
|
+
permissino: {
|
|
72
|
+
youDoNotHaveSubordinatePermissionsForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u4E0B\u7EA7\u6743\u9650",
|
|
73
|
+
pleaseContactTheAdministrator: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458",
|
|
74
|
+
youDoNotHaveAMapConfigurationForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u7684\u5730\u56FE\u914D\u7F6E",
|
|
75
|
+
pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u524D\u5F80\u8BBE\u7F6E\u4E2D\u5FC3\u8FDB\u884C\u914D\u7F6E"
|
|
64
76
|
}
|
|
65
77
|
};
|
|
66
78
|
|
package/es/make-installer.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { INSTALLED_KEY } from './constants/index.mjs';
|
|
2
2
|
import * as index from './components/index.mjs';
|
|
3
3
|
import { version } from './version.mjs';
|
|
4
|
-
import { store } from './store/index.mjs';
|
|
5
4
|
import { provideGlobalConfig } from './hooks/useGlobalConfig.mjs';
|
|
6
5
|
|
|
7
6
|
const makeInstaller = () => {
|
|
8
7
|
const install = (app, options) => {
|
|
9
|
-
var _a, _b;
|
|
10
8
|
if (app[INSTALLED_KEY]) return;
|
|
11
9
|
app[INSTALLED_KEY] = true;
|
|
12
10
|
Object.values(index).forEach((component) => {
|
|
@@ -14,9 +12,6 @@ const makeInstaller = () => {
|
|
|
14
12
|
app.use(component);
|
|
15
13
|
});
|
|
16
14
|
if (options) provideGlobalConfig(options, app, true);
|
|
17
|
-
if (!((_b = (_a = app.config) == null ? void 0 : _a.globalProperties) == null ? void 0 : _b.$pinia)) {
|
|
18
|
-
app.use(store);
|
|
19
|
-
}
|
|
20
15
|
};
|
|
21
16
|
return {
|
|
22
17
|
version,
|
package/es/style/index.scss
CHANGED
package/es/version.mjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var elementPlus = require('element-plus');
|
|
7
7
|
var iconsVue = require('@element-plus/icons-vue');
|
|
8
|
-
var
|
|
8
|
+
var index = require('../appIcon/index.js');
|
|
9
9
|
|
|
10
10
|
import "./style/appButton.scss";
|
|
11
11
|
|
|
@@ -42,10 +42,10 @@ const _sfc_main = {
|
|
|
42
42
|
setup(__props, { emit: __emit }) {
|
|
43
43
|
const props = __props;
|
|
44
44
|
const typeObj = {
|
|
45
|
-
default: "button_default",
|
|
46
|
-
primary: "button_function",
|
|
47
|
-
success: "button_addTo",
|
|
48
|
-
danger: "button_delete"
|
|
45
|
+
default: "hy-button_default",
|
|
46
|
+
primary: "hy-button_function",
|
|
47
|
+
success: "hy-button_addTo",
|
|
48
|
+
danger: "hy-button_delete"
|
|
49
49
|
};
|
|
50
50
|
const emit = __emit;
|
|
51
51
|
const handleClick = (event) => {
|
|
@@ -84,7 +84,7 @@ const _sfc_main = {
|
|
|
84
84
|
},
|
|
85
85
|
[
|
|
86
86
|
!__props.loading ? vue.renderSlot(_ctx.$slots, "svg", { key: 0 }, () => [
|
|
87
|
-
__props.svgName ? (vue.openBlock(), vue.createBlock(
|
|
87
|
+
__props.svgName ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppIcon), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"svg-name": __props.svgName,
|
|
90
90
|
"class-name": "!w-3 !h-3 text-main mr-2"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.button_default {
|
|
35
|
+
.hy-button_default {
|
|
36
36
|
background: rgba(94, 157, 180, 0.32);
|
|
37
37
|
|
|
38
38
|
.hy-button__border {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.button_function {
|
|
99
|
+
.hy-button_function {
|
|
100
100
|
background: rgba(45, 242, 255, 0.32);
|
|
101
101
|
|
|
102
102
|
.hy-button__border {
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.button_addTo {
|
|
163
|
+
.hy-button_addTo {
|
|
164
164
|
background: rgba(44, 232, 152, 0.32);
|
|
165
165
|
|
|
166
166
|
.hy-button__border {
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
.button_delete {
|
|
227
|
+
.hy-button_delete {
|
|
228
228
|
background: rgba(255, 77, 77, 0.32);
|
|
229
229
|
|
|
230
230
|
.hy-button__border {
|
|
@@ -33,45 +33,61 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
33
33
|
props: {
|
|
34
34
|
locale: {
|
|
35
35
|
type: String,
|
|
36
|
+
required: false,
|
|
36
37
|
default: "zhCn"
|
|
37
38
|
},
|
|
38
39
|
api: {
|
|
39
|
-
type: Object
|
|
40
|
+
type: [Object, Function],
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
userAvatarMap: {
|
|
44
|
+
type: Map,
|
|
45
|
+
required: false,
|
|
46
|
+
default: () => /* @__PURE__ */ new Map()
|
|
40
47
|
},
|
|
41
48
|
size: {
|
|
42
49
|
type: String,
|
|
50
|
+
required: false,
|
|
43
51
|
default: "default"
|
|
44
52
|
},
|
|
45
53
|
zIndex: {
|
|
46
|
-
type: Number
|
|
54
|
+
type: Number,
|
|
55
|
+
required: false
|
|
47
56
|
},
|
|
48
57
|
button: {
|
|
49
|
-
type: Object
|
|
58
|
+
type: Object,
|
|
59
|
+
required: false
|
|
50
60
|
},
|
|
51
61
|
link: {
|
|
52
|
-
type: Object
|
|
62
|
+
type: Object,
|
|
63
|
+
required: false
|
|
53
64
|
},
|
|
54
65
|
dialog: {
|
|
55
|
-
type: Object
|
|
66
|
+
type: Object,
|
|
67
|
+
required: false
|
|
56
68
|
},
|
|
57
69
|
message: {
|
|
58
|
-
type: Object
|
|
70
|
+
type: Object,
|
|
71
|
+
required: false
|
|
59
72
|
},
|
|
60
73
|
emptyValues: {
|
|
61
|
-
type: String
|
|
74
|
+
type: String,
|
|
75
|
+
required: false
|
|
62
76
|
},
|
|
63
77
|
valueOnClear: {
|
|
64
|
-
type: [String, Number, null]
|
|
78
|
+
type: [String, Number, null],
|
|
79
|
+
required: false
|
|
65
80
|
},
|
|
66
81
|
table: {
|
|
67
|
-
type: Object
|
|
82
|
+
type: Object,
|
|
83
|
+
required: false
|
|
68
84
|
}
|
|
69
85
|
},
|
|
70
86
|
setup(__props) {
|
|
71
87
|
const props = __props;
|
|
72
88
|
const globalConfig = useGlobalConfig.provideGlobalConfig(props);
|
|
73
89
|
const config = vue.computed(() => {
|
|
74
|
-
const { locale, api, ...config2 } = globalConfig.value;
|
|
90
|
+
const { locale, api, userAvatarMap, ...config2 } = globalConfig.value;
|
|
75
91
|
return {
|
|
76
92
|
locale: ElementLocale__namespace[locale] || ElementLocale__namespace["zhCn"],
|
|
77
93
|
...config2
|
|
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
31
31
|
},
|
|
32
32
|
showClose: {
|
|
33
33
|
type: Boolean,
|
|
34
|
-
default:
|
|
34
|
+
default: false
|
|
35
35
|
},
|
|
36
36
|
showCancel: {
|
|
37
37
|
type: Boolean,
|
|
@@ -55,19 +55,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
55
55
|
submitText: {
|
|
56
56
|
type: String
|
|
57
57
|
},
|
|
58
|
-
|
|
59
|
-
type:
|
|
58
|
+
iconColor: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "rgb(var(--hy-main))"
|
|
60
61
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
onClose: Function,
|
|
63
|
+
onCancel: Function,
|
|
64
|
+
onSubmit: Function
|
|
64
65
|
}, {
|
|
65
66
|
"modelValue": { type: Boolean, default: false },
|
|
66
67
|
"modelModifiers": {}
|
|
67
68
|
}),
|
|
68
|
-
emits: /* @__PURE__ */ vue.mergeModels(["
|
|
69
|
+
emits: /* @__PURE__ */ vue.mergeModels(["hide"], ["update:modelValue"]),
|
|
69
70
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
70
71
|
const props = __props;
|
|
72
|
+
const emits = __emit;
|
|
71
73
|
const { t } = useLocale.useLocale();
|
|
72
74
|
const visible = vue.useModel(__props, "modelValue");
|
|
73
75
|
const loading = vue.ref(false);
|
|
@@ -85,8 +87,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
85
87
|
}
|
|
86
88
|
visible.value = false;
|
|
87
89
|
loading.value = false;
|
|
90
|
+
emits("hide");
|
|
88
91
|
}
|
|
89
|
-
async function
|
|
92
|
+
async function onCancelHandler() {
|
|
90
93
|
if (loading.value) return;
|
|
91
94
|
loading.value = true;
|
|
92
95
|
if (props.onCancel) {
|
|
@@ -100,6 +103,23 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
100
103
|
}
|
|
101
104
|
visible.value = false;
|
|
102
105
|
loading.value = false;
|
|
106
|
+
emits("hide");
|
|
107
|
+
}
|
|
108
|
+
async function onCloseHandler() {
|
|
109
|
+
if (loading.value) return;
|
|
110
|
+
loading.value = true;
|
|
111
|
+
if (props.onClose) {
|
|
112
|
+
try {
|
|
113
|
+
await props.onClose();
|
|
114
|
+
} catch (err) {
|
|
115
|
+
console.error(err);
|
|
116
|
+
loading.value = false;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
visible.value = false;
|
|
121
|
+
loading.value = false;
|
|
122
|
+
emits("hide");
|
|
103
123
|
}
|
|
104
124
|
__expose({
|
|
105
125
|
show: () => {
|
|
@@ -121,7 +141,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
121
141
|
top: "15%"
|
|
122
142
|
}, _ctx.$attrs), {
|
|
123
143
|
header: vue.withCtx(() => [
|
|
124
|
-
vue.createElementVNode("div", {
|
|
144
|
+
vue.createElementVNode("div", {
|
|
145
|
+
class: "h-[38px] flex items-center justify-between border-b border-border pl-4 pr-[10px]",
|
|
146
|
+
onClick: vue.withModifiers(() => {
|
|
147
|
+
}, ["stop"])
|
|
148
|
+
}, [
|
|
125
149
|
vue.createElementVNode(
|
|
126
150
|
"span",
|
|
127
151
|
{ class: "text-sm text-main font-bold" },
|
|
@@ -151,44 +175,44 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
151
175
|
2
|
|
152
176
|
/* CLASS */
|
|
153
177
|
)) : vue.createCommentVNode("v-if", true)
|
|
154
|
-
])
|
|
178
|
+
], 8, ["onClick"])
|
|
155
179
|
]),
|
|
156
180
|
default: vue.withCtx(() => [
|
|
157
|
-
vue.createElementVNode("div", { class: "
|
|
181
|
+
vue.createElementVNode("div", { class: "flex flex-col items-center justify-between pt-[37px] pb-[27px]" }, [
|
|
158
182
|
vue.createElementVNode("div", { class: "flex flex-col items-center text-main" }, [
|
|
159
183
|
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
160
184
|
size: "40",
|
|
161
|
-
color:
|
|
185
|
+
color: __props.iconColor
|
|
162
186
|
}, {
|
|
163
187
|
default: vue.withCtx(() => [
|
|
164
188
|
vue.createVNode(vue.unref(iconsVue.Warning))
|
|
165
189
|
]),
|
|
166
190
|
_: 1
|
|
167
191
|
/* STABLE */
|
|
168
|
-
}),
|
|
192
|
+
}, 8, ["color"]),
|
|
169
193
|
vue.createElementVNode(
|
|
170
194
|
"div",
|
|
171
195
|
{
|
|
172
|
-
class: vue.normalizeClass(["text-base font-bold mt-[10px] mb-[26px]", __props.titleClass])
|
|
196
|
+
class: vue.normalizeClass(["text-base text-center font-bold mt-[10px] mb-[26px]", __props.titleClass])
|
|
173
197
|
},
|
|
174
198
|
vue.toDisplayString(__props.title),
|
|
175
199
|
3
|
|
176
200
|
/* TEXT, CLASS */
|
|
177
201
|
),
|
|
178
202
|
vue.createElementVNode("div", {
|
|
179
|
-
class: "max-w-[300px] text-smword-break",
|
|
203
|
+
class: "max-w-[300px] text-smword-break text-center break-all",
|
|
180
204
|
innerHTML: __props.content
|
|
181
205
|
}, null, 8, ["innerHTML"])
|
|
182
206
|
]),
|
|
183
207
|
__props.showSubmit || __props.showCancel ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
184
208
|
key: 0,
|
|
185
|
-
class: "
|
|
209
|
+
class: "pt-[32px]"
|
|
186
210
|
}, [
|
|
187
211
|
__props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppButton), {
|
|
188
212
|
key: 0,
|
|
189
213
|
type: __props.cancelType,
|
|
190
214
|
disabled: loading.value,
|
|
191
|
-
onClick:
|
|
215
|
+
onClick: onCancelHandler
|
|
192
216
|
}, {
|
|
193
217
|
default: vue.withCtx(() => [
|
|
194
218
|
vue.createTextVNode(
|