🐛 Fixing a bug. 表格全选后取消全显数据没有清空

This commit is contained in:
lbw 2023-04-27 21:17:20 +08:00
parent 0e695c6199
commit 475b075d23
37 changed files with 104 additions and 106 deletions

View File

@ -57,10 +57,10 @@
"sass": "^1.58.3",
"typescript": "^4.9.5",
"unplugin-auto-import": "^0.13.0",
"vite": "^4.1.4",
"vite": "^4.3.3",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-top-level-await": "^1.2.4",
"vite-plugin-top-level-await": "^1.3.0",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-eslint-parser": "^9.1.0"
},

View File

@ -112,8 +112,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -130,8 +130,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -50,7 +50,7 @@
<el-button icon="delete" text type="primary" v-auth="'sys_file_del'" @click="handleDelete([scope.row.id])">{{
$t('common.delBtn')
}}</el-button>
<el-button icon="download" type="primary" text @click="download(scope.row, scope.index)">{{ $t('common.download') }}</el-button>
<el-button icon="download" type="primary" text @click="download(scope.row)">{{ $t('common.download') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -102,8 +102,8 @@ const download = (row: any) => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -142,8 +142,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -128,8 +128,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -167,8 +167,8 @@ const handleRefreshCache = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.publicId));
const handleSelectionChange = (objs: { publicId: string }[]) => {
selectObjs.value = objs.map(({ publicId }) => publicId);
multiple.value = !objs.length;
};

View File

@ -118,8 +118,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.postId));
const handleSelectionChange = (objs: { postId: string }[]) => {
selectObjs.value = objs.map(({ postId }) => postId);
multiple.value = !objs.length;
};

View File

@ -168,8 +168,8 @@ const handleSelectable = (row: any) => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.roleId));
const handleSelectionChange = (objs: { roleId: string }[]) => {
selectObjs.value = objs.map(({ roleId }) => roleId);
multiple.value = !objs.length;
};

View File

@ -123,8 +123,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -166,8 +166,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -93,8 +93,8 @@ const resetQuery = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.accessToken));
const handleSelectionChange = (objs: { accessToken: string }[]) => {
selectObjs.value = objs.map(({ accessToken }) => accessToken);
multiple.value = !objs.length;
};

View File

@ -200,8 +200,8 @@ const handleSelectable = (row: any) => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.userId));
const handleSelectionChange = (objs: { userId: string }[]) => {
selectObjs.value = objs.map(({ userId }) => userId);
multiple.value = !objs.length;
};

View File

@ -104,8 +104,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
const { getDataList, tableStyle } = useTable(state);
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -137,8 +137,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.roleId));
const handleSelectionChange = (objs: { roleId: string }[]) => {
selectObjs.value = objs.map(({ roleId }) => roleId);
multiple.value = !objs.length;
};

View File

@ -138,8 +138,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -143,8 +143,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.userId));
const handleSelectionChange = (objs: { userId: string }[]) => {
selectObjs.value = objs.map(({ userId }) => userId);
multiple.value = !objs.length;
};

View File

@ -173,7 +173,7 @@ const resetQuery = () => {
};
/** 行选中事件 */
const handleSelectionChange = (rows) => {
const handleSelectionChange = (rows: any) => {
selectedRows.value = rows;
multiple.value = !rows.length;
};

View File

@ -94,8 +94,8 @@ const openDialog = (id: string) => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.jobLogId));
const handleSelectionChange = (objs: { jobLogId: string }[]) => {
selectObjs.value = objs.map(({ jobLogId }) => jobLogId);
multiple.value = !objs.length;
};

View File

@ -104,8 +104,8 @@ const resetQuery = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -102,8 +102,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -119,8 +119,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -118,8 +118,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -130,8 +130,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -176,10 +176,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -156,11 +156,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -19,9 +19,20 @@
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'mp_wxaccount_add'" class="ml10" formDialogRef icon="folder-add" type="primary" @click="formDialogRef.openDialog()">
<el-button v-auth="'mp_wxaccount_add'" class="ml10" icon="folder-add" type="primary" @click="formDialogRef.openDialog()">
{{ $t('common.addBtn') }}
</el-button>
<el-button
plain
v-auth="'mp_wxaccount_add'"
class="ml10"
icon="Delete"
type="primary"
:disabled="multiple"
@click="handleDelete(selectObjs)"
>
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
:export="'app_social_details_del'"
@exportExcel="exportExcel"
@ -67,31 +78,25 @@
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
><el-button icon="edit-pen" v-auth="'mp_wxaccount_edit'" text type="primary" @click="formDialogRef.openDialog(scope.row.id)">{{
$t('common.editBtn')
}}</el-button></el-dropdown-item
>
<el-dropdown-item>
<el-button icon="delete" v-auth="'mp_wxaccount_del'" text type="primary" @click="handleDelete([scope.row.id])">{{
$t('common.delBtn')
}}</el-button></el-dropdown-item
>
<el-button icon="edit-pen" v-auth="'mp_wxaccount_edit'" text type="primary" @click="formDialogRef.openDialog(scope.row.id)"
>{{ $t('common.editBtn') }}
</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button icon="DArrowRight" v-auth="'mp_wxaccount_del'" text type="primary" @click="access(scope.row)"
>接入</el-button
></el-dropdown-item
>
<el-dropdown-item
><el-button icon="Grid" v-auth="'mp_wxaccount_del'" text type="primary" @click="generate(scope.row)"
>二维码</el-button
></el-dropdown-item
>
<el-dropdown-item
><el-button icon="refresh" v-auth="'mp_wxaccount_del'" text type="primary" @click="quota(scope.row)"
>quota</el-button
></el-dropdown-item
>
<el-button icon="delete" v-auth="'mp_wxaccount_del'" text type="primary" @click="handleDelete([scope.row.id])"
>{{ $t('common.delBtn') }}
</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button icon="DArrowRight" v-auth="'mp_wxaccount_del'" text type="primary" @click="access(scope.row)">接入 </el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button icon="Grid" v-auth="'mp_wxaccount_del'" text type="primary" @click="generate(scope.row)">二维码 </el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button icon="refresh" v-auth="'mp_wxaccount_del'" text type="primary" @click="quota(scope.row)">quota </el-button>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@ -121,7 +126,7 @@ import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import commonFunction from '/@/utils/commonFunction';
import other from '/@/utils/other';
const { proxy } = getCurrentInstance();
const { copyText } = commonFunction();
//
const ImageUpload = defineAsyncComponent(() => import('/@/components/Upload/Image.vue'));
@ -161,10 +166,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -132,8 +132,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.leaveId));
const handleSelectionChange = (objs: { leaveId: string }[]) => {
selectObjs.value = objs.map(({ leaveId }) => leaveId);
multiple.value = !objs.length;
};

View File

@ -102,8 +102,8 @@ const resetQuery = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -114,8 +114,8 @@ const resetQuery = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.processonDefinitionId));
const handleSelectionChange = (objs: { processonDefinitionId: string }[]) => {
selectObjs.value = objs.map(({ processonDefinitionId }) => processonDefinitionId);
multiple.value = !objs.length;
};

View File

@ -54,8 +54,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
const { getDataList, sortChangeHandle } = useTable(state);
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -127,8 +127,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.taskId));
const handleSelectionChange = (objs: { taskId: string }[]) => {
selectObjs.value = objs.map(({ taskId }) => taskId);
multiple.value = !objs.length;
};

View File

@ -137,8 +137,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -138,8 +138,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.goodsOrderId));
const handleSelectionChange = (objs: { goodsOrderId: string }[]) => {
selectObjs.value = objs.map(({ goodsOrderId }) => goodsOrderId);
multiple.value = !objs.length;
};

View File

@ -109,8 +109,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.id));
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};

View File

@ -115,8 +115,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.refundOrderId));
const handleSelectionChange = (objs: { refundOrderId: string }[]) => {
selectObjs.value = objs.map(({ refundOrderId }) => refundOrderId);
multiple.value = !objs.length;
};

View File

@ -163,8 +163,8 @@ const exportExcel = () => {
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value.push(...objs.map((val: any) => val.orderId));
const handleSelectionChange = (objs: { orderId: string }[]) => {
selectObjs.value = objs.map(({ orderId }) => orderId);
multiple.value = !objs.length;
};