cloud-web-corejs 1.1.0-dev.47 → 1.1.0-dev.49
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 +1 -1
- package/src/components/onlineTalk/mixins.js +3 -2
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +2 -2
- package/src/components/xform/form-render/container-item/data-table-mixin.js +7 -6
- package/src/components/xform/utils/util.js +9 -0
- package/src/utils/request.js +14 -6
- package/src/views/user/home/default.vue +2 -0
- package/src/views/user/home/default2.vue +2 -0
- package/src/views/user/home/wjl/content.vue +5 -0
package/package.json
CHANGED
|
@@ -290,7 +290,7 @@ tmixins = {
|
|
|
290
290
|
method: `post`,
|
|
291
291
|
data: {operateTime: time},
|
|
292
292
|
modal: false,
|
|
293
|
-
...(silent ? { ignoreNetworkError: true } : {}),
|
|
293
|
+
...(silent ? { ignoreNetworkError: true, ignore502: true } : {}),
|
|
294
294
|
success: res => {
|
|
295
295
|
let records = res.objx || [];
|
|
296
296
|
records.forEach(record => {
|
|
@@ -394,7 +394,7 @@ tmixins = {
|
|
|
394
394
|
direction: direction
|
|
395
395
|
},
|
|
396
396
|
modal: false,
|
|
397
|
-
...(silent ? { ignoreNetworkError: true } : {}),
|
|
397
|
+
...(silent ? { ignoreNetworkError: true, ignore502: true } : {}),
|
|
398
398
|
success: res => {
|
|
399
399
|
let rows = res.objx || [];
|
|
400
400
|
if (rows.length) {
|
|
@@ -497,6 +497,7 @@ tmixins = {
|
|
|
497
497
|
data: {},
|
|
498
498
|
modal: false,
|
|
499
499
|
ignoreNetworkError: true,
|
|
500
|
+
ignore502: true,
|
|
500
501
|
success: res => {
|
|
501
502
|
this.isExitsRead = res.objx === 1;
|
|
502
503
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
runDataSourceRequest,
|
|
7
7
|
getReportGlobalMap,
|
|
8
8
|
getAccessUrl,
|
|
9
|
-
|
|
9
|
+
createXRowKey,
|
|
10
10
|
trim,
|
|
11
11
|
isArrayValueWidgetType,
|
|
12
12
|
isAttachmentWidgetType,
|
|
@@ -709,7 +709,7 @@ modules = {
|
|
|
709
709
|
if (this.tableParam && !this.designState) {
|
|
710
710
|
let row = this.tableParam.row;
|
|
711
711
|
if (!row._X_ROW_KEY) {
|
|
712
|
-
row._X_ROW_KEY =
|
|
712
|
+
row._X_ROW_KEY = createXRowKey();
|
|
713
713
|
}
|
|
714
714
|
let keyVal = row._X_ROW_KEY;
|
|
715
715
|
e && delete this.refList[e + "_" + keyVal];
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
assembleAxiosConfig,
|
|
14
14
|
getReportGlobalMap,
|
|
15
15
|
generateId,
|
|
16
|
+
createXRowKey,
|
|
16
17
|
deepClone,
|
|
17
18
|
loopHandleWidget,
|
|
18
19
|
columnFormatMap,
|
|
@@ -945,7 +946,7 @@ modules = {
|
|
|
945
946
|
rows = this.normalizeTableRows(rows, false);
|
|
946
947
|
// this.handleNullValue(rows);
|
|
947
948
|
rows.forEach((row) => {
|
|
948
|
-
row._X_ROW_KEY =
|
|
949
|
+
row._X_ROW_KEY = createXRowKey();
|
|
949
950
|
});
|
|
950
951
|
this.registerTreeKeys(rows);
|
|
951
952
|
this.formModel[this.fieldKeyName] = rows;
|
|
@@ -1045,7 +1046,7 @@ modules = {
|
|
|
1045
1046
|
}
|
|
1046
1047
|
});
|
|
1047
1048
|
if (!nextRow._X_ROW_KEY) {
|
|
1048
|
-
nextRow._X_ROW_KEY =
|
|
1049
|
+
nextRow._X_ROW_KEY = createXRowKey();
|
|
1049
1050
|
}
|
|
1050
1051
|
return nextRow;
|
|
1051
1052
|
});
|
|
@@ -1613,7 +1614,7 @@ modules = {
|
|
|
1613
1614
|
const rows = insertRows.map(() => {
|
|
1614
1615
|
const row = {
|
|
1615
1616
|
...this.createNewTableData(true),
|
|
1616
|
-
_X_ROW_KEY:
|
|
1617
|
+
_X_ROW_KEY: createXRowKey(),
|
|
1617
1618
|
};
|
|
1618
1619
|
if (treeContext) {
|
|
1619
1620
|
row[treeContext.identityConfig.physicalIdField] = null;
|
|
@@ -6898,7 +6899,7 @@ modules = {
|
|
|
6898
6899
|
let subFormModel = this.formModel[this.fieldKeyName];
|
|
6899
6900
|
if (!!subFormModel && subFormModel.length > 0) {
|
|
6900
6901
|
subFormModel.forEach((row) => {
|
|
6901
|
-
if (!row._X_ROW_KEY) row._X_ROW_KEY =
|
|
6902
|
+
if (!row._X_ROW_KEY) row._X_ROW_KEY = createXRowKey();
|
|
6902
6903
|
this.rowIdData.push(row._X_ROW_KEY);
|
|
6903
6904
|
});
|
|
6904
6905
|
|
|
@@ -7094,7 +7095,7 @@ modules = {
|
|
|
7094
7095
|
initExportRows(rows) {
|
|
7095
7096
|
if (!rows) return;
|
|
7096
7097
|
for (let row of rows) {
|
|
7097
|
-
if (!row._X_ROW_KEY) row._X_ROW_KEY =
|
|
7098
|
+
if (!row._X_ROW_KEY) row._X_ROW_KEY = createXRowKey();
|
|
7098
7099
|
row._X_EXPORT_ROW = true;
|
|
7099
7100
|
}
|
|
7100
7101
|
},
|
|
@@ -7104,7 +7105,7 @@ modules = {
|
|
|
7104
7105
|
//初始化fieldSchemaData!!!
|
|
7105
7106
|
let fieldSchemaMap = this.fieldSchemaMap;
|
|
7106
7107
|
for (let row of rows) {
|
|
7107
|
-
if (!row._X_ROW_KEY) row._X_ROW_KEY =
|
|
7108
|
+
if (!row._X_ROW_KEY) row._X_ROW_KEY = createXRowKey();
|
|
7108
7109
|
this.rowIdData.push(row._X_ROW_KEY);
|
|
7109
7110
|
let fieldSchemaMap2 = this.createRowFieldSchemaMap();
|
|
7110
7111
|
fieldSchemaMap[row._X_ROW_KEY] = fieldSchemaMap2;
|
|
@@ -181,6 +181,15 @@ export const generateId = function () {
|
|
|
181
181
|
);
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
+
// 表格 _X_ROW_KEY。不能用 generateId():取值大约只有 12 万种,千行以上几乎必撞,
|
|
185
|
+
// 树表新增时会报「_X_ROW_KEY 同时指向多个树节点」。
|
|
186
|
+
// 也不能用纯 row_ + 整数,那是 vxe uniqueId('row_') 的格式,插入新行时会撞上。
|
|
187
|
+
let xRowKeySeed = 0;
|
|
188
|
+
export function createXRowKey() {
|
|
189
|
+
xRowKeySeed += 1;
|
|
190
|
+
return `row_${Date.now().toString(36)}_${xRowKeySeed}`;
|
|
191
|
+
}
|
|
192
|
+
|
|
184
193
|
// 审计字段:创建/修改人及时间,camelCase 与 snake_case 两种形式;后端保存时重新生成
|
|
185
194
|
const AUDIT_FIELDS = [
|
|
186
195
|
"createBy",
|
package/src/utils/request.js
CHANGED
|
@@ -145,6 +145,10 @@ function isAxiosNetworkError(error) {
|
|
|
145
145
|
return error.code === "ERR_NETWORK" || /network error/i.test(message);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
function isGateway502(error) {
|
|
149
|
+
return !!(error && error.response && error.response.status === 502);
|
|
150
|
+
}
|
|
151
|
+
|
|
148
152
|
function shouldSwallowNetworkError(config, error) {
|
|
149
153
|
return !!(
|
|
150
154
|
config &&
|
|
@@ -153,6 +157,10 @@ function shouldSwallowNetworkError(config, error) {
|
|
|
153
157
|
);
|
|
154
158
|
}
|
|
155
159
|
|
|
160
|
+
function shouldSwallow502(config, error) {
|
|
161
|
+
return !!(config && config.ignore502 === true && isGateway502(error));
|
|
162
|
+
}
|
|
163
|
+
|
|
156
164
|
function getRequestErrorMessage(error) {
|
|
157
165
|
const config = (error && error.config) || {};
|
|
158
166
|
const response = error && error.response;
|
|
@@ -491,12 +499,12 @@ service.interceptors.response.use(
|
|
|
491
499
|
return Promise.reject(error);
|
|
492
500
|
}
|
|
493
501
|
let config = error.config;
|
|
494
|
-
//
|
|
495
|
-
|
|
496
|
-
|
|
502
|
+
// ignoreNetworkError 只吞 Network Error;ignore502 只吞 502。两者互不影响。
|
|
503
|
+
const swallowError =
|
|
504
|
+
shouldSwallowNetworkError(config, error) || shouldSwallow502(config, error);
|
|
497
505
|
if (handleRequestNetworkError()) {
|
|
498
506
|
if (config && config.modalStrictly !== true) removeModel(config);
|
|
499
|
-
return
|
|
507
|
+
return swallowError ? Promise.resolve() : Promise.reject(error);
|
|
500
508
|
}
|
|
501
509
|
if (
|
|
502
510
|
error.response &&
|
|
@@ -511,7 +519,7 @@ service.interceptors.response.use(
|
|
|
511
519
|
if (config.modalStrictly !== true) {
|
|
512
520
|
removeModel(config);
|
|
513
521
|
}
|
|
514
|
-
if (config.errorMsg !== false && !
|
|
522
|
+
if (config.errorMsg !== false && !swallowError) {
|
|
515
523
|
const requestError = getRequestErrorMessage(error);
|
|
516
524
|
ErroreBox.msg({
|
|
517
525
|
content: requestError.summary,
|
|
@@ -530,7 +538,7 @@ service.interceptors.response.use(
|
|
|
530
538
|
});
|
|
531
539
|
}
|
|
532
540
|
}
|
|
533
|
-
return
|
|
541
|
+
return swallowError ? Promise.resolve() : Promise.reject(error);
|
|
534
542
|
}
|
|
535
543
|
);
|
|
536
544
|
|
|
@@ -638,6 +638,7 @@ export default {
|
|
|
638
638
|
},
|
|
639
639
|
failMsg: false,
|
|
640
640
|
ignoreNetworkError: true,
|
|
641
|
+
ignore502: !isLoading,
|
|
641
642
|
fail: (res, response) => {
|
|
642
643
|
if (response && response.status == 200) {
|
|
643
644
|
this.$errorMsg(res);
|
|
@@ -661,6 +662,7 @@ export default {
|
|
|
661
662
|
},
|
|
662
663
|
failMsg: false,
|
|
663
664
|
ignoreNetworkError: true,
|
|
665
|
+
ignore502: !isLoading,
|
|
664
666
|
fail: (res, response) => {
|
|
665
667
|
if (response && response.status == 200) {
|
|
666
668
|
this.$errorMsg(res);
|
|
@@ -879,6 +879,7 @@ export default {
|
|
|
879
879
|
},
|
|
880
880
|
failMsg: false,
|
|
881
881
|
ignoreNetworkError: true,
|
|
882
|
+
ignore502: !isLoading,
|
|
882
883
|
fail: (res, response) => {
|
|
883
884
|
if (response && response.status === 200) {
|
|
884
885
|
this.$errorMsg(res);
|
|
@@ -902,6 +903,7 @@ export default {
|
|
|
902
903
|
},
|
|
903
904
|
failMsg: false,
|
|
904
905
|
ignoreNetworkError: true,
|
|
906
|
+
ignore502: !isLoading,
|
|
905
907
|
fail: (res, response) => {
|
|
906
908
|
if (response && response.status === 200) {
|
|
907
909
|
this.$errorMsg(res);
|
|
@@ -798,6 +798,7 @@ export default {
|
|
|
798
798
|
isLoading,
|
|
799
799
|
modal: isLoading || false,
|
|
800
800
|
ignoreNetworkError: opts.ignoreNetworkError,
|
|
801
|
+
ignore502: opts.ignore502,
|
|
801
802
|
success: opts.success,
|
|
802
803
|
failMsg: false,
|
|
803
804
|
errorMsg: false,
|
|
@@ -818,6 +819,7 @@ export default {
|
|
|
818
819
|
url: YX_PREFIX + "/bd_api/intf/getOrderCount",
|
|
819
820
|
isLoading,
|
|
820
821
|
ignoreNetworkError: !isLoading,
|
|
822
|
+
ignore502: !isLoading,
|
|
821
823
|
success: (res) => {
|
|
822
824
|
let objx = res.objx || {};
|
|
823
825
|
this.shortcutItems.forEach((item) => {
|
|
@@ -834,6 +836,7 @@ export default {
|
|
|
834
836
|
url: YX_PREFIX + "/bd_api/intf/getOrderMessage",
|
|
835
837
|
isLoading,
|
|
836
838
|
ignoreNetworkError: !isLoading,
|
|
839
|
+
ignore502: !isLoading,
|
|
837
840
|
success: (res) => {
|
|
838
841
|
let objx = res.objx;
|
|
839
842
|
this.pendingMessageRows = Array.isArray(objx)
|
|
@@ -1046,6 +1049,7 @@ export default {
|
|
|
1046
1049
|
isLoading: isLoading,
|
|
1047
1050
|
modal: isLoading || false,
|
|
1048
1051
|
ignoreNetworkError: !isLoading,
|
|
1052
|
+
ignore502: !isLoading,
|
|
1049
1053
|
// loadingTarget: document.body,
|
|
1050
1054
|
success: (res) => {
|
|
1051
1055
|
this.unDoWfRows =
|
|
@@ -1071,6 +1075,7 @@ export default {
|
|
|
1071
1075
|
isLoading: isLoading,
|
|
1072
1076
|
modal: isLoading || false,
|
|
1073
1077
|
ignoreNetworkError: !isLoading,
|
|
1078
|
+
ignore502: !isLoading,
|
|
1074
1079
|
// loadingTarget: document.body,
|
|
1075
1080
|
success: (res) => {
|
|
1076
1081
|
this.unreadMessageNum = res.objx || 0;
|