Browse Source

i8n-登录&菜单

Shan9312 10 months ago
parent
commit
3b0d30a8a5

BIN
src/assets/images/logo-en-i.png


BIN
src/assets/images/logo-en-m.png


BIN
src/assets/images/logo-en.png


+ 2 - 1
src/i18n.js

@@ -10,7 +10,8 @@ import zhlogin from './lang/cn.js'
 Vue.use(VueI18n)
 
 const i18n = new VueI18n({
-  locale: 'CN', // set locale
+  locale: 'EN', // set locale
+  fallbackLocale: 'EN', // 默认语言设置,当其他语言没有的情况下,使用en作为默认语言
   messages: {
     EN: {
       ...enLocale,

+ 99 - 2
src/lang/cn.js

@@ -19,7 +19,10 @@ export default {
     closed: '关闭',
     saveSuccess: '保存成功',
     deleteSuccess: '删除成功',
-    openGuide: '开启新手引导'
+    openGuide: '开启新手引导',
+    requestMsg:'请求超时',
+    logoIcon: require('../assets/images/logo1.png'),
+    logoM: require('../assets/images/logo_u3.png'),
   },
   auth: {
     useTestAccount: '不想注册?点我使用测试账号',
@@ -31,7 +34,18 @@ export default {
     emailPlaceholder: '请输入邮箱',
     usernamePlaceholder: '请输入用户名',
     logout: '登出',
-    signUpSuccess: '注册成功,请登录'
+    signUpSuccess: '注册成功,请登录',
+    logo: require('../assets/images/logo.png'),
+    userBtn: '登录',
+    userTname: '请输入正确的用户名',
+    userTpassword: '请输入正确的密码',
+    password: '密码',
+    username: '用户名',
+    rePassword: '记住密码',
+     passwordTest:'密码不少于6位',
+     logpMsg:'You have been logged out. You can cancel or log in again',
+     relogo:'Log in again',//重新登陆
+     conLogo:'Confirm logout' //   确认注销
   },
   navbar: {
     document: '文档',
@@ -150,5 +164,88 @@ export default {
     none: '-',
     custbiaozhun: '标准差',
     custbianyi: '变异系数'
+  },
+  menus: {
+    首页: '首页',
+    //
+    统计分析:'统计分析',
+      仪表盘:'仪表盘',
+      配方统计:'配方统计',
+      推料计划分析:'推料计划分析',
+      过程分析:"过程分析",
+      图表:'图表',
+      准确性分析:'准确性分析',
+      饲喂效率:'饲喂效率',
+      库存管理:'库存管理',
+      硬件测试:'硬件测试',
+      配方评估:'配方评估',
+      //
+      配方计划:'配方计划',
+      配方模板:'配方模板',
+      配方下发:'配方下发',
+      栏舍配方:'栏舍配方',
+      预混计划:'预混计划',
+      撒料计划:'撒料计划',
+      剩料计划:'剩料计划',
+      日执行计划:'日执行计划',
+      推料计划:'推料计划',
+      配方评估:'配方评估',
+      //
+      栏舍生产:'栏舍生产',
+      栏舍生产性能:'栏舍生产性能',
+      栏舍剩料记录:'栏舍剩料记录',
+      配方干物质:'配方干物质',
+      宾州筛:'宾州筛',
+      粪便筛:'粪便筛',
+      粪便评分:'粪便评分',
+      体况评分:'体况评分',
+      值班记录:'值班记录',
+      栏舍剩料记录:"栏舍剩料记录",
+     //
+     库存管理:'库存管理t',
+     入库管理:'入库管理',
+     系统用量:'系统用量',
+     人工用量:'人工用量',
+     盘点单:'盘点单',
+     库存预警:'库存预警',
+     库存统计:'库存统计',
+     饲料合同:'饲料合同',
+     //
+     基础数据:'基础数据',
+     驾驶员:'驾驶员',
+     TMR设备:'TMR设备',
+     其他设备管理:'其他设备管理',
+     牲畜类别:'牲畜类别',
+     舍组栏:'舍组栏',
+     饲料分类:'饲料分类',
+     饲料表:'饲料表',
+     供应商管理:'供应商管理',
+     标准参数:'标准参数',
+     默认参数配置:'默认参数配置',
+     sap日志:'sap日志',
+     //
+     系统管理:'系统管理',
+     集团信息:'集团信息',
+     图表2:'图表2',
+     仪表盘2:'仪表盘2',
+     数据同步:'数据同步',
+     牧场信息:'牧场信息',
+     角色管理:'角色管理',
+     用户管理:'用户管理',
+     操作日志:'操作日志',
+     仪表盘管理:'仪表盘管理',
+     运营管理:'运营管理',
+     标签管理:'标签管理',
+     通知管理:'通知管理',
+     消息接收:'消息接收',
+     提醒设置:'提醒设置',
+     //
+     后台管理:'后台管理',
+     硬件调用:'硬件调用',
+     菜单管理:'菜单管理',
+     字典管理:'字典管理',
+     SQL管理:'SQL管理',
+     测试:'Test',
+
   }
 }

+ 99 - 2
src/lang/en.js

@@ -19,7 +19,12 @@ export default {
     closed: 'Closed',
     saveSuccess: 'Success saved',
     deleteSuccess: 'Deleted',
-    openGuide: 'Show tutorial'
+    openGuide: 'Show tutorial',
+    requestMsg:'Request Timeout',
+    logoIcon: require('../assets/images/logo-en-i.png'),
+    logoM: require('../assets/images/logo-en-m.png'),
+    relogo:'Log in again',//重新登陆
+     conLogo:'Confirm logout' //   确认注销
   },
   auth: {
     useTestAccount: 'Click here to use test account',
@@ -31,7 +36,17 @@ export default {
     emailPlaceholder: 'Please enter your email',
     usernamePlaceholder: 'Please enter your username',
     logout: 'Log Out',
-    signUpSuccess: 'Sign up success, please sign in'
+    signUpSuccess: 'Sign up success, please sign in',
+    logo: require('../assets/images/logo-en.png'),
+    userBtn: 'Login',
+    userTname: 'Please enter correct username',
+    userTpassword: 'Please enter correct password',
+    password: 'Password',
+    username: 'Username',
+    rePassword: 'Remember Password',
+    passwordTest:'The password must be at least 6 characters long',
+
+
   },
   navbar: {
     document: 'Document',
@@ -148,5 +163,87 @@ export default {
     min: 'Min',
     count: 'Count',
     none: '-'
+  },
+
+  menus: {
+    首页: 'Home',
+    //
+    统计分析:'Statistical Analysis',
+      仪表盘:'Dashboard',
+      配方统计:'Formula Statistics',
+      推料计划分析:'Feed Push Plan Analysis',
+      过程分析:"rocess Analysis",
+      图表:'Chart',
+      准确性分析:'Accuracy Analysis',
+      饲喂效率:'Feeding Efficiency',
+      库存管理:'Inventory Management',
+      硬件测试:'Hardware Testing',
+      配方评估:'Formula Evaluation',
+      //
+      配方计划:'Formula Plan',
+      配方模板:'Formula Template',
+      配方下发:'Formula Issuance',
+      栏舍配方:'Pen Formula',
+      预混计划:'Premix Plan',
+      撒料计划:'Feed Spreading Plan',
+      剩料计划:'Leftover Feed Plan',
+      日执行计划:'Daily Execution Plan',
+      推料计划:'Feed Push Plan',
+      配方评估:'ormula Evaluation',
+      //
+      栏舍生产:'Shelter Production',
+      栏舍生产性能:'Shelter Production Performance',
+      配方干物质:'Formula Dry Matter',
+      宾州筛:'Penn State Sieve',
+      粪便筛:'Manure Sieve',
+      粪便评分:'Manure Scoring',
+      体况评分:'Body Condition Scoring',
+      值班记录:'Duty Record',
+      栏舍剩料记录:"Shelter Leftover Feed Record",
+     //
+     库存管理:'Inventory Management',
+     入库管理:'Inward Stock Management',
+     系统用量:'System Usage',
+     人工用量:'Labor Usage',
+     盘点单:'Inventory Count Sheet',
+     库存预警:'Inventory Alert',
+     库存统计:'Inventory Statistics',
+     饲料合同:'Feed Contract',
+     //
+     基础数据:'Basic Data',
+     驾驶员:'Driver',
+     TMR设备:'TMR Equipment',
+     其他设备管理:'Other Equipment Management',
+     牲畜类别:'Livestock Category',
+     舍组栏:'Shelter Group Pen',
+     饲料分类:'Feed Classification',
+     饲料表:'Feed Chart',
+     供应商管理:'Supplier Management',
+     标准参数:'Standard Parameters',
+     默认参数配置:'Default Parameter Configuration',
+     sap日志:'SAP Log',
+     //
+     系统管理:'System Management',
+     集团信息:'Group Information',
+     图表2:'Chart',
+     仪表盘2:'Dashboard',
+     数据同步:'Data Synchronization',
+     牧场信息:'Ranch Information',
+     角色管理:'Role Management',
+     用户管理:'User Management',
+     操作日志:'Operation Log',
+     仪表盘管理:'Dashboard Management',
+     运营管理:'Operation Management',
+     标签管理:'Label Management',
+     通知管理:'Notification Management',
+     消息接收:'Message Management',
+     提醒设置:'Reminder Settings',
+     //
+     后台管理:'Back-end Management',
+     硬件调用:'Hardware Invocation',
+     菜单管理:'Menu Management',
+     字典管理:'Dictionary Management',
+     SQL管理:'SQL Management',
+     测试:'Test',
   }
 }

+ 77 - 37
src/layout/components/Navbar.vue

@@ -1,7 +1,11 @@
 <template>
   <div class="navbar">
     <div class="left-menu">
-      <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
+      <hamburger
+        :is-active="sidebar.opened"
+        class="hamburger-container"
+        @toggleClick="toggleSideBar"
+      />
     </div>
     <h3 class="tmrTitle">TMRWatch全混合日粮监管系统</h3>
     <div class="right-menu">
@@ -29,18 +33,29 @@
         </el-dropdown-menu>
       </el-dropdown> -->
 
+      <!-- 切换中英文 -->
+      <el-switch
+        class="swichs"
+        v-model="langValue"
+        :active-text="active_text"
+        :inactive-text="inactive_text"
+        @change="translate"
+      ></el-switch>
+
       <el-dropdown class="avatar-container" trigger="click">
         <div class="avatar-wrapper">
           <!-- <img src="@/assets/cow.jpg" class="user-avatar"> -->
-          <span style="font-size:12px;color: #fff;">欢迎您,{{ employename }}</span>
-          <i class="el-icon-caret-bottom" style="color: #fff;" />
+          <span style="font-size: 12px; color: #fff"
+            >欢迎您,{{ employename }}</span
+          >
+          <i class="el-icon-caret-bottom" style="color: #fff" />
         </div>
         <el-dropdown-menu slot="dropdown" class="user-dropdown">
           <router-link to="/">
             <el-dropdown-item> 主页 </el-dropdown-item>
           </router-link>
           <el-dropdown-item divided>
-            <span style="display:block;" @click="logout">注销</span>
+            <span style="display: block" @click="logout">注销</span>
           </el-dropdown-item>
           <router-link to="/changpwd/Changpwd">
             <el-dropdown-item> 修改密码 </el-dropdown-item>
@@ -70,7 +85,12 @@ export default {
   data() {
     return {
       sumAmount: '',
-      meslist: ''
+      meslist: '',
+
+      langValue: false,
+      lang: '',
+      active_text: '',
+      inactive_text: ''
     }
   },
   computed: {
@@ -85,6 +105,7 @@ export default {
     ])
   },
   created() {
+    this.setSwitch()
     // window.setInterval(() => {
     //   setTimeout(() => {
     //     this.sumAmount = JSON.parse(sessionStorage.sumamount)
@@ -93,6 +114,19 @@ export default {
     // }, 100)
   },
   methods: {
+    // 切换中英文
+    setSwitch() {
+      this.active_text = navigator.language === 'zh' ? '英文' : '中文'
+      this.inactive_text = navigator.language === 'zh' ? '中文' : '英文'
+      this.lang = navigator.language
+    },
+    // 切换调用
+    translate() {
+      this.lang = this.lang === 'zh' ? 'en' : 'zh'
+      console.log(this.lang)
+      this.$i18n.locale = this.lang
+    },
+
     toggleSideBar() {
       this.$store.dispatch('app/toggleSideBar')
     },
@@ -103,32 +137,38 @@ export default {
       })
       // this.$router.push(`/login?redirect=${this.$route.fullPath}`)   //跳转到登陆前页面
     }
-
   }
 }
 </script>
 
 <style lang="scss" scoped>
+.swichs {
+  padding: 0 20px;
+  color: #fff;
+}
 .navbar {
   height: 50px;
   overflow: hidden;
   position: relative;
   background: url(../../assets/images/index/topBg.png);
-  box-shadow: 0 1px 4px rgba(0,21,41,.08);
-  .tmrTitle{color: #fff;float: left;}
+  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
+  .tmrTitle {
+    color: #fff;
+    float: left;
+  }
   .hamburger-container {
     line-height: 46px;
     height: 100%;
     float: left;
     cursor: pointer;
     color: #fff !important;
-    transition: background .3s;
-    -webkit-tap-highlight-color:transparent;
+    transition: background 0.3s;
+    -webkit-tap-highlight-color: transparent;
     &:hover {
-      background: rgba(255, 255, 255, .025)
+      background: rgba(255, 255, 255, 0.025);
     }
   }
-  h3{
+  h3 {
     margin-top: 13px;
   }
   .breadcrumb-container {
@@ -154,10 +194,10 @@ export default {
 
       &.hover-effect {
         cursor: pointer;
-        transition: background .3s;
+        transition: background 0.3s;
 
         &:hover {
-          background: rgba(0, 0, 0, .025)
+          background: rgba(0, 0, 0, 0.025);
         }
       }
     }
@@ -186,39 +226,39 @@ export default {
       }
     }
 
-    .right-menu-news{
-      margin-right:25px;
-      position:relative;
-      .right-menu-news-icon{
-        display:block;
-        float:left;
-        width:25px;
-        height:40px;
+    .right-menu-news {
+      margin-right: 25px;
+      position: relative;
+      .right-menu-news-icon {
+        display: block;
+        float: left;
+        width: 25px;
+        height: 40px;
       }
-      .right-menu-news-right{
-        display:block;
-        width:20px;
-        height:20px;
-        float:left;
+      .right-menu-news-right {
+        display: block;
+        width: 20px;
+        height: 20px;
+        float: left;
         border-radius: 10px;
-        background:red;
-        font-style:normal;
-        position:absolute;
-        right:-12px;
-        bottom:25px;
+        background: red;
+        font-style: normal;
+        position: absolute;
+        right: -12px;
+        bottom: 25px;
         font-weight: 300;
-        font-size:12px ;
+        font-size: 12px;
         line-height: 20px;
-        text-align:center;
-        color:#fff;
+        text-align: center;
+        color: #fff;
       }
     }
   }
 }
 </style>
 <style lang="scss" >
-.user-dropdown{
-  top: 40px!important;
+.user-dropdown {
+  top: 40px !important;
   color: #fff !important;
 }
 </style>

+ 82 - 82
src/layout/components/Sidebar/Logo.vue

@@ -1,82 +1,82 @@
-<template>
-  <div class="sidebar-logo-container" :class="{'collapse':collapse}">
-    <transition name="sidebarLogoFade">
-      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/" style="background:#fff;">
-        <img src="@/assets/images/logo1.png" class="sidebar-logo">
-        <!-- <h1 v-else class="sidebar-title">{{ title }} </h1> -->
-      </router-link>
-      <router-link v-else key="expand" class="sidebar-logo-link" to="/">
-        <img src="@/assets/images/logo_u3.png" style="max-height:100%;max-width:100%;">
-        <!-- <h1 class="sidebar-title">{{ title }} </h1> -->
-      </router-link>
-    </transition>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'SidebarLogo',
-  props: {
-    collapse: {
-      type: Boolean,
-      required: true
-    }
-  },
-  data() {
-    return {
-      // title: 'Vue Admin Template',
-      // logo: '../../../assets/images/logo_u3.png'
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.sidebarLogoFade-enter-active {
-  transition: opacity 1.5s;
-}
-
-.sidebarLogoFade-enter,
-.sidebarLogoFade-leave-to {
-  opacity: 0;
-}
-
-.sidebar-logo-container {
-  position: relative;
-  width: 100%;
-  height: 50px;
-  line-height: 50px;
-  background: #fff;
-  text-align: center;
-  overflow: hidden;
-
-  & .sidebar-logo-link {
-    height: 100%;
-    width: 100%;
-
-    & .sidebar-logo {
-      width: 32px;
-      height: 32px;
-      vertical-align: middle;
-      margin-right: 12px;
-    }
-
-    & .sidebar-title {
-      display: inline-block;
-      margin: 0;
-      color: #fff;
-      font-weight: 600;
-      line-height: 50px;
-      font-size: 14px;
-      font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
-      vertical-align: middle;
-    }
-  }
-
-  &.collapse {
-    .sidebar-logo {
-      margin-right: 0px;
-    }
-  }
-}
-</style>
+<template>
+  <div class="sidebar-logo-container" :class="{'collapse':collapse}">
+    <transition name="sidebarLogoFade">
+      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/" style="background:#fff;">
+        <img :src="$t('common.logoIcon')" class="sidebar-logo">
+        <!-- <h1 v-else class="sidebar-title">{{ title }} </h1> -->
+      </router-link>
+      <router-link v-else key="expand" class="sidebar-logo-link" to="/">
+        <img :src="$t('common.logoM')" style="max-height:100%;max-width:100%;">
+        <!-- <h1 class="sidebar-title">{{ title }} </h1> -->
+      </router-link>
+    </transition>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'SidebarLogo',
+  props: {
+    collapse: {
+      type: Boolean,
+      required: true
+    }
+  },
+  data() {
+    return {
+      // title: 'Vue Admin Template',
+      // logo: '../../../assets/images/logo_u3.png'
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.sidebarLogoFade-enter-active {
+  transition: opacity 1.5s;
+}
+
+.sidebarLogoFade-enter,
+.sidebarLogoFade-leave-to {
+  opacity: 0;
+}
+
+.sidebar-logo-container {
+  position: relative;
+  width: 100%;
+  height: 50px;
+  line-height: 50px;
+  background: #fff;
+  text-align: center;
+  overflow: hidden;
+
+  & .sidebar-logo-link {
+    height: 100%;
+    width: 100%;
+
+    & .sidebar-logo {
+      width: 32px;
+      height: 32px;
+      vertical-align: middle;
+      margin-right: 12px;
+    }
+
+    & .sidebar-title {
+      display: inline-block;
+      margin: 0;
+      color: #fff;
+      font-weight: 600;
+      line-height: 50px;
+      font-size: 14px;
+      font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
+      vertical-align: middle;
+    }
+  }
+
+  &.collapse {
+    .sidebar-logo {
+      margin-right: 0px;
+    }
+  }
+}
+</style>

+ 105 - 98
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,101 +1,108 @@
-<template>
-  <div v-if="!item.hidden" class="menu-wrapper">
-    <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
-      <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
-          <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
-        </el-menu-item>
-      </app-link>
-    </template>
-
-    <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
-      <template slot="title">
-        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
-      </template>
-      <template v-for="child in item.children">
-        <sidebar-item
-          v-if="child.path!='Changpwd' && child.path!='ChartPanel' && child.path!='Addboard' "
-          :key="child.path"
-          :is-nest="true"
-          :item="child"
-          :base-path="resolvePath(child.path)"
-          class="nest-menu"
-        />
-      </template>
-
-    </el-submenu>
-  </div>
-</template>
-
-<script>
-import path from 'path'
-import { isExternal } from '@/utils/validate'
-import Item from './Item'
-import AppLink from './Link'
-import FixiOSBug from './FixiOSBug'
-
-export default {
-  name: 'SidebarItem',
-  components: { Item, AppLink },
-  mixins: [FixiOSBug],
-  props: {
-    // route object
-    item: {
-      type: Object,
-      required: true
-    },
-    isNest: {
-      type: Boolean,
-      default: false
-    },
-    basePath: {
-      type: String,
-      default: ''
-    }
-  },
-  data() {
-    // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
-    // TODO: refactor with render function
-    this.onlyOneChild = null
-    return {}
-  },
-  methods: {
-    hasOneShowingChild(children = [], parent) {
+<template>
+  <div v-if="!item.hidden" class="menu-wrapper">
+    <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
+      <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
+        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
+          <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="menusTitle(onlyOneChild.meta.title)" :lang="$i18n.locale"  />
+        </el-menu-item>
+      </app-link>
+    </template>
+
+    <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
+      <template slot="title">
+        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="menusTitle(item.meta.title) " />
+      </template>
+      <template v-for="child in item.children">
+        <sidebar-item
+          v-if="child.path!='Changpwd' && child.path!='ChartPanel' && child.path!='Addboard' "
+          :key="child.path"
+          :is-nest="true"
+          :item="child"
+          :base-path="resolvePath(child.path)"
+          class="nest-menu"
+        />
+      </template>
+
+    </el-submenu>
+  </div>
+</template>
+
+<script>
+import path from 'path'
+import { isExternal } from '@/utils/validate'
+import Item from './Item'
+import AppLink from './Link'
+import FixiOSBug from './FixiOSBug'
+
+export default {
+  name: 'SidebarItem',
+  components: { Item, AppLink },
+  mixins: [FixiOSBug],
+  props: {
+    // route object
+    item: {
+      type: Object,
+      required: true
+    },
+    isNest: {
+      type: Boolean,
+      default: false
+    },
+    basePath: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
+    // TODO: refactor with render function
+    this.onlyOneChild = null
+    return {}
+  },
+  methods: {
+    // 动态获取菜单EN
+    menusTitle(item) {
+      if (this.$t('menus.' + item.trim())) {
+        return this.$t('menus.' + item.trim())
+      }
+      return item
+    },
+    hasOneShowingChild(children = [], parent) {
       const showingChildren = children.filter(item => {
-        // console.log(item)
-        if (item.hidden) {
-          return false
-        } else {
+        // console.log(item)
+        if (item.hidden) {
+          return false
+        } else {
           // Temp set(will be used if only has one showing child)
           if (item.name !== 'Changpwd') {
-            this.onlyOneChild = item
-            return true
-          }
-        }
-      })
-
-      // When there is only one child router, the child router is displayed by default
-      if (showingChildren.length === 1) {
-        return true
-      }
-
-      // Show parent if there are no child router to display
-      if (showingChildren.length === 0) {
-        this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
-        return true
-      }
-
-      return false
-    },
-    resolvePath(routePath) {
-      if (isExternal(routePath)) {
-        return routePath
-      }
-      if (isExternal(this.basePath)) {
-        return this.basePath
-      }
-      return path.resolve(this.basePath, routePath)
-    }
-  }
-}
-</script>
+            this.onlyOneChild = item
+            return true
+          }
+        }
+      })
+
+      // When there is only one child router, the child router is displayed by default
+      if (showingChildren.length === 1) {
+        return true
+      }
+
+      // Show parent if there are no child router to display
+      if (showingChildren.length === 0) {
+        this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
+        return true
+      }
+
+      return false
+    },
+    resolvePath(routePath) {
+      if (isExternal(routePath)) {
+        return routePath
+      }
+      if (isExternal(this.basePath)) {
+        return this.basePath
+      }
+      return path.resolve(this.basePath, routePath)
+    }
+  }
+}
+</script>

+ 101 - 98
src/layout/index.vue

@@ -1,98 +1,101 @@
-<template>
-  <div :class="classObj" class="app-wrapper">
-    <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
-    <sidebar class="sidebar-container" />
-    <div :class="{hasTagsView:needTagsView}" class="main-container">
-      <div :class="{'fixed-header':fixedHeader}">
-        <navbar />
-        <tags-view />
-      </div>
-      <app-main />
-    </div>
-  </div>
-</template>
-
-<script>
-import { Navbar, Sidebar, AppMain, TagsView } from './components'
-import ResizeMixin from './mixin/ResizeHandler'
-
-export default {
-  name: 'Layout',
-  components: {
-    Navbar,
-    Sidebar,
-    AppMain,
-    TagsView
-  },
-  mixins: [ResizeMixin],
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    device() {
-      return this.$store.state.app.device
-    },
-    needTagsView() {
-      return this.$store.state.settings.tagsView
-    },
-    fixedHeader() {
-      return this.$store.state.settings.fixedHeader
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened,
-        withoutAnimation: this.sidebar.withoutAnimation,
-        mobile: this.device === 'mobile'
-      }
-    }
-  },
-  methods: {
-    handleClickOutside() {
-      this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-  @import "~@/styles/mixin.scss";
-  @import "~@/styles/variables.scss";
-
-  .app-wrapper {
-    @include clearfix;
-    position: relative;
-    height: 100%;
-    width: 100%;
-    &.mobile.openSidebar{
-      position: fixed;
-      top: 0;
-    }
-  }
-  .drawer-bg {
-    background: #000;
-    opacity: 0.3;
-    width: 100%;
-    top: 0;
-    height: 100%;
-    position: absolute;
-    z-index: 999;
-  }
-
-  .fixed-header {
-    position: fixed;
-    top: 0;
-    right: 0;
-    z-index: 9;
-    width: calc(100% - #{$sideBarWidth});
-    transition: width 0.28s;
-  }
-
-  .hideSidebar .fixed-header {
-    width: calc(100% - 54px)
-  }
-
-  .mobile .fixed-header {
-    width: 100%;
-  }
-</style>
+<template>
+  <div :class="classObj" class="app-wrapper">
+    <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
+    <sidebar class="sidebar-container" :lang="$i18n.locale" />
+    <div :class="{hasTagsView:needTagsView}" class="main-container" :lang="$i18n.locale" >
+      <div :class="{'fixed-header':fixedHeader}" :lang="$i18n.locale" >
+        <navbar />
+        <tags-view />
+      </div>
+      <app-main />
+    </div>
+  </div>
+</template>
+
+<script>
+import { Navbar, Sidebar, AppMain, TagsView } from './components'
+import ResizeMixin from './mixin/ResizeHandler'
+
+export default {
+  name: 'Layout',
+  components: {
+    Navbar,
+    Sidebar,
+    AppMain,
+    TagsView
+  },
+  mixins: [ResizeMixin],
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    device() {
+      return this.$store.state.app.device
+    },
+    needTagsView() {
+      return this.$store.state.settings.tagsView
+    },
+    fixedHeader() {
+      return this.$store.state.settings.fixedHeader
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened,
+        withoutAnimation: this.sidebar.withoutAnimation,
+        mobile: this.device === 'mobile'
+      }
+    }
+  },
+  methods: {
+    handleClickOutside() {
+      this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  @import "~@/styles/mixin.scss";
+  @import "~@/styles/variables.scss";
+
+  .app-wrapper {
+    @include clearfix;
+    position: relative;
+    height: 100%;
+    width: 100%;
+    &.mobile.openSidebar{
+      position: fixed;
+      top: 0;
+    }
+  }
+  .drawer-bg {
+    background: #000;
+    opacity: 0.3;
+    width: 100%;
+    top: 0;
+    height: 100%;
+    position: absolute;
+    z-index: 999;
+  }
+
+  .fixed-header {
+    position: fixed;
+    top: 0;
+    right: 0;
+    z-index: 9;
+    width: calc(100% - #{$sideBarWidth});
+    transition: width 0.28s;
+    &:lang(en){
+      width: calc(100% - #{$sideBarWidth2});
+    }
+  }
+
+  .hideSidebar .fixed-header {
+    width: calc(100% - 54px)
+  }
+
+  .mobile .fixed-header {
+    width: 100%;
+  }
+</style>

+ 226 - 208
src/styles/sidebar.scss

@@ -1,216 +1,234 @@
-#app {
-
-  .main-container {
-    min-height: 100%;
-    transition: margin-left .28s;
-    margin-left: $sideBarWidth;
-    position: relative;
-  }
-
-  .sidebar-container {
-    transition: width 0.28s;
-    width: $sideBarWidth !important;
-    background-color: $menuBg;
-    height: 100%;
-    position: fixed;
-    font-size: 0px;
-    top: 0;
-    bottom: 0;
-    left: 0;
-    z-index: 1001;
-    overflow: hidden;
-
-    // reset element-ui css
-    .horizontal-collapse-transition {
-      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
-    }
-
-    .scrollbar-wrapper {
-      overflow-x: hidden !important;
-    }
-
-    .el-scrollbar__bar.is-vertical {
-      right: 0px;
-    }
-
-    .el-scrollbar {
-      height: 100%;
-    }
-
-    &.has-logo {
-      .el-scrollbar {
-        height: calc(100% - 50px);
-      }
-    }
-
-    .is-horizontal {
-      display: none;
-    }
-
-    a {
-      display: inline-block;
-      width: 100%;
-      overflow: hidden;
-    }
-
-    .svg-icon {
-      margin-right: 16px;
-    }
-
-    .el-menu {
-      border: none;
-      height: 100%;
-      width: 100% !important;
-    }
-
-    // menu hover
-    .submenu-title-noDropdown,
-    .el-submenu__title {
-      &:hover {
-        background-color: $menuHover !important;
-      }
-    }
-
-    .is-active>.el-submenu__title {
+#app {
+
+  .main-container {
+    min-height: 100%;
+    transition: margin-left .28s;
+    margin-left: $sideBarWidth;
+    position: relative;
+    &:lang(en) {
+      margin-left: $sideBarWidth2;
+    }
+  }
+
+  .sidebar-container {
+    transition: width 0.28s;
+    width: $sideBarWidth !important;
+    background-color: $menuBg;
+    height: 100%;
+    position: fixed;
+    font-size: 0px;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    z-index: 1001;
+    overflow: hidden;
+    &:lang(en) {
+      width: $sideBarWidth2 !important;
+    }
+
+    // reset element-ui css
+    .horizontal-collapse-transition {
+      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
+    }
+
+    .scrollbar-wrapper {
+      overflow-x: hidden !important;
+    }
+
+    .el-scrollbar__bar.is-vertical {
+      right: 0px;
+    }
+
+    .el-scrollbar {
+      height: 100%;
+    }
+
+    &.has-logo {
+      .el-scrollbar {
+        height: calc(100% - 50px);
+      }
+    }
+
+    .is-horizontal {
+      display: none;
+    }
+
+    a {
+      display: inline-block;
+      width: 100%;
+      overflow: hidden;
+    }
+
+    .svg-icon {
+      margin-right: 16px;
+    }
+
+    .el-menu {
+      border: none;
+      height: 100%;
+      width: 100% !important;
+    }
+
+    // menu hover
+    .submenu-title-noDropdown,
+    .el-submenu__title {
+      &:hover {
+        background-color: $menuHover !important;
+      }
+    }
+
+    .is-active>.el-submenu__title {
       color: $subMenuActiveText !important;
-      color:$subMenuHover !important;
-    }
-    & .nest-menu .el-submenu>.el-submenu__title,
-    & .el-submenu .el-menu-item {
-      min-width: $sideBarWidth !important;
-      background-color: $subMenuBg !important;
-
-      &:hover {
+      color:$subMenuHover !important;
+    }
+    & .nest-menu .el-submenu>.el-submenu__title,
+    & .el-submenu .el-menu-item {
+      min-width: $sideBarWidth !important;
+      background-color: $subMenuBg !important;
+
+      &:hover {
         background-color: $subMenuHover !important;
-        color: #fff !important;
-      }
-    }
-  }
+        color: #fff !important;
+      }
+      &:lang(en){
+        min-width: $sideBarWidth2 !important;
+      }
+    }
+  }
   .is-active .el-menu .menu-wrapper .router-link-active .is-active{
     background-color: $menuActiveBg !important;
     color: #fff !important;
-  }
-  .hideSidebar {
-    .sidebar-container {
-      width: 54px !important;
-    }
-
-    .main-container {
-      margin-left: 54px;
-    }
-
-    .submenu-title-noDropdown {
-      padding: 0 !important;
-      position: relative;
-
-      .el-tooltip {
-        padding: 0 !important;
-
-        .svg-icon {
-          margin-left: 20px;
-        }
-      }
-    }
-
-    .el-submenu {
-      overflow: hidden;
-
-      &>.el-submenu__title {
-        padding: 0 !important;
-
-        .svg-icon {
-          margin-left: 20px;
-        }
-
-        .el-submenu__icon-arrow {
-          display: none;
-        }
-      }
-    }
-
-    .el-menu--collapse {
-      .el-submenu {
-        &>.el-submenu__title {
-          &>span {
-            height: 0;
-            width: 0;
-            overflow: hidden;
-            visibility: hidden;
-            display: inline-block;
-          }
-        }
-      }
-    }
-  }
-
-  .el-menu--collapse .el-menu .el-submenu {
-    min-width: $sideBarWidth !important;
-  }
-
-  // mobile responsive
-  .mobile {
-    .main-container {
-      margin-left: 0px;
-    }
-
-    .sidebar-container {
-      transition: transform .28s;
-      width: $sideBarWidth !important;
-    }
-
-    &.hideSidebar {
-      .sidebar-container {
-        pointer-events: none;
-        transition-duration: 0.3s;
-        transform: translate3d(-$sideBarWidth, 0, 0);
-      }
-    }
-  }
-
-  .withoutAnimation {
-
-    .main-container,
-    .sidebar-container {
-      transition: none;
-    }
-  }
-}
-
-// when menu collapsed
-.el-menu--vertical {
-  &>.el-menu {
-    .svg-icon {
-      margin-right: 16px;
-    }
-  }
-
-  .nest-menu .el-submenu>.el-submenu__title,
-  .el-menu-item {
-    &:hover {
-      // you can use $subMenuHover
-      background-color: $menuHover !important;
-    }
-  }
-
-  // the scroll bar appears when the subMenu is too long
-  >.el-menu--popup {
-    max-height: 100vh;
-    overflow-y: auto;
-
-    &::-webkit-scrollbar-track-piece {
-      background: #d3dce6;
-    }
-
-    &::-webkit-scrollbar {
-      width: 6px;
-    }
-
-    &::-webkit-scrollbar-thumb {
-      background: #99a9bf;
-      border-radius: 20px;
-    }
-  }
-}
+  }
+  .hideSidebar {
+    .sidebar-container {
+      width: 54px !important;
+    }
+
+    .main-container {
+      margin-left: 54px;
+    }
+
+    .submenu-title-noDropdown {
+      padding: 0 !important;
+      position: relative;
+
+      .el-tooltip {
+        padding: 0 !important;
+
+        .svg-icon {
+          margin-left: 20px;
+        }
+      }
+    }
+
+    .el-submenu {
+      overflow: hidden;
+
+      &>.el-submenu__title {
+        padding: 0 !important;
+
+        .svg-icon {
+          margin-left: 20px;
+        }
+
+        .el-submenu__icon-arrow {
+          display: none;
+        }
+      }
+    }
+
+    .el-menu--collapse {
+      .el-submenu {
+        &>.el-submenu__title {
+          &>span {
+            height: 0;
+            width: 0;
+            overflow: hidden;
+            visibility: hidden;
+            display: inline-block;
+          }
+        }
+      }
+    }
+  }
+
+  .el-menu--collapse .el-menu .el-submenu {
+    min-width: $sideBarWidth !important;
+    &:lang(en){
+      min-width: $sideBarWidth2 !important;
+    }
+  }
+
+  // mobile responsive
+  .mobile {
+    .main-container {
+      margin-left: 0px;
+    }
+
+    .sidebar-container {
+      transition: transform .28s;
+      width: $sideBarWidth !important;
+      &:lang(en){
+        width: $sideBarWidth2 !important;
+      }
+    }
+
+    &.hideSidebar {
+      .sidebar-container {
+        pointer-events: none;
+        transition-duration: 0.3s;
+        transform: translate3d(-$sideBarWidth, 0, 0);
+        &:lang(en){
+          transform: translate3d(-$sideBarWidth2, 0, 0);
+        }
+      }
+    }
+  }
+
+  .withoutAnimation {
+
+    .main-container,
+    .sidebar-container {
+      transition: none;
+    }
+  }
+}
+
+// when menu collapsed
+.el-menu--vertical {
+  &>.el-menu {
+    .svg-icon {
+      margin-right: 16px;
+    }
+  }
+
+  .nest-menu .el-submenu>.el-submenu__title,
+  .el-menu-item {
+    &:hover {
+      // you can use $subMenuHover
+      background-color: $menuHover !important;
+    }
+  }
+
+  // the scroll bar appears when the subMenu is too long
+  >.el-menu--popup {
+    max-height: 100vh;
+    overflow-y: auto;
+
+    &::-webkit-scrollbar-track-piece {
+      background: #d3dce6;
+    }
+
+    &::-webkit-scrollbar {
+      width: 6px;
+    }
+
+    &::-webkit-scrollbar-thumb {
+      background: #99a9bf;
+      border-radius: 20px;
+    }
+  }
+}
 #app .sidebar-container .nest-menu .el-submenu > .el-submenu__title:active, #app .sidebar-container .el-submenu .el-menu-item:active{
   background-color: $menuActiveBg !important;
 }

+ 2 - 0
src/styles/variables.scss

@@ -22,6 +22,8 @@ $subMenuBgHover:#009C69;
 $subMenuHover:#009C69;
 
 $sideBarWidth: 210px;
+$sideBarWidth2:278px;
+
 
 // the :export directive is the magic sauce for webpack
 // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

+ 3 - 3
src/utils/request.js

@@ -76,7 +76,7 @@ service.interceptors.response.use(
     if (res.code !== 200) {
       Message({
         // message: res.msg + res.code,
-        message: '请求超时',
+        message: this.$t('common.requestMsg'),
         type: 'error',
         duration: 5 * 1000
       })
@@ -86,7 +86,7 @@ service.interceptors.response.use(
         // to re-login
         MessageBox.confirm('你已经注销登陆,你可以取消或重新登陆', '确认注销', {
           confirmButtonText: '重新登陆',
-          cancelButtonText: '取消',
+          cancelButtonText: this.$t('common.cancel'),
           type: 'warning'
         }).then(() => {
           store.dispatch('user/resetToken').then(() => {
@@ -124,7 +124,7 @@ service.interceptors.response.use(
     // 其他牧场失败后需要多次尝试
     if (config.__retryCount >= 3) {
       // Message({ message:error.message, type: 'error', duration: 5 * 1000 })
-      Message({ message:'请求超时', type: 'error', duration: 5 * 1000 })
+      Message({ message:this.$t('common.requestMsg'), type: 'error', duration: 5 * 1000 })
       // Message.error((error && error.data && error.data.msg) || '请求超时')
       return Promise.reject(error)
     }

File diff suppressed because it is too large
+ 624 - 623
src/views/basicData/groupColumn/index.vue


+ 377 - 255
src/views/login/index.vue

@@ -1,9 +1,13 @@
-<template>
+<template>
   <div class="login-container">
     <div class="new-login">
       <div class="new-login-l">
-        <img src="@/assets/images/logo.png" alt="">
+        <div class="imgs">
+          <img :src="$t('auth.logo')" alt="" :lang="$i18n.locale">
+         <div class="img-text" :lang="$i18n.locale">TMR TOTAL MIXED RATIONS MANAGEMENT SYSTEM</div>
+        </div>
       </div>
+
       <div class="new-login-r">
         <div class="title">{{$t('auth.signIn')}}</div>
         <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
@@ -11,27 +15,27 @@
             <span class="svg-container">
               <svg-icon icon-class="user" />
             </span>
-            <el-input ref="username" v-model="loginForm.username" :placeholder="$t('user_name')" name="username" type="text" tabindex="1" auto-complete="on" />
+            <el-input ref="username" v-model="loginForm.username" :placeholder="$t('auth.username')" name="username" type="text" tabindex="1" auto-complete="on" />
           </el-form-item>
 
           <el-form-item prop="password" class="password">
             <span class="svg-container">
               <svg-icon icon-class="password" />
             </span>
-            <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" :placeholder="$t('password')" name="password" tabindex="2" auto-complete="on" @keyup.enter.native="handleLogin" />
+            <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" :placeholder="$t('auth.password')" name="password" tabindex="2" auto-complete="on" @keyup.enter.native="handleLogin" />
             <span class="show-pwd" @click="showPwd">
               <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
             </span>
           </el-form-item>
-          <el-form-item prop="password" class="rememberPassword">
+          <el-form-item  class="rememberPassword">
             <input id="remember-password-checkbox" v-model="rememberPassword" type="checkbox" value="remember-me" @click="doRememberPassword($event)">
             <span for="remember-password-checkbox">
-              {{$t('remember_password')}}
+              {{$t('auth.rePassword')}}
             </span>
             </input>
           </el-form-item>
         </el-form>
-        <el-button type="text" :loading="loading" class="btn" @click.native.prevent="handleLogin">登录</el-button>
+        <el-button type="text" :loading="loading" class="btn" @click.native.prevent="handleLogin">{{$t('auth.userBtn')}}</el-button>
       </div>
     </div>
     <div style="position: absolute;bottom: 0;left: 0;right:0;color: #000;background: #fee; opacity: .7; font-size: 14px;">
@@ -42,96 +46,114 @@
       </p>
 
     </div>
-  </div>
-</template>
-
-<script>
-import { validUsername } from '@/utils/validate'
+  </div>
+</template>
+
+<script>
+import { validUsername } from '@/utils/validate'
 import Cookies from 'js-cookie'
 import { getToken } from '@/utils/auth'
-import axios from 'axios';
-const md5 = require("md5")
-export default {
-  name: 'Login',
-  data() {
-    const validateUsername = (rule, value, callback) => {
-      if (!validUsername(value)) {
-        callback(new Error('请输入正确的用户名'))
-      } else {
-        callback()
-      }
-    }
-    const validatePassword = (rule, value, callback) => {
-      if (value.length < 6) {
-        callback(new Error('密码不能少于6个字符'))
-      } else {
-        callback()
-      }
-    }
-    return {
-      loginForm: {
-        username: '',
-        password: ''
-      },
-      loginRules: {
-        username: [
-          { required: true, trigger: 'blur', validator: validateUsername }
-        ],
-        password: [
-          { required: true, trigger: 'blur', validator: validatePassword }
-        ]
-      },
-      loading: false,
-      passwordType: 'password',
+import axios from 'axios'
+const md5 = require('md5')
+export default {
+  name: 'Login',
+  data() {
+    const validateUsername = (rule, value, callback) => {
+      if (!validUsername(value)) {
+        callback(new Error(this.$t('auth.userTname')))
+      } else {
+        callback()
+      }
+    }
+    const validatePassword = (rule, value, callback) => {
+      if (!value.length) {
+        callback(new Error(this.$t('auth.userTpassword')))
+      } else if (value.length < 6) {
+        callback(new Error(this.$t('auth.passwordTest')))
+      } else {
+        callback()
+      }
+    }
+    return {
+      loginForm: {
+        username: '',
+        password: ''
+      },
+      loginRules: {
+        username: [
+          {
+            required: true,
+            trigger: 'blur',
+            message: this.$t('auth.usernamePlaceholder')
+            // validator: validateUsername
+          }
+        ],
+        password: [
+          {
+            required: true,
+            // message: this.$t('auth.passwordPlaceholder'),
+            trigger: 'blur',
+            validator: validatePassword
+          }
+        ]
+      },
+      loading: false,
+      passwordType: 'password',
       redirect: undefined,
-      rememberPassword: ''
-    }
-  },
-  watch: {
-    $route: {
-      handler: function(route) {
-        this.redirect = route.query && route.query.redirect
-      },
-      immediate: true
-    }
-  },
-  created() {
-    var that = this
-    document.onkeydown = function(e) {
-      e = window.event || e
-      // eslint-disable-next-line eqeqeq
-      if (that.$route.path == '/login' && (e.code == 'Enter' || e.code == 'Num Enter')) { // 验证在登录界面和按得键是回车键enter
-        that.handleLogin('ruleForm2') // 登录函数 (handleSubmit2('ruleForm2')-登录按钮的点击事件)
-      }
-    }
+      rememberPassword: ''
+    }
   },
-  mounted: function() {
+  watch: {
+    $route: {
+      handler: function (route) {
+        this.redirect = route.query && route.query.redirect
+      },
+      immediate: true
+    }
+  },
+  created() {
+    var that = this
+    document.onkeydown = function (e) {
+      e = window.event || e
+      // eslint-disable-next-line eqeqeq
+      if (
+        that.$route.path == '/login' &&
+        (e.code == 'Enter' || e.code == 'Num Enter')
+      ) {
+        // 验证在登录界面和按得键是回车键enter
+        that.handleLogin('ruleForm2') // 登录函数 (handleSubmit2('ruleForm2')-登录按钮的点击事件)
+      }
+    }
+  },
+  mounted: function () {
     // 读取cookie中的账号信息,如果有accountInfo的话,则说明该用户之前勾选了记住密码的功能,则需要自动填上账号密码
     this.loadAccountInfo()
-  },
-  methods: {
-    showPwd() {
-      if (this.passwordType === 'password') {
-        this.passwordType = ''
-      } else {
-        this.passwordType = 'password'
-      }
-      this.$nextTick(() => {
-        this.$refs.password.focus()
-      })
-    },
+  },
+  methods: {
+    showPwd() {
+      if (this.passwordType === 'password') {
+        this.passwordType = ''
+      } else {
+        this.passwordType = 'password'
+      }
+      this.$nextTick(() => {
+        this.$refs.password.focus()
+      })
+    },
     handleLogin() {
       var obj = {
         username: this.loginForm.username,
         password: md5(this.loginForm.password)
       }
       var rememberStatus = this.rememberPassword
-      var accountInfo = this.loginForm.username + '&' + this.loginForm.password
-      this.$refs.loginForm.validate(valid => {
-        if (valid) {
+      var accountInfo = this.loginForm.username + '&' + this.loginForm.password
+      this.$refs.loginForm.validate((valid) => {
+        if (valid) {
           this.loading = true
-          this.$store.dispatch('user/login', obj).then(() => {
-          // this.$store.dispatch('user/login', this.loginForm).then(() => {
+          this.$store
+            .dispatch('user/login', obj)
+            .then(() => {
+              // this.$store.dispatch('user/login', this.loginForm).then(() => {
               if (rememberStatus) {
                 console.log('勾选了记住密码,现在开始写入cookie')
                 Cookies.set('accountInfo', accountInfo, 1440 * 3)
@@ -143,24 +165,24 @@ export default {
               // 若为本地环境 则手写cookie
               if (window.location.href.indexOf('localhost') != -1) {
                 Cookies.set('token', getToken(), 1440)
-              }
-              this.$router.push({ path: this.redirect || '/' })
-              this.loading = false
-            })
-            .catch(() => {
-              this.loading = false
-            })
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
+              }
+              this.$router.push({ path: this.redirect || '/' })
+              this.loading = false
+            })
+            .catch(() => {
+              this.loading = false
+            })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     },
     doRememberPassword() {
       const rememberStatus = this.rememberPassword
       this.rememberPassword = !rememberStatus
     },
-    loadAccountInfo: function() {
+    loadAccountInfo: function () {
       const _this = this
       // zhaopeng&A15hOsu8YeGnCsjb
       const accountInfo = Cookies.get('accountInfo')
@@ -182,50 +204,50 @@ export default {
         _this.loginForm.password = passWord
         _this.rememberPassword = true
       }
-    }
-  }
-}
-</script>
-
-<style lang="scss">
-/* 修复input 背景不协调 和光标变色 */
-/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
-
-// $bg: #283443;
-// $light_gray: #fff;
-// $cursor: #fff;
-// 更改
-// $bg: #ccc;
-// $light_gray: #ccc;
-// $cursor: #000;
-// @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
-//   .login-container .el-input input {
-//     color: $cursor;
-//   }
-// }
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+/* 修复input 背景不协调 和光标变色 */
+/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
+
+// $bg: #283443;
+// $light_gray: #fff;
+// $cursor: #fff;
+// 更改
+// $bg: #ccc;
+// $light_gray: #ccc;
+// $cursor: #000;
+// @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
+//   .login-container .el-input input {
+//     color: $cursor;
+//   }
+// }
 // .login-container {
-//   min-height: 232px;
-//   .el-input {
-//     display: inline-block;
-//     height: 38px;
-//     width: 80%;
-
-//     input {
-//       background: #fff;
-//       border: 0px;
-//       -webkit-appearance: none;
-//       border-radius: 0px;
-//       padding: 5px 5px 5px 15px;
-//       color: #000;
-//       height: 16.7%;
-//       caret-color: $cursor;
-
-//       &:-webkit-autofill {
-//         box-shadow: 0 0 0px 1000px $bg inset !important;
-//         -webkit-text-fill-color: $cursor !important;
-//       }
-//     }
-//   }
+//   min-height: 232px;
+//   .el-input {
+//     display: inline-block;
+//     height: 38px;
+//     width: 80%;
+
+//     input {
+//       background: #fff;
+//       border: 0px;
+//       -webkit-appearance: none;
+//       border-radius: 0px;
+//       padding: 5px 5px 5px 15px;
+//       color: #000;
+//       height: 16.7%;
+//       caret-color: $cursor;
+
+//       &:-webkit-autofill {
+//         box-shadow: 0 0 0px 1000px $bg inset !important;
+//         -webkit-text-fill-color: $cursor !important;
+//       }
+//     }
+//   }
 //   .el-form-item {
 //       border: 1px solid rgba(255, 255, 255, 0.1);
 //       background: #fff;
@@ -257,99 +279,99 @@ export default {
 //       overflow: hidden;
 //     }
 //     .btn  span{width:72%;background:#01996a;border: #01996a;border-radius: 5px;line-height: 40px; text-align: center;color:#fff; margin: 0 auto;display: block;}
-
+
 //   }
-
-</style>
+</style>
 
 /* <style>
-
-.login-container .el-input input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
-    -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
-    box-shadow: 0 0 0px 1000px #fff inset !important;
-    -webkit-text-fill-color: #000 !important;
+.login-container .el-input input:-webkit-autofill,
+textarea:-webkit-autofill,
+select:-webkit-autofill {
+  -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
+  box-shadow: 0 0 0px 1000px #fff inset !important;
+  -webkit-text-fill-color: #000 !important;
 }
+</style> */
+// <style lang="scss" scoped>
+// $bg: #2d3a4b;
+// $dark_gray: #999;
+// $light_gray: #000;
 
-</style> */
-// <style lang="scss" scoped>
-// $bg: #2d3a4b;
-// $dark_gray: #999;
-// $light_gray: #000;
-
-// .login-container {
-//   min-height: 100%;
+// .login-container {
+//   min-height: 100%;
 //   width: 100%;
-//   height: 100%;
-//   position: relative;
-//   background: url("../../assets/images/nlogin-bg.png") no-repeat;
-//   background-size:100%;
-//   overflow: hidden;
-//   .login {
-//     border-radius: 5%;
-//     padding: 30px;
-//     background: rgba(0,0,0,0.4);
-//     width: 380px;
-//     height: 340px;
-//     position: relative;
+//   height: 100%;
+//   position: relative;
+//   background: url("../../assets/images/nlogin-bg.png") no-repeat;
+//   background-size:100%;
+//   overflow: hidden;
+//   .login {
+//     border-radius: 5%;
+//     padding: 30px;
+//     background: rgba(0,0,0,0.4);
+//     width: 380px;
+//     height: 340px;
+//     position: relative;
 //     top: 50%;
 //     left: 50%;
 //     margin-left: -190px;
 //     margin-top: -270px;
-//     box-shadow:0px 0px 10px #fff;
+//     box-shadow:0px 0px 10px #fff;
 //     .login-form {
-//       margin-top: 60px;
-//       position: relative;
-//       width: 520px;
-//       max-width: 100%;
-//       overflow: hidden;
-//     }
-
-//     .tips {
-//       font-size: 14px;
-//       color: #fff;
-//       margin-bottom: 10px;
-
-//       span {
-//         &:first-of-type {
-//           margin-right: 16px;
-//         }
-//       }
-//     }
-
-//     .svg-container {
-//       padding: 6px 5px 6px 15px;
-//       color: $dark_gray;
-//       vertical-align: middle;
-//       width: 30px;
-//       display: inline-block;
-//     }
-
-//       .title {
-//         font-size: 26px;
-//         color: $light_gray;
-//         margin: 0px auto 0 auto;
-//         text-align: center;
-//         font-weight: bold;
-//       }
-//       b {
-//         text-align: center;
-//         font: 14px/2 "";
-//       }
-
-//     .show-pwd {
-//       position: absolute;
-//       right: 10px;
-//       top: 7px;
-//       font-size: 16px;
-//       color: $dark_gray;
-//       cursor: pointer;
-//       user-select: none;
-//     }
+//       margin-top: 60px;
+//       position: relative;
+//       width: 520px;
+//       max-width: 100%;
+//       overflow: hidden;
+//     }
+
+//     .tips {
+//       font-size: 14px;
+//       color: #fff;
+//       margin-bottom: 10px;
+
+//       span {
+//         &:first-of-type {
+//           margin-right: 16px;
+//         }
+//       }
+//     }
+
+//     .svg-container {
+//       padding: 6px 5px 6px 15px;
+//       color: $dark_gray;
+//       vertical-align: middle;
+//       width: 30px;
+//       display: inline-block;
+//     }
+
+//       .title {
+//         font-size: 26px;
+//         color: $light_gray;
+//         margin: 0px auto 0 auto;
+//         text-align: center;
+//         font-weight: bold;
+//       }
+//       b {
+//         text-align: center;
+//         font: 14px/2 "";
+//       }
+
+//     .show-pwd {
+//       position: absolute;
+//       right: 10px;
+//       top: 7px;
+//       font-size: 16px;
+//       color: $dark_gray;
+//       cursor: pointer;
+//       user-select: none;
+//     }
 
 //     .kpt{text-align: center;color: #fff;display: inline-block;width: 100%;font:12px/18px '';}
-//   }
-// }
-// </style>
+//   }
+// }
+//
+</style>
 // <style lang="scss" scoped>
 //   .login-container {
 //     width: 100vw;
@@ -403,50 +425,150 @@ export default {
 //       }
 //     }
 //   }
-// </style>
+//
+</style>
 <style lang="scss" scoped>
-$bg: #2d3a4b;
-$dark_gray: #999;
+$bg: #2d3a4b;
+$dark_gray: #999;
 $light_gray: #000;
-$bg: #ccc;
-$light_gray: #ccc;
+$bg: #ccc;
+$light_gray: #ccc;
 $cursor: #000;
-.login-container{
-  position: relative;height: 100%;width: 100%;background:  url("../../assets/images/nlogin-bg1.jpg") no-repeat;background-size: cover;
-    .new-login{
-      width: 50%;height: 42%;position: absolute;left: 0;right: 0;bottom: 0;top: 0;margin: auto;
-      .new-login-l{
-        float:left;height:100%;width:50%;background:  url("../../assets/images/nlogin-bg2.png") no-repeat;position: relative;background-size: cover;
-        img{position: absolute;left: 0;right: 0;bottom: 0;top: 0;margin: auto;width: 50%;height:23%;}
+.login-container {
+  position: relative;
+  height: 100%;
+  width: 100%;
+  background: url('../../assets/images/nlogin-bg1.jpg') no-repeat;
+  background-size: cover;
+  .new-login {
+    width: 50%;
+    height: 42%;
+    position: absolute;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    top: 0;
+    margin: auto;
+    .new-login-l {
+      float: left;
+      height: 100%;
+      width: 50%;
+      background: url('../../assets/images/nlogin-bg2.png') no-repeat;
+      position: relative;
+      background-size: cover;
+      text-align: center;
+      .imgs {
+        position: absolute;
+        left: 0;
+        right: 0;
+        bottom: 0;
+        top: 0;
+        margin: auto;
+        height: 26%;
+        width: 100%;
       }
-      .new-login-r{
-        background: #fff;float:left;height:100%;width:50%;position: relative;
-        .title{margin-top: 10%;font-size: 20px;font-weight: 600;color: #019969;text-align: center;}
-        .login-form{
-          position: relative;width: 520px;overflow: hidden;height: 48%;width: 100%;
-          .svg-container{padding: 6px 5px 6px 15px; color: $dark_gray; vertical-align: middle; width: 30px; display: inline-block;}
-          .el-input {
-            display: inline-block; width: 80%;
-          }
+      img {
+        width: 50%;
+        // height: 23%;
+        &:lang(en) {
+          width: 70%;
         }
-        .el-form-item {
-          border: none; background: #fff; border-radius: 5px; color: #999;width: 73%; margin: 10px auto;height: 30%;
-          /deep/.el-form-item__content {
-            line-height: 16%; border-bottom: 1px solid #e7e7e7;
-          }
-          .el-form-item__content .el-input{
-            /deep/.el-input__inner{border: none !important;}
+      }
+      .img-text {
+        width: 100%;
+        font-size: 12px;
+        font-weight: 600;
+        color: #019969;
+        text-align: center;
+        margin-top: 8px;
+        display: none;
+        &:lang(en) {
+          display: block;
+        }
+      }
+    }
+    .new-login-r {
+      background: #fff;
+      float: left;
+      height: 100%;
+      width: 50%;
+      position: relative;
+      .title {
+        margin-top: 10%;
+        font-size: 20px;
+        font-weight: 600;
+        color: #019969;
+        text-align: center;
+      }
+      .login-form {
+        position: relative;
+        width: 520px;
+        overflow: hidden;
+        height: 48%;
+        width: 100%;
+        .svg-container {
+          padding: 6px 5px 6px 15px;
+          color: $dark_gray;
+          vertical-align: middle;
+          width: 30px;
+          display: inline-block;
+        }
+        .el-input {
+          display: inline-block;
+          width: 80%;
+        }
+      }
+      .el-form-item {
+        border: none;
+        background: #fff;
+        border-radius: 5px;
+        color: #999;
+        width: 73%;
+        margin: 10px auto;
+        height: 30%;
+        /deep/.el-form-item__content {
+          line-height: 16%;
+          border-bottom: 1px solid #e7e7e7;
+        }
+        .el-form-item__content .el-input {
+          /deep/.el-input__inner {
+            border: none !important;
           }
         }
-        .rememberPassword{
-          /deep/.el-form-item__content { line-height:16%; border: none;padding-bottom: 10px; span{padding-left: 5px;} }
+      }
+      .rememberPassword {
+        /deep/.el-form-item__content {
+          line-height: 16%;
+          border: none;
+          padding-bottom: 10px;
+          span {
+            padding-left: 5px;
+          }
         }
-        .password{margin-top: 10px;margin-bottom: 20px;}
-        .btn{
-          position: absolute; overflow: hidden; width: 75%;left: 0;right: 0;bottom: 10%;margin: 0 auto;
-          /deep/span{background:#01996a;border: #01996a;border-radius: 5px;line-height: 40px; text-align: center;color:#fff; display: block;}
+      }
+      .password {
+        margin-top: 10px;
+        margin-bottom: 20px;
+      }
+      .btn {
+        position: absolute;
+        overflow: hidden;
+        width: 75%;
+        left: 0;
+        right: 0;
+        bottom: 10%;
+        margin: 0 auto;
+        /deep/span {
+          background: #01996a;
+          border: #01996a;
+          border-radius: 5px;
+          line-height: 40px;
+          text-align: center;
+          color: #fff;
+          display: block;
         }
       }
     }
+  }
 }
-</style>
+</style>

Some files were not shown because too many files changed in this diff