Bläddra i källkod

修改文本分析的问题

dusenyao 1 år sedan
förälder
incheckning
df586f3ceb
2 ändrade filer med 326 tillägg och 303 borttagningar
  1. 305 297
      src/components/Header.vue
  2. 21 6
      src/views/teacher-dev/TextAnalysis.vue

+ 305 - 297
src/components/Header.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 顶部登录导航 -->
-  <div class="LoginNav1" v-if="isData">
-    <div class="logo" v-if="configInfor">
+  <div v-if="isData" class="LoginNav1">
+    <div v-if="configInfor" class="logo">
       <img
         v-if="configInfor.logo_image_url"
         :src="configInfor.logo_image_url"
@@ -9,8 +9,8 @@
         class="logo-image"
         @click="handleSelect"
       />
-      <span class="logo-img" v-else>logo</span>
-      <ul class="logo-projectlist" v-if="!projectShow">
+      <span v-else class="logo-img">logo</span>
+      <ul v-if="!projectShow" class="logo-projectlist">
         <li
           v-for="(itemI, indexI) in projectList"
           :key="indexI"
@@ -22,103 +22,86 @@
       </ul>
       <template v-else-if="seekShow">
         <div class="ylk_seek" @keydown="downSeek">
-          <input type="text" v-model="keyword" />
+          <input v-model="keyword" type="text" />
           <div @click="seekresult">搜索</div>
         </div>
       </template>
-        <el-popover
-          placement="bottom"
-          width="335"
-          trigger="click"
-          v-model="visibleOption"
-          v-if="seekOptions"
-        >
-          <div class="set_corpus_dv">
-            <span>选择难度</span>
-            <el-select
-              style="width: 205px"
-              v-model="corpus.difficlty"
-              placeholder="请选择"
-            >
-                <el-option v-for="(itemD,indexD) in difficltyList" :key="indexD" :label="itemD.label" :value="itemD.value"></el-option>
-            </el-select>
-          </div>
-          <div class="set_corpus_dv">
-            <span>选择范围</span>
-            <el-select
-              style="width: 205px"
-              v-model="corpus.scope"
-              placeholder="请选择"
-            >
-                <el-option v-for="(itemD,indexD) in scopeList" :key="indexD" :label="itemD.label" :value="itemD.value"></el-option>
-            </el-select>
-          </div>
-          <div class="set_corpus_dv">
-            <span>句子长度</span>
-            <el-input
-              v-model="corpus.sentenceStart"
-              style="width: 55px; margin-right: 8px;"
-              onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
-              class="numbre-input"
-            ></el-input>
-            ——
-            <el-input
-              v-model="corpus.sentenceEnd"
-              style="width: 55px; margin-left: 8px"
-              onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
-              class="numbre-input"
-            ></el-input>
-          </div>
-          <div class="set_corpus_submit">
-            <div @click="visibleOption = false">取消</div>
-            <div @click="visibleOption = false">确认</div>
-          </div>
-          <div slot="reference" class="set_corpus" style="margin-left: 24px;cursor:pointer;">设置条件</div>
-        </el-popover>
+      <el-popover v-if="seekOptions" v-model="visibleOption" placement="bottom" width="335" trigger="click">
+        <div class="set_corpus_dv">
+          <span>选择难度</span>
+          <el-select v-model="corpus.difficlty" style="width: 205px" placeholder="请选择">
+            <el-option
+              v-for="(itemD, indexD) in difficltyList"
+              :key="indexD"
+              :label="itemD.label"
+              :value="itemD.value"
+            />
+          </el-select>
+        </div>
+        <div class="set_corpus_dv">
+          <span>选择范围</span>
+          <el-select v-model="corpus.scope" style="width: 205px" placeholder="请选择">
+            <el-option v-for="(itemD, indexD) in scopeList" :key="indexD" :label="itemD.label" :value="itemD.value" />
+          </el-select>
+        </div>
+        <div class="set_corpus_dv">
+          <span>句子长度</span>
+          <el-input
+            v-model="corpus.sentenceStart"
+            style="width: 55px; margin-right: 8px"
+            onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
+            class="numbre-input"
+          />
+          ——
+          <el-input
+            v-model="corpus.sentenceEnd"
+            style="width: 55px; margin-left: 8px"
+            onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
+            class="numbre-input"
+          />
+        </div>
+        <div class="set_corpus_submit">
+          <div @click="visibleOption = false">取消</div>
+          <div @click="visibleOption = false">确认</div>
+        </div>
+        <div slot="reference" class="set_corpus" style="margin-left: 24px; cursor: pointer">设置条件</div>
+      </el-popover>
     </div>
     <div class="userName">
       <template v-if="seekOption">
-        <el-popover
-          placement="bottom"
-          width="335"
-          trigger="click"
-          v-model="visible"
-        >
+        <el-popover v-model="visible" placement="bottom" width="335" trigger="click">
           <div class="set_corpus_dv">
             <span>选择难度</span>
-            <el-select
-              style="width: 205px"
-              v-model="corpus.difficlty"
-              placeholder="请选择"
-            >
-                <el-option v-for="(itemD,indexD) in difficltyList" :key="indexD" :label="itemD.label" :value="itemD.value"></el-option>
+            <el-select v-model="corpus.difficlty" style="width: 205px" placeholder="请选择">
+              <el-option
+                v-for="(itemD, indexD) in difficltyList"
+                :key="indexD"
+                :label="itemD.label"
+                :value="itemD.value"
+              />
             </el-select>
           </div>
           <div class="set_corpus_dv">
             <span>选择范围</span>
-            <el-select
-              style="width: 205px"
-              v-model="corpus.scope"
-              placeholder="请选择"
-            >
-                <el-option v-for="(itemD,indexD) in scopeList" :key="indexD" :label="itemD.label" :value="itemD.value"></el-option>
+            <el-select v-model="corpus.scope" style="width: 205px" placeholder="请选择">
+              <el-option v-for="(itemD, indexD) in scopeList" :key="indexD" :label="itemD.label" :value="itemD.value" />
             </el-select>
           </div>
           <div class="set_corpus_dv">
             <span>句子长度</span>
             <el-input
               v-model="corpus.sentenceStart"
-              style="width: 55px; margin-right: 8px;"
+              style="width: 55px; margin-right: 8px"
               onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
               class="numbre-input"
-            ></el-input>
+            />
             ——
             <el-input
               v-model="corpus.sentenceEnd"
               style="width: 55px; margin-left: 8px"
               onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
               class="numbre-input"
-            ></el-input>
+            />
           </div>
           <div class="set_corpus_submit">
             <div @click="visible = false">取消</div>
@@ -128,88 +111,64 @@
         </el-popover>
       </template>
       <template>
-        <el-dropdown
-          style="margin-right: 16px; cursor: pointer"
-          trigger="click"
-          @command="changeLang"
-        >
-          <span class="el-dropdown-link" style="color: #000000">
+        <el-dropdown style="margin-right: 16px; cursor: pointer" trigger="click" @command="changeLang">
+          <span class="el-dropdown-link" style="color: #000">
             {{ lang }}
             <i class="el-icon-arrow-down el-icon--right"></i>
           </span>
           <el-dropdown-menu slot="dropdown" style="width: 200px">
-            <el-dropdown-item
-              v-for="item in language_list"
-              :key="item.language_type"
-              :command="item"
-              >{{ item.language_name }}</el-dropdown-item
-            >
+            <el-dropdown-item v-for="item in language_list" :key="item.language_type" :command="item">{{
+              item.language_name
+            }}</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
       </template>
       <div v-if="!userMessage" class="selectLoginOrRegistration">
-        <span @click="cutLoginReg"> <!-- 登录 -->{{ $t("Key9") }} </span>
+        <span @click="cutLoginReg"> <!-- 登录 -->{{ $t('Key9') }} </span>
       </div>
       <!-- 用户头像和用户名 -->
-      <div class="user" v-else>
+      <div v-else class="user">
         <img
-          @click="userShow = !userShow"
           class="headPhoto"
-          :src="
-            userMessage.image_url
-              ? userMessage.image_url
-              : require('../assets/login/Group3214.png')
-          "
+          :src="userMessage.image_url ? userMessage.image_url : require('../assets/login/Group3214.png')"
           alt=""
+          @click="userShow = !userShow"
         />
-        <span @click="userShow = !userShow">{{
-          userMessage.user_real_name
-        }}</span>
-        <div class="userShow" v-show="userShow">
+        <span @click="userShow = !userShow">{{ userMessage.user_real_name }}</span>
+        <div v-show="userShow" class="userShow">
           <p @click="gotoPersonalcenter">
             <img src="../assets/login/project7.png" alt="" />
-            <!-- 个人中心 -->{{ $t("Key38") }}
+            <!-- 个人中心 -->{{ $t('Key38') }}
           </p>
           <p @click="QuitLogin">
             <img src="../assets/login/Frame77.png" alt="" />
-            <!-- 退出登录 -->{{ $t("Key39") }}
+            <!-- 退出登录 -->{{ $t('Key39') }}
           </p>
         </div>
       </div>
       <!-- 消息 铃铛图片 -->
       <div class="message">
-        <img
-          @click="gotoPersonalcenter"
-          src="../assets/login/Vector.png"
-          alt=""
-        />
-        <span class="redDot" v-if="is_exist == 'true'"></span>
+        <img src="../assets/login/Vector.png" alt="" @click="gotoPersonalcenter" />
+        <span v-if="is_exist == 'true'" class="redDot"></span>
       </div>
     </div>
   </div>
 </template>
 
 <script>
-import { mapGetters } from "vuex";
-import { getToken, removeToken } from "@/utils/auth";
-import Cookies from "js-cookie";
-import {
-  getContent,
-  getStaticContent,
-  getLearnWebContent,
-  getContentFile,
-} from "@/api/api";
-import { setI18nLang } from "@/utils/i18n";
-import { getConfig } from "@/utils/auth";
-import { saveSession, getSession, removeSession } from "@/utils/role";
-import { updateWordPack } from "@/utils/i18n";
+import { mapGetters } from 'vuex';
+import { getToken, removeToken, getConfig } from '@/utils/auth';
+import Cookies from 'js-cookie';
+import { getStaticContent, getLearnWebContent, getContentFile } from '@/api/api';
+import { setI18nLang, updateWordPack } from '@/utils/i18n';
+import { removeSession } from '@/utils/role';
 
 export default {
-  name: "LayoutHeader",
-  props: ["projectShow", "seekShow", "seekOption","seekOptions"],
+  name: 'LayoutHeader',
+  props: ['projectShow', 'seekShow', 'seekOption', 'seekOptions'],
   data() {
     return {
-      keyword: this.$route.query.keyword?this.$route.query.keyword:'',
+      keyword: this.$route.query.keyword ? this.$route.query.keyword : '',
       visible: false,
       visibleOption: false,
       corpus: {
@@ -218,92 +177,125 @@ export default {
         sentenceStart: null,
         sentenceEnd: null,
       },
-      activeIndex: "2", // 主导航索引
-      LoginNavIndex: 0, //下拉框导航索引
-      projectName: "教研中心",
+      activeIndex: '2', // 主导航索引
+      LoginNavIndex: 0, // 下拉框导航索引
+      projectName: '教研中心',
       projectList: [],
-      is_exist: "false",
+      is_exist: 'false',
       teacherProList: [
-        //普通教师
+        // 普通教师
         {
           id: 0,
-          name: "教学中心",
-          img: "project1",
+          name: '教学中心',
+          img: 'project1',
         },
 
         {
           id: 2,
-          name: "教培中心",
-          img: "project3",
+          name: '教培中心',
+          img: 'project3',
         },
         {
           id: 3,
-          name: "教研中心",
-          img: "project4",
+          name: '教研中心',
+          img: 'project4',
         },
         {
           id: 5,
-          name: "学习中心",
-          img: "project6",
+          name: '学习中心',
+          img: 'project6',
         },
         {
           id: 4,
-          name: "考试中心",
-          img: "project5",
+          name: '考试中心',
+          img: 'project5',
         },
         {
           id: 6,
-          name: "个人中心",
-          img: "project7",
+          name: '个人中心',
+          img: 'project7',
         },
       ],
       stuProList: [
         {
           id: 0,
-          name: "教学中心",
-          img: "project1",
+          name: '教学中心',
+          img: 'project1',
         },
         {
           id: 5,
-          name: "学习中心",
-          img: "project6",
+          name: '学习中心',
+          img: 'project6',
         },
         {
           id: 6,
-          name: "个人中心",
-          img: "project7",
+          name: '个人中心',
+          img: 'project7',
         },
       ],
       userMessage: null,
       userShow: false,
       language_list: [],
-      lang: "",
+      lang: '',
       headTimer: null,
       configInfor: null,
       isData: false,
       difficltyList: [
         {
-            value: '',
-            label: '全部'
-        }
+          value: '',
+          label: '全部',
+        },
       ],
       scopeList: [
         {
-            value: '',
-            label: '全部'
-        }
-      ]
+          value: '',
+          label: '全部',
+        },
+      ],
     };
   },
-  watch: {},
   computed: {
-    ...mapGetters(["language_type"]),
+    ...mapGetters(['language_type']),
+  },
+  async created() {
+    let _this = this;
+    _this.getChildSysList();
+    console.log('v2022.03.18.10:25');
+    let userInfor = getToken();
+    if (userInfor) {
+      await updateWordPack({
+        word_key_list: ['Key9', 'Key38', 'Key39'],
+      });
+      this.isData = true;
+    }
+  },
+  mounted() {
+    let _this = this;
+    let user = getToken();
+    if (user) {
+      _this.userMessage = JSON.parse(user);
+    }
+    let config = getConfig();
+    if (config) {
+      _this.configInfor = JSON.parse(config);
+    }
+    _this.getLangList();
+    _this.getNotReadMessage();
+    _this.headTimer = setInterval(() => {
+      _this.getNotReadMessage();
+    }, 120000);
+  },
+  beforeDestroy() {
+    if (this.headTimer) {
+      // 如果定时器还在运行 或者直接关闭,不用判断
+      clearInterval(this.headTimer); // 关闭
+    }
   },
   methods: {
     downSeek(e) {
-      if (e.keyCode == 13) {
+      if (e.keyCode === 13) {
         if (!this.keyword) {
-          this.$message.warning("请先输入内容");
+          this.$message.warning('请先输入内容');
           return;
         }
         this.seekresult();
@@ -311,21 +303,21 @@ export default {
     },
     seekresult() {
       this.$router.replace({
-        path: "/corpus/Result",
+        path: '/corpus/Result',
         query: {
           keyword: this.keyword,
         },
       });
-      this.$emit("changehzdata");
+      this.$emit('changehzdata');
     },
-    // 前往个人中心
+    // 前往个人中心
     gotoPersonalcenter() {
       if (!this.userMessage) {
-        this.$message.warning("请先登录");
+        this.$message.warning('请先登录');
         return;
       }
-      let MethodName = "login_control-CreateAccessCode";
-      let acsCode = "";
+      let MethodName = 'login_control-CreateAccessCode';
+      let acsCode = '';
       // getContent(MethodName, UserCode, UserType, SessionID).then((res) => {
       //   acsCode = res.access_code;
       location.href = `/GCLS-Personal/#/EnterSys`;
@@ -333,16 +325,16 @@ export default {
     },
     // 切换导航
     handleSelect(key, keyPath) {
-      window.location.href = "/";
+      window.location.href = '/';
     },
     // 切换项目
     handleCommand(command) {
       let _this = this;
       _this.LoginNavIndex = command;
       if (!_this.userMessage) {
-        this.$message.warning("请先登录");
-        this.projectName = this.$t("Key5"); //"教研中心";
-        window.location.href = "/";
+        this.$message.warning('请先登录');
+        this.projectName = this.$t('Key5'); // "教研中心";
+        window.location.href = '/';
         return;
       }
       _this.projectName = _this.projectList[command].name;
@@ -351,25 +343,25 @@ export default {
     },
     // 切换登录的注册
     cutLoginReg() {
-      window.location.href = "/";
+      window.location.href = '/';
     },
     QuitLogin() {
-      window.location.href = "/";
-      removeSession("SysList");
+      window.location.href = '/';
+      removeSession('SysList');
       removeToken();
-      Cookies.remove("JSESSIONID");
+      Cookies.remove('JSESSIONID');
       this.userShow = false;
       this.userMessage = null;
-      sessionStorage.removeItem("useragent_root_close");
+      sessionStorage.removeItem('useragent_root_close');
     },
     getLangList() {
-      let MethodName = "language_manager-GetLanguageList";
+      let MethodName = 'language_manager-GetLanguageList';
       let data = {};
       getStaticContent(MethodName, data).then((res) => {
         this.language_list = res.language_list;
         for (let i = 0; i < this.language_list.length; i++) {
           let item = this.language_list[i];
-          if (item.language_type == this.language_type) {
+          if (item.language_type === this.language_type) {
             this.lang = item.language_name;
             break;
           }
@@ -384,7 +376,7 @@ export default {
       this.$router.go(0);
     },
     getNotReadMessage() {
-      let MethodName = "message-message_manager-IsExistMyMessage_NotRead";
+      let MethodName = 'message-message_manager-IsExistMyMessage_NotRead';
       let data = {};
       getLearnWebContent(MethodName, data).then((res) => {
         this.is_exist = res.is_exist;
@@ -395,7 +387,7 @@ export default {
     // },
     getChildSysList() {
       let _this = this;
-      let MethodName = "login_control-GetChildSysList_CanEnter_PC";
+      let MethodName = 'login_control-GetChildSysList_CanEnter_PC';
       getContentFile(MethodName, {})
         .then((res) => {
           if (res.child_sys_list && res.child_sys_list.length > 0) {
@@ -404,13 +396,13 @@ export default {
             for (let i = 0; i < _this.projectList.length; i++) {
               let item = _this.projectList[i];
               if (invok_module) {
-                if (invok_module == item.key) {
+                if (invok_module === item.key) {
                   _this.LoginNavIndex = i;
                   _this.projectName = item.name;
                 }
               } else {
-                let key = "GCLS-TC";
-                if (key == item.key) {
+                let key = 'GCLS-TC';
+                if (key === item.key) {
                   _this.LoginNavIndex = i;
                   _this.projectName = item.name;
                 }
@@ -423,57 +415,25 @@ export default {
         });
     },
   },
-  async created() {
-    let _this = this;
-    _this.getChildSysList();
-    console.log("v2022.03.18.10:25");
-    let userInfor = getToken();
-    if (userInfor) {
-      await updateWordPack({
-        word_key_list: ["Key9", "Key38", "Key39"],
-      });
-      this.isData = true;
-    }
-  },
-  mounted() {
-    let _this = this;
-    let user = getToken();
-    if (user) {
-      _this.userMessage = JSON.parse(user);
-    }
-    let config = getConfig();
-    if (config) {
-      _this.configInfor = JSON.parse(config);
-    }
-    _this.getLangList();
-    _this.getNotReadMessage();
-    _this.headTimer = setInterval(() => {
-      _this.getNotReadMessage();
-    }, 120000);
-  },
-  beforeDestroy() {
-    if (this.headTimer) {
-      //如果定时器还在运行 或者直接关闭,不用判断
-      clearInterval(this.headTimer); //关闭
-    }
-  },
 };
 </script>
 
 <style lang="scss" scoped>
 .LoginNav1 {
-  // height: 74px;
-  height: 64px;
-  position: relative;
+  position: sticky;
+  top: 0;
+  left: 0;
+  z-index: 999;
+  box-sizing: border-box;
   display: flex;
   align-items: center;
   justify-content: space-between;
-  box-sizing: border-box;
-  padding: 0px 24px;
-  z-index: 999;
-  // background: #ffffff;
-  // box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15);
-  font-family: "sourceR";
+  height: 64px;
+  padding: 0 24px;
+  font-family: 'sourceR';
+  background-color: #fff;
+  box-shadow: 0 1px 0 rgba(0, 0, 0, 15%);
+
   .el-dropdown-link {
     img {
       width: 8px;
@@ -481,195 +441,224 @@ export default {
       vertical-align: middle;
     }
   }
+
   .logo {
     > img {
       // width: 188px;
       height: 48px;
       cursor: pointer;
     }
+
     &-img {
+      // color: #fff;
+      margin-right: 29px;
+      font-size: 30px;
       font-style: normal;
       font-weight: 600;
-      font-size: 30px;
       font-variant: small-caps;
-      color: #000000;
-      // color: #fff;
-      margin-right: 29px;
       line-height: 64px;
+      color: #000;
     }
+
     display: flex;
     align-items: center;
+
     .logo-projectlist {
       display: flex;
-      padding: 0 24px;
       height: 64px;
+      padding: 0 24px;
       list-style: none;
+
       li {
         padding: 0 12px;
-        color: rgba(0, 0, 0, 0.45);
         font-size: 16px;
-        line-height: 64px;
         font-weight: 500;
-        cursor: pointer;
+        line-height: 64px;
+        color: rgba(0, 0, 0, 45%);
         white-space: nowrap;
+        cursor: pointer;
+
         &:hover {
           background: #f6f6f6;
         }
+
         &.active {
-          color: #ff9900;
+          color: #f90;
           background: #ffefd6;
         }
       }
     }
   }
+
   .userName {
     display: flex;
-    justify-content: flex-end;
     align-items: center;
+    justify-content: flex-end;
 
     .set_corpus {
       width: 48px;
       height: 35px;
-      background: #ebebeb;
-      border-radius: 8px;
-      font-weight: 400;
+      margin-right: 24px;
       font-size: 16px;
+      font-weight: 400;
       line-height: 35px;
+      color: #000;
       text-align: center;
-      color: #000000;
       cursor: pointer;
-      margin-right: 24px;
+      background: #ebebeb;
+      border-radius: 8px;
     }
+
     .seek {
-      margin-right: 100px;
       position: relative;
+      margin-right: 100px;
+
       img {
-        left: 10px;
-        top: 11px;
         position: absolute;
+        top: 11px;
+        left: 10px;
       }
     }
+
     .flag {
       position: relative;
       top: 5px;
     }
+
     .headPhoto {
       width: 50px;
       height: 50px;
+
       // background: url("../assets/teacherTrain/image 4.png") no-repeat 100% 100%;
       // background-size: 100%;
       border-radius: 50%;
+
       // margin-right: 10px;
     }
+
     .message {
-      height: 100%;
       position: relative;
       display: flex;
-      justify-content: center;
       align-items: center;
+      justify-content: center;
+      height: 100%;
       margin-left: 23px;
       cursor: pointer;
+
       img {
         width: 18px;
         height: 24px;
       }
+
       .redDot {
         position: absolute;
         top: 2px;
         right: 2px;
+        display: inline-block;
         width: 6px;
         height: 6px;
-        display: inline-block;
         background: red;
         border-radius: 50%;
       }
     }
+
     .selectLoginOrRegistration {
-      display: flex;
-      height: 32px;
-      border: 1px solid #ffffff;
       box-sizing: border-box;
-      border-radius: 4px;
-      justify-content: space-evenly;
+      display: flex;
       align-items: center;
+      justify-content: space-evenly;
+      height: 32px;
       padding: 0 16px;
+      border: 1px solid #fff;
+      border-radius: 4px;
+
       > span {
-        cursor: pointer;
         font-size: 16px;
-        color: #000000;
+        color: #000;
+        cursor: pointer;
       }
     }
+
     .user {
+      position: relative;
       display: flex;
       align-items: center;
+      color: #000;
       cursor: pointer;
-      position: relative;
-      color: #000000;
+
       > img {
         width: 34px;
         height: 34px;
       }
+
       > span {
-        font-size: 20px;
         padding-left: 10px;
+        font-size: 20px;
       }
+
       .userShow {
         position: absolute;
+        bottom: -100px;
+        left: -5px;
         width: 156px;
         height: 96px;
-        background: #ffffff;
-        box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
+        color: #000;
+        background: #fff;
         border-radius: 8px;
-        bottom: -100px;
-        left: -5px;
-        color: #000000;
+        box-shadow: 0 2px 8px rgba(0, 0, 0, 15%);
+
         img {
           width: 24px;
           height: 24px;
           margin-right: 10px;
         }
+
         p {
-          font-size: 16px;
-          height: 40px;
           display: flex;
           align-items: center;
+          height: 40px;
           padding-left: 20px;
           margin: 0;
           margin-top: 5px;
+          font-size: 16px;
         }
+
         > p:hover {
           background: #f2f2f2;
         }
       }
     }
   }
+
   .ylk_seek {
-    margin-left: 24px;
-    height: 35px;
     display: flex;
+    height: 35px;
+    margin-left: 24px;
+
     input {
+      box-sizing: border-box;
       width: 484px;
       height: 35px;
-      background: #ffffff;
+      padding: 0 10px;
+      background: #fff;
       border: 1px solid #669aff;
       outline: none;
-      padding: 0 10px;
-      box-sizing: border-box;
     }
+
     div {
+      box-sizing: border-box;
       width: 80px;
       height: 100%;
-      background: #669aff;
-      border-width: 1px 1px 1px 0px;
-      box-sizing: border-box;
-      border-style: solid;
-      border-color: #669aff;
-      text-align: center;
-      font-weight: 400;
       font-size: 16px;
+      font-weight: 400;
       line-height: 35px;
-      color: #ffffff;
+      color: #fff;
+      text-align: center;
       cursor: pointer;
+      background: #669aff;
+      border-color: #669aff;
+      border-style: solid;
+      border-width: 1px 1px 1px 0;
     }
   }
 }
@@ -677,96 +666,115 @@ export default {
 <style lang="scss">
 .LoginNav1 {
   .el-dropdown-menu__item {
-    line-height: 40px;
     display: flex;
-    justify-content: center;
     align-items: center;
+    justify-content: center;
+    line-height: 40px;
+
     > span {
-      font-family: "sourceR";
+      font-family: 'sourceR';
       font-size: 16px;
     }
   }
+
   .el-menu--horizontal > .el-menu-item {
     height: 64px;
     line-height: 64px;
   }
+
   .el-dropdown {
     display: block;
+
     > span {
-      font-family: "sourceR";
+      font-family: 'sourceR';
       font-size: 16px;
     }
   }
+
   .el-menu-item.is-active i {
     color: white;
   }
 }
+
 .set_corpus_dv {
   display: flex;
   align-items: center;
   margin-bottom: 24px;
+
   > span {
-    font-weight: 400;
+    margin-right: 18px;
     font-size: 16px;
+    font-weight: 400;
     line-height: 19px;
-    color: #000000;
-    margin-right: 18px;
+    color: #000;
   }
-  .numbre-input{
-    .el-input__inner{
-        padding: 0;
-        text-align: center;
+
+  .numbre-input {
+    .el-input__inner {
+      padding: 0;
+      text-align: center;
     }
   }
 }
+
 .set_corpus_submit {
-  margin-top: 32px;
   display: flex;
   justify-content: flex-end;
+  margin-top: 32px;
+
   div {
     width: 44px;
     height: 32px;
-    border-radius: 4px;
-    font-weight: 400;
     font-size: 14px;
+    font-weight: 400;
     line-height: 32px;
     text-align: center;
     cursor: pointer;
+    border-radius: 4px;
   }
+
   > :nth-child(2) {
-    color: #ffffff;
+    color: #fff;
     background: #4992ff;
   }
+
   > :nth-child(1) {
-    color: #000000;
     margin-right: 8px;
+    color: #000;
   }
 }
+
 .projectList {
   &.el-dropdown-menu__item {
-    line-height: 40px;
     display: flex;
     align-items: center;
-    color: #000000;
+    line-height: 40px;
+    color: #000;
+
     > img {
       top: 0;
     }
+
     > span {
+      font-family: 'sourceR';
       line-height: 40px;
-      font-family: "sourceR";
     }
   }
+
   &:hover {
-    background: #ff9900 !important;
     // background: rgba(255, 153, 0, 0.1) !important;
     color: #000 !important;
+    background: #f90 !important;
+
     // color: #fff;
   }
+
   &.menuActive {
-    background: #ff9900;
+    background: #f90;
   }
 }
-.el-popper{
-    z-index: 100000 !important;
+
+.el-popper {
+  z-index: 100000 !important;
 }
 </style>

+ 21 - 6
src/views/teacher-dev/TextAnalysis.vue

@@ -27,8 +27,11 @@
       </div>
       <div v-if="data" class="list_main">
         <div class="title">
-          <span style="margin-right: 16px">分析记录:</span>
-          <span>{{ data.total_count }}/20</span>
+          <span style="margin-right: 16px">文本列表:</span>
+          <span>
+            {{ data.cur_page_begin_index }} ~ {{ Math.min(data.cur_page_end_index, data.total_count) }} /
+            {{ data.total_count }}
+          </span>
         </div>
         <div class="list">
           <div v-for="(item, i) in data.record_list" :key="i + 'one'">
@@ -43,6 +46,13 @@
             </el-popconfirm>
           </div>
         </div>
+        <el-pagination
+          :current-page.sync="data.cur_page"
+          :page-size="20"
+          layout="prev, pager, next, jumper"
+          :total="data.total_count"
+          @current-change="handleCurrentChange"
+        />
       </div>
     </div>
   </div>
@@ -64,7 +74,6 @@ export default {
       txt: '',
       loading: false,
       token: null,
-      page: 1,
       pageSize: 20,
       data: null,
       file_id_list: [],
@@ -94,6 +103,7 @@ export default {
       // 通过 fileList 的 response 判断是否已全部完成上传
       if (fileList.every(({ response }) => response?.status)) {
         this.loading = true;
+        this.$refs.upload.clearFiles();
         AddTextFile({
           file_id_list: this.file_id_list,
         })
@@ -105,6 +115,7 @@ export default {
             this.$message.error(res.message);
           })
           .finally(() => {
+            this.file_id_list = [];
             this.loading = false;
           });
       }
@@ -284,7 +295,7 @@ export default {
      */
     pageQueryMyTextAnalyseRecordList(bol) {
       this.loading = true;
-      PageQueryMyTextAnalyseRecordList({ page_capacity: this.pageSize, cur_page: this.page })
+      PageQueryMyTextAnalyseRecordList({ page_capacity: this.pageSize, cur_page: this.data?.cur_page ?? 1 })
         .then((data) => {
           this.data = data;
           if (bol) {
@@ -295,6 +306,10 @@ export default {
           this.loading = false;
         });
     },
+    handleCurrentChange(val) {
+      this.data.cur_page = val;
+      this.pageQueryMyTextAnalyseRecordList();
+    },
   },
 };
 </script>
@@ -304,7 +319,7 @@ export default {
   min-height: 100%;
 
   .main {
-    min-height: 80.2vh;
+    min-height: calc(100vh - 64px - 54px - 24px);
     padding-top: 54px;
     padding-bottom: 24px;
     background: #f6f6f6;
@@ -388,7 +403,7 @@ export default {
       }
 
       .list {
-        margin-top: 16px;
+        margin: 16px 0 22px;
 
         > div {
           display: flex;