Просмотр исходного кода

Add Install Certificate function in CSMS ocpp operator menu
https://dev.wormwood.com.sg/zentao/task-view-760.html

wudebin 11 месяцев назад
Родитель
Сommit
1451e734a3

+ 43 - 1
Strides-Admin/src/views/ocpp/OCPPOperations.vue

@@ -324,6 +324,31 @@
               class="flex-item"/>
           </el-form-item>
         </template>
+        <template v-if="operationInfo.value == 'ICA'">
+          <el-form-item
+            label="Certificate Type:"
+            prop="certificateType"
+            v-if="paramsOption.certificateTypeOption">
+            <el-select
+              v-model="operationForm.certificateType"
+              class="flex-item">
+              <el-option
+                v-for="(item, index) in paramsOption.certificateTypeOption"
+                :key="index"
+                :label="item"
+                :value="item"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="Certificate:"
+            prop="certificate">
+            <el-input
+              v-model="operationForm.certificate"
+              class="flex-item"
+              type="textarea"
+              :autosize="autosize"/>
+          </el-form-item>
+        </template>
         <div class="perform">
           <el-button
             style="margin-left: 15px;"
@@ -390,7 +415,9 @@
           transactionId: '',
           customConfKey: '',
           chargingProfilePk: '',
-          chargingProfilePurpose: undefined
+          chargingProfilePurpose: undefined,
+          certificateType: '',
+          certificate: ''
         },
         paramsOption: {
           idTags: [],
@@ -409,6 +436,7 @@
           needChargingProfile: false,
           chargingProfileOption: [],
           chargingPurposeOption: [],
+          certificateTypeOption: [],
           needChargingProfilePurpose: false
         },
         rule: {
@@ -477,6 +505,16 @@
             trigger: 'change',
             message: 'Please select Charging Profile Purpose'
           },
+          certificateType: {
+            required: true,
+            trigger: 'change',
+            message: 'Please select certificate type'
+          },
+          certificate: {
+            required: true,
+            trigger: 'blur',
+            message: 'Please input certificate'
+          },
           location: {
             required: true,
             trigger: 'blur',
@@ -503,6 +541,10 @@
           action: true,
           width: 70
         }],
+        autosize: {
+          minRows: 5,
+          maxRows: 10
+        },
         searchTag: ""
       }
     },

+ 8 - 0
Strides-Admin/src/views/ocpp/operationUtil.js

@@ -21,6 +21,7 @@ const operation = {
         needChargingProfile: false,
         chargingProfileOption: [],
         chargingPurposeOption: [],
+        certificateTypeOption: [],
         needChargingProfilePurpose: false
       }
       switch (operation.value) {
@@ -127,6 +128,13 @@ const operation = {
           }
           break;
         }
+        case 'ICA': {//Install Certificate
+          let res = await ocpp.getCertificateTypeList()
+          if (res.success) {
+            result.certificateTypeOption = res.data
+          }
+          break;
+        }
       }
       /*if (result.needConnector && checkedList && checkedList.length > 0) {
         let ress = await ocpp.getConnectorIds(checkedList[0].stationId);