فهرست منبع

feat:修改菜单

DESKTOP-USV654P\pc 6 ماه پیش
والد
کامیت
f6d47a9a39

+ 4 - 1
src/services/apis/DatadetailController.ts

@@ -11,7 +11,10 @@ import { ErrorMessageMode } from '/#/axios';
             ;
 
 
-            /** 学生健康统计 GET /datadetail/datadetail/health-statistics */
+            /** 课表详情数据统计 GET /datadetail/datadetail/course-statistics */
+export async function getDatadetailCourseStatistics(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.CourseStatisticsDetailVo>
+        ({url: '/datadetail/datadetail/course-statistics', params:params},{errorMessageMode:mode});}
+/** 学生健康统计 GET /datadetail/datadetail/health-statistics */
 export async function getDatadetailHealthStatistics(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.HealthStatisticsDetailVo>
         ({url: '/datadetail/datadetail/health-statistics', params:params},{errorMessageMode:mode});}
 /** 教职工详情数据统计 GET /datadetail/datadetail/person-statistics */

+ 31 - 0
src/services/apis/StudentConsumeDateController.ts

@@ -0,0 +1,31 @@
+// @ts-ignore
+/* eslint-disable */
+
+// 该文件自动生成,请勿手动修改!
+import { defHttp } from '/@/utils/http/axios';
+import { ErrorMessageMode } from '/#/axios';
+            // --------------------------------------------------------------------------
+            // Student Consume Date Controller
+            // --------------------------------------------------------------------------
+
+            ;
+
+
+            /** 新增学生消费数据 POST /student/studentConsumeDate */
+export async function postStudentStudentConsumeDate(params:API.AddStudentConsumeDateDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.post<any>
+        ({url: '/student/studentConsumeDate', data:params},{errorMessageMode:mode});}
+/** 修改学生消费数据 PUT /student/studentConsumeDate */
+export async function putStudentStudentConsumeDate(params:API.UpdateStudentConsumeDateDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.put<any>
+        ({url: '/student/studentConsumeDate', data:params},{errorMessageMode:mode});}
+/** 删除学生消费数据 DELETE /student/studentConsumeDate */
+export async function deleteStudentStudentConsumeDate(params:string[],mode: ErrorMessageMode = 'modal'){ return defHttp.delete<any>
+        ({url: '/student/studentConsumeDate', data:params},{errorMessageMode:mode});}
+/** 根据id查询学生消费数据信息 GET /student/studentConsumeDate/info */
+export async function getStudentConsumeDateInfo(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.StudentConsumeDateVo>
+        ({url: '/student/studentConsumeDate/info', params:params},{errorMessageMode:mode});}
+/** 学生消费数据列表(分页) GET /student/studentConsumeDate/page */
+export async function getStudentConsumeDatePage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.StudentConsumeDatePageVo>>
+        ({url: '/student/studentConsumeDate/page', params:params},{errorMessageMode:mode});}
+            

+ 40 - 0
src/services/apis/StudentReportRecordController.ts

@@ -0,0 +1,40 @@
+// @ts-ignore
+/* eslint-disable */
+
+// 该文件自动生成,请勿手动修改!
+import { defHttp } from '/@/utils/http/axios';
+import { ErrorMessageMode } from '/#/axios';
+            // --------------------------------------------------------------------------
+            // Student Report Record Controller
+            // --------------------------------------------------------------------------
+
+            ;
+
+
+            /** 新增学生报到记录表 POST /student/studentReportRecord */
+export async function postStudentStudentReportRecord(params:API.AddStudentReportRecordDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.post<any>
+        ({url: '/student/studentReportRecord', data:params},{errorMessageMode:mode});}
+/** 修改学生报到记录表 PUT /student/studentReportRecord */
+export async function putStudentStudentReportRecord(params:API.UpdateStudentReportRecordDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.put<any>
+        ({url: '/student/studentReportRecord', data:params},{errorMessageMode:mode});}
+/** 删除学生报到记录表 DELETE /student/studentReportRecord */
+export async function deleteStudentStudentReportRecord(params:string[],mode: ErrorMessageMode = 'modal'){ return defHttp.delete<any>
+        ({url: '/student/studentReportRecord', data:params},{errorMessageMode:mode});}
+/** 班级统计 GET /student/studentReportRecord/class-statistics */
+export async function getStudentReportRecordClassStatistics(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.StudentReportRecordStatisticsVo>
+        ({url: '/student/studentReportRecord/class-statistics', params:params},{errorMessageMode:mode});}
+/** 根据id查询学生报到记录表信息 GET /student/studentReportRecord/info */
+export async function getStudentReportRecordInfo(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.StudentReportRecordVo>
+        ({url: '/student/studentReportRecord/info', params:params},{errorMessageMode:mode});}
+/** 班主任查询(分页) GET /student/studentReportRecord/mobile-page */
+export async function getStudentReportRecordMobilePage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.StudentReportRecordPageVo>>
+        ({url: '/student/studentReportRecord/mobile-page', params:params},{errorMessageMode:mode});}
+/** 学生报到记录表列表(分页) GET /student/studentReportRecord/page */
+export async function getStudentReportRecordPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.StudentReportRecordPageVo>>
+        ({url: '/student/studentReportRecord/page', params:params},{errorMessageMode:mode});}
+/** 领导统计 GET /student/studentReportRecord/statistics */
+export async function getStudentReportRecordStatistics(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.StudentReportRecordStatisticsVo>
+        ({url: '/student/studentReportRecord/statistics', params:params},{errorMessageMode:mode});}
+            

+ 6 - 0
src/services/apis/index.ts

@@ -148,7 +148,9 @@ import * as SchoolRollFurtherEducationController from './SchoolRollFurtherEducat
 import * as SchoolRollReasonController from './SchoolRollReasonController';
 import * as SchoolRollStudentController from './SchoolRollStudentController';
 import * as SchoolRollTransferStudentController from './SchoolRollTransferStudentController';
+import * as StudentConsumeDateController from './StudentConsumeDateController';
 import * as StudentHonorsController from './StudentHonorsController';
+import * as StudentReportRecordController from './StudentReportRecordController';
 import * as StudentManagerController from './StudentManagerController';
 import * as WfCadreCandidateController from './WfCadreCandidateController';
 import * as StudentStatisticsController from './StudentStatisticsController';
@@ -501,8 +503,12 @@ SchoolRollReasonController,
 SchoolRollStudentController,
 /** School Roll Transfer Student Controller */
 SchoolRollTransferStudentController,
+/** Student Consume Date Controller */
+StudentConsumeDateController,
 /** Student Honors Controller */
 StudentHonorsController,
+/** Student Report Record Controller */
+StudentReportRecordController,
 /** Student Manager Controller */
 StudentManagerController,
 /** Wf Cadre Candidate Controller */

+ 262 - 1
src/services/typing.d.ts

@@ -3136,6 +3136,35 @@ timeInterval?: number;
 userId?: string;
 }
 
+type AddStudentConsumeDateDto = {
+/** 班级id */
+classId?: string;
+/** 班级名称 */
+className?: string;
+/** 消费金额 */
+consumeMoney?: number;
+/** 消费时间 */
+consumeTime?: string;
+/** 消费类型 */
+consumeType?: string;
+/** 年级id */
+gradeId?: string;
+/** 年级名称 */
+gradeName?: string;
+/** 专业id */
+majorId?: string;
+/** 专业名称 */
+majorName?: string;
+/** 序号 */
+sortCode?: number;
+/** 学生id */
+studentId?: string;
+/** 学生姓名 */
+studentName?: string;
+/** 学生学号 */
+studentUserName?: string;
+}
+
 type AddStudentHonorsDto = {
 /** 申请人 */
 applicantUserId?: string;
@@ -3180,6 +3209,11 @@ teacherId?: string;
 userId?: string;
 }
 
+type AddStudentReportRecordDto = {
+/** 学生id */
+userId?: string;
+}
+
 type AddStudentScholarshipDto = {
 /** 申请id */
 applicantIds?: string[];
@@ -5373,6 +5407,8 @@ majorGradationIdCn?: string;
 }
 
 type BaseNewStudentPageVo = {
+/** 班级名称 */
+className?: string;
 createDate?: string;
 /** 身份证号 */
 credentialNumber?: string;
@@ -5413,6 +5449,8 @@ status?: number;
 stduyStatus?: string;
 /** 住宿类型中文 */
 stduyStatusCn?: string;
+/** 班主任 */
+teacherName?: string;
 /** 体重 */
 weight?: number;
 }
@@ -8123,6 +8161,17 @@ issn?: string;
 version?: string;
 }
 
+type CourseCountListVo = {
+/** 总课时 */
+courseCount?: string;
+/** 课程名称 */
+courseNames?: string;
+/** 所属部门 */
+deptName?: string;
+/** 统计项 */
+name?: string;
+}
+
 type CourseDetailVo = {
 /** 班级名称(课表类型为teacher时使用) */
 className?: string;
@@ -8161,6 +8210,15 @@ timePeriod?: number;
 timePeriodCn?: string;
 }
 
+type CourseStatisticsDetailVo = {
+/** 课时榜 */
+courseCountList?: CourseCountListVo[];
+/** 教学部课时统计 */
+deptCourseList?: ItemCountRatioVo[];
+/** 其他补充课时 */
+otnherCourseList?: ItemCountRatioVo[];
+}
+
 type CourseStatisticsVo = {
 /** 调课总数 */
 adjustCount?: number;
@@ -8501,7 +8559,7 @@ userIdCn?: string;
 
 type DurationVo = {
 /** 数量 */
-count?: number;
+count?: string;
 /** 时间段 */
 duration?: string;
 }
@@ -9679,6 +9737,15 @@ count?: number;
 item?: string;
 }
 
+type ItemCountRatioVo = {
+/** 数量 */
+count?: number;
+/** 统计项 */
+item?: string;
+/** 占比 */
+ratio?: number;
+}
+
 type ItemCountVo = {
 /** 数量 */
 count?: number;
@@ -12192,6 +12259,14 @@ total?: number;
 totalPage?: number;
 }
 
+type PageOutput<StudentConsumeDatePageVo> = {
+currentPage?: number;
+list?: StudentConsumeDatePageVo[];
+pageSize?: number;
+total?: number;
+totalPage?: number;
+}
+
 type PageOutput<StudentHonorsPageVo> = {
 currentPage?: number;
 list?: StudentHonorsPageVo[];
@@ -12208,6 +12283,14 @@ total?: number;
 totalPage?: number;
 }
 
+type PageOutput<StudentReportRecordPageVo> = {
+currentPage?: number;
+list?: StudentReportRecordPageVo[];
+pageSize?: number;
+total?: number;
+totalPage?: number;
+}
+
 type PageOutput<StudentStatisticsPageVo> = {
 currentPage?: number;
 list?: StudentStatisticsPageVo[];
@@ -14830,6 +14913,82 @@ timeInterval?: number;
 userId?: string;
 }
 
+type StudentConsumeDatePageVo = {
+/** 班级id */
+classId?: string;
+/** 班级名称 */
+className?: string;
+/** 消费金额 */
+consumeMoney?: number;
+/** 消费时间 */
+consumeTime?: string;
+/** 消费类型 */
+consumeType?: string;
+/** 消费类型 */
+consumeTypeCn?: string;
+/** 创建时间 */
+createDate?: string;
+/** 创建人 */
+createUserId?: string;
+/** 删除标记 */
+deleteMark?: number;
+/** 有效标志 */
+enabledMark?: number;
+/** 年级id */
+gradeId?: string;
+/** 年级名称 */
+gradeName?: string;
+/** 主键编号 */
+id?: string;
+/** 专业id */
+majorId?: string;
+/** 专业名称 */
+majorName?: string;
+/** 修改时间 */
+modifyDate?: string;
+/** 修改人 */
+modifyUserId?: string;
+/** 序号 */
+sortCode?: number;
+/** 学生id */
+studentId?: string;
+/** 学生姓名 */
+studentName?: string;
+/** 学生学号 */
+studentUserName?: string;
+}
+
+type StudentConsumeDateVo = {
+/** 班级id */
+classId?: string;
+/** 班级名称 */
+className?: string;
+/** 消费金额 */
+consumeMoney?: number;
+/** 消费时间 */
+consumeTime?: string;
+/** 消费类型 */
+consumeType?: string;
+/** 年级id */
+gradeId?: string;
+/** 年级名称 */
+gradeName?: string;
+/** 主键编号 */
+id?: string;
+/** 专业id */
+majorId?: string;
+/** 专业名称 */
+majorName?: string;
+/** 序号 */
+sortCode?: number;
+/** 学生id */
+studentId?: string;
+/** 学生姓名 */
+studentName?: string;
+/** 学生学号 */
+studentUserName?: string;
+}
+
 type StudentHonorsPageVo = {
 /** 获奖日期 */
 awardDate?: string;
@@ -14979,6 +15138,67 @@ teacherId?: string;
 userId?: string;
 }
 
+type StudentReportRecordPageVo = {
+/** 身份证号 */
+credentialNumber?: string;
+/** 毕业学校 */
+graduatedUniversity?: string;
+/** 是否已报到(1:是 0:否) */
+isReport?: number;
+/** 身份证号 */
+mobile?: string;
+/** 学生姓名 */
+name?: string;
+/** 家长电话 */
+parentMobile?: string;
+/** 就读方式 */
+stduyStatusCn?: string;
+/** 学生id */
+userId?: string;
+}
+
+type StudentReportRecordStatisticsVo = {
+/** 总人数 */
+allCount?: string;
+/** 已到人数 */
+arrivedCount?: string;
+/** 已到女生人数 */
+arrivedFemaleCount?: string;
+/** 已到男生人数 */
+arrivedMaleCount?: string;
+/** 班级名称 */
+className?: string;
+/** 女生人数 */
+femaleCount?: string;
+graduatedUniversityList?: ItemCountVo[];
+/** 男生人数 */
+maleCount?: string;
+/** 未到人数 */
+notArrivedCount?: string;
+/** 走读女学生总人数 */
+notStayFemaleCount?: string;
+/** 走读男学生总人数 */
+notStayMaleCount?: string;
+/** 报到率 */
+reportRate?: number;
+/** 住校女学生总人数 */
+stayFemaleCount?: string;
+/** 住校男学生总人数 */
+stayMaleCount?: string;
+/** 班主任 */
+teacherName?: string;
+}
+
+type StudentReportRecordVo = {
+/** 所属学期 */
+baseSemesterId?: string;
+id?: string;
+/** 报到时间 */
+reportTime?: string;
+/** 学生id */
+userId?: string;
+}
+
 type StudentStatisticsPageVo = {
 /** 班级名称 */
 className?: string;
@@ -19113,6 +19333,37 @@ timeInterval?: number;
 userId?: string;
 }
 
+type UpdateStudentConsumeDateDto = {
+/** 班级id */
+classId?: string;
+/** 班级名称 */
+className?: string;
+/** 消费金额 */
+consumeMoney?: number;
+/** 消费时间 */
+consumeTime?: string;
+/** 消费类型 */
+consumeType?: string;
+/** 年级id */
+gradeId?: string;
+/** 年级名称 */
+gradeName?: string;
+/** 主键编号 */
+id?: string;
+/** 专业id */
+majorId?: string;
+/** 专业名称 */
+majorName?: string;
+/** 序号 */
+sortCode?: number;
+/** 学生id */
+studentId?: string;
+/** 学生姓名 */
+studentName?: string;
+/** 学生学号 */
+studentUserName?: string;
+}
+
 type UpdateStudentHonorsDto = {
 /** 申请人 */
 applicantUserId?: string;
@@ -19161,6 +19412,12 @@ teacherId?: string;
 userId?: string;
 }
 
+type UpdateStudentReportRecordDto = {
+id?: string;
+/** 学生id */
+userId?: string;
+}
+
 type UpdateStundentFaceProcessDto = {
 classCn?: string;
 /** 班级id */
@@ -21173,10 +21430,14 @@ credentialNumber?: string;
 deleteMark?: number;
 /** 有效标志 */
 enabledMark?: number;
+/** 临时使用结束时间 */
+endTime?: string;
 /** 性别 */
 gender?: string;
 /** 主键编号 */
 id?: string;
+/** 是否临时性的(1:是 0:否) */
+isTemporary?: number;
 /** 修改时间 */
 modifyDate?: string;
 /** 姓名 */

+ 3 - 0
src/views/educational/basicInformation/components/data.config.ts

@@ -351,6 +351,7 @@ export const searchFormSchema: FormSchema[] = [
         { label: '未导入', value: '0' },
         { label: '已导入', value: '1' },
       ],
+      getPopupContainer: () => document.body,
     },
     colProps: { span: 8 },
   },
@@ -383,6 +384,7 @@ export const searchFormSchema: FormSchema[] = [
         { label: '否', value: '0' },
         { label: '是', value: '1' },
       ],
+      getPopupContainer: () => document.body,
     },
     colProps: { span: 8 },
   },
@@ -424,6 +426,7 @@ export const searchFormSchema: FormSchema[] = [
         { label: '未分配', value: '0' },
         { label: '已分配', value: '1' },
       ],
+      getPopupContainer: () => document.body,
     },
     colProps: { span: 8 },
   },

+ 194 - 0
src/views/educational/studentReport/data.config.ts

@@ -0,0 +1,194 @@
+import { BasicColumn, FormSchema } from '/@/components/Table';
+import { getDataOption } from '/@/api/system/dic';
+import { getClassOption } from '/@/api/userMagic';
+import { Switch } from 'ant-design-vue';
+import { h } from 'vue';
+import { useMessage } from '/@/hooks/web/useMessage';
+import { deleteStudentStudentReportRecord, postStudentStudentReportRecord } from '/@/services/apis/StudentReportRecordController';
+export const tableColumns: BasicColumn[] = [
+  {
+    title: '班级',
+    dataIndex: 'className',
+    align: 'left',
+  },
+  {
+    title: '班主任',
+    dataIndex: 'teacherName',
+    align: 'left',
+    width: 100,
+  },
+  {
+    title: '学生姓名',
+    dataIndex: 'name',
+    align: 'left',
+    width: 100,
+  },
+  {
+    title: '性别',
+    dataIndex: 'genderCn',
+    align: 'left',
+    width: 80,
+  },
+  {
+    title: '身份证号码',
+    dataIndex: 'credentialNumber',
+    align: 'left',
+    width: 150,
+  },
+  {
+    title: '手机号',
+    dataIndex: 'mobile',
+    align: 'left',
+    width: 150,
+  },
+  {
+    title: '家长联系电话',
+    dataIndex: 'parentMobile',
+    align: 'left',
+    width: 100,
+  },
+  {
+    title: '学生来源',
+    dataIndex: 'sourceCn',
+    align: 'left',
+    width: 100,
+  },
+  {
+    title: '就读方式',
+    dataIndex: 'stduyStatusCn',
+    align: 'left',
+    width: 100,
+  },
+  {
+    title: '报到状态',
+    dataIndex: 'isReport',
+    align: 'left',
+    width: 80,
+    customRender: ({ record }) => {
+      if (!Reflect.has(record, 'pendingStatus')) {
+        record.pendingStatus = false;
+      }
+      return h(Switch, {
+        checked: record.isReport === 1,
+        // checkedChildren: '已报到',
+        // unCheckedChildren: '未报到',
+        loading: record.pendingStatus,
+        async onChange(checked: boolean) {
+          record.pendingStatus = true;
+          const newStatus = checked ? 1 : 0;
+          const { createMessage } = useMessage();
+          try {
+            if (checked) {
+              await postStudentStudentReportRecord({ userId: record.userId });
+            } else {
+              await deleteStudentStudentReportRecord([record.userId]);
+            }
+            record.isReport = newStatus;
+            createMessage.error('修改成功');
+          } finally {
+            record.pendingStatus = false;
+          }
+        },
+      });
+    },
+  },
+  {
+    title: '报到日期',
+    dataIndex: 'graduateClass',
+    align: 'left',
+    width: 80,
+  },
+];
+
+export const searchFormSchema: FormSchema[] = [
+  {
+    field: 'classId',
+    label: '班级',
+    component: 'ApiSelect',
+    colProps: { span: 8 },
+    componentProps: {
+      api: getClassOption,
+      showSearch: true,
+      optionFilterProp: 'label',
+      getPopupContainer: () => document.body,
+    },
+  },
+  {
+    field: 'name',
+    label: '学生姓名',
+    component: 'Input',
+    colProps: { span: 8 },
+  },
+  {
+    field: 'credentialNumber',
+    label: '身份证号',
+    component: 'Input',
+    colProps: { span: 8 },
+  },
+  {
+    field: 'studentSource',
+    label: '学生来源',
+    component: 'ApiSelect',
+    colProps: { span: 8 },
+    componentProps: {
+      api: getDataOption,
+      params: { code: 'student_type' },
+      showSearch: true,
+      optionFilterProp: 'label',
+      getPopupContainer: () => document.body,
+    },
+  },
+  {
+    field: 'stduyStatus',
+    label: '就读方式',
+    component: 'ApiSelect',
+    colProps: { span: 8 },
+    componentProps: {
+      api: getDataOption,
+      params: { code: 'stduy_status' },
+      getPopupContainer: () => document.body,
+    },
+  },
+  {
+    field: 'gender',
+    label: '性别',
+    component: 'ApiSelect',
+    componentProps: {
+      api: getDataOption,
+      params: { code: 'gender' },
+      getPopupContainer: () => document.body,
+    },
+    colProps: { span: 8 },
+  },
+  {
+    field: 'isReport',
+    label: '报到状态',
+    component: 'Select',
+    colProps: { span: 8 },
+    componentProps: {
+      getPopupContainer: () => document.body,
+      options: [
+        {
+          label: '已报到',
+          value: '1',
+        },
+        {
+          label: '未报到',
+          value: '0',
+        },
+      ],
+    },
+  },
+  {
+    field: '[startDate,endDate]',
+    label: '报到时间',
+    component: 'RangePicker',
+    componentProps: {
+      getPopupContainer: () => document.body,
+      format: 'YYYY-MM-DD HH:mm:ss',
+      placeholder: ['开始时间', '结束时间'],
+      showTime: { format: 'HH:mm:ss' },
+    },
+    colProps: { span: 16 },
+  },
+];

+ 91 - 0
src/views/educational/studentReport/index.vue

@@ -0,0 +1,91 @@
+<script setup lang="ts">
+  import { PageWrapper } from '/@/components/Page';
+  import { useTable, BasicTable, TableAction } from '/@/components/Table';
+  import { searchFormSchema, tableColumns } from './data.config';
+  import ClassTree from '/@/views/educational/basicInformation/components/tree.vue';
+  import { reactive } from 'vue';
+  import {
+    deleteStudentBaseNewStudent,
+    getBaseNewStudentPage,
+  } from '/@/services/apis/BaseNewStudentController';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { Recordable } from 'vite-plugin-mock';
+
+  const searchInfo = reactive<Recordable>({});
+
+  const { createConfirm, createMessage } = useMessage();
+
+  const [registerTable, { reload }] = useTable({
+    api: getBaseNewStudentPage,
+    title: '新生列表',
+    rowKey: 'id',
+    columns: tableColumns,
+    formConfig: {
+      labelWidth: 120,
+      schemas: searchFormSchema,
+    },
+    useSearchForm: true,
+    showTableSetting: true,
+    bordered: true,
+    immediate: true,
+    canResize: true,
+    actionColumn: {
+      width: 100,
+      title: '操作',
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+      fixed: 'right',
+    },
+    rowSelection: {
+      type: 'checkbox',
+    },
+  });
+
+  function handleSelect(id) {
+    searchInfo.enrollmentPlanId = id;
+    reload();
+  }
+
+  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>
+  <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
+    <ClassTree class="w-1/3 xl:w-1/4" @select="handleSelect" />
+    <BasicTable class="w-2/3 xl:w-3/4" @register="registerTable" :searchInfo="searchInfo">
+      <template #toolbar> </template>
+      <template #action="{ record }">
+        <div style="display: flex; justify-content: center">
+          <TableAction
+            :actions="[
+              {
+                label: '删除',
+                color: 'error',
+                onClick: handleDelete.bind(null, record),
+              },
+            ]"
+          />
+        </div>
+      </template>
+    </BasicTable>
+  </PageWrapper>
+</template>
+
+<style scoped lang="less"></style>

+ 57 - 74
src/views/system/menu/components/ButtonTable.vue

@@ -38,8 +38,8 @@
     <MenuButtonModal @register="registerModal" @success="handleSuccess" />
   </div>
 </template>
-<script lang="ts">
-  import { defineComponent, reactive } from 'vue';
+<script lang="ts" setup>
+  import { reactive } from 'vue';
   import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
   import MenuButtonModal from './MenuButtonModal.vue';
   import SetPrintTemplate from './SetPrintTemplate.vue';
@@ -50,11 +50,11 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { PrintButton } from '/@/enums/printEnum';
   const { t } = useI18n();
-  const props = {
+  const props = defineProps({
     menuId: { type: String, default: '' },
     hasMetaFormId: { type: Boolean, default: false },
-  };
-  export const columns: BasicColumn[] = [
+  });
+  const columns: BasicColumn[] = [
     {
       title: t('按钮名称'),
       dataIndex: 'name',
@@ -89,77 +89,60 @@
     },
   ];
 
-  export default defineComponent({
-    name: 'MenuDrawer',
-    components: { TableAction, BasicTable, MenuButtonModal, Icon, SetPrintTemplate },
-    props,
-    emits: ['success', 'register'],
-    setup(props) {
-      let btnData = reactive<MenuButtonModel[]>([]);
-      const [registerTable, { getDataSource, setTableData, updateTableDataRecord }] = useTable({
-        title: t('按钮列表'),
-        dataSource: btnData,
-        api: getMenuButtonById,
-        beforeFetch: (params) => {
-          //发送请求默认新增  左边树结构所选机构id
-          return { ...params, id: props.menuId };
-        },
-        columns,
-        pagination: false,
-        striped: false,
-        useSearchForm: false,
-        showTableSetting: true,
-        bordered: true,
-        showIndexColumn: false,
-        canResize: false,
-        actionColumn: {
-          width: 80,
-          title: t('操作'),
-          dataIndex: 'action',
-          slots: { customRender: 'action' },
-          fixed: undefined,
-        },
-      });
+  defineEmits(['success', 'register']);
 
-      const [registerModal, { openModal }] = useModal();
+  let btnData = reactive<MenuButtonModel[]>([]);
+  const [registerTable, { getDataSource, setTableData, updateTableDataRecord }] = useTable({
+    title: t('按钮列表'),
+    dataSource: btnData,
+    api: getMenuButtonById,
+    beforeFetch: (params) => {
+      //发送请求默认新增  左边树结构所选机构id
+      return { ...params, id: props.menuId };
+    },
+    columns,
+    pagination: false,
+    striped: false,
+    useSearchForm: false,
+    showTableSetting: true,
+    bordered: true,
+    showIndexColumn: false,
+    canResize: false,
+    actionColumn: {
+      width: 80,
+      title: t('操作'),
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+      fixed: undefined,
+    },
+  });
 
-      function handleCreate() {
-        openModal(true, {
-          isUpdate: false,
-        });
-      }
+  const [registerModal, { openModal }] = useModal();
 
-      function handleEdit(record: Recordable) {
-        openModal(true, {
-          record,
-          isUpdate: true,
-        });
-      }
-      function handleSuccess({ isUpdate, record }) {
-        if (isUpdate) {
-          updateTableDataRecord(record.key, record);
-        } else {
-          const dataSource = getDataSource();
-          dataSource.push(record);
-          setTableData(dataSource);
-        }
-      }
+  function handleCreate() {
+    openModal(true, {
+      isUpdate: false,
+    });
+  }
 
-      function handleDelete(record: Recordable) {
-        const dataSource = getDataSource();
-        setTableData(dataSource.filter((x) => x.key !== record.key));
-      }
-      return {
-        PrintButton,
-        registerTable,
-        handleCreate,
-        registerModal,
-        handleEdit,
-        handleSuccess,
-        handleDelete,
-        getDataSource,
-        t,
-      };
-    },
-  });
+  function handleEdit(record: Recordable) {
+    openModal(true, {
+      record,
+      isUpdate: true,
+    });
+  }
+  function handleSuccess({ isUpdate, record }) {
+    if (isUpdate) {
+      updateTableDataRecord(record.key, record);
+    } else {
+      const dataSource = getDataSource();
+      dataSource.push(record);
+      setTableData(dataSource);
+    }
+  }
+
+  function handleDelete(record: Recordable) {
+    const dataSource = getDataSource();
+    setTableData(dataSource.filter((x) => x.key !== record.key));
+  }
 </script>

+ 56 - 73
src/views/system/menu/components/ColumnTable.vue

@@ -29,8 +29,8 @@
     <MenuColumnModal @register="registerModal" @success="handleSuccess" />
   </div>
 </template>
-<script lang="ts">
-  import { defineComponent, reactive } from 'vue';
+<script lang="ts" setup>
+  import { reactive } from 'vue';
 
   import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
   import MenuColumnModal from './MenuColumnModal.vue';
@@ -41,10 +41,10 @@
   import { MenuButtonModel } from '/@/api/system/menuButton/model';
   import { useI18n } from '/@/hooks/web/useI18n';
   const { t } = useI18n();
-  const props = {
+  const props = defineProps({
     menuId: { type: String, default: '' },
-  };
-  export const columns: BasicColumn[] = [
+  });
+  const columns: BasicColumn[] = [
     {
       title: t('表格列名称'),
       dataIndex: 'name',
@@ -58,79 +58,62 @@
     },
   ];
 
-  export default defineComponent({
-    name: 'MenuDrawer',
-    components: { TableAction, BasicTable, MenuColumnModal },
-    props,
-    emits: ['success', 'register'],
-    setup(props) {
-      let btnData = reactive<MenuButtonModel[]>([]);
+  defineEmits(['success', 'register']);
 
-      const [registerTable, { getDataSource, setTableData, updateTableDataRecord }] = useTable({
-        title: t('表格字段列表'),
-        dataSource: btnData,
-        api: getMenuColumnById,
-        beforeFetch: (params) => {
-          //发送请求默认新增  左边树结构所选机构id
-          return { ...params, menuId: props.menuId };
-        },
-        columns,
-        pagination: false,
-        striped: false,
-        useSearchForm: false,
-        showTableSetting: true,
-        bordered: true,
-        showIndexColumn: false,
-        canResize: false,
-        actionColumn: {
-          width: 80,
-          title: t('操作'),
-          dataIndex: 'action',
-          slots: { customRender: 'action' },
-          fixed: undefined,
-        },
-      });
+  let btnData = reactive<MenuButtonModel[]>([]);
 
-      const [registerModal, { openModal }] = useModal();
+  const [registerTable, { getDataSource, setTableData, updateTableDataRecord }] = useTable({
+    title: t('表格字段列表'),
+    dataSource: btnData,
+    api: getMenuColumnById,
+    beforeFetch: (params) => {
+      //发送请求默认新增  左边树结构所选机构id
+      return { ...params, menuId: props.menuId };
+    },
+    columns,
+    pagination: false,
+    striped: false,
+    useSearchForm: false,
+    showTableSetting: true,
+    bordered: true,
+    showIndexColumn: false,
+    canResize: false,
+    actionColumn: {
+      width: 80,
+      title: t('操作'),
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+      fixed: undefined,
+    },
+  });
 
-      function handleCreate() {
-        openModal(true, {
-          isUpdate: false,
-        });
-      }
+  const [registerModal, { openModal }] = useModal();
 
-      function handleEdit(record: Recordable) {
-        openModal(true, {
-          record,
-          isUpdate: true,
-        });
-      }
+  function handleCreate() {
+    openModal(true, {
+      isUpdate: false,
+    });
+  }
 
-      function handleSuccess({ isUpdate, record }) {
-        if (isUpdate) {
-          updateTableDataRecord(record.key, record);
-        } else {
-          const dataSource = getDataSource();
-          dataSource.push(record);
-          setTableData(dataSource);
-        }
-      }
+  function handleEdit(record: Recordable) {
+    openModal(true, {
+      record,
+      isUpdate: true,
+    });
+  }
 
-      function handleDelete(record: Recordable) {
-        const dataSource = getDataSource();
-        setTableData(dataSource.filter((x) => x.key !== record.key));
-      }
+  function handleSuccess({ isUpdate, record }) {
+    if (isUpdate) {
+      updateTableDataRecord(record.key, record);
+    } else {
+      const dataSource = getDataSource();
+      dataSource.push(record);
+      setTableData(dataSource);
+    }
+  }
 
-      return {
-        registerTable,
-        handleCreate,
-        registerModal,
-        handleEdit,
-        handleSuccess,
-        handleDelete,
-        getDataSource,
-        t,
-      };
-    },
-  });
+  function handleDelete(record: Recordable) {
+    const dataSource = getDataSource();
+    setTableData(dataSource.filter((x) => x.key !== record.key));
+  }
 </script>

+ 57 - 74
src/views/system/menu/components/FormTable.vue

@@ -29,8 +29,8 @@
     <MenuFormModal @register="registerModal" @success="handleSuccess" />
   </div>
 </template>
-<script lang="ts">
-  import { defineComponent, reactive } from 'vue';
+<script lang="ts" setup>
+  import { reactive } from 'vue';
 
   import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
   import MenuFormModal from './MenuFormModal.vue';
@@ -41,10 +41,12 @@
   import { MenuButtonModel } from '/@/api/system/menuButton/model';
   import { useI18n } from '/@/hooks/web/useI18n';
   const { t } = useI18n();
-  const props = {
+  const props = defineProps({
     menuId: { type: String, default: '' },
-  };
-  export const columns: BasicColumn[] = [
+  });
+
+  defineEmits(['success', 'register']);
+  const columns: BasicColumn[] = [
     {
       title: t('表单项名称'),
       dataIndex: 'name',
@@ -58,79 +60,60 @@
     },
   ];
 
-  export default defineComponent({
-    name: 'MenuDrawer',
-    components: { TableAction, BasicTable, MenuFormModal },
-    props,
-    emits: ['success', 'register'],
-    setup(props) {
-      let btnData = reactive<MenuButtonModel[]>([]);
+  let btnData = reactive<MenuButtonModel[]>([]);
 
-      const [registerTable, { getDataSource, setTableData, updateTableDataRecord }] = useTable({
-        title: t('表单项列表'),
-        dataSource: btnData,
-        api: getMenuFormById,
-        beforeFetch: (params) => {
-          //发送请求默认新增  左边树结构所选机构id
-          return { ...params, menuId: props.menuId };
-        },
-        columns,
-        pagination: false,
-        striped: false,
-        useSearchForm: false,
-        showTableSetting: true,
-        bordered: true,
-        showIndexColumn: false,
-        canResize: false,
-        actionColumn: {
-          width: 80,
-          title: t('操作'),
-          dataIndex: 'action',
-          slots: { customRender: 'action' },
-          fixed: undefined,
-        },
-      });
-
-      const [registerModal, { openModal }] = useModal();
+  const [registerTable, { getDataSource, setTableData, updateTableDataRecord }] = useTable({
+    title: t('表单项列表'),
+    dataSource: btnData,
+    api: getMenuFormById,
+    beforeFetch: (params) => {
+      //发送请求默认新增  左边树结构所选机构id
+      return { ...params, menuId: props.menuId };
+    },
+    columns,
+    pagination: false,
+    striped: false,
+    useSearchForm: false,
+    showTableSetting: true,
+    bordered: true,
+    showIndexColumn: false,
+    canResize: false,
+    actionColumn: {
+      width: 80,
+      title: t('操作'),
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+      fixed: undefined,
+    },
+  });
 
-      function handleCreate() {
-        openModal(true, {
-          isUpdate: false,
-        });
-      }
+  const [registerModal, { openModal }] = useModal();
 
-      function handleEdit(record: Recordable) {
-        openModal(true, {
-          record,
-          isUpdate: true,
-        });
-      }
+  function handleCreate() {
+    openModal(true, {
+      isUpdate: false,
+    });
+  }
 
-      function handleSuccess({ isUpdate, record }) {
-        if (isUpdate) {
-          updateTableDataRecord(record.key, record);
-        } else {
-          const dataSource = getDataSource();
-          dataSource.push(record);
-          setTableData(dataSource);
-        }
-      }
+  function handleEdit(record: Recordable) {
+    openModal(true, {
+      record,
+      isUpdate: true,
+    });
+  }
 
-      function handleDelete(record: Recordable) {
-        const dataSource = getDataSource();
-        setTableData(dataSource.filter((x) => x.key !== record.key));
-      }
+  function handleSuccess({ isUpdate, record }) {
+    if (isUpdate) {
+      updateTableDataRecord(record.key, record);
+    } else {
+      const dataSource = getDataSource();
+      dataSource.push(record);
+      setTableData(dataSource);
+    }
+  }
 
-      return {
-        registerTable,
-        handleCreate,
-        registerModal,
-        handleEdit,
-        handleSuccess,
-        handleDelete,
-        getDataSource,
-        t,
-      };
-    },
-  });
+  function handleDelete(record: Recordable) {
+    const dataSource = getDataSource();
+    setTableData(dataSource.filter((x) => x.key !== record.key));
+  }
 </script>