Forráskód Böngészése

fix: change enter

DESKTOP-USV654P\pc 2 hónapja
szülő
commit
443c7ca8e5

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ build:
 
 commit:
 	git add . && \
-	git commit --no-verify -m "fix: add enter "
+	git commit --no-verify -m "fix: change enter "
 
 checkPre:
 	git checkout pre

BIN
src/assets/images/banner.webp


+ 8 - 1
src/services/apis/ExamSubjectScoreController.ts

@@ -11,7 +11,14 @@ import { ErrorMessageMode } from '/#/axios';
             ;
 
 
-            /** 考试成绩查询(分页) GET /xycxedu/ExamSubjectScore/page */
+            /** 修改学生成绩 PUT /xycxedu/ExamSubjectScore */
+export async function putXycxeduExamSubjectScore(params:API.UpdateExamSubjectScoreDto[]
+,mode: ErrorMessageMode = 'modal'){ return defHttp.put<any>
+        ({url: '/xycxedu/ExamSubjectScore', data:params},{errorMessageMode:mode});}
+/** 根据录入id考试成绩查询 GET /xycxedu/ExamSubjectScore/enter-list */
+export async function getExamSubjectScoreEnterList(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.ExamSubjectScoreEnterImportVo[]>
+        ({url: '/xycxedu/ExamSubjectScore/enter-list', params:params},{errorMessageMode:mode});}
+/** 考试成绩查询(分页) GET /xycxedu/ExamSubjectScore/page */
 export async function getExamSubjectScorePage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.ExamSubjectScorePageVo>>
         ({url: '/xycxedu/ExamSubjectScore/page', params:params},{errorMessageMode:mode});}
             

+ 37 - 0
src/services/apis/ExamSubjectScoreEnterController.ts

@@ -0,0 +1,37 @@
+// @ts-ignore
+/* eslint-disable */
+
+// 该文件自动生成,请勿手动修改!
+import { defHttp } from '/@/utils/http/axios';
+import { ErrorMessageMode } from '/#/axios';
+            // --------------------------------------------------------------------------
+            // Exam Subject Score Enter Controller
+            // --------------------------------------------------------------------------
+
+            ;
+
+
+            /** 新增成绩录入 POST /xycxedu/examSubjectScoreEnter */
+export async function postXycxeduExamSubjectScoreEnter(params:API.AddExamSubjectScoreEnterDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.post<any>
+        ({url: '/xycxedu/examSubjectScoreEnter', data:params},{errorMessageMode:mode});}
+/** 修改成绩录入 PUT /xycxedu/examSubjectScoreEnter */
+export async function putXycxeduExamSubjectScoreEnter(params:API.UpdateExamSubjectScoreEnterDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.put<any>
+        ({url: '/xycxedu/examSubjectScoreEnter', data:params},{errorMessageMode:mode});}
+/** 删除成绩录入 DELETE /xycxedu/examSubjectScoreEnter */
+export async function deleteXycxeduExamSubjectScoreEnter(params:string[],mode: ErrorMessageMode = 'modal'){ return defHttp.delete<any>
+        ({url: '/xycxedu/examSubjectScoreEnter', data:params},{errorMessageMode:mode});}
+/** 下载模板 POST /xycxedu/examSubjectScoreEnter/export-query */
+export async function postExamSubjectScoreEnterExportQuery(mode: ErrorMessageMode = 'modal'){ return defHttp.download<string>
+        ({url: '/xycxedu/examSubjectScoreEnter/export-query',responseType:'blob',method:'POST', data:{}},{errorMessageMode:mode});}
+/** 导入 POST /xycxedu/examSubjectScoreEnter/import */
+export async function postExamSubjectScoreEnterImport(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.post<any>
+        ({url: '/xycxedu/examSubjectScoreEnter/import',headers:{'Content-Type':'multipart/form-data'}, data:params},{errorMessageMode:mode});}
+/** 根据id查询成绩录入信息 GET /xycxedu/examSubjectScoreEnter/info */
+export async function getExamSubjectScoreEnterInfo(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.ExamSubjectScoreEnterVo>
+        ({url: '/xycxedu/examSubjectScoreEnter/info', params:params},{errorMessageMode:mode});}
+/** 成绩录入列表(分页) GET /xycxedu/examSubjectScoreEnter/page */
+export async function getExamSubjectScoreEnterPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.ExamSubjectScoreEnterPageVo>>
+        ({url: '/xycxedu/examSubjectScoreEnter/page', params:params},{errorMessageMode:mode});}
+            

+ 3 - 0
src/services/apis/RoomBedAdjustController.ts

@@ -37,4 +37,7 @@ export async function getRoomBedAdjustIsClassTeacher(params:any,mode: ErrorMessa
 /** 未分配床位的学生(分页) GET /room/roomBedAdjust/no-bed-student */
 export async function getRoomBedAdjustNoBedStudent(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.NoBedStudentPageVo>>
         ({url: '/room/roomBedAdjust/no-bed-student', params:params},{errorMessageMode:mode});}
+/** 班主任查看寝室 GET /room/roomBedAdjust/teacher-room-list */
+export async function getRoomBedAdjustTeacherRoomList(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.TeacherRoomListVo[]>
+        ({url: '/room/roomBedAdjust/teacher-room-list', params:params},{errorMessageMode:mode});}
             

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

@@ -225,6 +225,7 @@ import * as WorkflowSpecialMenuController from './WorkflowSpecialMenuController'
 import * as WorkflowApproveRecordController from './WorkflowApproveRecordController';
 import * as ExamSubjectScoreController from './ExamSubjectScoreController';
 import * as ExamPlanController from './ExamPlanController';
+import * as ExamSubjectScoreEnterController from './ExamSubjectScoreEnterController';
 
 
         export default {
@@ -672,6 +673,8 @@ WorkflowApproveRecordController,
 ExamSubjectScoreController,
 /** Exam Plan Controller */
 ExamPlanController,
+/** Exam Subject Score Enter Controller */
+ExamSubjectScoreEnterController,
 
         };
         

+ 121 - 0
src/services/typing.d.ts

@@ -2283,6 +2283,17 @@ name?: string;
 semesterId?: string;
 }
 
+type AddExamSubjectScoreEnterDto = {
+/** 班级id */
+classIds?: string[];
+/** 科目id */
+courseSubjectId?: string;
+/** 考试计划id */
+examPlanId?: string;
+/** 学期id */
+semesterId?: string;
+}
+
 type AddFormCodeFirstDto = {
 /** 表单分类 关联 数据字典 */
 category?: string;
@@ -6204,6 +6215,10 @@ fileId?: string;
 fileInfos?: File对象[];
 /** 主键编号 */
 id?: string;
+/** 修改时间 */
+modifyDate?: string;
+/** 修改人 */
+modifyUserName?: string;
 /** 原因 */
 reason?: string;
 /** 分数 */
@@ -7208,6 +7223,8 @@ userId?: string;
 }
 
 type BaseStudentInfoDetailVo = {
+/** 学生档案编号 */
+archivesNumber?: string;
 /** 学籍状态(xjr_dictionary_item[archives_status]) */
 archivesStatus?: string;
 /** 学籍状态(xjr_dictionary_item[archives_status]) */
@@ -10194,6 +10211,65 @@ semesterName?: string;
 studentCount?: number;
 }
 
+type ExamSubjectScoreEnterImportVo = {
+/** 班级 */
+className?: string;
+/** 班级排名 */
+classRanking?: number;
+/** 学生身份证 */
+credentialNumber?: string;
+/** 年级排名 */
+gradeRanking?: number;
+/** 主键id */
+id?: string;
+/** 成绩 */
+score?: string;
+/** 学生姓名 */
+studentName?: string;
+}
+
+type ExamSubjectScoreEnterPageVo = {
+/** 班级名称 */
+className?: string;
+/** 科目名称 */
+courseSubjectName?: string;
+/** 创建时间 */
+createDate?: string;
+/** 创建人 */
+createUserName?: string;
+/** 考试计划 */
+examPlanName?: string;
+/** 主键 */
+id?: string;
+/** 学期 */
+semesterName?: string;
+}
+
+type ExamSubjectScoreEnterVo = {
+/** 所有学生数量 */
+allCount?: number;
+/** 班级名称 */
+classIds?: string;
+/** 班级 */
+classList?: BaseClass[];
+/** 班级名称 */
+className?: string;
+/** 科目名称 */
+courseSubjectName?: string;
+/** 创建时间 */
+createDate?: string;
+/** 创建人 */
+createUserName?: string;
+/** 考试计划 */
+examPlanName?: string;
+/** 已录入学生数量 */
+handleCount?: number;
+/** 主键 */
+id?: string;
+/** 学期 */
+semesterName?: string;
+}
+
 type ExamSubjectScorePageVo = {
 /** 科目 */
 coursename?: string;
@@ -13466,6 +13542,14 @@ total?: number;
 totalPage?: number;
 }
 
+type PageOutput<ExamSubjectScoreEnterPageVo> = {
+currentPage?: number;
+list?: ExamSubjectScoreEnterPageVo[];
+pageSize?: number;
+total?: number;
+totalPage?: number;
+}
+
 type PageOutput<ExamSubjectScorePageVo> = {
 currentPage?: number;
 list?: ExamSubjectScorePageVo[];
@@ -17533,6 +17617,15 @@ status?: number;
 userId?: string;
 }
 
+type TeacherRoomListVo = {
+/** 楼栋名称 */
+buildName?: string;
+/** 寝室id */
+id?: string;
+/** 寝室名称 */
+roomName?: string;
+}
+
 type TeacherStatisticsDetailVo = {
 /** 年龄占比数据 */
 ageList?: ItemCountVo[];
@@ -17909,6 +18002,8 @@ courseName?: string;
 courseSubjectId?: string;
 /** 预估折扣 */
 discount?: number;
+/** 预估折扣后的价格 */
+discountPrice?: number;
 /** 主编 */
 editorInChief?: string;
 /** 学科组名称 */
@@ -20477,6 +20572,30 @@ name?: string;
 semesterId?: string;
 }
 
+type UpdateExamSubjectScoreDto = {
+/** 班级排名 */
+classRanking?: number;
+/** 年级排名 */
+gradeRanking?: number;
+/** 主键id */
+id?: string;
+/** 分数 */
+score?: number;
+}
+
+type UpdateExamSubjectScoreEnterDto = {
+/** 班级id */
+classIds?: string[];
+/** 科目id */
+courseSubjectId?: string;
+/** 考试计划id */
+examPlanId?: string;
+/** 主键 */
+id?: string;
+/** 学期id */
+semesterId?: string;
+}
+
 type UpdateFaceManagementStatusDto = {
 enabledMark?: number;
 id?: string;
@@ -24038,6 +24157,8 @@ gender?: string;
 id?: string;
 /** 所学专业 */
 majorName?: string;
+/** 修改时间 */
+modifyDate?: string;
 /** 姓名 */
 name?: string;
 /** 民族(xjr_dictionary_item[nation]) */

+ 115 - 12
src/views/educational/studentScore/enter/data.config.ts

@@ -3,6 +3,7 @@ import { BasicColumn, FormSchema } from '/@/components/Table';
 import { requestMagicApi } from '/@/api/magicApi';
 import { getClassOption } from '/@/api/userMagic';
 import { getExamPlanPlanList } from '/@/services/apis/ExamPlanController';
+import { formatToDate } from '/@/utils/dateUtil';
 
 export const tableColumns: BasicColumn[] = [
   {
@@ -19,24 +20,27 @@ export const tableColumns: BasicColumn[] = [
   },
   {
     title: '科目',
-    dataIndex: 'milexamnames',
+    dataIndex: 'courseSubjectName',
     align: 'left',
-    width: 120,
+    width: 200,
   },
   {
     title: '班级',
-    dataIndex: 'milexamnames',
+    dataIndex: 'className',
     align: 'left',
   },
   {
     title: '录入时间',
-    dataIndex: 'milexamnames',
+    dataIndex: 'createDate',
     align: 'left',
     width: 150,
+    customRender: ({ text }) => {
+      return formatToDate(text);
+    },
   },
   {
     title: '录入人',
-    dataIndex: 'milexamnames',
+    dataIndex: 'createName',
     align: 'left',
     width: 120,
   },
@@ -64,9 +68,9 @@ export const searchFormSchema: FormSchema[] = [
     },
   },
   {
-    field: 'examPlanId',
+    field: 'examPlanName',
     label: '计划',
-    component: 'ApiSelect',
+    component: 'Input',
     colProps: { span: 8 },
     componentProps: {
       getPopupContainer: () => document.body,
@@ -82,15 +86,15 @@ export const searchFormSchema: FormSchema[] = [
     },
   },
   {
-    field: 'courseName',
+    field: 'courseSubjectName',
     label: '科目',
     component: 'Input',
     colProps: { span: 8 },
   },
   {
-    field: 'classId',
+    field: 'className',
     label: '班级',
-    component: 'ApiSelect',
+    component: 'Input',
     colProps: { span: 8 },
     componentProps: {
       getPopupContainer: () => document.body,
@@ -148,11 +152,25 @@ export const formSchema: FormSchema[] = [
     },
   },
   {
-    field: 'courseName',
+    field: 'courseSubjectId',
     label: '科目',
-    component: 'Input',
+    component: 'ApiSelect',
     required: true,
     colProps: { span: 24 },
+    componentProps: {
+      getPopupContainer: () => document.body,
+      api: requestMagicApi,
+      params: {
+        url: '/baseData/coursesubject/option',
+      },
+      showSearch: true,
+      filterOption: (input: string, option: any) => {
+        return (
+          option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+          option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        );
+      },
+    },
   },
   {
     field: 'classIds',
@@ -174,3 +192,88 @@ export const formSchema: FormSchema[] = [
     },
   },
 ];
+
+export const searchDetailFormSchema: FormSchema[] = [
+  {
+    field: 'classId',
+    label: '班级',
+    component: 'Select',
+    colProps: { span: 8 },
+    componentProps: {
+      getPopupContainer: () => document.body,
+      showSearch: true,
+      filterOption: (input: string, option: any) => {
+        return (
+          option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+          option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        );
+      },
+    },
+  },
+  {
+    field: 'studentName',
+    label: '学生姓名',
+    component: 'Input',
+    colProps: { span: 8 },
+  },
+  {
+    field: 'credentialNumber',
+    label: '身份证号',
+    component: 'Input',
+    colProps: { span: 8 },
+  },
+  {
+    field: 'isEnter',
+    label: '录入状态',
+    component: 'Select',
+    colProps: { span: 8 },
+    componentProps: {
+      getPopupContainer: () => document.body,
+      options: [
+        { value: 1, label: '已录入' },
+        { value: 0, label: '未录入' },
+      ],
+    },
+  },
+];
+
+export const tableDetailColumns: BasicColumn[] = [
+  {
+    title: '班级',
+    dataIndex: 'className',
+    align: 'left',
+    width: 120,
+  },
+  {
+    title: '学生姓名',
+    dataIndex: 'studentName',
+    align: 'left',
+    width: 150,
+  },
+  {
+    title: '身份证号',
+    dataIndex: 'credentialNumber',
+    align: 'left',
+  },
+  {
+    title: '成绩',
+    dataIndex: 'score',
+    align: 'left',
+    width: 100,
+    slots: { customRender: 'score' },
+  },
+  {
+    title: '班级排名',
+    dataIndex: 'classRanking',
+    align: 'left',
+    width: 100,
+    slots: { customRender: 'classRanking' },
+  },
+  {
+    title: '年级排名',
+    dataIndex: 'gradeRanking',
+    align: 'left',
+    width: 100,
+    slots: { customRender: 'gradeRanking' },
+  },
+];

+ 8 - 9
src/views/educational/studentScore/enter/edit.vue

@@ -18,11 +18,12 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { formSchema } from './data.config';
+
   import {
-    getExamPlanInfo,
-    postXycxeduExamPlan,
-    putXycxeduExamPlan,
-  } from '/@/services/apis/ExamPlanController';
+    putXycxeduExamSubjectScoreEnter,
+    postXycxeduExamSubjectScoreEnter,
+    getExamSubjectScoreEnterInfo,
+  } from '/@/services/apis/ExamSubjectScoreEnterController';
 
   const isUpdate = ref(true);
   const modelRef = ref({});
@@ -41,8 +42,7 @@
     modelRef.value = { ...data.baseData };
 
     if (unref(isUpdate)) {
-      const resData = await getExamPlanInfo({ id: data.baseData.id });
-      resData['classIds'] = resData['classIds'].split(',');
+      const resData = await getExamSubjectScoreEnterInfo({ id: data.baseData.id });
 
       modelRef.value = { ...resData };
       setFieldsValue({
@@ -58,12 +58,11 @@
       setModalProps({ confirmLoading: true });
       const postParams = unref(modelRef);
       Object.assign(postParams, values);
-      postParams['classIds'] = postParams['classIds'].join(',');
 
       if (unref(isUpdate)) {
-        await putXycxeduExamPlan(postParams as API.UpdateExamPlanDto);
+        await putXycxeduExamSubjectScoreEnter(postParams as API.UpdateExamSubjectScoreEnterDto);
       } else {
-        await postXycxeduExamPlan(postParams as API.AddExamPlanDto);
+        await postXycxeduExamSubjectScoreEnter(postParams as API.AddExamSubjectScoreEnterDto);
       }
 
       createMessage.success('操作成功');

+ 162 - 0
src/views/educational/studentScore/enter/editForm.vue

@@ -0,0 +1,162 @@
+<template>
+  <BasicModal
+    @ok="handleSubmit"
+    :destroyOnClose="true"
+    :maskClosable="false"
+    v-bind="$attrs"
+    @register="registerModal"
+    :title="getTitle"
+    :width="1002"
+    showFooter
+    :default-fullscreen="true"
+  >
+    <div class="h-full">
+      <div style="height: 112px">
+        <Descriptions layout="vertical" :column="6" bordered>
+          <Descriptions.Item label="考试学期">{{ modelRef?.semesterName }}a</Descriptions.Item>
+          <Descriptions.Item label="考试计划">{{ modelRef?.examPlanName }}</Descriptions.Item>
+          <Descriptions.Item label="录入科目">{{ modelRef?.courseSubjectName }}</Descriptions.Item>
+          <Descriptions.Item label="录入班级">{{ modelRef?.className }}</Descriptions.Item>
+          <Descriptions.Item label="学生总数量">{{ modelRef?.allCount || 0 }}</Descriptions.Item>
+          <Descriptions.Item label="已录入数量">{{ modelRef?.handleCount || 0 }}</Descriptions.Item>
+        </Descriptions>
+      </div>
+      <div style="height: calc(100% - 112px)">
+        <BasicTable @register="registerTable" :search-info="searchInfo">
+          <template #toolbar>
+            <a-button type="primary" @click="handelImport">批量导入</a-button>
+          </template>
+          <template #score="{ record }">
+            <InputNumber v-model:value="record.score" :min="0" default-value="0" />
+          </template>
+          <template #classRanking="{ record }">
+            <InputNumber v-model:value="record.classRanking" :min="0" default-value="0" />
+          </template>
+          <template #gradeRanking="{ record }">
+            <InputNumber v-model:value="record.gradeRanking" :min="0" default-value="0" />
+          </template>
+        </BasicTable>
+      </div>
+    </div>
+    <FormImport @register="registerImportModal" @success="handleSuccess" />
+  </BasicModal>
+</template>
+<script setup lang="ts">
+  import { ref, computed, unref, reactive } from 'vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { BasicModal, useModal, useModalInner } from '/@/components/Modal';
+  import { BasicTable, useTable } from '/@/components/Table';
+  import { tableDetailColumns, searchDetailFormSchema } from './data.config';
+  import { InputNumber, Descriptions } from 'ant-design-vue';
+
+  import {
+    postExamSubjectScoreEnterExportQuery,
+    getExamSubjectScoreEnterInfo,
+    postExamSubjectScoreEnterImport,
+  } from '/@/services/apis/ExamSubjectScoreEnterController';
+  import {
+    getExamSubjectScoreEnterList,
+    putXycxeduExamSubjectScore,
+  } from '/@/services/apis/ExamSubjectScoreController';
+  import FormImport from '/@/views/sys/import/index.vue';
+
+  const isUpdate = ref(true);
+  const modelRef = ref<Recordable>({});
+  const emit = defineEmits(['success', 'register']);
+  const { createMessage } = useMessage();
+  const searchInfo = reactive<Recordable>({});
+  const [registerImportModal, { openModal: openImportModal }] = useModal();
+
+  const [registerTable, { reload, getForm, getDataSource }] = useTable({
+    api: getExamSubjectScoreEnterList,
+    title: '考试记录表',
+    rowKey: 'id',
+    columns: tableDetailColumns,
+    formConfig: {
+      labelWidth: 120,
+      schemas: searchDetailFormSchema,
+    },
+    useSearchForm: true,
+    showTableSetting: true,
+    bordered: true,
+    immediate: false,
+    canResize: true,
+    pagination: false,
+  });
+
+  const [registerModal, { closeModal, setModalProps }] = useModalInner(async (data) => {
+    setModalProps({ confirmLoading: true, loading: true });
+    isUpdate.value = !!data?.isUpdate;
+    // modelRef.value = { ...data.baseData };
+
+    const { updateSchema } = getForm();
+
+    const resData = await getExamSubjectScoreEnterInfo({ id: data.baseData.id });
+    modelRef.value = { ...resData };
+
+    const options: Recordable[] = [];
+    resData.classList.forEach((item) => {
+      options.push({ label: item.name, value: item.id });
+    });
+
+    updateSchema({ field: 'classId', componentProps: { options } });
+
+    searchInfo.examSubjectScoreEnterId = data.baseData.id;
+    await reload();
+    setModalProps({ confirmLoading: false, loading: false });
+  });
+
+  const getTitle = computed(() => (!unref(isUpdate) ? '成绩录入' : '成绩录入'));
+  const handleSubmit = async () => {
+    try {
+      setModalProps({ confirmLoading: true });
+      const dataSource = getDataSource();
+      const postData: Recordable[] = [];
+
+      dataSource.forEach((item) => {
+        if (item.score > 0 || item.classRanking > 0 || item.gradeRanking > 0) {
+          postData.push({
+            id: item.id,
+            score: item.score || 0,
+            classRanking: item.classRanking || 0,
+            gradeRanking: item.gradeRanking || 0,
+          });
+        }
+      });
+
+      if (postData.length > 0) {
+        await putXycxeduExamSubjectScore(postData);
+        closeModal();
+        emit('success');
+      } else {
+        createMessage.success('请输入成绩');
+      }
+    } finally {
+      setModalProps({ confirmLoading: false });
+    }
+  };
+
+  const handelImport = () => {
+    const postData = getForm().getFieldsValue();
+    Object.assign(postData, { examSubjectScoreEnterId: unref(modelRef).id });
+    openImportModal(true, {
+      baseData: {
+        title: '导入学生成绩',
+        upload: postExamSubjectScoreEnterImport,
+        params: { id: unref(modelRef).id },
+        errorName: '学生成绩错误',
+        download: postExamSubjectScoreEnterExportQuery,
+        downloadParams: { ...postData },
+        // templatePath:
+        //   'https://zhxy.cqtlzjzx.com/minio/static/resources/%E5%AD%A6%E7%94%9F%E6%88%90%E7%BB%A9%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF-%E5%AD%A6%E7%94%9F%E7%A7%91%E7%9B%AE%E6%88%90%E7%BB%A9.xlsx',
+        templateName: '学生成绩导入模板',
+      },
+    });
+  };
+
+  const handleSuccess = () => {
+    reload();
+  };
+</script>
+
+<style scoped lang="less"></style>

+ 18 - 5
src/views/educational/studentScore/enter/index.vue

@@ -9,7 +9,7 @@
           :actions="[
             {
               label: '录入成绩',
-              onClick: handleEdit.bind(null, record, true),
+              onClick: handleEnter.bind(null, record),
             },
             {
               label: '删除',
@@ -21,6 +21,7 @@
       </template>
     </BasicTable>
     <FormEdit @register="registerModal" @success="handleSuccess" />
+    <FormDetailEdit @register="registerDetailModal" />
   </PageWrapper>
 </template>
 
@@ -32,12 +33,17 @@
   import { useModal } from '/@/components/Modal';
   import { useMessage } from '/@/hooks/web/useMessage';
   import FormEdit from './edit.vue';
-  import { deleteXycxeduExamPlan, getExamPlanPage } from '/@/services/apis/ExamPlanController';
+  import FormDetailEdit from './editForm.vue';
+  import {
+    getExamSubjectScoreEnterPage,
+    deleteXycxeduExamSubjectScoreEnter,
+  } from '/@/services/apis/ExamSubjectScoreEnterController';
 
   const [registerModal, { openModal }] = useModal();
+  const [registerDetailModal, { openModal: openDetailModal }] = useModal();
 
   const [registerTable, { reload }] = useTable({
-    api: getExamPlanPage,
+    api: getExamSubjectScoreEnterPage,
     title: '考试记录表',
     rowKey: 'id',
     columns: tableColumns,
@@ -67,7 +73,7 @@
       content: '是否删除该记录?',
       onOk: async () => {
         try {
-          await deleteXycxeduExamPlan([record.id]);
+          await deleteXycxeduExamSubjectScoreEnter([record.id]);
           createMessage.success('删除成功');
           await reload();
         } catch (e) {
@@ -87,7 +93,14 @@
       },
     });
   };
-
+  const handleEnter = (record: any) => {
+    openDetailModal(true, {
+      isUpdate: true,
+      baseData: {
+        ...record,
+      },
+    });
+  };
   const handleSuccess = async () => {
     await reload();
   };

+ 11 - 2
src/views/sys/import/index.vue

@@ -4,7 +4,7 @@
   import { Upload } from 'ant-design-vue';
   import { ref } from 'vue';
   import { useMessage } from '/@/hooks/web/useMessage';
-  import { baseDownloadFileUrl } from '/@/utils/file/download';
+  import { baseDownloadFileUrl, downloadByData } from '/@/utils/file/download';
   import { jsonToSheetXlsx } from '/@/components/Excel';
   import { Recordable } from 'vite-plugin-mock';
 
@@ -50,6 +50,15 @@
   const handleDonwmLoad = async () => {
     if (modelRef.value.templatePath) {
       await baseDownloadFileUrl(modelRef.value.templatePath, `${modelRef.value.templateName}.xlsx`);
+    } else if (modelRef.value.download) {
+      const downloadData = await modelRef.value.download({
+        ...(modelRef.value.downloadParams || {}),
+      });
+      downloadByData(
+        downloadData.data,
+        `${modelRef.value.templateName}.xlsx`,
+        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+      );
     }
   };
 </script>
@@ -66,7 +75,7 @@
     @cancel="handleCancel"
   >
     <div class="flex flex-col">
-      <div class="flex items-center" v-if="modelRef.templatePath">
+      <div class="flex items-center" v-if="modelRef.templatePath || modelRef.download">
         <div class="text-[16px] text-[1000]">下载导入模板</div>
         <a-button type="primary" class="w-[110px] ml-[12px]" @click="handleDonwmLoad">
           下载模板