|
|
@@ -0,0 +1,177 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <div class="filter-container">
|
|
|
+ <div class="radio-group">
|
|
|
+ <el-radio-group
|
|
|
+ v-model="params.tabIndex"
|
|
|
+ @change="changeTab">
|
|
|
+ <el-radio-button
|
|
|
+ v-for="(item,index) in dateRangeTab"
|
|
|
+ :key="index"
|
|
|
+ :label="index">
|
|
|
+ {{item.name + " (" + item.total + ")"}}
|
|
|
+ </el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <div class="filter-view">
|
|
|
+ <div class="flex1" style="min-width: 300px; max-width: 350px;">
|
|
|
+ <el-input
|
|
|
+ v-model="params.pageVo.criteria"
|
|
|
+ placeholder="Search by Site ID, Station ID"
|
|
|
+ @keyup.enter.native="getTableData" />
|
|
|
+ </div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="getTableData">
|
|
|
+ Search
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ v-loading="table.loading"
|
|
|
+ :data="table.list"
|
|
|
+ style="width: 100%;min-height: 65vh;">
|
|
|
+ <el-table-column
|
|
|
+ label="Site ID"
|
|
|
+ align="center"
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.sitePk }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="Site Name"
|
|
|
+ align="center"
|
|
|
+ prop="siteName"/>
|
|
|
+ <el-table-column
|
|
|
+ label="Station ID"
|
|
|
+ align="center"
|
|
|
+ prop="chargeBoxId"/>
|
|
|
+ <el-table-column
|
|
|
+ label="Timestamp"
|
|
|
+ align="center"
|
|
|
+ prop="timestamp"/>
|
|
|
+ <el-table-column
|
|
|
+ label="Latest Notification"
|
|
|
+ align="center"
|
|
|
+ prop="notification"/>
|
|
|
+ <el-table-column
|
|
|
+ label="Action"
|
|
|
+ align="center"
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-dropdown
|
|
|
+ class="action-dropdown"
|
|
|
+ @command="(v) => handleCommand(v, row)">
|
|
|
+ <i class="el-icon-more icon-action"></i>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ command="viewDetail">
|
|
|
+ View Info
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="right">
|
|
|
+ <pagination
|
|
|
+ v-show="table.total > 0"
|
|
|
+ :total="table.total"
|
|
|
+ :page.sync="params.pageNo"
|
|
|
+ :limit.sync="params.pageSize"
|
|
|
+ @pagination="getTableData" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import error from '@/http/api/error'
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ params: {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ pageVo: {
|
|
|
+ criteria: ""
|
|
|
+ },
|
|
|
+ tabIndex: 0
|
|
|
+ },
|
|
|
+ table: {
|
|
|
+ loading: false,
|
|
|
+ list: [],
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ dateRangeTab: [{
|
|
|
+ name: "Boot Notification",
|
|
|
+ total: 1
|
|
|
+ },{
|
|
|
+ name: "Disconnected",
|
|
|
+ total: 1
|
|
|
+ },{
|
|
|
+ name: "Faulted",
|
|
|
+ total: 1
|
|
|
+ },{
|
|
|
+ name: "Connected",
|
|
|
+ total: 1
|
|
|
+ },{
|
|
|
+ name: "Charging",
|
|
|
+ total: 1
|
|
|
+ },{
|
|
|
+ name: "Finishing",
|
|
|
+ total: 1
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: { Pagination },
|
|
|
+ created() {
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getTableData() {
|
|
|
+ this.table.loading = true;
|
|
|
+ error.getConnectivityPages(this.params).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ this.table.list = res.data
|
|
|
+ this.table.total = res.total
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: err
|
|
|
+ })
|
|
|
+ }).finally(() => {
|
|
|
+ this.table.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeTab() {
|
|
|
+
|
|
|
+ },
|
|
|
+ handleCommand(func, item) {
|
|
|
+ this[func](item)
|
|
|
+ },
|
|
|
+ viewDetail(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/incident/charger-connectivity/info/" + row.chargerConnectivityId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import '../../styles/element-ui.scss';
|
|
|
+.radio-group {
|
|
|
+ padding-top: 5px;
|
|
|
+}
|
|
|
+.radio-group ::v-deep .el-radio-button {
|
|
|
+ padding: 5px;
|
|
|
+ .el-radio-button__inner {
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid $--color-primary;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|