natasha 1 year ago
parent
commit
f24846a46b

BIN
src/assets/teacherdev/pencil-ruler-line.png


+ 154 - 133
src/router/index.js

@@ -5,147 +5,168 @@ Vue.use(VueRouter);
 import { Loading } from 'element-ui';
 import { getToken } from '@/utils/auth'; // get token from cookie
 
-const routes = [
-  {
-    path: '/EnterSys',
-    // component: Index,
-    beforeEnter: (to, from, next) => {
-      let loadingInstance = Loading.service({
-        text: '跳转中...',
-      });
-      let token = getToken();
-      if (token) {
-        if (JSON.parse(token).popedom_code_list.indexOf(2000006) === -1) {
-          next({ path: '/' });
-          loadingInstance.close();
-        } else {
-          next('/teacherdevEntering');
-          loadingInstance.close();
-        }
-      }
-    },
-  },
-  {
-    path: '/GoodsDetail',
-    beforeEnter: (to, from, next) => {
-      let loadingInstance = Loading.service({
-        text: '跳转中...',
-      });
-      if (to.query.goods_type === 401) {
-        next({
-          path: '/Preview',
-          query: {
-            id: to.query.goods_id,
-            invok_module: to.query.invok_module,
-          },
-        });
-        loadingInstance.close();
-      }
-    },
-  },
-  // 教研中心
-  {
-    path: '/',
-    name: 'Index',
-    component: Index,
-    meta: { title: '', keepAlive: false },
-  },
-  {
-    path: '/login',
-    name: 'login',
-    component: () => import('../views/login.vue'),
-  },
-  {
-    path: '/Preview',
-    name: 'Preview',
-    component: () => import('../views/teacher-dev/Preview.vue'),
-  },
-  {
-    path: '/Viewmore',
-    name: 'Viewmore',
-    meta: { title: '', keepAlive: false },
-    component: () => import('../views/teacher-dev/Viewmore.vue'),
-  },
-  {
-    path: '/TextAnalysis',
-    name: 'TextAnalysis',
-    meta: { title: '', keepAlive: false },
-    component: () => import('../views/teacher-dev/TextAnalysis.vue'),
-  },
-  {
-    path: '/teacherdevEntering',
-    name: 'teacherdevEntering',
-    meta: { title: '', keepAlive: false },
-    component: () => import('../views/teacher-devEntering/index.vue'),
-  },
-  {
-    path: '/creadDocument',
-    name: 'creadDocument',
-    component: () => import('../views/teacher-devEntering/creadDocument.vue'),
-  },
-  {
-    path: '/discountCodeList',
-    name: 'discountCodeList',
-    component: () => import('@/views/teacher-devEntering/discountCodeList'),
-  },
-  {
-    path: '/textanalysis/Result',
-    component: () => import('@/views/Textanalysis/index'),
-  },
-  {
-    path: '/textanalysis/WordTable',
-    component: () => import('@/views/Textanalysis/WordTable'),
-  },
-  {
-    path: '/corpus/seekPage',
-    component: () => import('@/views/corpus/seekPage'),
-  },
-  {
-    path: '/corpus/Result',
-    component: () => import('@/views/corpus/Result'),
-  },
-  {
-    path: '/wordcard/table',
-    component: () => import('@/views/wordcard/table'),
-  },
-  {
-    path: '/wordcard/cread',
-    component: () => import('@/views/wordcard/cread'),
-    meta: { title: '创建词汇卡片', keepAlive: true },
-  },
-  {
-    path: '/wordcard/print',
-    component: () => import('@/views/wordcard/print'),
-  },
-  {
-    path: '/CalligraphyMaster/table',
-    component: () => import('@/views/CalligraphyMaster/table'),
-  },
-  {
-    path: '/CalligraphyMaster/cread',
-    component: () => import('@/views/CalligraphyMaster/cread'),
-  },
-  {
-    path: '/CalligraphyMaster/fontFamilyList',
-    component: () => import('@/views/CalligraphyMaster/fontFamilyList'),
-  },
-  {
-    path: '*',
-    redirect: '/404',
-  },
+const routes = [{
+        path: '/EnterSys',
+        // component: Index,
+        beforeEnter: (to, from, next) => {
+            let loadingInstance = Loading.service({
+                text: '跳转中...',
+            });
+            let token = getToken();
+            if (token) {
+                if (JSON.parse(token).popedom_code_list.indexOf(2000006) === -1) {
+                    next({ path: '/' });
+                    loadingInstance.close();
+                } else {
+                    next('/teacherdevEntering');
+                    loadingInstance.close();
+                }
+            }
+        },
+    },
+    {
+        path: '/GoodsDetail',
+        beforeEnter: (to, from, next) => {
+            let loadingInstance = Loading.service({
+                text: '跳转中...',
+            });
+            if (to.query.goods_type === 401) {
+                next({
+                    path: '/Preview',
+                    query: {
+                        id: to.query.goods_id,
+                        invok_module: to.query.invok_module,
+                    },
+                });
+                loadingInstance.close();
+            }
+        },
+    },
+    // 教研中心
+    {
+        path: '/',
+        name: 'Index',
+        component: Index,
+        meta: { title: '', keepAlive: false },
+    },
+    {
+        path: '/login',
+        name: 'login',
+        component: () =>
+            import ('../views/login.vue'),
+    },
+    {
+        path: '/Preview',
+        name: 'Preview',
+        component: () =>
+            import ('../views/teacher-dev/Preview.vue'),
+    },
+    {
+        path: '/Viewmore',
+        name: 'Viewmore',
+        meta: { title: '', keepAlive: false },
+        component: () =>
+            import ('../views/teacher-dev/Viewmore.vue'),
+    },
+    {
+        path: '/TextAnalysis',
+        name: 'TextAnalysis',
+        meta: { title: '', keepAlive: false },
+        component: () =>
+            import ('../views/teacher-dev/TextAnalysis.vue'),
+    },
+    {
+        path: '/teacherdevEntering',
+        name: 'teacherdevEntering',
+        meta: { title: '', keepAlive: false },
+        component: () =>
+            import ('../views/teacher-devEntering/index.vue'),
+    },
+    {
+        path: '/creadDocument',
+        name: 'creadDocument',
+        component: () =>
+            import ('../views/teacher-devEntering/creadDocument.vue'),
+    },
+    {
+        path: '/discountCodeList',
+        name: 'discountCodeList',
+        component: () =>
+            import ('@/views/teacher-devEntering/discountCodeList'),
+    },
+    {
+        path: '/textanalysis/Result',
+        component: () =>
+            import ('@/views/Textanalysis/index'),
+    },
+    {
+        path: '/textanalysis/WordTable',
+        component: () =>
+            import ('@/views/Textanalysis/WordTable'),
+    },
+    {
+        path: '/corpus/seekPage',
+        component: () =>
+            import ('@/views/corpus/seekPage'),
+    },
+    {
+        path: '/corpus/Result',
+        component: () =>
+            import ('@/views/corpus/Result'),
+    },
+    {
+        path: '/wordcard/table',
+        component: () =>
+            import ('@/views/wordcard/table'),
+    },
+    {
+        path: '/wordcard/cread',
+        component: () =>
+            import ('@/views/wordcard/cread'),
+        meta: { title: '创建词汇卡片', keepAlive: true },
+    },
+    {
+        path: '/wordcard/print',
+        component: () =>
+            import ('@/views/wordcard/print'),
+    },
+    {
+        path: '/CalligraphyMaster/table',
+        component: () =>
+            import ('@/views/CalligraphyMaster/table'),
+    },
+    {
+        path: '/CalligraphyMaster/cread',
+        component: () =>
+            import ('@/views/CalligraphyMaster/cread'),
+    },
+    {
+        path: '/CalligraphyMaster/fontFamilyList',
+        component: () =>
+            import ('@/views/CalligraphyMaster/fontFamilyList'),
+    },
+    {
+        path: '/textanalysis/checkArticle',
+        component: () =>
+            import ('@/views/Textanalysis/CheckArticle'),
+    },
+    {
+        path: '*',
+        redirect: '/404',
+    },
 ];
 
 const router = new VueRouter({
-  // mode: 'history',
-  base: process.env.BASE_URL,
-  routes,
+    // mode: 'history',
+    base: process.env.BASE_URL,
+    routes,
 });
 
 // 获取原型对象上的push函数
 const originalPush = VueRouter.prototype.push;
 // 修改原型对象中的push方法
 VueRouter.prototype.push = function push(location) {
-  return originalPush.call(this, location).catch((err) => err);
+    return originalPush.call(this, location).catch((err) => err);
 };
 
-export default router;
+export default router;

+ 213 - 0
src/views/Textanalysis/CheckArticle.vue

@@ -0,0 +1,213 @@
+<template>
+  <div v-loading="loading" class="check-article">
+    <div class="wheader">
+      <HeaderPage />
+    </div>
+    <div class="main">
+      <div class="main-top">
+        <a class="go-back" @click="$router.go(-1)">
+            <i class="el-icon-arrow-left"></i>
+            返回
+        </a>
+        <b>校对</b>
+        <div class="btn-box">
+            <el-button>校对拼音</el-button>
+            <el-button type="primary">校对分词</el-button>
+        </div>
+      </div>
+      <div class="paragraph" v-for="(item, index) in indexArr" :key="index + 'paragraph'" >
+        <label>段 {{index+1}}</label>
+        <div class="sentence-box" v-for="(items, indexs) in item" :key="indexs + 'words'">
+            <div class="sentence" v-for="(itemss, indexss) in items" :key="indexss + 'words'">
+                <b>{{itemss.index}}.</b>
+                <div class="sentence" v-html="itemss.text">
+                </div>
+            </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import HeaderPage from '@/components/Header.vue';
+import { publicMethods } from '@/api/api';
+
+export default {
+  components: {
+    HeaderPage,
+  },
+  data() {
+    return {
+      loading: false,
+      id: '',
+      ArticelData: null,
+      indexArr: [], // 索引数组
+    };
+  },
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.routerData = JSON.parse(JSON.stringify(this.$route.query));
+    this.id = this.routerData.id
+    this.getArticleData()
+  },
+  methods: {
+    // 获取分析结果
+    getArticleData() {
+      this.loading = true;
+      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
+          analyse_record_id: this.id,
+        }
+      )
+        .then((res) => {
+            if(res.status===1){
+                let newdata = [];
+                res.parsed_text.paragraph_list.forEach((item) => {
+                    if (item.length !== 0) {
+                        newdata.push(item);
+                    }
+                });
+                this.ArticelData = newdata;
+                let arr = []
+                let indexS = 0;
+                // 添加索引
+                this.ArticelData.forEach((item,index) => {
+                    arr.push([])
+                    item.forEach((items,indexs) => {
+                        arr[index].push([])
+                        indexS += 1;
+                        let str = ''
+                        items.forEach((itemss,indexss)=>{
+                            itemss.text.forEach(itemT=>{
+                                str += itemT.word
+                            })
+                            if(indexss!==items.length-1) str+='&nbsp;&nbsp;'
+                        })
+                        let obj = {
+                            text: str,
+                            index: JSON.parse(JSON.stringify(indexS))
+                        }
+                        arr[index][indexs].push(obj)
+                    });
+                });
+                this.indexArr = arr
+                this.loading = false;
+            }
+          
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.check-article {
+  min-height: 100%;
+  background: #f6f6f6;
+
+  .wheader {
+    background: #fff;
+  }
+
+  .main {
+    width: 1200px;
+    margin: 23px auto;
+    background: #FFF;
+    padding: 24px;
+    &-top{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        margin-bottom: 24px;
+        position: relative;
+        b{
+            color: #000;
+            font-size: 24px;
+            font-weight: 500;
+            line-height: 32px;
+            position: absolute;
+            width: 100%;
+            text-align: center;
+            top: 0;
+            left: 0;
+        }
+        .el-button{
+            padding: 5px 16px;
+            border-radius: 2px;
+            border: 1px solid #165DFF;
+            color: #165DFF;
+            font-size: 14px;
+            font-weight: 400;
+            line-height: 22px;
+            &.el-button--primary{
+                background: #165DFF;
+                color: #FFF;
+            }
+        }
+    }
+    .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: 5px 8px;
+        align-items: center;
+        cursor: pointer;
+        margin-bottom: 16px;
+        .el-icon-arrow-left{
+            font-size: 16px;
+            margin-right: 8px;
+        }
+    }
+    .paragraph{
+        margin-bottom: 8px;
+        text-align: center;
+        >label{
+            border-radius: 2px;
+            border: 1px solid #175DFF;
+            background: #E7EEFF;
+            padding: 1px 8px;
+            color: var(--blue-05, #175DFF);
+            font-size: 14px;
+            font-weight: 400;
+            line-height: 22px;
+        }
+        .sentence-box{
+            .sentence{
+                display: flex;
+                margin-top: 8px;
+                b{
+                    width: 32px;
+                    line-height: 24px;
+                    flex-shrink: 0;
+                    color: #000;
+                    font-size: 16px;
+                    font-weight: 400;
+                    margin-top: 16px;
+                }
+                .sentence{
+                    flex: 1;
+                    padding: 8px;
+                    background: #F7F7F7;
+                    color: #000;
+                    font-size: 16px;
+                    font-weight: 400;
+                    line-height: 24px;
+                    text-align: left;
+                }
+            }
+        }
+    }
+  }
+}
+</style>
+

+ 14 - 1
src/views/Textanalysis/index.vue

@@ -172,6 +172,10 @@
                 <img src="../../assets/teacherdev/icon-down.png" alt="" />
                 下载
               </div>
+              <div class="btn_dv" style="margin-right: 24px" @click="checkArticle">
+                <img src="../../assets/teacherdev/pencil-ruler-line.png" alt="" />
+                校对
+              </div>
               <div class="daxiao">
                 <span @click="handleFontsize('-')">
                   <template v-if="wordFontsize > 12">
@@ -1341,6 +1345,15 @@ export default {
                 keyword: this.searchVal.trim(),
             },
         });
+    },
+    // 校对
+    checkArticle(){
+        this.$router.push({
+            path: "/textanalysis/checkArticle",
+            query: {
+                id: this.id
+            },
+        });
     }
   },
 };
@@ -1765,7 +1778,7 @@ export default {
               align-items: center;
               justify-content: center;
               width: 82px;
-              height: 40px;
+              height: 30px;
               font-size: 14px;
               font-weight: 400;
               color: rgba(0, 0, 0, 85%);