wy před 1 rokem
rodič
revize
84f35cf9cc

+ 9 - 1
common/http.js

@@ -146,11 +146,19 @@ export function getStationCode() {
 export function getcloudConnState() {
 	return request.post("/swap/cloudConnState")
 }
-//插枪充电
+//切换仓内仓外
 export function gettoggleChargeWay(data) {
 	return request.post("/discharge/toggleChargeWay",data)
 }
 //限功率
 export function getlimitPower(data) {
 	return request.post("/discharge/limitPower",data)
+}
+//插枪充电
+export function getgunStartCharge(data) {
+	return request.post("/discharge/gunStartCharge",data)
+}
+//停止插枪充电
+export function getgunStopCharge(data) {
+	return request.post("/discharge/gunStopCharge",data)
 }

+ 2 - 2
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.222:8080/api",
+	uni_app_web_api_url: "http://192.168.3.4:8080/api",
 	// web_socket_url:'ws://zk.li-ai.com.cn:8080/ws/',
-	web_socket_url:'ws://192.168.3.222:8080/ws/',
+	web_socket_url:'ws://192.168.3.4:8080/ws/',
 	debug: true
 }

+ 11 - 62
pages/equipment-monitoring/components/BatteryCharger.vue

@@ -27,7 +27,7 @@
 	// } from '@/common/http.js'
 	export default {
 		name: "BatteryCharger",
-		props: ['chargerCode', 'comState', 'chgState', "sn", "storeState"],
+		props: ['chargerCode', 'comState'],
 		data() {
 			return {
 				loading: false,
@@ -43,15 +43,15 @@
 					return ['通讯异常', 'warning']
 				}
 			},
-			buttonState() {
-				if ((this.chgState === 0 || this.chgState === 3)&& this.storeState === 1) {
-					return ['btnState', '充电']
-				} else if (this.chgState === 2&& this.storeState === 1) {
-					return ['purple', '断电']
-				} else {
-					return 1
-				}
-			}
+			// buttonState() {
+			// 	if ((this.chgState === 0 || this.chgState === 3)&& this.storeState === 1) {
+			// 		return ['btnState', '充电']
+			// 	} else if (this.chgState === 2&& this.storeState === 1) {
+			// 		return ['purple', '断电']
+			// 	} else {
+			// 		return 1
+			// 	}
+			// }
 		},
 		methods: {
 			//顶部公共消息提示
@@ -60,58 +60,7 @@
 				this.popupMessage = message?message:'后端接口404错误!'
 				this.$refs.Exchangepopup.open()
 			},
-			//充电、断电操作
-			sendCharger() {
-				console.log(this.chargerId)
-				if (this.buttonState == 1) {
-					return
-				}
-				let params = {}
-				if (this.chgState === 0 || this.chgState === 3) {
-					params = {
-						chargerId: this.chargerCode * 1,
-						sn: this.sn
-					}
-				} else if (this.chgState === 2) {
-					params = {
-						chargerId: this.chargerCode * 1
-					}
-				}
-				this.loading = true
-				let that = this
-				uni.showModal({
-					title: `确认发起${this.buttonState[1]}`,
-					content: '',
-					success: function(res) {
-						if (res.confirm) { //点击确定
-							//充电操作
-							if (that.chgState === 0 || that.chgState === 3) {
-								that.ExchangeMessage('success','充电指令已下发')
-								that.$http.startCharge(params)
-									.then(res => {
-										that.ExchangeMessage(res.code === 0 ? 'success' : 'error', res.code === 0?'充电成功':'充电失败')
-									}).catch(err => {
-										console.error(err)
-									})
-							}
-							//断电操作
-							else if (that.chgState === 2) {
-								that.ExchangeMessage('success','断电指令已下发')
-								that.$http.stopCharge(params)
-									.then(res => {
-										that.ExchangeMessage(res.code === 0 ? 'success' : 'error', res.code === 0?'断电成功':'断电失败')
-									}).catch(err => {
-										console.error(err)
-									})
-							}
-						} else if (res.cancel) {
-							return false
-							//用户点击取消按钮触发
-						}
-						that.loading = false
-					}
-				})
-			}
+			
 		}
 	}
 </script>

+ 3 - 16
pages/equipment-monitoring/components/BatteryStatus.vue

@@ -2,7 +2,7 @@
     <view>
         <!-- <view class="communication">
             <view><image class="cangwei" src="../../../static/equipment/cangwei.png" /><text class="storeCode_num">{{storeCode}}号仓位</text></view>
-            <view :class="statustext[1]">{{statustext[0]}}</view>
+            
         </view> -->
         <view class="battery-number">
             <text>电池编号</text><text>{{sn ||'-'}}</text>
@@ -29,13 +29,7 @@ export default {
     name: "BatteryStatus",
     props:['storeCode','comState','sn','chgEstimatedTime','soc','showCode'],
     computed:{
-        statustext(){
-            if(this.comState===1){
-                return ['通讯正常','success']
-            }else{
-                return ['通讯异常','warning']
-            }
-        },
+     
         setcolor(){
             if(this.soc<=30 && this.soc > 0){
                 return '#ce4545'
@@ -80,14 +74,7 @@ export default {
         // }
     }
 
-    .success {
-        color: #92fdb9;
-        text-align: right;
-    }
-    .warning {
-        color: #ff4d4f;
-        text-align: right;
-    }
+   
 }
 
 .battery-number {

+ 318 - 24
pages/equipment-monitoring/components/StorageInfo.vue

@@ -2,39 +2,95 @@
 	<view class="storage-item">
 		<view class="container">
 			<view class="container-header">
-				<view class="battery" :class="showCode ==0?'showCodeActive':''" @click="showCode = 0">
+				<view class="battery" :class="showCode ==0?'showCodeActive':''" @click="actshowCode(0)">
 					{{StateNum}}
 				</view>
-				<view class="a-gun battery" :class="showCode ==1?'showCodeActive':''" @click="showCode = 1">
+				<view class="a-gun battery" :class="showCode ==1?'showCodeActive':''" @click="actshowCode(1)">
 					A枪
 				</view>
-				<view class="b-gun battery" :class="showCode ==2?'showCodeActive':''" @click="showCode = 2">
+				<view class="b-gun battery" :class="showCode ==2?'showCodeActive':''" @click="actshowCode(2)">
 					B枪
 				</view>
 			</view>
 			<view class="container-code">
-				<view class="container-code-one">
-					通讯正常
+				<view class="container-code-one" :class="statustext[1]" v-if="showCode== 0">
+					{{statustext[0]}}
 				</view>
-				<view class="container-code-two">
-					<image src="../../../static/equipment/d5.png" mode=""></image>
-					<image src="../../../static/equipment/c1.png" mode=""></image>
+				<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"></BatteryStatus>
+				: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 != 0">
-					<text>vin码</text><text>123456789</text>
+				<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="电流"></BatteryInfo>
-				<BatteryInfo :num="voltage" unit="V" text="电压"></BatteryInfo>
+				<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">
+				<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>
@@ -46,15 +102,31 @@
 			</view>
 			<view class="battery-charger">
 				<BatteryCharger :chargerCode="chargerInfoVo.chargerCode" :comState="chargerInfoVo.comState"
-					:chgState="chargerInfoVo.chgState" :sn="sn" :storeState="storeState"
-					v-show="chargerInfoVo.chargerCode"></BatteryCharger>
-				<view class="battery-info" v-show="chargerInfoVo.chargerCode">
+					v-if="chargerInfoVo.chargerCode &&showCode ==0"></BatteryCharger>
+				<BatteryCharger :chargerCode="chargerInfoOneVo.chargerCode" :comState="chargerInfoOneVo.comState"
+					v-if="chargerInfoOneVo.chargerCode &&showCode ==1"></BatteryCharger>
+				<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>
-
+				</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>
+				</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>
 				</view>
 				<view class="battery-charger-btn">
 					<view class="Plug-gun-charging" @click="ChargingMode(chgType)">
@@ -91,7 +163,12 @@
 			'soh',
 			'storeState',
 			'chargerInfoVo',
-			'chgType'
+			'chgType',
+			'batInfoOneVo',
+			'batInfoTwoVo',
+			'chargerInfoOneVo',
+			'chargerInfoTwoVo',
+			'showCodeNum'
 		],
 		components: {
 			BatteryInfo,
@@ -101,14 +178,33 @@
 		data() {
 			return {
 				showCode: 0, //0电池1A枪2B枪
+				Markers: 0, //标记 0代表没点击过 1代表点击过
+			}
+		},
+		mounted() {
+			this.showCode = this.showCodeNum; //根据后端返的数据动态渲染当前状态
+		},
+		watch: {
+			showCodeNum(newshowCodeNum, oldshowCodeNum) {
+				if (this.Markers == 0) {
+					this.showCode = newshowCodeNum //没点击过  根据后端数据实时渲染不同的数据
+				}
 			}
 		},
+
 		methods: {
+			//页面切换
+			actshowCode(code) {
+				this.showCode = code;
+				this.Markers = 1
+			},
+			//打开弹窗
 			set() {
 				this.$emit('drawer')
 			},
+			//切换仓内仓外
 			ChargingMode(chgType) {
-
+				//停止充电后才能切换
 				let data = {
 					"chargerId": this.chargerInfoVo.chargerCode,
 					"chargerWay": chgType == 1 ? '0' : '1',
@@ -116,14 +212,144 @@
 					"powerControl": 0,
 					"powerToggle": 0
 				}
-				this.$http.gettoggleChargeWay(data).then(res => {
-						console.log(res,'res666')
-				})
+				if (chgType == 0 && this.chargerInfoVo.chgState == 2) { //仓内充电 充电时不允许切换
+					return
+				} else if (chgType == 1 && this.chargerInfoOneVo.chgState == 2 || this.chargerInfoTwoVo.chgState == 2) {
+					return
+				} else {
+					this.$http.gettoggleChargeWay(data).then(res => {
+						this.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
+							res.code === 0 ? '切换成功!' : '切换失败!')
+					})
+
+				}
 
 
+			},
+			//仓内充电、断电操作
+			sendCharger(name) {
+				let params = {}
+				if (this.chargerInfoVo.chgState === 0 || this.chargerInfoVo.chgState === 3) {
+					params = {
+						chargerId: this.chargerInfoVo.chargerCode * 1,
+						sn: this.sn
+					}
+				} else if (this.chargerInfoVo.chgState === 2) {
+					params = {
+						chargerId: this.chargerInfoVo.chargerCode * 1
+					}
+				}
+				let that = this
+				uni.showModal({
+					title: `确认发起${name}`,
+					content: '',
+					success: function(res) {
+						if (res.confirm) { //点击确定
+							//充电操作
+							if (that.chargerInfoVo.chgState === 0 || that.chargerInfoVo.chgState === 3) {
+								that.$emit('ExchangeMessage', 'success', '充电指令已下发')
+								that.$http.startCharge(params)
+									.then(res => {
+										that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
+											res.code === 0 ? '充电成功' : '充电失败')
+									}).catch(err => {
+										console.error(err)
+									})
+							}
+							//断电操作
+							else if (that.chargerInfoVo.chgState === 2) {
+								that.$emit('ExchangeMessage', 'success', '断电指令已下发')
+								that.$http.stopCharge(params)
+									.then(res => {
+										that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
+											res.code === 0 ? '断电成功' : '断电失败')
+									}).catch(err => {
+										console.error(err)
+									})
+							}
+						} else if (res.cancel) {
+							return false
+							//用户点击取消按钮触发
+						}
+					}
+				})
+			},
+			//仓外充电·断电操作
+			sendChargerOut(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,
+					}
+				}
+				let that = this
+				uni.showModal({
+					title: `确认发起${name}`,
+					content: '',
+					success: function(res) {
+						if (res.confirm) { //点击确定
+							//断电操作
+						if (that.chargerInfoOneVo.chgState === 2 || that.chargerInfoTwoVo.chgState === 2) {
+								that.$emit('ExchangeMessage', 'success', '断电指令已下发')
+								that.$http.getgunStopCharge(params)
+									.then(res => {
+										that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
+											res.code === 0 ? '断电成功' : '断电失败')
+									}).catch(err => {
+										console.error(err)
+									})
+						}else if(that.chargerInfoOneVo.chgState === 0 || that.chargerInfoOneVo.chgState === 3 ||
+								 that.chargerInfoTwoVo.chgState === 0 || that.chargerInfoTwoVo.chgState === 3){
+							//充电操作
+								that.$emit('ExchangeMessage', 'success', '充电指令已下发')
+								that.$http.getgunStartCharge(params)
+										.then(res => {
+											that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
+												res.code === 0 ? '充电成功' : '充电失败')
+										}).catch(err => {
+											console.error(err)
+										})
+							}
+							
+						} else if (res.cancel) {
+							return false
+							//用户点击取消按钮触发
+						}
+					}
+				})
 			}
 		},
 		computed: {
+			statustext() {
+				if (this.comState === 1) {
+					return ['通讯正常', 'success']
+				} else {
+					return ['通讯异常', 'warning']
+				}
+			},
+			statustextA() {
+				if (this.chargerInfoOneVo.comState === 1) {
+					return ['已连接', 'success']
+				} else {
+					return ['未连接', 'warning']
+				}
+			},
+			statustextB() {
+				if (this.chargerInfoTwoVo.comState === 1) {
+					return ['已连接', 'success']
+				} else {
+					return ['未连接', 'warning']
+				}
+			},
 			chargerState() {
 				if (this.chargerInfoVo.chgState === 1) {
 					return [3, ' 准备充电']
@@ -143,6 +369,44 @@
 					return [4, ' 无法获取']
 				}
 			},
+			chargerStateA() {
+				if (this.chargerInfoOneVo.chgState === 1) {
+					return [3, ' 准备充电']
+				} else if (this.chargerInfoOneVo.chgState === 2) {
+					return [1, ' 充电中']
+				} else if (this.chargerInfoOneVo.chgState === 3) {
+					return [2, ' 充电完成']
+				} else if (this.chargerInfoOneVo.chgState === 4) {
+					return [8, ' 充电失败']
+				} else if (this.chargerInfoOneVo.chgState === 5) {
+					return [6, ' 预约']
+				} else if (this.chargerInfoOneVo.chgState === 6) {
+					return [5, ' 故障']
+				} else if (this.chargerInfoOneVo.chgState === 0) {
+					return [7, ' 空闲']
+				} else {
+					return [4, ' 无法获取']
+				}
+			},
+			chargerStateB() {
+				if (this.chargerInfoTwoVo.chgState === 1) {
+					return [3, ' 准备充电']
+				} else if (this.chargerInfoTwoVo.chgState === 2) {
+					return [1, ' 充电中']
+				} else if (this.chargerInfoTwoVo.chgState === 3) {
+					return [2, ' 充电完成']
+				} else if (this.chargerInfoTwoVo.chgState === 4) {
+					return [8, ' 充电失败']
+				} else if (this.chargerInfoTwoVo.chgState === 5) {
+					return [6, ' 预约']
+				} else if (this.chargerInfoTwoVo.chgState === 6) {
+					return [5, ' 故障']
+				} else if (this.chargerInfoTwoVo.chgState === 0) {
+					return [7, ' 空闲']
+				} else {
+					return [4, ' 无法获取']
+				}
+			},
 			chargerColor() {
 				if (this.chargerInfoVo.chgState === 3) {
 					return 'background-color:rgb(19,33,39,0.9);border:#477c62 solid 1px'
@@ -154,6 +418,28 @@
 					return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
 				}
 			},
+			chargerColorA() {
+				if (this.chargerInfoOneVo.chgState === 3) {
+					return 'background-color:rgb(19,33,39,0.9);border:#477c62 solid 1px'
+				} else if (this.chargerInfoOneVo.chgState === 1 || this.chargerInfoOneVo.chgState === 5) {
+					return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
+				} else if (this.chargerInfoOneVo.chgState === 2 || this.chargerInfoOneVo.chgState === 0) {
+					return ''
+				} else {
+					return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
+				}
+			},
+			chargerColorB() {
+				if (this.chargerInfoTwoVo.chgState === 3) {
+					return 'background-color:rgb(19,33,39,0.9);border:#477c62 solid 1px'
+				} else if (this.chargerInfoTwoVo.chgState === 1 || this.chargerInfoTwoVo.chgState === 5) {
+					return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
+				} else if (this.chargerInfoTwoVo.chgState === 2 || this.chargerInfoTwoVo.chgState === 0) {
+					return ''
+				} else {
+					return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
+				}
+			},
 			StateNum() {
 				if (this.storeState === 0) {
 					return '电池(无)'
@@ -217,6 +503,14 @@
 					color: #91FDB9;
 				}
 
+				.success {
+					color: #92fdb9;
+				}
+
+				.warning {
+					color: #ff4d4f;
+				}
+
 				.container-code-two {
 					display: flex;
 

+ 5 - 6
pages/equipment-monitoring/components/batteryDrawe.vue

@@ -24,7 +24,7 @@
 					</uni-data-select>
 				</uni-forms-item>
 				<uni-forms-item label="充电功率:" name="name" label-align="right" label-width="120px">
-					<uni-easyinput type="number" v-model="fromData.powerNum" placeholder="请输入" />
+					<uni-easyinput type="number" v-model="fromData.powerNum" placeholder="请输入" maxlength="4"/>
 					<view class="kwh">
 						KWH
 					</view>
@@ -37,18 +37,16 @@
 
 <script>
 	export default {
-		name: 'batteryDrawe',
 		props: ['infodata'],
 		data() {
 			return {
-				popupMessage: '成功消息',
-				popupType: 'success',
+				
 				fromData: {
 					arr: [{
-						text: 'a枪',
+						text: 'A枪',
 						value: '0'
 					}, {
-						text: 'b枪',
+						text: 'B枪',
 						value: '1'
 					}],
 					arrType: [{
@@ -126,6 +124,7 @@
 		position: absolute;
 		right: 0;
 		top: 0px;
+		text-align: center;
 	}
 
 	::v-deep .uni-select__selector {

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

@@ -15,7 +15,9 @@
 						:max-temperature="item.maxTemperature" :max-cell-voltage="item.maxCellVoltage" index
 						:min-cell-voltage="item.minCellVoltage" :soh="item.soh" :store-state="item.storeState"
 						:charger-info-vo="item.chargerInfoVo" :class="box_num == index ? 'slect_box':''"
-						:chgType='item.chgType' />
+						:chgType='item.chgType' :batInfoOneVo="item.batInfoOneVo" :batInfoTwoVo='item.batInfoTwoVo' 
+						:chargerInfoOneVo="item.chargerInfoOneVo" :chargerInfoTwoVo="item.chargerInfoTwoVo" 
+						:showCodeNum='item.showCodeNum' @ExchangeMessage='ExchangeMessage'/>
 				</view>
 
 			</scroll-view>
@@ -68,9 +70,6 @@
 				infodata: {}, //详情数据
 			}
 		},
-		mounted() {
-			// console.log(this.storeInfoLists,'storeInfoLists999999999999')
-		},
 		methods: {
 			//抽屉
 			drawer(item, index) {

+ 11 - 1
pages/equipment-monitoring/index.vue

@@ -151,8 +151,18 @@
 						// console.log(this.robotcode,'robotInfoVos99999')
 					}
 					if (data.storeInfoList) {
+						data.storeInfoList.forEach(item=>{
+						if(item.chgType == 0){
+							item.showCodeNum = 0 //仓内充电  显示电池
+						}else{
+							if(!item.batInfoOneVo.sn && item.batInfoTwoVo.sn){ //A枪不存在数据B枪有数据
+								item.showCodeNum = 2
+							}else{
+								item.showCodeNum = 1 
+							}
+						}
+						})
 						this.storeInfoLists = data.storeInfoList;
-
 					}
 				})
 				// 监听WebSocket关闭事件

+ 2 - 2
pages/fault-alarm/index.vue

@@ -6,10 +6,10 @@
 			</view> -->
 			<view class="service_header_right">
 				<view class="btn" :class="isSlecte?'active':''" @click="isSlecte=true">
-					故障告警
+					当前告警
 				</view>
 				<view class="btn" :class="!isSlecte?'active':''" @click="isSlecte=false">
-					消防告警
+					告警记录
 				</view>
 			</view>
 		</view>