cloud-web-corejs 1.0.54-dev.672 → 1.0.54-dev.673
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
|
@@ -33,46 +33,32 @@ export function getDetailRowKey(row, index = 0) {
|
|
|
33
33
|
return row.zdEn || row.taZdMc || `idx_${row.orders ?? index}`;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export function
|
|
36
|
+
export function sortDetailRowsByZdEn(rows = []) {
|
|
37
37
|
return [...rows].sort((a, b) => {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
const aVal = String(a?.zdEn ?? "");
|
|
39
|
+
const bVal = String(b?.zdEn ?? "");
|
|
40
|
+
return aVal.localeCompare(bVal, "zh-CN", {
|
|
41
|
+
numeric: true,
|
|
42
|
+
sensitivity: "base",
|
|
43
|
+
});
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
export function
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
+
export function buildRowDiffMaps(preCellDiff = {}, curCellDiff = {}) {
|
|
48
|
+
const preRowDiff = {};
|
|
49
|
+
const curRowDiff = {};
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
Object.keys(preCellDiff).forEach((key) => {
|
|
52
|
+
const rowKey = key.split("__")[0];
|
|
53
|
+
preRowDiff[rowKey] = true;
|
|
50
54
|
});
|
|
51
|
-
curRows.forEach((row, index) => {
|
|
52
|
-
curMap.set(getDetailRowKey(row, index), row);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const rowDiffSet = new Set();
|
|
56
|
-
const allKeys = new Set([...preMap.keys(), ...curMap.keys()]);
|
|
57
|
-
|
|
58
|
-
allKeys.forEach((key) => {
|
|
59
|
-
const preRow = preMap.get(key);
|
|
60
|
-
const curRow = curMap.get(key);
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const hasDiff = DETAIL_COMPARE_FIELDS.some(
|
|
68
|
-
(field) => !isSameValue(preRow[field], curRow[field])
|
|
69
|
-
);
|
|
70
|
-
if (hasDiff) {
|
|
71
|
-
rowDiffSet.add(key);
|
|
72
|
-
}
|
|
56
|
+
Object.keys(curCellDiff).forEach((key) => {
|
|
57
|
+
const rowKey = key.split("__")[0];
|
|
58
|
+
curRowDiff[rowKey] = true;
|
|
73
59
|
});
|
|
74
60
|
|
|
75
|
-
return
|
|
61
|
+
return { preRowDiff, curRowDiff };
|
|
76
62
|
}
|
|
77
63
|
|
|
78
64
|
export function buildDetailDiffMaps(preRows = [], curRows = []) {
|
|
@@ -64,9 +64,9 @@ import compareMixin from "./compareMixin";
|
|
|
64
64
|
import compareBasicSection from "./compareBasicSection.vue";
|
|
65
65
|
import {
|
|
66
66
|
buildDetailDiffMaps,
|
|
67
|
-
|
|
67
|
+
buildRowDiffMaps,
|
|
68
68
|
getDetailRowKey,
|
|
69
|
-
|
|
69
|
+
sortDetailRowsByZdEn,
|
|
70
70
|
} from "./tableDetailDiff";
|
|
71
71
|
|
|
72
72
|
const zdTypeMap = {
|
|
@@ -109,7 +109,10 @@ export default {
|
|
|
109
109
|
preCellDiff: {},
|
|
110
110
|
curCellDiff: {},
|
|
111
111
|
},
|
|
112
|
-
|
|
112
|
+
detailRowDiff: {
|
|
113
|
+
pre: {},
|
|
114
|
+
cur: {},
|
|
115
|
+
},
|
|
113
116
|
};
|
|
114
117
|
},
|
|
115
118
|
computed: {
|
|
@@ -169,33 +172,38 @@ export default {
|
|
|
169
172
|
formatTreeFlag(cellValue) {
|
|
170
173
|
return this.$t1(treeFlagMap[cellValue] || cellValue || "");
|
|
171
174
|
},
|
|
172
|
-
getDetailColumns() {
|
|
175
|
+
getDetailColumns(side) {
|
|
176
|
+
const rowDiffMap = this.detailRowDiff[side] || {};
|
|
173
177
|
return [
|
|
174
178
|
{
|
|
175
|
-
title:
|
|
176
|
-
field: "
|
|
177
|
-
width:
|
|
179
|
+
title: "",
|
|
180
|
+
field: "_diffFlag",
|
|
181
|
+
width: 32,
|
|
178
182
|
fixed: "left",
|
|
183
|
+
align: "center",
|
|
179
184
|
slots: {
|
|
180
185
|
default: ({ row, rowIndex }) => {
|
|
181
|
-
const
|
|
186
|
+
const rowKey = getDetailRowKey(row, rowIndex);
|
|
187
|
+
if (!rowDiffMap[rowKey]) return [null];
|
|
182
188
|
return [
|
|
183
|
-
<
|
|
184
|
-
{
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
</el-tooltip>
|
|
192
|
-
) : null}
|
|
193
|
-
<span>{row.zdEn}</span>
|
|
194
|
-
</span>,
|
|
189
|
+
<el-tooltip
|
|
190
|
+
enterable={false}
|
|
191
|
+
effect="dark"
|
|
192
|
+
content={this.$t1("存在差异项")}
|
|
193
|
+
placement="top"
|
|
194
|
+
>
|
|
195
|
+
<i class="el-icon-warning compare-row-diff-icon" />
|
|
196
|
+
</el-tooltip>,
|
|
195
197
|
];
|
|
196
198
|
},
|
|
197
199
|
},
|
|
198
200
|
},
|
|
201
|
+
{
|
|
202
|
+
title: this.$t1("实体字段名称"),
|
|
203
|
+
field: "zdEn",
|
|
204
|
+
width: 150,
|
|
205
|
+
fixed: "left",
|
|
206
|
+
},
|
|
199
207
|
{
|
|
200
208
|
title: this.$t1("数据库表字段名"),
|
|
201
209
|
field: "taZdMc",
|
|
@@ -304,27 +312,33 @@ export default {
|
|
|
304
312
|
};
|
|
305
313
|
},
|
|
306
314
|
initDetailGrids() {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
this.detailDiff = buildDetailDiffMaps(
|
|
310
|
-
|
|
315
|
+
const rawPreRows = this.compareHData1?.szTaZdMbDTOs || [];
|
|
316
|
+
const rawCurRows = this.compareHData2?.szTaZdMbDTOs || [];
|
|
317
|
+
this.detailDiff = buildDetailDiffMaps(rawPreRows, rawCurRows);
|
|
318
|
+
const { preRowDiff, curRowDiff } = buildRowDiffMaps(
|
|
319
|
+
this.detailDiff.preCellDiff,
|
|
320
|
+
this.detailDiff.curCellDiff
|
|
321
|
+
);
|
|
322
|
+
this.detailRowDiff = { pre: preRowDiff, cur: curRowDiff };
|
|
323
|
+
this.preRows = sortDetailRowsByZdEn(rawPreRows);
|
|
324
|
+
this.curRows = sortDetailRowsByZdEn(rawCurRows);
|
|
311
325
|
|
|
312
|
-
const columns = this.getDetailColumns();
|
|
313
326
|
const baseConfig = {
|
|
314
327
|
border: true,
|
|
315
328
|
resizable: true,
|
|
316
329
|
showOverflow: true,
|
|
317
330
|
scrollX: { enabled: true },
|
|
318
|
-
columns,
|
|
319
331
|
...this.getGridSizeConfig(),
|
|
320
332
|
};
|
|
321
333
|
this.preGridOption = {
|
|
322
334
|
...baseConfig,
|
|
335
|
+
columns: this.getDetailColumns("pre"),
|
|
323
336
|
data: this.preRows,
|
|
324
337
|
cellClassName: (params) => this.getPreCellClassName(params),
|
|
325
338
|
};
|
|
326
339
|
this.curGridOption = {
|
|
327
340
|
...baseConfig,
|
|
341
|
+
columns: this.getDetailColumns("cur"),
|
|
328
342
|
data: this.curRows,
|
|
329
343
|
cellClassName: (params) => this.getCurCellClassName(params),
|
|
330
344
|
};
|
|
@@ -358,9 +372,6 @@ export default {
|
|
|
358
372
|
getCurCellClassName({ row, column, rowIndex }) {
|
|
359
373
|
return this.getDetailCellClassName("cur", row, column, rowIndex);
|
|
360
374
|
},
|
|
361
|
-
hasDetailRowDiff(row, rowIndex) {
|
|
362
|
-
return this.detailRowDiffSet.has(getDetailRowKey(row, rowIndex));
|
|
363
|
-
},
|
|
364
375
|
getDetailCellClassName(side, row, column, rowIndex) {
|
|
365
376
|
const field = column.field;
|
|
366
377
|
if (!field || !row) return "";
|
|
@@ -452,18 +463,10 @@ export default {
|
|
|
452
463
|
color: #67c23a;
|
|
453
464
|
}
|
|
454
465
|
|
|
455
|
-
::v-deep .
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
.compare-row-diff-icon {
|
|
461
|
-
flex-shrink: 0;
|
|
462
|
-
margin-right: 4px;
|
|
463
|
-
font-size: 14px;
|
|
464
|
-
color: #e6a23c;
|
|
465
|
-
cursor: default;
|
|
466
|
-
}
|
|
466
|
+
::v-deep .compare-row-diff-icon {
|
|
467
|
+
color: #e6a23c;
|
|
468
|
+
font-size: 14px;
|
|
469
|
+
cursor: default;
|
|
467
470
|
}
|
|
468
471
|
|
|
469
472
|
&.is-section-fullscreen {
|