batteryDrawe.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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. <view class="chargeAway">充电方式【{{fromData.chargerAway}}】</view>
  15. <view class="chargeCont">
  16. <view class="gunleft" v-if="infodata.showCode==2 && infodata.chgType==1">
  17. <view class="gun">B</view>
  18. <view class="power">
  19. <view>{{$checks.powerFitler(fromData.powerObj.powerType)}}</view>
  20. <view>{{fromData.powerObj.power?fromData.powerObj.power+'kW':'—'}}</view>
  21. </view>
  22. </view>
  23. <view class="gunleft" v-else>
  24. <view class="gun">A</view>
  25. <view class="power">
  26. <view>{{$checks.powerFitler(fromData.powerObj.powerType)}}</view>
  27. <view>{{fromData.powerObj.power?fromData.powerObj.power+'kW':'—'}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="chargeAway">设置</view>
  32. <!-- <uni-forms-item label="当前充电:" name="name" label-align="right" label-width="120px">
  33. <uni-easyinput type="text" v-model="fromData.comState== 0 ?'线束充电':'插枪充电'"
  34. placeholder="请输入" disabled />
  35. </uni-forms-item> -->
  36. <uni-forms-item label="枪号:" name="arr" label-width="66px" label-align="right">
  37. <uni-data-select v-model="fromData.Guncall" :localdata="fromData.arr"
  38. @change="changegun">
  39. </uni-data-select>
  40. </uni-forms-item>
  41. <uni-forms-item label="类型:" name="arrType" label-width="66px" label-align="right">
  42. <uni-data-select v-model="fromData.setType" :localdata="fromData.arrType"
  43. @change="changeId">
  44. </uni-data-select>
  45. </uni-forms-item>
  46. <uni-forms-item label="功率:" name="name" label-align="right" label-width="66px" v-if="fromData.setType !=0">
  47. <uni-easyinput type="number" v-model="fromData.powerNum" placeholder="请输入"
  48. maxlength="4" />
  49. <view class="kwh">
  50. {{fromData.setType == 2 ?'%': fromData.setType == 3 ?'A':'kW'}}
  51. </view>
  52. </uni-forms-item>
  53. </uni-forms>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. props: ['infodata'],
  60. data() {
  61. return {
  62. fromData: {
  63. arr: [],
  64. arrType: [{
  65. text: '桩自主控制功率',
  66. value: '0'
  67. },
  68. {
  69. text: '功率值',
  70. value: '1'
  71. },
  72. // {
  73. // text: '功率百分比',
  74. // value: '2'
  75. // }, {
  76. // text: '输出电流',
  77. // value: '3'
  78. // }
  79. ],
  80. gunNo: '',
  81. comState: 1, //充电类型
  82. Guncall: '',
  83. setType: '',
  84. cangnum: 0, //仓号
  85. powerNum: '',
  86. powerObj: {
  87. type: null,
  88. power: null,
  89. powerType: null
  90. }, //充电设置功率
  91. chargerAway:null,
  92. },
  93. }
  94. },
  95. methods: {
  96. //获取充个设置数据
  97. getChargePower(){
  98. let type=null
  99. if(this.infodata.chgType==0){
  100. type=1
  101. }else{
  102. if(this.infodata.showCode==1){
  103. type=3
  104. }else{
  105. type=4
  106. }
  107. }
  108. this.$http.getChargePower({chargerId:this.infodata.chargerInfoVo.chargerCode,type}).then(res=>{
  109. if(res.code===0){
  110. this.fromData.powerObj=res.data
  111. }
  112. })
  113. },
  114. //下拉事件
  115. changeId() {
  116. },
  117. //下拉事件
  118. changegun() {
  119. },
  120. //取消
  121. close() {
  122. this.$emit('closeDrawer')
  123. },
  124. // 保存
  125. SubmitPublic() {
  126. this.$emit('save', this.fromData)
  127. }
  128. },
  129. mounted() {
  130. this.getChargePower()
  131. this.fromData.comState = this.infodata.chgType
  132. if (this.fromData.comState == 1) { //1是插枪充电 0是线束充电
  133. this.fromData.chargerAway='插枪充电'
  134. if(this.infodata.showCode==1){
  135. this.fromData.arr = [{
  136. text: "A枪",
  137. value: "0",
  138. }]
  139. }else{
  140. this.fromData.arr = [{
  141. text: "B枪",
  142. value: "1",
  143. }]
  144. }
  145. } else {
  146. this.fromData.chargerAway='线束充电'
  147. this.fromData.arr = [{
  148. text: "A枪",
  149. value: "0",
  150. }]
  151. }
  152. this.fromData.cangnum = this.infodata.chargerInfoVo.chargerCode
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. ::v-deep .uni-forms-item__content {
  158. background: rgba(255, 255, 255, 0);
  159. border-radius: 2px 2px 2px 2px;
  160. border: 1px solid #263042;
  161. .uni-easyinput__content {
  162. background: none !important;
  163. border: none !important;
  164. color: #fff;
  165. }
  166. }
  167. .chargeAway{
  168. background-color: #1c263a;
  169. width: 100%;
  170. height: 34px;
  171. line-height: 34px;
  172. color: white;
  173. font-weight: 600;
  174. font-size: 15px;
  175. text-indent: 15px;
  176. margin-bottom: 26px;
  177. }
  178. .chargeCont{
  179. display: flex;
  180. margin-left: 15px;
  181. margin-bottom: 26px;
  182. .gunleft{
  183. display: flex;
  184. width: 50%;
  185. .gun{
  186. width: 56px;
  187. height: 56px;
  188. line-height: 56px;
  189. text-align: center;
  190. border: #1c263a solid 1px;
  191. color: white;
  192. font-size: 24px;
  193. font-weight: 600;
  194. }
  195. .power{
  196. display: flex;
  197. flex-direction: column;
  198. color: white;
  199. font-size: 16px;
  200. padding-left: 18px;
  201. justify-content: space-around;
  202. }
  203. }
  204. }
  205. .kwh {
  206. width: 50px;
  207. height: 35px;
  208. background: #263042;
  209. font-size: 14px;
  210. font-weight: 400;
  211. color: #4C5D71;
  212. line-height: 35px;
  213. position: absolute;
  214. right: 0;
  215. top: 0px;
  216. text-align: center;
  217. }
  218. ::v-deep .uni-select__selector {
  219. background: #111827;
  220. border: 1px solid #263042;
  221. color: white;
  222. z-index: 9999999;
  223. }
  224. ::v-deep .uni-select {
  225. border: none;
  226. }
  227. ::v-deep .uni-popper__arrow::after {
  228. display: none;
  229. }
  230. ::v-deep .uni-popper__arrow {
  231. display: none;
  232. }
  233. ::v-deep .uni-select__input-text {
  234. color: #fff;
  235. }
  236. ::v-deep .uni-forms-item__label{
  237. color: white;
  238. font-weight: bold;
  239. }
  240. .main_drawe {
  241. padding: 20px;
  242. margin-top: 80px;
  243. }
  244. .drawerBox {
  245. display: flex;
  246. flex-direction: column;
  247. height: 100%;
  248. .top {
  249. width: 100%;
  250. height: 74px;
  251. line-height: 54px;
  252. border-bottom: 1px solid rgba(65, 74, 99, 0.5);
  253. box-sizing: border-box;
  254. z-index: 999;
  255. padding: 0px 20px;
  256. display: flex;
  257. padding-top: 20px;
  258. background-color: #141A25;
  259. position: fixed;
  260. top: 0;
  261. .title {
  262. min-width: 74px;
  263. white-space: nowrap;
  264. font-size: 16px;
  265. font-weight: 500;
  266. color: #FFFFFF;
  267. position: relative;
  268. }
  269. .title::before {
  270. content: '';
  271. width: 100%;
  272. position: absolute;
  273. height: 2px;
  274. background: #FFFFFF;
  275. box-shadow: 0px 0px 6px 0px rgba(255, 255, 255, 0.8);
  276. bottom: -1px;
  277. }
  278. .close {
  279. width: 24px;
  280. height: 24px;
  281. color: #FFFFFF;
  282. margin-left: auto;
  283. font-size: 14px;
  284. text-align: center;
  285. vertical-align: middle;
  286. }
  287. .handler {
  288. display: flex;
  289. margin-left: auto;
  290. height: 54px;
  291. align-items: center;
  292. .cancel {
  293. width: 60px;
  294. height: 54px;
  295. border-radius: 2px;
  296. border: 1px solid #263042;
  297. font-size: 14px;
  298. font-weight: 400;
  299. color: #FFFFFF;
  300. text-align: center;
  301. line-height: 54px;
  302. }
  303. .save {
  304. width: 60px;
  305. height: 54px;
  306. background: #91FDB9;
  307. border-radius: 2px;
  308. text-align: center;
  309. line-height: 54px;
  310. font-size: 14px;
  311. font-weight: 400;
  312. color: black;
  313. }
  314. }
  315. }
  316. }
  317. </style>