vbea 3 years ago
parent
commit
48f5f9b6bd

+ 1 - 1
Strides-APP/android/app/build.gradle

@@ -3,7 +3,7 @@ apply plugin: 'com.google.gms.google-services'
 
 
 import com.android.build.OutputFile
 import com.android.build.OutputFile
 
 
-def myVersionName = "0.2.0 Alpha" //★★★★★版本号★★★★★
+def myVersionName = "0.3.1 Alpha" //★★★★★版本号★★★★★
 /**
 /**
  * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  * and bundleReleaseJsAndAssets).
  * and bundleReleaseJsAndAssets).

+ 2 - 2
Strides-APP/android/app/version.properties

@@ -1,2 +1,2 @@
-#Tue Dec 27 17:46:25 CST 2022
-VERSION_CODE=63
+#Tue Dec 27 18:13:18 CST 2022
+VERSION_CODE=65

+ 2 - 2
Strides-APP/app.json

@@ -2,7 +2,7 @@
   "name": "JuicePlus",
   "name": "JuicePlus",
   "displayName": "ChargEco",
   "displayName": "ChargEco",
   "versionCode": 60,
   "versionCode": 60,
-  "versionName": "V0.2.0 Alpha",
+  "versionName": "V0.3.1 Alpha",
   "product": false,
   "product": false,
-  "debug": true
+  "debug": false
 }
 }

+ 6 - 3
Strides-APP/app/pages/home/Home.js

@@ -204,6 +204,11 @@ export default class HomePage extends Component {
     this.getStationList();
     this.getStationList();
   }
   }
 
 
+  /**
+   * 获取所有充电桩
+   * @param {Location} region 当前位置
+   * @param {boolean} first 是否初始化
+   */
   getStationList(region, first) {
   getStationList(region, first) {
     Dialog.showProgressDialog('Loading...');
     Dialog.showProgressDialog('Loading...');
     apiStation.getAllStation(this.filter).then(res => {
     apiStation.getAllStation(this.filter).then(res => {
@@ -223,9 +228,7 @@ export default class HomePage extends Component {
             siteType: item.siteType,
             siteType: item.siteType,
             latitude: item.locationLatitude,
             latitude: item.locationLatitude,
             longitude: item.locationLongitude,
             longitude: item.locationLongitude,
-            /*latitude: item.locationLatitude,
-            longitude: item.locationLongitude,
-            acConnector: item.acConnector,
+            /*acConnector: item.acConnector,
             allConnector: item.allConnector,
             allConnector: item.allConnector,
             dcConnector: item.dcConnector,
             dcConnector: item.dcConnector,
             distance: utils.getDistance(item.distance)*/
             distance: utils.getDistance(item.distance)*/

+ 6 - 0
Strides-Admin/src/http/api/site.js

@@ -45,6 +45,12 @@ const site = {
   getChargingProfiles() {
   getChargingProfiles() {
     return get(MODULE_NAME+ '/getChargingProfiles')
     return get(MODULE_NAME+ '/getChargingProfiles')
   },
   },
+  getBalancingChargingProfiles(params) {
+    return get(MODULE_NAME+ '/getLoadBalancingChargingProfiles', params)
+  },
+  getBalancingOptions() {
+    return get(MODULE_NAME+ '/getLoadBalancingList')
+  },
   deleteChargingProfile(id) {
   deleteChargingProfile(id) {
     return get(MODULE_NAME+ '/delSiteChargingProfile', {siteChargingProfileId: id})
     return get(MODULE_NAME+ '/delSiteChargingProfile', {siteChargingProfileId: id})
   }
   }

+ 7 - 2
Strides-Admin/src/views/dashboard/Dashboard.vue

@@ -51,6 +51,10 @@
               <span>Unavailable</span>
               <span>Unavailable</span>
               <label>{{stationsData.unAvailable ? stationsData.unAvailable : 0}}</label>
               <label>{{stationsData.unAvailable ? stationsData.unAvailable : 0}}</label>
             </div>
             </div>
+            <div class="total-list-item mini">
+              <span>Finishing</span>
+              <label>{{stationsData.finishing ? stationsData.finishing : 0}}</label>
+            </div>
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
@@ -384,7 +388,7 @@
     content: " ";
     content: " ";
     border-radius: 10px;
     border-radius: 10px;
     position: absolute;
     position: absolute;
-    background-image: linear-gradient(to right, #001489, #FFFAE8);
+    background-image: linear-gradient(to right, #F3B901, #FFFAE8);
   }
   }
   .total-power {
   .total-power {
     color: #3179E4;
     color: #3179E4;
@@ -406,7 +410,7 @@
   .total-list-item {
   .total-list-item {
     display: flex;
     display: flex;
     padding: 6px;
     padding: 6px;
-    line-height: 21px;
+    line-height: 22px;
     align-items: center;
     align-items: center;
     justify-content: space-between;
     justify-content: space-between;
   }
   }
@@ -422,6 +426,7 @@
     font-size: 15px;
     font-size: 15px;
   }
   }
   .total-list-item.mini {
   .total-list-item.mini {
+    padding: 4px 6px;
     line-height: 14px;
     line-height: 14px;
   }
   }
   .total-list-item.mini span {
   .total-list-item.mini span {

+ 23 - 38
Strides-Admin/src/views/site/AddSite.vue

@@ -390,21 +390,18 @@
         <div class="section-title">
         <div class="section-title">
           LOAD BALANCING
           LOAD BALANCING
         </div>
         </div>
-        <el-row
+        <Balancing v-model="balancingForm"/>
+        <!-- <el-row
           :gutter="20"
           :gutter="20"
-          v-for="(item, index) in siteForm.siteChargingProfiles"
-          :key="index"
-        >
+          v-for="(item, index) in balancingForm.siteChargingProfiles"
+          :key="index">
           <el-col :span="6" :offset="0">
           <el-col :span="6" :offset="0">
             <el-form-item
             <el-form-item
               label="Chargers In-Use:"
               label="Chargers In-Use:"
               label-width="150px">
               label-width="150px">
-              <!--:prop="'siteChargingProfiles.' + index + '.boxInUse'"
-              :rules="rules.siteChargingProfiles.boxInUse"
-            -->
               <el-select v-model="item.boxInUse">
               <el-select v-model="item.boxInUse">
                 <el-option
                 <el-option
-                  v-for="(item,index) in boxUseOptions"
+                  v-for="(item,index) in [1,2]"
                   :key="index"
                   :key="index"
                   :label="item"
                   :label="item"
                   :value="item"
                   :value="item"
@@ -416,9 +413,6 @@
             <el-form-item
             <el-form-item
               label="Charging Profile:"
               label="Charging Profile:"
               label-width="150px">
               label-width="150px">
-              <!--:prop="'siteChargingProfiles.' + index + '.chargingProfilePk'"
-              :rules="rules.siteChargingProfiles.chargingProfilePk"
-            -->
               <el-select v-model="item.chargingProfilePk" filterable>
               <el-select v-model="item.chargingProfilePk" filterable>
                 <el-option
                 <el-option
                   v-for="(item,index) in chargingProfileOPtions"
                   v-for="(item,index) in chargingProfileOPtions"
@@ -436,13 +430,13 @@
               src="../../assets/form-list-sub.png"
               src="../../assets/form-list-sub.png"
             />
             />
             <img
             <img
-              v-if="siteForm.siteChargingProfiles.length - 1 === index"
+              v-if="balancingForm.siteChargingProfiles.length - 1 === index"
               class="list-item-icon"
               class="list-item-icon"
               @click="handleAddSiteChargingProfiles"
               @click="handleAddSiteChargingProfiles"
               src="../../assets/form-list-add.png"
               src="../../assets/form-list-add.png"
             />
             />
           </el-col>
           </el-col>
-        </el-row>
+        </el-row> -->
       </div>
       </div>
       <div v-if="enableFleetWhiteList()">
       <div v-if="enableFleetWhiteList()">
         <div class="sparator"></div>
         <div class="sparator"></div>
@@ -605,6 +599,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+import Balancing from './components/Balancing'
 import Reservation from './components/Reservation'
 import Reservation from './components/Reservation'
 import waves from '@/directive/waves' // waves directive
 import waves from '@/directive/waves' // waves directive
 import site from '../../http/api/site'
 import site from '../../http/api/site'
@@ -613,15 +608,15 @@ import { fetchFleetCompanyOptions } from '@/http/api/driver'
 export default {
 export default {
   name: 'AddSite',
   name: 'AddSite',
   directives: { waves },
   directives: { waves },
-  components: { Reservation },
+  components: { Balancing, Reservation },
   async created() {
   async created() {
     this.pageLoading = true;
     this.pageLoading = true;
     this.getChargeTypeOptions()
     this.getChargeTypeOptions()
     this.getRateTypeOptions()
     this.getRateTypeOptions()
     this.getSiteTypeOptions()
     this.getSiteTypeOptions()
     this.getCountryOptions()
     this.getCountryOptions()
-    this.getCompanyOptions()
-    await this.getChargingProfileOPtions()
+    await this.getCompanyOptions()
+    //this.getChargingProfileOPtions()
     this.pageLoading = false;
     this.pageLoading = false;
   },
   },
   data() {
   data() {
@@ -633,7 +628,7 @@ export default {
       countryOptions: [],
       countryOptions: [],
       companyOptions: [],
       companyOptions: [],
       chargingProfileOPtions: [],
       chargingProfileOPtions: [],
-      boxUseOptions: [1,2,3,4,5,6,7,8,9,10],
+      
       siteTypeTable: [{
       siteTypeTable: [{
         siteType: "",
         siteType: "",
         allDay: false,
         allDay: false,
@@ -644,7 +639,14 @@ export default {
         minRows: 3,
         minRows: 3,
         maxRows: 6,
         maxRows: 6,
       },
       },
-
+      balancingForm: {
+        loadBalancing: 'dynamic',
+        staticMaxAmpere: 0,
+        siteChargingProfiles: [{
+          boxInUse: '',
+          chargingProfilePk: ''
+        }],
+      },
       siteForm: {
       siteForm: {
         specialChargeRates: [
         specialChargeRates: [
           {
           {
@@ -654,19 +656,12 @@ export default {
             rateType: '',
             rateType: '',
           }
           }
         ],
         ],
-        siteChargingProfiles: [
-          {
-            boxInUse: '',
-            chargingProfilePk: ''
-          }
-        ],
         siteInformation: {
         siteInformation: {
           siteName: '',
           siteName: '',
           latitude: '',
           latitude: '',
           longitude: '',
           longitude: '',
           type: '',
           type: '',
         },
         },
-
         additionalInformation: {
         additionalInformation: {
           operatingHours: '',
           operatingHours: '',
           parkingFee: '',
           parkingFee: '',
@@ -896,18 +891,6 @@ export default {
         )
         )
       }
       }
     },
     },
-    handelSubSiteChargingProfiles(index) {
-      this.siteForm.siteChargingProfiles.splice(index, 1)
-      if (this.siteForm.siteChargingProfiles.length === 0) {
-        this.handleAddSiteChargingProfiles()
-      }
-    },
-    handleAddSiteChargingProfiles() {
-      this.siteForm.siteChargingProfiles.push({
-        boxInUse: '',
-        chargingProfilePk: ''
-      })
-    },
     reservationTimeLimitEnable(enable) {
     reservationTimeLimitEnable(enable) {
       this.siteForm.reservation.enable = enable
       this.siteForm.reservation.enable = enable
     },
     },
@@ -1108,7 +1091,7 @@ export default {
         })
         })
       }
       }
 
 
-      this.siteForm.siteChargingProfiles.forEach(item => {
+      this.balancingForm.siteChargingProfiles.forEach(item => {
         if (item.boxInUse && item.chargingProfilePk)
         if (item.boxInUse && item.chargingProfilePk)
           chargeProfiles.push(item)
           chargeProfiles.push(item)
       })
       })
@@ -1158,6 +1141,8 @@ export default {
         operatingHours,
         operatingHours,
         parkingFee,
         parkingFee,
         additionalNotes,
         additionalNotes,
+        loadBalancing: this.balancingForm.loadBalancing,
+        staticMaxAmpere: this.balancingForm.staticMaxAmpere,
         ...this.siteForm.idle
         ...this.siteForm.idle
       };
       };
 
 

+ 280 - 0
Strides-Admin/src/views/site/components/Balancing.vue

@@ -0,0 +1,280 @@
+<template>
+  <div class="vbe-balancing">
+    <el-row :gutter="20">
+      <el-col :sm="24">
+        <el-form-item
+          label="Load Balancing Type:"
+          label-width="160px">
+          <el-select
+            style="max-width: 150px;"
+            v-model="balancingForm.loadBalancing"
+            @change="changeBalance">
+            <el-option
+              v-for="(item,index) in balancingTypes"
+              :key="index"
+              :label="item"
+              :value="item"/>
+          </el-select>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row :gutter="20" v-if="balancingForm.loadBalancing == 'static'">
+      <el-col :sm="24">
+        <el-form-item
+          label="Max Current At Site:"
+          label-width="160px">
+          <el-input
+            style="max-width: 100px;"
+            v-model.number="balancingForm.staticMaxAmpere"
+            maxlength="5"
+            @change="changeAmpere"/>
+          <span class="text-unit">A</span>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row
+      :gutter="30"
+      v-for="(item, index) in balancingForm.siteChargingProfiles"
+      :key="index">
+      <el-col :sm="8" :md="7" :lg="6">
+        <el-form-item
+          label="Chargers In-Use:"
+          label-width="130px">
+          <el-select
+            v-model="item.boxInUse"
+            @change="changeInUse(index)">
+            <el-option
+              v-for="(item, idx) in boxUseOptions"
+              :key="idx"
+              :label="item"
+              :value="item"/>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :sm="10" :md="9" :lg="8">
+        <el-form-item
+          label="Charging Profile:"
+          label-width="130px">
+          <el-select 
+            v-model="item.chargingProfilePk"
+            v-if="balancingForm.loadBalancing == 'static'"
+            filterable
+            v-loading="balancingPrifileList[index].loading">
+            <el-option
+              v-for="(item,idx) in balancingPrifileList[index].options"
+              :key="idx"
+              :label="item.description"
+              :value="item.chargingProfilePk"/>
+          </el-select>
+          <el-select
+            v-model="item.chargingProfilePk"
+            v-else
+            filterable>
+            <el-option
+              v-for="(item,idx) in chargingProfileOptions"
+              :key="idx"
+              :label="item.description"
+              :value="item.chargingProfilePk"/>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :sm="6" :md="5" :lg="4">
+        <img
+          class="list-item-icon"
+          @click="handelSubSiteChargingProfiles(index)"
+          src="../../../assets/form-list-sub.png"/>
+        <img
+          v-if="balancingForm.siteChargingProfiles.length - 1 === index"
+          class="list-item-icon"
+          @click="handleAddSiteChargingProfiles"
+          src="../../../assets/form-list-add.png"/>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import site from '../../../http/api/site'
+export default {
+  name: "Balancing",
+  props: {
+    value: {
+      type: Object,
+      default: {
+        loadBalancing: 'dynamic',
+        staticMaxAmpere: 0,
+        siteChargingProfiles: []
+      },
+      required: true
+    }
+  },
+  model: {
+    prop: 'value',
+    event: 'change'
+  },
+  data() {
+    return {
+      balancingTypes: [],
+      boxUseOptions: [1,2,3,4,5,6,7,8,9,10],
+      chargingProfileOptions: [],
+      balancingPrifileList: [{
+        loading: false,
+        options: []
+      }],
+      balancingForm: {
+        loadBalancing: 'dynamic',
+        staticMaxAmpere: 0,
+        siteChargingProfiles: [{
+          boxInUse: '',
+          chargingProfilePk: ''
+        }]
+      },
+      oldConfig: {
+        dynamic: [],
+        static: []
+      }
+    }
+  },
+  mounted() {
+    this.balancingForm = this.value
+    this.getBalancingTypeOptions()
+    this.getChargingProfileOptions()
+  },
+  methods: {
+    onChange() {
+      //console.log(event);
+      this.$emit('change', this.balancingForm);
+    },
+    /**
+     * 切换均衡类型
+     */
+    changeBalance() {
+      let list = [];
+      if (this.balancingForm.loadBalancing == "dynamic") {
+        this.oldConfig.static = [...this.balancingForm.siteChargingProfiles];
+        list = this.oldConfig.dynamic;
+      } else {
+        this.oldConfig.dynamic = [...this.balancingForm.siteChargingProfiles];
+        list = this.oldConfig.static
+      }
+      if (list.length > 0) {
+        this.balancingForm.siteChargingProfiles = list;
+      } else {
+        this.balancingPrifileList = [];
+        this.balancingForm.staticMaxAmpere = 0;
+        this.balancingForm.siteChargingProfiles = [];
+        this.handleAddSiteChargingProfiles()
+      }
+    },
+    /**
+     * 改变最大电流输入值
+     */
+    changeAmpere() {
+      if (this.balancingForm.staticMaxAmpere == "" || typeof this.balancingForm.staticMaxAmpere == 'string') {
+        this.balancingForm.staticMaxAmpere = 0;
+      }
+      this.getAllBalancingChargingProfiles(true)
+      /*this.balancingForm.siteChargingProfiles = [];
+      this.handleAddSiteChargingProfiles()*/
+    },
+    /**
+     * 改变InUse下拉框
+     * @param {Object} index ChargeProfile项目索引
+     */
+    changeInUse(index) {
+      if (this.balancingForm.loadBalancing == 'static') {
+        this.balancingForm.siteChargingProfiles[index].chargingProfilePk = "";
+        this.getBalancingChargingProfiles(index)
+      }
+    },
+    /**
+     * 获取均衡类型选项
+     */
+    getBalancingTypeOptions() {
+      site.getBalancingOptions().then(({ data }) => {
+        this.balancingTypes = data
+      })
+    },
+    /**
+     * 获取充电配置选项
+     */
+    getChargingProfileOptions() {
+      site.getChargingProfiles().then(({ data }) => {
+        this.chargingProfileOptions = data
+      })
+    },
+    /**
+     * 遍历获取均衡充电配置选项
+     * @param {Object} clear 是否清除之前的选项
+     */
+    getAllBalancingChargingProfiles(clear) {
+      this.balancingPrifileList.forEach((item, index) => {
+        if (clear) {
+          this.balancingForm.siteChargingProfiles[index].chargingProfilePk = ""
+        }
+        if (clear || item.options.length == 0) {
+          this.getBalancingChargingProfiles(index)
+        }
+      })
+    },
+    /**
+     * 动态获取均衡充电配置选项
+     */
+    getBalancingChargingProfiles(index) {
+      if (this.balancingForm.siteChargingProfiles[index].boxInUse && this.balancingForm.staticMaxAmpere > 0) {
+        this.balancingPrifileList[index].loading = true;
+        site.getBalancingChargingProfiles({
+          inUse: this.balancingForm.siteChargingProfiles[index].boxInUse,
+          loadBalancing: this.balancingForm.loadBalancing,
+          staticMaxAmpere: this.balancingForm.staticMaxAmpere
+        }).then(({ data }) => {
+          this.balancingPrifileList[index].options = data
+        }).finally(() => {
+          this.balancingPrifileList[index].loading = false
+        })
+      }
+    },
+    handelSubSiteChargingProfiles(index) {
+      this.balancingForm.siteChargingProfiles.splice(index, 1)
+      this.balancingPrifileList.splice(index, 1)
+      if (this.balancingForm.siteChargingProfiles.length === 0) {
+        this.handleAddSiteChargingProfiles()
+      } else {
+        //this.onChange();
+      }
+    },
+    handleAddSiteChargingProfiles() {
+      this.balancingForm.siteChargingProfiles.push({
+        boxInUse: '',
+        chargingProfilePk: ''
+      })
+      if (this.balancingForm.loadBalancing == 'static') {
+        this.balancingPrifileList.push({
+          options: [],
+          loading: false
+        })
+        this.getAllBalancingChargingProfiles()
+      }
+      //this.onChange();
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+  .vbe-balancing {
+    .list-item-icon {
+      width: 30px;
+      height: 30px;
+      cursor: pointer;
+      margin: 5px 10px 22px;
+    }
+    .el-input {
+      min-width: 60px;
+    }
+    .text-unit {
+      font-size: 14px;
+      margin-left: 10px;
+    }
+  }
+</style>