Forráskód Böngészése

生词修改字段名

natasha 16 órája
szülő
commit
b21b658906

+ 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) {

+ 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]) {