蒋科 4 kuukautta sitten
vanhempi
commit
88de12c7b0

+ 29 - 5
pages/equipment-monitoring/components/StorageInfo.vue

@@ -142,12 +142,32 @@
 					<!-- <BatteryInfo :num="chargerInfoTwoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo> -->
 				</view>
 				<view class="battery-charger-btn">
-					<view class="Plug-gun-charging" @click="ChargingMode(chgType)">
+					<button class="Plug-gun-charging" @click="ChargingMode(chgType)">
 						{{chgType == 0 ?'切换为插枪充电':'切换为线束充电'}}
-					</view>
-					<view class="Settings Plug-gun-charging" @click="set">
+					</button>
+					<template v-if="chgType == 0 && showCode !=0">
+						<button class="disabled Plug-gun-charging" @click="set" :disabled="true">设置</button>
+					</template>
+					<template v-else-if="chgType == 1  && showCode ==0">
+						<button class="disabled Plug-gun-charging" @click="set" :disabled="true">设置</button>
+					</template>
+					<template v-else>
+						<template v-if="showCode==0 && chargerInfoVo.comState===1">
+							<button class="Settings Plug-gun-charging" @click="set">设置</button>
+						</template>
+						<template v-else-if="showCode==1 && chargerInfoOneVo.comState===1">
+							<button class="Settings Plug-gun-charging" @click="set">设置</button>
+						</template>
+						<template v-else-if="showCode==2 && chargerInfoTwoVo.comState===1">
+							<button class="Settings Plug-gun-charging" @click="set">设置</button>
+						</template>
+						<template v-else>
+							<button class="disabled Plug-gun-charging" :disabled="true" @click="set">设置</button>
+						</template>
+					</template>
+					<!-- <view class="Settings Plug-gun-charging" @click="set">
 						设置
-					</view>
+					</view> -->
 				</view>
 				<image src="../../../static/equipment/nodata.png" class="nodata" v-show="!chargerInfoVo.chargerCode">
 			</view>
@@ -216,7 +236,7 @@
 				this.Markers = 1
 			},
 			//打开弹窗
-			set(obj) {
+			set() {
 			  this.getShowCode()
 			  this.$emit('drawer')
 			},
@@ -662,6 +682,10 @@
 				background: #636C97;
 				margin-left: 20px;
 			}
+			.disabled{
+				background: #606266;
+				margin-left: 20px;
+			}
 		}
 	}
 </style>

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

@@ -44,8 +44,7 @@
 						@change="changeId">
 					</uni-data-select>
 				</uni-forms-item>
-				<uni-forms-item label="功率:" name="name" label-align="right" label-width="66px"
-					v-if="fromData.setType !=0">
+				<uni-forms-item label="功率:" name="name" label-align="right" label-width="66px" v-if="fromData.setType !=0">
 					<uni-easyinput type="number" v-model="fromData.powerNum" placeholder="请输入"
 						maxlength="4" />
 					<view class="kwh">
@@ -65,13 +64,7 @@
 			return {
 
 				fromData: {
-					arr: [{
-						text: 'A枪',
-						value: '0'
-					}, {
-						text: 'B枪',
-						value: '1'
-					}],
+					arr: [],
 					arrType: [{
 							text: '桩自主控制功率',
 							value: '0'
@@ -111,10 +104,12 @@
 				let type=null
 				  if(this.infodata.chgType==0){
 					type=1
-				  }else if(this.infodata.chgType==1 && this.infodata.showCode==1){
-					type=3
-				  }else if(this.infodata.chgType==1 && this.infodata.showCode==2){
-					type=4
+				  }else{
+					  if(this.infodata.showCode==1){
+						type=3
+					  }else{
+						type=4
+					  }
 				  }
 				this.$http.getChargePower({chargerId:this.infodata.chargerInfoVo.chargerCode,type}).then(res=>{
 					if(res.code===0){
@@ -124,7 +119,7 @@
 			},
 			//下拉事件
 			changeId() {
-				console.log(123)
+
 			},
 			//下拉事件
 			changegun() {
@@ -144,13 +139,18 @@
 			this.fromData.comState = this.infodata.chgType
 			if (this.fromData.comState == 1) { //1是插枪充电 0是线束充电
 				this.fromData.chargerAway='插枪充电'
-				this.fromData.arr = [{
-					text: "A枪",
-					value: "0",
-				}, {
-					text: "B枪",
-					value: "1",
-				}]
+				if(this.infodata.showCode==1){
+					this.fromData.arr = [{
+						text: "A枪",
+						value: "0",
+					}]
+				}else{
+					this.fromData.arr = [{
+						text: "B枪",
+						value: "1",
+					}]
+				}
+				
 			} else {
 				this.fromData.chargerAway='线束充电'
 				this.fromData.arr = [{