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/utils/keepAlive.js
CHANGED
|
@@ -166,11 +166,15 @@ export default {
|
|
|
166
166
|
const key = name
|
|
167
167
|
|
|
168
168
|
if (cache[key]) {
|
|
169
|
+
// 临时打点:菜单切换卡顿定位(定位后移除)
|
|
170
|
+
console.log("[nav-perf] keep-alive HIT: " + key)
|
|
169
171
|
vnode.componentInstance = cache[key].componentInstance
|
|
170
172
|
// make current key freshest
|
|
171
173
|
remove(keys, key)
|
|
172
174
|
keys.push(key)
|
|
173
175
|
} else {
|
|
176
|
+
// 临时打点:菜单切换卡顿定位(定位后移除)
|
|
177
|
+
console.log("[nav-perf] keep-alive MISS: " + key)
|
|
174
178
|
cache[key] = vnode
|
|
175
179
|
keys.push(key)
|
|
176
180
|
// prune oldest entry
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 微前端菜单适配层(零依赖纯函数)。
|
|
3
|
+
* 供引包应用与未引包主应用(deep-import 本文件)共用,
|
|
4
|
+
* 禁止在此引入 @base 的 store / router / request / 组件。
|
|
5
|
+
* 协议说明见 docs/qiankun微前端改造-实现方案.md 第三章。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// 表单菜单(动态表单)类型值,菜单归属识别的唯一权威标识
|
|
9
|
+
export const FORM_MENU_TYPE = 5;
|
|
10
|
+
|
|
11
|
+
// url 命名空间保留首段:/base/xxx 表示组件在 npm 包内(@base/views/xxx)
|
|
12
|
+
export const BASE_SEGMENT = "base";
|
|
13
|
+
|
|
14
|
+
const BASE_VIEW_PREFIX = "@base/views";
|
|
15
|
+
const APP_CODE_REG = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
16
|
+
|
|
17
|
+
export function isFormMenu(menu) {
|
|
18
|
+
return !!menu && menu.type === FORM_MENU_TYPE;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 访问路径 = route || url(与 createRoute3 现有取值逻辑一致)
|
|
23
|
+
*/
|
|
24
|
+
export function getAccessPath(menu) {
|
|
25
|
+
if (!menu) return "";
|
|
26
|
+
return String(menu.route || menu.url || "");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 取路径首段(不含查询串);@ 开头的存量组件路径无首段语义,返回 ""
|
|
31
|
+
*/
|
|
32
|
+
export function getFirstSegment(path) {
|
|
33
|
+
if (!path || typeof path !== "string" || path.startsWith("@")) {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
return path.split("?")[0].split("/").filter(Boolean)[0] || "";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 解析菜单归属:访问路径首段命中注册表 appCode 则归属该子应用,
|
|
41
|
+
* 否则(空 / base / 未命中)归主应用,返回 ""。
|
|
42
|
+
*/
|
|
43
|
+
export function resolveOwner(menu, registry) {
|
|
44
|
+
const seg = getFirstSegment(getAccessPath(menu));
|
|
45
|
+
if (!seg || seg === BASE_SEGMENT) return "";
|
|
46
|
+
const apps = normalizeRegistry(registry);
|
|
47
|
+
return apps.some((app) => app.appCode === seg) ? seg : "";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 解析组件路径(type 0 普通菜单):
|
|
52
|
+
* - "@..." 存量旧写法:url 即组件路径,原样返回;
|
|
53
|
+
* - 首段 base:转 @base/views 命名空间;
|
|
54
|
+
* - 首段等于渲染方 appCode:剥掉首段(渲染方只渲染归属自己的菜单);
|
|
55
|
+
* - 其余原样(无前缀走渲染方 @/views;别家前缀加载失败落兜底组件)。
|
|
56
|
+
*/
|
|
57
|
+
export function resolveComponentPath(menu, rendererAppCode) {
|
|
58
|
+
const url = menu && menu.url != null ? String(menu.url) : "";
|
|
59
|
+
if (!url) return "";
|
|
60
|
+
if (url.startsWith("@")) return url;
|
|
61
|
+
const seg = getFirstSegment(url);
|
|
62
|
+
if (!seg) return url;
|
|
63
|
+
if (seg === BASE_SEGMENT) {
|
|
64
|
+
const rest = stripFirstSegment(url);
|
|
65
|
+
return rest ? BASE_VIEW_PREFIX + rest : "";
|
|
66
|
+
}
|
|
67
|
+
if (rendererAppCode && seg === rendererAppCode) {
|
|
68
|
+
const rest = stripFirstSegment(url);
|
|
69
|
+
if (!rest) return "";
|
|
70
|
+
// 单字段写法 /appA/base/xx:剥掉归属前缀后可能仍带 base 命名空间,递归解析一次
|
|
71
|
+
// (appCode 传空,只剥一层归属前缀,不会把 /appA/appA/xx 连剥两层)
|
|
72
|
+
return resolveComponentPath({ url: rest }, "");
|
|
73
|
+
}
|
|
74
|
+
return url;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function stripFirstSegment(url) {
|
|
78
|
+
const clean = url.startsWith("/") ? url : "/" + url;
|
|
79
|
+
const idx = clean.indexOf("/", 1);
|
|
80
|
+
return idx > 0 ? clean.slice(idx) : "";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 全量菜单按归属切分:主应用保留完整树(侧边栏整树展示),
|
|
85
|
+
* 各子应用得到归属自己的菜单行的扁平列表(用于 props 下发生成子应用内部路由)。
|
|
86
|
+
*/
|
|
87
|
+
export function dispatchMenus(menus, registry) {
|
|
88
|
+
const apps = normalizeRegistry(registry);
|
|
89
|
+
const subAppMenus = {};
|
|
90
|
+
apps.forEach((app) => {
|
|
91
|
+
subAppMenus[app.appCode] = [];
|
|
92
|
+
});
|
|
93
|
+
const walk = (rows) => {
|
|
94
|
+
(rows || []).forEach((row) => {
|
|
95
|
+
const owner = resolveOwner(row, apps);
|
|
96
|
+
if (owner) {
|
|
97
|
+
subAppMenus[owner].push(row);
|
|
98
|
+
}
|
|
99
|
+
if (row && row.children && row.children.length) {
|
|
100
|
+
walk(row.children);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
walk(menus || []);
|
|
105
|
+
return { mainMenus: menus || [], subAppMenus };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 校验应用注册表(逻辑参数 micro_app_registry 的 paramValue)。
|
|
110
|
+
* 非法条目跳过并记入 errors,绝不静默;enabled === false 的合法条目不收录也不报错。
|
|
111
|
+
* options.reservedSegments 传各应用 @/views 一级目录名,防 appCode 撞名。
|
|
112
|
+
*/
|
|
113
|
+
export function validateRegistry(raw, options = {}) {
|
|
114
|
+
const errors = [];
|
|
115
|
+
let list = raw;
|
|
116
|
+
if (typeof raw === "string") {
|
|
117
|
+
try {
|
|
118
|
+
list = JSON.parse(raw);
|
|
119
|
+
} catch (e) {
|
|
120
|
+
return { apps: [], errors: ["注册表 JSON 解析失败: " + e.message] };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (!Array.isArray(list)) {
|
|
124
|
+
return { apps: [], errors: ["注册表必须是 JSON 数组"] };
|
|
125
|
+
}
|
|
126
|
+
const reserved = [BASE_SEGMENT].concat(options.reservedSegments || []);
|
|
127
|
+
const apps = [];
|
|
128
|
+
const seen = {};
|
|
129
|
+
list.forEach((item, index) => {
|
|
130
|
+
const tag = "注册表第" + (index + 1) + "项";
|
|
131
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) {
|
|
132
|
+
errors.push(tag + "不是对象");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const appCode = item.appCode;
|
|
136
|
+
if (!appCode || typeof appCode !== "string" || !APP_CODE_REG.test(appCode)) {
|
|
137
|
+
errors.push(tag + " appCode 缺失或格式非法: " + JSON.stringify(appCode));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (reserved.indexOf(appCode) >= 0) {
|
|
141
|
+
errors.push(tag + " appCode 与保留字/视图目录撞名: " + appCode);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (seen[appCode]) {
|
|
145
|
+
errors.push(tag + " appCode 重复: " + appCode);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (item.entry == null || (typeof item.entry !== "string" && typeof item.entry !== "object")) {
|
|
149
|
+
errors.push(tag + "(" + appCode + ")entry 缺失或格式非法");
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
seen[appCode] = true;
|
|
153
|
+
if (item.enabled === false) return;
|
|
154
|
+
apps.push({
|
|
155
|
+
appCode: appCode,
|
|
156
|
+
appName: item.appName || appCode,
|
|
157
|
+
entry: item.entry,
|
|
158
|
+
hasCorejs: !!item.hasCorejs,
|
|
159
|
+
enabled: true,
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
return { apps, errors };
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* 取分环境 entry:entry 为字符串直接用;为对象按 env 取,缺省回落 production。
|
|
167
|
+
*/
|
|
168
|
+
export function resolveEntry(entry, env) {
|
|
169
|
+
if (!entry) return "";
|
|
170
|
+
if (typeof entry === "string") return entry;
|
|
171
|
+
return entry[env] || entry.production || "";
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function normalizeRegistry(registry) {
|
|
175
|
+
if (!registry) return [];
|
|
176
|
+
const list = Array.isArray(registry) ? registry : registry.apps || [];
|
|
177
|
+
return list.filter((app) => {
|
|
178
|
+
return app
|
|
179
|
+
&& typeof app.appCode === "string"
|
|
180
|
+
&& app.appCode
|
|
181
|
+
&& app.enabled !== false;
|
|
182
|
+
});
|
|
183
|
+
}
|