|
@@ -124,7 +124,41 @@
|
|
|
width="100">
|
|
width="100">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<!-- <TableAction /> -->
|
|
<!-- <TableAction /> -->
|
|
|
- <span class="link-type" @click="showConnectorQR(row)">QRCode</span>
|
|
|
|
|
|
|
+ <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="showConnectorQR">
|
|
|
|
|
+ QRCode
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ command="changeToAvailable"
|
|
|
|
|
+ v-if='row.status == "Unavailable"'>
|
|
|
|
|
+ Change Availability to Available
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ command="changeToUnavailable"
|
|
|
|
|
+ v-else>
|
|
|
|
|
+ Change Availability to Unavailable
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ command="unlockConnector">
|
|
|
|
|
+ Unlock Connector
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ command="remoteStart"
|
|
|
|
|
+ v-if='row.status == "Preparing"'>
|
|
|
|
|
+ Remote Start Transaction
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ command="remoteStop"
|
|
|
|
|
+ v-if='row.status == "Charging"'>
|
|
|
|
|
+ Remote Stop Transaction
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
|
+ </el-dropdown>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -148,6 +182,7 @@
|
|
|
import TableAction from '@/components/TableAction.vue'
|
|
import TableAction from '@/components/TableAction.vue'
|
|
|
import ConnectorTags from './components/ConnectorTags.vue'
|
|
import ConnectorTags from './components/ConnectorTags.vue'
|
|
|
import api from '../../http/api/charge'
|
|
import api from '../../http/api/charge'
|
|
|
|
|
+ import ocpp from '../../http/api/ocpp'
|
|
|
export default {
|
|
export default {
|
|
|
components: { Pagination, TableAction, ConnectorTags },
|
|
components: { Pagination, TableAction, ConnectorTags },
|
|
|
data() {
|
|
data() {
|
|
@@ -224,10 +259,97 @@
|
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ handleCommand(cb, item) {
|
|
|
|
|
+ this[cb](item)
|
|
|
|
|
+ },
|
|
|
showConnectorQR(row) {
|
|
showConnectorQR(row) {
|
|
|
this.printConnector.visible = true;
|
|
this.printConnector.visible = true;
|
|
|
this.printConnector.qrCode = row.chargeBoxId + "::" + row.connectorId
|
|
this.printConnector.qrCode = row.chargeBoxId + "::" + row.connectorId
|
|
|
},
|
|
},
|
|
|
|
|
+ unlockConnector(row) {
|
|
|
|
|
+ this.$confirm("Confirm unlock this connector?", "Unlock Connector", {
|
|
|
|
|
+ confirmButtonText: 'Confirm',
|
|
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ connectorId: row.connectorId,
|
|
|
|
|
+ stationIds: [row.chargeBoxId]
|
|
|
|
|
+ }
|
|
|
|
|
+ this.sendPerform("ocppOperations/unlockConnector", params);
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ changeToAvailable(row) {
|
|
|
|
|
+ this.$confirm("Confirm change to available?", "Change Availability", {
|
|
|
|
|
+ confirmButtonText: 'Confirm',
|
|
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ availType: "OPERATIVE",
|
|
|
|
|
+ connectorId: row.connectorId,
|
|
|
|
|
+ stationIds: [row.chargeBoxId]
|
|
|
|
|
+ }
|
|
|
|
|
+ this.sendPerform("ocppOperations/changeAvailability", params);
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ changeToUnavailable(row) {
|
|
|
|
|
+ this.$confirm("Confirm change to unavailable?", "Change Availability", {
|
|
|
|
|
+ confirmButtonText: 'Confirm',
|
|
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ availType: "INOPERATIVE",
|
|
|
|
|
+ connectorId: row.connectorId,
|
|
|
|
|
+ stationIds: [row.chargeBoxId]
|
|
|
|
|
+ }
|
|
|
|
|
+ this.sendPerform("ocppOperations/changeAvailability", params);
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ sendPerform(api, params) {
|
|
|
|
|
+ this.listLoading = true;
|
|
|
|
|
+ ocpp.sendPerform(api, params).then(res => {
|
|
|
|
|
+ this.listLoading = false;
|
|
|
|
|
+ if (res.data.taskId) {
|
|
|
|
|
+ this.$router.push({path: '/ocpp-operations/result/' + res.data.taskId});
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.listLoading = false;
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: err
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ remoteStart(row) {
|
|
|
|
|
+ this.$confirm("Confirm remote start?", "Remote", {
|
|
|
|
|
+ confirmButtonText: 'Confirm',
|
|
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ availType: "INOPERATIVE",
|
|
|
|
|
+ connectorId: row.connectorId,
|
|
|
|
|
+ stationIds: [row.chargeBoxId]
|
|
|
|
|
+ }
|
|
|
|
|
+ //this.sendPerform("ocppOperations/remoteStartTransaction", params);
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ remoteStop(row) {
|
|
|
|
|
+ this.$confirm("Confirm remote stop?", "Remote", {
|
|
|
|
|
+ confirmButtonText: 'Confirm',
|
|
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ availType: "INOPERATIVE",
|
|
|
|
|
+ connectorId: row.connectorId,
|
|
|
|
|
+ stationIds: [row.chargeBoxId]
|
|
|
|
|
+ }
|
|
|
|
|
+ //this.sendPerform("ocppOperations/remoteStopTransaction", params);
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
hideConnectorQR() {
|
|
hideConnectorQR() {
|
|
|
console.log('hide');
|
|
console.log('hide');
|
|
|
this.printConnector.visible = false;
|
|
this.printConnector.visible = false;
|