whycq
2024-07-23 8c3f98d5240355920cfcbbe6dc96f2c079764dfc
Monitor-APP/pages/home/home.vue
@@ -233,13 +233,13 @@
                              <swiper-item class="swiper-item" v-for="(item,i) in swiperList" :key="i">
                                 <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: 40%;">料号: {{item.matnr}}</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: 40%;">名称: {{item.maknx}}</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
               }
            })
@@ -807,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