Browse Source

pad2.0备份

蒋科 1 year ago
parent
commit
753ece4b2e

+ 1 - 1
common/http.js

@@ -144,7 +144,7 @@ export function getStationCode() {
 }
 //云端
 export function getcloudConnState() {
-	return request.post("/swap/cloudConnState")
+	return request.post("/alarm/toDayAlarm")
 }
 //切换仓内仓外
 export function gettoggleChargeWay(data) {

+ 15 - 4
common/request.js

@@ -18,6 +18,7 @@ export default {
 	send(options = {}) {
 		options.url = config.uni_app_web_api_url + '' + options.url;
 		options.method = options.method || "GET";
+		options.timeout=5000
 
 		let users = storage.getJson("userId");
 		let token = storage.getJson("token");
@@ -32,14 +33,23 @@ export default {
 			// 	title: '加载中...',
 			// 	mask: true
 			// });
+			
 			uni.request(options).then(data => {
 				var [error, res] = data;
+				// console.log(error,'data')
 				if (error != null) {
 					reject(error);
-					uni.showToast({
-						title: '请求接口失败!',
-						icon: 'none',
-					})
+					if(error.errMsg.includes('timeout')){
+						uni.showToast({
+							title: '请求接口失败!',
+							icon: 'none',
+						})
+					}else{
+						uni.showToast({
+							title: '网络错误!',
+							icon: 'none',
+						})
+					}
 				} else {
 					if (res.data.code == -3) {
 						storage.remove("users")
@@ -54,6 +64,7 @@ export default {
 				}
 				// uni.hideLoading();
 			});
+			
 		});
 	},
 	get(url = "", data = {}) {

+ 26 - 13
components/BatteryInfo/BatteryInfo.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="battery-info" :class="[IsSelect?'SelectBorder':'defaultBorder']" @click="HandleBatterySelected(storeCode,storeState,getChgState)">
-		<view class="battery-header" :class="[storeState===1?'battery-have':'battery-null']">
+		<view class="battery-header" :class="[storeState===1&&soc?'battery-have':'battery-null']">
 			<view class="battery-box" v-show="getChgState!=2 && storeState===1">
 				<view class="batteryList">
 					<view class="battery-many" v-for="item in getBatteryNum" :key="item"
@@ -8,14 +8,17 @@
 						<image :src="item === getBatteryNum ? '/static/change/ding.png' : '/static/change/zhong.png'"></image>
 					</view>
 				</view>
-				<span>SOC {{soc || '0'}}%<br>{{chgEstimatedTime || '0'}}min 充满</span>
+				<span>SOC {{soc || '0'}}%</span>
 			</view>
 			<view class="battery-anmition" v-show="getChgState==2">
 				<span>SOC {{soc || '0'}}%<br>{{chgEstimatedTime || '0'}}min 充满</span>
 			</view>
 		</view>
 		<view class="battery-footer">
-			<span class="battery-number">{{ storeCode }}号仓</span>
+			<view class="battery-number">
+				<span class="codeNum">{{ storeCode }}号仓</span>
+				<span v-if="freezeState"><image src="/static/change/s5.png"></image></span>
+			</view>
 		</view>
 	</view>
 </template>
@@ -58,13 +61,13 @@
 				}
 			},
 			//计算电池是否充电中
-			        getChgState(){
-			            if(this.chgState==1 || this.chgState==2){
-			                return 2
-			            }else{
-			                return 0
-			            }
-			        }
+			getChgState(){
+				if(this.chgState==1 || this.chgState==2){
+					return 2
+				}else{
+					return 0
+				}
+			}
 		},
 		methods: {
 			//把选择的仓位号传给父组件,触发函数BatterySelected
@@ -180,9 +183,19 @@
 			line-height: 24px;
 			color: white;
 			font-size: 12px;
-			text-indent: 8px;
+			.battery-number{
+				display: flex;
+				justify-content: space-between;
+				.codeNum{
+					text-indent: 5rpx;
+				}
+				image{
+					width: 18rpx;
+					height: 18rpx;
+					margin-top: 3rpx;
+					margin-right: 5rpx;
+				}
+			}
 		}
-
-
 	}
 </style>

+ 14 - 14
components/Navbar/Navbar.vue

@@ -78,8 +78,21 @@
 				alarmNum: 0, //消防告警数量
 				cloud: 0, //云端
 				codeState: 0, //编号
+				curAlarmNum:null,
 			};
 		},
+		mounted() {
+			// this.getRoute()
+			this.getuserinfo()
+			this.getState()
+			this.curAlarmNum=setInterval(()=>{
+				this.cloudConnState()
+				this.getnum()
+			},1000)
+		},
+		destroyed() {
+			clearInterval(this.curAlarmNum)
+		},
 		methods: {
 			//编号
 			getState() {
@@ -147,7 +160,7 @@
 				this.getPage('故障告警')
 				this.$storage.setJson('gotoname', 1) //存本地用于判断显示的告警页面
 			},
-			//当消防告警数量
+			//当前实时消防告警数量
 			getnum() {
 				this.$http.getToDayAlarm().then(res => {
 					if (res.code == 0) {
@@ -156,19 +169,6 @@
 				});
 			}
 		},
-		mounted() {
-			// this.getRoute()
-			this.getuserinfo()
-			this.getnum()
-			this.getState()
-			
-			setInterval(()=>{
-				this.cloudConnState()
-			},2000)
-		},
-		onShow() {
-
-		}
 	}
 </script>
 

+ 2 - 2
components/PannelItem/PannelItem.vue

@@ -35,9 +35,9 @@
 						if (res.confirm) {
 							that.$http.EditSwapplc(id+'').then(res=>{
 								if(res.code === 0){
-									that.$emit('ExchangeMessage','success',id===4?'暂停成功!':'恢复成功!')
+									that.$emit('ExchangeMessage','success',id===4?'暂停指令下发成功!':'恢复指令下发成功!')
 								}else{
-									that.$emit('ExchangeMessage','error',id===4?'暂停失败!':'恢复失败!')
+									that.$emit('ExchangeMessage','error',id===4?'暂停指令下发失败!':'恢复指令下发失败!')
 								}
 								
 							})

+ 3 - 1
components/lyy-table/lyy-table.vue

@@ -51,7 +51,9 @@
 									:class="[content[header.key] ==1?'warnColor':'']">{{content[header.key] === 0 ? '持续': '已结束'}}</text>
 							</template>
 							<template v-else>
-								<view v-if="header.label == '操作' && !battery" class="editColor" @click="EditAlarm(content)">消防换仓
+								<view v-if="header.label == '操作' && !battery">
+									<view  @click="EditAlarm(content)" v-if="content.type=='消防告警' && content.alarmValue==999" class="editColor">消防换仓</view>
+									<view v-else>{{emptyString}}</view>
 								</view>
 								<view v-if="header.label == '操作' && battery" class="editColor" @click="EditAlarmInfo(content)">详情
 								</view>

+ 4 - 4
config.js

@@ -1,8 +1,8 @@
 export default {
 	web_name: "智小狸",
-	// uni_app_web_api_url: "http://zk.li-ai.com.cn:8080/api", //后端统一接口路径
-	uni_app_web_api_url: "http://192.168.3.177:8080/api",
-	// web_socket_url:'ws://zk.li-ai.com.cn:8080/ws/',
-	web_socket_url:'ws://192.168.3.177:8080/ws/',
+	uni_app_web_api_url: "http://192.168.0.204:8080/api", //后端统一接口路径
+	// uni_app_web_api_url: "http://192.168.3.177:8080/api",
+	web_socket_url:'ws://192.168.0.204:8080/ws/',
+	// web_socket_url:'ws://192.168.3.177:8080/ws/',
 	debug: true
 }

+ 6 - 4
manifest.json

@@ -1,9 +1,9 @@
 {
     "name" : "智能换电",
-    "appid" : "__UNI__D9A00CF",
+    "appid" : "__UNI__A9957B4",
     "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
+    "versionName" : "2.0.0",
+    "versionCode" : 200,
     "transformPx" : false,
     "networkTimeout" : {
         "request" : 30000
@@ -49,7 +49,9 @@
                 ]
             },
             /* ios打包配置 */
-            "ios" : {},
+            "ios" : {
+                "dSYMs" : false
+            },
             /* SDK配置 */
             "sdkConfigs" : {
                 "ad" : {}

+ 6 - 2
pages/basic-data/index.vue

@@ -22,7 +22,7 @@
 			<view class="reset-btn" @click="resetForm">重置</view>
 		</view>
 		<view class="basic-table">
-			<view class="search-btn marginZero" @click="OpenAddDrawer">新增</view>
+			<!-- <view class="search-btn marginZero" @click="OpenAddDrawer">新增</view> -->
 			<baseDateTable @DelCarData="DelCarData" @EditCarData="EditCarData" :headerFixed="true"
 				:showLoadMore="showLoadMore" :loadMore="loadMore" :columnFixed=1 :contents="datalist" :headers="headers"
 				@onPullup="pullup">
@@ -271,11 +271,15 @@
 			},
 			//车辆列表,
 			vehicleList() {
+				uni.showLoading({
+					title:'数据加载中...'
+				})
 				console.log(this.queryParams)
 				this.$http.vehicleList(this.queryParams).then((res) => {
 					this.datalist = res.data.records;
 					this.total = res.data.total;
-				});
+					uni.hideLoading()
+				}).catch(err => {uni.hideLoading()});
 			},
 			//关闭抽屉
 			closeDrawer() {

+ 142 - 118
pages/equipment-monitoring/components/StorageInfo.vue

@@ -12,95 +12,111 @@
 					B枪
 				</view>
 			</view>
-			<view class="container-code">
-				<view class="container-code-one" :class="statustext[1]" v-if="showCode== 0">
-					{{statustext[0]}}
-				</view>
-				<view class="container-code-one" :class="statustextA[1]" v-if="showCode== 1">
-					{{statustextA[0]}}
-				</view>
-				<view class="container-code-one" :class="statustextB[1]" v-if="showCode== 2">
-					{{statustextB[0]}}
-				</view>
-				<view class="container-code-two" v-if="showCode== 0">
-					<image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoVo.chgState === 2"
-						@click="sendCharger('断电')"></image>
-					<image src="../../../static/equipment/c1.png" mode=""
-						v-if="chargerInfoVo.chgState === 0 || chargerInfoVo.chgState === 3" @click="sendCharger('充电')">
-					</image>
-					<image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoVo.chgState !== 2"></image>
-					<image src="../../../static/equipment/c2.png" mode=""
-						v-if="chargerInfoVo.chgState !== 0 && chargerInfoVo.chgState !== 3"></image>
-				</view>
-				<view class="container-code-two" v-if="showCode== 1">
-					<image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoOneVo.chgState === 2"
-						@click="sendChargerOut('断电',batInfoOneVo.gunCode,chargerInfoOneVo.chargerCode)">
-					</image>
-					<image src="../../../static/equipment/c1.png" mode=""
-						v-if="chargerInfoOneVo.chgState === 0 || chargerInfoOneVo.chgState === 3"
-						@click="sendChargerOut('充电',batInfoOneVo.gunCode,chargerInfoOneVo.chargerCode)"></image>
-					<image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoOneVo.chgState !== 2">
-					</image>
-					<image src="../../../static/equipment/c2.png" mode=""
-						v-if="chargerInfoOneVo.chgState !== 0 && chargerInfoOneVo.chgState !== 3"></image>
-				</view>
-				<view class="container-code-two" v-if="showCode== 2">
-					<image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoTwoVo.chgState === 2"
-						@click="sendChargerOut('断电',batInfoTwoVo.gunCode,chargerInfoTwoVo.chargerCode)">
-					</image>
-					<image src="../../../static/equipment/c1.png" mode=""
-						v-if="chargerInfoTwoVo.chgState === 0 || chargerInfoTwoVo.chgState === 3"
-						@click="sendChargerOut('充电',batInfoTwoVo.gunCode,chargerInfoTwoVo.chargerCode)"></image>
-					<image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoTwoVo.chgState !== 2">
-					</image>
-					<image src="../../../static/equipment/c2.png" mode=""
-						v-if="chargerInfoTwoVo.chgState !== 0 && chargerInfoTwoVo.chgState !== 3"></image>
-				</view>
-			</view>
-
-
-			<BatteryStatus :storeCode="storeCode" :comState="comState" :sn="sn" :soc="soc"
-				:chgEstimatedTime="chgEstimatedTime" :showCode="showCode" v-if="showCode== 0"></BatteryStatus>
-			<BatteryStatus :storeCode="batInfoOneVo.storeCode" :comState="chargerInfoOneVo.comState"
-				:sn="batInfoOneVo.sn" :soc="batInfoOneVo.soc" :chgEstimatedTime="chargerInfoOneVo.chgEstimatedTime"
-				:showCode="showCode" v-if="showCode== 1"></BatteryStatus>
-			<BatteryStatus :storeCode="batInfoTwoVo.storeCode" :comState="chargerInfoTwoVo.comState"
-				:sn="batInfoTwoVo.sn" :soc="batInfoTwoVo.soc" :chgEstimatedTime="chargerInfoTwoVo.chgEstimatedTime"
-				:showCode="showCode" v-if="showCode== 2"></BatteryStatus>
-			<view class="battery-info">
-				<view class="vim" v-if="showCode == 1">
-					<text>vin码</text><text>{{batInfoOneVo.vin ||'-'}}</text>
-				</view>
-				<view class="vim" v-if="showCode == 2">
-					<text>vin码</text><text>{{batInfoTwoVo.vin ||'-'}}</text>
-				</view>
-				<BatteryInfo :num="current" unit="A" text="电流" v-if="showCode == 0"></BatteryInfo>
-				<BatteryInfo :num="batInfoOneVo.current" unit="A" text="电流" v-if="showCode ==1"></BatteryInfo>
-				<BatteryInfo :num="batInfoTwoVo.current" unit="A" text="电流" v-if="showCode == 2"></BatteryInfo>
-				<BatteryInfo :num="voltage" unit="V" text="电压" v-if="showCode == 0"></BatteryInfo>
-				<BatteryInfo :num="batInfoOneVo.voltage" unit="V" text="电压" v-if="showCode == 1"></BatteryInfo>
-				<BatteryInfo :num="batInfoTwoVo.voltage" unit="V" text="电压" v-if="showCode == 2"></BatteryInfo>
-				<BatteryInfo :num="soh" unit="%" text="SOH" v-if="showCode == 0"></BatteryInfo>
-				<view class="info-right" :style="chargerColor" v-if="showCode == 0">
-					<image class="s1" :src="require('../../../static/equipment/'+`s${chargerState[0]}`+'.png')">
-						<text>{{chargerState[1]}}</text>
-				</view>
-				<view class="info-right" :style="chargerColorA" v-if="showCode == 1">
-					<image class="s1" :src="require('../../../static/equipment/'+`s${chargerStateA[0]}`+'.png')">
-						<text>{{chargerStateA[1]}}</text>
+			<view class="topBox">
+				<view class="container-code">
+					<view class="container-code-one" :class="statustext[1]" v-if="showCode== 0">
+						{{statustext[0]}}
+					</view>
+					<view class="container-code-one" :class="statustextA[1]" v-if="showCode== 1">
+						{{statustextA[0]}}
+					</view>
+					<view class="container-code-one" :class="statustextB[1]" v-if="showCode== 2">
+						{{statustextB[0]}}
+					</view>
+					<view class="container-code-two" v-if="showCode== 0">
+						<image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoVo.chgState === 2"
+							@click="sendCharger('断电')"></image>
+						<image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoVo.chgState !== 2"></image>
+						<image src="../../../static/equipment/c1.png" mode=""
+							v-if="chargerInfoVo.chgState === 0 || chargerInfoVo.chgState === 3" @click="sendCharger('充电')">
+						</image>
+						<image src="../../../static/equipment/c2.png" mode=""
+							v-if="chargerInfoVo.chgState !== 0 && chargerInfoVo.chgState !== 3"></image>
+					</view>
+					<view class="container-code-two" v-if="showCode== 1">
+						<image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoOneVo.chgState === 2"
+							@click="sendChargerClose('断电',batInfoOneVo.gunCode,chargerInfoOneVo.chargerCode)">
+						</image>
+						<image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoOneVo.chgState !== 2">
+						</image>
+						<image src="../../../static/equipment/c1.png" mode=""
+							v-if="chargerInfoOneVo.chgState === 0 || chargerInfoOneVo.chgState === 3"
+							@click="sendChargerOpen('充电',batInfoOneVo.gunCode,chargerInfoOneVo.chargerCode)"></image>
+						<image src="../../../static/equipment/c2.png" mode=""
+							v-if="chargerInfoOneVo.chgState !== 0 && chargerInfoOneVo.chgState !== 3"></image>
+					</view>
+					<view class="container-code-two" v-if="showCode== 2">
+						<image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoTwoVo.chgState === 2"
+							@click="sendChargerClose('断电',batInfoTwoVo.gunCode,chargerInfoTwoVo.chargerCode)">
+						</image>
+						<image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoTwoVo.chgState !== 2">
+						</image>
+						<image src="../../../static/equipment/c1.png" mode=""
+							v-if="chargerInfoTwoVo.chgState === 0 || chargerInfoTwoVo.chgState === 3"
+							@click="sendChargerOpen('充电',batInfoTwoVo.gunCode,chargerInfoTwoVo.chargerCode)"></image>
+						<image src="../../../static/equipment/c2.png" mode=""
+							v-if="chargerInfoTwoVo.chgState !== 0 && chargerInfoTwoVo.chgState !== 3"></image>
+					</view>
 				</view>
-				<view class="info-right" :style="chargerColorB" v-if="showCode == 2">
-					<image class="s1" :src="require('../../../static/equipment/'+`s${chargerStateB[0]}`+'.png')">
-						<text>{{chargerStateB[1]}}</text>
+				<BatteryStatus :storeCode="storeCode" :comState="comState" :sn="sn" :soc="soc"
+					:chgEstimatedTime="chgEstimatedTime" :showCode="showCode" v-if="showCode== 0"></BatteryStatus>
+				<BatteryStatus :storeCode="batInfoOneVo.storeCode" :comState="chargerInfoOneVo.comState"
+					:sn="batInfoOneVo.sn" :soc="batInfoOneVo.soc" :chgEstimatedTime="chargerInfoOneVo.chgEstimatedTime"
+					:showCode="showCode" v-if="showCode== 1"></BatteryStatus>
+				<BatteryStatus :storeCode="batInfoTwoVo.storeCode" :comState="chargerInfoTwoVo.comState"
+					:sn="batInfoTwoVo.sn" :soc="batInfoTwoVo.soc" :chgEstimatedTime="chargerInfoTwoVo.chgEstimatedTime"
+					:showCode="showCode" v-if="showCode== 2"></BatteryStatus>
+				<view class="battery-info">
+					<view class="vim" v-if="showCode == 1">
+						<text>vin码</text><text>{{batInfoOneVo.vin ||'-'}}</text>
+					</view>
+					<view class="vim" v-if="showCode == 2">
+						<text>vin码</text><text>{{batInfoTwoVo.vin ||'-'}}</text>
+					</view>
+					<template v-if="showCode == 0">
+						<BatteryInfo :num="chargerInfoVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
+						<BatteryInfo :num="chargerInfoVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
+					</template>
+					<template v-if="showCode == 1">
+						<BatteryInfo :num="chargerInfoOneVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
+						<BatteryInfo :num="chargerInfoOneVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
+					</template>
+					<template v-if="showCode == 2">
+						<BatteryInfo :num="chargerInfoTwoVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
+						<BatteryInfo :num="chargerInfoTwoVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
+					</template>
+					<BatteryInfo :num="current" unit="A" text="电流" v-if="showCode == 0 && chgType == 0"></BatteryInfo>
+					<BatteryInfo :num="batInfoOneVo.current" unit="A" text="电流" v-if="showCode ==1 && chgType == 0">
+					</BatteryInfo>
+					<BatteryInfo :num="batInfoTwoVo.current" unit="A" text="电流" v-if="showCode == 2 && chgType == 0">
+					</BatteryInfo>
+					<BatteryInfo :num="voltage" unit="V" text="电压" v-if="showCode == 0 && chgType == 0"></BatteryInfo>
+					<BatteryInfo :num="batInfoOneVo.voltage" unit="V" text="电压" v-if="showCode == 1 && chgType == 0">
+					</BatteryInfo>
+					<BatteryInfo :num="batInfoTwoVo.voltage" unit="V" text="电压" v-if="showCode == 2 && chgType == 0">
+					</BatteryInfo>
+					<BatteryInfo :num="soh" unit="%" text="SOH" v-if="showCode == 0"></BatteryInfo>
+					<view class="info-right" :style="chargerColor" v-if="showCode == 0">
+						<image class="s1" :src="require('../../../static/equipment/'+`s${chargerState[0]}`+'.png')">
+							<text>{{chargerState[1]}}</text>
+					</view>
+					<view class="info-right" :style="chargerColorA" v-if="showCode == 1">
+						<image class="s1" :src="require('../../../static/equipment/'+`s${chargerStateA[0]}`+'.png')">
+							<text>{{chargerStateA[1]}}</text>
+					</view>
+					<view class="info-right" :style="chargerColorB" v-if="showCode == 2">
+						<image class="s1" :src="require('../../../static/equipment/'+`s${chargerStateB[0]}`+'.png')">
+							<text>{{chargerStateB[1]}}</text>
+					</view>
+					<!--  <BatteryInfo :num="minTemperature" unit="℃" text="最低温度"></BatteryInfo>
+					<BatteryInfo :num="maxTemperature" unit="℃" text="最高温度"></BatteryInfo>
+					<BatteryInfo :num="maxCellVoltage" unit="V" text="最高单体电压"></BatteryInfo>
+					<BatteryInfo :num="minCellVoltage" unit="V" text="最低单体电压"></BatteryInfo>
+					<view class="info-right">
+						<image class="s1" src="../../../static/equipment/s1.png"><text class="text">{{StateNum}}</text>
+					</view>
+					 -->
 				</view>
-				<!--  <BatteryInfo :num="minTemperature" unit="℃" text="最低温度"></BatteryInfo>
-                <BatteryInfo :num="maxTemperature" unit="℃" text="最高温度"></BatteryInfo>
-                <BatteryInfo :num="maxCellVoltage" unit="V" text="最高单体电压"></BatteryInfo>
-                <BatteryInfo :num="minCellVoltage" unit="V" text="最低单体电压"></BatteryInfo>
-                <view class="info-right">
-                    <image class="s1" src="../../../static/equipment/s1.png"><text class="text">{{StateNum}}</text>
-                </view>
-                 -->
 			</view>
 			<view class="battery-charger">
 				<BatteryCharger :chargerCode="chargerInfoVo.chargerCode" :comState="chargerInfoVo.comState"
@@ -110,29 +126,24 @@
 				<BatteryCharger :chargerCode="chargerInfoTwoVo.chargerCode" :comState="chargerInfoTwoVo.comState"
 					v-if="chargerInfoTwoVo.chargerCode &&showCode ==2"></BatteryCharger>
 				<view class="battery-info" v-if="chargerInfoVo.chargerCode && showCode ==0">
-					<BatteryInfo :num="chargerInfoVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
-					<BatteryInfo :num="chargerInfoVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
 					<BatteryInfo :num="chargerInfoVo.chgCurrent" unit="A" text="充电电流"></BatteryInfo>
 					<BatteryInfo :num="chargerInfoVo.chgVoltage" unit="V" text="充电电压"></BatteryInfo>
-					<BatteryInfo :num="chargerInfoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo>
+					<!-- <BatteryInfo :num="chargerInfoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo> -->
 				</view>
 				<view class="battery-info" v-if="chargerInfoOneVo.chargerCode && showCode ==1">
-					<BatteryInfo :num="chargerInfoOneVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
-					<BatteryInfo :num="chargerInfoOneVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
 					<BatteryInfo :num="chargerInfoOneVo.chgCurrent" unit="A" text="充电电流"></BatteryInfo>
 					<BatteryInfo :num="chargerInfoOneVo.chgVoltage" unit="V" text="充电电压"></BatteryInfo>
-					<BatteryInfo :num="chargerInfoOneVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo>
+					<!-- <BatteryInfo :num="chargerInfoOneVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo> -->
 				</view>
 				<view class="battery-info" v-if="chargerInfoTwoVo.chargerCode && showCode ==2">
-					<BatteryInfo :num="chargerInfoTwoVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
-					<BatteryInfo :num="chargerInfoTwoVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
+
 					<BatteryInfo :num="chargerInfoTwoVo.chgCurrent" unit="A" text="充电电流"></BatteryInfo>
 					<BatteryInfo :num="chargerInfoTwoVo.chgVoltage" unit="V" text="充电电压"></BatteryInfo>
-					<BatteryInfo :num="chargerInfoTwoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo>
+					<!-- <BatteryInfo :num="chargerInfoTwoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo> -->
 				</view>
 				<view class="battery-charger-btn">
 					<view class="Plug-gun-charging" @click="ChargingMode(chgType)">
-						{{chgType == 0 ?'插枪充电':'线束充电'}}
+						{{chgType == 0 ?'切换为插枪充电':'切换为线束充电'}}
 					</view>
 					<view class="Settings Plug-gun-charging" @click="set">
 						设置
@@ -276,22 +287,12 @@
 					}
 				})
 			},
-			//仓外充电·断电操作
-			sendChargerOut(name, guncode, chargerId) {
+			//仓外·断电操作
+			sendChargerClose(name, guncode, chargerId) {
 				let params = {}
-				if (this.chargerInfoOneVo.chgState === 0 || this.chargerInfoOneVo.chgState === 3 ||
-					this.chargerInfoTwoVo.chgState === 0 || this.chargerInfoTwoVo.chgState === 3) {
-					params = {
-						"chargerId": chargerId * 1,
-						"gunNo": guncode,
-						"strategy": 4,
-						"strategyParam": 0
-					}
-				} else if (this.chargerInfoOneVo.chgState === 2 || this.chargerInfoTwoVo.chgState === 2) {
-					params = {
-						"chargerId": chargerId * 1,
-						"gunNo": guncode,
-					}
+				params = {
+					"chargerId": chargerId * 1,
+					"gunNo": guncode,
 				}
 				let that = this
 				uni.showModal({
@@ -300,7 +301,6 @@
 					success: function(res) {
 						if (res.confirm) { //点击确定
 							//断电操作
-							console.log(that.chargerInfoOneVo,that.chargerInfoTwoVo)
 							if (that.chargerInfoOneVo.chgState === 2 || that.chargerInfoTwoVo.chgState === 2) {
 								that.$emit('ExchangeMessage', 'success', '断电指令已下发')
 								console.log('stop')
@@ -311,7 +311,30 @@
 									}).catch(err => {
 										console.error(err)
 									})
-							} else if (that.chargerInfoOneVo.chgState === 0 || that.chargerInfoOneVo
+							}
+						} else if (res.cancel) {
+							return false
+							//用户点击取消按钮触发
+						}
+					}
+				})
+			},
+			//仓外充电
+			sendChargerOpen(name, guncode, chargerId) {
+				let params = {}
+				params = {
+					"chargerId": chargerId * 1,
+					"gunNo": guncode,
+					"strategy": 4,
+					"strategyParam": 0
+				}
+				let that = this
+				uni.showModal({
+					title: `确认发起${name}`,
+					content: '',
+					success: function(res) {
+						if (res.confirm) { //点击确定
+							if (that.chargerInfoOneVo.chgState === 0 || that.chargerInfoOneVo
 								.chgState === 3 ||
 								that.chargerInfoTwoVo.chgState === 0 || that.chargerInfoTwoVo.chgState === 3) {
 								//充电操作
@@ -324,7 +347,6 @@
 										console.error(err)
 									})
 							}
-
 						} else if (res.cancel) {
 							return false
 							//用户点击取消按钮触发
@@ -342,14 +364,14 @@
 				}
 			},
 			statustextA() {
-				if (this.chargerInfoOneVo.comState === 1) {
+				if (this.batInfoOneVo.conState === 1) {
 					return ['已连接', 'success']
 				} else {
 					return ['未连接', 'warning']
 				}
 			},
 			statustextB() {
-				if (this.chargerInfoTwoVo.comState === 1) {
+				if (this.batInfoTwoVo.conState === 1) {
 					return ['已连接', 'success']
 				} else {
 					return ['未连接', 'warning']
@@ -497,7 +519,9 @@
 					background-color: #636C97;
 				}
 			}
-
+			.topBox{
+				height: 688rpx;
+			}
 			.container-code {
 				display: flex;
 				margin-bottom: 10px;

+ 10 - 10
pages/equipment-monitoring/components/batteryDrawe.vue

@@ -12,7 +12,7 @@
 		<view class="main_drawe">
 			<uni-forms :modelValue="fromData">
 				<uni-forms-item label="当前充电:" name="name" label-align="right" label-width="120px">
-					<uni-easyinput type="text" v-model="fromData.comState== 0 ?'插枪充电':'线束充电'" placeholder="请输入"
+					<uni-easyinput type="text" v-model="fromData.comState== 0 ?'线束充电':'插枪充电'" placeholder="请输入"
 						disabled />
 				</uni-forms-item>
 				<uni-forms-item label="枪号:" name="arr" label-width="120px" label-align="right">
@@ -26,7 +26,7 @@
 				<uni-forms-item label="充电功率:" name="name" label-align="right" label-width="120px" v-if="fromData.setType !=0">
 					<uni-easyinput type="number" v-model="fromData.powerNum" placeholder="请输入" maxlength="4"/>
 					<view class="kwh">
-						{{fromData.setType == 2 ?'%': fromData.setType == 3 ?'A':'kWh'}}
+						{{fromData.setType == 2 ?'%': fromData.setType == 3 ?'A':'kW'}}
 					</view>
 				</uni-forms-item>
 			</uni-forms>
@@ -57,13 +57,13 @@
 							text: '功率值',
 							value: '1'
 						},
-						{
-							text: '功率百分比',
-							value: '2'
-						}, {
-							text: '输出电流',
-							value: '3'
-						}
+						// {
+						// 	text: '功率百分比',
+						// 	value: '2'
+						// }, {
+						// 	text: '输出电流',
+						// 	value: '3'
+						// }
 					],
 					gunNo: '',
 					comState: 1, //充电类型
@@ -96,7 +96,7 @@
 		},
 		mounted() {
 			this.fromData.comState = this.infodata.chgType
-			if(this.fromData.comState == 0){ //0是插枪充电 1是线束充电
+			if(this.fromData.comState == 1){ //1是插枪充电 0是线束充电
 				this.fromData.arr = [ {text: "A枪",value: "0",},{text: "B枪",value: "1",}]
 			}else{
 				this.fromData.arr = [ {text: "A枪",value: "0",}]

+ 8 - 3
pages/equipment-monitoring/components/manual.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="main_manual">
 		<SubTitle title="储充信息  8" titleEng="Storage and charging information"></SubTitle>
-		<view class="header_title">
+		<!-- <view class="header_title">
 			<image class="header_title_img" src="../../../static/equipment/tip.png" mode=""></image>
 			仓位上方是电池,下方是充电机,点击仓位可查看充电详情信息
-		</view>
+		</view> -->
 		<view class="box_swiper">
 			<scroll-view scroll-x="true" class="scroll_x">
 				<view v-for="(item, index) in storeInfoLists" :key="index">
@@ -70,6 +70,11 @@
 				infodata: {}, //详情数据
 			}
 		},
+		mounted() {
+			setTimeout(()=>{
+				uni.hideLoading()
+			},2000)
+		},
 		methods: {
 			//抽屉
 			drawer(item, index) {
@@ -209,4 +214,4 @@
 		padding-top: 20px;
 
 	}
-</style>
+</style>

+ 15 - 36
pages/equipment-monitoring/index.vue

@@ -5,19 +5,19 @@
 				{{isSlecte?'机器人':'储充设备'}}
 			</view> -->
 			<view class="tabar_btn">
-				<view class="btn" :class="isSlecte?'active':''" @click="isSlecte=true">
-					机器人
-				</view>
 				<view class="btn" :class="!isSlecte?'active':''" @click="isSlecte=false">
 					储充设备
 				</view>
+				<view class="btn" :class="isSlecte?'active':''" @click="isSlecte=true">
+					机器人
+				</view>
 			</view>
 		</view>
 		<view class="main">
-			<view class="main_one" v-if="isSlecte">
+			<view class="main_one" v-show="isSlecte">
 				<automatic :robotInfoVo="robotInfoVo" :robotcode='robotcode'></automatic>
 			</view>
-			<view class="main_two" v-if="!isSlecte">
+			<view class="main_two" v-show="!isSlecte">
 				<manual :storeInfoLists="storeInfoLists"></manual>
 			</view>
 		</view>
@@ -34,7 +34,7 @@
 		},
 		data() {
 			return {
-				isSlecte: true, //切换页面
+				isSlecte: false, //切换页面
 				getStationCode: null, //这个暂时没有
 				ws: null, //websuokit 链接器
 				timer: null, //记录链接的方法   方便清除
@@ -58,7 +58,10 @@
 				}
 			}, 3000)
 		},
-
+		destroyed(){
+			clearInterval(this.timer)
+			this.ws.close()
+		},
 		onUnload() {
 			console.log('onUnload')
 			if(this.timer!=null){
@@ -74,32 +77,12 @@
 				this.heartbeatTimer=null
 			}
 		},
-		computed: {
-			pageState() {
-				if (this.swapState === -1) {
-					return 0
-				} else if (this.swapState === 1) {
-					return 1 //可以发起换电操作
-				} else {
-					return 2 //换电中,不能发起换电
-				}
-			}
-		},
-		watch: {
-			pageState(val) {
-				if (val === 0) {
-					uni.showLoading({
-						title: ''
-					});
-				} else {
-					uni.hideLoading();
-				}
-			}
-		},
 		methods: {
-
 			//判断websocket是否链接上
 			InitWs() {
+				uni.showLoading({
+					title:'数据加载中...'
+				})
 				let token = this.$storage.getJson("token");
 				let users = this.$storage.getJson("users");
 				// if (users == null || token == null) {
@@ -137,12 +120,8 @@
 				})
 				this.ws.onMessage((res) => {
 					this.onMessageTime = new Date();
-					let data = JSON.parse(res.data)
-					// console.log(data,'resws')
-					if (res) {
-						uni.hideLoading()
-					}
-					console.log(data)
+					let data = JSON.parse(res.data)					
+					// console.log(data)
 					//请求成功 开始赋值
 					if (data.robotInfoVo) {
 						this.robotInfoVo = data.robotInfoVo;

+ 6 - 1
pages/fault-alarm/components/Fault.vue

@@ -187,6 +187,9 @@
 			},
 			//告警记录列表,
 			alarmList() {
+				uni.showLoading({
+					title:'数据加载中...'
+				})
 				this.$http.alarmList(this.queryParams).then(res => {
 					// console.log(res.data.records)
 					this.showLoadMore = false
@@ -204,8 +207,9 @@
 						})
 						this.datalist.push(...res.data.records)
 						this.total = res.data.total
+						uni.hideLoading()
 					}
-				});
+				}).catch(err => {uni.hideLoading()});
 			},
 			//充电机下拉选择事件
 			changeId(e) {
@@ -214,6 +218,7 @@
 			//重置
 			resetForm() {
 				this.dateArr = []
+				this.datalist=[]
 				this.queryParams = {
 					page: 1,
 					pageSize: 10,

+ 82 - 54
pages/fault-alarm/components/FireAlarm.vue

@@ -12,7 +12,8 @@
 					<uni-datetime-picker v-model="dateArr" type="daterange" rangeSeparator="至" />
 				</uni-forms-item> -->
 				<uni-forms-item label="告警类型:" name="type" label-width="80px" label-align="right" class="select_box">
-					<uni-data-select v-model="queryParams.type" :localdata="range" style="width: 104px;"></uni-data-select>
+					<uni-data-select v-model="queryParams.type" :localdata="range"
+						style="width: 104px;"></uni-data-select>
 				</uni-forms-item>
 
 			</uni-forms>
@@ -27,8 +28,8 @@
 		</view>
 		<view class="main_table">
 			<!-- <FaultTable :loading="loading" :datalist="datalist"></FaultTable> -->
-			<lyy-table @faultDrawer="faultDrawer" :headerFixed="true" :showLoadMore="showLoadMore" :loadMore="loadMore" :battery="0"
-				:columnFixed=1 :contents="datalist" :headers="headers" @onPullup="pullup">
+			<lyy-table @faultDrawer="faultDrawer" :headerFixed="true" :showLoadMore="showLoadMore" :loadMore="loadMore"
+				:battery="0" :columnFixed=1 :contents="datalist" :headers="headers" @onPullup="pullup">
 			</lyy-table>
 		</view>
 		<!-- 顶部公共提示信息 -->
@@ -75,17 +76,23 @@
 		props: ['isSlecte', 'title'],
 		name: 'Fault',
 		mounted() {
-			this.alarmList()
+			uni.showLoading({
+				title:'数据加载中...'
+			})
+			this.curAlarmlist=setInterval(()=>{
+				this.alarmList()
+			},1000)
 		},
 		destroyed() {
-			this.$storage.remove('gotoname');//清除本地存储
+			this.$storage.remove('gotoname'); //清除本地存储
+			clearInterval(this.curAlarmlist)
 		},
 		data() {
 			return {
 				popupMessage: '成功消息',
 				popupType: 'success',
 				alarmFrom: {
-					
+
 				},
 				range: [{
 						value: 1,
@@ -98,7 +105,7 @@
 					{
 						value: 3,
 						text: "机器人告警"
-					},{
+					}, {
 						value: 4,
 						text: "消防告警"
 					},
@@ -111,40 +118,42 @@
 					equipment: undefined, //告警设备
 					beginTime: undefined,
 					endTime: undefined,
-					info:undefined,
+					info: undefined,
+					type: undefined, //告警类型
 					orderByWays: 'desc' //排序方式
 				},
 				total: 0, //总条数,
 				loading: false,
 				headers: [{
-					label: '告警设备',
-					key: 'equipment',
-					widtd: 150
-				},{
-					label: '告警类型',
-					key: 'type',
-					widtd: 200,
-				},{
-					label: '告警标识',
-					key: 'code',
-					widtd: 150,
-				},{
-					label: '告警信息',
-					key: 'info',
-					widtd: 330
-				},   {
-					label: '操作',
-					key: 'id',
-					widtd: 120,
-				},
-				// {
-				// 	label: '告警开始时间',
-				// 	key: 'beginTime',
-				// 	widtd: 196,
-				// },
+						label: '告警设备',
+						key: 'equipment',
+						widtd: 150
+					}, {
+						label: '告警类型',
+						key: 'type',
+						widtd: 200,
+					}, {
+						label: '告警标识',
+						key: 'code',
+						widtd: 150,
+					}, {
+						label: '告警信息',
+						key: 'info',
+						widtd: 330
+					}, {
+						label: '操作',
+						key: 'id',
+						widtd: 120,
+					},
+					// {
+					// 	label: '告警开始时间',
+					// 	key: 'beginTime',
+					// 	widtd: 196,
+					// },
 				],
 				showLoadMore: false,
 				loadMore: 'more',
+				curAlarmlist:null,
 			}
 		},
 		methods: {
@@ -156,7 +165,7 @@
 			},
 			//告警处理抽屉
 			faultDrawer(row) {
-				console.log(row,'row')
+				console.log(row, 'row')
 				this.alarmFrom = row
 				this.$refs.AlarmDrawer.open();
 			},
@@ -195,30 +204,41 @@
 			},
 			//消防告警记录列表,
 			alarmList() { //getwarnList
+				
+				if(this.queryParams.type){
+					this.queryParams.type=this.queryParams.type*1
+				}
 				this.$http.getwarnList(this.queryParams).then(res => {
 					// console.log(res.data.records)
 					this.showLoadMore = false
 					if (res.code === 0) {
-						res.data.list.forEach(item=>{
-							if(item.type == 1){
+						res.data.list.forEach(item => {
+							if (item.type == 1) {
 								item.type = '充电机告警'
-							}else if(item.type == 2){
+							} else if (item.type == 2) {
 								item.type = 'BMS告警'
-							}else if(item.type == 3){
+							} else if (item.type == 3) {
 								item.type = '机器人告警'
-							}else if(item.type == 4){
+							} else if (item.type == 4) {
 								item.type = '消防告警'
 							}
+							if(item.equipment.includes('电池') || item.equipment.includes('充电机') || item.equipment.includes('架载机')){
+							  item.alarmValue=999
+							}
 						})
-						this.datalist.push(...res.data.list)
+						if(res.data.list.length>this.datalist.length){
+							this.datalist.push(...res.data.list)
+						}
 						this.total = res.data.total
+						uni.hideLoading()
 					}
-				});
+				}).catch(err => {uni.hideLoading()});
 			},
-		
+
 			//重置
 			resetForm() {
 				this.dateArr = []
+				this.datalist = []
 				this.queryParams = {
 					page: 1,
 					pageSize: 10,
@@ -227,16 +247,16 @@
 					beginTime: undefined,
 					endTime: undefined,
 					type: undefined,
-					orderByWays:"desc"
+					orderByWays: "desc"
 				}
 				this.alarmList()
 			},
 			//查询
 			handleQuery() {
 				if (this.dateArr.length > 0) {
-					this.queryParams.beginTime = this.dateArr[0] +' ' +'00:00:00'
-					this.queryParams.endTime = this.dateArr[1]+' ' +'23:59:59'
-				}else{
+					this.queryParams.beginTime = this.dateArr[0] + ' ' + '00:00:00'
+					this.queryParams.endTime = this.dateArr[1] + ' ' + '23:59:59'
+				} else {
 					this.queryParams.beginTime = undefined
 					this.queryParams.endTime = undefined
 				}
@@ -251,23 +271,28 @@
 
 <style lang="scss" scoped>
 	.drawer_main {
+
 		// padding-top: 20px;
-		.drawer_main_title{
+		.drawer_main_title {
 			font-size: 16px;
 		}
-		.drawer_main_tip{
+
+		.drawer_main_tip {
 			font-size: 14px;
 			margin-top: 10px;
-			text{
+
+			text {
 				font-size: 16px;
 			}
 		}
-		.btn_box{
+
+		.btn_box {
 			display: flex;
 			font-size: 14px;
 			margin-top: 20px;
 			justify-content: flex-end;
-			.btn_box_ok{
+
+			.btn_box_ok {
 				width: 100px;
 				height: 32px;
 				background: #91FDB9;
@@ -276,9 +301,10 @@
 				line-height: 32px;
 				color: black;
 				margin-right: 20px;
-				
+
 			}
-			.btn_box_off{
+
+			.btn_box_off {
 				width: 60px;
 				height: 32px;
 				border-radius: 2px 2px 2px 2px;
@@ -289,10 +315,12 @@
 			}
 		}
 	}
-	::v-deep .uni-popup-message__box{
+
+	::v-deep .uni-popup-message__box {
 		height: 20px;
 		line-height: 11px;
 	}
+
 	.main_table {
 		width: 1040px;
 		height: 580px;

+ 10 - 1
pages/index/index.vue

@@ -58,6 +58,7 @@
 		<view class="equipment">
 			<SubTitle title="设备状态" titleEng="DEVICE STATUS"></SubTitle>
 			<view class="statusShow">
+				<template v-if="stateList.length>0">
 				<view class="positon p-left"></view>
 				<view class="positon p-right"></view>
 				<view class="positon p-b-left"></view>
@@ -88,6 +89,7 @@
 					<view></view>
 					<BatteryState v-for="item in stateList" :key="item.code" :batteryState="item.batteryState"></BatteryState>
 				</view>
+				</template>
 			</view>
 			<view class="status-description">
 				<view class="positon p-left"></view>
@@ -173,6 +175,10 @@
 			},3000)
 			this.getDataView()
 		},
+		destroyed(){
+			clearInterval(this.timer)
+			this.ws.close()
+		},
 		computed: {
 			robotResult() {
 				switch (this.robotState) {
@@ -199,6 +205,9 @@
 				})
 			},
 			InitWs() {
+				uni.showLoading({
+					title:'数据加载中...'
+				})
 				if (this.ws != null) {
 					this.ws.close()
 					this.ws = null
@@ -249,7 +258,7 @@
 					// console.log(d)
 					this.stateList = d.stateList
 					this.robotState = d.robotState
-					// uni.hideLoading()
+					uni.hideLoading()
 				})
 				// 监听WebSocket关闭事件
 				this.ws.onClose(() => {

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

@@ -119,16 +119,16 @@
 						<view class="letter">POWER EXCHANGE OPERATION</view>
 						<view class="switch">
 							<view class="uni-list-cell-db">{{powerChangeStatus?'开启中':'已关闭'}}</view>
-							<switch color="#91FDB9" style="transform:scale(0.6)" @change="switchChange" checked />
+							<switch color="#91FDB9" style="transform:scale(0.6)" @change="switchChange" :checked="powerChangeStatus" />
 						</view>
 					</view>
 				</view>
 				<view class="Exchange-bottom">
 					<view class="Exchange-times">
 						<view class="Progress-btn" :class='!powerChangeStatus?"isshowactive":""' @click="BeginChangePower">开始换电</view>
-						<view class="Exchange-status" v-if="showStore == 0">
+						<view class="Exchange-status" v-if="!TcInfoVoData.sourceCode && !TcInfoVoData.targetCode && !xfTargetCodeData.xfTargetCode">
 							<view class="lock">
-								<span>{{ swapProcess.forbidLockState ? '锁止已屏蔽' : ''}}</span>
+								<span>{{ forbidLockState ? '锁止已屏蔽' : '锁止已放开'}}</span>
 								<span class="time">换电时长:<font>{{PlcChangerTime || '—'}}</font></span>
 							</view>
 							<view class="percent">
@@ -150,7 +150,7 @@
 								<span class="time">机器人工作时长:<font>{{PlcWorkTime || '—'}}</font></span>
 							</view>
 						</view>
-						<view class="Exchange-status" v-if="showStore == 1">
+						<view class="Exchange-status" v-if="TcInfoVoData.sourceCode && TcInfoVoData.targetCode">
 							<view class="Exchange-status-left">
 								<view class="Exchange-status-left-box">
 									<text class="text1">仓位</text><text
@@ -171,8 +171,7 @@
 								</view>
 							</view>
 						</view>
-
-						<view class="Exchange-status" v-if="showStore == 2">
+						<view class="Exchange-status" v-if="xfTargetCodeData.xfTargetCode">
 							<view class="Exchange-status-left">
 								<view class="Exchange-status-left-box change-store">
 									<text class="text1">仓位</text><text
@@ -305,13 +304,15 @@
 				timer: null, //ws连接
 				isDrawer: true, //切换抽屉显示内容
 				plate: '—', //弹窗车牌号
-				powerChangeStatus: true,
+				powerChangeStatus: false,
 				isSelectstoreState: [], //选择的仓位存储电池状态
-				showStore: 0, //0换电展示 1调仓展示  2换仓展示
 				TcInfoVoData: {}, //调仓信息对象
 				xfTargetCodeData: {}, //消防换仓对象
 				heartbeatTimer:null,
-				onMessageTime:null,
+				onMessageTime:null,
+				TcNumber:0,//调仓计数器 大于5时显示换电页面
+				XfNumber:0,//消防调仓计数器 大于5时显示换电页面
+				forbidLockState:true,//锁止状态
 			}
 		},
 		mounted() {
@@ -326,6 +327,10 @@
 					}
 				}
 			},3000)
+		},
+		destroyed(){
+			clearInterval(this.timer)
+			this.ws.close()
 		},
 		onUnload() {
 			console.log('onUnload')
@@ -605,9 +610,9 @@
 								that.$http.plcStop(isStop + '')
 									.then(res => {
 										if (res.code === 0) {
-											that.ExchangeMessage('success', isStop == 1 ? '急停成功' : '中止成功')
+											that.ExchangeMessage('success', isStop == 1 ? '急停指令下发成功' : '中止指令下发成功')
 										} else {
-											that.ExchangeMessage('error', isStop == 1 ? '急停失败' : '中止失败')
+											that.ExchangeMessage('error', isStop == 1 ? '急停指令下发失败' : '中止指令下发失败')
 										}
 									}).catch(err => {
 										console.error(err)
@@ -676,7 +681,7 @@
 												that.clearStore()
 											}
 											that.ExchangeMessage(res.code === 0 ? 'success' : 'error', res
-												.code === 0 ? '发起调仓成功!' : '发起调仓失败!')
+												.code === 0 ? '调仓指令下发成功!' : '调仓指令下发失败!')
 										}).catch(err => {
 											console.error(err)
 										})
@@ -715,7 +720,7 @@
 												that.clearStore()
 											}
 											that.ExchangeMessage(res.code === 0 ? 'success' : 'error',
-												res.code === 0 ? '发起消防换仓成功!' : '发起消防换仓失败!')
+												res.code === 0 ? '消防换仓指令下发成功!' : '消防换仓指令下发失败!')
 										}).catch(err => {
 											console.error(err)
 										})
@@ -740,7 +745,10 @@
 				this.BatteryIsSelectArr = [false, false, false, false, false, false, false, false]
 			},
 			//websocket连接函数
-			InitWs() {
+			InitWs() {
+				uni.showLoading({
+					title:'数据加载中...'
+				})
 				if (this.ws != null) {
 					this.ws.close()
 					this.ws = null
@@ -775,13 +783,13 @@
 				})
 				this.ws.onMessage((res) => {
 					this.onMessageTime = new Date();
-					
 					let d = JSON.parse(res.data)
-					console.log(d)
+					// console.log(d)
 					// uni.hideLoading()
 					//电池仓位列表
 					if (d.storeInfoList) {
-						this.storeInfoList = d.storeInfoList
+						this.storeInfoList = d.storeInfoList
+						uni.hideLoading()
 					}
 					//日志列表
 					if (d.logList) {
@@ -801,11 +809,20 @@
 					}
 					//换电进度
 					if (d.swapProcess) {
-						this.swapProcess = d.swapProcess
+						this.swapProcess = d.swapProcess
+						//清空调仓数据
+						if(d.swapProcess.swapId){
+						  this.xfTargetCodeData={}//消防调仓
+						  this.TcInfoVoData={}//调仓
+						}
 					}
 					//选电模式
 					if (d.batChooseMode >= 0) {
-						this.pamars.batChooseMode = d.batChooseMode
+						this.pamars.batChooseMode = d.batChooseMode
+						//锁止状态
+					}
+					if(d.hasOwnProperty('forbidLockState')){
+						this.forbidLockState=d.forbidLockState
 					}
 					//调仓
 					if (d.sourceCode && d.targetCode) {
@@ -816,9 +833,14 @@
 							startTime: d.startTime,
 							chargerState: d.chargerState,
 						}
-						this.showStore = 1;
-					} else {
-						this.showStore = 0
+						this.xfTargetCodeData={}
+						this.TcNumber=0
+					}else{
+						if(this.TcNumber<=5){
+						  this.TcNumber=this.TcNumber+1
+						}else{
+						  this.TcInfoVoData={}//调仓
+						}
 					}
 					//消防换仓
 					if (d.xfTargetCode) {
@@ -827,10 +849,15 @@
 							chargerState: d.chargerState,
 							startTime: d.startTime,
 							actionFlow: d.actionFlow,
-						}
-						this.showStore = 2;
-					} else {
-						this.showStore = 0
+						}
+						this.TcInfoVoData={}
+						this.XfNumber=0
+					}else{
+						if(this.XfNumber<=5){
+						  this.XfNumber=this.XfNumber+1
+						}else{
+						  this.xfTargetCodeData={}//调仓
+						}
 					}
 				})
 				// 监听WebSocket关闭事件

+ 7 - 0
pages/service-recode/components/change.vue

@@ -188,6 +188,9 @@
 			},
 			//请求数据列表
 			getswapList(){
+				uni.showLoading({
+					title:'数据加载中...'
+				})
 				this.$http.swapList(this.changeData)
 					.then(res => {
 						if(res.code == 0){
@@ -205,9 +208,13 @@
 							})
 							this.changelist.push(...res.data.records)
 							this.total = res.data.total;
+							setTimeout(()=>{
+								uni.hideLoading()
+							},1000)
 						}
 					}).catch(err => {
 						console.error(err)
+						uni.hideLoading()
 					})
 			},
 			//重置

+ 7 - 0
pages/service-recode/components/recharge.vue

@@ -197,16 +197,23 @@
 			},
 			//请求数据列表
 			getchargeList() {
+				uni.showLoading({
+					title:'数据加载中...'
+				})
 				this.$http.chargeList(this.rechargeData)
 					.then(res => {
 						if (res.code == 0) {
 							this.showLoadMore = false
 							this.contents.push(...res.data.records);
 							this.total = res.data.total
+							setTimeout(()=>{
+								uni.hideLoading()
+							},1000)
 						}
 
 					}).catch(err => {
 						console.error(err)
+						uni.hideLoading()
 					})
 			},
 			//请求充电机下拉框数据

BIN
static/change/s5.png


+ 2 - 2
uni_modules/uni-table/components/uni-table/uni-table.vue

@@ -4,7 +4,7 @@
 		<table class="uni-table" border="0" cellpadding="0" cellspacing="0" :class="{ 'table--stripe': stripe }" :style="{ 'min-width': minWidth + 'px' }">
 			<slot></slot>
 			<tr v-if="noData" class="uni-table-loading">
-				<td class="uni-table-text" :class="{ 'empty-border': border }">{{ emptyText }}</td>
+				<td class="uni-table-text" :class="{ 'empty-border': border }"></td>
 			</tr>
 			<view v-if="loading" class="uni-table-mask" :class="{ 'empty-border': border }"><div class="uni-table--loader"></div></view>
 		</table>
@@ -13,7 +13,7 @@
 		<view class="uni-table" :style="{ 'min-width': minWidth + 'px' }" :class="{ 'table--stripe': stripe }">
 			<slot></slot>
 			<view v-if="noData" class="uni-table-loading">
-				<view class="uni-table-text" :class="{ 'empty-border': border }">{{ emptyText }}</view>
+				<view class="uni-table-text" :class="{ 'empty-border': border }"></view>
 			</view>
 			<view v-if="loading" class="uni-table-mask" :class="{ 'empty-border': border }"><div class="uni-table--loader"></div></view>
 		</view>

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/__uniappopenlocation.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/view.css


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/view.umd.min.js


Some files were not shown because too many files changed in this diff