|
@@ -9,14 +9,17 @@
|
|
|
import StudentImport from './components/import1.vue';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import { reactive } from 'vue';
|
|
|
- import { getBaseNewStudentPage } from '/@/services/apis/BaseNewStudentController';
|
|
|
+ import {
|
|
|
+ deleteStudentBaseNewStudent,
|
|
|
+ getBaseNewStudentPage,
|
|
|
+ } from '/@/services/apis/BaseNewStudentController';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
const searchInfo = reactive<Recordable>({});
|
|
|
|
|
|
const [registerModal, { openModal }] = useModal();
|
|
|
|
|
|
- const { createMessage } = useMessage();
|
|
|
+ const { createConfirm, createMessage } = useMessage();
|
|
|
|
|
|
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
|
|
|
|
@@ -38,7 +41,7 @@
|
|
|
immediate: true,
|
|
|
canResize: true,
|
|
|
actionColumn: {
|
|
|
- width: 100,
|
|
|
+ width: 120,
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
slots: { customRender: 'action' },
|
|
@@ -97,6 +100,25 @@
|
|
|
}
|
|
|
openDivisionModal(true, { isUpdate: false, baseData: [...data] });
|
|
|
};
|
|
|
+
|
|
|
+ const handleDelete = (record: any) => {
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: '温馨提醒',
|
|
|
+ content: '是否删除该记录?',
|
|
|
+ onOk: async () => {
|
|
|
+ try {
|
|
|
+ await deleteStudentBaseNewStudent([record.id]);
|
|
|
+ createMessage.success('删除成功');
|
|
|
+ await reload();
|
|
|
+ } catch (e) {
|
|
|
+ createMessage.error('删除失败');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ okText: '确认',
|
|
|
+ cancelText: '取消',
|
|
|
+ });
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -117,6 +139,11 @@
|
|
|
label: '编辑',
|
|
|
onClick: handleEdit.bind(null, record, true),
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '删除',
|
|
|
+ color: 'error',
|
|
|
+ onClick: handleDelete.bind(null, record),
|
|
|
+ },
|
|
|
]"
|
|
|
/>
|
|
|
</div>
|