From 8a855ff4cebb72383b6043e5c5c2f3a27ade9533 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 11 十二月 2025 15:38:31 +0800
Subject: [PATCH] #
---
Monitor-APP/pages/home/home.vue | 107 +++++++++++++++++++----------------------------------
1 files changed, 39 insertions(+), 68 deletions(-)
diff --git a/Monitor-APP/pages/home/home.vue b/Monitor-APP/pages/home/home.vue
index 873f6a1..336b75e 100644
--- a/Monitor-APP/pages/home/home.vue
+++ b/Monitor-APP/pages/home/home.vue
@@ -143,7 +143,7 @@
<view style="height: 2%"></view>
<view style="height: 18%; display: flex; justify-content: space-around; align-items: center">
<view style="height: 50%">
- <image style="height: 100%" src="../../static/img/logo-bai.png" mode="aspectFit"></image>
+ <image style="height: 100%; opacity: 0;" src="../../static/img/logo-bai.png" mode="aspectFit"></image>
</view>
</view>
</view>
@@ -183,9 +183,9 @@
<view style="width: 50%; font-size: 3vw">鐗╂枡缂栫爜: {{ item.matnr }}</view>
<view style="width: 50%; font-size: 3vw">鍚嶇О: {{ item.maknx }}</view>
<view style="width: 50%; font-size: 3vw">瑙勬牸: {{ item.specs }}</view>
- <view style="width: 50%; font-size: 3vw">鎵规: {{ item.batch }}</view>
- <view style="width: 50%; font-size: 3vw">閿�鍞崟鍙�: {{ item.orderNo }}</view>
- <view style="width: 50%; font-size: 3vw">瀹㈡埛鍚嶇О: {{ item.customer }}</view>
+ <!-- <view style="width: 50%; font-size: 3vw">鎵规: {{ item.batch }}</view> -->
+ <view style="width: 50%; font-size: 3vw">渚涘簲鍟嗕唬鐮�: {{ item.orderNo }}</view>
+ <!-- <view style="width: 50%; font-size: 3vw">瀹㈡埛鍚嶇О: {{ item.customer }}</view> -->
<view style="width: 33%; font-size: 3vw">鏁伴噺: {{ item.count }}</view>
</swiper-item>
</swiper>
@@ -230,29 +230,17 @@
</view>
</view>
<view class="item">
- <view class="desc">Wcsport锛�</view>
+ <view class="desc">port锛�</view>
<view class="input">
<input type="text" v-model="basePort" />
</view>
</view>
<view class="item">
- <view class="desc">WcsUrl锛�</view>
+ <view class="desc">Url锛�</view>
<view class="input">
<input type="text" v-model="baseUrl" />
</view>
- </view>
- <view class="item">
- <view class="desc">Wmsport锛�</view>
- <view class="input">
- <input type="text" v-model="wmsPort" />
- </view>
- </view>
- <view class="item">
- <view class="desc">WmsUrl锛�</view>
- <view class="input">
- <input type="text" v-model="wmsUrl" />
- </view>
- </view>
+ </view>
<view class="item">
<view class="desc">ledId锛�</view>
<view class="input">
@@ -348,7 +336,8 @@
wmsUrl: '',
wmsPort: '',
switchDebounceTimer: null,
- viewSwitchInProgress: false
+ viewSwitchInProgress: false,
+ getConfigUrl:"http://127.0.0.1:8088/wcs/monitor/getIpConfig"
};
},
onShow() {
@@ -357,8 +346,7 @@
plus.navigator.setFullscreen(true);
// #endif
this.getVersion();
- var ip = this.getIp();
- console.log(ip);
+
},
mounted() {
let that = this;
@@ -393,6 +381,9 @@
that.baseCrnId = BaseCrnId;
that.wmsUrl = WMSURL;
that.wmsPort = WMSPORT;
+
+ that.getIPConfig();
+
that.uniWebSocket();
// that.webSockerInit()
},
@@ -421,54 +412,29 @@
this.oldData = [];
}
}, 30000 * 10); // 姣忓皬鏃舵墽琛屼竴娆�
+
+
},
methods: {
- getIp() {
- var ip = null;
- if (plus.os.name === 'Android') {
- try {
- const InetAddress = plus.android.importClass('java.net.InetAddress');
- const NetworkInterface = plus.android.importClass('java.net.NetworkInterface');
- const Collections = plus.android.importClass('java.util.Collections');
-
- let interfaces = NetworkInterface.getNetworkInterfaces();
- let en = Collections.list(interfaces); // Java ArrayList
- let ipEth = null; // 鏈夌嚎
- let ipWifi = null; // Wi-Fi
- let ipOther = null; // 鍏滃簳
- let size = plus.android.invoke(en, 'size');
- for (let i = 0; i < size; i++) {
- let intf = plus.android.invoke(en, 'get', i);
- let name = plus.android.invoke(intf, 'getName'); // eth0 / wlan0 / lo 绛�
- let enumIpAddr = plus.android.invoke(intf, 'getInetAddresses');
- let enumList = Collections.list(enumIpAddr);
- let listSize = plus.android.invoke(enumList, 'size');
- for (let j = 0; j < listSize; j++) {
- let inetAddress = plus.android.invoke(enumList, 'get', j);
- if (!plus.android.invoke(inetAddress, 'isLoopbackAddress')) {
- let hostAddress = plus.android.invoke(inetAddress, 'getHostAddress');
- // 鍙彇 IPv4
- if (hostAddress.indexOf(':') === -1) {
- if (name.startsWith('eth') && !ipEth) {
- ipEth = hostAddress;
- } else if (name.startsWith('wlan') && !ipWifi) {
- ipWifi = hostAddress;
- } else if (!ipOther) {
- ipOther = hostAddress;
- }
- }
- }
- }
+ getIPConfig(){
+ const that = this
+
+ console.log(that.baseIP)
+ uni.request({
+ url: that.getConfigUrl,
+ method:'GET',
+ success(result) {
+ console.log(result)
+ const res = result.data
+ uni.setStorageSync('BaseIp', res.data.ledIp);
+ uni.setStorageSync('BaseLedId', res.data.ledId);
+ uni.setStorageSync('BasePort', res.data.ledPort);
+ uni.setStorageSync('UPROJ', res.data.ledUrl);
+
}
- ip = ipEth || ipWifi || ipOther || null;
- return ip;
- } catch (e) {
- console.log('鑾峰彇IP澶辫触锛�', e);
- return ip;
- }
- } else {
- return ip;
- }
+ });
+
+
},
uniWebSocket() {
let that = this;
@@ -591,13 +557,18 @@
that.infoText.title = '骞舵澘鍑哄簱';
} else if (data.taskList[0].ioType === 54) {
that.infoText.title = '骞舵澘鍏ュ簱';
+ }else {
+ that.infoText.title = data.taskList[0].title;
}
that.infoText.barcode = data.taskList[0].barcode;
that.infoText.workNo = data.taskList[0].workNo;
that.infoText.sourceLocNo = data.taskList[0].sourceLocNo;
that.infoText.staNo = data.taskList[0].staNo;
that.swiperList = data.taskList[0].matDtos;
- } else {
+ }else if(data.type === 'NoData'){
+ that.infoType = 0;
+ }
+ else {
if (that.infoType == 2 || that.infoType == 3) {
return;
}
--
Gitblit v1.9.1