From 219444d566232738c8d19b4878c1c026462c2e0a Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 21 Mar 2023 18:09:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BatchDropdown/index.vue | 106 ++++ src/components/BatchDropdown/types.d.ts | 16 + src/components/PermissionButton/index.vue | 3 +- src/views/device/Instance/index.vue | 160 +++++- src/views/iot-card/CardManagement/Export.vue | 4 +- src/views/iot-card/CardManagement/index.vue | 505 +++++++++++++------ 6 files changed, 626 insertions(+), 168 deletions(-) create mode 100644 src/components/BatchDropdown/index.vue create mode 100644 src/components/BatchDropdown/types.d.ts diff --git a/src/components/BatchDropdown/index.vue b/src/components/BatchDropdown/index.vue new file mode 100644 index 00000000..90368bbf --- /dev/null +++ b/src/components/BatchDropdown/index.vue @@ -0,0 +1,106 @@ + + + + + \ No newline at end of file diff --git a/src/components/BatchDropdown/types.d.ts b/src/components/BatchDropdown/types.d.ts new file mode 100644 index 00000000..37f04f23 --- /dev/null +++ b/src/components/BatchDropdown/types.d.ts @@ -0,0 +1,16 @@ +import type { ButtonProps } from "ant-design-vue/es/button"; +import type { PopconfirmProps } from "ant-design-vue/es/popconfirm"; + +export interface BatchActionsType extends ButtonProps { + key: string; + text?: string; + permission?: string; + onClick?: (data: any) => void; + style?: CSSProperties; + popConfirm?: PopconfirmProps; + icon?: string; + selected?: {// 需要选择表格数据,后触发的事件 + popConfirm?: PopconfirmProps; + onClick?: (data: any) => void + } +} \ No newline at end of file diff --git a/src/components/PermissionButton/index.vue b/src/components/PermissionButton/index.vue index 44733152..96af0ee9 100644 --- a/src/components/PermissionButton/index.vue +++ b/src/components/PermissionButton/index.vue @@ -55,6 +55,7 @@ import { CSSProperties, PropType } from 'vue' import { TooltipProps, PopconfirmProps } from 'ant-design-vue/es' import { buttonProps } from 'ant-design-vue/es/button/button' import { usePermissionStore } from '@/store/permission'; +import { omit } from 'lodash-es'; // interface PermissionButtonEmits { // (e: 'click', data: MouseEvent): void; @@ -88,7 +89,7 @@ const props = defineProps({ style: { type: Object as PropType }, - ...buttonProps() + ...omit(buttonProps(), 'icon') }) // const { tooltip, popConfirm, hasPermission, noButton, ..._buttonProps } = props; diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index 48205595..30270b39 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -10,10 +10,14 @@ :columns="columns" :request="query" :defaultParams="{ sorts: [{ name: 'createTime', order: 'desc' }] }" - :rowSelection="{ - selectedRowKeys: _selectedRowKeys, - onChange: onSelectChange, - }" + :rowSelection=" + isCheck + ? { + selectedRowKeys: _selectedRowKeys, + onChange: onSelectChange, + } + : false + " :params="params" >