feat(项目设置): 菜单管理误报规则去掉批量编辑

This commit is contained in:
RubyLiu 2023-10-20 14:12:45 +08:00 committed by 刘瑞斌
parent f39fc156c4
commit 32baa603f9
2 changed files with 14 additions and 10 deletions

View File

@ -43,8 +43,9 @@ export interface FakeTableListItem {
export interface FakeTableOperationParams {
projectId: string;
excludeIds?: string[]; // 排除的id
selectedIds?: string[]; // 选中的id
selectIds?: string[]; // 选中的id
selectAll: boolean; // 是否跨页全选
params?: TableQueryParams; // 查询参数
enable?: boolean; // 是否启用
condition?: TableQueryParams; // 条件
}

View File

@ -124,10 +124,6 @@
const tableBatchActions = {
baseAction: [
{
label: 'common.batchModify',
eventTag: 'batchModify',
},
{
label: 'common.enable',
eventTag: 'batchEnable',
@ -194,7 +190,7 @@
},
];
const { propsRes, propsEvent, loadList, setKeyword, setLoadListParams } = useTable(
const { propsRes, propsEvent, loadList, setKeyword, setLoadListParams, resetSelector } = useTable(
postFakeTableList,
{
scroll: { x: 1200 },
@ -218,6 +214,7 @@
const fetchData = async () => {
setKeyword(keyword.value);
await loadList();
resetSelector();
};
const handleDelete = (v: string | BatchActionQueryParams) => {
@ -228,11 +225,14 @@
try {
if (typeof v === 'string') {
//
await getDeleteFake({ selectedIds: [v], projectId: currentProjectId.value, selectAll: false });
await getDeleteFake({ selectIds: [v], projectId: currentProjectId.value, selectAll: false });
} else {
//
await getDeleteFake({
...v,
selectIds: v.selectedIds,
selectAll: v.selectAll,
excludeIds: v.excludeIds,
condition: v.params,
projectId: currentProjectId.value,
});
}
@ -275,7 +275,7 @@
if (typeof v === 'string') {
// /
await postUpdateEnableFake({
selectedIds: [v],
selectIds: [v],
projectId: currentProjectId.value,
enable: isEnable,
selectAll: false,
@ -283,7 +283,10 @@
} else {
// /
await postUpdateEnableFake({
...v,
selectIds: v.selectedIds,
selectAll: v.selectAll,
excludeIds: v.excludeIds,
condition: v.params,
projectId: currentProjectId.value,
enable: isEnable,
});