StorageInfo.vue 24 KB

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