From 8b43954926db6b4df6a61ab6e04d6cb11189069d Mon Sep 17 00:00:00 2001 From: 吴健 <14790700720@163.com> Date: 星期二, 15 四月 2025 08:54:08 +0800 Subject: [PATCH] add-415 --- jcdm-ui/src/views/main/kb/engineCheck/index.vue | 40 ++++++++++++++++++++++++++++++++++------ 1 files changed, 34 insertions(+), 6 deletions(-) diff --git a/jcdm-ui/src/views/main/kb/engineCheck/index.vue b/jcdm-ui/src/views/main/kb/engineCheck/index.vue index 506aeae..198a131 100644 --- a/jcdm-ui/src/views/main/kb/engineCheck/index.vue +++ b/jcdm-ui/src/views/main/kb/engineCheck/index.vue @@ -44,9 +44,9 @@ <el-row :gutter="10" class="mb8" type="flex" justify="center" style="text-align: center"> <el-col :span="1.5"> - <el-button plain :disabled="buttondisabled" type="primary" style="width:400px;height:160px" v-hasPermi="['bs:formula:add']"> + <el-button plain type="primary" style="width:400px;height:160px" v-hasPermi="['bs:formula:add']" @click="forceUpload"> <span class="el-icon-thumb" style="font-size:40px;color:black"></span> - <span style="font-size:45px;color:black"><strong>寮哄埗涓婄嚎</strong></span> + <span style="font-size:45px;color:black" ><strong>寮哄埗涓婄嚎</strong></span> </el-button> </el-col> </el-row> @@ -74,7 +74,7 @@ </template> <script> -import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling"; +import { listOrderScheduling, forceUploadMethod, getUrl, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling"; import { listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection } from "@/api/main/da/passingStationCollection/passingStationCollection"; import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo"; import WebSocketReconnect from "@/utils/WebsocketTool"; @@ -119,6 +119,7 @@ props: [], data() { return { + websocketUrl: '', websocket: null, result: {}, transEngineNo: '', @@ -166,16 +167,42 @@ // immediate:true // } }, - created() {}, + created() { + + }, mounted() { - this.initWebSocket() + this.getWebUrl() + }, methods: { + getWebUrl(){ + console.log("1111") + getUrl().then(res=>{ + console.log("res",res) + this.websocketUrl = res+"OP120" + this.initWebSocket() + }) + }, + forceUpload() { + console.log('0000', this.form.engineNo) + if (this.form.engineNo !== null) { + forceUploadMethod(this.form.engineNo).then(res => { + + }) + } else { + this.$message({ + message: '璇疯緭鍏ュ彂鍔ㄦ満鏉$爜', + type: 'error', + offset: 300 + }) + } + }, initWebSocket: function (){ //鍒ゆ柇褰撳墠娴忚鍣ㄦ槸鍚︽敮鎸乄ebSocket if ('WebSocket' in window) { //杩炴帴WebSocket鑺傜偣 - this.websocket = new WebSocketReconnect('ws://127.0.0.1:8086/websocket/111122') + console.log("9999",this.websocketUrl) + this.websocket = new WebSocketReconnect(this.websocketUrl) //鎺ユ敹鍒版秷鎭殑鍥炶皟鏂规硶 this.websocket.socket.onmessage = (event) => { @@ -226,6 +253,7 @@ let OrderSchedulingParam = {engineNo: null} OrderSchedulingParam.engineNo = this.form.engineNo; listOrderScheduling(OrderSchedulingParam).then(response => { + console.log(response) if(response.total === 1 ){ this.form.productType = response.rows[0].model this.form.orderNo = response.rows[0].orderNo -- Gitblit v1.9.3