@skyfox2000/webui 1.4.11 → 1.4.13
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/lib/assets/modules/{baseLayout-DSVT_hCt.js → baseLayout-BtJNPMBy.js} +3 -3
- package/lib/assets/modules/{file-upload-T2kmeyGd.js → file-upload-CYNi1NsW.js} +1 -1
- package/lib/assets/modules/{index-C6BAsERS.js → index-BOOirPG2.js} +1 -1
- package/lib/assets/modules/{index-DkMjvF98.js → index-Cj6QnoC7.js} +2 -2
- package/lib/assets/modules/{index-Cwr2EDEI.js → index-DWnhNqJu.js} +2 -2
- package/lib/assets/modules/{menuTabs-D99nhxm_.js → menuTabs-DDGkYuvg.js} +2 -2
- package/lib/assets/modules/{toolIcon-DDp0EFRE.js → toolIcon-DXQt60Ya.js} +1 -1
- package/lib/assets/modules/{upload-template-BK8iQQYz.js → upload-template-CaeUt6VI.js} +657 -646
- package/lib/assets/modules/{uploadList-B8p45yS2.js → uploadList-D0jw6jNr.js} +4 -4
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +2 -2
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +5 -5
- package/lib/es/MenuLayout/index.js +2 -2
- package/lib/es/TemplateFile/index.js +4 -4
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/utils/micro-openapis.d.ts +1 -0
- package/lib/webui.es.js +373 -372
- package/package.json +1 -1
- package/src/components/content/table/index.vue +8 -0
- package/src/utils/micro-openapis.ts +23 -2
- package/src/utils/table.ts +0 -1
package/package.json
CHANGED
|
@@ -180,6 +180,14 @@ onMounted(async () => {
|
|
|
180
180
|
pagination.value.total = gridCtrl.total.value ?? 0;
|
|
181
181
|
}
|
|
182
182
|
} else if (gridCtrl.autoload !== false) {
|
|
183
|
+
if (gridCtrl.page) {
|
|
184
|
+
if (gridCtrl.gridUrl?.url === gridCtrl.page.urls.list) {
|
|
185
|
+
gridCtrl.remotePage = false;
|
|
186
|
+
}
|
|
187
|
+
if (gridCtrl.gridUrl?.url === gridCtrl.page.urls.find) {
|
|
188
|
+
gridCtrl.remotePage = true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
183
191
|
if (gridCtrl.remotePage) {
|
|
184
192
|
dataList.value = (await gridQueryFind(gridCtrl)).rows;
|
|
185
193
|
} else {
|
|
@@ -25,6 +25,7 @@ interface ApiResponseData {
|
|
|
25
25
|
class MicroAppSDK {
|
|
26
26
|
private static messageId = 0;
|
|
27
27
|
private static callbacks = new Map<number, { resolve: Function; reject: Function }>();
|
|
28
|
+
private static pendingRequests = new Map<string, Promise<any>>();
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* 检查是否在微前端环境中运行
|
|
@@ -46,6 +47,15 @@ class MicroAppSDK {
|
|
|
46
47
|
throw new Error(`未配置${method}接口!`);
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
// 生成请求标识符(方法名+参数JSON字符串)
|
|
51
|
+
const requestKey = `${method}_${JSON.stringify(params)}`;
|
|
52
|
+
|
|
53
|
+
// 检查是否已有相同请求正在进行
|
|
54
|
+
if (this.pendingRequests.has(requestKey)) {
|
|
55
|
+
// 返回正在进行的请求的Promise
|
|
56
|
+
return this.pendingRequests.get(requestKey);
|
|
57
|
+
}
|
|
58
|
+
|
|
49
59
|
// 生成唯一消息ID
|
|
50
60
|
const id = ++this.messageId;
|
|
51
61
|
|
|
@@ -57,11 +67,15 @@ class MicroAppSDK {
|
|
|
57
67
|
setTimeout(() => {
|
|
58
68
|
if (this.callbacks.has(id)) {
|
|
59
69
|
this.callbacks.delete(id);
|
|
70
|
+
this.pendingRequests.delete(requestKey);
|
|
60
71
|
reject(new Error(`API调用超时: ${method}`));
|
|
61
72
|
}
|
|
62
73
|
}, 10000); // 10秒超时
|
|
63
74
|
});
|
|
64
75
|
|
|
76
|
+
// 保存正在进行的请求
|
|
77
|
+
this.pendingRequests.set(requestKey, promise);
|
|
78
|
+
|
|
65
79
|
// 构造请求数据
|
|
66
80
|
const requestData: ApiRequestData = {
|
|
67
81
|
type: 'API_REQUEST',
|
|
@@ -74,7 +88,14 @@ class MicroAppSDK {
|
|
|
74
88
|
(window as any).microApp.dispatch(requestData);
|
|
75
89
|
|
|
76
90
|
// 等待结果
|
|
77
|
-
|
|
91
|
+
try {
|
|
92
|
+
const result = await promise;
|
|
93
|
+
this.pendingRequests.delete(requestKey);
|
|
94
|
+
return result;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
this.pendingRequests.delete(requestKey);
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
78
99
|
}
|
|
79
100
|
|
|
80
101
|
/**
|
|
@@ -165,4 +186,4 @@ export const MicroOpenApis = {
|
|
|
165
186
|
userLogout: MicroAppSDK.userLogout.bind(MicroAppSDK),
|
|
166
187
|
mainAppPush: MicroAppSDK.mainAppPush.bind(MicroAppSDK),
|
|
167
188
|
isInMicroApp: MicroAppSDK.isInMicroApp.bind(MicroAppSDK),
|
|
168
|
-
};
|
|
189
|
+
};
|
package/src/utils/table.ts
CHANGED
|
@@ -96,7 +96,6 @@ export const mergeColumns = (newColumns: TableColumn[], oldColumns?: TableColumn
|
|
|
96
96
|
* @returns
|
|
97
97
|
*/
|
|
98
98
|
export const gridQueryList = <T>(gridCtrl: GridControl<T>): Promise<T[]> => {
|
|
99
|
-
gridCtrl.remotePage = false;
|
|
100
99
|
return gridQueryFind(gridCtrl).then((result) => {
|
|
101
100
|
return result.rows as T[];
|
|
102
101
|
});
|