Ver Fonte

修改前端页面bug

oyq28 há 3 anos atrás
pai
commit
93c982c082

+ 1 - 1
imcs-ui/src/lang/zh/agv.js

@@ -22,7 +22,7 @@ export default {
         orderName: '订单名称',
         orderNo: '订单编号',
         partName: '零件名称',
-        partNo: '零件编号',
+        partNo: '零件唯一码',
         procedureNo: '工序',
         start: '起点',
         goal: '终点',

+ 3 - 0
imcs-ui/src/main.js

@@ -55,6 +55,8 @@ Vue.use(Element, {
 })
 Vue.use(uploader)
 
+import { message } from '@/utils/resetMessage'
+
 Vue.prototype.$post = request.post
 Vue.prototype.$get = request.get
 Vue.prototype.$put = request.put
@@ -62,6 +64,7 @@ Vue.prototype.$delete = request.delete
 Vue.prototype.$download = request.download
 Vue.prototype.$upload = request.upload
 Vue.prototype.$login = request.login
+Vue.prototype.$message = message
 
 // register global utility filters
 Object.keys(filters).forEach(key => {

+ 20 - 0
imcs-ui/src/utils/resetMessage.js

@@ -0,0 +1,20 @@
+import { Message } from 'element-ui';
+let messageInstance = null;
+const resetMessage = (options) => {
+  if(messageInstance) {
+    messageInstance.close()
+  }
+  messageInstance = Message(options)
+};
+['error','success','info','warning'].forEach(type => {
+  resetMessage[type] = options => {
+    if(typeof options === 'string') {
+      options = {
+        message:options
+      }
+    }
+    options.type = type
+    return resetMessage(options)
+  }
+})
+export const message = resetMessage

+ 4 - 4
imcs-ui/src/views/zuihou/agvMgr/workRecord/Index.vue

@@ -12,7 +12,7 @@
           size="medium"
         />
       </span>
-      <!--订单编号-->
+      <!--订单编号
       <span>
         <span>{{ $t("agv.searchForm.orderNo") }}:</span>
         <el-input
@@ -20,7 +20,7 @@
           :placeholder='$t("common.pleaseEnter")'
           style="width: 150px;"
           size="medium"
-        />
+        />-->
       </span>
       <!--零件名称-->
       <span>
@@ -111,12 +111,12 @@
         :label='$t("agv.table.agv.orderName")'
       :show-overflow-tooltip="true"
       />
-      <!--订单编号-->
+      <!--订单编号
       <el-table-column
         prop="orderNo"
         :label='$t("agv.table.agv.orderNo")'
         :show-overflow-tooltip="true"
-      />
+      />-->
       <!--零件名称-->
       <el-table-column
         prop="partName"

+ 115 - 0
imcs-ui/src/views/zuihou/largeScreen/threeDatasModel/Index.vue

@@ -0,0 +1,115 @@
+<template>
+     <div class="main-info">
+        <iframe
+         ref="iframe"
+         id="iframe"
+         frameborder="0"
+         :src="iframeSrc"
+         style="min-height:900px;width: 100%;height:100%;"
+         scrolling="auto"
+        >
+        </iframe>
+    </div>    
+</template>
+
+<script>
+  
+  export default {
+     name: "ThreeDatasModel",
+     data(){
+         return {
+           iframeSrc: '',
+           isReceiveMsg: false,
+           actionNum: 5,
+           timer: null,
+           loading: false
+         }
+     },
+     created() {
+        this.iframeSrc = `http://192.168.170.123:8015/scada/gc/128098`
+        // 监听收到消息
+        //window.addEventListener('message', this.handleMessageEvent)
+    },
+    mounted () {
+       const self = this
+       this.$nextTick(() => {
+       const iframe = document.getElementById('iframe')
+       this.loading = true;
+       if (iframe.attachEvent) { // 适配IE      
+        iframe.attachEvent('onload', function () {
+          self.clickIframe()
+          setTimeout(() => {
+            self.handlePostMessageFail()
+          }, 1000)
+          this.loading = false;
+        })
+      } else {          
+          iframe.onload = function () {
+           // 坑一,postMessage发送通知时,可能对方的页面还没有加载完成导致发送失败
+             
+             self.clickIframe()
+             this.loading = false;
+             
+             /*
+             setTimeout(() => {
+               self.handlePostMessageFail()
+              }, 1000) */
+            } 
+           } 
+      })
+    },
+    methods: {
+    handleMessageEvent(event) {
+      if (event.data && event.data.data) {
+        const data = event.data.data
+        const body = data.body || ''
+        if (parseInt(data.responseCode) === 0) {
+          // 成功返回
+          setTimeout(() => {
+            this.$router.push({ name: this.backPath })
+          }, 500)
+        } else if (parseInt(data.responseCode) === 2) {
+          // 收到消息
+          console.log('-------已收到消息', data)
+          this.isReceiveMsg = true
+        }
+      }
+    },
+    clickIframe() {
+      const iframe =
+        document.getElementById('iframe') &&
+        document.getElementById('iframe').contentWindow
+      if (!iframe) return
+        const list = []
+        list.push(this.processData)
+        const dict = {
+          processList: list
+        }
+        // 不限制域名就用*,否则就是具体域名
+        iframe.postMessage(dict, '*')
+      },
+    handlePostMessageFail () {
+      this.timer = setInterval(() => {
+        if (!this.isReceiveMsg) {
+          if (this.actionNum <= 0) {
+            clearInterval(this.timer)
+            this.timer = null
+            this.isReceiveMsg = true
+            return
+          }
+          this.clickIframe()
+          this.actionNum--
+        } else {
+          clearInterval(this.timer)
+          this.timer = null
+          this.isReceiveMsg = true
+        }
+      }, 1500)
+    },
+    destroyed() {
+        window.removeEventListener('message', this.handleMessageEvent)
+     }
+    }
+}
+
+</script>

+ 2 - 2
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideEmulate/Index.vue

@@ -61,7 +61,7 @@
 	  			</div>
 	  			<!-- 中部-货架小格子 -->
 	  			<table class="contentDiv" border="0" cellspacing="0" cellpadding="6">
-	  				<tr v-for="objTr in item.layList" :key="objTr">
+	  				<tr v-for="(objTr, objIndex) in item.layList" :key="objIndex">
 	  					<td v-for="objTd in objTr.stockList" :key="objTd.id" :class="objTd.storgeStockCount>0 ? 'blueBg' : ''" @click="editOne(objTd)">
 	  						{{objTd.no}}
 	  						<el-image v-if="objTd.lockStatus == '0'" class="locked" :src="resolveLogo(lockImg)" fit="contain"></el-image>
@@ -385,7 +385,7 @@
 	    editOne(row) {
 	    	this.edit(row);
 	    },
-	    edit (row) {
+	    edit (row) {		  
 	      this.$refs.edit.setTenant(row, this.dicts)
 	      this.$refs.edit.type = "edit"
 	      this.dialog.title = this.$t("lineSide.common.libProd")

+ 2 - 2
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideEmulate/components/Edit.vue

@@ -14,7 +14,7 @@
 	      :key="tableKey"
 	      ref="table"
 	      v-loading="loading"
-	      :data="tableData"
+	      :data="tableData.data"
 	      border
 	      fit
 	      row-key="id"
@@ -244,7 +244,7 @@ export default {
 	        const res = response.data
 	        console.log("res123123214==== ", res);
 	        if (res.isSuccess) {
-	          this.tableData = res.data
+	          this.tableData = res
 	        }
 	        // eslint-disable-next-line no-return-assign
 	      }).finally(() => this.loading = false)