@fmdeui/fmui 1.0.17 → 1.0.18
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/es/packages/hooks/sysInfo.mjs +2 -2
- package/es/packages/hooks/useInfo.mjs +59 -20
- package/index.js +89 -50
- package/index.min.js +4 -4
- package/index.min.mjs +4 -4
- package/index.mjs +89 -50
- package/lib/packages/hooks/sysInfo.js +29 -29
- package/lib/packages/hooks/useInfo.js +59 -20
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/package.json +1 -1
- /package/{lib → es}/index.css +0 -0
- /package/{es/make-installer.css → lib/version.css} +0 -0
|
@@ -7,10 +7,10 @@ import '../api/index.mjs';
|
|
|
7
7
|
import { feature } from '../api/sys/index.mjs';
|
|
8
8
|
import { useBaseApi } from '../api/base/index.mjs';
|
|
9
9
|
|
|
10
|
-
const storesThemeConfig = useThemeConfig();
|
|
11
|
-
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
12
10
|
async function loadSysInfo(tenantid) {
|
|
13
11
|
var _a;
|
|
12
|
+
const storesThemeConfig = useThemeConfig();
|
|
13
|
+
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
14
14
|
const [err, res] = await feature(useBaseApi("sysTenant").gcomm(null, "sysInfo/" + Number(tenantid)));
|
|
15
15
|
if (err) {
|
|
16
16
|
themeConfig.value.logoUrl = img;
|
|
@@ -1,44 +1,83 @@
|
|
|
1
1
|
import { useUserInfo } from '../stores/userInfo.mjs';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const _getUserInfo = () => {
|
|
4
|
+
const store = useUserInfo();
|
|
5
|
+
return store.userInfos;
|
|
6
|
+
};
|
|
4
7
|
const isSupperAdmin = () => {
|
|
5
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 999;
|
|
6
10
|
};
|
|
7
11
|
const isTenantAdmin = () => {
|
|
8
|
-
|
|
12
|
+
var _a;
|
|
13
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 888;
|
|
9
14
|
};
|
|
10
15
|
const isAdmin = () => {
|
|
11
16
|
return isSupperAdmin() || isTenantAdmin();
|
|
12
17
|
};
|
|
13
18
|
const isNormalUser = () => {
|
|
14
|
-
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 777;
|
|
15
21
|
};
|
|
16
22
|
const isMember = () => {
|
|
17
|
-
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 666;
|
|
18
25
|
};
|
|
19
26
|
const userEmail = () => {
|
|
20
|
-
|
|
27
|
+
var _a;
|
|
28
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.email;
|
|
21
29
|
};
|
|
22
30
|
const userName = () => {
|
|
23
|
-
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.userName;
|
|
33
|
+
};
|
|
34
|
+
const userFriendName = () => {
|
|
35
|
+
var _a, _b, _c, _d, _e;
|
|
36
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.realName) ? (_b = _getUserInfo()) == null ? void 0 : _b.realName : ((_c = _getUserInfo()) == null ? void 0 : _c.account) ? (_d = _getUserInfo()) == null ? void 0 : _d.account : (_e = _getUserInfo()) == null ? void 0 : _e.email;
|
|
24
37
|
};
|
|
25
|
-
const userFriendName = () => (userInfos == null ? void 0 : userInfos.realName) ? userInfos == null ? void 0 : userInfos.realName : (userInfos == null ? void 0 : userInfos.account) ? userInfos == null ? void 0 : userInfos.account : userInfos == null ? void 0 : userInfos.email;
|
|
26
38
|
const tenantId = () => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
var _a;
|
|
40
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.tenantId;
|
|
41
|
+
};
|
|
42
|
+
const userAccount = () => {
|
|
43
|
+
var _a;
|
|
44
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.account;
|
|
45
|
+
};
|
|
46
|
+
const userPhone = () => {
|
|
47
|
+
var _a;
|
|
48
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.phone;
|
|
49
|
+
};
|
|
50
|
+
const userId = () => {
|
|
51
|
+
var _a;
|
|
52
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.id;
|
|
53
|
+
};
|
|
54
|
+
const orgId = () => {
|
|
55
|
+
var _a;
|
|
56
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.orgId;
|
|
57
|
+
};
|
|
58
|
+
const orgName = () => {
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.orgName;
|
|
61
|
+
};
|
|
62
|
+
const posId = () => {
|
|
63
|
+
var _a;
|
|
64
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.posId;
|
|
65
|
+
};
|
|
66
|
+
const posName = () => {
|
|
67
|
+
var _a;
|
|
68
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.posName;
|
|
69
|
+
};
|
|
70
|
+
const roles = () => {
|
|
71
|
+
var _a;
|
|
72
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.roles;
|
|
73
|
+
};
|
|
37
74
|
const hasRoleCode = (code) => {
|
|
38
|
-
|
|
75
|
+
var _a;
|
|
76
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.roles.find((u) => u.code === code)) ? true : false;
|
|
39
77
|
};
|
|
40
78
|
const hasPrivilege = (privilege) => {
|
|
41
|
-
|
|
79
|
+
var _a;
|
|
80
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.authApiList.includes(privilege);
|
|
42
81
|
};
|
|
43
82
|
|
|
44
83
|
export { hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone };
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.18 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pinia'), require('crypto-js'), require('xlsx-js-style'), require('element-plus'), require('vue'), require('@element-plus/icons-vue'), require('axios'), require('js-cookie'), require('@microsoft/signalr'), require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('vue-i18n'), require('exceljs'), require('lodash-es'), require('@vueuse/core'), require('mitt'), require('vue-router'), require('nprogress')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'pinia', 'crypto-js', 'xlsx-js-style', 'element-plus', 'vue', '@element-plus/icons-vue', 'axios', 'js-cookie', '@microsoft/signalr', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'vue-i18n', 'exceljs', 'lodash-es', '@vueuse/core', 'mitt', 'vue-router', 'nprogress'], factory) :
|
|
@@ -18873,48 +18873,48 @@
|
|
|
18873
18873
|
}
|
|
18874
18874
|
}
|
|
18875
18875
|
|
|
18876
|
-
const storesThemeConfig$1 = useThemeConfig();
|
|
18877
|
-
const { themeConfig: themeConfig$1 } = pinia$1.storeToRefs(storesThemeConfig$1);
|
|
18878
18876
|
async function loadSysInfo(tenantid) {
|
|
18879
18877
|
var _a;
|
|
18878
|
+
const storesThemeConfig = useThemeConfig();
|
|
18879
|
+
const { themeConfig } = pinia$1.storeToRefs(storesThemeConfig);
|
|
18880
18880
|
const [err, res] = await feature(useBaseApi("sysTenant").gcomm(null, "sysInfo/" + Number(tenantid)));
|
|
18881
18881
|
if (err) {
|
|
18882
|
-
themeConfig
|
|
18882
|
+
themeConfig.value.logoUrl = img;
|
|
18883
18883
|
Local.remove("themeConfig");
|
|
18884
|
-
Local.set("themeConfig", storesThemeConfig
|
|
18884
|
+
Local.set("themeConfig", storesThemeConfig.themeConfig);
|
|
18885
18885
|
return;
|
|
18886
18886
|
} else {
|
|
18887
18887
|
if (res.data.type != "success" || res.data.result == null) return;
|
|
18888
18888
|
const data = res.data.result;
|
|
18889
|
-
themeConfig
|
|
18890
|
-
themeConfig
|
|
18891
|
-
themeConfig
|
|
18892
|
-
themeConfig
|
|
18893
|
-
themeConfig
|
|
18894
|
-
themeConfig
|
|
18895
|
-
themeConfig
|
|
18896
|
-
themeConfig
|
|
18897
|
-
themeConfig
|
|
18898
|
-
themeConfig
|
|
18899
|
-
themeConfig
|
|
18900
|
-
themeConfig
|
|
18901
|
-
themeConfig
|
|
18902
|
-
themeConfig
|
|
18903
|
-
themeConfig
|
|
18904
|
-
themeConfig
|
|
18905
|
-
themeConfig
|
|
18906
|
-
themeConfig
|
|
18907
|
-
themeConfig
|
|
18908
|
-
themeConfig
|
|
18909
|
-
themeConfig
|
|
18910
|
-
themeConfig
|
|
18911
|
-
themeConfig
|
|
18912
|
-
themeConfig
|
|
18889
|
+
themeConfig.value.logoUrl = data.logo;
|
|
18890
|
+
themeConfig.value.globalTitle = data.title;
|
|
18891
|
+
themeConfig.value.globalViceTitle = data.viceTitle;
|
|
18892
|
+
themeConfig.value.globalViceTitleMsg = data.viceDesc;
|
|
18893
|
+
themeConfig.value.icp = data.icp;
|
|
18894
|
+
themeConfig.value.icpUrl = data.icpUrl;
|
|
18895
|
+
themeConfig.value.isWatermark = data.watermark != null;
|
|
18896
|
+
themeConfig.value.watermarkText = data.watermark;
|
|
18897
|
+
themeConfig.value.copyright = data.copyright;
|
|
18898
|
+
themeConfig.value.version = data.version;
|
|
18899
|
+
themeConfig.value.carouselFiles = data.carouselFiles;
|
|
18900
|
+
themeConfig.value.primary = data.themeColor;
|
|
18901
|
+
themeConfig.value.layout = data.layout;
|
|
18902
|
+
themeConfig.value.animation = data.animation;
|
|
18903
|
+
themeConfig.value.secondVer = data.secondVer;
|
|
18904
|
+
themeConfig.value.captcha = data.captcha;
|
|
18905
|
+
themeConfig.value.forceChangePassword = data.forceChangePassword;
|
|
18906
|
+
themeConfig.value.passwordExpirationTime = data.passwordExpirationTime;
|
|
18907
|
+
themeConfig.value.i18NSwitch = data.i18NSwitch;
|
|
18908
|
+
themeConfig.value.idleTimeout = data.idleTimeout;
|
|
18909
|
+
themeConfig.value.onlineNotice = data.onlineNotice;
|
|
18910
|
+
themeConfig.value.mobileLogin = data.mobileLogin;
|
|
18911
|
+
themeConfig.value.scanLogin = data.scanLogin;
|
|
18912
|
+
themeConfig.value.signUp = data.signUp;
|
|
18913
18913
|
window.__env__.VITE_SM_PUBLIC_KEY = data.publicKey;
|
|
18914
18914
|
updateFavicon(data.logo);
|
|
18915
|
-
updateIdleTimeout((_a = themeConfig
|
|
18915
|
+
updateIdleTimeout((_a = themeConfig.value.idleTimeout) != null ? _a : 0);
|
|
18916
18916
|
Local.remove("themeConfig");
|
|
18917
|
-
Local.set("themeConfig", storesThemeConfig
|
|
18917
|
+
Local.set("themeConfig", storesThemeConfig.themeConfig);
|
|
18918
18918
|
}
|
|
18919
18919
|
}
|
|
18920
18920
|
const updateFavicon = (url) => {
|
|
@@ -18922,45 +18922,84 @@
|
|
|
18922
18922
|
favicon.href = url ? url : "data:;base64,=";
|
|
18923
18923
|
};
|
|
18924
18924
|
|
|
18925
|
-
const
|
|
18925
|
+
const _getUserInfo = () => {
|
|
18926
|
+
const store = useUserInfo();
|
|
18927
|
+
return store.userInfos;
|
|
18928
|
+
};
|
|
18926
18929
|
const isSupperAdmin = () => {
|
|
18927
|
-
|
|
18930
|
+
var _a;
|
|
18931
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 999;
|
|
18928
18932
|
};
|
|
18929
18933
|
const isTenantAdmin = () => {
|
|
18930
|
-
|
|
18934
|
+
var _a;
|
|
18935
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 888;
|
|
18931
18936
|
};
|
|
18932
18937
|
const isAdmin = () => {
|
|
18933
18938
|
return isSupperAdmin() || isTenantAdmin();
|
|
18934
18939
|
};
|
|
18935
18940
|
const isNormalUser = () => {
|
|
18936
|
-
|
|
18941
|
+
var _a;
|
|
18942
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 777;
|
|
18937
18943
|
};
|
|
18938
18944
|
const isMember = () => {
|
|
18939
|
-
|
|
18945
|
+
var _a;
|
|
18946
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.accountType) === 666;
|
|
18940
18947
|
};
|
|
18941
18948
|
const userEmail = () => {
|
|
18942
|
-
|
|
18949
|
+
var _a;
|
|
18950
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.email;
|
|
18943
18951
|
};
|
|
18944
18952
|
const userName = () => {
|
|
18945
|
-
|
|
18953
|
+
var _a;
|
|
18954
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.userName;
|
|
18955
|
+
};
|
|
18956
|
+
const userFriendName = () => {
|
|
18957
|
+
var _a, _b, _c, _d, _e;
|
|
18958
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.realName) ? (_b = _getUserInfo()) == null ? void 0 : _b.realName : ((_c = _getUserInfo()) == null ? void 0 : _c.account) ? (_d = _getUserInfo()) == null ? void 0 : _d.account : (_e = _getUserInfo()) == null ? void 0 : _e.email;
|
|
18946
18959
|
};
|
|
18947
|
-
const userFriendName = () => (userInfos == null ? void 0 : userInfos.realName) ? userInfos == null ? void 0 : userInfos.realName : (userInfos == null ? void 0 : userInfos.account) ? userInfos == null ? void 0 : userInfos.account : userInfos == null ? void 0 : userInfos.email;
|
|
18948
18960
|
const tenantId = () => {
|
|
18949
|
-
|
|
18961
|
+
var _a;
|
|
18962
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.tenantId;
|
|
18963
|
+
};
|
|
18964
|
+
const userAccount = () => {
|
|
18965
|
+
var _a;
|
|
18966
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.account;
|
|
18967
|
+
};
|
|
18968
|
+
const userPhone = () => {
|
|
18969
|
+
var _a;
|
|
18970
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.phone;
|
|
18971
|
+
};
|
|
18972
|
+
const userId = () => {
|
|
18973
|
+
var _a;
|
|
18974
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.id;
|
|
18975
|
+
};
|
|
18976
|
+
const orgId = () => {
|
|
18977
|
+
var _a;
|
|
18978
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.orgId;
|
|
18979
|
+
};
|
|
18980
|
+
const orgName = () => {
|
|
18981
|
+
var _a;
|
|
18982
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.orgName;
|
|
18983
|
+
};
|
|
18984
|
+
const posId = () => {
|
|
18985
|
+
var _a;
|
|
18986
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.posId;
|
|
18987
|
+
};
|
|
18988
|
+
const posName = () => {
|
|
18989
|
+
var _a;
|
|
18990
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.posName;
|
|
18991
|
+
};
|
|
18992
|
+
const roles = () => {
|
|
18993
|
+
var _a;
|
|
18994
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.roles;
|
|
18950
18995
|
};
|
|
18951
|
-
const userAccount = () => userInfos == null ? void 0 : userInfos.account;
|
|
18952
|
-
const userPhone = () => userInfos == null ? void 0 : userInfos.phone;
|
|
18953
|
-
const userId = () => userInfos == null ? void 0 : userInfos.id;
|
|
18954
|
-
const orgId = () => userInfos == null ? void 0 : userInfos.orgId;
|
|
18955
|
-
const orgName = () => userInfos == null ? void 0 : userInfos.orgName;
|
|
18956
|
-
const posId = () => userInfos == null ? void 0 : userInfos.posId;
|
|
18957
|
-
const posName = () => userInfos == null ? void 0 : userInfos.posName;
|
|
18958
|
-
const roles = () => userInfos == null ? void 0 : userInfos.roles;
|
|
18959
18996
|
const hasRoleCode = (code) => {
|
|
18960
|
-
|
|
18997
|
+
var _a;
|
|
18998
|
+
return ((_a = _getUserInfo()) == null ? void 0 : _a.roles.find((u) => u.code === code)) ? true : false;
|
|
18961
18999
|
};
|
|
18962
19000
|
const hasPrivilege = (privilege) => {
|
|
18963
|
-
|
|
19001
|
+
var _a;
|
|
19002
|
+
return (_a = _getUserInfo()) == null ? void 0 : _a.authApiList.includes(privilege);
|
|
18964
19003
|
};
|
|
18965
19004
|
|
|
18966
19005
|
const useDateTimeShortCust = () => {
|