Browse Source

表格优化提交

main
likunming 1 year ago
parent
commit
3f49c5b0b1
  1. 2
      io.sc.platform.core.frontend/package.json
  2. 17
      io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.131", "version": "8.1.132",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件", "//main": "库的主文件",
"main": "dist/platform-core.js", "main": "dist/platform-core.js",

17
io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue

@ -1518,15 +1518,22 @@ const setLocalData = (rows: any) => {
state.pagination.rowsNumber = table.rows.length; state.pagination.rowsNumber = table.rows.length;
stickyHeaderColumn(); stickyHeaderColumn();
}; };
//
const replaceRow = (row) => { const replaceRowHandler = (arr, row) => {
for (let i = 0; i < table.rows.length; i++) { for (let i = 0; i < arr.length; i++) {
if (row[rowKey_] === table.rows[i][rowKey_]) { if (row[rowKey_] === arr[i][rowKey_]) {
table.rows[i] = { ...table.rows[i], ...row }; arr[i] = { ...arr[i], ...row };
break; break;
} else if (props.tree && arr[i].children && arr[i].children.length > 0) {
replaceRowHandler(arr[i].children, row);
} }
} }
}; };
//
const replaceRow = (row) => {
replaceRowHandler(table.rows, row);
};
// //
const removeRows = (rows) => { const removeRows = (rows) => {
rows.forEach((item) => { rows.forEach((item) => {

Loading…
Cancel
Save