StorageInfo.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. <template>
  2. <view class="storage-item">
  3. <view class="container">
  4. <view class="container-header">
  5. <view class="battery" :class="showCode ==0?'showCodeActive':''" @click="actshowCode(0)">
  6. {{StateNum}}
  7. </view>
  8. <view class="a-gun battery" :class="showCode ==1?'showCodeActive':''" @click="actshowCode(1)">
  9. A枪
  10. </view>
  11. <view class="b-gun battery" :class="showCode ==2?'showCodeActive':''" @click="actshowCode(2)">
  12. B枪
  13. </view>
  14. </view>
  15. <view class="topBox">
  16. <view class="container-code">
  17. <view class="container-code-one" :class="statustext[1]" v-if="showCode== 0">
  18. {{statustext[0]}}
  19. </view>
  20. <view class="container-code-one" :class="statustextA[1]" v-if="showCode== 1">
  21. {{statustextA[0]}}
  22. </view>
  23. <view class="container-code-one" :class="statustextB[1]" v-if="showCode== 2">
  24. {{statustextB[0]}}
  25. </view>
  26. <view class="container-code-two" v-if="showCode== 0">
  27. <image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoVo.chgState === 2"
  28. @click="sendCharger('断电')"></image>
  29. <image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoVo.chgState !== 2"></image>
  30. <image src="../../../static/equipment/c1.png" mode=""
  31. v-if="chargerInfoVo.chgState === 0 || chargerInfoVo.chgState === 3" @click="sendCharger('充电')">
  32. </image>
  33. <image src="../../../static/equipment/c2.png" mode=""
  34. v-if="chargerInfoVo.chgState !== 0 && chargerInfoVo.chgState !== 3"></image>
  35. </view>
  36. <view class="container-code-two" v-if="showCode== 1">
  37. <image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoOneVo.chgState === 2"
  38. @click="sendChargerClose('断电',batInfoOneVo.gunCode,chargerInfoOneVo.chargerCode)">
  39. </image>
  40. <image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoOneVo.chgState !== 2">
  41. </image>
  42. <image src="../../../static/equipment/c1.png" mode=""
  43. v-if="chargerInfoOneVo.chgState === 0 || chargerInfoOneVo.chgState === 3"
  44. @click="sendChargerOpen('充电',batInfoOneVo.gunCode,chargerInfoOneVo.chargerCode)"></image>
  45. <image src="../../../static/equipment/c2.png" mode=""
  46. v-if="chargerInfoOneVo.chgState !== 0 && chargerInfoOneVo.chgState !== 3"></image>
  47. </view>
  48. <view class="container-code-two" v-if="showCode== 2">
  49. <image src="../../../static/equipment/d5.png" mode="" v-if="chargerInfoTwoVo.chgState === 2"
  50. @click="sendChargerClose('断电',batInfoTwoVo.gunCode,chargerInfoTwoVo.chargerCode)">
  51. </image>
  52. <image src="../../../static/equipment/d6.png" mode="" v-if="chargerInfoTwoVo.chgState !== 2">
  53. </image>
  54. <image src="../../../static/equipment/c1.png" mode=""
  55. v-if="chargerInfoTwoVo.chgState === 0 || chargerInfoTwoVo.chgState === 3"
  56. @click="sendChargerOpen('充电',batInfoTwoVo.gunCode,chargerInfoTwoVo.chargerCode)"></image>
  57. <image src="../../../static/equipment/c2.png" mode=""
  58. v-if="chargerInfoTwoVo.chgState !== 0 && chargerInfoTwoVo.chgState !== 3"></image>
  59. </view>
  60. </view>
  61. <BatteryStatus :storeCode="storeCode" :comState="comState" :sn="sn" :soc="soc"
  62. :chgEstimatedTime="chgEstimatedTime" :showCode="showCode" v-if="showCode== 0"></BatteryStatus>
  63. <BatteryStatus :storeCode="batInfoOneVo.storeCode" :comState="chargerInfoOneVo.comState"
  64. :sn="batInfoOneVo.sn" :soc="batInfoOneVo.soc" :chgEstimatedTime="chargerInfoOneVo.chgEstimatedTime"
  65. :showCode="showCode" v-if="showCode== 1"></BatteryStatus>
  66. <BatteryStatus :storeCode="batInfoTwoVo.storeCode" :comState="chargerInfoTwoVo.comState"
  67. :sn="batInfoTwoVo.sn" :soc="batInfoTwoVo.soc" :chgEstimatedTime="chargerInfoTwoVo.chgEstimatedTime"
  68. :showCode="showCode" v-if="showCode== 2"></BatteryStatus>
  69. <view class="battery-info">
  70. <view class="vim" v-if="showCode == 1">
  71. <text>vin码</text><text>{{batInfoOneVo.vin ||'-'}}</text>
  72. </view>
  73. <view class="vim" v-if="showCode == 2">
  74. <text>vin码</text><text>{{batInfoTwoVo.vin ||'-'}}</text>
  75. </view>
  76. <template v-if="showCode == 0">
  77. <BatteryInfo :num="chargerInfoVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
  78. <BatteryInfo :num="chargerInfoVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
  79. </template>
  80. <template v-if="showCode == 1">
  81. <BatteryInfo :num="chargerInfoOneVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
  82. <BatteryInfo :num="chargerInfoOneVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
  83. </template>
  84. <template v-if="showCode == 2">
  85. <BatteryInfo :num="chargerInfoTwoVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
  86. <BatteryInfo :num="chargerInfoTwoVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
  87. </template>
  88. <BatteryInfo :num="current" unit="A" text="电流" v-if="showCode == 0 && chgType == 0"></BatteryInfo>
  89. <BatteryInfo :num="batInfoOneVo.current" unit="A" text="电流" v-if="showCode ==1 && chgType == 0">
  90. </BatteryInfo>
  91. <BatteryInfo :num="batInfoTwoVo.current" unit="A" text="电流" v-if="showCode == 2 && chgType == 0">
  92. </BatteryInfo>
  93. <BatteryInfo :num="voltage" unit="V" text="电压" v-if="showCode == 0 && chgType == 0"></BatteryInfo>
  94. <BatteryInfo :num="batInfoOneVo.voltage" unit="V" text="电压" v-if="showCode == 1 && chgType == 0">
  95. </BatteryInfo>
  96. <BatteryInfo :num="batInfoTwoVo.voltage" unit="V" text="电压" v-if="showCode == 2 && chgType == 0">
  97. </BatteryInfo>
  98. <BatteryInfo :num="soh" unit="%" text="SOH" v-if="showCode == 0"></BatteryInfo>
  99. <view class="info-right" :style="chargerColor" v-if="showCode == 0">
  100. <image class="s1" :src="require('../../../static/equipment/'+`s${chargerState[0]}`+'.png')">
  101. <text>{{chargerState[1]}}</text>
  102. </view>
  103. <view class="info-right" :style="chargerColorA" v-if="showCode == 1">
  104. <image class="s1" :src="require('../../../static/equipment/'+`s${chargerStateA[0]}`+'.png')">
  105. <text>{{chargerStateA[1]}}</text>
  106. </view>
  107. <view class="info-right" :style="chargerColorB" v-if="showCode == 2">
  108. <image class="s1" :src="require('../../../static/equipment/'+`s${chargerStateB[0]}`+'.png')">
  109. <text>{{chargerStateB[1]}}</text>
  110. </view>
  111. <!-- <BatteryInfo :num="minTemperature" unit="℃" text="最低温度"></BatteryInfo>
  112. <BatteryInfo :num="maxTemperature" unit="℃" text="最高温度"></BatteryInfo>
  113. <BatteryInfo :num="maxCellVoltage" unit="V" text="最高单体电压"></BatteryInfo>
  114. <BatteryInfo :num="minCellVoltage" unit="V" text="最低单体电压"></BatteryInfo>
  115. <view class="info-right">
  116. <image class="s1" src="../../../static/equipment/s1.png"><text class="text">{{StateNum}}</text>
  117. </view>
  118. -->
  119. </view>
  120. </view>
  121. <view class="battery-charger">
  122. <BatteryCharger :chargerCode="chargerInfoVo.chargerCode" :comState="chargerInfoVo.comState"
  123. v-if="chargerInfoVo.chargerCode &&showCode ==0"></BatteryCharger>
  124. <BatteryCharger :chargerCode="chargerInfoOneVo.chargerCode" :comState="chargerInfoOneVo.comState"
  125. v-if="chargerInfoOneVo.chargerCode &&showCode ==1"></BatteryCharger>
  126. <BatteryCharger :chargerCode="chargerInfoTwoVo.chargerCode" :comState="chargerInfoTwoVo.comState"
  127. v-if="chargerInfoTwoVo.chargerCode &&showCode ==2"></BatteryCharger>
  128. <view class="battery-info" v-if="chargerInfoVo.chargerCode && showCode ==0">
  129. <BatteryInfo :num="chargerInfoVo.chgCurrent" unit="A" text="充电电流"></BatteryInfo>
  130. <BatteryInfo :num="chargerInfoVo.chgVoltage" unit="V" text="充电电压"></BatteryInfo>
  131. <!-- <BatteryInfo :num="chargerInfoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo> -->
  132. </view>
  133. <view class="battery-info" v-if="chargerInfoOneVo.chargerCode && showCode ==1">
  134. <BatteryInfo :num="chargerInfoOneVo.chgCurrent" unit="A" text="充电电流"></BatteryInfo>
  135. <BatteryInfo :num="chargerInfoOneVo.chgVoltage" unit="V" text="充电电压"></BatteryInfo>
  136. <!-- <BatteryInfo :num="chargerInfoOneVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo> -->
  137. </view>
  138. <view class="battery-info" v-if="chargerInfoTwoVo.chargerCode && showCode ==2">
  139. <BatteryInfo :num="chargerInfoTwoVo.chgCurrent" unit="A" text="充电电流"></BatteryInfo>
  140. <BatteryInfo :num="chargerInfoTwoVo.chgVoltage" unit="V" text="充电电压"></BatteryInfo>
  141. <!-- <BatteryInfo :num="chargerInfoTwoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo> -->
  142. </view>
  143. <view class="battery-charger-btn">
  144. <button class="Plug-gun-charging" @click="ChargingMode(chgType)">
  145. {{chgType == 0 ?'切换为插枪充电':'切换为线束充电'}}
  146. </button>
  147. <template v-if="chgType == 0 && showCode !=0">
  148. <button class="disabled Plug-gun-charging" @click="set" :disabled="true">设置</button>
  149. </template>
  150. <template v-else-if="chgType == 1 && showCode ==0">
  151. <button class="disabled Plug-gun-charging" @click="set" :disabled="true">设置</button>
  152. </template>
  153. <template v-else>
  154. <template v-if="showCode==0 && chargerInfoVo.comState===1">
  155. <button class="Settings Plug-gun-charging" @click="set">设置</button>
  156. </template>
  157. <template v-else-if="showCode==1 && chargerInfoOneVo.comState===1">
  158. <button class="Settings Plug-gun-charging" @click="set">设置</button>
  159. </template>
  160. <template v-else-if="showCode==2 && chargerInfoTwoVo.comState===1">
  161. <button class="Settings Plug-gun-charging" @click="set">设置</button>
  162. </template>
  163. <template v-else>
  164. <button class="disabled Plug-gun-charging" :disabled="true" @click="set">设置</button>
  165. </template>
  166. </template>
  167. <!-- <view class="Settings Plug-gun-charging" @click="set">
  168. 设置
  169. </view> -->
  170. </view>
  171. <image src="../../../static/equipment/nodata.png" class="nodata" v-show="!chargerInfoVo.chargerCode">
  172. </view>
  173. </view>
  174. </view>
  175. </template>
  176. <script>
  177. import BatteryInfo from "./BatteryInfo.vue";
  178. import BatteryStatus from "./BatteryStatus.vue";
  179. import BatteryCharger from "./BatteryCharger.vue"
  180. export default {
  181. name: "StorageInfo",
  182. props: [
  183. 'storeCode',
  184. 'comState',
  185. 'sn',
  186. 'soc',
  187. 'chgEstimatedTime',
  188. 'current',
  189. 'voltage',
  190. 'minTemperature',
  191. 'maxTemperature',
  192. 'maxCellVoltage',
  193. 'minCellVoltage',
  194. 'soh',
  195. 'storeState',
  196. 'chargerInfoVo',
  197. 'chgType',
  198. 'batInfoOneVo',
  199. 'batInfoTwoVo',
  200. 'chargerInfoOneVo',
  201. 'chargerInfoTwoVo',
  202. 'showCodeNum'
  203. ],
  204. components: {
  205. BatteryInfo,
  206. BatteryStatus,
  207. BatteryCharger
  208. },
  209. data() {
  210. return {
  211. showCode: 0, //0电池1A枪2B枪
  212. Markers: 0, //标记 0代表没点击过 1代表点击过
  213. }
  214. },
  215. mounted() {
  216. this.showCode = this.showCodeNum; //根据后端返的数据动态渲染当前状态
  217. },
  218. watch: {
  219. showCodeNum(newshowCodeNum, oldshowCodeNum) {
  220. if (this.Markers == 0) {
  221. this.showCode = newshowCodeNum //没点击过 根据后端数据实时渲染不同的数据
  222. }
  223. }
  224. },
  225. methods: {
  226. //传给父组件的showCode
  227. getShowCode(){
  228. this.$emit('getShowCode',this.showCode)
  229. },
  230. //页面切换
  231. actshowCode(code) {
  232. this.showCode = code;
  233. this.Markers = 1
  234. },
  235. //打开弹窗
  236. set() {
  237. this.getShowCode()
  238. this.$emit('drawer')
  239. },
  240. //切换仓内仓外
  241. ChargingMode(chgType) {
  242. //停止充电后才能切换
  243. let _self=this
  244. let data = {
  245. "chargerId": this.chargerInfoVo.chargerCode,
  246. "chargerWay": chgType == 1 ? '1' : '2',
  247. "controlPriority": 0,
  248. "powerControl": 0,
  249. "powerToggle": 0
  250. }
  251. uni.showModal({
  252. title: `请确认切换为${chgType===0?'插枪充电':'线束充电'}`,
  253. content: '',
  254. success: function(res) {
  255. if(res.confirm){
  256. if (chgType == 0 && _self.chargerInfoVo.chgState == 2) { //仓内充电 充电时不允许切换
  257. _self.$emit('ExchangeMessage', 'error','请停止充电后再进行切换!')
  258. return
  259. } else if (chgType == 1 && _self.chargerInfoOneVo.chgState == 2 || _self.chargerInfoTwoVo.chgState == 2) {
  260. _self.$emit('ExchangeMessage', 'error','请停止充电后再进行切换!')
  261. return
  262. } else {
  263. _self.$http.gettoggleChargeWay(data).then(res => {
  264. _self.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
  265. res.code === 0 ? '切换成功!' : res.msg)
  266. })
  267. }
  268. }
  269. }
  270. })
  271. },
  272. //仓内充电、断电操作
  273. sendCharger(name) {
  274. let params = {}
  275. if (this.chargerInfoVo.chgState === 0 || this.chargerInfoVo.chgState === 3) {
  276. params = {
  277. chargerId: this.chargerInfoVo.chargerCode * 1,
  278. sn: this.sn
  279. }
  280. } else if (this.chargerInfoVo.chgState === 2) {
  281. params = {
  282. chargerId: this.chargerInfoVo.chargerCode * 1
  283. }
  284. }
  285. let that = this
  286. uni.showModal({
  287. title: `确认发起${name}`,
  288. content: '',
  289. success: function(res) {
  290. if (res.confirm) { //点击确定
  291. //充电操作
  292. if (that.chargerInfoVo.chgState === 0 || that.chargerInfoVo.chgState === 3) {
  293. that.$emit('ExchangeMessage', 'success', '充电指令已下发')
  294. that.$http.startCharge(params)
  295. .then(res => {
  296. that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
  297. res.code === 0 ? '充电成功' : '充电失败')
  298. }).catch(err => {
  299. console.error(err)
  300. })
  301. }
  302. //断电操作
  303. else if (that.chargerInfoVo.chgState === 2) {
  304. that.$emit('ExchangeMessage', 'success', '断电指令已下发')
  305. that.$http.stopCharge(params)
  306. .then(res => {
  307. that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
  308. res.code === 0 ? '断电成功' : '断电失败')
  309. }).catch(err => {
  310. console.error(err)
  311. })
  312. }
  313. } else if (res.cancel) {
  314. return false
  315. //用户点击取消按钮触发
  316. }
  317. }
  318. })
  319. },
  320. //仓外·断电操作
  321. sendChargerClose(name, guncode, chargerId) {
  322. let params = {}
  323. params = {
  324. "chargerId": chargerId * 1,
  325. "gunNo": guncode,
  326. }
  327. let that = this
  328. uni.showModal({
  329. title: `确认发起${name}`,
  330. content: '',
  331. success: function(res) {
  332. if (res.confirm) { //点击确定
  333. //断电操作
  334. if (that.chargerInfoOneVo.chgState === 2 || that.chargerInfoTwoVo.chgState === 2) {
  335. that.$emit('ExchangeMessage', 'success', '断电指令已下发')
  336. console.log('stop')
  337. that.$http.getgunStopCharge(params)
  338. .then(res => {
  339. that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
  340. res.code === 0 ? '断电成功' : '断电失败')
  341. }).catch(err => {
  342. console.error(err)
  343. })
  344. }
  345. } else if (res.cancel) {
  346. return false
  347. //用户点击取消按钮触发
  348. }
  349. }
  350. })
  351. },
  352. //仓外充电
  353. sendChargerOpen(name, guncode, chargerId) {
  354. let params = {}
  355. params = {
  356. "chargerId": chargerId * 1,
  357. "gunNo": guncode,
  358. "strategy": 4,
  359. "strategyParam": 0
  360. }
  361. let that = this
  362. uni.showModal({
  363. title: `确认发起${name}`,
  364. content: '',
  365. success: function(res) {
  366. if (res.confirm) { //点击确定
  367. if (that.chargerInfoOneVo.chgState === 0 || that.chargerInfoOneVo
  368. .chgState === 3 ||
  369. that.chargerInfoTwoVo.chgState === 0 || that.chargerInfoTwoVo.chgState === 3) {
  370. //充电操作
  371. that.$emit('ExchangeMessage', 'success', '充电指令已下发')
  372. that.$http.getgunStartCharge(params)
  373. .then(res => {
  374. that.$emit('ExchangeMessage', res.code === 0 ? 'success' : 'error',
  375. res.code === 0 ? '充电成功' : '充电失败')
  376. }).catch(err => {
  377. console.error(err)
  378. })
  379. }
  380. } else if (res.cancel) {
  381. return false
  382. //用户点击取消按钮触发
  383. }
  384. }
  385. })
  386. }
  387. },
  388. computed: {
  389. statustext() {
  390. if (this.comState === 1) {
  391. return ['通讯正常', 'success']
  392. } else {
  393. return ['通讯异常', 'warning']
  394. }
  395. },
  396. statustextA() {
  397. if (this.batInfoOneVo.conState === 1) {
  398. return ['已连接', 'success']
  399. } else {
  400. return ['未连接', 'warning']
  401. }
  402. },
  403. statustextB() {
  404. if (this.batInfoTwoVo.conState === 1) {
  405. return ['已连接', 'success']
  406. } else {
  407. return ['未连接', 'warning']
  408. }
  409. },
  410. chargerState() {
  411. if (this.chargerInfoVo.chgState === 1) {
  412. return [3, ' 准备充电']
  413. } else if (this.chargerInfoVo.chgState === 2) {
  414. return [1, ' 充电中']
  415. } else if (this.chargerInfoVo.chgState === 3) {
  416. return [2, ' 充电完成']
  417. } else if (this.chargerInfoVo.chgState === 4) {
  418. return [8, ' 充电失败']
  419. } else if (this.chargerInfoVo.chgState === 5) {
  420. return [6, ' 预约']
  421. } else if (this.chargerInfoVo.chgState === 6) {
  422. return [5, ' 故障']
  423. } else if (this.chargerInfoVo.chgState === 0) {
  424. return [7, ' 空闲']
  425. } else {
  426. return [4, ' 无法获取']
  427. }
  428. },
  429. chargerStateA() {
  430. if (this.chargerInfoOneVo.chgState === 1) {
  431. return [3, ' 准备充电']
  432. } else if (this.chargerInfoOneVo.chgState === 2) {
  433. return [1, ' 充电中']
  434. } else if (this.chargerInfoOneVo.chgState === 3) {
  435. return [2, ' 充电完成']
  436. } else if (this.chargerInfoOneVo.chgState === 4) {
  437. return [8, ' 充电失败']
  438. } else if (this.chargerInfoOneVo.chgState === 5) {
  439. return [6, ' 预约']
  440. } else if (this.chargerInfoOneVo.chgState === 6) {
  441. return [5, ' 故障']
  442. } else if (this.chargerInfoOneVo.chgState === 0) {
  443. return [7, ' 空闲']
  444. } else {
  445. return [4, ' 无法获取']
  446. }
  447. },
  448. chargerStateB() {
  449. if (this.chargerInfoTwoVo.chgState === 1) {
  450. return [3, ' 准备充电']
  451. } else if (this.chargerInfoTwoVo.chgState === 2) {
  452. return [1, ' 充电中']
  453. } else if (this.chargerInfoTwoVo.chgState === 3) {
  454. return [2, ' 充电完成']
  455. } else if (this.chargerInfoTwoVo.chgState === 4) {
  456. return [8, ' 充电失败']
  457. } else if (this.chargerInfoTwoVo.chgState === 5) {
  458. return [6, ' 预约']
  459. } else if (this.chargerInfoTwoVo.chgState === 6) {
  460. return [5, ' 故障']
  461. } else if (this.chargerInfoTwoVo.chgState === 0) {
  462. return [7, ' 空闲']
  463. } else {
  464. return [4, ' 无法获取']
  465. }
  466. },
  467. chargerColor() {
  468. if (this.chargerInfoVo.chgState === 3) {
  469. return 'background-color:rgb(19,33,39,0.9);border:#477c62 solid 1px'
  470. } else if (this.chargerInfoVo.chgState === 1 || this.chargerInfoVo.chgState === 5) {
  471. return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
  472. } else if (this.chargerInfoVo.chgState === 2 || this.chargerInfoVo.chgState === 0) {
  473. return ''
  474. } else {
  475. return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
  476. }
  477. },
  478. chargerColorA() {
  479. if (this.chargerInfoOneVo.chgState === 3) {
  480. return 'background-color:rgb(19,33,39,0.9);border:#477c62 solid 1px'
  481. } else if (this.chargerInfoOneVo.chgState === 1 || this.chargerInfoOneVo.chgState === 5) {
  482. return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
  483. } else if (this.chargerInfoOneVo.chgState === 2 || this.chargerInfoOneVo.chgState === 0) {
  484. return ''
  485. } else {
  486. return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
  487. }
  488. },
  489. chargerColorB() {
  490. if (this.chargerInfoTwoVo.chgState === 3) {
  491. return 'background-color:rgb(19,33,39,0.9);border:#477c62 solid 1px'
  492. } else if (this.chargerInfoTwoVo.chgState === 1 || this.chargerInfoTwoVo.chgState === 5) {
  493. return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
  494. } else if (this.chargerInfoTwoVo.chgState === 2 || this.chargerInfoTwoVo.chgState === 0) {
  495. return ''
  496. } else {
  497. return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
  498. }
  499. },
  500. StateNum() {
  501. if (this.storeState === 0) {
  502. return '电池(无)'
  503. } else if (this.storeState === 1) {
  504. return '电池(有)'
  505. } else {
  506. return '异常'
  507. }
  508. }
  509. }
  510. };
  511. </script>
  512. <style lang="scss" scoped>
  513. .storage-item {
  514. width: 347px;
  515. background-color: #0a101c;
  516. height: 598px;
  517. margin-right: 22px;
  518. border: 1px solid #0a101c;
  519. .container {
  520. padding: 20px 24px;
  521. color: #404a63;
  522. font-size: 14px;
  523. .container-header {
  524. display: flex;
  525. .battery {
  526. width: 112px;
  527. height: 32px;
  528. background: #1C263A;
  529. color: #DEEFF9;
  530. line-height: 32px;
  531. text-align: center;
  532. margin-bottom: 10px;
  533. }
  534. .a-gun {
  535. width: 78px;
  536. margin-left: 12px;
  537. }
  538. .b-gun {
  539. width: 78px;
  540. margin-left: 12px;
  541. }
  542. .showCodeActive {
  543. background-color: #636C97;
  544. }
  545. }
  546. .topBox{
  547. height: 688rpx;
  548. }
  549. .container-code {
  550. display: flex;
  551. margin-bottom: 10px;
  552. justify-content: space-between;
  553. .container-code-one {
  554. font-size: 16px;
  555. color: #91FDB9;
  556. }
  557. .success {
  558. color: #92fdb9;
  559. }
  560. .warning {
  561. color: #ff4d4f;
  562. }
  563. .container-code-two {
  564. display: flex;
  565. image {
  566. width: 60px;
  567. height: 24px;
  568. }
  569. image:first-child {
  570. margin-right: 20px;
  571. }
  572. }
  573. }
  574. .battery-info {
  575. display: flex;
  576. margin-top: 16px;
  577. justify-content: space-between;
  578. flex-wrap: wrap;
  579. margin-bottom: 20px;
  580. min-height: 116px;
  581. .vim {
  582. width: 100%;
  583. margin: 0px 0px 12px 0px;
  584. text {
  585. font-size: 14px;
  586. color: #414A63;
  587. }
  588. text:last-child {
  589. display: inline-block;
  590. margin-left: 10px;
  591. font-weight: 600;
  592. color: #fff;
  593. }
  594. }
  595. .info-right {
  596. width: 46%;
  597. height: 32px;
  598. line-height: 30px;
  599. text-align: center;
  600. font-size: 14px;
  601. font-weight: 500;
  602. color: white;
  603. background-color: #0e1f31;
  604. border: #1b71a4 solid 1px;
  605. .s1 {
  606. vertical-align: middle;
  607. width: 18px;
  608. height: 18px;
  609. }
  610. }
  611. .info-warning {
  612. width: 46%;
  613. background-color: #201823;
  614. border: #834246 solid 1px;
  615. height: 34px;
  616. line-height: 32px;
  617. text-align: center;
  618. font-size: 14px;
  619. font-weight: 500;
  620. color: white;
  621. // img{
  622. // vertical-align: middle;
  623. // }
  624. }
  625. }
  626. .battery-charger {
  627. width: 100%;
  628. min-height: 228px;
  629. .nodata {
  630. position: relative;
  631. left: calc(50% - 33px);
  632. margin-top: 6vh;
  633. width: 66px;
  634. height: 66px;
  635. }
  636. }
  637. }
  638. .battery-charger-btn {
  639. display: flex;
  640. position: absolute;
  641. bottom: 20px;
  642. .Plug-gun-charging {
  643. width: 135px;
  644. height: 32px;
  645. background: #69B889;
  646. text-align: center;
  647. line-height: 32px;
  648. font-size: 16px;
  649. font-family: PingFang SC-Medium, PingFang SC;
  650. font-weight: 500;
  651. color: #DEEFF9;
  652. }
  653. .Settings {
  654. background: #636C97;
  655. margin-left: 20px;
  656. }
  657. .disabled{
  658. background: #606266;
  659. margin-left: 20px;
  660. }
  661. }
  662. }
  663. </style>