From 5965737384b17b9c56e4fb8d1f1202f701f39884 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 25 Apr 2024 14:17:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BD=91=E5=85=83=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E5=8C=85=E5=8B=BE=E9=80=89=E5=88=A0=E9=99=A4=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ne/neSoftware/index.vue | 33 ++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/views/ne/neSoftware/index.vue b/src/views/ne/neSoftware/index.vue index 3da17a5e..841fba1f 100644 --- a/src/views/ne/neSoftware/index.vue +++ b/src/views/ne/neSoftware/index.vue @@ -63,6 +63,8 @@ type TabeStateType = { seached: boolean; /**记录数据 */ data: object[]; + /**勾选记录 */ + selectedRowKeys: (string | number)[]; }; /**表格状态 */ @@ -71,6 +73,7 @@ let tableState: TabeStateType = reactive({ size: 'middle', seached: false, data: [], + selectedRowKeys: [], }); /**表格字段列 */ @@ -162,6 +165,11 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } +/**表格多选 */ +function fnTableSelectedRowKeys(keys: (string | number)[]) { + tableState.selectedRowKeys = keys; +} + /**查询列表, pageNum初始页数 */ function fnGetList(pageNum?: number) { if (tableState.loading) return; @@ -242,9 +250,16 @@ function fnModalEditCancel() { /**删除软件包 */ function fnRecordDelete(id: string) { + if (!id || modalState.confirmLoading) return; + let msg = 'Removing software packages?'; + if (id === '0') { + msg = `${msg} select ${tableState.selectedRowKeys.length}`; + id = tableState.selectedRowKeys.join(','); + } + Modal.confirm({ title: t('common.tipTitle'), - content: 'Removing software packages?', + content: msg, onOk() { if (modalState.confirmLoading) return; modalState.confirmLoading = true; @@ -408,6 +423,16 @@ onMounted(() => { More File Upload + + + {{ t('common.deleteText') }} + @@ -467,6 +492,12 @@ onMounted(() => { :pagination="tablePagination" :scroll="{ x: tableColumns.length * 150 }" @resizeColumn="(w:number, col:any) => (col.width = w)" + :row-selection="{ + type: 'checkbox', + columnWidth: '48px', + selectedRowKeys: tableState.selectedRowKeys, + onChange: fnTableSelectedRowKeys, + }" >