Kaynağa Gözat

选择课件时对 eep 类型宽度进行处理

dsy 4 hafta önce
ebeveyn
işleme
11bde6ecf2
1 değiştirilmiş dosya ile 27 ekleme ve 5 silme
  1. 27 5
      src/components/select/SelectCourse.vue

+ 27 - 5
src/components/select/SelectCourse.vue

@@ -1,5 +1,11 @@
 <template>
-  <el-dialog class="select-course" :visible="dialogVisible" width="1100px" :title="$t('Key373')" @close="dialogClose">
+  <el-dialog
+    class="select-course"
+    :visible="dialogVisible"
+    :width="dialogWidth"
+    :title="$t('Key373')"
+    @close="dialogClose"
+  >
     <div>
       <el-dropdown trigger="click" placement="top" @command="selectBook">
         <span class="el-dropdown-link">{{ curBook.book_name }} <i class="el-icon-arrow-down"></i></span>
@@ -15,10 +21,7 @@
       <div class="content-structure-tree">
         <TreeMenus ref="tree" :current-course="currentCourse" :list="nodes" @curCourse="curCourse" />
       </div>
-      <div
-        class="content-structure-container"
-        :style="{ 'min-width': `${category === 'NPC' || category === 'NNPE' ? '885px' : ''}` }"
-      >
+      <div class="content-structure-container" :style="{ 'min-width': minWidth }">
         <template v-if="category === 'NPC'">
           <booknpc
             v-if="context"
@@ -126,6 +129,25 @@ let currentCourse = ref('');
 let courseID = computed(() => currentCourse.value);
 let book_list = ref([]);
 let nodes = ref([]);
+let minWidth = computed(() => {
+  if (['NPC', 'NNPE'].includes(category.value)) {
+    return '885px';
+  }
+  if (category.value === 'EEP') {
+    return '1270px';
+  }
+  return '';
+});
+
+let dialogWidth = computed(() => {
+  if (['NPC', 'NNPE'].includes(category.value)) {
+    return '1100px';
+  }
+  if (category.value === 'EEP') {
+    return '1500px';
+  }
+  return '1100px';
+});
 
 watch(
   () => curBook.value,