瀏覽代碼

Merge branch 'master' of http://gcls-git.helxsoft.cn/GCLS/eep_page

dusenyao 3 天之前
父節點
當前提交
5b185549a3

+ 1 - 0
src/icons/svg/icon-edit.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1751255525990" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5259" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M474.58679343 587.16868738c-11.45302241 0-22.90604486-4.37057868-31.6472022-13.11173601-17.48231469-17.48231469-17.48231469-45.83841849 0-63.29440437l487.24053555-487.24053552c17.48231469-17.48231469 45.81208967-17.48231469 63.29440431 0 17.48231469 17.48231469 17.48231469 45.83841849 0 63.29440441L506.23399561 574.05695137a44.61676276 44.61676276 0 0 1-31.64720218 13.11173601z" fill="#2c2c2c" p-id="5260"></path><path d="M904.16728498 1017.19676833h-781.96497912c-62.68884228 0-113.68770304-50.99886074-113.68770305-113.71403181v-781.96497913c0-62.71517108 50.99886074-113.71403182 113.66137425-113.71403185l457.51533479 0.0263288c24.72273117 0 44.75893818 20.03620706 44.75893819 44.7589382s-20.03620706 44.75893818-44.75893819 44.7589382l-457.51533479-0.02632877c-13.2960375 0-24.14349786 10.84746035-24.14349785 24.16982661v781.96497915c0 13.32236631 10.84746035 24.1698266 24.16982665 24.16982664h781.96497912c13.32236631 0 24.1698266-10.84746035 24.16982668-24.16982664V403.42008173c0-24.72273117 20.06253583-44.75893818 44.75893815-44.75893828 24.72273117 0 44.75893818 20.03620706 44.7589382 44.75893828V903.50906532c0 62.68884228-50.99886074 113.68770304-113.68770303 113.68770301z" fill="#2c2c2c" p-id="5261"></path></svg>

+ 1 - 0
src/icons/svg/icon-save.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1751265545159" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7114" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1001.772663 328.213557C899.780869 226.221763 797.787268 124.217325 695.779218 22.227337A75.81245 75.81245 0 0 0 642.163399 0H75.844961C33.95512 0 0 33.969569 0 75.859411V948.138783c0 41.907904 33.95512 75.861217 75.844961 75.861217h872.308271c41.875392 0 75.844961-33.953313 75.844962-75.861217V381.845632a75.843155 75.843155 0 0 0-22.225531-53.632075zM246.511026 75.859411H474.078422v132.742681H246.511026V75.859411zM777.487168 948.138783H246.511026V468.583903H777.487168V948.138783z m170.666064 0h-94.821103V430.660519c0-20.953952-16.985688-37.937834-37.92519-37.937834h-606.817491c-20.937696 0-37.921578 16.985688-37.921577 37.937834V948.138783H75.846768V75.859411h94.821103v170.664259c0 20.93589 16.983882 37.921578 37.921577 37.921577h303.410552c20.937696 0 37.921578-16.985688 37.921578-37.921577V75.859411h92.241821c101.991794 101.989988 203.981783 203.979976 305.99164 305.984415l-0.001807 566.294957z" fill="#231815" p-id="7115"></path></svg>

+ 17 - 13
src/views/book/courseware/create/components/question/new_word/NewWord.vue

@@ -10,7 +10,7 @@
           toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
         />
       </div>
-      <el-table :data="data.option" border style="width: 100%">
+      <el-table :data="data.new_word_list" border style="width: 100%">
         <el-table-column fixed prop="number" label="序号" width="70">
           <template slot-scope="scope">
             <el-input v-model="scope.row.number" />
@@ -245,47 +245,51 @@ export default {
       this.data.lrc_arr = [];
     },
     uploads(file_id, index) {
-      this.data.option[index].mp3_list = file_id;
+      this.data.new_word_list[index].mp3_list = file_id;
     },
     deleteFiles(file_id, index) {
-      this.data.option[index].mp3_list = '';
+      this.data.new_word_list[index].mp3_list = '';
     },
     uploadPic(file_id, index) {
-      this.data.option[index].file_list[0] = file_id;
+      this.data.new_word_list[index].file_list[0] = file_id;
     },
     deletePic(file_id, index) {
-      this.data.option[index].file_list[0] = '';
+      this.data.new_word_list[index].file_list[0] = '';
     },
     // 自动生成音频
     handleMatic(index) {
       GetStaticResources('tool-TextToVoiceFile', {
-        text: this.data.option[index].new_word.replace(/<[^>]+>/g, ''),
+        text: this.data.new_word_list[index].new_word.replace(/<[^>]+>/g, ''),
       })
         .then(({ status, file_id }) => {
           if (status === 1) {
-            this.data.option[index].mp3_list = file_id;
+            this.data.new_word_list[index].mp3_list = file_id;
           }
         })
         .catch(() => {});
     },
     // 删除行
     handleDelete(index) {
-      this.data.option.splice(index, 1);
+      this.data.new_word_list.splice(index, 1);
     },
     // 上移下移
     moveElement(dItem, index, type) {
       let obj = JSON.parse(JSON.stringify(dItem));
       if (type == 'up' && index > 0) {
-        this.data.option.splice(index - 1, 0, obj);
-        this.data.option.splice(index + 1, 1);
+        this.data.new_word_list.splice(index - 1, 0, obj);
+        this.data.new_word_list.splice(index + 1, 1);
       }
-      if (type == 'down' && index < this.data.option.length - 1) {
-        this.data.option[index] = this.data.option.splice(index + 1, 1, this.data.option[index])[0];
+      if (type == 'down' && index < this.data.new_word_list.length - 1) {
+        this.data.new_word_list[index] = this.data.new_word_list.splice(
+          index + 1,
+          1,
+          this.data.new_word_list[index],
+        )[0];
       }
     },
     // 增加
     addElement() {
-      this.data.option.push(getOption());
+      this.data.new_word_list.push(getOption());
     },
     // 获取数据
     handleBlurCon(row) {

+ 36 - 3
src/views/book/courseware/create/components/base/pinyin_base/PinyinBase.vue → src/views/book/courseware/create/components/question/pinyin_base/PinyinBase.vue

@@ -3,6 +3,15 @@
     <template #content>
       <!-- eslint-disable max-len -->
       <div class="fill-wrapper">
+        <div class="fun-type">
+          <a
+            v-for="{ value, label } in funList"
+            :key="value"
+            :class="[data.property.fun_type === value ? 'active' : '']"
+            @click="data.property.fun_type = value"
+            >{{ label }}</a
+          >
+        </div>
         <div class="content-box">
           <el-input
             v-if="data.property.audio_generation_method === 'auto'"
@@ -23,8 +32,7 @@
             style="width: 200px"
           />
         </div>
-        <span v-if="data.property.fun_type === 'input'"
-class="tips"
+        <span v-if="data.property.fun_type === 'input'" class="tips"
           >在需要加空的内容处插入 3 个或以上的下划线“_”。</span
         >
         <div v-if="data.audio_file_id">
@@ -72,7 +80,7 @@ import ModuleMixin from '../../common/ModuleMixin';
 import SoundRecord from '@/views/book/courseware/create/components/question/fill/components/SoundRecord.vue';
 import UploadAudio from '@/views/book/courseware/create/components/question/fill/components/UploadAudio.vue';
 
-import { getPinyinBaseData } from '@/views/book/courseware/data/pinyinBase';
+import { getPinyinBaseData, funList } from '@/views/book/courseware/data/pinyinBase';
 import { addTone, handleToneValue } from '@/views/book/courseware/data/common';
 import { getRandomNumber } from '@/utils';
 import { GetStaticResources } from '@/api/app';
@@ -90,6 +98,7 @@ export default {
       matically_pinyin_obj: {}, // 存放转成声调的拼音
       matically_pinyin_str: {}, // 存放转成声调的字符串
       res_arr: [],
+      funList,
     };
   },
   watch: {
@@ -306,6 +315,30 @@ export default {
     width: 100%;
   }
 
+  .fun-type {
+    display: flex;
+    gap: 5px;
+    width: 100%;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #e5e6eb;
+
+    a {
+      padding: 5px 10px;
+      font-weight: normal;
+      color: #1d2129;
+      cursor: pointer;
+      background: #f2f3f5;
+      border: 1px solid #f2f3f5;
+      border-radius: 2px;
+
+      &.active {
+        color: #165dff;
+        background: #e7eeff;
+        border-color: #165dff;
+      }
+    }
+  }
+
   .tips {
     font-size: 12px;
     color: #999;

+ 2 - 2
src/views/book/courseware/create/components/base/pinyin_base/PinyinBaseSetting.vue → src/views/book/courseware/create/components/question/pinyin_base/PinyinBaseSetting.vue

@@ -2,11 +2,11 @@
   <div>
     <el-form :model="property" label-width="72px" label-position="left">
       <SerailNumber :property="property" />
-      <el-form-item label="功能">
+      <!-- <el-form-item label="功能">
         <el-select v-model="property.fun_type" placeholder="请选择">
           <el-option v-for="{ value, label } in funList" :key="value" :label="label" :value="value" />
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item v-if="property.fun_type === 'mark'" label="选择类型">
         <el-radio-group v-model="property.answer_mode">
           <el-radio v-for="{ value, label } in markList" :key="value" :label="value">

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

@@ -31,8 +31,8 @@ import UploadControl from '../create/components/base/upload_control/UploadContro
 import UploadControlSetting from '../create/components/base/upload_control/UploadControlSetting.vue';
 import UploadPreview from '../create/components/base/upload_preview/UploadPreview.vue';
 import UploadRreviewSetting from '../create/components/base/upload_preview/UploadRreviewSetting.vue';
-import PinyinBase from '../create/components/base/pinyin_base/PinyinBase.vue';
-import PinyinBaseSetting from '../create/components/base/pinyin_base/PinyinBaseSetting.vue';
+import PinyinBase from '../create/components/question/pinyin_base/PinyinBase.vue';
+import PinyinBaseSetting from '../create/components/question/pinyin_base/PinyinBaseSetting.vue';
 import CharacterBase from '../create/components/base/character_base/CharacterBase.vue';
 import CharacterBaseSetting from '../create/components/base/character_base/CharacterBaseSetting.vue';
 import Character from '../create/components/question/character/Character.vue';
@@ -179,14 +179,6 @@ export const bookTypeOption = [
         set: SpacingSetting,
         preview: SpacingPreview,
       },
-      {
-        value: 'pinyin_base',
-        label: '拼音',
-        icon: 'pinyin',
-        component: PinyinBase,
-        set: PinyinBaseSetting,
-        preview: PinyinBasePreview,
-      },
       // {
       //   value: 'character_base',
       //   label: '汉字',
@@ -345,6 +337,14 @@ export const bookTypeOption = [
         set: ImageTextSetting,
         preview: ImageTextPreview,
       },
+      {
+        value: 'pinyin_base',
+        label: '拼音组件',
+        icon: '',
+        component: PinyinBase,
+        set: PinyinBaseSetting,
+        preview: PinyinBasePreview,
+      },
     ],
   },
 ];

+ 1 - 1
src/views/book/courseware/data/newWord.js

@@ -78,7 +78,7 @@ export function getNewWordData() {
     title: '生词组件',
     property: getNewWordProperty(),
     title_con: '',
-    option: [getOption()],
+    new_word_list: [getOption()],
     lrc_arr: [], // lrc 文件解析后的数据
     // lrc 文件数据
     lrc_data: {

+ 4 - 4
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -20,7 +20,7 @@
         </div>
         <el-collapse-transition>
           <template v-if="is_list">
-            <div v-if="data.option && data.option.length > 0" v-show="wordShow" class="NPC-word-list">
+            <div v-if="data.new_word_list && data.new_word_list.length > 0" v-show="wordShow" class="NPC-word-list">
               <div v-if="data.audio_data.file_id" class="aduioLine-box">
                 <AudioLine
                   ref="audioLine"
@@ -141,7 +141,7 @@
             </div>
           </template>
           <template v-else>
-            <div v-if="data.option && data.option.length > 0" v-show="wordShow" class="NPC-word-tile">
+            <div v-if="data.new_word_list && data.new_word_list.length > 0" v-show="wordShow" class="NPC-word-tile">
               <div v-for="(items, index) in data.option_list" :key="index" class="NPC-word-tile-item">
                 <div
                   v-for="(item, indexs) in items"
@@ -369,7 +369,7 @@ export default {
       handler(val) {
         if (val) {
           if (this.is_change) return;
-          if (val.option[0].new_word) {
+          if (val.new_word_list[0].new_word) {
             this.wordShow = isEnable(this.data.property.is_word_show);
             this.initData();
           }
@@ -493,7 +493,7 @@ export default {
           this.data.audio_data.url = url_map[this.data.audio_data.file_id];
         });
       }
-      this.data.option.forEach((item) => {
+      this.data.new_word_list.forEach((item) => {
         if (item.number) {
           option_list.push([item]);
         } else if (option_list[option_list.length - 1]) {