|
@@ -1,15 +1,15 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="card-container">
|
|
<div class="card-container">
|
|
|
- <div class="card-content">
|
|
|
|
|
- <el-form
|
|
|
|
|
- :model="settingsForm"
|
|
|
|
|
- :rules="rule"
|
|
|
|
|
- v-loading="loading"
|
|
|
|
|
- ref="settingsForm"
|
|
|
|
|
- label-position="left"
|
|
|
|
|
- label-width="150px"
|
|
|
|
|
- style="width: 100%;">
|
|
|
|
|
- <div class="section-title">OCPP Settings</div>
|
|
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ :model="settingsForm"
|
|
|
|
|
+ :rules="rule"
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ ref="settingsForm"
|
|
|
|
|
+ label-position="left"
|
|
|
|
|
+ label-width="150px"
|
|
|
|
|
+ style="width: 100%;">
|
|
|
|
|
+ <div class="card-content">
|
|
|
|
|
+ <!-- <div class="section-title">OCPP Settings</div>
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="16" :md="12" :lg="9">
|
|
<el-col :xs="24" :sm="16" :md="12" :lg="9">
|
|
|
<div class="flexc">
|
|
<div class="flexc">
|
|
@@ -50,7 +50,7 @@
|
|
|
(i.e.no expiry date will be set).</div>
|
|
(i.e.no expiry date will be set).</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <div class="hr"></div>
|
|
|
|
|
|
|
+ <div class="hr"></div> -->
|
|
|
<div class="section-title">
|
|
<div class="section-title">
|
|
|
<span style="padding-right: 30px;">Mail Notification Settings</span>
|
|
<span style="padding-right: 30px;">Mail Notification Settings</span>
|
|
|
<el-checkbox v-model="settingsForm.enabled">Enable notifications</el-checkbox>
|
|
<el-checkbox v-model="settingsForm.enabled">Enable notifications</el-checkbox>
|
|
@@ -244,46 +244,8 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <div class="hr"></div>
|
|
|
|
|
- <div class="section-title">Charge Type Settings</div>
|
|
|
|
|
- <div class="rate-list-view" v-for="(item, index) in settingsForm.chargeTypes" :key="index">
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label="Type:"
|
|
|
|
|
- label-width="50px"
|
|
|
|
|
- :prop="'chargeTypes.'+index+'.chargeType'"
|
|
|
|
|
- :rules="rule.chargeTypes.chargeType">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="item.chargeType"
|
|
|
|
|
- class="rate-text">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="i in chargeTypeOptions"
|
|
|
|
|
- :key="i"
|
|
|
|
|
- :label="i"
|
|
|
|
|
- :value="i" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label="Wattage:"
|
|
|
|
|
- label-width="75px"
|
|
|
|
|
- :prop="'chargeTypes.'+index+'.wattage'"
|
|
|
|
|
- :rules="rule.chargeTypes.wattage">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="item.wattage"
|
|
|
|
|
- class="rate-text"
|
|
|
|
|
- maxlength="5"/>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <img
|
|
|
|
|
- class="list-item-icon"
|
|
|
|
|
- @click="subChargeType(index)"
|
|
|
|
|
- src="@/assets/form-list-sub.png"
|
|
|
|
|
- v-if="settingsForm.chargeTypes.length > 1"/>
|
|
|
|
|
- <img
|
|
|
|
|
- class="list-item-icon"
|
|
|
|
|
- @click="addChargeType"
|
|
|
|
|
- src="@/assets/form-list-add.png"
|
|
|
|
|
- v-if="index == settingsForm.chargeTypes.length - 1"/>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="hr-full"></div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-content">
|
|
|
<div class="buttons">
|
|
<div class="buttons">
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -298,8 +260,8 @@
|
|
|
Update Changes
|
|
Update Changes
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-form>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -313,14 +275,9 @@
|
|
|
settingsForm: {
|
|
settingsForm: {
|
|
|
enabled: false,
|
|
enabled: false,
|
|
|
recipients: [],
|
|
recipients: [],
|
|
|
- chargeTypes: [],
|
|
|
|
|
|
|
+ //chargeTypes: [],
|
|
|
enabledFeatures: []
|
|
enabledFeatures: []
|
|
|
},
|
|
},
|
|
|
- chargeType: {
|
|
|
|
|
- chargeType: '',
|
|
|
|
|
- chargeTypePk: '',
|
|
|
|
|
- wattage: ''
|
|
|
|
|
- },
|
|
|
|
|
rule: {
|
|
rule: {
|
|
|
"heartbeat": {
|
|
"heartbeat": {
|
|
|
required: true,
|
|
required: true,
|
|
@@ -366,22 +323,6 @@
|
|
|
pattern: /^[a-zA-Z0-9]+[\S]+@[a-zA-Z0-9_-]+[\.][\Sa-zA-Z]+$/,
|
|
pattern: /^[a-zA-Z0-9]+[\S]+@[a-zA-Z0-9_-]+[\.][\Sa-zA-Z]+$/,
|
|
|
trigger: 'blur',
|
|
trigger: 'blur',
|
|
|
message: 'Please type a correct recipient'
|
|
message: 'Please type a correct recipient'
|
|
|
- },
|
|
|
|
|
- chargeTypes: {
|
|
|
|
|
- chargeType: {
|
|
|
|
|
- required: true,
|
|
|
|
|
- trigger: 'change',
|
|
|
|
|
- message: 'Charge Type is required',
|
|
|
|
|
- },
|
|
|
|
|
- wattage: [{
|
|
|
|
|
- required: true,
|
|
|
|
|
- trigger: 'change',
|
|
|
|
|
- message: 'Wattage is required',
|
|
|
|
|
- }, {
|
|
|
|
|
- pattern: /^[1-9]+\d*.?\d*$/,
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- message: 'Please type a correct wattage'
|
|
|
|
|
- }]
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
recipient: '',
|
|
recipient: '',
|
|
@@ -396,13 +337,13 @@
|
|
|
"protocol": "",
|
|
"protocol": "",
|
|
|
"port": '',
|
|
"port": '',
|
|
|
"recipients": [],
|
|
"recipients": [],
|
|
|
- chargeTypes: [],
|
|
|
|
|
|
|
+ //chargeTypes: [],
|
|
|
"enabledFeatures": []
|
|
"enabledFeatures": []
|
|
|
},
|
|
},
|
|
|
features: [],
|
|
features: [],
|
|
|
featuresGroup: 0,
|
|
featuresGroup: 0,
|
|
|
manualValid: false,
|
|
manualValid: false,
|
|
|
- chargeTypeOptions: [],
|
|
|
|
|
|
|
+ //chargeTypeOptions: [],
|
|
|
passwordType: "password"
|
|
passwordType: "password"
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -417,7 +358,7 @@
|
|
|
this.features = res.data;
|
|
this.features = res.data;
|
|
|
this.featuresGroup = res.data.length / 2
|
|
this.featuresGroup = res.data.length / 2
|
|
|
}
|
|
}
|
|
|
- this.getChargeTypeOptions()
|
|
|
|
|
|
|
+ //this.getChargeTypeOptions()
|
|
|
this.getSettings();
|
|
this.getSettings();
|
|
|
},
|
|
},
|
|
|
async getSettings() {
|
|
async getSettings() {
|
|
@@ -425,21 +366,7 @@
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
this.settingsForm = res.data;
|
|
this.settingsForm = res.data;
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- getChargeTypeOptions() {
|
|
|
|
|
- site.getTypeList().then(res => {
|
|
|
|
|
- if (res.data) {
|
|
|
|
|
- this.chargeTypeOptions = res.data
|
|
|
|
|
- this.chargeType.chargeType = res.data[0]
|
|
|
|
|
- if (!this.settingsForm.chargeTypes) {
|
|
|
|
|
- this.settingsForm.chargeTypes = []
|
|
|
|
|
- this.addChargeType()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- }).catch(err => {
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.loading = false;
|
|
|
},
|
|
},
|
|
|
init() {
|
|
init() {
|
|
|
this.recipient = "";
|
|
this.recipient = "";
|
|
@@ -518,35 +445,6 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- deleteChargeType(id, back) {
|
|
|
|
|
- api.deleteChargeType(id).then(res => {
|
|
|
|
|
- back()
|
|
|
|
|
- }).catch(err => {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: err,
|
|
|
|
|
- type: 'error'
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- subChargeType(index) {
|
|
|
|
|
- var chargeType = this.settingsForm.chargeTypes[index]
|
|
|
|
|
- if (chargeType.chargeTypePk) {
|
|
|
|
|
- this.$confirm('Confirm delete this charge type?', 'Delete', {
|
|
|
|
|
- confirmButtonText: 'Confirm',
|
|
|
|
|
- cancelButtonText: 'Cancel',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- this.deleteChargeType(chargeType.chargeTypePk, () => {
|
|
|
|
|
- this.settingsForm.chargeTypes.splice(index, 1)
|
|
|
|
|
- })
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- this.settingsForm.chargeTypes.splice(index, 1)
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- addChargeType() {
|
|
|
|
|
- this.settingsForm.chargeTypes.push(JSON.parse(JSON.stringify(this.chargeType)))
|
|
|
|
|
- },
|
|
|
|
|
handleUpateButton() {
|
|
handleUpateButton() {
|
|
|
this.$refs['settingsForm'].validate(result => {
|
|
this.$refs['settingsForm'].validate(result => {
|
|
|
if (this.settingsForm.recipients.length == 0) {
|
|
if (this.settingsForm.recipients.length == 0) {
|
|
@@ -598,7 +496,8 @@
|
|
|
<style scoped="scoped">
|
|
<style scoped="scoped">
|
|
|
.card-content {
|
|
.card-content {
|
|
|
min-width: 500px;
|
|
min-width: 500px;
|
|
|
- padding: 15px 80px;
|
|
|
|
|
|
|
+ margin: 0 8px 16px;
|
|
|
|
|
+ padding: 15px 50px;
|
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
|
background-color: white;
|
|
background-color: white;
|
|
|
}
|
|
}
|
|
@@ -606,10 +505,10 @@
|
|
|
color: #333;
|
|
color: #333;
|
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
|
margin-bottom: 30px;
|
|
margin-bottom: 30px;
|
|
|
- font-size: 16px;
|
|
|
|
|
|
|
+ font-size: 14px;
|
|
|
user-select: none;
|
|
user-select: none;
|
|
|
line-height: 24px;
|
|
line-height: 24px;
|
|
|
- font-weight: 500;
|
|
|
|
|
|
|
+ font-weight: 700;
|
|
|
font-family: sans-serif;
|
|
font-family: sans-serif;
|
|
|
/* text-transform: uppercase; */
|
|
/* text-transform: uppercase; */
|
|
|
}
|
|
}
|
|
@@ -655,7 +554,7 @@
|
|
|
}
|
|
}
|
|
|
.buttons {
|
|
.buttons {
|
|
|
padding-top: 15px;
|
|
padding-top: 15px;
|
|
|
- padding-bottom: 30px;
|
|
|
|
|
|
|
+ padding-bottom: 15px;
|
|
|
}
|
|
}
|
|
|
.tips {
|
|
.tips {
|
|
|
color: #999;
|
|
color: #999;
|
|
@@ -704,12 +603,23 @@
|
|
|
.link-button:hover {
|
|
.link-button:hover {
|
|
|
color: #ff5500;
|
|
color: #ff5500;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @media screen and (max-width: 800px) {
|
|
|
|
|
+ .card-container {
|
|
|
|
|
+ padding: 10px 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .card-content {
|
|
|
|
|
+ min-width: auto;
|
|
|
|
|
+ padding: 15px 30px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@media screen and (max-width: 500px) {
|
|
@media screen and (max-width: 500px) {
|
|
|
.card-container {
|
|
.card-container {
|
|
|
padding: 0px;
|
|
padding: 0px;
|
|
|
}
|
|
}
|
|
|
.card-content {
|
|
.card-content {
|
|
|
- padding: 15px 40px;
|
|
|
|
|
|
|
+ padding: 15px 20px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.el-checkbox-group .el-checkbox {
|
|
.el-checkbox-group .el-checkbox {
|