manual.vue 5.8 KB

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