2 Commits ae63acca7c ... f79b3ca7ff

Author SHA1 Message Date
  dsy f79b3ca7ff Merge branch 'master' of http://60.205.254.193:3000/GCLS/eep_page 1 day ago
  dsy b832ae14f9 问题修改 1 day ago

+ 40 - 2
src/components/CommonPreview.vue

@@ -25,6 +25,14 @@
             "
             >完成选择</span
           >
+          <span
+            class="link"
+            @click="
+              groupShowAll = false;
+              isShowGroup = false;
+            "
+            >完成选择</span
+          >
         </div>
         <span
           v-else
@@ -72,12 +80,19 @@
         <div class="courseware-tree">
           <div
             v-for="{ id: nodeId, name, status_name, deep, is_leaf_chapter } in node_list"
+            v-for="{ id: nodeId, name, status_name, deep, is_leaf_chapter } in node_list"
+          :key="nodeId"
             :key="nodeId"
+            <div
             :class="['menu-item', { active: curSelectId === nodeId }, { courseware: isTrue(is_leaf_chapter) }]"
             :style="computedNameStyle(deep, isTrue(is_leaf_chapter))"
             @click="selectChapterNode(nodeId, isTrue(is_leaf_chapter))"
           >
-            <span class="name nowrap-ellipsis" :title="name">
+            <span
+              class="name nowrap-ellipsis"
+              :title="name"
+              :style="{ color: computedNameColor(status_name, is_leaf_chapter, nodeId) }"
+            >
               {{ name }}
             </span>
             <span v-if="['audit', 'edit_preview'].includes(type)" class="status">{{ status_name }}</span>
@@ -1058,7 +1073,7 @@ export default {
      * 打开选择语言弹窗
      */
     openTranslate(params) {
-      //  this.visibleTranslate = true;
+      // this.visibleTranslate = true;
       if (params && params.type) this.drawerType = Number(params.type);
     },
     /**
@@ -1266,6 +1281,29 @@ export default {
       };
     },
     /**
+     * 计算章节名称颜色
+     * @param {string} statusName - 章节状态名称
+     * @param {boolean} is_leaf_chapter - 是否是叶子章节
+     * @param {string} nodeId - 节点ID
+     * @returns {string} - 颜色值
+     */
+    computedNameColor(statusName, is_leaf_chapter, nodeId) {
+      if (!isTrue(is_leaf_chapter)) {
+        return '';
+      }
+      if (this.courseware_info.is_can_start_edit === 'false') {
+        return '';
+      }
+      if (this.curSelectId === nodeId) {
+        return '#4095e5';
+      }
+      let color = '#74b9ff';
+      if (statusName === '审核通过') {
+        color = '#27ae60';
+      }
+      return color;
+    },
+    /**
      * 切换左侧导航栏显示与隐藏
      */
     toggleNavigationShow() {

+ 2 - 2
src/views/book/components/MultilingualFill.vue

@@ -120,6 +120,7 @@ export default {
           }));
         }
       },
+      immediate: true,
     },
   },
   created() {
@@ -162,9 +163,8 @@ export default {
         from: 'zh',
         to: this.curLang.toLowerCase(),
       }).then(({ trans_list }) => {
-        console.log(trans_list);
         if (trans_list.length > 0) {
-          const transText = trans_list[0].dst;
+          const transText = trans_list.map((item) => item.dst).join('\n');
           const curLangItem = this.selectedLangList.find((item) => item.type === this.curLang);
           if (curLangItem) {
             curLangItem.translation = transText;

+ 1 - 1
src/views/book/courseware/create/components/question/input/Input.vue

@@ -7,7 +7,7 @@
         toolbar="fontselect fontsizeselect alignleft aligncenter alignright forecolor backcolor"
         :font-size="data?.unified_attrib?.font_size"
         :font-family="data?.unified_attrib?.font"
-        placeholder="请输入内容"
+        placeholder="占位"
       />
 
       <el-button class="btn" @click="openMultilingual">多语言</el-button>

+ 88 - 88
src/views/book/courseware/data/bookType.js

@@ -137,14 +137,6 @@ export const bookTypeOption = [
         preview: DescribePreview,
       },
       {
-        value: 'audio',
-        label: '音频',
-        icon: 'audio',
-        component: AudioPage,
-        set: AudioSetting,
-        preview: AudioPreview,
-      },
-      {
         value: 'picture',
         label: '图片',
         icon: 'picture',
@@ -153,6 +145,14 @@ export const bookTypeOption = [
         preview: PicturePreview,
       },
       {
+        value: 'audio',
+        label: '音频',
+        icon: 'audio',
+        component: AudioPage,
+        set: AudioSetting,
+        preview: AudioPreview,
+      },
+      {
         value: 'video',
         label: '视频',
         icon: 'video',
@@ -161,48 +161,16 @@ export const bookTypeOption = [
         preview: VideoPreview,
       },
       {
-        value: 'input',
-        label: '输入',
-        icon: 'input',
-        component: Input,
-        set: InputSetting,
-        preview: InputPreview,
-      },
-      {
-        value: 'write_base',
-        label: '写字',
-        icon: 'write_base',
-        component: WriteBase,
-        set: WriteBaseSetting,
-        preview: WriteBasePreview,
-      },
-      {
-        value: 'record_input',
-        label: '录音',
-        icon: 'record_input',
-        component: RecordInput,
-        set: RecordInputSetting,
-        preview: RecordInputPreview,
-      },
-      {
-        value: 'upload_control',
-        label: '上传',
-        icon: 'uploadControl',
-        component: UploadControl,
-        set: UploadControlSetting,
-        preview: UploadControlPreview,
+        value: 'notes',
+        label: '注释',
+        icon: 'notes',
+        component: Notes,
+        set: NotesSetting,
+        preview: NotesPreview,
       },
-      // {
-      //   value: 'upload_preview',
-      //   label: '上传',
-      //   icon: 'uploadPreviews',
-      //   component: UploadPreview,
-      //   set: UploadRreviewSetting,
-      //   preview: UploadPreviewPreview,
-      // },
       {
         value: 'drawing',
-        label: '趣味画板',
+        label: '画板',
         icon: 'drawing',
         component: Drawing,
         set: DrawingSetting,
@@ -210,7 +178,7 @@ export const bookTypeOption = [
       },
       {
         value: 'image_text',
-        label: '图文融合',
+        label: '图片热区',
         icon: 'image_text',
         component: ImageText,
         set: ImageTextSetting,
@@ -240,22 +208,6 @@ export const bookTypeOption = [
         set: H5GamesSetting,
         preview: H5GamesPreview,
       },
-      // {
-      //   value: 'spacing',
-      //   label: '间距',
-      //   icon: 'spacing',
-      //   component: SpacingPage,
-      //   set: SpacingSetting,
-      //   preview: SpacingPreview,
-      // },
-      // {
-      //   value: 'character_base',
-      //   label: '汉字',
-      //   icon: 'chineseCharacter',
-      //   component: CharacterBase,
-      //   set: CharacterBaseSetting,
-      //   preview: CharacterBasePreview,
-      // },
       {
         value: 'label',
         label: '标签',
@@ -272,6 +224,30 @@ export const bookTypeOption = [
         set: DividerSetting,
         preview: DividerPreview,
       },
+      // {
+      //   value: 'upload_preview',
+      //   label: '上传',
+      //   icon: 'uploadPreviews',
+      //   component: UploadPreview,
+      //   set: UploadRreviewSetting,
+      //   preview: UploadPreviewPreview,
+      // },
+      // {
+      //   value: 'spacing',
+      //   label: '间距',
+      //   icon: 'spacing',
+      //   component: SpacingPage,
+      //   set: SpacingSetting,
+      //   preview: SpacingPreview,
+      // },
+      // {
+      //   value: 'character_base',
+      //   label: '汉字',
+      //   icon: 'chineseCharacter',
+      //   component: CharacterBase,
+      //   set: CharacterBaseSetting,
+      //   preview: CharacterBasePreview,
+      // },
     ],
   },
   {
@@ -303,6 +279,22 @@ export const bookTypeOption = [
         preview: CharacterPreview,
       },
       {
+        value: 'newWord_template',
+        label: '生字',
+        icon: 'newWord_template',
+        component: NewWordTemplate,
+        set: NewWordTemplateSetting,
+        preview: NewWordTemplatePreview,
+      },
+      {
+        value: 'character_structure',
+        label: '汉字结构',
+        icon: 'character_structure',
+        component: CharacterStructure,
+        set: CharacterStructureSetting,
+        preview: CharacterStructurePreview,
+      },
+      {
         value: 'new_word',
         label: '生词表',
         icon: 'new_word',
@@ -333,6 +325,38 @@ export const bookTypeOption = [
     label: '练习组件',
     children: [
       {
+        value: 'input',
+        label: '输入',
+        icon: 'input',
+        component: Input,
+        set: InputSetting,
+        preview: InputPreview,
+      },
+      {
+        value: 'write_base',
+        label: '写字',
+        icon: 'write_base',
+        component: WriteBase,
+        set: WriteBaseSetting,
+        preview: WriteBasePreview,
+      },
+      {
+        value: 'record_input',
+        label: '录音',
+        icon: 'record_input',
+        component: RecordInput,
+        set: RecordInputSetting,
+        preview: RecordInputPreview,
+      },
+      {
+        value: 'upload_control',
+        label: '上传',
+        icon: 'uploadControl',
+        component: UploadControl,
+        set: UploadControlSetting,
+        preview: UploadControlPreview,
+      },
+      {
         value: 'select',
         label: '选择题',
         icon: 'select',
@@ -372,14 +396,6 @@ export const bookTypeOption = [
         set: SortSetting,
         preview: SortPreview,
       },
-      {
-        value: 'notes',
-        label: '注释',
-        icon: 'notes',
-        component: Notes,
-        set: NotesSetting,
-        preview: NotesPreview,
-      },
       // {
       //   value: 'other_word',
       //   label: '其他词汇',
@@ -388,22 +404,6 @@ export const bookTypeOption = [
       //   set: OtherWordSetting,
       //   preview: OtherWordPreview,
       // },
-      {
-        value: 'newWord_template',
-        label: '生字',
-        icon: 'newWord_template',
-        component: NewWordTemplate,
-        set: NewWordTemplateSetting,
-        preview: NewWordTemplatePreview,
-      },
-      {
-        value: 'character_structure',
-        label: '汉字结构',
-        icon: 'character_structure',
-        component: CharacterStructure,
-        set: CharacterStructureSetting,
-        preview: CharacterStructurePreview,
-      },
       // {
       //   value: 'write',
       //   label: '书写',