Quellcode durchsuchen

国际化版本

sunyadv vor 5 Jahren
Ursprung
Commit
096f2ebf25

+ 2 - 0
ys_int/src/port.js

@@ -108,6 +108,8 @@ export default {
         importMouldEquipmentExcel: '/mouldequipment/importMouldEquipmentExcel', //批量导入云模盒
         
         setPacket: '/JSKBT/setPacket.do',// 云平台下行配置数据包接口
+        openingAndClosingTimesChart: '/mouldhistory/openingAndClosingTimesChart', //获取云模盒的每日开合次数图表 (时间/次数)
+        openingAndClosingTimesChartCycle: '/mouldhistory/openingAndClosingTimesChartCycle', //获取云模盒的每日开合次数周期 (时间/次数)
     },
     file: {
         view: '/pdffile/getPdfFile' // 文件预览

+ 19 - 19
ys_int/src/routes.js

@@ -26,11 +26,11 @@ import i18n from './i18n/i18n';
 
 var navigation = {};
 
-if(i18n.locale == "en-US") {
-    navigation = require('./i18n/lang/en').default.navigation;
-} else {
-    navigation = require('./i18n/lang/zh').default.navigation;
-}
+// if(i18n.locale == "en-US") {
+//     navigation = require('./i18n/lang/en').default.navigation;
+// } else {
+//     navigation = require('./i18n/lang/zh').default.navigation;
+// }
 
 let routes = [
     {
@@ -47,8 +47,8 @@ let routes = [
         iconCls: 'iconfont icon-ditu',
         leaf: true,//只有一个节点
         children: [
-            { path: '/map', component: map, name: navigation.map },
-            { path: '/message', component: message, name: navigation.msg, hidden: true }
+            { path: '/map', component: map, name: "navigation.map" },
+            { path: '/message', component: message, name: "navigation.msg", hidden: true }
         ]
     },
     //运行监测
@@ -59,7 +59,7 @@ let routes = [
         iconCls: 'iconfont icon-jiance',
         leaf: true,//只有一个节点
         children: [
-            { path: '/detection', component: detection, name: navigation.test },
+            { path: '/detection', component: detection, name: "navigation.test" },
             { path: '/detection/:id', component: maintenance, name: '运行检测详情', hidden: true }
         ]
     },
@@ -67,37 +67,37 @@ let routes = [
     {
         path: '/',
         component: Home,
-        name: navigation.pro,
+        name: "navigation.pro",
         iconCls: 'iconfont icon-ic_dashboard',
         children: [
-            { path: '/project', component: project, name: navigation.proList },
+            { path: '/project', component: project, name: "navigation.proList" },
             { path: '/project/:id', component: projectDetail, name: '项目详情', hidden: true },
-            { path: '/staff', component: staff, name: navigation.staff },
-            { path: '/competence', component: competence, name: navigation.power }
+            { path: '/staff', component: staff, name: "navigation.staff" },
+            { path: '/competence', component: competence, name: "navigation.power" }
         ]
     },
     //模具管理
     {
         path: '/',
         component: Home,
-        name: navigation.mold,
+        name: "navigation.mold",
         iconCls: 'iconfont icon-moxing',
         children: [
-            { path: '/moldList', component: moldList, name: navigation.moldList },
+            { path: '/moldList', component: moldList, name: "navigation.moldList" },
             { path: '/moldList/:id/:type', component: moldDetail, name: '模具详情', hidden: true },
-            { path: '/moldDownload', component: moldDownload, name: navigation.moldDown }
+            { path: '/moldDownload', component: moldDownload, name: "navigation.moldDown" }
         ]
     },
     //基础管理
     {
         path: '/',
         component: Home,
-        name: navigation.base,
+        name: "navigation.base",
         iconCls: 'iconfont icon-setting-fill',
         children: [
-            { path: '/comp', component: comp, name: navigation.asset },
-            { path: '/factory', component: factory, name: navigation.producer },
-            { path: '/allocation', component: allocation, name: navigation.device }
+            { path: '/comp', component: comp, name: "navigation.asset" },
+            { path: '/factory', component: factory, name: "navigation.producer" },
+            { path: '/allocation', component: allocation, name: "navigation.device" }
         ]
     },
     //邀请

+ 5 - 5
ys_int/src/views/Home.vue

@@ -105,12 +105,12 @@
                         <el-submenu :index="index+''" v-if="!item.leaf">
                             <template slot="title">
                                 <i :class="item.iconCls"></i>
-                                <span class="itemName">{{item.name}}</span>
+                                <span class="itemName">{{$t(item.name)}}</span>
                             </template>
-                            <el-menu-item v-for="child in item.children" :index="child.path" :key="child.path" v-if="!child.hidden">{{child.name}}</el-menu-item>
+                            <el-menu-item v-for="child in item.children" :index="child.path" :key="child.path" v-if="!child.hidden">{{$t(child.name)}}</el-menu-item>
                         </el-submenu>
                         <el-menu-item v-if="item.leaf && item.children.length > 0" :index="item.children[0].path">
-                            <i :class="item.iconCls"></i><span class="itemName">{{item.children[0].name}}</span>
+                            <i :class="item.iconCls"></i><span class="itemName">{{$t(item.children[0].name)}}</span>
                         </el-menu-item>
                     </template>
                 </el-menu>
@@ -125,7 +125,7 @@
                             </div>
                             <ul class="el-menu submenu" :class="'submenu-hook-'+index" @mouseover="showMenu(index,true)" @mouseout="showMenu(index,false)">
                                 <li v-for="child in item.children" v-if="!child.hidden" :key="child.path" class="el-menu-item" style="padding-left: 40px;" 
-                                :class="$route.path==child.path?'is-active':''" @click="$router.push(child.path)">{{child.name}}</li>
+                                :class="$route.path==child.path?'is-active':''" @click="$router.push(child.path)">{{$t(child.name)}}</li>
                             </ul>
                         </template>
                         <template v-else>
@@ -250,7 +250,7 @@
                     cancelButtonText: this.$t('el.messagebox.cancel'),
                     type: 'warning'
                 }).then(() => {
-                    _this.$router.go(0);
+                    //_this.$router.go(0);
                     if (_this.$i18n.locale === 'zh-CN') {
                         _this.$i18n.locale = 'en-US';
                         localStorage.lang = 'en-US';

+ 1 - 4
ys_int/src/views/base/allocation.vue

@@ -483,6 +483,7 @@
                 //     });
                 // }else{
                 this.allocations[this.activeIndex].isUse = 1;
+                this.operateDialogVisible = false;
                 // this.http.post( this.port.base.enableMould, {
                 //     id: this.allocations[this.activeIndex].id,
                 //     isUse: 1
@@ -495,7 +496,6 @@
                     equipmentNo: str
                 },
                 res => {
-                    this.operateDialogVisible = false;
                     if (res.code == "ok") {
                         this.$message({
                             message: this.$t("basic.inUse"),
@@ -510,7 +510,6 @@
                     }
                 },
                 error => {
-                    this.operateDialogVisible = false;
                     this.$message({
                         message: error,
                         type: "error"
@@ -539,7 +538,6 @@
                     equipmentNo: str
                 },
                 res => {
-                    this.operateDialogVisible = false;
                     if (res.code == "ok") {
                         this.$message({
                             message: this.$t("basic.offUse"),
@@ -554,7 +552,6 @@
                     }
                 },
                 error => {
-                    this.operateDialogVisible = false;
                     this.$message({
                         message: error,
                         type: "error"

+ 1 - 1
ys_int/src/views/detection/detection.vue

@@ -36,7 +36,7 @@
             <el-table-column prop="runTimes" :label="$t('mold.runTimes')" align="center" width="100" sortable></el-table-column>
             <el-table-column prop="ocCycle" :label="$t('mold.ocCycle')" align="center" width="140" sortable></el-table-column>
             <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" align="center" width="80" sortable></el-table-column>
-            <el-table-column prop="lastOpenTime" :label="$t('mold.lastOpenTime')" align="center" width="150" sortable></el-table-column>
+            <el-table-column prop="lastOpenTime" :label="$t('runTest.lastOpenTime')" align="center" width="150" sortable></el-table-column>
             <el-table-column :label="$t('runTest.state')" align="center" width="100" sortable>
                 <template slot-scope="scope">
                     <span v-if="scope.row.state == 0">{{$t('base.static')}}</span>

+ 1 - 4
ys_vue/src/views/base/allocation.vue

@@ -454,6 +454,7 @@
                 //     });
                 // }else{
                 this.allocations[this.activeIndex].isUse = 1;
+                this.operateDialogVisible = false;
                 // this.http.post( this.port.base.enableMould, {
                 //     id: this.allocations[this.activeIndex].id,
                 //     isUse: 1
@@ -466,7 +467,6 @@
                     equipmentNo: str
                 },
                 res => {
-                    this.operateDialogVisible = false;
                     if (res.code == "ok") {
                         this.$message({
                             message: "设备已启用",
@@ -481,7 +481,6 @@
                     }
                 },
                 error => {
-                    this.operateDialogVisible = false;
                     this.$message({
                         message: error,
                         type: "error"
@@ -510,7 +509,6 @@
                     equipmentNo: str
                 },
                 res => {
-                    this.operateDialogVisible = false;
                     if (res.code == "ok") {
                         this.$message({
                             message: "设备已停用",
@@ -525,7 +523,6 @@
                     }
                 },
                 error => {
-                    this.operateDialogVisible = false;
                     this.$message({
                         message: error,
                         type: "error"