From a2a3ff67091968eb03e08decb7e1ceb168e59a5b Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Mon, 13 Jan 2025 20:22:13 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/7631=E3=80=91JVxeTable=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84getValues=E5=9B=9E=E8=B0=83=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BF=AE=E6=AD=A3=20---=20=E3=80=90issues/76?= =?UTF-8?q?24=E3=80=91JVxeTable=20=E5=8D=95=E9=80=89=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=20---?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/JVxeTable/src/hooks/useMethods.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/hooks/useMethods.ts b/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/hooks/useMethods.ts index 62bd9061..279296bd 100644 --- a/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/hooks/useMethods.ts +++ b/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/hooks/useMethods.ts @@ -455,7 +455,9 @@ export function useMethods(props: JVxeTableProps, { emit }, data: JVxeDataProps, /** 获取表格表单里的值 */ function getValues(callback, rowIds) { let tableData = getTableData({ rowIds: rowIds }); - callback('', tableData); + // update-begin--author:liaozhiyang---date:20241227---for:【issues/7631】JVxeTable组件的getValues回调函数参数修正 + callback(tableData, tableData); + // update-end--author:liaozhiyang---date:20241227---for:【issues/7631】JVxeTable组件的getValues回调函数参数修正 } type getTableDataOptions = { @@ -638,7 +640,7 @@ export function useMethods(props: JVxeTableProps, { emit }, data: JVxeDataProps, async function clearSelection() { const xTable = getXTable(); let event = { $table: xTable, target: instanceRef.value }; - if (props.rowSelectionType === JVxeTypes.rowRadio) { + if (['radio', JVxeTypes.rowRadio].includes(props.rowSelectionType ?? '')) { await xTable.clearRadioRow(); handleVxeRadioChange(event); } else { @@ -653,7 +655,7 @@ export function useMethods(props: JVxeTableProps, { emit }, data: JVxeDataProps, */ function getSelectionData(isFull?: boolean) { const xTable = getXTable(); - if (props.rowSelectionType === JVxeTypes.rowRadio) { + if (['radio', JVxeTypes.rowRadio].includes(props.rowSelectionType ?? '')) { let row = xTable.getRadioRecord(isFull); if (isNull(row)) { return []; @@ -740,7 +742,7 @@ export function useMethods(props: JVxeTableProps, { emit }, data: JVxeDataProps, async function removeSelection() { let xTable = getXTable(); let res; - if (props.rowSelectionType === JVxeTypes.rowRadio) { + if (['radio', JVxeTypes.rowRadio].includes(props.rowSelectionType ?? '')) { res = await xTable.removeRadioRow(); } else { res = await xTable.removeCheckboxRow(); @@ -857,7 +859,7 @@ export function useMethods(props: JVxeTableProps, { emit }, data: JVxeDataProps, function getSelectedData(isFull?: boolean) { const xTable = getXTable(); let rows:any[] = [] - if (props.rowSelectionType === JVxeTypes.rowRadio) { + if (['radio', JVxeTypes.rowRadio].includes(props.rowSelectionType ?? '')) { let row = xTable.getRadioRecord(isFull); if (isNull(row)) { return [];