From d24e3dda64bda6cd77fddcae9aac9976432371d0 Mon Sep 17 00:00:00 2001 From: whycq <123456> Date: 星期二, 18 十月 2022 08:40:37 +0800 Subject: [PATCH] # --- Monitor-APP/pages/index/index.vue | 185 ++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 153 insertions(+), 32 deletions(-) diff --git a/Monitor-APP/pages/index/index.vue b/Monitor-APP/pages/index/index.vue index dca538d..b354b71 100644 --- a/Monitor-APP/pages/index/index.vue +++ b/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}} {{hours}}:{{minutes}}:{{seconds}} {{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}} {{hours}}:{{minutes}}:{{seconds}} {{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%; -- Gitblit v1.9.1