cloud-web-corejs 1.0.54-dev.745 → 1.0.54-dev.747

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.
Files changed (52) hide show
  1. package/package.json +194 -192
  2. package/src/App.vue +73 -71
  3. package/src/components/baseArea/index.vue +1628 -1628
  4. package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
  5. package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -297
  6. package/src/components/fileLibrary/index.vue +1109 -1109
  7. package/src/components/fileLibrary/propertiesDialog.vue +190 -190
  8. package/src/components/fileLibrary/recycleBinDialog.vue +237 -237
  9. package/src/components/wf/mixins/setCandidateDialog.js +217 -217
  10. package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
  11. 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
  12. package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -272
  13. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +216 -216
  14. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +928 -928
  15. package/src/components/xform/form-designer/index.vue +195 -195
  16. package/src/components/xform/form-designer/indexMixin.js +848 -848
  17. package/src/components/xform/form-designer/setting-panel/index.vue +313 -313
  18. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -124
  19. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +369 -369
  20. package/src/components/xform/form-designer/widget-panel/index.vue +389 -389
  21. package/src/components/xform/form-designer/widget-panel/indexMixin.js +343 -343
  22. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4531 -4531
  23. package/src/components/xform/form-render/container-item/data-table-mixin.js +4748 -4576
  24. package/src/components/xform/form-render/container-item/tab-item.vue +125 -125
  25. package/src/components/xform/form-render/indexMixin.js +5061 -5078
  26. package/src/components/xform/lang/en-US.js +457 -457
  27. package/src/components/xform/lang/zh-CN.js +628 -628
  28. package/src/components/xform/utils/util.js +1585 -1554
  29. package/src/index.js +347 -230
  30. package/src/layout/components/AppMain.vue +122 -125
  31. package/src/layout/components/extractedCode/viewDialog.vue +207 -207
  32. package/src/layout/components/langTool.vue +128 -123
  33. package/src/layout/defaultLayout.vue +164 -158
  34. package/src/microRouter/index.js +389 -0
  35. package/src/permission.js +185 -135
  36. package/src/public-path.js +8 -0
  37. package/src/store/config/index.js +667 -669
  38. package/src/store/modules/micro.js +46 -0
  39. package/src/store/modules/permission.js +468 -373
  40. package/src/store/modules/user.js +419 -415
  41. package/src/utils/auth.js +27 -1
  42. package/src/utils/index.js +579 -6
  43. package/src/utils/keepAlive.js +4 -0
  44. package/src/utils/menuAdapter.js +183 -0
  45. package/src/utils/request.js +417 -28
  46. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +483 -483
  47. package/src/views/bd/setting/form_script/form_list.vue +174 -174
  48. package/src/views/bd/setting/form_script/mixins/form_list.js +330 -330
  49. package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -171
  50. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -253
  51. package/src/views/user/menuFallback/index.vue +123 -0
  52. 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
- router.beforeEach((to, from, next) => {
31
- // start progress bar
32
- NProgress.start();
33
-
34
- store.dispatch("user/initLoginConfig").then(() => {
35
- const hasToken = getToken();
36
-
37
- if (hasToken) {
38
- if (to.path === "/login") {
39
- // if is logged in, redirect to the home page
40
- next({
41
- path: "/",
42
- });
43
- NProgress.done(); // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939
44
- } else {
45
- // determine whether the user has obtained his permission roles through getInfo
46
- const hasRoles =
47
- store.getters.roles &&
48
- store.getters.roles.length > 0;
49
- if (to.meta.checkToken === false || hasRoles) {
50
- next();
51
- } else {
52
- try {
53
- store
54
- .dispatch("user/getInfo2")
55
- .then((res) => {
56
- if (res && res.type == "success") {
57
- store
58
- .dispatch("permission/generateRoutes2", res.objx)
59
- .then((accessRoutes) => {
60
- // 根据roles权限生成可访问的路由表
61
- // router.addRoutes(accessRoutes); // 动态添加可访问路由表
62
- next({
63
- ...to,
64
- replace: true,
65
- }); // hack方法 确保addRoutes已完成
66
- });
67
- } else {
68
- store.dispatch("user/resetToken").then(() => {
69
- next("/login");
70
- NProgress.done();
71
- });
72
- }
73
- })
74
- .catch((error) => {
75
- store.dispatch("user/resetToken").then(() => {
76
- next("/login");
77
- NProgress.done();
78
- });
79
- });
80
- } catch (error) {
81
- // remove token and go to login page to re-login
82
- //await store.dispatch('user/resetToken')
83
- Message.error(error || "Has Error");
84
- next("/login");
85
- NProgress.done();
86
- }
87
- }
88
- }
89
- } else {
90
- /* has no token*/
91
- if (to.meta.checkToken === false) {
92
- next();
93
- } else if (whiteList.indexOf(to.path) !== -1) {
94
- // in the free login whitelist, go directly
95
- next();
96
- } else {
97
- // other pages that do not have permission to access are redirected to the login page.
98
- next("/login");
99
- NProgress.done();
100
- }
101
- }
102
- })
103
-
104
-
105
- });
106
-
107
- router.onError((error) => {
108
- // finish progress bar
109
- console.error(error);
110
- NProgress.done();
111
- });
112
-
113
- router.afterEach((to, from, next) => {
114
- if (settingConfig.i18nEnabled === true && to.path !== "/login" && to.meta.checkToken !== false) {
115
- indexUtil.initI18nMessage("business");
116
- }
117
- if (settingConfig.accessLogEnabled === true && to.meta.title && to.name !== 'home') {
118
- let visitedViews = store.getters.visitedViews;
119
- let item = visitedViews.find(visitedView => visitedView.fullPath == to.fullPath)
120
- if (!item) {
121
- let treePathName = to.meta.treePathName || "";
122
- let content = treePathName ?
123
- treePathName + to.meta.title + "," :
124
- to.meta.title;
125
- saveAccessMenuLog({
126
- data: {
127
- businessCode: content,
128
- content: content,
129
- path: to.path
130
- },
131
- });
132
- }
133
- }
134
- NProgress.done();
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
+ });
@@ -0,0 +1,8 @@
1
+ /* eslint-disable camelcase, no-undef */
2
+ /**
3
+ * qiankun 子应用模式下修正 webpack 运行时 publicPath,
4
+ * 必须在入口文件的第一行 import,早于其余任何模块。
5
+ */
6
+ if (window.__POWERED_BY_QIANKUN__) {
7
+ __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
8
+ }