Parcourir la source

feat:修改新生

DESKTOP-USV654P\pc il y a 5 mois
Parent
commit
6a0605fd01

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

@@ -0,0 +1,37 @@
+// @ts-ignore
+/* eslint-disable */
+
+// 该文件自动生成,请勿手动修改!
+import { defHttp } from '/@/utils/http/axios';
+import { ErrorMessageMode } from '/#/axios';
+            // --------------------------------------------------------------------------
+            // Base New Student Controller
+            // --------------------------------------------------------------------------
+
+            ;
+
+
+            /** 新增新生维护信息 POST /student/baseNewStudent */
+export async function postStudentBaseNewStudent(params:API.AddBaseNewStudentDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.post<any>
+        ({url: '/student/baseNewStudent', data:params},{errorMessageMode:mode});}
+/** 修改新生维护信息 PUT /student/baseNewStudent */
+export async function putStudentBaseNewStudent(params:API.UpdateBaseNewStudentDto
+,mode: ErrorMessageMode = 'modal'){ return defHttp.put<any>
+        ({url: '/student/baseNewStudent', data:params},{errorMessageMode:mode});}
+/** 删除新生维护信息 DELETE /student/baseNewStudent */
+export async function deleteStudentBaseNewStudent(params:string[],mode: ErrorMessageMode = 'modal'){ return defHttp.delete<any>
+        ({url: '/student/baseNewStudent', data:params},{errorMessageMode:mode});}
+/** 导入 POST /student/baseNewStudent/import */
+export async function postBaseNewStudentImport(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.post<any>
+        ({url: '/student/baseNewStudent/import',headers:{'Content-Type':'multipart/form-data'}, data:params},{errorMessageMode:mode});}
+/** 根据id查询新生维护信息信息 GET /student/baseNewStudent/info */
+export async function getBaseNewStudentInfo(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.BaseNewStudentVo>
+        ({url: '/student/baseNewStudent/info', params:params},{errorMessageMode:mode});}
+/** 新生维护信息列表(分页) GET /student/baseNewStudent/page */
+export async function getBaseNewStudentPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.BaseNewStudentPageVo>>
+        ({url: '/student/baseNewStudent/page', params:params},{errorMessageMode:mode});}
+/** 新生维护信息树 GET /student/baseNewStudent/tree */
+export async function getBaseNewStudentTree(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.BaseNewStudentTreeVo[]>
+        ({url: '/student/baseNewStudent/tree', params:params},{errorMessageMode:mode});}
+            

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

@@ -100,6 +100,7 @@ import * as ScheduleController from './ScheduleController';
 import * as StatisticsController from './StatisticsController';
 import * as BaseClassMajorSetController from './BaseClassMajorSetController';
 import * as BaseMajorCategorController from './BaseMajorCategorController';
+import * as BaseNewStudentController from './BaseNewStudentController';
 import * as BaseStudentAssessmentItemController from './BaseStudentAssessmentItemController';
 import * as BaseStudentBehaviorManageController from './BaseStudentBehaviorManageController';
 import * as BaseStudentBursariesApplicantController from './BaseStudentBursariesApplicantController';
@@ -387,6 +388,8 @@ StatisticsController,
 BaseClassMajorSetController,
 /** Base Major Categor Controller */
 BaseMajorCategorController,
+/** Base New Student Controller */
+BaseNewStudentController,
 /** Base Student Assessment Item Controller */
 BaseStudentAssessmentItemController,
 /** Base Student Behavior Manage Controller */

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

@@ -433,6 +433,42 @@ name?: string;
 remark?: string;
 }
 
+type AddBaseNewStudentDto = {
+/** 身份证号 */
+credentialNumber?: string;
+/** 招生计划id(enrollment_plan) */
+enrollmentPlanId?: string;
+/** 第一志愿 */
+firstAmbition?: string;
+/** 性别 */
+gender?: string;
+/** 毕业班级 */
+graduateClass?: string;
+/** 毕业学校 */
+graduateSchool?: string;
+/** 身高 */
+height?: number;
+/** 是否可调配(0:否,1:是) */
+isAdjust?: number;
+/** 手机号 */
+mobile?: string;
+/** 学生姓名 */
+name?: string;
+/** 成绩 */
+score?: number;
+/** 第二志愿 */
+secondAmbition?: string;
+sortCode?: number;
+/** 学生来源 */
+source?: string;
+/** 班级状态(0:未分配, 1:已分配) */
+status?: number;
+/** 住宿类型 */
+stduyStatus?: string;
+/** 体重 */
+weight?: number;
+}
+
 type AddBasePersonnelLabourCapitalDto = {
 /** 发放年月 */
 dateOfIssue?: string;
@@ -4635,6 +4671,93 @@ isSelect?: number;
 majorGradationIdCn?: string;
 }
 
+type BaseNewStudentPageVo = {
+createDate?: string;
+/** 身份证号 */
+credentialNumber?: string;
+/** 第一志愿 */
+firstAmbition?: string;
+/** 性别 */
+gender?: string;
+/** 性别中文 */
+genderCn?: string;
+/** 毕业班级 */
+graduateClass?: string;
+/** 毕业学校 */
+graduateSchool?: string;
+/** 身高 */
+height?: number;
+id?: string;
+/** 是否可调配(0:否,1:是) */
+isAdjust?: number;
+/** 手机号 */
+mobile?: string;
+/** 学生姓名 */
+name?: string;
+/** 成绩 */
+score?: number;
+/** 第二志愿 */
+secondAmbition?: string;
+/** 学生来源 */
+source?: string;
+/** 班级状态(0:未分配, 1:已分配) */
+status?: number;
+/** 住宿类型 */
+stduyStatus?: string;
+/** 住宿类型中文 */
+stduyStatusCn?: string;
+/** 体重 */
+weight?: number;
+}
+
+type BaseNewStudentTreeVo = {
+/** children */
+children?: BaseNewStudentTreeVo[];
+/** id */
+id?: string;
+/** name */
+name?: string;
+/** disabled */
+parentId?: string;
+/** 类型(1:年级,2:春秋季) */
+treeType?: number;
+}
+
+type BaseNewStudentVo = {
+/** 身份证号 */
+credentialNumber?: string;
+/** 第一志愿 */
+firstAmbition?: string;
+/** 性别 */
+gender?: string;
+/** 毕业班级 */
+graduateClass?: string;
+/** 毕业学校 */
+graduateSchool?: string;
+/** 身高 */
+height?: number;
+id?: string;
+/** 是否可调配(0:否,1:是) */
+isAdjust?: number;
+/** 手机号 */
+mobile?: string;
+/** 学生姓名 */
+name?: string;
+/** 成绩 */
+score?: number;
+/** 第二志愿 */
+secondAmbition?: string;
+sortCode?: number;
+/** 学生来源 */
+source?: string;
+/** 班级状态(0:未分配, 1:已分配) */
+status?: number;
+/** 住宿类型 */
+stduyStatus?: string;
+/** 体重 */
+weight?: number;
+}
+
 type BaseOfficeBuildChangeStatusDto = {
 /** 主键编号 */
 id?: string;
@@ -9911,6 +10034,14 @@ total?: number;
 totalPage?: number;
 }
 
+type PageOutput<BaseNewStudentPageVo> = {
+currentPage?: number;
+list?: BaseNewStudentPageVo[];
+pageSize?: number;
+total?: number;
+totalPage?: number;
+}
+
 type PageOutput<BasePersonnelLabourCapitalMonthPageVo> = {
 currentPage?: number;
 list?: BasePersonnelLabourCapitalMonthPageVo[];
@@ -14743,6 +14874,43 @@ name?: string;
 remark?: string;
 }
 
+type UpdateBaseNewStudentDto = {
+/** 身份证号 */
+credentialNumber?: string;
+/** 招生计划id(enrollment_plan) */
+enrollmentPlanId?: string;
+/** 第一志愿 */
+firstAmbition?: string;
+/** 性别 */
+gender?: string;
+/** 毕业班级 */
+graduateClass?: string;
+/** 毕业学校 */
+graduateSchool?: string;
+/** 身高 */
+height?: number;
+id?: string;
+/** 是否可调配(0:否,1:是) */
+isAdjust?: number;
+/** 手机号 */
+mobile?: string;
+/** 学生姓名 */
+name?: string;
+/** 成绩 */
+score?: number;
+/** 第二志愿 */
+secondAmbition?: string;
+sortCode?: number;
+/** 学生来源 */
+source?: string;
+/** 班级状态(0:未分配, 1:已分配) */
+status?: number;
+/** 住宿类型 */
+stduyStatus?: string;
+/** 体重 */
+weight?: number;
+}
+
 type UpdateBasePersonnelLabourCapitalDto = {
 /** 发放年月 */
 dateOfIssue?: string;

+ 270 - 33
src/views/educational/basicInformation/components/data.config.ts

@@ -1,71 +1,241 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
 import { requestMagicApi } from '/@/api/magicApi';
-export const TableColumns: BasicColumn[] = [
+import { getMajorSetOption } from '/@/api/userMagic';
+import { getDataOption } from '/@/api/system/dic';
+export const tableColumns: BasicColumn[] = [
   {
     title: '毕业学校',
-    dataIndex: 's',
+    dataIndex: 'graduateSchool',
+    align: 'left',
   },
   {
     title: '学生姓名',
-    dataIndex: 'studentName',
+    dataIndex: 'name',
+    align: 'left',
+    width: 100,
   },
   {
-    title: '姓名',
-    dataIndex: 'sex',
+    title: '性别',
+    dataIndex: 'genderCn',
+    align: 'left',
+    width: 80,
   },
   {
     title: '身份证号码',
-    dataIndex: 'idCard',
+    dataIndex: 'credentialNumber',
+    align: 'left',
+    width: 150,
   },
   {
     title: '身高(CM)',
     dataIndex: 'height',
+    align: 'left',
+    width: 100,
   },
   {
     title: '体重(KG)',
     dataIndex: 'weight',
+    align: 'left',
+    width: 100,
   },
   {
     title: '成绩',
     dataIndex: 'score',
+    align: 'left',
+    width: 80,
   },
   {
-    title: '初中毕业班级',
-    dataIndex: 'grade',
+    title: '毕业班级',
+    dataIndex: 'graduateClass',
+    align: 'left',
+    width: 80,
   },
   {
     title: '学生来源',
     dataIndex: 'source',
+    align: 'left',
+    width: 100,
   },
   {
     title: '住宿类型',
-    dataIndex: 'source',
+    dataIndex: 'stduyStatusCn',
+    align: 'left',
+    width: 100,
   },
   {
     title: '手机号',
-    dataIndex: 'source',
+    dataIndex: 'mobile',
+    align: 'left',
+    width: 100,
   },
   {
     title: '第一志愿',
-    dataIndex: 'source',
+    dataIndex: 'firstAmbition',
+    align: 'left',
+    width: 120,
   },
   {
     title: '第二志愿',
-    dataIndex: 'source',
+    dataIndex: 'secondAmbition',
+    align: 'left',
+    width: 120,
   },
   {
     title: '班级状态',
-    dataIndex: 'source',
-  },
-  {
-    title: '操作',
-    dataIndex: 'action',
+    dataIndex: 'status',
+    align: 'left',
     width: 100,
-    fixed: 'right',
-    slots: { customRender: 'action' },
+    customRender: ({ record }) => {
+      return record.status === 1 ? '已分配' : '未分配';
+    },
   },
 ];
+
 export const formSchema: FormSchema[] = [
+  {
+    label: '学生姓名',
+    field: 'name',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+  },
+  {
+    label: '性别',
+    field: 'gender',
+    required: true,
+    colProps: { span: 8 },
+    component: 'ApiSelect',
+    componentProps: {
+      api: getDataOption,
+      params: { code: 'gender' },
+      getPopupContainer: () => document.body,
+    },
+  },
+  {
+    label: '身份证号',
+    field: 'credentialNumber',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+  },
+  {
+    label: '身高',
+    field: 'height',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+    componentProps: {
+      suffix: 'CM',
+    },
+  },
+  {
+    label: '体重',
+    field: 'weight',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+    componentProps: {
+      suffix: 'KG',
+    },
+  },
+  {
+    label: '手机号',
+    field: 'mobile',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+  },
+  {
+    label: '家长联系电话',
+    field: 'gradeId',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+  },
+  {
+    label: '毕业学校',
+    field: 'graduateSchool',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+  },
+  {
+    label: '毕业班级',
+    field: 'graduateClass',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+  },
+  {
+    label: '学生来源',
+    field: 'source',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Input',
+  },
+  {
+    label: '家庭地址',
+    field: 'gradeId',
+    colProps: { span: 16 },
+    component: 'Input',
+  },
+  {
+    label: '第一志愿',
+    field: 'firstAmbition',
+    required: true,
+    colProps: { span: 8 },
+    component: 'ApiSelect',
+    componentProps: {
+      api: getMajorSetOption,
+      getPopupContainer: () => document.body,
+    },
+  },
+  {
+    label: '第二志愿',
+    field: 'secondAmbition',
+    required: true,
+    colProps: { span: 8 },
+    component: 'ApiSelect',
+    componentProps: {
+      api: getMajorSetOption,
+      getPopupContainer: () => document.body,
+    },
+  },
+  {
+    label: '专业调配',
+    field: 'isAdjust',
+    required: true,
+    colProps: { span: 8 },
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '否', value: 0 },
+        { label: '是', value: 1 },
+      ],
+    },
+  },
+  {
+    label: '住宿类型',
+    field: 'stduyStatus',
+    required: true,
+    colProps: { span: 8 },
+    component: 'ApiSelect',
+    componentProps: {
+      api: getDataOption,
+      params: { code: 'stduy_status' },
+      getPopupContainer: () => document.body,
+    },
+  },
+  {
+    label: '成绩',
+    field: 'score',
+    required: true,
+    colProps: { span: 8 },
+    component: 'InputNumber',
+  },
+];
+
+export const formDivisionSchema: FormSchema[] = [
   {
     label: '年级',
     field: 'gradeId',
@@ -128,35 +298,102 @@ export const formSchema: FormSchema[] = [
     colProps: { span: 24 },
   },
 ];
-export const searchSchema: FormSchema[] = [
+export const searchFormSchema: FormSchema[] = [
   {
     field: 'name',
     label: '学生姓名',
     component: 'Input',
-    colProps: { span: 6 },
+    colProps: { span: 8 },
   },
   {
-    field: 'icCard',
+    field: 'credentialNumber',
     label: '身份证号',
     component: 'Input',
-    colProps: { span: 6 },
+    colProps: { span: 8 },
   },
   {
-    field: 'export',
+    field: 'isImportScore',
     label: '成绩导入',
     component: 'Select',
     componentProps: {
       options: [
-        {
-          label: '未导入',
-          value: '0',
-        },
-        {
-          label: '已导入',
-          value: '1',
-        },
+        { label: '未导入', value: '0' },
+        { label: '已导入', value: '1' },
+      ],
+    },
+    colProps: { span: 8 },
+  },
+  {
+    field: 'firstAmbition',
+    label: '一志愿专业',
+    component: 'ApiSelect',
+    componentProps: {
+      api: getMajorSetOption,
+      getPopupContainer: () => document.body,
+    },
+    colProps: { span: 8 },
+  },
+  {
+    field: 'secondAmbition',
+    label: '二志愿专业',
+    component: 'ApiSelect',
+    componentProps: {
+      api: getMajorSetOption,
+      getPopupContainer: () => document.body,
+    },
+    colProps: { span: 8 },
+  },
+  {
+    field: 'isAdjust',
+    label: '专业调配',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '否', value: '0' },
+        { label: '是', value: '1' },
+      ],
+    },
+    colProps: { span: 8 },
+  },
+  {
+    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 },
+  },
+  {
+    field: 'graduateSchool',
+    label: '毕业学校',
+    component: 'Input',
+    colProps: { span: 8 },
+  },
+  {
+    field: 'gender',
+    label: '性别',
+    component: 'ApiSelect',
+    componentProps: {
+      api: getDataOption,
+      params: { code: 'gender' },
+      getPopupContainer: () => document.body,
+    },
+    colProps: { span: 8 },
+  },
+  {
+    field: 'status',
+    label: '班级状态',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '未分配', value: '0' },
+        { label: '已分配', value: '1' },
       ],
     },
-    colProps: { span: 6 },
+    colProps: { span: 8 },
   },
 ];

+ 0 - 0
src/views/educational/basicInformation/components/formEdit.vue → src/views/educational/basicInformation/components/division.vue


+ 76 - 0
src/views/educational/basicInformation/components/edit.vue

@@ -0,0 +1,76 @@
+<template>
+  <BasicModal
+    @ok="handleSubmit"
+    :destroyOnClose="true"
+    :maskClosable="false"
+    v-bind="$attrs"
+    @register="registerModal"
+    :title="getTitle"
+    :width="1002"
+    showFooter
+  >
+    <BasicForm @register="registerForm" />
+  </BasicModal>
+</template>
+<script setup lang="ts">
+  import { ref, computed, unref } from 'vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, useForm } from '/@/components/Form/index';
+  import { formSchema } from './data.config';
+  import {
+    getBaseNewStudentInfo,
+    postStudentBaseNewStudent,
+    putStudentBaseNewStudent,
+  } from '/@/services/apis/BaseNewStudentController';
+
+  const isUpdate = ref(true);
+  const modelRef = ref({});
+  const emit = defineEmits(['success', 'register']);
+  const { createMessage } = useMessage();
+  const [registerForm, { validate, setFieldsValue, resetFields }] = useForm({
+    labelWidth: 100,
+    schemas: formSchema,
+    showActionButtonGroup: false,
+  });
+
+  const [registerModal, { closeModal, setModalProps }] = useModalInner(async (data) => {
+    resetFields();
+    setModalProps({ confirmLoading: false });
+    isUpdate.value = !!data?.isUpdate;
+    modelRef.value = { ...data.baseData };
+
+    if (unref(isUpdate)) {
+      const resData = await getBaseNewStudentInfo({ id: data.baseData.id });
+
+      modelRef.value = { ...resData };
+      setFieldsValue({
+        ...resData,
+      });
+    }
+  });
+
+  const getTitle = computed(() => (!unref(isUpdate) ? '新增新生' : '编辑新生'));
+  const handleSubmit = async () => {
+    try {
+      const values = await validate();
+      setModalProps({ confirmLoading: true });
+      const postParams = unref(modelRef);
+      Object.assign(postParams, values);
+
+      if (unref(isUpdate)) {
+        await putStudentBaseNewStudent(postParams as API.UpdateBaseNewStudentDto);
+      } else {
+        await postStudentBaseNewStudent(postParams as API.AddBaseNewStudentDto);
+      }
+
+      createMessage.success('操作成功');
+      closeModal();
+      emit('success');
+    } finally {
+      setModalProps({ confirmLoading: false });
+    }
+  };
+</script>
+
+<style scoped lang="less"></style>

+ 4 - 2
src/views/educational/basicInformation/components/achievementImport.vue → src/views/educational/basicInformation/components/import.vue

@@ -14,6 +14,8 @@
   const handleUpdate = async (e) => {
     data.value = e[0];
   };
+
+  const emit = defineEmits(['success', 'register']);
   const handleSubmit = async () => {
     try {
       await postBaseClassCourseImport({ file: data.value }, 'none');
@@ -50,8 +52,8 @@
       <div class="flex flex-col">
         <span class="text-[16px] text-[1000]">1、 下载导入模板</span>
         <a-button type="primary" class="w-[110px] mt-[12px]" @click="handleDonwmLoad">
-          下载模板</a-button
-        >
+          下载模板
+        </a-button>
       </div>
       <div class="mt-[12px]">
         <span class="text-[16px] text-[1000]">2、 上传文件</span>

+ 80 - 0
src/views/educational/basicInformation/components/import1.vue

@@ -0,0 +1,80 @@
+<script setup lang="ts">
+  import BasicModal from '/@/components/Modal/src/BasicModal.vue';
+  import { useModalInner } from '/@/components/Modal';
+  import { Upload } from 'ant-design-vue';
+  import { ref } from 'vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { baseDownloadFileUrl } from '/@/utils/file/download';
+  import { useLoading } from '/@/components/Loading';
+  import { postBaseNewStudentImport } from '/@/services/apis/BaseNewStudentController';
+
+  const errMsg = ref('');
+  const { createMessage } = useMessage();
+
+  const emit = defineEmits(['success', 'register']);
+
+  const [openFullLoading, closeFullLoading] = useLoading({
+    tip: '处理中...',
+  });
+
+  const [registerModal, { setModalProps }] = useModalInner(() => {
+    setModalProps({ confirmLoading: false });
+  });
+
+  const beforeUpload = async (e) => {
+    try {
+      openFullLoading();
+      await postBaseNewStudentImport({ file: e });
+      createMessage.success('导入成功');
+    } catch (err: any) {
+      errMsg.value = err;
+    } finally {
+      closeFullLoading();
+    }
+  };
+
+  const handleCancel = () => {
+    emit('success');
+  };
+
+  const handleDonwmLoad = async () => {
+    await baseDownloadFileUrl(
+      'https://zhxy.cqtlzjzx.com/minio/static/resources/%E7%8F%AD%E7%BA%A7%E8%AF%BE%E7%A8%8B%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx',
+      '学生导入模板.xlsx',
+    );
+  };
+</script>
+
+<template>
+  <BasicModal
+    :destroyOnClose="true"
+    :maskClosable="false"
+    v-bind="$attrs"
+    @register="registerModal"
+    :width="1002"
+    title="新生成绩导入"
+    :footer="null"
+    @cancel="handleCancel"
+  >
+    <div class="flex flex-col">
+      <div class="flex items-center">
+        <div class="text-[16px] text-[1000]">1、 下载导入模板</div>
+        <a-button type="primary" class="w-[110px] ml-[12px]" @click="handleDonwmLoad">
+          下载模板
+        </a-button>
+      </div>
+      <div class="mt-[12px]">
+        <div class="text-[16px] text-[1000] mb-2">2、 上传文件</div>
+        <Upload.Dragger :showUploadList="false" :before-upload="beforeUpload" accept=".xlsx,.xls">
+          <p class="ant-upload-text">单击或拖动文件到此区域进行上传 </p>
+        </Upload.Dragger>
+      </div>
+      <span class="mt-[24px]">导入反馈:</span>
+      <div style="border: 1px solid #ccc; width: 100%; height: 300px; overflow: auto; color: red">
+        {{ errMsg }}
+      </div>
+    </div>
+  </BasicModal>
+</template>
+
+<style scoped lang="less"></style>

+ 51 - 0
src/views/educational/basicInformation/components/tree.vue

@@ -0,0 +1,51 @@
+<template>
+  <div class="mr-2 overflow-hidden bg-white h-full">
+    <BasicTree
+      :title="t('年级列表')"
+      toolbar
+      search
+      :clickRowToExpand="true"
+      :treeData="treeData"
+      :selectedKeys="selectedKeys"
+      expandOnSearch
+      :fieldNames="{ key: 'id', title: 'name' }"
+      @select="handleSelect"
+    />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, onMounted, ref } from 'vue';
+
+  import { BasicTree, TreeItem } from '/@/components/Tree';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { getBaseNewStudentTree } from '/@/services/apis/BaseNewStudentController';
+  const { t } = useI18n();
+  export default defineComponent({
+    name: 'ClassTree',
+    components: { BasicTree },
+
+    emits: ['select'],
+    setup(_, { emit }) {
+      const treeData = ref<TreeItem[]>([]);
+      const selectedKeys = ref<string[]>([]);
+
+      async function fetch() {
+        treeData.value = (await getBaseNewStudentTree({})) as unknown as TreeItem[];
+        let id = treeData.value[0].id;
+        selectedKeys.value.push(id);
+        // emit('select', id);
+      }
+
+      function handleSelect(keys: string, event: Event) {
+        if (event.node.treeType === 2) {
+          emit('select', keys[0]);
+        }
+      }
+
+      onMounted(() => {
+        fetch();
+      });
+      return { treeData, handleSelect, selectedKeys, t };
+    },
+  });
+</script>

+ 62 - 34
src/views/educational/basicInformation/index.vue

@@ -1,53 +1,80 @@
 <script setup lang="ts">
   import { PageWrapper } from '/@/components/Page';
-  import { useTable } from '/@/components/Table';
-  import BasicTable from '/@/components/Table/src/BasicTable.vue';
-  import { searchSchema, TableColumns } from './components/data.config';
-  import TableAction from '/@/components/Table/src/components/TableAction.vue';
-  import { getBaseappfunctionPage } from '/@/services/apis/BaseAppFunctionController';
-  import formEdit from './components/formEdit.vue';
-  import BasicTree from '/@/components/Tree/src/Tree.vue';
-  import achievementImport from './components/achievementImport.vue';
+  import { useTable, BasicTable, TableAction } from '/@/components/Table';
+  import { searchFormSchema, tableColumns } from './components/data.config';
+  import FormEdit from './components/edit.vue';
+  import ClassTree from './components/tree.vue';
+  import FormImport from './components/import.vue';
+  import StudentImport from './components/import1.vue';
   import { useModal } from '/@/components/Modal';
-  const [formReg, { openModal }] = useModal();
-  const [importReg, { openModal: openImportModal }] = useModal();
+  import { reactive } from 'vue';
+  import { getBaseNewStudentPage } from '/@/services/apis/BaseNewStudentController';
+
+  const searchInfo = reactive<Recordable>({});
+
+  const [registerModal, { openModal }] = useModal();
+
+  const [registerImportModal, { openModal: openImportModal }] = useModal();
+
+  const [registerStudentImportModal, { openModal: openStudentImportModal }] = useModal();
+
   const [registerTable, { reload }] = useTable({
-    api: getBaseappfunctionPage,
-    columns: TableColumns,
+    api: getBaseNewStudentPage,
     title: '新生列表',
-    bordered: true,
     rowKey: 'id',
-    showTableSetting: true,
-    beforeFetch: (params) => {
-      return params;
-    },
-    rowSelection: {
-      type: 'checkbox',
-      onChange: (selectedRowKeys, selectedRows) => {
-        console.log(selectedRowKeys, selectedRows);
-      },
-    },
-    useSearchForm: true,
+    columns: tableColumns,
     formConfig: {
       labelWidth: 120,
-      schemas: searchSchema,
+      schemas: searchFormSchema,
+    },
+    useSearchForm: true,
+    showTableSetting: true,
+    bordered: true,
+    immediate: true,
+    canResize: true,
+    actionColumn: {
+      width: 100,
+      title: '操作',
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+      fixed: 'right',
     },
   });
   const handleEdit = (record: any, isUpdate: boolean) => {
-    openModal(true, { ...record, isUpdate: isUpdate });
+    openModal(true, {
+      isUpdate: isUpdate,
+      baseData: {
+        ...record,
+      },
+    });
+  };
+
+  function handleSelect(id) {
+    searchInfo.classId = id;
+    reload();
+  }
+
+  const handleSuccess = async () => {
+    await reload();
+  };
+
+  const handelStudenImport = () => {
+    openStudentImportModal(true, {});
+  };
+  const handelImport = () => {
+    openImportModal(true, {});
   };
 </script>
 
 <template>
   <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
-    <div class="mr-2 overflow-hidden bg-white h-full w-1/4">
-      <BasicTree title="年级列表" search />
-    </div>
-    <BasicTable class="w-3/4" @register="registerTable">
+    <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>
+        <a-button type="primary" @click="handleEdit({}, false)">新增</a-button>
         <a-button type="primary" @click="handleEdit({}, false)">手动分班</a-button>
-        <a-button type="primary" @click="openImportModal(true, {})">成绩导入</a-button>
-        <a-button>导出</a-button>
+        <a-button type="primary" @click="handelStudenImport">学生导入</a-button>
+        <a-button type="primary" @click="handelImport">成绩导入</a-button>
       </template>
       <template #action="{ record }">
         <div style="display: flex; justify-content: center">
@@ -62,8 +89,9 @@
         </div>
       </template>
     </BasicTable>
-    <formEdit @register="formReg" @success="reload" />
-    <achievementImport @register="importReg" />
+    <FormEdit @register="registerModal" @success="handleSuccess" />
+    <FormImport @register="registerImportModal" @success="handleSuccess" />
+    <StudentImport @register="registerStudentImportModal" @success="handleSuccess" />
   </PageWrapper>
 </template>
 

+ 6 - 6
src/views/teachingManager/textbookManagement/components/data.config.ts

@@ -310,9 +310,9 @@ export const formSchema: FormSchema[] = [
     field: 'subjectGroupId',
     component: 'ApiSelect',
     required: true,
-    ifShow: ({ values }) => {
-      return values.textbookType == 't_textbook';
-    },
+    // ifShow: ({ values }) => {
+    //   return values.textbookType == 't_textbook';
+    // },
     componentProps: {
       api: requestMagicApi,
       params: { url: '/educational/subjectGroup/list' },
@@ -324,9 +324,9 @@ export const formSchema: FormSchema[] = [
     field: 'courseSubjectId',
     required: true,
     component: 'ApiSelect',
-    ifShow: ({ values }) => {
-      return values.textbookType == 't_textbook';
-    },
+    // ifShow: ({ values }) => {
+    //   return values.textbookType == 't_textbook';
+    // },
     componentProps: ({ formModel }) => {
       return {
         api: async () => {