|
|
@@ -148,6 +148,11 @@
|
|
|
command="showConnectorQR">
|
|
|
QRCode
|
|
|
</el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ command="showWebPosQR"
|
|
|
+ v-if="enableWebPos">
|
|
|
+ WebPosQR
|
|
|
+ </el-dropdown-item>
|
|
|
<el-dropdown-item
|
|
|
command="changeToAvailable"
|
|
|
v-if='row.status == "Unavailable"'>
|
|
|
@@ -192,210 +197,225 @@
|
|
|
<DialogRemoteOcpp
|
|
|
v-bind="actionDialog"
|
|
|
@hide="hideActionDialog"/>
|
|
|
+ <WebPosQR
|
|
|
+ v-bind="webPosDialog"
|
|
|
+ @hide="hideConnectorQR"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import Pagination from '@/components/Pagination'
|
|
|
- import TableAction from '@/components/TableAction.vue'
|
|
|
- import ConnectorTags from './components/ConnectorTags.vue'
|
|
|
- import DialogRemoteOcpp from './components/DialogRemoteOcpp.vue'
|
|
|
- import api from '../../http/api/charge'
|
|
|
- import ocpp from '../../http/api/ocpp'
|
|
|
- export default {
|
|
|
- components: { Pagination, TableAction, ConnectorTags, DialogRemoteOcpp },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- filter: {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- pageVo: {
|
|
|
- criteria: '',
|
|
|
- status: '',
|
|
|
- errorCode: ''
|
|
|
- }
|
|
|
- },
|
|
|
- listLoading: true,
|
|
|
- connectorList: [],
|
|
|
- total: 0,
|
|
|
- statusOptions: [],
|
|
|
- errCodeOptions: [],
|
|
|
- printConnector: {
|
|
|
- qrCode: "",
|
|
|
- visible: false
|
|
|
- },
|
|
|
- sitePk: "",
|
|
|
- actionDialog: {
|
|
|
- visible: false,
|
|
|
- isStart: true,
|
|
|
- item: {}
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import TableAction from '@/components/TableAction.vue'
|
|
|
+import ConnectorTags from './components/ConnectorTags.vue'
|
|
|
+import WebPosQR from './components/WebPosQR.vue'
|
|
|
+import DialogRemoteOcpp from './components/DialogRemoteOcpp.vue'
|
|
|
+import api from '../../http/api/charge'
|
|
|
+import ocpp from '../../http/api/ocpp'
|
|
|
+import settings from '../../settings.js'
|
|
|
+export default {
|
|
|
+ components: { Pagination, TableAction, ConnectorTags, DialogRemoteOcpp,WebPosQR },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ filter: {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ pageVo: {
|
|
|
+ criteria: '',
|
|
|
+ status: '',
|
|
|
+ errorCode: ''
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- if (this.$route.params.id) {
|
|
|
- this.filter.sitePk = this.sitePk = this.$route.params.id;
|
|
|
- }
|
|
|
- this.getStatusOption();
|
|
|
- this.getErrorCodeOptions();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- goBack() {
|
|
|
- this.$router.push({
|
|
|
- path: "/site-management/edit/" + this.sitePk
|
|
|
- })
|
|
|
- },
|
|
|
- handleFilter() {
|
|
|
- this.filter.pageNo = 1;
|
|
|
- this.getConnectorList();
|
|
|
- },
|
|
|
- getStatusOption() {
|
|
|
- api.getStatusList().then(res => {
|
|
|
- if (res.data.length > 0) {
|
|
|
- res.data.forEach(item => {
|
|
|
- this.statusOptions.push({
|
|
|
- name: item,
|
|
|
- value: item
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- this.getConnectorList();
|
|
|
- }).catch(err => {
|
|
|
- this.$message.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- getErrorCodeOptions() {
|
|
|
- api.getErrorCodeOption().then(res => {
|
|
|
- if (res.data.length > 0) {
|
|
|
- res.data.forEach(item => {
|
|
|
- this.errCodeOptions.push({
|
|
|
- name: item,
|
|
|
- value: item
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- this.getConnectorList();
|
|
|
- }).catch(err => {
|
|
|
- this.$message.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- getConnectorList() {
|
|
|
- this.listLoading = true;
|
|
|
- api.getConnectorList(this.filter).then(res => {
|
|
|
- this.listLoading = false;
|
|
|
- this.total = res.total;
|
|
|
- this.connectorList = res.data;
|
|
|
- }).catch(err => {
|
|
|
- this.$message.error(err)
|
|
|
- this.listLoading = false;
|
|
|
- })
|
|
|
- },
|
|
|
- handleCommand(cb, item) {
|
|
|
- this[cb](item)
|
|
|
},
|
|
|
- showConnectorQR(row) {
|
|
|
- this.printConnector.visible = true;
|
|
|
- this.printConnector.qrCode = row.chargeBoxId + "::" + row.connectorId
|
|
|
+ listLoading: true,
|
|
|
+ connectorList: [],
|
|
|
+ total: 0,
|
|
|
+ statusOptions: [],
|
|
|
+ errCodeOptions: [],
|
|
|
+ printConnector: {
|
|
|
+ qrCode: "",
|
|
|
+ visible: false
|
|
|
},
|
|
|
- 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);
|
|
|
- })
|
|
|
+ sitePk: "",
|
|
|
+ actionDialog: {
|
|
|
+ visible: false,
|
|
|
+ isStart: true,
|
|
|
+ item: {}
|
|
|
},
|
|
|
- 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);
|
|
|
- })
|
|
|
+ webPosDialog: {
|
|
|
+ visible: false,
|
|
|
+ item: {}
|
|
|
},
|
|
|
- sendPerform(api, params) {
|
|
|
- this.listLoading = true;
|
|
|
- ocpp.sendPerform(api, params).then(res => {
|
|
|
- this.listLoading = false;
|
|
|
- if (res.data.taskId) {
|
|
|
- this.$openRoute("/ocpp-operations/result/" + res.data.taskId);
|
|
|
- //this.$router.push({path: '/ocpp-operations/result/' + res.data.taskId});
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- this.listLoading = false;
|
|
|
- this.$message({
|
|
|
- type: 'error',
|
|
|
- message: err
|
|
|
+ enableWebPos: settings.enableWebPos
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ if (this.$route.params.id) {
|
|
|
+ this.filter.sitePk = this.sitePk = this.$route.params.id;
|
|
|
+ }
|
|
|
+ this.getStatusOption();
|
|
|
+ this.getErrorCodeOptions();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goBack() {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/site-management/edit/" + this.sitePk
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleFilter() {
|
|
|
+ this.filter.pageNo = 1;
|
|
|
+ this.getConnectorList();
|
|
|
+ },
|
|
|
+ getStatusOption() {
|
|
|
+ api.getStatusList().then(res => {
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ res.data.forEach(item => {
|
|
|
+ this.statusOptions.push({
|
|
|
+ name: item,
|
|
|
+ value: item
|
|
|
+ })
|
|
|
})
|
|
|
- });
|
|
|
- },
|
|
|
- remoteStart(row) {
|
|
|
- this.actionDialog.visible = true;
|
|
|
- this.actionDialog.item = row;
|
|
|
- this.actionDialog.isStart = true;
|
|
|
- /*this.$confirm("Confirm remote start?", "Remote", {
|
|
|
- confirmButtonText: 'Confirm',
|
|
|
- cancelButtonText: 'Cancel',
|
|
|
- type: 'warning'
|
|
|
- }).then(res => {
|
|
|
- const params = {
|
|
|
- connectorId: row.connectorId,
|
|
|
- stationIds: [row.chargeBoxId],
|
|
|
- //mobileNumber: ""
|
|
|
- }
|
|
|
- //this.sendPerform("ocppOperations/remoteStartTransaction", params);
|
|
|
- })*/
|
|
|
- },
|
|
|
- remoteStop(row) {
|
|
|
- this.actionDialog.visible = true;
|
|
|
- this.actionDialog.item = row;
|
|
|
- this.actionDialog.isStart = false;
|
|
|
- /*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() {
|
|
|
- this.printConnector.visible = false;
|
|
|
- },
|
|
|
- hideActionDialog() {
|
|
|
- this.actionDialog.visible = false;
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.getConnectorList();
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getErrorCodeOptions() {
|
|
|
+ api.getErrorCodeOption().then(res => {
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ res.data.forEach(item => {
|
|
|
+ this.errCodeOptions.push({
|
|
|
+ name: item,
|
|
|
+ value: item
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.getConnectorList();
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getConnectorList() {
|
|
|
+ this.listLoading = true;
|
|
|
+ api.getConnectorList(this.filter).then(res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.total = res.total;
|
|
|
+ this.connectorList = res.data;
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error(err)
|
|
|
+ this.listLoading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCommand(cb, item) {
|
|
|
+ this[cb](item)
|
|
|
+ },
|
|
|
+ showConnectorQR(row) {
|
|
|
+ this.printConnector.visible = true;
|
|
|
+ this.printConnector.qrCode = row.chargeBoxId + "::" + row.connectorId
|
|
|
+ },
|
|
|
+ showWebPosQR(row) {
|
|
|
+ this.webPosDialog.item = row;
|
|
|
+ this.webPosDialog.visible = true;
|
|
|
+ },
|
|
|
+ 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.$openRoute("/ocpp-operations/result/" + 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.actionDialog.visible = true;
|
|
|
+ this.actionDialog.item = row;
|
|
|
+ this.actionDialog.isStart = true;
|
|
|
+ /*this.$confirm("Confirm remote start?", "Remote", {
|
|
|
+ confirmButtonText: 'Confirm',
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(res => {
|
|
|
+ const params = {
|
|
|
+ connectorId: row.connectorId,
|
|
|
+ stationIds: [row.chargeBoxId],
|
|
|
+ //mobileNumber: ""
|
|
|
+ }
|
|
|
+ //this.sendPerform("ocppOperations/remoteStartTransaction", params);
|
|
|
+ })*/
|
|
|
+ },
|
|
|
+ remoteStop(row) {
|
|
|
+ this.actionDialog.visible = true;
|
|
|
+ this.actionDialog.item = row;
|
|
|
+ this.actionDialog.isStart = false;
|
|
|
+ /*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() {
|
|
|
+ this.printConnector.visible = false;
|
|
|
+ this.webPosDialog.visible = false;
|
|
|
+ },
|
|
|
+ hideActionDialog() {
|
|
|
+ this.actionDialog.visible = false;
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|