cloud-web-corejs 1.0.54-dev.745 → 1.0.54-dev.746
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/package.json +192 -192
- package/src/App.vue +73 -71
- package/src/components/baseArea/index.vue +1628 -1628
- package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
- package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -297
- package/src/components/fileLibrary/index.vue +1109 -1109
- package/src/components/fileLibrary/propertiesDialog.vue +190 -190
- package/src/components/fileLibrary/recycleBinDialog.vue +237 -237
- package/src/components/wf/mixins/setCandidateDialog.js +217 -217
- package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
- package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +986 -986
- package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -272
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +216 -216
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +928 -928
- package/src/components/xform/form-designer/index.vue +195 -195
- package/src/components/xform/form-designer/indexMixin.js +848 -848
- package/src/components/xform/form-designer/setting-panel/index.vue +313 -313
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -124
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +369 -369
- package/src/components/xform/form-designer/widget-panel/index.vue +389 -389
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +343 -343
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4531 -4531
- package/src/components/xform/form-render/container-item/data-table-mixin.js +4748 -4576
- package/src/components/xform/form-render/container-item/tab-item.vue +125 -125
- package/src/components/xform/form-render/indexMixin.js +5061 -5078
- package/src/components/xform/lang/en-US.js +457 -457
- package/src/components/xform/lang/zh-CN.js +628 -628
- package/src/components/xform/utils/util.js +1585 -1554
- package/src/index.js +344 -230
- package/src/layout/components/AppMain.vue +122 -125
- package/src/layout/components/extractedCode/viewDialog.vue +207 -207
- package/src/layout/components/langTool.vue +128 -123
- package/src/layout/defaultLayout.vue +164 -158
- package/src/permission.js +185 -135
- package/src/store/config/index.js +667 -669
- package/src/store/modules/micro.js +46 -0
- package/src/store/modules/permission.js +461 -373
- package/src/store/modules/user.js +419 -415
- package/src/utils/auth.js +27 -1
- package/src/utils/index.js +579 -6
- package/src/utils/keepAlive.js +4 -0
- package/src/utils/menuAdapter.js +183 -0
- package/src/utils/request.js +417 -28
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +483 -483
- package/src/views/bd/setting/form_script/form_list.vue +174 -174
- package/src/views/bd/setting/form_script/mixins/form_list.js +330 -330
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -171
- package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -253
- package/src/views/user/menuFallback/index.vue +123 -0
- package/src/views/user/wf/wfReport/index.vue +625 -625
package/src/permission.js
CHANGED
|
@@ -1,135 +1,185 @@
|
|
|
1
|
-
/**version-1.0*/
|
|
2
|
-
import router from "@base/router";
|
|
3
|
-
import store from "./store";
|
|
4
|
-
import {
|
|
5
|
-
Message
|
|
6
|
-
} from "element-ui";
|
|
7
|
-
import NProgress from "nprogress"; // progress bar
|
|
8
|
-
import "nprogress/nprogress.css"; // progress bar style
|
|
9
|
-
import {
|
|
10
|
-
getToken
|
|
11
|
-
} from "./utils/auth"; // get token from cookie
|
|
12
|
-
import settingConfig from "@/settings";
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
saveAccessMenuLog
|
|
16
|
-
} from "./api/user";
|
|
17
|
-
import indexUtil from "./utils/index.js"
|
|
18
|
-
|
|
19
|
-
NProgress.configure({
|
|
20
|
-
showSpinner: false,
|
|
21
|
-
}); // NProgress Configuration
|
|
22
|
-
|
|
23
|
-
const whiteList = [
|
|
24
|
-
"/login",
|
|
25
|
-
"/auth-redirect",
|
|
26
|
-
"/report/vform/out_render",
|
|
27
|
-
"/report/xform/out_render",
|
|
28
|
-
]; // no redirect whitelist
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1
|
+
/**version-1.0*/
|
|
2
|
+
import router from "@base/router";
|
|
3
|
+
import store from "./store";
|
|
4
|
+
import {
|
|
5
|
+
Message
|
|
6
|
+
} from "element-ui";
|
|
7
|
+
import NProgress from "nprogress"; // progress bar
|
|
8
|
+
import "nprogress/nprogress.css"; // progress bar style
|
|
9
|
+
import {
|
|
10
|
+
getToken
|
|
11
|
+
} from "./utils/auth"; // get token from cookie
|
|
12
|
+
import settingConfig from "@/settings";
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
saveAccessMenuLog
|
|
16
|
+
} from "./api/user";
|
|
17
|
+
import indexUtil from "./utils/index.js"
|
|
18
|
+
|
|
19
|
+
NProgress.configure({
|
|
20
|
+
showSpinner: false,
|
|
21
|
+
}); // NProgress Configuration
|
|
22
|
+
|
|
23
|
+
const whiteList = [
|
|
24
|
+
"/login",
|
|
25
|
+
"/auth-redirect",
|
|
26
|
+
"/report/vform/out_render",
|
|
27
|
+
"/report/xform/out_render",
|
|
28
|
+
]; // no redirect whitelist
|
|
29
|
+
|
|
30
|
+
// ===== 临时打点:菜单切换 3s 卡顿定位(定位后移除,勿同步子工程)=====
|
|
31
|
+
let navPerf = { t0: 0, path: "" };
|
|
32
|
+
router.beforeEach((to, from, next) => {
|
|
33
|
+
navPerf.t0 = performance.now();
|
|
34
|
+
navPerf.path = to.fullPath;
|
|
35
|
+
next();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// qiankun 保活:子应用容器被隐藏期间暂停一切路由响应(配合包入口 update 生命周期)
|
|
39
|
+
router.beforeEach((to, from, next) => {
|
|
40
|
+
if (store.state.micro && store.state.micro.routerPaused) {
|
|
41
|
+
next(false);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
next();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
router.beforeEach((to, from, next) => {
|
|
48
|
+
// start progress bar
|
|
49
|
+
NProgress.start();
|
|
50
|
+
|
|
51
|
+
store.dispatch("user/initLoginConfig").then(() => {
|
|
52
|
+
const hasToken = getToken();
|
|
53
|
+
|
|
54
|
+
if (hasToken) {
|
|
55
|
+
if (to.path === "/login") {
|
|
56
|
+
// if is logged in, redirect to the home page
|
|
57
|
+
next({
|
|
58
|
+
path: "/",
|
|
59
|
+
});
|
|
60
|
+
NProgress.done(); // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939
|
|
61
|
+
} else {
|
|
62
|
+
// determine whether the user has obtained his permission roles through getInfo
|
|
63
|
+
const hasRoles
|
|
64
|
+
= store.getters.roles
|
|
65
|
+
&& store.getters.roles.length > 0;
|
|
66
|
+
if (to.meta.checkToken === false || hasRoles) {
|
|
67
|
+
next();
|
|
68
|
+
} else {
|
|
69
|
+
try {
|
|
70
|
+
store
|
|
71
|
+
.dispatch("user/getInfo2")
|
|
72
|
+
.then((res) => {
|
|
73
|
+
if (res && res.type == "success") {
|
|
74
|
+
// qiankun 子应用模式:菜单由主应用 props 下发,不自拉;
|
|
75
|
+
// 自治嵌入模式(selfManaged,主应用未下发菜单)仍走自拉全量菜单
|
|
76
|
+
let microState = store.state.micro || {};
|
|
77
|
+
let generateAction = microState.isMicro && !microState.selfManaged
|
|
78
|
+
? store.dispatch("permission/generateRoutesFromProps", microState.menus || [])
|
|
79
|
+
: store.dispatch("permission/generateRoutes2", res.objx);
|
|
80
|
+
generateAction
|
|
81
|
+
.then((accessRoutes) => {
|
|
82
|
+
// 根据roles权限生成可访问的路由表
|
|
83
|
+
// router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
|
84
|
+
next({
|
|
85
|
+
...to,
|
|
86
|
+
replace: true,
|
|
87
|
+
}); // hack方法 确保addRoutes已完成
|
|
88
|
+
});
|
|
89
|
+
} else {
|
|
90
|
+
store.dispatch("user/resetToken").then(() => {
|
|
91
|
+
next("/login");
|
|
92
|
+
NProgress.done();
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
.catch((error) => {
|
|
97
|
+
store.dispatch("user/resetToken").then(() => {
|
|
98
|
+
next("/login");
|
|
99
|
+
NProgress.done();
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
} catch (error) {
|
|
103
|
+
// remove token and go to login page to re-login
|
|
104
|
+
//await store.dispatch('user/resetToken')
|
|
105
|
+
Message.error(error || "Has Error");
|
|
106
|
+
next("/login");
|
|
107
|
+
NProgress.done();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
/* has no token*/
|
|
113
|
+
if (to.meta.checkToken === false) {
|
|
114
|
+
next();
|
|
115
|
+
} else if (whiteList.indexOf(to.path) !== -1) {
|
|
116
|
+
// in the free login whitelist, go directly
|
|
117
|
+
next();
|
|
118
|
+
} else {
|
|
119
|
+
// other pages that do not have permission to access are redirected to the login page.
|
|
120
|
+
next("/login");
|
|
121
|
+
NProgress.done();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
router.onError((error) => {
|
|
130
|
+
// finish progress bar
|
|
131
|
+
console.error(error);
|
|
132
|
+
NProgress.done();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// ===== 临时打点:守卫+组件解析耗时 / 渲染上屏耗时(定位后移除)=====
|
|
136
|
+
router.afterEach((to) => {
|
|
137
|
+
if (navPerf.path !== to.fullPath) return;
|
|
138
|
+
const tNav = performance.now();
|
|
139
|
+
requestAnimationFrame(() => {
|
|
140
|
+
requestAnimationFrame(() => {
|
|
141
|
+
const tPaint = performance.now();
|
|
142
|
+
console.log(
|
|
143
|
+
"[nav-perf] " + to.fullPath
|
|
144
|
+
+ " | 守卫+组件解析 " + (tNav - navPerf.t0).toFixed(0) + "ms"
|
|
145
|
+
+ " | 渲染上屏 " + (tPaint - tNav).toFixed(0) + "ms"
|
|
146
|
+
+ " | 总计 " + (tPaint - navPerf.t0).toFixed(0) + "ms"
|
|
147
|
+
);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
router.afterEach((to, from, next) => {
|
|
153
|
+
// qiankun 子应用模式:页签壳被隐藏,没有 TagsView 组件维护 cachedViews,这里补 addView,
|
|
154
|
+
// 否则 BaseKeepAlive 的 include 恒为空,子应用内部页面切换全部重建(切页签必刷新)。
|
|
155
|
+
// 自治嵌入模式壳可见,TagsView 自己维护,无需补
|
|
156
|
+
if (
|
|
157
|
+
store.state.micro
|
|
158
|
+
&& store.state.micro.isMicro
|
|
159
|
+
&& !store.state.micro.selfManaged
|
|
160
|
+
&& to.name
|
|
161
|
+
) {
|
|
162
|
+
store.dispatch("tagsView/addView", to);
|
|
163
|
+
}
|
|
164
|
+
if (settingConfig.i18nEnabled === true && to.path !== "/login" && to.meta.checkToken !== false) {
|
|
165
|
+
indexUtil.initI18nMessage("business");
|
|
166
|
+
}
|
|
167
|
+
if (settingConfig.accessLogEnabled === true && to.meta.title && to.name !== 'home') {
|
|
168
|
+
let visitedViews = store.getters.visitedViews;
|
|
169
|
+
let item = visitedViews.find(visitedView => visitedView.fullPath == to.fullPath)
|
|
170
|
+
if (!item) {
|
|
171
|
+
let treePathName = to.meta.treePathName || "";
|
|
172
|
+
let content = treePathName
|
|
173
|
+
? treePathName + to.meta.title + ","
|
|
174
|
+
: to.meta.title;
|
|
175
|
+
saveAccessMenuLog({
|
|
176
|
+
data: {
|
|
177
|
+
businessCode: content,
|
|
178
|
+
content: content,
|
|
179
|
+
path: to.path
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
NProgress.done();
|
|
185
|
+
});
|