manual.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="main_manual">
  3. <SubTitle title="储充信息 8" titleEng="Storage and charging information"></SubTitle>
  4. <view class="header_title">
  5. <image class="header_title_img" src="../../../static/equipment/tip.png" mode=""></image>
  6. 仓位上方是电池,下方是充电机,点击仓位可查看充电详情信息
  7. </view>
  8. <view class="box_swiper">
  9. <scroll-view scroll-x="true" class="scroll_x">
  10. <view v-for="(item, index) in storeInfoLists" :key="index">
  11. <!-- @click="drawer(item,index)"-->
  12. <StorageInfo :store-code="item.storeCode" :com-state="item.comState" :sn="item.sn" :soc="item.soc"
  13. @drawer="drawer(item,index)" :chg-estimated-time="item.chargerInfoVo.chgEstimatedTime"
  14. :current="item.current" :voltage="item.voltage" :min-temperature="item.minTemperature"
  15. :max-temperature="item.maxTemperature" :max-cell-voltage="item.maxCellVoltage" index
  16. :min-cell-voltage="item.minCellVoltage" :soh="item.soh" :store-state="item.storeState"
  17. :charger-info-vo="item.chargerInfoVo" :class="box_num == index ? 'slect_box':''"
  18. :chgType='item.chgType' />
  19. </view>
  20. </scroll-view>
  21. <!--右侧抽屉 -->
  22. <uni-drawer ref="showRight" mode="right" :width="400" :mask-click="true" @change='changemask'>
  23. <scroll-view style="height: 100%;" scroll-y="true">
  24. <batteryDrawe :infodata="infodata" @closeDrawer="closeDrawer" @save='save'></batteryDrawe>
  25. </PublicDrawer>
  26. </scroll-view>
  27. </uni-drawer>
  28. <!-- 右侧抽屉结束 -->
  29. <!-- 顶部公共提示信息 -->
  30. <uni-popup ref="Exchangepopup" type="message">
  31. <uni-popup-message :type="popupType" :message="popupMessage" :duration="2000"></uni-popup-message>
  32. </uni-popup>
  33. <!-- 顶部提示信息结束-->
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import SubTitle from "../../../components/SubTitle/SubTitle.vue"
  39. import StorageInfo from "../components/StorageInfo.vue"
  40. import batteryDrawe from "../components/batteryDrawe.vue"
  41. import chargerDrawe from "../components/chargerDrawe.vue"
  42. name: 'manual'
  43. export default {
  44. components: {
  45. SubTitle,
  46. StorageInfo,
  47. batteryDrawe,
  48. chargerDrawe
  49. },
  50. props: ['storeInfoLists'],
  51. data() {
  52. return {
  53. popupMessage: '成功消息',
  54. popupType: 'success',
  55. isSlecte: true,
  56. box_num: -1, //记录选中了第几个
  57. name: 'batteryDrawe',
  58. props: ['infodata'],
  59. batteryInfoActive: 1, //0代表电池1代表充电机
  60. infodata: {}, //详情数据
  61. }
  62. },
  63. mounted() {
  64. // console.log(this.storeInfoLists,'storeInfoLists999999999999')
  65. },
  66. methods: {
  67. //抽屉
  68. drawer(item, index) {
  69. this.box_num = index;
  70. this.$refs.showRight.open();
  71. this.infodata = item;
  72. console.log(item, index, 'item')
  73. },
  74. //关闭抽屉
  75. closeDrawer() {
  76. this.batteryInfoActive = 1;
  77. this.box_num = -1;
  78. this.$refs.showRight.close();
  79. },
  80. //抽屉改变事件
  81. changemask(e) {
  82. if (!e) {
  83. this.closeDrawer()
  84. }
  85. },
  86. //顶部公共消息提示
  87. ExchangeMessage(type, message) {
  88. this.popupType = type
  89. this.popupMessage = message ? message : '后端接口404错误!'
  90. this.$refs.Exchangepopup.open()
  91. },
  92. //抽屉保存修改
  93. save(datas) {
  94. console.log(datas, 'e')
  95. let data = {
  96. chargerId: datas.cangnum,
  97. gunNo: datas.Guncall,
  98. powerNum: datas.powerNum,
  99. powerType: datas.setType
  100. }
  101. if(data.gunNo=='' || data.powerNum=='' || data.powerNum=='' ){
  102. this.ExchangeMessage('warn','请填写完整')
  103. }else{
  104. this.$http.getlimitPower(data).then(res => {
  105. this.ExchangeMessage(res.code === 0 ? 'success' : 'error',
  106. res.code === 0 ? '设置功率下发成功!' : '设置功率下发失败!')
  107. this.$refs.showRight.close();
  108. })
  109. }
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .main_manual {
  116. position: relative;
  117. .header_title {
  118. position: absolute;
  119. font-size: 12px;
  120. font-family: PingFang SC-Regular, PingFang SC;
  121. font-weight: 400;
  122. color: #414A63;
  123. right: 10px;
  124. top: 5px;
  125. .header_title_img {
  126. width: 14px;
  127. height: 14px;
  128. vertical-align: middle;
  129. margin-right: 5px;
  130. margin-top: -2px;
  131. }
  132. }
  133. .box_swiper {
  134. width: 1000px;
  135. height: 600px;
  136. background: #111827;
  137. padding: 20px;
  138. .scroll_x {
  139. width: 100%;
  140. height: 100%;
  141. // border: 1px solid red;
  142. /deep/ .uni-scroll-view-content {
  143. display: flex;
  144. view:last-child {
  145. .storage-item {
  146. margin-right: 0px;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. }
  153. .slect_box {
  154. border: 1px solid #338150 !important;
  155. }
  156. .header_drawer_btn {
  157. display: flex;
  158. font-size: 14px;
  159. font-family: PingFang SC-Regular, PingFang SC;
  160. font-weight: 400;
  161. color: #FFFFFF;
  162. .header_drawer_btn_left {
  163. width: 60px;
  164. height: 32px;
  165. background: #263042;
  166. border-radius: 2px 0px 0px 2px;
  167. line-height: 32px;
  168. text-align: center;
  169. }
  170. .header_drawer_btn_right {
  171. line-height: 32px;
  172. text-align: center;
  173. width: 74px;
  174. height: 32px;
  175. background: #263042;
  176. border-radius: 0px 2px 2px 0px;
  177. }
  178. .active {
  179. color: black;
  180. background: #91FDB9;
  181. }
  182. }
  183. .drawer_main {
  184. // border: 1px solid red;
  185. padding-top: 20px;
  186. }
  187. </style>