From b63a19ec7bf5ae8f756b0bc9de7910b73a9c429d Mon Sep 17 00:00:00 2001 From: likunming Date: Thu, 24 Oct 2024 15:07:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AC=E5=9C=B0=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=88=A0=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/platform/components/grid/GridTop.vue | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/io.sc.platform.core.frontend/src/platform/components/grid/GridTop.vue b/io.sc.platform.core.frontend/src/platform/components/grid/GridTop.vue index 1937fe62..41ed7c39 100644 --- a/io.sc.platform.core.frontend/src/platform/components/grid/GridTop.vue +++ b/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] &&