#
whycq
2024-07-23 a19d10e17b289c35ed08203fd63735bcec96cae8
Monitor-APP/pages/home/home.vue
@@ -234,12 +234,12 @@
                                 <view style="width: 30%;">{{i+1}} / {{swiperList.length}}</view>
                                 <!-- <view style="width: 30%;">料号: {{item.matnr}}</view> -->
                                 <view style="width: 40%;">名称: {{item.maknx}}</view>
                                 <view style="width: 30%;">客户: {{item.manu}}</view>
                                 <view style="width: 30%;">订单: {{item.orderNo}}</view>
                                 
                                 
                                 <view style="width: 30%;">出库: {{item.count}} / 总数: {{item.total}}</view>
                                 <view style="width: 40%;">规格: {{item.specs}}</view>
                                 <view style="width: 30%;">备注: {{item.memo}}</view>
                                 <view style="width: 30%;">批号: {{item.batch}}</view>
                                 
                                 
                              </swiper-item>
@@ -391,7 +391,8 @@
            swiperList: [],
            timeOut: false,
            times: 0,
            currDate: ''
            currDate: '',
            socketInfo2: ''
         }
      },
      onShow() {
@@ -415,25 +416,44 @@
         // this.getUrl()
      },
      onLoad() {
         this.ws()
         setInterval(()=>{
            this.getServerData()
            this.initlineChart()
            this.initPieChart()
            this.getOther()
            // this.getServerData()
            // this.initlineChart()
            // this.initPieChart()
            // this.getOther()
            // this.getDate()
            this.getDate2()
            // this.getDate2()
            this.getInfo()
            this.getError()
            // this.getError()
            // this.getInfo2()
            // this.getError2()
            this.getUrl()
            this.controller()
            // this.getUrl()
            // this.controller()
            // 测试用
            
         },1000)
      },
      methods: {
         timeOut() {
         ws() {
            let _this = this
            _this.connectWS()
            uni.onSocketOpen(function (res) {
               console.log("Open");
            })
            uni.onSocketClose(function (res) {
               console.log("Close");
               setInterval(()=>{
                  _this.connectWS()
               },1000)
            })
         },
         connectWS() {
            uni.connectSocket({ url: `http://127.0.0.1:9090/pswcs/console/websocket`, })
         },
         timeOut1() {
            console.log(this.times);
         },
         getUrl() {
@@ -554,7 +574,7 @@
               },
               fail(err) {
                  that.timeOut = true
                  that.times = that.times+3
                  that.times = that.times+1
                  that.infoType = 0
               }
            })
@@ -570,7 +590,6 @@
                  that.timeOut = false
                  that.times = 0
                  var   res = result.data
                  console.log(res);
                  if (res.data && res.data !== "") {
                     var errorInfo = res.data
                     if (that.infoType == 1) {
@@ -808,6 +827,7 @@
                  ledId: that.baseLedId,
               },
               success(result) {
                  console.log(result);
                  var res = result.data
                  if (res.code === 200) {
                     that.baseInfo.xDistance = res.data.xDistance