Browse Source

修复本地模式删除的问题

main
likunming 4 months ago
parent
commit
b63a19ec7b
  1. 27
      io.sc.platform.core.frontend/src/platform/components/grid/GridTop.vue

27
io.sc.platform.core.frontend/src/platform/components/grid/GridTop.vue

@ -172,11 +172,11 @@ const remove = () => {
const selectedRows = props.grid.getSelectedRows();
if (tickedRows?.length > 0) {
tickedRows.forEach((item) => {
ids.push(item[props.grid.props.primaryKey]);
ids.push(props.grid.props.localMode ? item['_rowKey_'] : item[props.grid.props.primaryKey]);
});
} else if (selectedRows?.length > 0) {
selectedRows.forEach((item) => {
ids.push(item[props.grid.props.primaryKey]);
ids.push(props.grid.props.localMode ? item['_rowKey_'] : item[props.grid.props.primaryKey]);
});
}
let flag = true;
@ -212,8 +212,7 @@ const remove = () => {
}
})
.catch((error) => {
console.error(error);
console.info('==========error==========', error);
console.error('[w-grid]Remove error:', error);
});
}
}
@ -259,7 +258,7 @@ const resetDefaultValues = () => {
props.grid.refresh();
})
.catch((error) => {
console.error(error);
console.error('[w-grid]ResetDefaultValues error:', error);
});
};
@ -374,13 +373,13 @@ const buttonObj = reactive({
},
click: () => {
if (props.grid.props.selectMode !== selectMode.cell) {
console.warn(`Select mode is not 'cell', Cannot use cell editing function`);
console.warn('[w-grid]`selectMode` property is not `cell`, Cannot use cell editing function.');
return false;
} else if (Object.keys(table.cellSelected).length === 0 || !table.cellSelected['colName']) {
NotifyManager.info('请选择要编辑的单元格');
return false;
} else if (table.columns.findIndex((item) => item['name'] === table.cellSelected['colName'] && item['type']) < 0) {
console.warn(`The column selected is not configured with a component type for editing.`);
console.warn('[w-grid]The column selected is not configured with a component type for editing.');
return false;
}
table.bodyEditStatus = editStatus.cell;
@ -399,13 +398,13 @@ const buttonObj = reactive({
},
click: () => {
if (props.grid.props.selectMode !== selectMode.cell) {
console.warn(`Select mode is not 'cell', Cannot use cell editing function`);
console.warn('[w-grid]`selectMode` property is not `cell`, Cannot use cell editing function.');
return false;
} else if (Object.keys(table.cellSelected).length === 0 || !table.cellSelected['colName']) {
NotifyManager.info('请选择要编辑的单元格');
return false;
} else if (table.columns.findIndex((item) => item['name'] === table.cellSelected['colName'] && item['type']) < 0) {
console.warn(`The column selected is not configured with a component type for editing.`);
console.warn('[w-grid]The column selected is not configured with a component type for editing.');
return false;
}
//
@ -425,7 +424,7 @@ const buttonObj = reactive({
},
click: () => {
if (table.columns.findIndex((item) => item['type']) < 0) {
console.warn(`Not configured with a component type for editing.`);
console.warn('[w-grid]Not configured with a component type for editing.');
return false;
}
table.bodyEditStatus = editStatus.row;
@ -438,7 +437,7 @@ const buttonObj = reactive({
label: t('action.edit'),
click: () => {
if (table.columns.findIndex((item) => item['type']) < 0) {
console.warn(`Not configured with a component type for editing.`);
console.warn('[w-grid]Not configured with a component type for editing.');
return false;
}
table.bodyEditStatus = editStatus.rows;
@ -623,7 +622,7 @@ const handleChildrenBtn = (arr, moreQueryShow) => {
for (let i = 0; i < arr.length; i++) {
const btn = arr[i];
if (typeof btn === 'string' && !buttonObj[btn]) {
throw new Error(`'` + btn + `'` + ' toolbar action NOT exist');
throw new Error('[w-grid]`' + btn + '`' + ' toolbar action NOT exist.');
} else if (Array.isArray(btn) && btn.length > 0) {
const handleResult = handleChildrenBtn(btn, moreQueryShow);
if (handleResult && handleResult.length > 0) {
@ -670,7 +669,7 @@ const handleToolbarActions = () => {
}
props.grid.props.toolbarActions.forEach((btn: any, index) => {
if (typeof btn === 'string' && !buttonObj[btn]) {
throw new Error(`'` + btn + `'` + ' toolbar action NOT exist');
throw new Error('[w-grid]`' + btn + '`' + ' toolbar action NOT exist.');
} else if (typeof btn === 'string' && buttonObj[btn]) {
if (btn === buttonObj.query.name && moreQueryShow) {
buttons_.value.push([buttonObj[btn], buttonObj[buttonObj.moreQuery.name]]);
@ -716,7 +715,7 @@ const dbClickOperation = (row) => {
row['expand'] = Tools.isEmpty(row['expand']) ? true : !row['expand'];
} else {
if (!buttonObj[props.grid.props.dbClickOperation] && checkConfigNotContains(buttons_.value)) {
throw new Error(`'` + props.grid.props.dbClickOperation + `'` + ' toolbar action NOT exist');
throw new Error('[w-grid]`' + props.grid.props.dbClickOperation + '`' + ' toolbar action NOT exist.');
} else if (
props.grid.props.dbClickOperation !== buttonObj.separator &&
buttonObj[props.grid.props.dbClickOperation] &&

Loading…
Cancel
Save