#
whycq
2022-10-18 d24e3dda64bda6cd77fddcae9aac9976432371d0
Monitor-APP/pages/index/index.vue
@@ -6,7 +6,7 @@
         <view class="head">
            <text @click="port()">自动仓库WCS监控平台</text>
            <view class="time-tools">{{year}}-{{month}}-{{day}}&nbsp{{hours}}:{{minutes}}:{{seconds}}&nbsp{{week}}</view>
            <view class="button-left" @click="url()"></view>
            <view class="button-left" @click="ejected()"></view>
            <view class="button-right" @click="ledId()"></view>
         </view>
         <view class="main">
@@ -74,7 +74,7 @@
         <view class="head">
            <text @click="port()">自动仓库WCS监控平台</text>
            <view class="time-tools">{{year}}-{{month}}-{{day}}&nbsp{{hours}}:{{minutes}}:{{seconds}}&nbsp{{week}}</view>
            <view class="button-left" @click="url()"></view>
            <view class="button-left" @click="ejected()"></view>
            <view class="button-right" @click="ledId()"></view>
         </view>
         <view class="main">
@@ -252,6 +252,46 @@
               placeholder="示例:1" @confirm="crnConfirm"></uni-popup-dialog>
         </uni-popup>
      </view>
      <!-- 自定义弹出层 -->
      <view class="eject-mask" v-show="ejectShow">
         <view class="eject">
            <!-- 弹出title -->
            <view class="eject-title">修改 / 配置</view>
            <!-- input -->
            <view class="eject-input">
               <view class="item">
                  <view class="desc">ip:</view>
                  <view class="input">
                     <input type="text" v-model="baseIP">
                  </view>
               </view>
               <view class="item">
                  <view class="desc">port:</view>
                  <view class="input">
                     <input type="text" v-model="basePort">
                  </view>
               </view>
               <view class="item">
                  <view class="desc">ledId:</view>
                  <view class="input">
                     <input type="text" v-model="baseLedId">
                  </view>
               </view>
               <view class="item">
                  <view class="desc">crnId:</view>
                  <view class="input">
                     <input type="text" v-model="crnId">
                  </view>
               </view>
            </view>
            <!-- button -->
            <view class="eject-button">
               <view class="button-item" @click="ejectClose">取 消</view>
               <view class="button-item" @click="ejectConfirm">确 认</view>
            </view>
         </view>
      </view>
   </view>
</template>
@@ -330,6 +370,8 @@
            interval:1000, // 调用时长
            duration:8000, // 移动速度
            matList:[], // 订单列表
            ejectShow: false,
         }
      },
      mounted() {
@@ -338,16 +380,18 @@
         const BaseLedId = uni.getStorageSync('BaseLedId');
         const BasePort = uni.getStorageSync('BasePort');
         const BaseCrnId = uni.getStorageSync('BaseCrnId');
         if (BaseIP && BaseLedId) {
         // if (BaseIP && BaseLedId) {
            that.baseIP = BaseIP
            that.baseLedId = BaseLedId
            that.basePort = BasePort
            that.baseCrnId = BaseCrnId
         } else {
            that.baseUrl = ''
            that.baseLedId = ''
         }
         this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUrl
         // } else {
         //    that.baseUrl = ''
         //    that.baseLedId = ''
         // }
         this.getUrl()
         console.log(this.commonUrl);
         // this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUr
      },
      onReady() {
         // 获得初始数据
@@ -370,6 +414,10 @@
         },1000)
      },
      methods: {
         // 获取url
         getUrl() {
            this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
         },
         // 获取错误信息
         getYYY() {
            let that = this
@@ -485,7 +533,7 @@
               },
               method:'GET',
               success(result) {
                  // console.log(result);
                  console.log(result);
                  res = result.data 
                  if (res.data && res.data !== "") {
                     that.errorMsg = res.data
@@ -515,7 +563,7 @@
               },
               method:'GET',
               success(result) {
                  console.log(result);
                  // console.log(result);
                  res = result.data
                  if(res.data && res.data !== null) {
                     // that.move = false
@@ -636,33 +684,24 @@
               }
            })
         },
         port() {
            this.$refs.port.open()
         ejected () {
            this.ejectShow = true
         },
         url() {
            this.$refs.url.open()
         },
         ledId() {
            this.$refs.ledId.open()
         },
         crn() {
            this.$refs.crnId.open()
         },
         baseUrlConfirm(val) {
            this.baseIp = val
         // 弹出层确认
         ejectConfirm() {
            uni.setStorageSync('BaseIp', this.baseIp);
         },
         ledIdConfirm(val) {
            this.baseLedId = val
            uni.setStorageSync('BaseLedId', this.baseLedId);
         },
         portConfirm(val) {
            this.basePort = val
            uni.setStorageSync('BasePort',this.basePort);
         },
         crnConfirm(val) {
            this.baseCrnId = val
            uni.setStorageSync('BaseCrnId',this.baseCrnId);
            this.getUrl()
            console.log(uni.getStorageSync('BaseIp'));
            console.log(this.baseIP);
            console.log(this.commonUrl);
            this.ejectShow = false
         },
         // 弹出层取消
         ejectClose() {
            this.ejectShow = false
         },
         getServerData() {
            this.chartsDataLine1=JSON.parse(JSON.stringify(this.chartsData.Line))
@@ -695,6 +734,88 @@
</script>
<style>
   /* 弹出:配置区域 */
   .eject-mask {
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      position: fixed;
      top: 0;
      left: 0;
      z-index: 999;
      display: flex;
      align-items: center;
      justify-content: center;
   }
   .eject{
      position: relative;
      width: 600px;
      height: 350px;
      background-color: #eaeaea;
      border-radius: 25rpx;
   }
   .eject-title {
      width: 100%;
      height: 100px;
      line-height: 100px;
      font-size: 20px;
      font-weight: 700;
      color:    #606266;
      text-align: center;
   }
   .eject-input {
   }
   .item {
      display: flex;
      align-items: center;
      margin: 10px 0 0 0;
   }
   .desc {
      display: inline-block;
      width: 40%;
      text-align: right;
      color: #606266;
      font-size: 18px;
   }
   .input {
      display: flex;
      align-items: center;
      padding-left: 5px;
      padding-right: 5px;
      width: 100%;
      height: 30px;
      border: 1px solid #C0C4CC;
      margin-right: 50px;
   }
   .eject-input input {
      width: 100%;
   }
   .eject-button {
      display: flex;
      align-items: center;
      position: absolute;
      bottom: 0;
      height: 60px;
      line-height: 60px;
      width: 100%;
      border-top: 1px solid #ccc;
   }
   .button-item {
      width: 50%;
      height: 100%;
      font-size: 20px;
      font-weight: bold;
      text-align: center;
      color: #909399;
   }
   .button-item:last-child {
      color: #67C23A;
      border-left: 1px solid #ccc;
   }
   .full-width {
      width: 100%;
      height: 100%;