Michael Wang 3 rokov pred
rodič
commit
5eba79001b

+ 2 - 1
src/components/CourseTypeSelect.vue

@@ -13,11 +13,12 @@
 </template>
 
 <script setup lang="ts">
+import { Course_Type } from "@/types";
 import { computed } from "vue-demi";
 
 const props = withDefaults(
   defineProps<{
-    value?: "PUBLIC" | "MAJOR";
+    value?: Course_Type;
     disabled?: boolean;
   }>(),
   {

+ 2 - 1
src/features/courseManagement/CourseManagement.vue

@@ -144,6 +144,7 @@ import {
   updateCourse,
 } from "@/api/courseManagementPage";
 import { useMainStore } from "@/store";
+import { Course_Type } from "@/types";
 import { downloadFileURL } from "@/utils/utils";
 import { message, Modal } from "ant-design-vue";
 import { watch, onMounted, ref, reactive, toRaw } from "vue-demi";
@@ -152,7 +153,7 @@ const store = useMainStore();
 store.currentLocation = "基础管理 / 科目管理";
 
 let rootOrgId = $ref(undefined as unknown as number);
-let type = $ref(undefined as unknown as string); // 科目类型
+let type = $ref(undefined as unknown as Course_Type); // 科目类型
 let code = $ref("");
 let name = $ref("");
 let enable = $ref(undefined as undefined | boolean);

+ 2 - 0
src/types/index.ts

@@ -3,3 +3,5 @@ export interface Role {
   roleCode: "ORG_ADMIN" | "SUPER_ADMIN" | "ROOT_ORG_ADMIN" | "COURSE_ADMIN";
   roleName: string;
 }
+
+export type Course_Type = "PUBLIC" | "MAJOR";