Ver Fonte

字词卡片

natasha há 1 ano atrás
pai
commit
b811d298d8

+ 16 - 2
src/views/corpus/seekPage.vue

@@ -12,7 +12,7 @@
       </div>
     </template>
 
-    <!-- <div class="txt">请搜索汉字,例如:好</div> -->
+    <div class="txt">包含{{ book_count }}本教材、{{ word_count }}个字词,{{ sentence_count }}个例句</div>
   </div>
 </template>
 
@@ -21,7 +21,7 @@
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from '@/components/Header';
 import { getConfigInfor } from '@/utils/index';
-import { getStaticContent } from '@/api/api';
+import { getStaticContent, BookgetContent } from '@/api/api';
 import { setToken } from '@/utils/auth';
 
 export default {
@@ -39,6 +39,9 @@ export default {
       AppID: this.$route.query.AppID,
       showPage: false,
       userID: this.$route.query.UserID ? this.$route.query.UserID : '',
+      book_count: 0,
+      word_count: 0,
+      sentence_count: 0,
     };
   },
   //计算属性 类似于data概念
@@ -71,6 +74,16 @@ export default {
         },
       });
     },
+    getTotalCount() {
+      const Mname = 'book-data_stat-GetBookWordExampleSentenceTotalCount';
+      BookgetContent(Mname, {}).then((res) => {
+        if (res.status === 1) {
+          this.book_count = res.book_count;
+          this.word_count = res.word_count;
+          this.sentence_count = res.example_sentence_count;
+        }
+      });
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   async created() {
@@ -89,6 +102,7 @@ export default {
     }
     localStorage.removeItem('seekPageData');
     this.showPage = true;
+    this.getTotalCount();
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {},

+ 1 - 1
src/views/teacher-dev/index.vue

@@ -83,7 +83,7 @@ export default {
       toolBookList: null, // 工具书
       isData: false,
       textAnalyseShow: true,
-      showMaterial: true, // 是否可以查看教辅材料等
+      showMaterial: false, // 是否可以查看教辅材料等
     };
   },
   computed: {},

+ 37 - 2
src/views/wordcard/cread.vue

@@ -2,6 +2,12 @@
   <div class="cread" v-loading="loading">
     <Header :projectShow="true" v-if="!userID" />
     <div class="main" v-if="!isPreview">
+      <div class="go-back-box">
+        <a v-if="!userID" class="go-back" @click="goBack">
+          <i class="el-icon-arrow-left"></i>
+          返回
+        </a>
+      </div>
       <div class="from">
         <div class="type">
           <div :class="[typeIndex == 0 ? 'sele' : '']" @click="cutType(0)">字词模式</div>
@@ -118,7 +124,7 @@
         class="operation"
         v-if="isCread && writeTableData && writeTableData.result && writeTableData.result.length > 0"
       >
-        <div @click="saveEvent"><img src="../../assets/teacherdev/word-save.png" alt="" /> 保存</div>
+        <div @click="save"><img src="../../assets/teacherdev/word-save.png" alt="" /> 保存</div>
         <div @click="previewEvent"><img src="../../assets/teacherdev/word-eyes.png" alt="" /> 预览</div>
         <div @click="download2('pdfDom')"><img src="../../assets/teacherdev/word-download.png" alt="" /> 打印</div>
       </div>
@@ -245,6 +251,12 @@ export default {
     handleClose() {
       this.saveShow = false;
     },
+    // 返回上一页
+    goBack() {
+      this.$router.push({
+        path: '/wordcard/table',
+      });
+    },
     // 保存
     save() {
       this.loading = this.$loading({
@@ -262,6 +274,7 @@ export default {
           type: this.typeIndex == 0 ? 'WORD' : 'SENTENCE',
           text: this.from.content,
           content: JSON.stringify(this.writeTableData),
+          update_scope: 0,
         })
           .then((res) => {
             this.loading.close();
@@ -1098,7 +1111,29 @@ export default {
 .cread {
   height: 100%;
   position: relative;
-
+  .go-back-box {
+    width: 1200px;
+    margin: 0 auto 16px auto;
+  }
+  .go-back {
+    border-radius: 4px;
+    border: 1px solid #d9d9d9;
+    background: #fff;
+    box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
+    display: flex;
+    width: 60px;
+    color: #333;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 22px;
+    padding: 9px 8px;
+    align-items: center;
+    cursor: pointer;
+    .el-icon-arrow-left {
+      font-size: 16px;
+      margin-right: 8px;
+    }
+  }
   .main {
     min-height: 100%;
     background: #f7f7f7;

+ 33 - 26
src/views/wordcard/table.vue

@@ -4,9 +4,10 @@
     <div class="main" v-if="showPage">
       <div>
         <div class="title">字词练习卡</div>
+        <div class="right" @click="Startcread">开始创建</div>
         <div class="number_cread">
           <span class="left">文件数量:{{ data.total_count }}</span>
-          <div class="right" @click="Startcread">开始创建</div>
+          <el-input v-model="searchInput" placeholder="检索" @keyup.enter.native="getdata" />
         </div>
         <div class="table">
           <div>
@@ -18,8 +19,16 @@
           </div>
           <div v-for="(item, i) in data.word_sentence_card_list" :key="i + 'one'">
             <div class="number">{{ item.number }}</div>
-            <div
-              class="dv dv1"
+            <div class="dv dv1" @click="editName(item)">
+              {{ item.name }}
+            </div>
+            <div class="dv dvs">
+              {{ item.type == 'WORD' ? '字词卡' : '书写卡' }}
+            </div>
+            <div class="dv">{{ item.text }}</div>
+            <div class="dv dv2">{{ item.create_time }}</div>
+            <span
+              class="edit-btn"
               @click="
                 $router.push({
                   path: '/wordcard/cread',
@@ -30,15 +39,8 @@
                   },
                 })
               "
-            >
-              {{ item.name }}
-            </div>
-            <div class="dv dvs">
-              {{ item.type == 'WORD' ? '字词卡' : '书写卡' }}
-            </div>
-            <div class="dv">{{ item.text }}</div>
-            <div class="dv dv2">{{ item.create_time }}</div>
-            <span class="edit-btn" @click="editName(item)"><i class="el-icon-edit"></i></span>
+              ><i class="el-icon-edit"></i
+            ></span>
             <el-popconfirm title="确定删除这一条记录吗?" @confirm="deleteOne(item.id, i)">
               <img slot="reference" src="../../assets/teacherdev/delete-one.png" alt="" />
             </el-popconfirm>
@@ -97,6 +99,7 @@ export default {
       userID: this.$route.query.UserID ? this.$route.query.UserID : '',
       saveShow: false,
       saveName: '',
+      searchInput: '',
     };
   },
   // 计算属性 类似于data概念
@@ -162,6 +165,7 @@ export default {
         cur_page: this.page,
         page_capacity: this.pageSize,
         app_user_id: this.userID,
+        search_content: this.searchInput.trim(),
       })
         .then((res) => {
           this.data = res;
@@ -199,8 +203,7 @@ export default {
       LearnWebSI(Mname, {
         id: this.activeItem.id,
         name: this.saveName,
-        type: this.activeItem.type,
-        text: this.activeItem.text,
+        update_scope: 1,
       })
         .then((res) => {
           this.loading.close();
@@ -245,28 +248,32 @@ export default {
       text-transform: uppercase;
       color: #2c2c2c;
     }
+    .right {
+      width: 112px;
+      height: 40px;
+      background: #669aff;
+      border-radius: 4px;
+      font-weight: 500;
+      font-size: 16px;
+      line-height: 40px;
+      text-align: center;
+      color: #ffffff;
+      cursor: pointer;
+      margin-left: 1088px;
+    }
     .number_cread {
       display: flex;
       justify-content: space-between;
       margin-top: 12px;
+      align-items: center;
       .left {
-        margin-top: 40px;
         font-weight: 400;
         font-size: 16px;
         line-height: 24px;
         color: #000000;
       }
-      .right {
-        width: 112px;
-        height: 40px;
-        background: #669aff;
-        border-radius: 4px;
-        font-weight: 500;
-        font-size: 16px;
-        line-height: 40px;
-        text-align: center;
-        color: #ffffff;
-        cursor: pointer;
+      .el-input {
+        width: 220px;
       }
     }
     .table {