batteryDrawe.vue 4.9 KB

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