Commit 46b742d3 authored by baiyinhao's avatar baiyinhao

审计日志 假数据删除和批量删除功能

parent 8d477263
......@@ -17,6 +17,16 @@
// label: '编22222222222辑',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
// label: '删2222222222222222除',
color: 'error',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
......@@ -91,10 +101,12 @@
const filterStore = useFilterStore();
const route = useRoute();
const { createMessage } = useMessage();
const tableData = ref([]);
const tableDatatab2 = ref([]);
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerModal, { openModal }] = useModal();
const [registerModalEmail, { openModal: openModalEmail }] = useModal();
const [registerTable, { reload, getForm }] = useTable({
const [registerTable, { reload, getForm, getRowSelection }] = useTable({
title: '审计日志',
api: async (params) => {
console.log('params', params);
......@@ -129,7 +141,10 @@
fixed: undefined,
},
});
const [registerTable2, { reload: reload2, getForm: getForm2 }] = useTable({
const [
registerTable2,
{ reload: reload2, getForm: getForm2, getRowSelection: getRowSelection2 },
] = useTable({
title: '通知规则名称',
api: async (params) => {
console.log('params', params);
......@@ -208,18 +223,50 @@
});
}
/**删除按钮*/
async function handleDelete(record: Recordable) {
await deleteById(record.businessId);
/** 删除按钮*/
function handleDelete(record: Recordable) {
tableData.value.splice(
tableData.value.findIndex((item) => item.businessId === record.businessId),
1,
);
createMessage.success('删除成功!');
await reload();
reload();
}
/**tab2删除按钮*/
async function handleDeletetab2(record: Recordable) {
await deleteById(record.businessId);
function handleDeletetab2(record: Recordable) {
tableDatatab2.value.splice(
tableDatatab2.value.findIndex((item) => item.businessId === record.businessId),
1,
);
createMessage.success('删除成功!');
await reload2();
reload2();
}
/**批量删除*/
function handleDeleteBatch() {
const rowSelection = getRowSelection().selectedRowKeys;
for (let i = 0; i < rowSelection.length; i++) {
tableData.value.splice(
tableData.value.findIndex((item) => item.businessId === rowSelection[i]),
1,
);
}
createMessage.success('删除成功!');
reload();
}
/**批量删除tab2*/
function handleDeleteBatch2() {
const rowSelection = getRowSelection2().selectedRowKeys;
for (let i = 0; i < rowSelection.length; i++) {
tableDatatab2.value.splice(
tableDatatab2.value.findIndex((item) => item.businessId === rowSelection[i]),
1,
);
}
createMessage.success('删除成功!');
reload2();
}
function handleSuccess() {
......@@ -231,6 +278,7 @@
/**进入页面的初始化方法 getForm2是给tab2用的*/
onMounted(() => {
tableData.value = tableListtab1;
const path = route.path;
if (filterStore.getSearchParams[path]) {
if (JSON.parse(filterStore.getSearchParams[path] !== {})) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment