@fmdeui/fmui 1.0.36 → 1.0.38
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/index.d.ts +1 -3
- package/es/index.mjs +1 -5
- package/es/make-installer.css +1 -2
- package/es/make-installer.mjs +2 -1
- package/es/packages/components/fm-layout/src/navBars/topBar/userNews.vue2.mjs +3 -3
- package/es/packages/hooks/other.mjs +4 -3
- package/es/packages/stores/index.mjs +1 -0
- package/es/router/index.d.ts +2 -12
- package/es/stores/index.d.ts +2 -0
- package/index.css +1 -65
- package/index.js +124 -431
- package/index.min.css +1 -2
- package/index.min.js +6 -6
- package/index.min.mjs +6 -6
- package/index.mjs +121 -424
- package/lib/component.css +1 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +5 -18
- package/lib/make-installer.js +2 -1
- package/lib/packages/components/fm-layout/src/navBars/topBar/userNews.vue2.js +3 -3
- package/lib/packages/hooks/other.js +6 -5
- package/lib/packages/stores/index.js +2 -0
- package/lib/router/index.d.ts +2 -12
- package/lib/stores/index.d.ts +2 -0
- 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/es/node_modules/.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.css.mjs +0 -3
- package/es/packages/router/backEnd.mjs +0 -138
- package/es/packages/router/createRouter.mjs +0 -15
- package/es/packages/router/frontEnd.mjs +0 -80
- package/es/packages/router/index.mjs +0 -63
- package/es/packages/router/route.mjs +0 -28
- package/es/packages/router/utils.mjs +0 -37
- package/es/router/backEnd.d.ts +0 -63
- package/es/router/createRouter.d.ts +0 -7
- package/es/router/frontEnd.d.ts +0 -61
- package/es/router/route.d.ts +0 -60
- package/es/router/utils.d.ts +0 -14
- package/lib/node_modules/.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.css.js +0 -7
- package/lib/packages/router/backEnd.js +0 -149
- package/lib/packages/router/createRouter.js +0 -17
- package/lib/packages/router/frontEnd.js +0 -90
- package/lib/packages/router/index.js +0 -75
- package/lib/packages/router/route.js +0 -30
- package/lib/packages/router/utils.js +0 -40
- package/lib/router/backEnd.d.ts +0 -63
- package/lib/router/createRouter.d.ts +0 -7
- package/lib/router/frontEnd.d.ts +0 -61
- package/lib/router/route.d.ts +0 -60
- package/lib/router/utils.d.ts +0 -14
package/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { default as emitter } from './utils/mitt';
|
|
|
4
4
|
import { default as Watermark } from './utils/watermark';
|
|
5
5
|
import { default as commonFunction } from './hooks/commonFunction';
|
|
6
6
|
import { default as other } from './hooks/other';
|
|
7
|
-
import { default as router } from './router';
|
|
8
7
|
import { EmptyArrayType } from './types';
|
|
9
8
|
import { MessageHandler } from 'element-plus';
|
|
10
9
|
import { App } from 'vue';
|
|
@@ -13,7 +12,6 @@ export * from './api';
|
|
|
13
12
|
export * from './utils';
|
|
14
13
|
export * from './stores';
|
|
15
14
|
export * from './hooks';
|
|
16
|
-
export * from './router';
|
|
17
15
|
export * from './locale';
|
|
18
16
|
declare const commonFun: {
|
|
19
17
|
percentFormat: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
@@ -37,7 +35,7 @@ declare const commonFun: {
|
|
|
37
35
|
value: () => Date[];
|
|
38
36
|
}[];
|
|
39
37
|
};
|
|
40
|
-
export { setIntroduction, emitter as mittBus, Watermark, other, commonFunction, commonFun, setCssCdn, setJsCdn
|
|
38
|
+
export { setIntroduction, emitter as mittBus, Watermark, other, commonFunction, commonFun, setCssCdn, setJsCdn };
|
|
41
39
|
export { version } from './version';
|
|
42
40
|
export declare const install: (app: App) => void;
|
|
43
41
|
export default installer;
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,6 @@ var mitt = require('./packages/utils/mitt.js');
|
|
|
8
8
|
var watermark = require('./packages/utils/watermark.js');
|
|
9
9
|
var commonFunction = require('./packages/hooks/commonFunction.js');
|
|
10
10
|
var other = require('./packages/hooks/other.js');
|
|
11
|
-
var index$3 = require('./packages/router/index.js');
|
|
12
11
|
require('./packages/types/index.js');
|
|
13
12
|
var index = require('./packages/api/index.js');
|
|
14
13
|
require('./packages/utils/index.js');
|
|
@@ -24,7 +23,6 @@ var authFunction = require('./packages/hooks/authFunction.js');
|
|
|
24
23
|
var base64Conver = require('./packages/utils/base64Conver.js');
|
|
25
24
|
var useLocale = require('./packages/hooks/useLocale.js');
|
|
26
25
|
var arrayOperation = require('./packages/utils/arrayOperation.js');
|
|
27
|
-
var route = require('./packages/router/route.js');
|
|
28
26
|
var idleTimeout = require('./packages/hooks/idleTimeout.js');
|
|
29
27
|
var download = require('./packages/utils/download.js');
|
|
30
28
|
var en = require('./packages/locale/lang/en.js');
|
|
@@ -34,16 +32,14 @@ var flowLoading = require('./packages/utils/flowLoading.js');
|
|
|
34
32
|
var formatTime = require('./packages/utils/formatTime.js');
|
|
35
33
|
var gpsConvertor = require('./packages/utils/gpsConvertor.js');
|
|
36
34
|
var useInfo = require('./packages/hooks/useInfo.js');
|
|
37
|
-
var backEnd = require('./packages/router/backEnd.js');
|
|
38
|
-
var frontEnd = require('./packages/router/frontEnd.js');
|
|
39
35
|
var toolsValidate = require('./packages/utils/toolsValidate.js');
|
|
40
36
|
var sysInfo = require('./packages/hooks/sysInfo.js');
|
|
37
|
+
var inpinia = require('./packages/stores/inpinia.js');
|
|
41
38
|
var useDialogEvents = require('./packages/hooks/composables/useDialogEvents.js');
|
|
42
39
|
var signalR = require('./packages/utils/signalR.js');
|
|
43
|
-
var createRouter = require('./packages/router/createRouter.js');
|
|
44
40
|
var saulVModel = require('./packages/utils/saulVModel.js');
|
|
45
41
|
var dataSignature = require('./packages/utils/data-signature.js');
|
|
46
|
-
var index$
|
|
42
|
+
var index$3 = require('./packages/api/base/index.js');
|
|
47
43
|
var theme = require('./packages/utils/theme.js');
|
|
48
44
|
var dateTimeShortCust = require('./packages/hooks/dateTimeShortCust.js');
|
|
49
45
|
var formRule = require('./packages/utils/formRule.js');
|
|
@@ -68,7 +64,6 @@ exports.mittBus = mitt.default;
|
|
|
68
64
|
exports.Watermark = watermark.default;
|
|
69
65
|
exports.commonFunction = commonFunction.default;
|
|
70
66
|
exports.other = other.default;
|
|
71
|
-
exports.initRouter = index$3.initRouter;
|
|
72
67
|
exports.AccountTypeEnum = index.AccountTypeEnum;
|
|
73
68
|
exports.HttpMethodEnum = index.HttpMethodEnum;
|
|
74
69
|
exports.JobCreateTypeEnum = index.JobCreateTypeEnum;
|
|
@@ -118,11 +113,6 @@ exports.clone = arrayOperation.clone;
|
|
|
118
113
|
exports.isObjectValueEqual = arrayOperation.isObjectValueEqual;
|
|
119
114
|
exports.judgementSameArr = arrayOperation.judgementSameArr;
|
|
120
115
|
exports.removeDuplicate = arrayOperation.removeDuplicate;
|
|
121
|
-
exports.configureRoutes = route.configureRoutes;
|
|
122
|
-
Object.defineProperty(exports, "staticRoutes", {
|
|
123
|
-
enumerable: true,
|
|
124
|
-
get: function () { return route.staticRoutes; }
|
|
125
|
-
});
|
|
126
116
|
exports.destroyIdleTimeout = idleTimeout.destroyIdleTimeout;
|
|
127
117
|
exports.initIdleTimeout = idleTimeout.initIdleTimeout;
|
|
128
118
|
exports.updateIdleTimeout = idleTimeout.updateIdleTimeout;
|
|
@@ -164,9 +154,6 @@ exports.userFriendName = useInfo.userFriendName;
|
|
|
164
154
|
exports.userId = useInfo.userId;
|
|
165
155
|
exports.userName = useInfo.userName;
|
|
166
156
|
exports.userPhone = useInfo.userPhone;
|
|
167
|
-
exports.initBackEndControlRoutes = backEnd.initBackEndControlRoutes;
|
|
168
|
-
exports.setDynamicViewsModules = backEnd.setDynamicViewsModules;
|
|
169
|
-
exports.initFrontEndControlRoutes = frontEnd.initFrontEndControlRoutes;
|
|
170
157
|
exports.judgementIdCard = toolsValidate.judgementIdCard;
|
|
171
158
|
exports.verifiyNumberInteger = toolsValidate.verifiyNumberInteger;
|
|
172
159
|
exports.verifyAccount = toolsValidate.verifyAccount;
|
|
@@ -193,15 +180,15 @@ exports.verifyTextColor = toolsValidate.verifyTextColor;
|
|
|
193
180
|
exports.verifyUrl = toolsValidate.verifyUrl;
|
|
194
181
|
exports.loadSysInfo = sysInfo.loadSysInfo;
|
|
195
182
|
exports.updateFavicon = sysInfo.updateFavicon;
|
|
183
|
+
exports.pinia = inpinia.default;
|
|
196
184
|
exports.provideFormEvents = useDialogEvents.provideFormEvents;
|
|
197
185
|
exports.useFormEvents = useDialogEvents.useFormEvents;
|
|
198
186
|
exports.restartSignalR = signalR.restartSignalR;
|
|
199
187
|
exports.signalR = signalR.signalR;
|
|
200
|
-
exports.router = createRouter.router;
|
|
201
188
|
exports.saulVModel = saulVModel.saulVModel;
|
|
202
189
|
exports.signatureByKSort = dataSignature.signatureByKSort;
|
|
203
|
-
exports.useApi = index$
|
|
204
|
-
exports.useBaseApi = index$
|
|
190
|
+
exports.useApi = index$3.useApi;
|
|
191
|
+
exports.useBaseApi = index$3.useBaseApi;
|
|
205
192
|
exports.useChangeColor = theme.useChangeColor;
|
|
206
193
|
exports.useDateTimeShortCust = dateTimeShortCust.useDateTimeShortCust;
|
|
207
194
|
exports.useFormRulePresets = formRule.useFormRulePresets;
|
package/lib/make-installer.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('./packages/stores/index.js');
|
|
4
4
|
var index$1 = require('./packages/directive/index.js');
|
|
5
5
|
var setupVXETableHook = require('./packages/hooks/setupVXETableHook.js');
|
|
6
6
|
require('./packages/components/index.js');
|
|
7
|
+
var inpinia = require('./packages/stores/inpinia.js');
|
|
7
8
|
var index = require('./packages/components/svgIcon/index.js');
|
|
8
9
|
|
|
9
10
|
const makeInstaller = (components = []) => {
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
require('../../../../../api/index.js');
|
|
7
7
|
var commonFunction = require('../../../../../hooks/commonFunction.js');
|
|
8
|
-
require('../../../../../router/index.js');
|
|
9
|
-
var createRouter = require('../../../../../router/createRouter.js');
|
|
10
8
|
var index = require('../../../../../api/base/index.js');
|
|
11
9
|
|
|
12
10
|
const _hoisted_1 = { class: "user-news-container" };
|
|
@@ -32,13 +30,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
30
|
noticeList: Array
|
|
33
31
|
},
|
|
34
32
|
setup(__props) {
|
|
33
|
+
const { proxy } = vue.getCurrentInstance();
|
|
35
34
|
const { removeHtmlSub } = commonFunction.default();
|
|
36
35
|
const state = vue.reactive({
|
|
37
36
|
dialogVisible: false,
|
|
38
37
|
content: ""
|
|
39
38
|
});
|
|
40
39
|
const goToNotice = () => {
|
|
41
|
-
|
|
40
|
+
const router = proxy.$mycurRouter;
|
|
41
|
+
router.push("/dashboard/notice");
|
|
42
42
|
};
|
|
43
43
|
const viewNoticeDetail = async (notice) => {
|
|
44
44
|
state.content = notice.content;
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
require('../router/index.js');
|
|
7
6
|
var inpinia = require('../stores/inpinia.js');
|
|
8
7
|
var pinia = require('pinia');
|
|
9
8
|
var themeConfig = require('../stores/themeConfig.js');
|
|
10
9
|
var index = require('../locale/index.js');
|
|
11
10
|
var toolsValidate = require('../utils/toolsValidate.js');
|
|
12
|
-
var createRouter = require('../router/createRouter.js');
|
|
13
11
|
|
|
12
|
+
const { proxy } = vue.getCurrentInstance();
|
|
14
13
|
function useTitle() {
|
|
15
14
|
const stores = themeConfig.useThemeConfig(inpinia.default);
|
|
16
15
|
const { themeConfig: themeConfig$1 } = pinia.storeToRefs(stores);
|
|
16
|
+
const router = proxy.$mycurRouter;
|
|
17
17
|
vue.nextTick(() => {
|
|
18
18
|
let webTitle = "";
|
|
19
19
|
let globalTitle = themeConfig$1.value.globalTitle;
|
|
20
|
-
const { path, meta } =
|
|
20
|
+
const { path, meta } = router.currentRoute.value;
|
|
21
21
|
if (path === "/login") {
|
|
22
22
|
webTitle = meta.title;
|
|
23
23
|
} else {
|
|
24
|
-
webTitle = setTagsViewNameI18n(
|
|
24
|
+
webTitle = setTagsViewNameI18n(router.currentRoute.value);
|
|
25
25
|
}
|
|
26
26
|
document.title = `${webTitle} - ${globalTitle}` || globalTitle;
|
|
27
27
|
});
|
|
@@ -104,7 +104,8 @@ function handleEmpty(list) {
|
|
|
104
104
|
function handleOpenLink(val) {
|
|
105
105
|
var _a, _b, _c;
|
|
106
106
|
const { origin, pathname } = window.location;
|
|
107
|
-
|
|
107
|
+
const router = proxy.$mycurRouter;
|
|
108
|
+
router.push(val.path);
|
|
108
109
|
if (toolsValidate.verifyUrl((_a = val.meta) == null ? void 0 : _a.isLink)) window.open((_b = val.meta) == null ? void 0 : _b.isLink);
|
|
109
110
|
else window.open(`${origin}${pathname}#${(_c = val.meta) == null ? void 0 : _c.isLink}`);
|
|
110
111
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var inpinia = require('./inpinia.js');
|
|
3
4
|
var keepAliveNames = require('./keepAliveNames.js');
|
|
4
5
|
var requestOldRoutes = require('./requestOldRoutes.js');
|
|
5
6
|
var routesList = require('./routesList.js');
|
|
@@ -9,6 +10,7 @@ var userInfo = require('./userInfo.js');
|
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
13
|
+
exports.pinia = inpinia.default;
|
|
12
14
|
exports.useKeepALiveNames = keepAliveNames.useKeepALiveNames;
|
|
13
15
|
exports.useRequestOldRoutes = requestOldRoutes.useRequestOldRoutes;
|
|
14
16
|
exports.useRoutesList = routesList.useRoutesList;
|
package/lib/router/index.d.ts
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { initBackEndControlRoutes, setDynamicViewsModules } from './backEnd';
|
|
4
|
-
import { router } from './createRouter';
|
|
5
|
-
import { Router } from 'vue-router';
|
|
6
|
-
/**
|
|
7
|
-
* 初始化路由
|
|
8
|
-
* @returns 路由实例
|
|
9
|
-
*/
|
|
10
|
-
export declare function initRouter(): Router;
|
|
11
|
-
export default router;
|
|
12
|
-
export { configureRoutes, staticRoutes, setDynamicViewsModules, initBackEndControlRoutes, initFrontEndControlRoutes };
|
|
1
|
+
declare const EmtyRouter: {};
|
|
2
|
+
export default EmtyRouter;
|
package/lib/stores/index.d.ts
CHANGED
package/locale/en.js
CHANGED
package/locale/en.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.38 */(function(e,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis!="undefined"?globalThis:e||self,e.fmdeuiPlusLocaleEn=t())})(this,(function(){"use strict";var e={name:"en",plus:{datepicker:{date:"Please select date",dates:"Please select dates",week:"Please select week",month:"Please select month",months:"Please select months",year:"Please select year",years:"Please select years",startDatePlaceholder:"Please select start date",endDatePlaceholder:"Please select end date",datetime:"Please select datetime",startMonthPlaceholder:"Please select start month",endMonthPlaceholder:"Please select end month",startTimePlaceholder:"Please select start time",endTimePlaceholder:"Please select end time",shortcutsDate:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDaterange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"},shortcutsMonthrange:{thisMonth:"This month",thisYear:"This year",pastSixMonths:"Past six months"},shortcutsDatetime:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDatetimerange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"}},form:{pleaseEnter:"Please enter ",pleaseSelect:"Please select "},input:{placeholder:"Please enter ",appendTitle:"Yuan",validatePhone:"Please enter a valid phone number",validateIdCard:"Please enter a valid ID card number",validateInteger:"Please enter a valid integer",format:"Please enter a valid ",amount:"amount",numbers:"numbers",digitUppercase:"Please enter a valid amount format",validateError:"Please enter a valid format",escaped:{0:"Cent",1:"Penny",2:"Zero",3:"One",4:"Two",5:"Three",6:"Four",7:"Five",8:"Six",9:"Seven",10:"Eight",11:"Nine",12:"Yuan",13:"Ten thousand",14:"Ten million",15:"Ten billion",16:"Ten",17:"Hundred",18:"Thousand",19:"Short",20:"Whole"}},moduleForm:{save:"Save",back:"Back"},search:{searchText:"Search",resetText:"Reset",expand:"Expand",retract:"Retract",pleaseEnter:"Please enter ",pleaseSelect:"Please select ",popoverAttrs:{showTxt:"More",title:"All conditions",allTxt:"SelectAll",reverseTxt:"Reverse",clearTxt:"ClearAll"}},select:{selectAllTxt:"Select all"},selectIcon:{placeholder:"Please select icon",dialogTitle:"Please select icon",searchPlaceholder:"Search icon",emptyDescription:"No icon found"},copy:{copySuccess:"Copy success",copyFail:"Copy fail",invalidCopyContent:"Invalid copy content"},selectTable:{searchBtnTxt:"Search",radioTxt:"Radio",loadingTxt:"Loading...",copySuccess:"Copy success",copyFail:"Copy fail"},stepWizard:{lastBtnTitle:"Complete"},table:{columnBind:{btnTxt:"Column setting",title:"Column setting"},fistColumn:{label:"Number",radio:"Radio"},operator:{label:"Operation",more:"More",sum:"Sum",total:"Total",allSum:"All sum"},singleEdit:{tipText:"Click to edit"},pleaseEnter:"Please enter ",pleaseSelect:"Please select ",loadingTxt:"Loading...",dragTxt:"Drag",saveBtnTxt:"Save",density:"Density",default:"Default",loose:"Loose",compact:"Compact"},list:{idleTimeoutMessage:"Long time no operation, system logged out.",sysMessage:"System Message"}}};return e}));
|
package/locale/en.min.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.38 */var e={name:"en",plus:{datepicker:{date:"Please select date",dates:"Please select dates",week:"Please select week",month:"Please select month",months:"Please select months",year:"Please select year",years:"Please select years",startDatePlaceholder:"Please select start date",endDatePlaceholder:"Please select end date",datetime:"Please select datetime",startMonthPlaceholder:"Please select start month",endMonthPlaceholder:"Please select end month",startTimePlaceholder:"Please select start time",endTimePlaceholder:"Please select end time",shortcutsDate:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDaterange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"},shortcutsMonthrange:{thisMonth:"This month",thisYear:"This year",pastSixMonths:"Past six months"},shortcutsDatetime:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDatetimerange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"}},form:{pleaseEnter:"Please enter ",pleaseSelect:"Please select "},input:{placeholder:"Please enter ",appendTitle:"Yuan",validatePhone:"Please enter a valid phone number",validateIdCard:"Please enter a valid ID card number",validateInteger:"Please enter a valid integer",format:"Please enter a valid ",amount:"amount",numbers:"numbers",digitUppercase:"Please enter a valid amount format",validateError:"Please enter a valid format",escaped:{0:"Cent",1:"Penny",2:"Zero",3:"One",4:"Two",5:"Three",6:"Four",7:"Five",8:"Six",9:"Seven",10:"Eight",11:"Nine",12:"Yuan",13:"Ten thousand",14:"Ten million",15:"Ten billion",16:"Ten",17:"Hundred",18:"Thousand",19:"Short",20:"Whole"}},moduleForm:{save:"Save",back:"Back"},search:{searchText:"Search",resetText:"Reset",expand:"Expand",retract:"Retract",pleaseEnter:"Please enter ",pleaseSelect:"Please select ",popoverAttrs:{showTxt:"More",title:"All conditions",allTxt:"SelectAll",reverseTxt:"Reverse",clearTxt:"ClearAll"}},select:{selectAllTxt:"Select all"},selectIcon:{placeholder:"Please select icon",dialogTitle:"Please select icon",searchPlaceholder:"Search icon",emptyDescription:"No icon found"},copy:{copySuccess:"Copy success",copyFail:"Copy fail",invalidCopyContent:"Invalid copy content"},selectTable:{searchBtnTxt:"Search",radioTxt:"Radio",loadingTxt:"Loading...",copySuccess:"Copy success",copyFail:"Copy fail"},stepWizard:{lastBtnTitle:"Complete"},table:{columnBind:{btnTxt:"Column setting",title:"Column setting"},fistColumn:{label:"Number",radio:"Radio"},operator:{label:"Operation",more:"More",sum:"Sum",total:"Total",allSum:"All sum"},singleEdit:{tipText:"Click to edit"},pleaseEnter:"Please enter ",pleaseSelect:"Please select ",loadingTxt:"Loading...",dragTxt:"Drag",saveBtnTxt:"Save",density:"Density",default:"Default",loose:"Loose",compact:"Compact"},list:{idleTimeoutMessage:"Long time no operation, system logged out.",sysMessage:"System Message"}}};export{e as default};
|
package/locale/en.mjs
CHANGED
package/locale/zh-cn.js
CHANGED
package/locale/zh-cn.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.38 */(function(u,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define(e):(u=typeof globalThis!="undefined"?globalThis:u||self,u.fmdeuiPlusLocaleZhCn=e())})(this,(function(){"use strict";var u={name:"zh-cn",plus:{datepicker:{date:"\u8BF7\u9009\u62E9\u65E5\u671F",dates:"\u8BF7\u9009\u62E9\u65E5\u671F",week:"\u8BF7\u9009\u62E9\u5468",month:"\u8BF7\u9009\u62E9\u6708\u4EFD",months:"\u8BF7\u9009\u62E9\u6708\u4EFD",year:"\u8BF7\u9009\u62E9\u5E74\u4EFD",years:"\u8BF7\u9009\u62E9\u5E74\u4EFD",startDatePlaceholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",endDatePlaceholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",datetime:"\u8BF7\u9009\u62E9\u65E5\u671F\u65F6\u95F4",startMonthPlaceholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u6708\u4EFD",endMonthPlaceholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u6708\u4EFD",startTimePlaceholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",endTimePlaceholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",shortcutsDate:{today:"\u4ECA\u5929",yesterday:"\u6628\u5929",lastWeek:"\u4E00\u5468\u524D"},shortcutsDaterange:{pastWeek:"\u6700\u8FD1\u4E00\u5468",pastMonth:"\u6700\u8FD1\u4E00\u4E2A\u6708",pastThreeMonths:"\u6700\u8FD1\u4E09\u4E2A\u6708"},shortcutsMonthrange:{thisMonth:"\u672C\u6708",thisYear:"\u4ECA\u5E74\u81F3\u4ECA",pastSixMonths:"\u6700\u8FD1\u516D\u4E2A\u6708"},shortcutsDatetime:{today:"\u4ECA\u5929",yesterday:"\u6628\u5929",lastWeek:"\u4E00\u5468\u524D"},shortcutsDatetimerange:{pastWeek:"\u6700\u8FD1\u4E00\u5468",pastMonth:"\u6700\u8FD1\u4E00\u4E2A\u6708",pastThreeMonths:"\u6700\u8FD1\u4E09\u4E2A\u6708"}},form:{pleaseEnter:"\u8BF7\u8F93\u5165",pleaseSelect:"\u8BF7\u9009\u62E9"},input:{placeholder:"\u8BF7\u8F93\u5165",appendTitle:"\u5143",validatePhone:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",validateIdCard:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8EAB\u4EFD\u8BC1\u53F7\u7801",validateInteger:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u6574\u6570",format:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684",amount:"\u91D1\u989D",numbers:"\u6570\u5B57",digitUppercase:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u91D1\u989D\u683C\u5F0F",validateError:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u683C\u5F0F",escaped:{0:"\u89D2",1:"\u5206",2:"\u96F6",3:"\u58F9",4:"\u8D30",5:"\u53C1",6:"\u8086",7:"\u4F0D",8:"\u9646",9:"\u67D2",10:"\u634C",11:"\u7396",12:"\u5143",13:"\u4E07",14:"\u4EBF",15:"\u5146",16:"\u62FE",17:"\u4F70",18:"\u4EDF",19:"\u6B20",20:"\u6574"}},moduleForm:{save:"\u4FDD\u5B58",back:"\u8FD4\u56DE"},search:{searchText:"\u67E5\u8BE2",resetText:"\u91CD\u7F6E",expand:"\u5C55\u5F00",retract:"\u6536\u8D77",pleaseEnter:"\u8BF7\u8F93\u5165",pleaseSelect:"\u8BF7\u9009\u62E9",popoverAttrs:{showTxt:"\u66F4\u591A",title:"\u6240\u6709\u6761\u4EF6",allTxt:"\u5168\u9009",reverseTxt:"\u53CD\u9009",clearTxt:"\u6E05\u7A7A"}},select:{selectAllTxt:"\u5168\u9009"},selectIcon:{placeholder:"\u8BF7\u9009\u62E9\u56FE\u6807",dialogTitle:"\u8BF7\u9009\u62E9\u56FE\u6807",searchPlaceholder:"\u641C\u7D22\u56FE\u6807",emptyDescription:"\u672A\u641C\u7D22\u5230\u60A8\u8981\u627E\u7684\u56FE\u6807"},copy:{copySuccess:"\u590D\u5236\u6210\u529F",copyFail:"\u590D\u5236\u5931\u8D25",invalidCopyContent:"\u65E0\u6548\u7684\u590D\u5236\u5185\u5BB9"},selectTable:{searchBtnTxt:"\u5173\u95ED\u4E0B\u62C9\u6846",radioTxt:"\u5355\u9009",loadingTxt:"\u52A0\u8F7D\u4E2D..."},stepWizard:{lastBtnTitle:"\u5B8C\u6210"},table:{columnBind:{btnTxt:"\u5217\u8BBE\u7F6E",title:"\u5217\u8BBE\u7F6E"},fistColumn:{label:"\u5E8F\u53F7",radio:"\u5355\u9009"},operator:{label:"\u64CD\u4F5C",more:"\u66F4\u591A",sum:"\u5F53\u9875\u5408\u8BA1",total:"\u5408\u8BA1",allSum:"\u5168\u90E8\u5408\u8BA1"},singleEdit:{tipText:"\u5355\u51FB\u53EF\u7F16\u8F91"},pleaseEnter:"\u8BF7\u8F93\u5165",pleaseSelect:"\u8BF7\u9009\u62E9",loadingTxt:"\u52A0\u8F7D\u4E2D...",saveBtnTxt:"\u4FDD\u5B58",dragTxt:"\u62D6\u52A8",density:"\u5BC6\u5EA6",default:"\u9ED8\u8BA4",loose:"\u5BBD\u677E",compact:"\u7D27\u51D1"},list:{idleTimeoutMessage:"\u957F\u65F6\u95F4\u672A\u64CD\u4F5C\uFF0C\u5DF2\u9000\u51FA\u7CFB\u7EDF\u3002",sysMessage:"\u7CFB\u7EDF\u6D88\u606F"}}};return u}));
|
package/locale/zh-cn.min.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.38 */var u={name:"zh-cn",plus:{datepicker:{date:"\u8BF7\u9009\u62E9\u65E5\u671F",dates:"\u8BF7\u9009\u62E9\u65E5\u671F",week:"\u8BF7\u9009\u62E9\u5468",month:"\u8BF7\u9009\u62E9\u6708\u4EFD",months:"\u8BF7\u9009\u62E9\u6708\u4EFD",year:"\u8BF7\u9009\u62E9\u5E74\u4EFD",years:"\u8BF7\u9009\u62E9\u5E74\u4EFD",startDatePlaceholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",endDatePlaceholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",datetime:"\u8BF7\u9009\u62E9\u65E5\u671F\u65F6\u95F4",startMonthPlaceholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u6708\u4EFD",endMonthPlaceholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u6708\u4EFD",startTimePlaceholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",endTimePlaceholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",shortcutsDate:{today:"\u4ECA\u5929",yesterday:"\u6628\u5929",lastWeek:"\u4E00\u5468\u524D"},shortcutsDaterange:{pastWeek:"\u6700\u8FD1\u4E00\u5468",pastMonth:"\u6700\u8FD1\u4E00\u4E2A\u6708",pastThreeMonths:"\u6700\u8FD1\u4E09\u4E2A\u6708"},shortcutsMonthrange:{thisMonth:"\u672C\u6708",thisYear:"\u4ECA\u5E74\u81F3\u4ECA",pastSixMonths:"\u6700\u8FD1\u516D\u4E2A\u6708"},shortcutsDatetime:{today:"\u4ECA\u5929",yesterday:"\u6628\u5929",lastWeek:"\u4E00\u5468\u524D"},shortcutsDatetimerange:{pastWeek:"\u6700\u8FD1\u4E00\u5468",pastMonth:"\u6700\u8FD1\u4E00\u4E2A\u6708",pastThreeMonths:"\u6700\u8FD1\u4E09\u4E2A\u6708"}},form:{pleaseEnter:"\u8BF7\u8F93\u5165",pleaseSelect:"\u8BF7\u9009\u62E9"},input:{placeholder:"\u8BF7\u8F93\u5165",appendTitle:"\u5143",validatePhone:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",validateIdCard:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8EAB\u4EFD\u8BC1\u53F7\u7801",validateInteger:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u6574\u6570",format:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684",amount:"\u91D1\u989D",numbers:"\u6570\u5B57",digitUppercase:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u91D1\u989D\u683C\u5F0F",validateError:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u683C\u5F0F",escaped:{0:"\u89D2",1:"\u5206",2:"\u96F6",3:"\u58F9",4:"\u8D30",5:"\u53C1",6:"\u8086",7:"\u4F0D",8:"\u9646",9:"\u67D2",10:"\u634C",11:"\u7396",12:"\u5143",13:"\u4E07",14:"\u4EBF",15:"\u5146",16:"\u62FE",17:"\u4F70",18:"\u4EDF",19:"\u6B20",20:"\u6574"}},moduleForm:{save:"\u4FDD\u5B58",back:"\u8FD4\u56DE"},search:{searchText:"\u67E5\u8BE2",resetText:"\u91CD\u7F6E",expand:"\u5C55\u5F00",retract:"\u6536\u8D77",pleaseEnter:"\u8BF7\u8F93\u5165",pleaseSelect:"\u8BF7\u9009\u62E9",popoverAttrs:{showTxt:"\u66F4\u591A",title:"\u6240\u6709\u6761\u4EF6",allTxt:"\u5168\u9009",reverseTxt:"\u53CD\u9009",clearTxt:"\u6E05\u7A7A"}},select:{selectAllTxt:"\u5168\u9009"},selectIcon:{placeholder:"\u8BF7\u9009\u62E9\u56FE\u6807",dialogTitle:"\u8BF7\u9009\u62E9\u56FE\u6807",searchPlaceholder:"\u641C\u7D22\u56FE\u6807",emptyDescription:"\u672A\u641C\u7D22\u5230\u60A8\u8981\u627E\u7684\u56FE\u6807"},copy:{copySuccess:"\u590D\u5236\u6210\u529F",copyFail:"\u590D\u5236\u5931\u8D25",invalidCopyContent:"\u65E0\u6548\u7684\u590D\u5236\u5185\u5BB9"},selectTable:{searchBtnTxt:"\u5173\u95ED\u4E0B\u62C9\u6846",radioTxt:"\u5355\u9009",loadingTxt:"\u52A0\u8F7D\u4E2D..."},stepWizard:{lastBtnTitle:"\u5B8C\u6210"},table:{columnBind:{btnTxt:"\u5217\u8BBE\u7F6E",title:"\u5217\u8BBE\u7F6E"},fistColumn:{label:"\u5E8F\u53F7",radio:"\u5355\u9009"},operator:{label:"\u64CD\u4F5C",more:"\u66F4\u591A",sum:"\u5F53\u9875\u5408\u8BA1",total:"\u5408\u8BA1",allSum:"\u5168\u90E8\u5408\u8BA1"},singleEdit:{tipText:"\u5355\u51FB\u53EF\u7F16\u8F91"},pleaseEnter:"\u8BF7\u8F93\u5165",pleaseSelect:"\u8BF7\u9009\u62E9",loadingTxt:"\u52A0\u8F7D\u4E2D...",saveBtnTxt:"\u4FDD\u5B58",dragTxt:"\u62D6\u52A8",density:"\u5BC6\u5EA6",default:"\u9ED8\u8BA4",loose:"\u5BBD\u677E",compact:"\u7D27\u51D1"},list:{idleTimeoutMessage:"\u957F\u65F6\u95F4\u672A\u64CD\u4F5C\uFF0C\u5DF2\u9000\u51FA\u7CFB\u7EDF\u3002",sysMessage:"\u7CFB\u7EDF\u6D88\u606F"}}};export{u as default};
|
package/locale/zh-cn.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import pinia from '../stores/inpinia.mjs';
|
|
2
|
-
import { useUserInfo } from '../stores/userInfo.mjs';
|
|
3
|
-
import { useRequestOldRoutes } from '../stores/requestOldRoutes.mjs';
|
|
4
|
-
import { Session } from '../utils/storage.mjs';
|
|
5
|
-
import { NextLoading } from '../utils/loading.mjs';
|
|
6
|
-
import { useRoutesList } from '../stores/routesList.mjs';
|
|
7
|
-
import { useTagsViewRoutes } from '../stores/tagsViewRoutes.mjs';
|
|
8
|
-
import { dynamicRoutes, notFoundAndNoPower } from './route.mjs';
|
|
9
|
-
import { formatTwoStageRoutes, formatFlatteningRoutes } from './utils.mjs';
|
|
10
|
-
import { router } from './createRouter.mjs';
|
|
11
|
-
import '../api/index.mjs';
|
|
12
|
-
import { useSysApi } from '../api/sys/index.mjs';
|
|
13
|
-
|
|
14
|
-
const import_meta = {};
|
|
15
|
-
let dynamicViewsModules = {};
|
|
16
|
-
function setDynamicViewsModules(modules) {
|
|
17
|
-
dynamicViewsModules = modules;
|
|
18
|
-
}
|
|
19
|
-
function initDynamicViewsModules() {
|
|
20
|
-
try {
|
|
21
|
-
const layouModules = import_meta.glob("../layout/routerView/*.{vue,tsx}");
|
|
22
|
-
const viewsModules = import_meta.glob("../views/**/*.{vue,tsx}");
|
|
23
|
-
dynamicViewsModules = Object.assign({}, { ...layouModules }, { ...viewsModules });
|
|
24
|
-
} catch (error) {
|
|
25
|
-
dynamicViewsModules = {};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
initDynamicViewsModules();
|
|
29
|
-
async function initBackEndControlRoutes() {
|
|
30
|
-
if (window.nextLoading === void 0) NextLoading.start();
|
|
31
|
-
if (!Session.get("token")) return false;
|
|
32
|
-
await useUserInfo().setUserInfos();
|
|
33
|
-
await useUserInfo().setConstList();
|
|
34
|
-
await useUserInfo().setDictList();
|
|
35
|
-
const res = await getBackEndControlRoutes();
|
|
36
|
-
if (res == void 0 || res.length <= 0) return Promise.resolve(true);
|
|
37
|
-
useRequestOldRoutes().setRequestOldRoutes(res);
|
|
38
|
-
if (dynamicRoutes.length === 0) {
|
|
39
|
-
dynamicRoutes.push({
|
|
40
|
-
path: "/",
|
|
41
|
-
name: "Layout",
|
|
42
|
-
component: () => import('../components/fm-layout/src/index.vue.mjs'),
|
|
43
|
-
children: []
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
dynamicRoutes[0].children = await backEndComponent(res);
|
|
47
|
-
await setAddRoute();
|
|
48
|
-
setFilterMenuAndCacheTagsViewRoutes();
|
|
49
|
-
}
|
|
50
|
-
async function setFilterMenuAndCacheTagsViewRoutes() {
|
|
51
|
-
const storesRoutesList = useRoutesList(pinia);
|
|
52
|
-
storesRoutesList.setRoutesList(dynamicRoutes[0].children);
|
|
53
|
-
setCacheTagsViewRoutes();
|
|
54
|
-
}
|
|
55
|
-
function setCacheTagsViewRoutes() {
|
|
56
|
-
const storesTagsView = useTagsViewRoutes(pinia);
|
|
57
|
-
storesTagsView.setTagsViewRoutes(formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes))[0].children);
|
|
58
|
-
}
|
|
59
|
-
function setFilterRouteEnd() {
|
|
60
|
-
let filterRouteEnd = formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes));
|
|
61
|
-
filterRouteEnd[0].children = [...filterRouteEnd[0].children, ...notFoundAndNoPower];
|
|
62
|
-
return filterRouteEnd;
|
|
63
|
-
}
|
|
64
|
-
async function setAddRoute() {
|
|
65
|
-
await setFilterRouteEnd().forEach((route) => {
|
|
66
|
-
router.addRoute(route);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
async function getBackEndControlRoutes() {
|
|
70
|
-
var res = await useSysApi().getMenuTree();
|
|
71
|
-
let resData = res.data.result;
|
|
72
|
-
return resData;
|
|
73
|
-
}
|
|
74
|
-
async function setBackEndControlRefreshRoutes() {
|
|
75
|
-
await getBackEndControlRoutes();
|
|
76
|
-
}
|
|
77
|
-
function backEndComponent(routes) {
|
|
78
|
-
if (!routes) return [];
|
|
79
|
-
return routes.map((item) => {
|
|
80
|
-
if (!item.path) item.path = "";
|
|
81
|
-
if (item.component && typeof item.component === "string") {
|
|
82
|
-
item.component = dynamicImport(dynamicViewsModules, item.component);
|
|
83
|
-
if (!item.component) {
|
|
84
|
-
item.component = () => import('../components/fm-layout/src/index.vue.mjs');
|
|
85
|
-
console.warn(`Using default component for route: ${item.path}`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (item.children) {
|
|
89
|
-
item.children = backEndComponent(item.children);
|
|
90
|
-
}
|
|
91
|
-
return item;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function dynamicImport(dynamicViewsModules2, component) {
|
|
95
|
-
const keys = Object.keys(dynamicViewsModules2);
|
|
96
|
-
let matchKeys = [];
|
|
97
|
-
matchKeys = keys.filter((key) => key.includes(component));
|
|
98
|
-
if (matchKeys.length === 0) {
|
|
99
|
-
const REMOVE_PREFIXES = [
|
|
100
|
-
"../../../../packages/fmasyspage/views",
|
|
101
|
-
"../../../../packages/fmwlpage/views",
|
|
102
|
-
"../../../../packages/fmreliefpage/views",
|
|
103
|
-
"../views",
|
|
104
|
-
"./views",
|
|
105
|
-
"./layout/routerView",
|
|
106
|
-
"../layout/routerView",
|
|
107
|
-
".."
|
|
108
|
-
].map((p) => p.replace(/\./g, "\\.").replace(/\//g, "\\/")).join("|");
|
|
109
|
-
matchKeys = keys.filter((key) => {
|
|
110
|
-
const k = key.replace(new RegExp(`^(${REMOVE_PREFIXES})/?`), "/");
|
|
111
|
-
return k.startsWith(`${component}`) || k.startsWith(`/${component}`);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
if ((matchKeys == null ? void 0 : matchKeys.length) === 1) {
|
|
115
|
-
const matchKey = matchKeys[0];
|
|
116
|
-
return dynamicViewsModules2[matchKey];
|
|
117
|
-
}
|
|
118
|
-
if ((matchKeys == null ? void 0 : matchKeys.length) > 1) {
|
|
119
|
-
const exactMatch = matchKeys.find((key) => key.endsWith(`${component}.vue`) || key.endsWith(`${component}.tsx`));
|
|
120
|
-
if (exactMatch) {
|
|
121
|
-
return dynamicViewsModules2[exactMatch];
|
|
122
|
-
}
|
|
123
|
-
return dynamicViewsModules2[matchKeys[0]];
|
|
124
|
-
}
|
|
125
|
-
if (dynamicViewsModules2[component]) {
|
|
126
|
-
return dynamicViewsModules2[component];
|
|
127
|
-
}
|
|
128
|
-
if (component.startsWith("/")) {
|
|
129
|
-
const relativeComponent = component.substring(1);
|
|
130
|
-
if (dynamicViewsModules2[relativeComponent]) {
|
|
131
|
-
return dynamicViewsModules2[relativeComponent];
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
console.warn(`No component found for: ${component}`);
|
|
135
|
-
console.warn("Available modules:", Object.keys(dynamicViewsModules2));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export { backEndComponent, dynamicImport, getBackEndControlRoutes, initBackEndControlRoutes, setAddRoute, setBackEndControlRefreshRoutes, setCacheTagsViewRoutes, setDynamicViewsModules, setFilterMenuAndCacheTagsViewRoutes, setFilterRouteEnd };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
2
|
-
import { notFoundAndNoPower, staticRoutes } from './route.mjs';
|
|
3
|
-
|
|
4
|
-
const router = createRouter({
|
|
5
|
-
history: createWebHashHistory(),
|
|
6
|
-
/**
|
|
7
|
-
* 说明:
|
|
8
|
-
* 1、notFoundAndNoPower 默认添加 404、401 界面,防止一直提示 No match found for location with path 'xxx'
|
|
9
|
-
* 2、backEnd.ts(后端控制路由)、frontEnd.ts(前端控制路由) 中也需要加 notFoundAndNoPower 404、401 界面。
|
|
10
|
-
* 防止 404、401 不在 layout 布局中,不设置的话,404、401 界面将全屏显示
|
|
11
|
-
*/
|
|
12
|
-
routes: [...notFoundAndNoPower, ...staticRoutes]
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export { router };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { storeToRefs } from 'pinia';
|
|
2
|
-
import { formatTwoStageRoutes, formatFlatteningRoutes } from './utils.mjs';
|
|
3
|
-
import { dynamicRoutes, notFoundAndNoPower } from './route.mjs';
|
|
4
|
-
import pinia from '../stores/inpinia.mjs';
|
|
5
|
-
import { Session } from '../utils/storage.mjs';
|
|
6
|
-
import { useUserInfo } from '../stores/userInfo.mjs';
|
|
7
|
-
import { useTagsViewRoutes } from '../stores/tagsViewRoutes.mjs';
|
|
8
|
-
import { useRoutesList } from '../stores/routesList.mjs';
|
|
9
|
-
import { NextLoading } from '../utils/loading.mjs';
|
|
10
|
-
import { router } from './createRouter.mjs';
|
|
11
|
-
|
|
12
|
-
async function initFrontEndControlRoutes() {
|
|
13
|
-
if (window.nextLoading === void 0) NextLoading.start();
|
|
14
|
-
if (!Session.get("token")) return false;
|
|
15
|
-
await useUserInfo(pinia).setUserInfos();
|
|
16
|
-
await setAddRoute();
|
|
17
|
-
setFilterMenuAndCacheTagsViewRoutes();
|
|
18
|
-
}
|
|
19
|
-
async function setAddRoute() {
|
|
20
|
-
await setFilterRouteEnd().forEach((route) => {
|
|
21
|
-
router.addRoute(route);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
async function frontEndsResetRoute() {
|
|
25
|
-
await setFilterRouteEnd().forEach((route) => {
|
|
26
|
-
const routeName = route.name;
|
|
27
|
-
router.hasRoute(routeName) && router.removeRoute(routeName);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function setFilterRouteEnd() {
|
|
31
|
-
let filterRouteEnd = formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes));
|
|
32
|
-
filterRouteEnd[0].children = [...setFilterRoute(filterRouteEnd[0].children), ...notFoundAndNoPower];
|
|
33
|
-
return filterRouteEnd;
|
|
34
|
-
}
|
|
35
|
-
function setFilterRoute(chil) {
|
|
36
|
-
const stores = useUserInfo(pinia);
|
|
37
|
-
const { userInfos } = storeToRefs(stores);
|
|
38
|
-
let filterRoute = [];
|
|
39
|
-
chil.forEach((route) => {
|
|
40
|
-
if (route.meta.roles) {
|
|
41
|
-
route.meta.roles.forEach((metaRoles) => {
|
|
42
|
-
userInfos.value.roles.forEach((roles) => {
|
|
43
|
-
if (metaRoles === roles) filterRoute.push({ ...route });
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return filterRoute;
|
|
49
|
-
}
|
|
50
|
-
function setCacheTagsViewRoutes() {
|
|
51
|
-
const stores = useUserInfo(pinia);
|
|
52
|
-
const storesTagsView = useTagsViewRoutes(pinia);
|
|
53
|
-
const { userInfos } = storeToRefs(stores);
|
|
54
|
-
let rolesRoutes = setFilterHasRolesMenu(dynamicRoutes, userInfos.value.roles);
|
|
55
|
-
storesTagsView.setTagsViewRoutes(formatTwoStageRoutes(formatFlatteningRoutes(rolesRoutes))[0].children);
|
|
56
|
-
}
|
|
57
|
-
function setFilterMenuAndCacheTagsViewRoutes() {
|
|
58
|
-
const stores = useUserInfo(pinia);
|
|
59
|
-
const storesRoutesList = useRoutesList(pinia);
|
|
60
|
-
const { userInfos } = storeToRefs(stores);
|
|
61
|
-
storesRoutesList.setRoutesList(setFilterHasRolesMenu(dynamicRoutes[0].children, userInfos.value.roles));
|
|
62
|
-
setCacheTagsViewRoutes();
|
|
63
|
-
}
|
|
64
|
-
function hasRoles(roles, route) {
|
|
65
|
-
if (route.meta && route.meta.roles) return roles.some((role) => route.meta.roles.includes(role));
|
|
66
|
-
else return true;
|
|
67
|
-
}
|
|
68
|
-
function setFilterHasRolesMenu(routes, roles) {
|
|
69
|
-
const menu = [];
|
|
70
|
-
routes.forEach((route) => {
|
|
71
|
-
const item = { ...route };
|
|
72
|
-
if (hasRoles(roles, item)) {
|
|
73
|
-
if (item.children) item.children = setFilterHasRolesMenu(item.children, roles);
|
|
74
|
-
menu.push(item);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
return menu;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export { frontEndsResetRoute, hasRoles, initFrontEndControlRoutes, setAddRoute, setCacheTagsViewRoutes, setFilterHasRolesMenu, setFilterMenuAndCacheTagsViewRoutes, setFilterRoute, setFilterRouteEnd };
|