Prechádzať zdrojové kódy

科目下拉,显示code

Michael Wang 3 rokov pred
rodič
commit
824a50507d

+ 3 - 3
src/components/CourseSelect.vue

@@ -6,7 +6,7 @@
     :value="valueStr"
     @search="handleSearch"
     @change="handleChange"
-    style="width: 140px"
+    style="width: 200px"
     :filter-option="false"
   >
     <a-select-option
@@ -14,7 +14,7 @@
       :key="index"
       :value="item.id"
     >
-      {{ item.name }}
+      {{ item.name }}({{ item.code }})
     </a-select-option>
   </a-select>
 </template>
@@ -27,7 +27,7 @@ const props =
   defineProps<{ value?: null | number; rootOrgId?: null | number }>();
 const emit = defineEmits(["update:value"]);
 
-let optionList = $ref<{ id: number; name: string }[]>([]);
+let optionList = $ref<{ id: number; name: string; code: string }[]>([]);
 
 watch(
   () => props.rootOrgId,

+ 5 - 3
src/components/ProjectCourseSelect.vue

@@ -6,7 +6,7 @@
     :value="valueStr"
     @search="handleSearch"
     @change="handleChange"
-    style="width: 140px"
+    style="width: 200px"
     :disabled="props.disabled"
     :filter-option="false"
   >
@@ -15,7 +15,7 @@
       :key="index"
       :value="item.courseId"
     >
-      {{ item.courseName }}
+      {{ item.courseName }}({{ item.courseCode }})
     </a-select-option>
   </a-select>
 </template>
@@ -31,7 +31,9 @@ const props = defineProps<{
 }>();
 const emit = defineEmits(["update:value"]);
 
-let optionList = $ref<{ courseId: number; courseName: string }[]>([]);
+let optionList = $ref<
+  { courseId: number; courseName: string; courseCode: string }[]
+>([]);
 
 onMounted(fetchData);
 async function fetchData(searchStr = "") {