pull/1/head
LiuJiaNan 2024-01-22 16:18:39 +08:00
parent 6db2c2cb03
commit 1812d05ec3
3 changed files with 11 additions and 8 deletions

View File

@ -112,9 +112,11 @@ const fnSubmit = debounce(
1000, 1000,
() => { () => {
const selectionData = tableRef.value.getSelectionRows(); const selectionData = tableRef.value.getSelectionRows();
const listData = differenceWith(selectionData, props.listData, (a, b) => { const listData = differenceWith(
return a.RISKCHECKITEM_ID === b.RISKCHECKITEM_ID; selectionData,
}); props.listData,
(a, b) => a.RISKCHECKITEM_ID === b.RISKCHECKITEM_ID
);
fnClose(); fnClose();
emits("submit", listData); emits("submit", listData);
}, },

View File

@ -111,10 +111,9 @@ const { list, pagination, fnGetData, fnResetPagination, tableRef, searchForm } =
const fnInit = async () => { const fnInit = async () => {
await nextTick(); await nextTick();
props.userList.forEach((item) => { props.userList.forEach((item) => {
console.log(item.NAME);
tableRef.value.toggleRowSelection(item); tableRef.value.toggleRowSelection(item);
}); });
list.value.length === 0 && fnGetData(); fnGetData();
}; };
const fnClose = () => { const fnClose = () => {
tableRef.value.clearSelection(); tableRef.value.clearSelection();

View File

@ -197,9 +197,11 @@ const fnDeleteNewUser = (USER_ID, index) => {
); );
}; };
const fnUserDialogSubmit = (selectionData) => { const fnUserDialogSubmit = (selectionData) => {
data.newUserList = differenceWith(selectionData, data.oldUserList, (a, b) => { data.newUserList = differenceWith(
return a.USER_ID === b.USER_ID; selectionData,
}); data.oldUserList,
(a, b) => a.USER_ID === b.USER_ID
);
}; };
const fnSubmit = debounce( const fnSubmit = debounce(
1000, 1000,