|
|
@@ -150,7 +150,7 @@
|
|
|
:currency="currencyData[siteForm.address.countryCode]"/>
|
|
|
</div>
|
|
|
|
|
|
- <div class="view-content" id="idSiteTypes">
|
|
|
+ <div class="view-content" id="idSiteTypes" v-if="false">
|
|
|
<div class="section-title">Site EMAIL Configuration</div>
|
|
|
<email-recipient v-model="siteForm.emails"/>
|
|
|
</div>
|
|
|
@@ -327,7 +327,23 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
-
|
|
|
+ <div class="view-content">
|
|
|
+ <div class="section-title">SITE EMAIL CONFIGURATION</div>
|
|
|
+ <div class="flexcr">
|
|
|
+ <email-recipient v-model="siteForm.emails"/>
|
|
|
+ <div class="flex1">
|
|
|
+ <el-checkbox-group
|
|
|
+ class="features-group"
|
|
|
+ v-model="siteForm.enabledFeatures">
|
|
|
+ <template v-for="(item, index) in featuresOptions">
|
|
|
+ <el-checkbox
|
|
|
+ :key="index"
|
|
|
+ :label="item.value">{{item.name}}</el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="view-content flexcr">
|
|
|
<div class="buttons">
|
|
|
<el-button
|
|
|
@@ -370,6 +386,7 @@ import WhiteListUser from '../site/components/WhiteListUser'
|
|
|
import SiteTypeWithTime from './components/SiteTypeWithTime'
|
|
|
import waves from '@/directive/waves' // waves directive
|
|
|
import site from '../../http/api/site'
|
|
|
+import apiSet from '../../http/api/settings'
|
|
|
import { getRoleName } from '@/utils/auth'
|
|
|
export default {
|
|
|
directives: { waves },
|
|
|
@@ -389,6 +406,7 @@ export default {
|
|
|
pageLoading: false,
|
|
|
isMCSTUser: false,
|
|
|
countryOptions: [],
|
|
|
+ featuresOptions: [],
|
|
|
siteForm: {
|
|
|
sitePk: "",
|
|
|
siteName: "",
|
|
|
@@ -431,6 +449,7 @@ export default {
|
|
|
loadBalancing: "",//负载均衡
|
|
|
staticMaxAmpere: "",//负载均衡
|
|
|
siteChargingProfiles: null,//负载均衡
|
|
|
+ enabledFeatures: []
|
|
|
},
|
|
|
ratesForm: {
|
|
|
chargeRates: [{
|
|
|
@@ -545,7 +564,8 @@ export default {
|
|
|
created() {
|
|
|
this.pageLoading = true;
|
|
|
this.isMCSTUser = getRoleName() === "MCST";
|
|
|
- this.getCountryOptions()
|
|
|
+ this.getCountryOptions();
|
|
|
+ this.getFeaturesList();
|
|
|
if (this.$route.params.id) {
|
|
|
this.isEdit = true;
|
|
|
this.getSiteInfo()
|
|
|
@@ -566,6 +586,27 @@ export default {
|
|
|
})
|
|
|
this.currencyData = sign;
|
|
|
}
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error',
|
|
|
+ duration: 3000,
|
|
|
+ })
|
|
|
+ this.pageLoading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getFeaturesList() {
|
|
|
+ apiSet.getFeatures().then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ this.featuresOptions = res.data;
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error',
|
|
|
+ duration: 3000,
|
|
|
+ })
|
|
|
+ this.pageLoading = false;
|
|
|
})
|
|
|
},
|
|
|
getSiteInfo() {
|
|
|
@@ -573,6 +614,9 @@ export default {
|
|
|
sitePk: this.$route.params.id,
|
|
|
}).then(res => {
|
|
|
if (res.data) {
|
|
|
+ if (!res.data.enabledFeatures) {
|
|
|
+ res.data.enabledFeatures = []
|
|
|
+ }
|
|
|
this.siteForm = res.data;
|
|
|
this.applySiteInfo();
|
|
|
} else {
|
|
|
@@ -754,6 +798,14 @@ export default {
|
|
|
} else {
|
|
|
this.siteForm.groupWhitelist = []
|
|
|
}
|
|
|
+ if (this.siteForm.enabledFeatures.length > 0 && this.siteForm.emails.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "Please add at least one email recipients",
|
|
|
+ type: 'error',
|
|
|
+ duration: 3000,
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.pageLoading = true;
|
|
|
const params = {
|
|
|
...this.siteForm,
|
|
|
@@ -999,4 +1051,20 @@ export default {
|
|
|
position: absolute;
|
|
|
transform: scale(0.8);
|
|
|
}
|
|
|
+ .features-group {
|
|
|
+ min-width: 300px;
|
|
|
+ display: flex;
|
|
|
+ margin-left: 20px;
|
|
|
+ flex-direction: column;
|
|
|
+ ::v-deep .el-checkbox {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ }
|
|
|
+ ::v-deep .el-checkbox__label {
|
|
|
+ word-break: break-all;
|
|
|
+ white-space: normal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
</style>
|