Przeglądaj źródła

实现局部页面刷新功能和解决前端页面bug

oyq28 3 lat temu
rodzic
commit
9a86634851

+ 18 - 3
imcs-ui/src/App.vue

@@ -1,14 +1,29 @@
 <template>
   <div id='app'>
-    <router-view />
+    <router-view v-if="isRouterAlive" />
   </div>
 </template>
 
 <script>
 export default {
   name: 'App',
-  created () {
-    //TODO 每次刷新页面会加载这个方法?是否能在这里判断 必须要缓存的Token ,用户信息等
+  provide () {
+    return {
+      reload: this.reload
+    }
+  },
+  data () {
+    return {
+      isRouterAlive: true
+    }
+  },
+  methods: {
+    reload () {
+      this.isRouterAlive = false
+      this.$nextTick(function() {
+         this.isRouterAlive = true
+      })
+    }
   }
 }
 </script>

+ 1 - 0
imcs-ui/src/lang/zh/machining.js

@@ -116,6 +116,7 @@ export default {
         no: '编号',
         orderNo: '订单编号',
         orderName: '订单名称',
+		uniqueCode: '零件唯一码',
         workpieceName: '零件名称',
         workpieceId: '零件编号',
         procedureName: '工序名称',

+ 2 - 2
imcs-ui/src/views/zuihou/qualityCenter/measuringOffsetMgr/Index.vue

@@ -62,8 +62,8 @@
       <el-table-column prop="orderName" :label='$t("machining.table.offset.orderName")' :show-overflow-tooltip="true"></el-table-column>
       <!-- '零件名称 -->
       <el-table-column prop="workpieceName" :label='$t("machining.table.offset.workpieceName")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 零件编号 -->
-      <el-table-column prop="workpieceId" :label='$t("machining.table.offset.workpieceId")'  :show-overflow-tooltip="true"></el-table-column>
+      <!-- 零件唯一码 -->
+      <el-table-column prop="uniqueCode" :label='$t("machining.table.offset.uniqueCode")'  :show-overflow-tooltip="true"></el-table-column>
       <!-- 工序名称 -->
       <el-table-column prop="procedureName" :label='$t("machining.table.offset.procedureName")' :show-overflow-tooltip="true"></el-table-column>
       <!-- X -->

+ 15 - 10
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/Index.vue

@@ -78,11 +78,13 @@
 	  components: { countTo, SchedResource, SchedPlan, SchedTask, SchedTime },
 	  props: {
 	  },
+	  inject: ['reload'],
 	  data () {
 	    return {
 	    	topTongjiData: {"producePlan": 0, "delayPlan": 0,"producePart": 0,"badPart": 0},
 	    	activeTab: "task",  // 默认选择的tab(任务时间甘特图)
-	    	isShow: true
+	    	isShow: true,
+			timer: ''
 	    }
 	  },
 	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
@@ -100,10 +102,13 @@
 	  mounted () {
 	    this.timerTask()
 	  },
+	  beforeDestroy() {
+      	this.clearTimer()
+      },
 	  methods: {
 	  	tabClick(e){
 	  		console.log("被选择的tab:", e.index)
-	  		// 如果点击的是【任务时间甘特图】 resource
+	  		// 如果点击的是【订单计划】 resource
 	  		if(e.index == 0){
 	  			// 加载列表数据
 				this.clearTimer()
@@ -115,7 +120,7 @@
 				this.clearTimer()
 	  			this.$refs.resource.fetch()
 	  		}
-	  		// 如果点击的是【订单计划】 resource
+	  		// 如果点击的是【任务池】 resource
 	  		if(e.index == 2){
 	  			// 加载列表数据
 				this.timerTask()
@@ -126,16 +131,16 @@
 	  	setChange(){
 	  		this.isShow = !this.isShow
 	  	},
-		timerTask(){
+		timerTask(){			
        		let that = this
        		that.timer = setInterval(()=>{
-          	   window.location.reload()
-      	 	}, 60000)
+			   	that.reload()
+      	 	}, 60000)				
     	},
-    	clearTimer(){
+    	clearTimer(){			
        		if(this.timer){
-          	clearInterval(this.timer)
-          	this.timer = null
+          		clearInterval(this.timer)				
+          		this.timer = null
        		}
    		 },
 	  	// 获取统计数据
@@ -155,7 +160,7 @@
 	    		}
 	  		})
 	  	}
-	  }
+	  }	  
 	}
 </script>
 	

+ 1 - 1
imcs-ui/src/views/zuihou/statisticalAnalysis/resouceOee/Index.vue

@@ -96,7 +96,7 @@
           //this.queryParams = initQueryParams({})
           //this.$refs.table.clearSort()
           //this.$refs.clearFilter() 
-          this.search()
+          this.getLineList()
       },
 	    fetch () {
 	  	  this.tableKey = !this.tableKey