diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java index d06aa4399..af4cf2766 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java @@ -1,10 +1,12 @@ package com.genersoft.iot.vmp.jt1078.bean; import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; /** * JT 终端控制 */ +@Data @Schema(description = "终端控制") public class JTDeviceConnectionControl { @@ -52,78 +54,6 @@ public class JTDeviceConnectionControl { */ private Long timeLimit; - public Boolean getSwitchOn() { - return switchOn; - } - - public void setSwitchOn(Boolean switchOn) { - this.switchOn = switchOn; - } - - public String getAuthentication() { - return authentication; - } - - public void setAuthentication(String authentication) { - this.authentication = authentication; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public Integer getTcpPort() { - return tcpPort; - } - - public void setTcpPort(Integer tcpPort) { - this.tcpPort = tcpPort; - } - - public Integer getUdpPort() { - return udpPort; - } - - public void setUdpPort(Integer udpPort) { - this.udpPort = udpPort; - } - - public Long getTimeLimit() { - return timeLimit; - } - - public void setTimeLimit(Long timeLimit) { - this.timeLimit = timeLimit; - } - @Override public String toString() { return "JTDeviceConnectionControl{" + diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java b/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java index 288806a81..2f4f5ace6 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java @@ -436,7 +436,7 @@ public class JT1078Controller { service.setConfig(config.getPhoneNumber(), config.getConfig()); } - @Operation(summary = "终端控制-连接", security = @SecurityRequirement(name = JwtUtils.HEADER)) + @Operation(summary = "终端控制-连接指定的服务器", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "control", description = "终端控制参数", required = true) @PostMapping("/control/connection") public void connectionControl(@RequestBody ConnectionControlParam control){ diff --git a/web/src/api/jtDevice.js b/web/src/api/jtDevice.js index 59369e61d..a30a5f3f3 100644 --- a/web/src/api/jtDevice.js +++ b/web/src/api/jtDevice.js @@ -300,5 +300,12 @@ export function reset(phoneNumber) { } }) } +export function connection(data) { + return request({ + method: 'post', + url: '/api/jt1078/control/connection', + data: data + }) +} diff --git a/web/src/store/modules/jtDevice.js b/web/src/store/modules/jtDevice.js index 2100f910e..8dc196065 100644 --- a/web/src/store/modules/jtDevice.js +++ b/web/src/store/modules/jtDevice.js @@ -1,6 +1,6 @@ import { add, - addChannel, controlPlayback, deleteDevice, factoryReset, + addChannel, connection, controlPlayback, deleteDevice, factoryReset, fillLight, getRecordTempUrl, linkDetection, play, ptz, queryAttribute, queryChannels, queryConfig, @@ -290,6 +290,16 @@ const actions = { reject(error) }) }) + }, + connection({ commit }, data) { + return new Promise((resolve, reject) => { + connection(data).then(response => { + const { data } = response + resolve(data) + }).catch(error => { + reject(error) + }) + }) } } diff --git a/web/src/views/jtDevice/dialog/connectionServer.vue b/web/src/views/jtDevice/dialog/connectionServer.vue new file mode 100755 index 000000000..8476b002a --- /dev/null +++ b/web/src/views/jtDevice/dialog/connectionServer.vue @@ -0,0 +1,124 @@ + + + diff --git a/web/src/views/jtDevice/list.vue b/web/src/views/jtDevice/list.vue index 2cc2d538d..a14f2f1df 100755 --- a/web/src/views/jtDevice/list.vue +++ b/web/src/views/jtDevice/list.vue @@ -123,6 +123,8 @@ 终端复位 恢复出厂 + + 连接指定服务器 车门控制 @@ -149,6 +151,7 @@ + @@ -160,11 +163,12 @@ import position from './dialog/position.vue' import textMsg from './dialog/textMsg.vue' import telephoneCallback from './dialog/telephoneCallback.vue' import driverInfo from './dialog/driverInfo.vue' +import connectionServer from './dialog/connectionServer.vue' export default { name: 'App', components: { - deviceEdit, configInfo, attribute, position, textMsg, telephoneCallback, driverInfo + deviceEdit, configInfo, attribute, position, textMsg, telephoneCallback, driverInfo, connectionServer }, data() { return { @@ -263,8 +267,6 @@ export default { moreClick: function(command, itemData) { if (command === 'params') { this.showParam(itemData) - } else if (command === 'connection') { - // this.queryCloudRecords(itemData) } else if (command === 'attribute') { this.queryAttribute(itemData) } else if (command === 'linkDetection') { @@ -281,6 +283,8 @@ export default { this.factoryReset(itemData) } else if (command === 'reset') { this.reset(itemData) + } else if (command === 'connection') { + this.connection(itemData) } else { this.$message.info('尚不支持') } @@ -352,6 +356,9 @@ export default { }) }, + connection: function(itemData) { + this.$refs.connectionServer.openDialog(itemData.phoneNumber) + }, linkDetection: function(itemData) { this.$store.dispatch('jtDevice/linkDetection', itemData.phoneNumber) .then((data) => {