batteryDrawe.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="">
  3. <view class="drawerBox">
  4. <view class="top">
  5. <view class="title">充电设置</view>
  6. <view class="handler">
  7. <view class="cancel" @click="close">取消</view>
  8. <view class="save" @click="SubmitPublic">保存</view>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="main_drawe">
  13. <uni-forms :modelValue="fromData">
  14. <uni-forms-item label="当前充电:" name="name" label-align="right" label-width="120px">
  15. <uni-easyinput type="text" v-model="fromData.comState== 0 ?'插枪充电':'线束充电'" placeholder="请输入"
  16. disabled />
  17. </uni-forms-item>
  18. <uni-forms-item label="枪号:" name="arr" label-width="120px" label-align="right">
  19. <uni-data-select v-model="fromData.Guncall" :localdata="fromData.arr" @change="changegun">
  20. </uni-data-select>
  21. </uni-forms-item>
  22. <uni-forms-item label="按类型设置:" name="arrType" label-width="120px" label-align="right">
  23. <uni-data-select v-model="fromData.setType" :localdata="fromData.arrType" @change="changeId">
  24. </uni-data-select>
  25. </uni-forms-item>
  26. <uni-forms-item label="充电功率:" name="name" label-align="right" label-width="120px" v-if="fromData.setType !=0">
  27. <uni-easyinput type="number" v-model="fromData.powerNum" placeholder="请输入" maxlength="4"/>
  28. <view class="kwh">
  29. {{fromData.setType == 2 ?'%': fromData.setType == 3 ?'A':'kWh'}}
  30. </view>
  31. </uni-forms-item>
  32. </uni-forms>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. props: ['infodata'],
  39. data() {
  40. return {
  41. fromData: {
  42. arr: [{
  43. text: 'A枪',
  44. value: '0'
  45. }, {
  46. text: 'B枪',
  47. value: '1'
  48. }],
  49. arrType: [{
  50. text: '桩自主控制功率',
  51. value: '0'
  52. },
  53. {
  54. text: '功率值',
  55. value: '1'
  56. },
  57. {
  58. text: '功率百分比',
  59. value: '2'
  60. }, {
  61. text: '输出电流',
  62. value: '3'
  63. }
  64. ],
  65. gunNo: '',
  66. comState: 1, //充电类型
  67. Guncall: '',
  68. setType: '',
  69. cangnum:0,//仓号
  70. powerNum:'',
  71. },
  72. }
  73. },
  74. methods: {
  75. //下拉事件
  76. changeId() {
  77. console.log(123)
  78. },
  79. //下拉事件
  80. changegun() {
  81. },
  82. //取消
  83. close() {
  84. this.$emit('closeDrawer')
  85. },
  86. // 保存
  87. SubmitPublic() {
  88. this.$emit('save',this.fromData)
  89. }
  90. },
  91. mounted() {
  92. this.fromData.comState = this.infodata.chgType
  93. if(this.fromData.comState == 0){ //0是插枪充电 1是线束充电
  94. this.fromData.arr = [ {text: "A枪",value: "0",},{text: "B枪",value: "1",}]
  95. }else{
  96. this.fromData.arr = [ {text: "A枪",value: "0",}]
  97. }
  98. this.fromData.cangnum = this.infodata.chargerInfoVo.chargerCode
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. ::v-deep .uni-forms-item__content {
  104. background: rgba(255, 255, 255, 0);
  105. border-radius: 2px 2px 2px 2px;
  106. border: 1px solid #263042;
  107. .uni-easyinput__content {
  108. background: none !important;
  109. border: none !important;
  110. color: #fff;
  111. }
  112. }
  113. .kwh {
  114. width: 50px;
  115. height: 35px;
  116. background: #263042;
  117. font-size: 14px;
  118. font-weight: 400;
  119. color: #4C5D71;
  120. line-height: 35px;
  121. position: absolute;
  122. right: 0;
  123. top: 0px;
  124. text-align: center;
  125. }
  126. ::v-deep .uni-select__selector {
  127. background: #111827;
  128. border: 1px solid #263042;
  129. color: #606266;
  130. z-index: 9999999;
  131. }
  132. ::v-deep .uni-select {
  133. border: none;
  134. }
  135. ::v-deep .uni-popper__arrow::after {
  136. display: none;
  137. }
  138. ::v-deep .uni-popper__arrow {
  139. display: none;
  140. }
  141. ::v-deep .uni-select__input-text {
  142. color: #fff;
  143. }
  144. .main_drawe {
  145. padding: 20px;
  146. margin-top: 80px;
  147. }
  148. .drawerBox {
  149. display: flex;
  150. flex-direction: column;
  151. height: 100%;
  152. .top {
  153. width: 100%;
  154. height: 74px;
  155. line-height: 54px;
  156. border-bottom: 1px solid rgba(65, 74, 99, 0.5);
  157. box-sizing: border-box;
  158. z-index: 999;
  159. padding: 0px 20px;
  160. display: flex;
  161. padding-top: 20px;
  162. background-color: #141A25;
  163. position: fixed;
  164. top: 0;
  165. .title {
  166. min-width: 74px;
  167. white-space: nowrap;
  168. font-size: 16px;
  169. font-weight: 500;
  170. color: #FFFFFF;
  171. position: relative;
  172. }
  173. .title::before {
  174. content: '';
  175. width: 100%;
  176. position: absolute;
  177. height: 2px;
  178. background: #FFFFFF;
  179. box-shadow: 0px 0px 6px 0px rgba(255, 255, 255, 0.8);
  180. bottom: -1px;
  181. }
  182. .close {
  183. width: 24px;
  184. height: 24px;
  185. color: #FFFFFF;
  186. margin-left: auto;
  187. font-size: 14px;
  188. text-align: center;
  189. vertical-align: middle;
  190. }
  191. .handler {
  192. display: flex;
  193. margin-left: auto;
  194. height: 54px;
  195. align-items: center;
  196. .cancel {
  197. width: 60px;
  198. height: 54px;
  199. border-radius: 2px;
  200. border: 1px solid #263042;
  201. font-size: 14px;
  202. font-weight: 400;
  203. color: #FFFFFF;
  204. text-align: center;
  205. line-height: 54px;
  206. }
  207. .save {
  208. width: 60px;
  209. height: 54px;
  210. background: #91FDB9;
  211. border-radius: 2px;
  212. text-align: center;
  213. line-height: 54px;
  214. font-size: 14px;
  215. font-weight: 400;
  216. color: black;
  217. }
  218. }
  219. }
  220. }
  221. </style>