wy 1 рік тому
батько
коміт
4fa34ff725

+ 8 - 0
common/http.js

@@ -146,3 +146,11 @@ 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)
+}

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

+ 243 - 214
pages/equipment-monitoring/components/StorageInfo.vue

@@ -1,6 +1,6 @@
-<template>
-    <view class="storage-item" >
-        <view class="container">
+<template>
+	<view class="storage-item">
+		<view class="container">
 			<view class="container-header">
 				<view class="battery" :class="showCode ==0?'showCodeActive':''" @click="showCode = 0">
 					电池(有)
@@ -8,9 +8,9 @@
 				<view class="a-gun battery" :class="showCode ==1?'showCodeActive':''" @click="showCode = 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="showCode = 2">
 					B枪
-				</view> 
+				</view>
 			</view>
 			<view class="container-code">
 				<view class="container-code-one">
@@ -20,159 +20,169 @@
 					<image src="../../../static/equipment/d5.png" mode=""></image>
 					<image src="../../../static/equipment/c1.png" mode=""></image>
 				</view>
-				
-			</view>
-            <BatteryStatus
-            :storeCode="storeCode"
-            :comState="comState"
-            :sn="sn"
-            :soc="soc"
-            :chgEstimatedTime="chgEstimatedTime"
-			:showCode="showCode"
-            ></BatteryStatus>
-         <view class="battery-info">
+
+			</view>
+			<BatteryStatus :storeCode="storeCode" :comState="comState" :sn="sn" :soc="soc"
+				:chgEstimatedTime="chgEstimatedTime" :showCode="showCode"></BatteryStatus>
+			<view class="battery-info">
 				<view class="vim" v-if="showCode != 0">
 					<text>vin码</text><text>123456789</text>
-				</view>
-                <BatteryInfo :num="current" unit="A" text="电流"></BatteryInfo>
-                <BatteryInfo :num="voltage" unit="V" text="电压"></BatteryInfo>
+				</view>
+				<BatteryInfo :num="current" unit="A" text="电流"></BatteryInfo>
+				<BatteryInfo :num="voltage" unit="V" text="电压"></BatteryInfo>
 				<BatteryInfo :num="soh" unit="%" text="SOH" v-if="showCode == 0"></BatteryInfo>
 				<view class="info-right" :style="chargerColor">
-				     <image class="s1" :src="require('../../../static/equipment/'+`s${chargerState[0]}`+'.png')"><text>{{chargerState[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>
+					<image class="s1" :src="require('../../../static/equipment/'+`s${chargerState[0]}`+'.png')">
+						<text>{{chargerState[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>
-            <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">
-                    <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>
+			<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">
+					<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-charger-btn">
-					<view class="Plug-gun-charging">
-						插枪充电
+					<view class="Plug-gun-charging" @click="ChargingMode(chgType)">
+						{{chgType == 0 ?'插枪充电':'线束充电'}}
 					</view>
 					<view class="Settings Plug-gun-charging" @click="set">
 						设置
 					</view>
-				</view>
-                <image src="../../../static/equipment/nodata.png" class="nodata" v-show="!chargerInfoVo.chargerCode">
-            </view>
-        </view>
-    </view>
-</template>
-
-<script>
-import BatteryInfo from "./BatteryInfo.vue";
-import BatteryStatus from "./BatteryStatus.vue";
-import BatteryCharger from "./BatteryCharger.vue"
-export default {
-    name:"StorageInfo",
-    props:[
-        'storeCode',
-        'comState',
-        'sn',
-        'soc',
-        'chgEstimatedTime',
-        'current',
-        'voltage',
-        'minTemperature',
-        'maxTemperature',
-        'maxCellVoltage',
-        'minCellVoltage',
-        'soh',
-        'storeState',
-        'chargerInfoVo'
-    ],
-    components: {
-        BatteryInfo,
-        BatteryStatus,
-        BatteryCharger
-    },
-    data(){
-        return{
-			showCode:0,//0电池1A枪2B枪
-        }
-    },
-	methods:{
-		set(){
-			this.$emit('drawer')
+				</view>
+				<image src="../../../static/equipment/nodata.png" class="nodata" v-show="!chargerInfoVo.chargerCode">
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import BatteryInfo from "./BatteryInfo.vue";
+	import BatteryStatus from "./BatteryStatus.vue";
+	import BatteryCharger from "./BatteryCharger.vue"
+	export default {
+		name: "StorageInfo",
+		props: [
+			'storeCode',
+			'comState',
+			'sn',
+			'soc',
+			'chgEstimatedTime',
+			'current',
+			'voltage',
+			'minTemperature',
+			'maxTemperature',
+			'maxCellVoltage',
+			'minCellVoltage',
+			'soh',
+			'storeState',
+			'chargerInfoVo',
+			'chgType'
+		],
+		components: {
+			BatteryInfo,
+			BatteryStatus,
+			BatteryCharger
+		},
+		data() {
+			return {
+				showCode: 0, //0电池1A枪2B枪
+			}
+		},
+		methods: {
+			set() {
+				this.$emit('drawer')
+			},
+			ChargingMode(chgType) {
+
+				let data = {
+					"chargerId": this.chargerInfoVo.chargerCode,
+					"chargerWay": chgType == 1 ? '0' : '1',
+					"controlPriority": 0,
+					"powerControl": 0,
+					"powerToggle": 0
+				}
+				this.$http.gettoggleChargeWay(data).then(res => {
+						console.log(res,'res666')
+				})
+
+
+			}
+		},
+		computed: {
+			chargerState() {
+				if (this.chargerInfoVo.chgState === 1) {
+					return [3, ' 准备充电']
+				} else if (this.chargerInfoVo.chgState === 2) {
+					return [1, ' 充电中']
+				} else if (this.chargerInfoVo.chgState === 3) {
+					return [2, ' 充电完成']
+				} else if (this.chargerInfoVo.chgState === 4) {
+					return [8, ' 充电失败']
+				} else if (this.chargerInfoVo.chgState === 5) {
+					return [6, ' 预约']
+				} else if (this.chargerInfoVo.chgState === 6) {
+					return [5, ' 故障']
+				} else if (this.chargerInfoVo.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'
+				} else if (this.chargerInfoVo.chgState === 1 || this.chargerInfoVo.chgState === 5) {
+					return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
+				} else if (this.chargerInfoVo.chgState === 2 || this.chargerInfoVo.chgState === 0) {
+					return ''
+				} else {
+					return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
+				}
+			},
+			StateNum() {
+				if (this.storeState === 0) {
+					return '空仓'
+				} else if (this.storeState === 1) {
+					return '有电池'
+				} else {
+					return '连接异常'
+				}
+			}
 		}
-	},
-    computed:{
-        chargerState(){
-            if(this.chargerInfoVo.chgState === 1){
-                return [3,' 准备充电']
-            }else if(this.chargerInfoVo.chgState === 2){
-                return [1,' 充电中']
-            }else if(this.chargerInfoVo.chgState === 3){
-                return [2,' 充电完成']
-            }else if(this.chargerInfoVo.chgState === 4){
-                return [8,' 充电失败']
-            }else if(this.chargerInfoVo.chgState === 5){
-                return [6,' 预约']
-            }else if(this.chargerInfoVo.chgState === 6){
-                return [5,' 故障']
-            }else if(this.chargerInfoVo.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'
-            }else if(this.chargerInfoVo.chgState ===1 || this.chargerInfoVo.chgState === 5){
-                return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
-            }else if(this.chargerInfoVo.chgState ===2 || this.chargerInfoVo.chgState === 0){
-                return ''
-            }else{
-                return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
-            }
-        },
-        StateNum(){
-            if(this.storeState === 0){
-                return '空仓'
-            }else if(this.storeState === 1){
-                return '有电池'
-            }else{
-                return '连接异常'
-            }
-        }
-    }
-};
-</script >
-<style lang="scss" scoped>
-    .storage-item{
-        width: 347px;
-        background-color: #0a101c;
-        height: 598px;
-        margin-right: 22px;
-		border: 1px solid #0a101c;
-        .container{
-            padding: 20px 24px;
-            color: #404a63;
-            font-size: 14px;
-            .container-header{
+	};
+</script>
+<style lang="scss" scoped>
+	.storage-item {
+		width: 347px;
+		background-color: #0a101c;
+		height: 598px;
+		margin-right: 22px;
+		border: 1px solid #0a101c;
+
+		.container {
+			padding: 20px 24px;
+			color: #404a63;
+			font-size: 14px;
+
+			.container-header {
 				display: flex;
-				.battery{
+
+				.battery {
 					width: 112px;
 					height: 32px;
 					background: #1C263A;
@@ -181,106 +191,125 @@ export default {
 					text-align: center;
 					margin-bottom: 10px;
 				}
-				.a-gun{
+
+				.a-gun {
 					width: 78px;
 					margin-left: 12px;
 				}
-				.b-gun{
+
+				.b-gun {
 					width: 78px;
 					margin-left: 12px;
 				}
-				.showCodeActive{
+
+				.showCodeActive {
 					background-color: #636C97;
 				}
 			}
-			.container-code{
+
+			.container-code {
 				display: flex;
 				margin-bottom: 10px;
 				justify-content: space-between;
-				.container-code-one{
+
+				.container-code-one {
 					font-size: 16px;
 					color: #91FDB9;
 				}
-				.container-code-two{
+
+				.container-code-two {
 					display: flex;
-					image{
+
+					image {
 						width: 60px;
 						height: 24px;
 					}
-					image:first-child{
+
+					image:first-child {
 						margin-right: 20px;
 					}
 				}
-			}
-            .battery-info{
-                display: flex;
-                margin-top: 16px;
-                justify-content: space-between;
-                flex-wrap: wrap;
+			}
+
+			.battery-info {
+				display: flex;
+				margin-top: 16px;
+				justify-content: space-between;
+				flex-wrap: wrap;
 				margin-bottom: 20px;
 				min-height: 116px;
-				.vim{
+
+				.vim {
 					width: 100%;
 					margin: 0px 0px 12px 0px;
-					text{
+
+					text {
 						font-size: 14px;
 						color: #414A63;
 					}
-					text:last-child{
+
+					text:last-child {
 						display: inline-block;
 						margin-left: 10px;
 						font-weight: 600;
 						color: #fff;
 					}
-				}
-                .info-right{
-                    width: 46%;
-                    height: 32px;
-                    line-height:30px;
-                    text-align: center;
-                    font-size: 14px;
-                    font-weight: 500;
-                    color: white;
-                    background-color: #0e1f31;
-                    border: #1b71a4 solid 1px;
-                    .s1{
-                        vertical-align: middle;
-                        width: 18px;
-                        height: 18px;
-                    }
-                }
-                .info-warning{
-                    width: 46%;
-                    background-color: #201823;
-                    border: #834246 solid 1px;
-                    height: 34px;
-                    line-height:32px;
-                    text-align: center;
-                    font-size: 14px;
-                    font-weight: 500;
-                    color: white;
-                    // img{
-                    //     vertical-align: middle;
-                    // }
-                }
-            }
-            .battery-charger{
-                width: 100%;
-                min-height: 228px;
-                .nodata{
-                    position: relative;
-                    left: calc(50% - 33px);
-                    margin-top: 6vh;
-                    width: 66px;
-                    height: 66px;
-                }
-            }
-        }
-		.battery-charger-btn{
+				}
+
+				.info-right {
+					width: 46%;
+					height: 32px;
+					line-height: 30px;
+					text-align: center;
+					font-size: 14px;
+					font-weight: 500;
+					color: white;
+					background-color: #0e1f31;
+					border: #1b71a4 solid 1px;
+
+					.s1 {
+						vertical-align: middle;
+						width: 18px;
+						height: 18px;
+					}
+				}
+
+				.info-warning {
+					width: 46%;
+					background-color: #201823;
+					border: #834246 solid 1px;
+					height: 34px;
+					line-height: 32px;
+					text-align: center;
+					font-size: 14px;
+					font-weight: 500;
+					color: white;
+					// img{
+					//     vertical-align: middle;
+					// }
+				}
+			}
+
+			.battery-charger {
+				width: 100%;
+				min-height: 228px;
+
+				.nodata {
+					position: relative;
+					left: calc(50% - 33px);
+					margin-top: 6vh;
+					width: 66px;
+					height: 66px;
+				}
+			}
+		}
+
+		.battery-charger-btn {
 			display: flex;
-			    position: absolute;
-			    bottom: 20px;
-			.Plug-gun-charging{
+			position: absolute;
+			bottom: 20px;
+
+			.Plug-gun-charging {
 				width: 135px;
 				height: 32px;
 				background: #69B889;
@@ -291,11 +320,11 @@ export default {
 				font-weight: 500;
 				color: #DEEFF9;
 			}
-			.Settings{
+
+			.Settings {
 				background: #636C97;
 				margin-left: 20px;
 			}
-		}
-    }
-	
-</style>
+		}
+	}
+</style>

+ 185 - 39
pages/equipment-monitoring/components/batteryDrawe.vue

@@ -1,52 +1,104 @@
 <template>
-	<view>
-		<uni-forms :modelValue="infodata">
-			<uni-forms-item label="当前充电:" name="name" label-align="right" label-width="120px">
-				<uni-easyinput type="text" v-model="infodata.comState?'通讯正常':'通讯异常' || '-'" placeholder="请输入"
-					disabled />
-			</uni-forms-item>
-			<uni-forms-item label="枪号:" name="arr" label-width="120px" label-align="right" >
-				<uni-data-select v-model="pppp" :localdata="infodata.arr" @change="changeId"></uni-data-select>
-			</uni-forms-item>
-		<uni-forms-item label="按类型设置:" name="arr" label-width="120px" label-align="right" >
-			<uni-data-select v-model="pppp" :localdata="infodata.arr" @change="changeId"></uni-data-select>
-		</uni-forms-item>
-			<uni-forms-item label="充电功率:" name="name" label-align="right" label-width="120px">
-				<uni-easyinput type="text" v-model="infodata.soh || '-'" placeholder="请输入"  />
-				<view class="kwh">
-					KWH
+	<view class="">
+		<view class="drawerBox">
+			<view class="top">
+				<view class="title">充电设置</view>
+				<view class="handler">
+					<view class="cancel" @click="close">取消</view>
+					<view class="save" @click="SubmitPublic">保存</view>
 				</view>
-			</uni-forms-item>
-		</uni-forms>
+			</view>
+		</view>
+		<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="请输入"
+						disabled />
+				</uni-forms-item>
+				<uni-forms-item label="枪号:" name="arr" label-width="120px" label-align="right">
+					<uni-data-select v-model="fromData.Guncall" :localdata="fromData.arr" @change="changegun">
+					</uni-data-select>
+				</uni-forms-item>
+				<uni-forms-item label="按类型设置:" name="arrType" label-width="120px" label-align="right">
+					<uni-data-select v-model="fromData.setType" :localdata="fromData.arrType" @change="changeId">
+					</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="请输入" />
+					<view class="kwh">
+						KWH
+					</view>
+				</uni-forms-item>
+			</uni-forms>
+		</view>
 	</view>
+
 </template>
 
 <script>
 	export default {
 		name: 'batteryDrawe',
-		// props: ['infodata'],
+		props: ['infodata'],
 		data() {
 			return {
-				pppp:'',
-				infodata:{
-					arr:[{
-						text:'a枪',
-						value:'0'
-					},{text:'b枪',
-						value:'1'}],
-					soh:1,
-					comState:1
+				popupMessage: '成功消息',
+				popupType: 'success',
+				fromData: {
+					arr: [{
+						text: 'a枪',
+						value: '0'
+					}, {
+						text: 'b枪',
+						value: '1'
+					}],
+					arrType: [{
+							text: '桩自主控制功率',
+							value: '0'
+						},
+						{
+							text: '功率值',
+							value: '1'
+						},
+						{
+							text: '功率百分比',
+							value: '2'
+						}, {
+							text: '输出电流',
+							value: '3'
+						}
+					],
+					gunNo: '',
+					comState: 1, //充电类型
+					Guncall: '',
+					setType: '',
+					cangnum:0,//仓号
+					powerNum:'',
 				},
-				fromData:{
-					
-				}
-				
+
+
 			}
 		},
-		methods:{
-			changeId(){
+		methods: {
+			//下拉事件
+			changeId() { 
 				console.log(123)
+			},
+			//下拉事件
+			changegun() {
+
+			},
+			//取消
+			close() {
+				this.$emit('closeDrawer')
+			},
+			// 保存
+			SubmitPublic() {
+				this.$emit('save',this.fromData)
 			}
+		},
+		mounted() {
+			this.fromData.comState = this.infodata.chgType,
+			this.fromData.cangnum = this.infodata.chargerInfoVo.chargerCode
 		}
 	}
 </script>
@@ -75,19 +127,113 @@
 		right: 0;
 		top: 0px;
 	}
-	::v-deep .uni-select__selector{
+
+	::v-deep .uni-select__selector {
 		background: #111827;
-		border:1px solid #263042;
+		border: 1px solid #263042;
 		color: #606266;
 		z-index: 9999999;
 	}
-	::v-deep .uni-select{
+
+	::v-deep .uni-select {
 		border: none;
 	}
-	::v-deep .uni-popper__arrow::after{
+
+	::v-deep .uni-popper__arrow::after {
 		display: none;
 	}
-	::v-deep .uni-popper__arrow{
+
+	::v-deep .uni-popper__arrow {
 		display: none;
 	}
+
+	::v-deep .uni-select__input-text {
+		color: #fff;
+	}
+
+	.main_drawe {
+		padding: 20px;
+		margin-top: 80px;
+	}
+
+	.drawerBox {
+		display: flex;
+		flex-direction: column;
+		height: 100%;
+
+		.top {
+			width: 100%;
+			height: 74px;
+			line-height: 54px;
+			border-bottom: 1px solid rgba(65, 74, 99, 0.5);
+			box-sizing: border-box;
+			z-index: 999;
+			padding: 0px 20px;
+			display: flex;
+			padding-top: 20px;
+			background-color: #141A25;
+			position: fixed;
+			top: 0;
+
+			.title {
+				min-width: 74px;
+				white-space: nowrap;
+				font-size: 16px;
+				font-weight: 500;
+				color: #FFFFFF;
+				position: relative;
+			}
+
+			.title::before {
+				content: '';
+				width: 100%;
+				position: absolute;
+				height: 2px;
+				background: #FFFFFF;
+				box-shadow: 0px 0px 6px 0px rgba(255, 255, 255, 0.8);
+				bottom: -1px;
+			}
+
+			.close {
+				width: 24px;
+				height: 24px;
+				color: #FFFFFF;
+				margin-left: auto;
+				font-size: 14px;
+				text-align: center;
+				vertical-align: middle;
+			}
+
+			.handler {
+				display: flex;
+				margin-left: auto;
+				height: 54px;
+				align-items: center;
+
+				.cancel {
+					width: 60px;
+					height: 54px;
+					border-radius: 2px;
+					border: 1px solid #263042;
+					font-size: 14px;
+					font-weight: 400;
+					color: #FFFFFF;
+					text-align: center;
+					line-height: 54px;
+				}
+
+				.save {
+					width: 60px;
+					height: 54px;
+					background: #91FDB9;
+					border-radius: 2px;
+					text-align: center;
+					line-height: 54px;
+					font-size: 14px;
+					font-weight: 400;
+					color: black;
+				}
+			}
+		}
+	}
 </style>

+ 69 - 42
pages/equipment-monitoring/components/manual.vue

@@ -7,43 +7,37 @@
 		</view>
 		<view class="box_swiper">
 			<scroll-view scroll-x="true" class="scroll_x">
-				<view v-for="(item, index) in storeInfoLists" :key="index"> <!-- @click="drawer(item,index)"-->
-					<StorageInfo :store-code="item.storeCode" :com-state="item.comState" :sn="item.sn" :soc="item.soc" @drawer="drawer(item,index)"
-						:chg-estimated-time="item.chargerInfoVo.chgEstimatedTime" :current="item.current"
-						:voltage="item.voltage" :min-temperature="item.minTemperature"
+				<view v-for="(item, index) in storeInfoLists" :key="index">
+					<!-- @click="drawer(item,index)"-->
+					<StorageInfo :store-code="item.storeCode" :com-state="item.comState" :sn="item.sn" :soc="item.soc"
+						@drawer="drawer(item,index)" :chg-estimated-time="item.chargerInfoVo.chgEstimatedTime"
+						:current="item.current" :voltage="item.voltage" :min-temperature="item.minTemperature"
 						: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':''" />
+						:charger-info-vo="item.chargerInfoVo" :class="box_num == index ? 'slect_box':''"
+						:chgType='item.chgType' />
 				</view>
 
 			</scroll-view>
-			
-			
+
+
 			<!--右侧抽屉 -->
 			<uni-drawer ref="showRight" mode="right" :width="400" :mask-click="true" @change='changemask'>
 				<scroll-view style="height: 100%;" scroll-y="true">
-					<PublicDrawer :flag="false" :title="titlenum" @closeDrawer="closeDrawer">
-						<!-- <view class="header_drawer_btn">
-							<view class="header_drawer_btn_left" :class="batteryInfoActive == 0?'active':''" @click="batteryInfoActive = 0">
-								电池
-							</view>
-							<view class="header_drawer_btn_right" :class="batteryInfoActive == 1?'active':''" @click="batteryInfoActive = 1">
-								充电机
-							</view>
-						</view> -->
-						<!-- <view class="drawer_main">
-							<view v-if="!batteryInfoActive"> -->
-								<batteryDrawe :infodata="infodata"></batteryDrawe>
-							<!-- </view>
-							<view v-if="batteryInfoActive"><chargerDrawe :infodata="infodata"></chargerDrawe></view>
-						</view> -->
+					<batteryDrawe :infodata="infodata" @closeDrawer="closeDrawer" @save='save'></batteryDrawe>
+
+
 					</PublicDrawer>
 				</scroll-view>
 			</uni-drawer>
 			<!-- 右侧抽屉结束 -->
-			
-			
-			
+
+
+			<!-- 顶部公共提示信息 -->
+			<uni-popup ref="Exchangepopup" type="message">
+				<uni-popup-message :type="popupType" :message="popupMessage" :duration="2000"></uni-popup-message>
+			</uni-popup>
+			<!-- 顶部提示信息结束-->
 		</view>
 	</view>
 </template>
@@ -53,7 +47,7 @@
 	import StorageInfo from "../components/StorageInfo.vue"
 	import batteryDrawe from "../components/batteryDrawe.vue"
 	import chargerDrawe from "../components/chargerDrawe.vue"
-	name:'manual'
+	name: 'manual'
 	export default {
 		components: {
 			SubTitle,
@@ -64,11 +58,14 @@
 		props: ['storeInfoLists'],
 		data() {
 			return {
+				popupMessage: '成功消息',
+				popupType: 'success',
 				isSlecte: true,
 				box_num: -1, //记录选中了第几个
-				titlenum: '充电设置', //抽屉标题
-				batteryInfoActive:1,//0代表电池1代表充电机
-				infodata:{},//详情数据
+				name: 'batteryDrawe',
+				props: ['infodata'],
+				batteryInfoActive: 1, //0代表电池1代表充电机
+				infodata: {}, //详情数据
 			}
 		},
 		mounted() {
@@ -78,22 +75,47 @@
 			//抽屉
 			drawer(item, index) {
 				this.box_num = index;
-				// this.titlenum = item.storeCode + '号仓充电详情'
 				this.$refs.showRight.open();
 				this.infodata = item;
 				console.log(item, index, 'item')
 			},
 			//关闭抽屉
-			closeDrawer(){
+			closeDrawer() {
 				this.batteryInfoActive = 1;
 				this.box_num = -1;
 				this.$refs.showRight.close();
 			},
 			//抽屉改变事件
-			changemask(e){
-				if(!e){
+			changemask(e) {
+				if (!e) {
 					this.closeDrawer()
 				}
+			},
+			//顶部公共消息提示
+			ExchangeMessage(type, message) {
+				this.popupType = type
+				this.popupMessage = message ? message : '后端接口404错误!'
+				this.$refs.Exchangepopup.open()
+			},
+			//抽屉保存修改
+			save(datas) {
+				console.log(datas, 'e')
+				let data = {
+					chargerId: datas.cangnum,
+					gunNo: datas.Guncall,
+					powerNum: datas.powerNum,
+					powerType: datas.setType
+				}
+				if(data.gunNo=='' || data.powerNum=='' || data.powerNum=='' ){
+					this.ExchangeMessage('warn','请填写完整')
+				}else{
+					this.$http.getlimitPower(data).then(res => {
+						this.ExchangeMessage(res.code === 0 ? 'success' : 'error',
+							res.code === 0 ? '设置功率下发成功!' : '设置功率下发失败!')
+							this.$refs.showRight.close();
+					})
+				}
+				
 			}
 		}
 	}
@@ -134,8 +156,9 @@
 
 				/deep/ .uni-scroll-view-content {
 					display: flex;
-					view:last-child{
-						.storage-item{
+
+					view:last-child {
+						.storage-item {
 							margin-right: 0px;
 						}
 					}
@@ -147,13 +170,15 @@
 	.slect_box {
 		border: 1px solid #338150 !important;
 	}
-	.header_drawer_btn{
+
+	.header_drawer_btn {
 		display: flex;
 		font-size: 14px;
 		font-family: PingFang SC-Regular, PingFang SC;
 		font-weight: 400;
 		color: #FFFFFF;
-		.header_drawer_btn_left{
+
+		.header_drawer_btn_left {
 			width: 60px;
 			height: 32px;
 			background: #263042;
@@ -161,7 +186,8 @@
 			line-height: 32px;
 			text-align: center;
 		}
-		.header_drawer_btn_right{
+
+		.header_drawer_btn_right {
 			line-height: 32px;
 			text-align: center;
 			width: 74px;
@@ -169,15 +195,16 @@
 			background: #263042;
 			border-radius: 0px 2px 2px 0px;
 		}
-		.active{
+
+		.active {
 			color: black;
 			background: #91FDB9;
 		}
 	}
-	
-	.drawer_main{
+
+	.drawer_main {
 		// border: 1px solid red;
 		padding-top: 20px;
-		
+
 	}
 </style>