wy 1 rok temu
rodzic
commit
638d8d23bc

+ 27 - 26
pages/power-changer/index.vue

@@ -53,7 +53,7 @@
 							<PannelTitle words="车牌识别" :value="vehicleInfo.plateState ? '成功' : '未识别'"
 								:flag="vehicleInfo.plateComState" />
 						</view>
-						
+
 					</view>
 					<view class="list">
 						<view class="carLeft">
@@ -64,7 +64,7 @@
 							<PannelTitle words="连接状态" :value="vehicleInfo.conState ? '已连接' : '未连接'"
 								:flag="vehicleInfo.conState" />
 						</view>
-						
+
 					</view>
 					<view class="list">
 						<view class="carLeft">
@@ -77,7 +77,7 @@
 								@ExchangeMessage="ExchangeMessage" :flag="!vehicleInfo.lockState" />
 						</view>
 					</view>
-					
+
 				</view>
 			</view>
 		</view>
@@ -175,15 +175,18 @@
 						<view class="Exchange-status" v-if="showStore == 2">
 							<view class="Exchange-status-left">
 								<view class="Exchange-status-left-box change-store">
-									<text class="text1">仓位</text><text class="text2">{{xfTargetCodeData.xfTargetCode}}号仓位</text>
+									<text class="text1">仓位</text><text
+										class="text2">{{xfTargetCodeData.xfTargetCode}}号仓位</text>
 								</view>
 								<view class="Exchange-status-left-box">
-									<text class="text1">电池状态</text><text class="text2">{{xfTargetCodeData.chargerState?'充电中':'未充电'}}</text>
+									<text class="text1">电池状态</text><text
+										class="text2">{{xfTargetCodeData.chargerState?'充电中':'未充电'}}</text>
 								</view>
 							</view>
 							<view class="Exchange-status-left">
 								<view class="Exchange-status-left-box">
-									<text class="text1">动作流程</text><text class="text2">{{xfTargetCodeData.actionFlow || '-'}}</text>
+									<text class="text1">动作流程</text><text
+										class="text2">{{xfTargetCodeData.actionFlow || '-'}}</text>
 								</view>
 								<view class="Exchange-status-left-box">
 									<text class="text1">工作时长</text><text class="text2">{{changeWareHouse || '-'}}</text>
@@ -314,11 +317,19 @@
 				isSelectstoreState: [], //选择的仓位存储电池状态
 				showStore: 0, //0换电展示 1调仓展示  2换仓展示
 				TcInfoVoData: {}, //调仓信息对象
-				xfTargetCodeData:{},//消防换仓对象
+				xfTargetCodeData: {}, //消防换仓对象
 			}
 		},
 		mounted() {
 			this.InitWs()
+			//检查断开重连
+			this.timer = setInterval(() => {
+				if (this.ws.readyState != 1) {
+					this.ws.close()
+					console.log('检查断开重连')
+					this.InitWs()
+				}
+			}, 2000)
 		},
 		onUnload() {
 			console.log('onUnload')
@@ -352,7 +363,7 @@
 				}
 			},
 			//消防换仓工作时长
-			changeWareHouse(){
+			changeWareHouse() {
 				if (this.xfTargetCodeData.startTime) {
 					let end_time = this.$moment()
 					let seconds = end_time.diff(this.xfTargetCodeData.startTime, "seconds")
@@ -640,7 +651,7 @@
 						2) {
 						that.ExchangeMessage('warn',
 							`【${this.BatterySelectAllArr[0].storeState===1?this.BatterySelectAllArr[0].storeCode:this.BatterySelectAllArr[1].storeCode}】号仓位电池未断电,请断电后在进行调仓!`
-							)
+						)
 					} else {
 						const params = {
 							sourceCode: this.BatterySelectAllArr[0].storeState === 1 ? this.BatterySelectAllArr[0]
@@ -730,7 +741,7 @@
 					this.ws = null
 				}
 				if (this.timer != null) {
-					clearInterval(this.timer)
+					// clearInterval(this.timer)
 					this.timer = null
 				}
 				let token = this.$storage.getJson('token');
@@ -807,7 +818,7 @@
 							targetCode: d.targetCode,
 							actionFlow: d.actionFlow,
 							startTime: d.startTime,
-							chargerState:d.chargerState,
+							chargerState: d.chargerState,
 						}
 						this.showStore = 1;
 					} else {
@@ -816,13 +827,13 @@
 					//消防换仓
 					if (d.xfTargetCode) {
 						this.xfTargetCodeData = {
-							xfTargetCode:d.xfTargetCode,
-							chargerState:d.chargerState,
-							startTime:d.startTime,
-							actionFlow:d.actionFlow,
+							xfTargetCode: d.xfTargetCode,
+							chargerState: d.chargerState,
+							startTime: d.startTime,
+							actionFlow: d.actionFlow,
 						}
 						this.showStore = 2;
-					}else{
+					} else {
 						this.showStore = 0
 					}
 				})
@@ -833,16 +844,6 @@
 				this.ws.onError(() => {
 					console.log("WebSocket连接错误")
 				})
-				if (this.timer == null) {
-					this.timer = setInterval(() => {
-						if (this.ws.readyState != 1) {
-							clearInterval(this.timer)
-							this.timer = null
-							this.ws.close()
-							this.InitWs()
-						}
-					}, 2000)
-				}
 			},
 		},
 	}

+ 4 - 4
pages/service-recode/components/change.vue

@@ -119,11 +119,11 @@
 					key: 'swapBeginTime',
 					widtd: 200
 				}, {
-					label: '安装满电时长(s)',
+					label: '安装满电时长',
 					key: 'fullDuration',
 					widtd: 150,
 				},{
-					label:'换电时长(s)',
+					label:'换电时长',
 					key:'swapDuration',
 					widtd:130,
 					
@@ -192,8 +192,7 @@
 					.then(res => {
 						if(res.code == 0){
 							this.showLoadMore = false
-							this.changelist.push(...res.data.records)
-							this.changelist.forEach(item=>{
+							res.data.records.forEach(item=>{
 								if(item.swapState == 0){
 									item.swapState = '不完整'
 								}else if(item.swapState == 1){
@@ -204,6 +203,7 @@
 									item.swapState = '换电错误'
 								}
 							})
+							this.changelist.push(...res.data.records)
 							this.total = res.data.total;
 						}
 					}).catch(err => {

+ 2 - 2
pages/service-recode/components/recharge.vue

@@ -95,10 +95,10 @@
 					}, {
 						label: '充电结束时间',
 						key: 'chgEndTime',
-						widtd: 130,
+						widtd: 200,
 
 					}, {
-						label: '充电时长(小时)',
+						label: '充电时长()',
 						key: 'chgDuration',
 						widtd: 150,
 						sort: true

+ 2 - 2
pages/service-recode/components/rechargeDrawer.vue

@@ -5,12 +5,12 @@
 		<view class="Carlist" v-for="(item,index) in infodata" :key="index">
 			<view class="carDetail">
 				<view class="vinMa">
-					<view>开始时段</view>
+					<view>开始时段</view>
 					<view>{{item.startTime }}</view>
 				</view>
 				<view class="box_vinma">
 					<view class="vinMa">
-						<view>结束时段</view>
+						<view>结束时段</view>
 						<view>{{item.endTime }}</view>
 					</view>