Compare commits
No commits in common. "88372b072f549e7082f8b6d7f32f004389654f3d" and "736d29b2f3c6e0a620fbee764f19698673c07794" have entirely different histories.
88372b072f
...
736d29b2f3
|
@ -293,7 +293,7 @@ class PickmCard extends Component {
|
|||
return;
|
||||
}
|
||||
for (let i = 0; i < rows.length; i++){
|
||||
rowids.push(rows[i].data.values.cpickm_bid.value);
|
||||
rowids.push(rows[0].data.values.cpickm_bid.value);
|
||||
}
|
||||
let data = {
|
||||
cpickmids: hids,
|
||||
|
|
|
@ -130,26 +130,13 @@ function processResultBatchByCard(props, moduleId, rows, indexs) {
|
|||
let updateArray = [];
|
||||
let allRows = props.editTable.getAllRows(moduleId);
|
||||
let i = allRows.length;
|
||||
// for (let j = 0; j < rows.length; j++) {
|
||||
// let row = rows[j];
|
||||
// let obj = {index: indexs[j], data: row};
|
||||
// if (indexs[j] < i) {
|
||||
// updateArray.push(obj);
|
||||
// } else {
|
||||
// insertArray.push(obj);
|
||||
// }
|
||||
// }
|
||||
// 提取所有现有行的rowid,用于快速判断
|
||||
const existingRowIds = allRows.map(row => row.rowid);
|
||||
|
||||
for (let j = 0; j < rows.length; j++) {
|
||||
let row = rows[j];
|
||||
let obj = {index: indexs[j], data: row};
|
||||
// 判断当前行的rowid是否已存在于allRows中
|
||||
if (existingRowIds.includes(row.rowid)) {
|
||||
updateArray.push(obj); // 存在则更新
|
||||
if (indexs[j] < i) {
|
||||
updateArray.push(obj);
|
||||
} else {
|
||||
insertArray.push(obj); // 不存在则插入
|
||||
insertArray.push(obj);
|
||||
}
|
||||
}
|
||||
if (updateArray.length > 0) {
|
||||
|
|
Loading…
Reference in New Issue