|
@@ -1,88 +1,89 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
<div class="filter-container">
|
|
<div class="filter-container">
|
|
|
- <el-form
|
|
|
|
|
- :model="filter"
|
|
|
|
|
- v-bind:inline="true"
|
|
|
|
|
- label-position="right"
|
|
|
|
|
- label-width="100px"
|
|
|
|
|
- style="width: 100%;">
|
|
|
|
|
- <div class="filter-view">
|
|
|
|
|
- <div
|
|
|
|
|
- v-if="sitePk"
|
|
|
|
|
- class="back-icon"
|
|
|
|
|
- @click="goBack">
|
|
|
|
|
- <i class="el-icon el-icon-back"></i>
|
|
|
|
|
- </div>
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label=""
|
|
|
|
|
- class="flex-item">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="filter.criteria"
|
|
|
|
|
- placeholder="Search by Station ID/Site Name/Service Provider"
|
|
|
|
|
- @keyup.enter.native="handleFilter" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <div>
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- icon="el-icon-search"
|
|
|
|
|
- @click="handleFilter">
|
|
|
|
|
- Search
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label-width="130px"
|
|
|
|
|
- label="Heartbeat Period:"
|
|
|
|
|
- class="flex-item">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="filter.heartbeatPeriod"
|
|
|
|
|
- placeholder="Select"
|
|
|
|
|
- @change="handleFilter">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, index) in heartOptions"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- :label="item.name"/>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label-width="130px"
|
|
|
|
|
- label="Station Status:"
|
|
|
|
|
- class="flex-item"
|
|
|
|
|
- v-if="sitePk">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="filter.dataStatus"
|
|
|
|
|
- placeholder="Select"
|
|
|
|
|
- @change="handleFilter">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, index) in statusOptions"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- :label="item.name"/>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <div class="filter-flex-button">
|
|
|
|
|
- <el-button
|
|
|
|
|
- v-if="!$route.meta.onlyView"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
|
- @click="addStation">
|
|
|
|
|
- Add Station
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="filter-view">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="sitePk"
|
|
|
|
|
+ class="back-icon"
|
|
|
|
|
+ @click="goBack">
|
|
|
|
|
+ <i class="el-icon el-icon-back"></i>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-form>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ class="filter-view-item"
|
|
|
|
|
+ v-model="filter.pageVo.providerPk"
|
|
|
|
|
+ placeholder="Service Provider"
|
|
|
|
|
+ @change="handleFilter"
|
|
|
|
|
+ clearable>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in providerOptions"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item.providerName"
|
|
|
|
|
+ :value="item.providerPk"/>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ class="filter-view-item"
|
|
|
|
|
+ v-model="filter.pageVo.heartbeatPeriod"
|
|
|
|
|
+ placeholder="Heartbeat Period"
|
|
|
|
|
+ @change="handleFilter"
|
|
|
|
|
+ clearable>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in heartOptions"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ :label="item.name"/>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ class="filter-view-item"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ v-model="filter.pageVo.dataStatus"
|
|
|
|
|
+ placeholder="Station Status"
|
|
|
|
|
+ @change="handleFilter"
|
|
|
|
|
+ v-if="sitePk">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in statusOptions"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ :label="item.name"/>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <div class="flex1" style="max-width: 350px;">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ class="filter-view-item"
|
|
|
|
|
+ v-model="filter.pageVo.criteria"
|
|
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
|
|
+ placeholder="Station ID, Site Name, Carpark Code"
|
|
|
|
|
+ @keyup.enter.native="handleFilter"
|
|
|
|
|
+ @change="handleFilter"
|
|
|
|
|
+ clearable/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
|
+ @click="handleFilter">
|
|
|
|
|
+ Search
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="filter-flex-button">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="!$route.meta.onlyView"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ @click="addStation">
|
|
|
|
|
+ Add Station
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<el-table
|
|
<el-table
|
|
|
v-loading="listLoading"
|
|
v-loading="listLoading"
|
|
|
:data="stationList"
|
|
:data="stationList"
|
|
|
- fit
|
|
|
|
|
class="no-border"
|
|
class="no-border"
|
|
|
style="width: 100%;min-height: 65vh;">
|
|
style="width: 100%;min-height: 65vh;">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="Station ID"
|
|
label="Station ID"
|
|
|
align="center"
|
|
align="center"
|
|
|
- class-name="fixed-width">
|
|
|
|
|
|
|
+ min-width="150">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ row.chargeBoxId }}</span>
|
|
<span>{{ row.chargeBoxId }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -90,15 +91,20 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="Site Name"
|
|
label="Site Name"
|
|
|
align="center"
|
|
align="center"
|
|
|
- class-name="fixed-width">
|
|
|
|
|
|
|
+ min-width="150">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ row.siteName }}</span>
|
|
<span>{{ row.siteName }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="Carpark Code"
|
|
|
|
|
+ prop="carParkCode"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ min-width="120"/>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="Service Provider"
|
|
label="Service Provider"
|
|
|
align="center"
|
|
align="center"
|
|
|
- class-name="fixed-width">
|
|
|
|
|
|
|
+ min-width="140">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ row.providerName }}</span>
|
|
<span>{{ row.providerName }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -106,7 +112,7 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="Last Heartbeat"
|
|
label="Last Heartbeat"
|
|
|
align="center"
|
|
align="center"
|
|
|
- class-name="fixed-width">
|
|
|
|
|
|
|
+ min-width="150">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ row.lastHeartbeat }}</span>
|
|
<span>{{ row.lastHeartbeat }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -114,8 +120,7 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="Connector"
|
|
label="Connector"
|
|
|
align="center"
|
|
align="center"
|
|
|
- width="100px"
|
|
|
|
|
- class-name="fixed-width">
|
|
|
|
|
|
|
+ min-width="100">
|
|
|
<template slot="header" slot-scope="scope">
|
|
<template slot="header" slot-scope="scope">
|
|
|
<div>Connector</div>
|
|
<div>Connector</div>
|
|
|
<div style="font-size: 0.8em; margin-top: -5px;">(In Use/Total)</div>
|
|
<div style="font-size: 0.8em; margin-top: -5px;">(In Use/Total)</div>
|
|
@@ -127,15 +132,14 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="Status"
|
|
label="Status"
|
|
|
align="center"
|
|
align="center"
|
|
|
- width="120px"
|
|
|
|
|
prop="dataStatus"
|
|
prop="dataStatus"
|
|
|
- class-name="fixed-width"/>
|
|
|
|
|
|
|
+ min-width="90"/>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
v-if="!$route.meta.onlyView"
|
|
v-if="!$route.meta.onlyView"
|
|
|
label="Action"
|
|
label="Action"
|
|
|
align="center"
|
|
align="center"
|
|
|
- width="80">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
|
|
+ min-width="70">
|
|
|
|
|
+ <template slot-scope="{row}" v-if="row.dataStatus != 'Inactive'">
|
|
|
<el-dropdown
|
|
<el-dropdown
|
|
|
class="action-dropdown"
|
|
class="action-dropdown"
|
|
|
@command="(v) => handleCommand(v, row)">
|
|
@command="(v) => handleCommand(v, row)">
|
|
@@ -169,9 +173,9 @@
|
|
|
<Pagination
|
|
<Pagination
|
|
|
v-show="total > 0"
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
:total="total"
|
|
|
- :page.sync="listQuery.page"
|
|
|
|
|
- :limit.sync="listQuery.limit"
|
|
|
|
|
- @pagination="handlePageChange" />
|
|
|
|
|
|
|
+ :page.sync="filter.pageNo"
|
|
|
|
|
+ :limit.sync="filter.pageSize"
|
|
|
|
|
+ @pagination="getList" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -181,24 +185,27 @@ import Pagination from '@/components/Pagination'
|
|
|
import TableAction from '@/components/TableAction.vue'
|
|
import TableAction from '@/components/TableAction.vue'
|
|
|
import api from '../../http/api/charge'
|
|
import api from '../../http/api/charge'
|
|
|
import ocpp from '../../http/api/ocpp'
|
|
import ocpp from '../../http/api/ocpp'
|
|
|
|
|
+import provider from '../../http/api/provider'
|
|
|
export default {
|
|
export default {
|
|
|
components: { Pagination, TableAction },
|
|
components: { Pagination, TableAction },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
filter: {
|
|
filter: {
|
|
|
- criteria: '',
|
|
|
|
|
- dataStatus: '',
|
|
|
|
|
- heartbeatPeriod: 'ALL'
|
|
|
|
|
|
|
+ pageNo: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ pageVo: {
|
|
|
|
|
+ criteria: '',
|
|
|
|
|
+ dataStatus: '',
|
|
|
|
|
+ providerPk: '',
|
|
|
|
|
+ heartbeatPeriod: 'ALL'
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
listLoading: true,
|
|
listLoading: true,
|
|
|
stationList: [],
|
|
stationList: [],
|
|
|
heartOptions: [],
|
|
heartOptions: [],
|
|
|
statusOptions: [],
|
|
statusOptions: [],
|
|
|
|
|
+ providerOptions: [],
|
|
|
total: 1,
|
|
total: 1,
|
|
|
- listQuery: {
|
|
|
|
|
- page: 1,
|
|
|
|
|
- limit: 10,
|
|
|
|
|
- },
|
|
|
|
|
sitePk: ""
|
|
sitePk: ""
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -207,6 +214,7 @@ export default {
|
|
|
this.filter.sitePk = this.sitePk = this.$route.params.id;
|
|
this.filter.sitePk = this.sitePk = this.$route.params.id;
|
|
|
this.getStatusOptions();
|
|
this.getStatusOptions();
|
|
|
}
|
|
}
|
|
|
|
|
+ this.getAllProvider();
|
|
|
this.getHeartbeatOptions();
|
|
this.getHeartbeatOptions();
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
@@ -217,8 +225,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handleFilter() {
|
|
handleFilter() {
|
|
|
- this.listLoading = true;
|
|
|
|
|
- this.listQuery.page = 1;
|
|
|
|
|
|
|
+ this.filter.pageNo = 1;
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
handlePageChange() {
|
|
handlePageChange() {
|
|
@@ -227,37 +234,39 @@ export default {
|
|
|
},
|
|
},
|
|
|
getHeartbeatOptions() {
|
|
getHeartbeatOptions() {
|
|
|
api.getHeartbeatPeriodList().then(res => {
|
|
api.getHeartbeatPeriodList().then(res => {
|
|
|
- console.log('data', res);
|
|
|
|
|
this.heartOptions = res.data;
|
|
this.heartOptions = res.data;
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
- console.error('data', err);
|
|
|
|
|
|
|
+ this.$message.error(err);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
getStatusOptions() {
|
|
getStatusOptions() {
|
|
|
api.getStatusOptions().then(res => {
|
|
api.getStatusOptions().then(res => {
|
|
|
- console.log('data', res);
|
|
|
|
|
this.statusOptions = res.data;
|
|
this.statusOptions = res.data;
|
|
|
- this.statusOptions.unshift({
|
|
|
|
|
|
|
+ /*this.statusOptions.unshift({
|
|
|
name: "All",
|
|
name: "All",
|
|
|
value: ""
|
|
value: ""
|
|
|
- })
|
|
|
|
|
|
|
+ })*/
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.$message.error(err);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ getAllProvider() {
|
|
|
|
|
+ provider.getAllServiceProvider().then(res => {
|
|
|
|
|
+ if (res.data && res.data.length > 0) {
|
|
|
|
|
+ this.providerOptions = res.data
|
|
|
|
|
+ }
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
- console.error('data', err);
|
|
|
|
|
|
|
+ this.$message.error(err);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
getList() {
|
|
getList() {
|
|
|
- const params = {
|
|
|
|
|
- pageSize: this.listQuery.limit,
|
|
|
|
|
- pageNo: this.listQuery.page,
|
|
|
|
|
- pageVo: this.filter
|
|
|
|
|
- }
|
|
|
|
|
- api.getStationPages(params).then(res => {
|
|
|
|
|
- console.log('data', res);
|
|
|
|
|
|
|
+ this.listLoading = true;
|
|
|
|
|
+ api.getStationPages(this.filter).then(res => {
|
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
|
this.total = res.total;
|
|
this.total = res.total;
|
|
|
this.stationList = res.data;
|
|
this.stationList = res.data;
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
- console.error('data', err);
|
|
|
|
|
|
|
+ this.$message.error(err);
|
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
|
this.total = 0;
|
|
this.total = 0;
|
|
|
this.stationList = [];
|
|
this.stationList = [];
|
|
@@ -289,7 +298,9 @@ export default {
|
|
|
stationIds: [row.chargeBoxId]
|
|
stationIds: [row.chargeBoxId]
|
|
|
}
|
|
}
|
|
|
this.resetStation(params);
|
|
this.resetStation(params);
|
|
|
- })
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.$message.error(err);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
hardReset(row) {
|
|
hardReset(row) {
|
|
|
this.$confirm("Confirm hard reset?", "Reset", {
|
|
this.$confirm("Confirm hard reset?", "Reset", {
|
|
@@ -302,7 +313,9 @@ export default {
|
|
|
stationIds: [row.chargeBoxId]
|
|
stationIds: [row.chargeBoxId]
|
|
|
}
|
|
}
|
|
|
this.resetStation(params);
|
|
this.resetStation(params);
|
|
|
- })
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.$message.error(err);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
resetStation(params) {
|
|
resetStation(params) {
|
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
@@ -327,7 +340,9 @@ export default {
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
this.deleteStation(row.chargeBoxPk)
|
|
this.deleteStation(row.chargeBoxPk)
|
|
|
- })
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.$message.error(err);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
deleteStation(id) {
|
|
deleteStation(id) {
|
|
|
api.deleteStation({chargeBoxPk: id}).then(res => {
|
|
api.deleteStation({chargeBoxPk: id}).then(res => {
|