Ver Fonte

多语言

gcj há 3 anos atrás
pai
commit
5e5b7e7a45

+ 79 - 81
package-lock.json

@@ -1786,6 +1786,16 @@
           "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
           "dev": true
         },
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
         "cacache": {
           "version": "13.0.1",
           "resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz",
@@ -1812,6 +1822,53 @@
             "unique-filename": "^1.1.1"
           }
         },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true,
+          "optional": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true,
+          "optional": true
+        },
+        "loader-utils": {
+          "version": "2.0.2",
+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
+          "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "big.js": "^5.2.2",
+            "emojis-list": "^3.0.0",
+            "json5": "^2.1.2"
+          }
+        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz?cache=0&sync_timestamp=1598275560784&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsource-map%2Fdownload%2Fsource-map-0.6.1.tgz",
@@ -1828,6 +1885,16 @@
             "minipass": "^3.1.1"
           }
         },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        },
         "terser-webpack-plugin": {
           "version": "2.3.8",
           "resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz",
@@ -1844,6 +1911,18 @@
             "terser": "^4.6.12",
             "webpack-sources": "^1.4.3"
           }
+        },
+        "vue-loader-v16": {
+          "version": "npm:vue-loader@16.8.3",
+          "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
+          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chalk": "^4.1.0",
+            "hash-sum": "^2.0.0",
+            "loader-utils": "^2.0.0"
+          }
         }
       }
     },
@@ -12079,87 +12158,6 @@
         }
       }
     },
-    "vue-loader-v16": {
-      "version": "npm:vue-loader@16.5.0",
-      "resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.5.0.tgz?cache=0&sync_timestamp=1628666767864&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-loader%2Fdownload%2Fvue-loader-16.5.0.tgz",
-      "integrity": "sha1-CcTgcSRmiZ40uZpoZSTxkWX7KJI=",
-      "dev": true,
-      "optional": true,
-      "requires": {
-        "chalk": "^4.1.0",
-        "hash-sum": "^2.0.0",
-        "loader-utils": "^2.0.0"
-      },
-      "dependencies": {
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz",
-          "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
-        "chalk": {
-          "version": "4.1.2",
-          "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646655305&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz",
-          "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz",
-          "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
-          "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
-          "dev": true,
-          "optional": true
-        },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz",
-          "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
-          "dev": true,
-          "optional": true
-        },
-        "loader-utils": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
-          "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1626703414084&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
-          "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        }
-      }
-    },
     "vue-pdf": {
       "version": "4.2.0",
       "resolved": "https://registry.npm.taobao.org/vue-pdf/download/vue-pdf-4.2.0.tgz",

+ 4 - 4
src/components/Header.vue

@@ -43,7 +43,7 @@
         </el-dropdown>
       </template>
       <div v-if="!userMessage" class="selectLoginOrRegistration">
-        <span @click="cutLoginReg">登录</span>
+        <span @click="cutLoginReg"> <!-- 登录 -->{{ $t("Key9") }} </span>
       </div>
       <!-- 用户头像和用户名 -->
       <div class="user" v-else>
@@ -63,11 +63,11 @@
         <div class="userShow" v-show="userShow">
           <p @click="gotoPersonalcenter">
             <img src="../assets/login/project7.png" alt="" />
-            个人中心
+            <!-- 个人中心 -->{{ $t("Key8") }}
           </p>
           <p @click="QuitLogin">
             <img src="../assets/login/Frame77.png" alt="" />
-            退出登录
+            <!-- 退出登录 -->{{ $t("Key39") }}
           </p>
         </div>
       </div>
@@ -190,7 +190,7 @@ export default {
       _this.LoginNavIndex = command;
       if (!_this.userMessage) {
         this.$message.warning("请先登录");
-        this.projectName = "教研中心";
+        this.projectName = this.$t("Key5"); //"教研中心";
         window.location.href = "/";
         return;
       }

+ 4 - 2
src/components/Upload.vue

@@ -19,8 +19,10 @@
       :limit="filleNumber"
       :before-upload="handlebeforeUplaod"
     >
-      <el-button type="primary" v-if="type == '批量上传'">批量上传</el-button>
-      <el-button v-else>上传文件</el-button>
+      <el-button type="primary" v-if="type == '批量上传'">{{
+        $t("Key158")
+      }}</el-button>
+      <el-button v-else>{{ $t("Key152") }}</el-button>
     </el-upload>
   </div>
 </template>

+ 8 - 7
src/components/payment/Confirmorder.vue

@@ -13,7 +13,7 @@
           {{ data.name }}
         </p>
         <p class="p2">
-          <span>教研课程</span>
+          <span><!-- 教研资料 -->{{ $t("Key214") }}</span>
         </p>
         <p class="p3">
           <span v-for="(item, i) in data.teacher" :key="i + item">
@@ -26,7 +26,7 @@
       </div>
     </div>
     <div class="promotionCode">
-      <span class="sp1">使用优惠码</span>
+      <span class="sp1"> <!-- 使用优惠码 -->{{ $t("Key107") }} </span>
       <input
         v-model="discount_code"
         type="text"
@@ -38,26 +38,27 @@
         v-loading="codeloading"
         @click="verifyCode"
         v-if="isShow"
-        >确定</span
       >
+        <!-- 确定 -->{{ $t("Key94") }}
+      </span>
       <span class="sp2" v-else>-{{ discount_money }}</span>
     </div>
     <div class="total">
       <p class="p1">
-        <span> 一件商品,总金额: </span>
+        <span> {{ $t("Key53") }}: </span>
         <span class="co-value">¥{{ data.price }}</span>
       </p>
       <p class="p2">
-        <span> 优惠折扣: </span>
+        <span> {{ $t("Key54") }}: </span>
         <span class="co-value">-¥{{ discount_money }}</span>
       </p>
       <p class="p3">
-        <span> 应付: </span>
+        <span> {{ $t("Key55") }}: </span>
         <span class="co-value">¥{{ receivables_money }}</span>
       </p>
     </div>
     <div class="submitBtn">
-      <button @click="buy(data)">确定订单</button>
+      <button @click="buy(data)"><!-- 确定订单 -->{{ $t("Key58") }}</button>
     </div>
   </div>
 </template>

+ 6 - 6
src/components/payment/Payment.vue

@@ -13,7 +13,7 @@
           {{ data.name }}
         </p>
         <p class="p2">
-          <span>教研课程</span>
+          <span> <!-- 教研资料 -->{{ $t("Key214") }} </span>
         </p>
         <p class="p3">
           <span v-for="(item, i) in data.teacher" :key="i + item">
@@ -40,11 +40,11 @@
     </div>
     <div class="total">
       <p class="p1">
-        <span> 一件商品,总金额: </span>
+        <span> {{ $t("Key53") }}: </span>
         <span class="co-value">¥{{ data.price }}</span>
       </p>
       <p class="p2">
-        <span> 优惠折扣: </span>
+        <span> {{ $t("Key54") }}: </span>
         <span
           v-text="changediscount_money(this.discount_money)"
           class="co-value"
@@ -55,13 +55,13 @@
         <span class="co-value useCode">
           {{
             data.discount_code
-              ? "优惠码:" + data.discount_code
-              : "未使用优惠码"
+              ? $t("Key232") + data.discount_code
+              : $t("Key108")
           }}
         </span>
       </p>
       <p class="p3">
-        <span> 应付: </span>
+        <span> {{ $t("Key55") }}: </span>
         <span class="co-value">¥{{ data.receivables_money }}</span>
       </p>
     </div>

+ 3 - 3
src/components/teacher-dev/HeaderOne.vue

@@ -24,7 +24,7 @@
           type="text"
           name=""
           id=""
-          placeholder="搜索课程"
+          :placeholder="$t('Key43')"
           v-model="SeekName"
           @change="SeekName = SeekName.trim()"
         />
@@ -82,7 +82,7 @@ export default {
           });
         }
       } else {
-        this.$message.warning("请输入内容");
+        this.$message.warning(this.$t("Key46")); //请输入内容
       }
     },
     // 回车搜索
@@ -105,7 +105,7 @@ export default {
             });
           }
         } else {
-          this.$message.warning("请输入内容");
+          this.$message.warning(this.$t("Key46")); //请输入内容
         }
       }
     },

+ 1 - 1
src/components/teacher-dev/Teaching.vue

@@ -5,7 +5,7 @@
       <div class="title">
         <span class="text"> 教辅资料 </span>
         <div class="more" @click="goMore">
-          <span> 查看更多 </span>
+          <span> <!-- 查看更多  -->{{ $t("Key47") }} </span>
           <img src="../../assets/teacherdev/moreImage.png" alt="" />
         </div>
       </div>

+ 2 - 2
src/components/teacher-dev/Textbook.vue

@@ -3,9 +3,9 @@
   <div class="Textbook">
     <div class="top">
       <div class="title">
-        <span class="text"> 教研资料 </span>
+        <span class="text"> <!-- 教研资料 -->{{ $t("Key214") }} </span>
         <div class="more" @click="goMore">
-          <span> 查看更多 </span>
+          <span> <!-- 查看更多  -->{{ $t("Key47") }} </span>
           <img src="../../assets/teacherdev/moreImage.png" alt="" />
         </div>
       </div>

+ 1 - 1
src/components/teacher-dev/ToolBook.vue

@@ -5,7 +5,7 @@
       <div class="title">
         <span class="text"> 工具书 </span>
         <div class="more" @click="goMore">
-          <span> 查看更多 </span>
+          <span> <!-- 查看更多  -->{{ $t("Key47") }} </span>
           <img src="../../assets/teacherdev/moreImage.png" alt="" />
         </div>
       </div>

+ 1 - 1
src/components/teacher-devEntering/Nav.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="Nav">
     <span>
-      <span @click="back"> 教研中心 </span>
+      <span @click="back">{{ $t("Key5") }}</span>
       {{ title ? ` / ${title}` : "" }}</span
     >
   </div>

+ 42 - 41
src/permission.js

@@ -3,60 +3,61 @@ import store from './store'
 import { Message } from 'element-ui'
 import NProgress from 'nprogress' // progress bar
 import 'nprogress/nprogress.css' // progress bar style
-import { getToken, getConfig } from '@/utils/auth' // get token from cookie
+import { getToken, removeToken, getConfig } from '@/utils/auth' // get token from cookie
 import getPageTitle from '@/utils/get-page-title'
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
 const whiteList = ['/login'] // no redirect whitelist
 
-router.beforeEach(async(to, from, next) => {
-    // start progress bar
-    NProgress.start()
-        // set page title
-    document.title = getPageTitle(to.meta.title)
-        //next();
-    NProgress.done()
-    const hasToken = getToken()
+router.beforeEach(async (to, from, next) => {
+  // start progress bar
+  NProgress.start()
+  // set page title
+  document.title = getPageTitle(to.meta.title)
+  //next();
+  NProgress.done()
+  const hasToken = getToken()
 
-    if (hasToken) {
-        //=======重点部分以下=======
+  if (hasToken) {
+    //=======重点部分以下=======
 
-        let config = getConfig();
-        if (config) {
-            if (to.path === '/login') {
-                // if is logged in, redirect to the home page
-                next({ path: '/EnterSys' })
-                NProgress.done()
-            } else {
-                try {
-                    next()
-                } catch (error) {
-                    Message.error(error || 'Has Error')
-                    next(`/login?redirect=${to.path}`)
-                    NProgress.done()
-                }
-            }
-        } else {
-            next(`/login?redirect=${to.path}`)
-            NProgress.done()
+    let config = getConfig();
+    if (config) {
+      if (to.path === '/login') {
+        // if is logged in, redirect to the home page
+        next({ path: '/EnterSys' })
+        NProgress.done()
+      } else {
+        try {
+          next()
+        } catch (error) {
+          Message.error(error || 'Has Error')
+          next(`/login?redirect=${to.path}`)
+          NProgress.done()
         }
-        //=======重点部分以上=======
+      }
+    } else {
+      removeToken();
+      next(`/login?redirect=${to.path}`)
+      NProgress.done()
+    }
+    //=======重点部分以上=======
 
+  } else {
+    /* has no token*/
+    if (whiteList.indexOf(to.path) !== -1) {
+      // in the free login whitelist, go directly
+      next()
     } else {
-        /* has no token*/
-        if (whiteList.indexOf(to.path) !== -1) {
-            // in the free login whitelist, go directly
-            next()
-        } else {
-            // other pages that do not have permission to access are redirected to the login page.
-            next(`/login?redirect=${to.path}`)
-            NProgress.done()
-        }
+      // other pages that do not have permission to access are redirected to the login page.
+      next(`/login?redirect=${to.path}`)
+      NProgress.done()
     }
+  }
 })
 
 router.afterEach(() => {
-    // finish progress bar
-    NProgress.done()
+  // finish progress bar
+  NProgress.done()
 })

+ 89 - 88
src/router/index.js

@@ -6,105 +6,106 @@ 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("/teacherdevEntering");
-                    loadingInstance.close()
-                } else {
-                    next({ path: "/" });
-                    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,
-                    },
-                })
-                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: '/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: '*',
-        redirect: '/404'
+  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("/teacherdevEntering");
+        loadingInstance.close()
+      } else {
+        next({ path: "/" });
+        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,
+        },
+      })
+      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: '/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: '*',
+  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方法
+//修改原型对象中的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

+ 36 - 30
src/utils/i18n.js

@@ -12,35 +12,35 @@ import ruLocal from 'element-ui/lib/locale/lang/ru-RU';
 
 Vue.use(VueI18n);
 const i18n = new VueI18n({
-    locale: localStorage.getItem('language_type') || "ZH", //store.getters.language_type,
-    messages: {
-        ZH: {
-            ...zhLocal
-        },
-        AR: {
-            ...arLocal
-        },
-        EN: {
-            ...enLocal
-        },
-        JA: {
-            ...jaLocal
-        },
-        DE: {
-            ...deLocal
-        },
-        RU: {
-            ...ruLocal
-        }
+  locale: localStorage.getItem('language_type') || "ZH", //store.getters.language_type,
+  messages: {
+    ZH: {
+      ...zhLocal
     },
-    silentTranslationWarn: true
+    AR: {
+      ...arLocal
+    },
+    EN: {
+      ...enLocal
+    },
+    JA: {
+      ...jaLocal
+    },
+    DE: {
+      ...deLocal
+    },
+    RU: {
+      ...ruLocal
+    }
+  },
+  silentTranslationWarn: true
 });
 
 ElementLocale.i18n((key, value) => i18n.t(key, value));
 
 export async function setI18nLang(language_type) {
-    console.log(language_type);
-    await store.dispatch('lang/updateLanguageType', language_type);
+  console.log(language_type);
+  await store.dispatch('lang/updateLanguageType', language_type);
 }
 
 /**
@@ -48,18 +48,24 @@ export async function setI18nLang(language_type) {
  * @param {Object} Parameter word_key_list 需要读取的词汇
  */
 export function updateWordPack(Parameter) {
+  return new Promise((resolve, reject) => {
     Parameter.language_type = store.getters.language_type;
     let MethodName = 'language_manager-GetWordPack';
     getStaticContent(MethodName, Parameter).then(data => {
-        let localWord = i18n.messages[data.language_type];
-        if (localWord === undefined) {
-            localWord = {};
-        }
-        let wordPack = Object.assign(localWord, data.word_pack);
+      let localWord = i18n.messages[data.language_type];
+      if (localWord === undefined) {
+        localWord = {};
+      }
+      let wordPack = Object.assign(localWord, data.word_pack);
 
-        i18n.setLocaleMessage(data.language_type, wordPack);
-        // localStorage.setItem('i18n-message', JSON.stringify(i18n.messages));
+      i18n.setLocaleMessage(data.language_type, wordPack);
+      resolve()
+      // localStorage.setItem('i18n-message', JSON.stringify(i18n.messages));
+    }).catch(err => {
+      reject(err)
     });
+  })
+
 }
 
 export default i18n;

+ 228 - 0
src/views/404.vue

@@ -0,0 +1,228 @@
+<template>
+  <div class="wscn-http404-container">
+    <div class="wscn-http404">
+      <div class="pic-404">
+        <img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404">
+        <img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404">
+        <img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404">
+        <img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404">
+      </div>
+      <div class="bullshit">
+        <div class="bullshit__oops">OOPS!</div>
+        <div class="bullshit__info">All rights reserved
+          <a style="color:#20a0ff" href="https://wallstreetcn.com" target="_blank">wallstreetcn</a>
+        </div>
+        <div class="bullshit__headline">{{ message }}</div>
+        <div class="bullshit__info">Please check that the URL you entered is correct, or click the button below to return to the homepage.</div>
+        <a href="" class="bullshit__return-home">Back to home</a>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'Page404',
+  computed: {
+    message() {
+      return 'The webmaster said that you can not enter this page...'
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.wscn-http404-container{
+  transform: translate(-50%,-50%);
+  position: absolute;
+  top: 40%;
+  left: 50%;
+}
+.wscn-http404 {
+  position: relative;
+  width: 1200px;
+  padding: 0 50px;
+  overflow: hidden;
+  .pic-404 {
+    position: relative;
+    float: left;
+    width: 600px;
+    overflow: hidden;
+    &__parent {
+      width: 100%;
+    }
+    &__child {
+      position: absolute;
+      &.left {
+        width: 80px;
+        top: 17px;
+        left: 220px;
+        opacity: 0;
+        animation-name: cloudLeft;
+        animation-duration: 2s;
+        animation-timing-function: linear;
+        animation-fill-mode: forwards;
+        animation-delay: 1s;
+      }
+      &.mid {
+        width: 46px;
+        top: 10px;
+        left: 420px;
+        opacity: 0;
+        animation-name: cloudMid;
+        animation-duration: 2s;
+        animation-timing-function: linear;
+        animation-fill-mode: forwards;
+        animation-delay: 1.2s;
+      }
+      &.right {
+        width: 62px;
+        top: 100px;
+        left: 500px;
+        opacity: 0;
+        animation-name: cloudRight;
+        animation-duration: 2s;
+        animation-timing-function: linear;
+        animation-fill-mode: forwards;
+        animation-delay: 1s;
+      }
+      @keyframes cloudLeft {
+        0% {
+          top: 17px;
+          left: 220px;
+          opacity: 0;
+        }
+        20% {
+          top: 33px;
+          left: 188px;
+          opacity: 1;
+        }
+        80% {
+          top: 81px;
+          left: 92px;
+          opacity: 1;
+        }
+        100% {
+          top: 97px;
+          left: 60px;
+          opacity: 0;
+        }
+      }
+      @keyframes cloudMid {
+        0% {
+          top: 10px;
+          left: 420px;
+          opacity: 0;
+        }
+        20% {
+          top: 40px;
+          left: 360px;
+          opacity: 1;
+        }
+        70% {
+          top: 130px;
+          left: 180px;
+          opacity: 1;
+        }
+        100% {
+          top: 160px;
+          left: 120px;
+          opacity: 0;
+        }
+      }
+      @keyframes cloudRight {
+        0% {
+          top: 100px;
+          left: 500px;
+          opacity: 0;
+        }
+        20% {
+          top: 120px;
+          left: 460px;
+          opacity: 1;
+        }
+        80% {
+          top: 180px;
+          left: 340px;
+          opacity: 1;
+        }
+        100% {
+          top: 200px;
+          left: 300px;
+          opacity: 0;
+        }
+      }
+    }
+  }
+  .bullshit {
+    position: relative;
+    float: left;
+    width: 300px;
+    padding: 30px 0;
+    overflow: hidden;
+    &__oops {
+      font-size: 32px;
+      font-weight: bold;
+      line-height: 40px;
+      color: #1482f0;
+      opacity: 0;
+      margin-bottom: 20px;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-fill-mode: forwards;
+    }
+    &__headline {
+      font-size: 20px;
+      line-height: 24px;
+      color: #222;
+      font-weight: bold;
+      opacity: 0;
+      margin-bottom: 10px;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-delay: 0.1s;
+      animation-fill-mode: forwards;
+    }
+    &__info {
+      font-size: 13px;
+      line-height: 21px;
+      color: grey;
+      opacity: 0;
+      margin-bottom: 30px;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-delay: 0.2s;
+      animation-fill-mode: forwards;
+    }
+    &__return-home {
+      display: block;
+      float: left;
+      width: 110px;
+      height: 36px;
+      background: #1482f0;
+      border-radius: 100px;
+      text-align: center;
+      color: #ffffff;
+      opacity: 0;
+      font-size: 14px;
+      line-height: 36px;
+      cursor: pointer;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-delay: 0.3s;
+      animation-fill-mode: forwards;
+    }
+    @keyframes slideUp {
+      0% {
+        transform: translateY(60px);
+        opacity: 0;
+      }
+      100% {
+        transform: translateY(0);
+        opacity: 1;
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
src/views/login.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="login-container">
+  <div class="login-container" v-if="configInfor">
     <div class="login-left">
       <div class="login-texts">
         <p>

+ 29 - 4
src/views/teacher-dev/Preview.vue

@@ -21,7 +21,9 @@
             <span class="price_1" v-text="changePrice('1', data.price)"></span>
             <span class="price_2" v-text="changePrice('2', data.price)"></span>
           </div>
-          <div class="pay" @click="buy" v-if="!data.isPurchased">购买</div>
+          <div class="pay" @click="buy" v-if="!data.isPurchased">
+            <!-- 购买 -->{{ $t("Key72") }}
+          </div>
           <div class="download" v-if="data.isPurchased && IsDownload">
             <img
               @click="download"
@@ -82,7 +84,9 @@
       width="720px"
       :before-close="closeNoPyment"
     >
-      <div class="dialogTitle" slot="title">商品详情</div>
+      <div class="dialogTitle" slot="title">
+        <!-- 商品详情 -->{{ $t("Key52") }}
+      </div>
       <Confirmorder
         ref="Confirmorder"
         :data="data"
@@ -112,7 +116,7 @@ import HeaderOne from "@/components/teacher-dev/HeaderOne";
 import pdf from "vue-pdf";
 import Confirmorder from "@/components/payment/Confirmorder";
 import Payment from "@/components/payment/Payment";
-import Cookies from "js-cookie";
+import { updateWordPack } from "@/utils/i18n";
 import { getToken } from "@/utils/auth";
 
 import {
@@ -332,7 +336,28 @@ export default {
         });
     },
   },
-  created() {},
+  async created() {
+    await updateWordPack({
+      word_key_list: [
+        "Key5",
+        "Key8",
+        "Key9",
+        "Key39",
+        "Key52",
+        "Key53",
+        "Key54",
+        "Key55",
+        "Key58",
+        "Key72",
+        "Key94",
+        "Key107",
+        "Key214",
+        "Key232",
+        "Key108",
+      ],
+    });
+    this.isData = true;
+  },
   mounted() {
     this.materialId = this.$route.query.id;
     this.Ispreview = this.$route.query.type;

+ 41 - 28
src/views/teacher-dev/Viewmore.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 查看更多 -->
-  <div class="Viewmore">
+  <div class="Viewmore" v-if="isData">
     <Header />
 
     <HeaderOne :changeKeycode="changeKeycode" :keycode="keycode" :text="text" />
@@ -39,7 +39,7 @@
             class="inline-input"
             v-model="TeacherName"
             :fetch-suggestions="querySearch"
-            placeholder="请输入内容"
+            :placeholder="$t('Key46')"
             :trigger-on-focus="false"
             @select="handleSelect"
           ></el-autocomplete>
@@ -91,6 +91,7 @@ import Header from "@/components/Header";
 import HeaderOne from "@/components/teacher-dev/HeaderOne";
 import Teaching from "@/components/teacher-dev/Teaching";
 import { materiallist, teacherlist } from "@/api/api";
+import { updateWordPack } from "@/utils/i18n";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {
@@ -102,21 +103,9 @@ export default {
   data() {
     //这里存放数据
     return {
+      isData: false,
       seleIndex: null, //筛选索引
-      seleList: [
-        {
-          name: "名称",
-          isUp: null, //是不是升序
-        },
-        {
-          name: "发布时间",
-          isUp: null, //是不是升序
-        },
-        {
-          name: "浏览次数",
-          isUp: null, //是不是升序
-        },
-      ],
+      seleList: [],
       selePeole: "", //筛选的名字
       gotoPage: "", //前往某一页
       DataList: null,
@@ -210,14 +199,7 @@ export default {
         item.isUp = false;
         this.seleIndex = i;
       }
-      switch (item.name) {
-        case "名称":
-          this.orderColumn = "1";
-        case "发布时间":
-          this.orderColumn = "2";
-        case "浏览次数":
-          this.orderColumn = "3";
-      }
+      this.orderColumn = item.id + "";
       if (item.isUp) {
         this.orderType = "ASC";
       } else {
@@ -268,18 +250,49 @@ export default {
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {
+  async created() {
+    await updateWordPack({
+      word_key_list: [
+        "Key8",
+        "Key9",
+        "Key39",
+        "Key44",
+        "Key45",
+        "Key46",
+        "Key165",
+        "Key225",
+        "Key248",
+      ],
+    });
+    this.isData = true;
+    this.seleList = [
+      {
+        name: this.$t("Key225"), //"名称",
+        isUp: null, //是不是升序
+        id: 1,
+      },
+      {
+        name: this.$t("Key165"), //"发布时间",
+        isUp: null, //是不是升序
+        id: 2,
+      },
+      {
+        name: "浏览次数",
+        isUp: null, //是不是升序
+        id: 3,
+      },
+    ];
     if (this.$route.query.classify) {
       if (this.$route.query.classify == "TEXTBOOK") {
-        this.text = "教材";
+        this.text = this.$t("Key44"); //"教材";
       }
       if (this.$route.query.classify == "TEACHING") {
-        this.text = "教学";
+        this.text = this.$t("Key45"); //"教学";
       }
       this.tag.push(this.$route.query.classify);
     }
     if (this.$route.query.keyWord) {
-      this.text = "搜索结果";
+      this.text = this.$t("Key248"); //"搜索结果";
       this.keycode = this.$route.query.keyWord;
     }
     this.getdata();

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

@@ -13,15 +13,18 @@
           active-text-color="#FF9900"
         >
           <el-menu-item index="TEXTBOOK">教辅资料</el-menu-item>
-          <el-menu-item index="TEACHING">教研资料</el-menu-item>
+          <el-menu-item index="TEACHING">
+            <!-- 教研资料 -->{{ $t("Key214") }}
+          </el-menu-item>
           <el-menu-item index="TOOLBOOK">工具书</el-menu-item>
         </el-menu>
         <div class="seek" @keyup="keyDownSeekData">
+          <!-- 搜索课程 -->
           <input
             type="text"
             name=""
             id=""
-            placeholder="搜索课程"
+            :placeholder="$t('Key43')"
             v-model="SeekName"
             @change="SeekName = SeekName.trim()"
           />
@@ -57,10 +60,9 @@ import Excel from "@/components/teacher-dev/Excel";
 import Textbook from "@/components/teacher-dev/Textbook";
 import Teaching from "@/components/teacher-dev/Teaching";
 import ToolBook from "@/components/teacher-dev/ToolBook";
+import { materiallist } from "@/api/api";
+import { updateWordPack } from "@/utils/i18n";
 
-import Cookies from "js-cookie";
-import { VerifyLogin, materiallist } from "@/api/api";
-import { getToken } from "../../utils/auth";
 export default {
   name: "teacher_edu",
   components: {
@@ -162,7 +164,20 @@ export default {
         });
     },
   },
-  created() {
+  async created() {
+    await updateWordPack({
+      word_key_list: [
+        "Key5",
+        "Key8",
+        "Key9",
+        "Key39",
+        "Key43",
+        "Key47",
+        "Key214",
+        "Key214",
+      ],
+    });
+    this.isData = true;
     // 需要根据身份信息来判断是进入首页还是录入
     // if (token) {
     //   if (JSON.parse(token).popedom_code_list.indexOf(2000006) != -1) {

+ 66 - 22
src/views/teacher-devEntering/creadDocument.vue

@@ -2,18 +2,24 @@
   <div
     :class="['creadDocument', language_type == 'AR' ? 'text_right' : '']"
     v-loading="loading"
+    v-if="isData"
   >
     <Header />
     <Nav title="创建文档" />
     <div class="title">
       <div>创建文档</div>
       <div class="btn">
-        <el-button @click="submit('form')" style="width: 180px" type="primary"
-          >完成</el-button
-        >
-        <el-button @click="preview" style="width: 180px" type="warning"
-          >预览</el-button
+        <!-- 完成 -->
+        <el-button
+          @click="submit('form')"
+          style="width: 180px"
+          type="primary"
+          >{{ $t("Key83") }}</el-button
         >
+
+        <el-button @click="preview" style="width: 180px" type="warning">
+          <!-- 预览 -->{{ $t("Key144") }}
+        </el-button>
       </div>
     </div>
     <div class="content">
@@ -23,10 +29,11 @@
           ref="form"
           :model="form"
           :rules="rules"
-          label-width="100px"
+          label-width="151px"
           :show-message="false"
         >
-          <el-form-item label="名称" prop="name">
+          <!-- 文档 -->
+          <el-form-item :label="$t('Key225')" prop="name">
             <el-input
               v-model="form.name"
               style="width: 500px"
@@ -34,7 +41,8 @@
               @change="form.name = form.name.trim()"
             ></el-input>
           </el-form-item>
-          <el-form-item label="作者" prop="author">
+          <!-- 作者 -->
+          <el-form-item :label="$t('Key227')" prop="author">
             <el-input
               v-model="form.author"
               style="width: 500px"
@@ -42,22 +50,24 @@
               @change="authorChange"
             ></el-input>
           </el-form-item>
-          <el-form-item label="定价" prop="price">
+          <!-- 定价 -->
+          <el-form-item :label="$t('Key135')" prop="price">
             <el-input
               v-model="form.price"
               style="width: 500px"
-              placeholder="请输入价格"
+              :placeholder="$t('Key138')"
               @input="priceInput"
               @blur="priceBlur"
             >
               <template slot="prepend">¥</template>
             </el-input>
           </el-form-item>
-          <el-form-item label="所属机构" prop="institutionID">
+          <!-- 所属机构 -->
+          <el-form-item :label="$t('Key136')" prop="institutionID">
             <el-select
               v-model="form.institutionID"
               style="width: 500px"
-              placeholder="请选择机构"
+              :placeholder="$t('Key139')"
             >
               <el-option
                 v-for="item in institutionList"
@@ -68,20 +78,27 @@
               </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="下载" prop="download">
+          <!-- 下载 -->
+          <el-form-item :label="$t('Key242')" prop="download">
             <el-radio-group v-model="form.download">
-              <el-radio label="downloadable">开启</el-radio>
-              <el-radio label="0">关闭</el-radio>
+              <el-radio label="downloadable">
+                <!-- 开启 -->{{ $t("Key245") }}
+              </el-radio>
+              <el-radio label="0"> <!-- 关闭 -->{{ $t("Key246") }} </el-radio>
             </el-radio-group>
           </el-form-item>
-          <el-form-item label="分类" prop="classify">
+          <!-- 分类 -->
+          <el-form-item :label="$t('Key243')" prop="classify">
             <el-radio-group v-model="form.classify">
               <el-radio label="TEXTBOOK">教辅资料</el-radio>
-              <el-radio label="TEACHING">教研资料</el-radio>
+              <el-radio label="TEACHING">
+                <!-- 教研资料 -->{{ $t("Key214") }}
+              </el-radio>
               <el-radio label="TOOLBOOK">工具书</el-radio>
             </el-radio-group>
           </el-form-item>
-          <el-form-item label="文档" prop="file">
+          <!-- 文档 -->
+          <el-form-item :label="$t('Key244')" prop="file">
             <Upload
               :accept="'.doc,.docx,.xls,.xlsx,.pdf,.ppt,.pptx'"
               :fileList="form.fileList"
@@ -101,7 +118,7 @@ import Header from "@/components/Header";
 import Nav from "@/components/teacher-devEntering/Nav";
 import Upload from "@/components/Upload";
 import { mapGetters } from "vuex";
-
+import { updateWordPack } from "@/utils/i18n";
 import {
   materialdetail,
   attachmentinsert,
@@ -118,6 +135,7 @@ export default {
   },
   data() {
     return {
+      isData: false,
       form: {
         name: "",
         author: "",
@@ -371,7 +389,32 @@ export default {
         });
     },
   },
-  created() {
+  async created() {
+    await updateWordPack({
+      word_key_list: [
+        "Key5",
+        "Key8",
+        "Key9",
+        "Key39",
+        "Key83",
+        "Key114",
+        "Key135",
+        "Key136",
+        "Key138",
+        "Key139",
+        "Key144",
+        "Key152",
+        "Key214",
+        "Key225",
+        "Key227",
+        "Key242",
+        "Key243",
+        "Key244",
+        "Key245",
+        "Key246",
+      ],
+    });
+    this.isData = true;
     this.loading = true;
     this.materialId = this.$route.query.materialId;
     if (this.materialId) {
@@ -410,8 +453,8 @@ export default {
     display: flex;
     .from {
       width: 100%;
-      padding: 50px 70px;
-      max-width: 700px;
+      padding: 50px 20px;
+      max-width: 751px;
     }
 
     .addclass {
@@ -432,6 +475,7 @@ export default {
     font-size: 16px;
     color: #000000;
     margin-right: 51px;
+    margin-left: 51px;
   }
   .el-upload-list__item-name {
     margin-left: 50px;

+ 36 - 8
src/views/teacher-devEntering/discountCodeList.vue

@@ -1,14 +1,15 @@
 <template>
-  <div class="discountCodeList">
+  <div class="discountCodeList" v-if="isData">
     <Header />
     <Nav title="优惠码管理" />
     <div class="contentInner">
       <div class="search-form">
         <el-form :inline="true" ref="form" style="margin-left: 10px">
           <el-form-item>
+            <!-- 优惠码 -->
             <el-form-item
               class="label-input"
-              label="优惠码"
+              :label="$t('Key232')"
               style="margin-right: 30px"
             >
               <el-input
@@ -33,7 +34,9 @@
             label="导出选项:"
             style="margin-right: 30px"
           >
-            <el-radio v-model="exportRadio" :label="-1">全部</el-radio>
+            <el-radio v-model="exportRadio" :label="-1">
+              <!-- 全部 -->{{ $t("Key110") }}
+            </el-radio>
             <el-radio v-model="exportRadio" :label="1">已使用</el-radio>
             <el-radio v-model="exportRadio" :label="0">未使用</el-radio>
           </el-form-item>
@@ -52,40 +55,48 @@
           style="width: 100%"
           v-loading="tableloading"
         >
+          <!-- 优惠码 -->
           <el-table-column
             class="table-firstC"
-            label="优惠码"
+            :label="$t('Key232')"
             prop="discount_code"
             width="150"
           ></el-table-column>
+          <!-- 状态 -->
           <el-table-column
-            label="状态"
+            :label="$t('Key164')"
             prop="is_used"
             width="150"
             :formatter="handleStatus"
           ></el-table-column>
+          <!-- 使用者 -->
           <el-table-column
             label="使用者"
             prop="consumer_name"
             width="150"
           ></el-table-column>
+          <!-- 使用时间 -->
           <el-table-column
             label="使用时间"
             prop="use_time"
             width="200"
           ></el-table-column>
+          <!-- 使用者所属机构 -->
           <el-table-column
             label="使用者所属机构"
             prop="consumer_org_name"
             width="250"
           ></el-table-column>
+          <!-- 创建时间 -->
           <el-table-column
-            label="创建时间"
+            :label="$t('Key163')"
             prop="create_time"
             width="200"
           ></el-table-column>
-          <el-table-column fixed="right" label="操作" prop width="100">
+          <!-- 操作 -->
+          <el-table-column fixed="right" :label="$t('Key166')" prop width="100">
             <template slot-scope="scope">
+              <!-- 删除 -->
               <el-button @click="handleDel(scope.row)" type="text"
                 >删除</el-button
               >
@@ -112,6 +123,7 @@ import Nav from "@/components/teacher-devEntering/Nav";
 import { BookgetContent, LearnWebSI } from "@/api/api";
 import { getToken } from "@/utils/auth";
 import { encodeURL } from "js-base64";
+import { updateWordPack } from "@/utils/i18n";
 export default {
   name: "courselist",
   components: {
@@ -135,10 +147,26 @@ export default {
       exportRadio: -1,
       exportLoading: false,
       goods_type: null,
+      isData: false,
     };
   },
-  created() {
+  async created() {
+    await updateWordPack({
+      word_key_list: [
+        "Key5",
+        "Key8",
+        "Key9",
+        "Key39",
+        "Key110",
+        "Key164",
+        "Key163",
+        "Key166",
+        "Key232",
+      ],
+    });
+
     const _this = this;
+    _this.isData = true;
     _this.bookId = this.$route.query.bookId;
     _this.goods_type = this.$route.query.goods_type;
     this.getList();

+ 64 - 27
src/views/teacher-devEntering/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 教研中心录入 -->
-  <div class="teacher-devEntering">
+  <div class="teacher-devEntering" v-if="isData">
     <Header />
     <Nav />
     <div class="top">
@@ -8,7 +8,7 @@
         <input
           v-model="keyWord"
           @change="keyWord = keyWord.trim()"
-          placeholder="请输入内容"
+          :placeholder="$t('Key46')"
         />
         <img
           @click="seekData"
@@ -21,6 +21,7 @@
         <div style="margin: 0 23px">
           <!-- 
             :fileList="fileList"
+           
            -->
           <Upload
             type="批量上传"
@@ -29,7 +30,9 @@
             :accept="'.doc,.docx,.xls,.xlsx,.pdf,.ppt,.pptx'"
           />
         </div>
-        <el-button type="primary" @click="newDocument">新建文档</el-button>
+        <el-button type="primary" @click="newDocument">
+          <!-- 新建文档 -->{{ $t("Key159") }}
+        </el-button>
       </div>
     </div>
     <div class="table" v-loading="loading">
@@ -46,45 +49,54 @@
           :formatter="handlefileType"
         ></el-table-column>
         <el-table-column
-          label="发布时间"
+          :label="$t('Key159')"
           prop="updateTime"
           width="200"
         ></el-table-column>
+        <!-- 下载 -->
         <el-table-column
           :formatter="handledownload"
-          label="下载"
+          :label="$t('Key242')"
           prop="download"
           width="150"
         ></el-table-column>
+        <!-- 状态 -->
         <el-table-column
-          label="状态"
+          :label="$t('Key164')"
           prop="status"
           width="150"
           :formatter="handleStatus"
         ></el-table-column>
-        <el-table-column label="操作" prop>
+        <!-- 操作 -->
+        <el-table-column :label="$t('Key166')" prop>
           <template slot-scope="scope">
-            <el-button @click="handleEdit(scope.row, scope.$index)" type="text"
-              >编辑</el-button
-            >
-            <el-button @click="handleDel(scope.row)" type="text"
-              >删除</el-button
-            >
-            <el-button @click="handleDiscount(scope.row)" type="text"
-              >优惠码</el-button
+            <!-- 编辑 -->
+            <el-button
+              @click="handleEdit(scope.row, scope.$index)"
+              type="text"
+              >{{ $t("Key123") }}</el-button
             >
+            <!-- 删除 -->
+            <el-button @click="handleDel(scope.row)" type="text">{{
+              $t("Key172")
+            }}</el-button>
+            <!-- 优惠码 -->
+            <el-button @click="handleDiscount(scope.row)" type="text">{{
+              $t("Key232")
+            }}</el-button>
+            <!-- 上架 -->
             <el-button
               v-if="scope.row.status != 4"
               @click="up(scope.row)"
               type="text"
-              >上架</el-button
+              >{{ $t("Key125") }}</el-button
             >
-
+            <!-- 下架 -->
             <el-button
               v-if="scope.row.status != 3"
               @click="down(scope.row)"
               type="text"
-              >下架</el-button
+              >{{ $t("Key124") }}</el-button
             >
           </template>
         </el-table-column>
@@ -105,8 +117,6 @@
 import Header from "@/components/Header";
 import Nav from "@/components/teacher-devEntering/Nav";
 import Upload from "@/components/Upload";
-import { getToken } from "@/utils/auth";
-import { usertenant } from "@/api/api";
 import {
   VerifyLogin,
   materiallist,
@@ -115,9 +125,9 @@ import {
   attachmentinsert,
   materialoutOfStockAction,
   materialinStockAction,
+  usertenant,
 } from "@/api/api";
-import Cookies from "js-cookie";
-
+import { updateWordPack } from "@/utils/i18n";
 export default {
   name: "teacher-devEntering",
   components: {
@@ -147,6 +157,7 @@ export default {
       pageNum: 1,
       pageSize: 10,
       institutionList: null,
+      isData: false,
     };
   },
   methods: {
@@ -308,9 +319,9 @@ export default {
     handledownload(row) {
       let index = row.tag.indexOf("downloadable");
       if (index != -1) {
-        return "开启";
+        return this.$t("Key245"); //"开启";
       } else {
-        return "关闭";
+        return this.$t("Key246"); //"关闭";
       }
     },
     // 处理文档类型
@@ -325,9 +336,9 @@ export default {
     // 处理发布状态
     handleStatus(row) {
       if (row.status == 4) {
-        return "已上架";
+        return this.$t("Key126"); //已上架
       } else if (row.status == 3) {
-        return "已下架";
+        return this.$t("Key127"); //"已下架";
       }
     },
     // 新建文档
@@ -353,7 +364,33 @@ export default {
         });
     },
   },
-  created() {
+  async created() {
+    await updateWordPack({
+      word_key_list: [
+        "Key5",
+        "Key8",
+        "Key9",
+        "Key39",
+        "Key46",
+        "Key123",
+        "Key124",
+        "Key125",
+        "Key126",
+        "Key127",
+        "Key152",
+        "Key158",
+        "Key159",
+        "Key164",
+        "Key165",
+        "Key166",
+        "Key172",
+        "Key242",
+        "Key245",
+        "Key246",
+        "Key232",
+      ],
+    });
+    this.isData = true;
     // 获取当前可编辑机构
     usertenant({})
       .then((res) => {