cloud-web-corejs 1.1.0-dev.47 → 1.1.0-dev.48
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
CHANGED
|
@@ -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",
|