mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-26 23:17:50 +08:00
1078-调整页面
This commit is contained in:
parent
972ef30f8d
commit
0103d5819b
@ -68,6 +68,12 @@ public class JT1078TerminalController {
|
|||||||
assert phoneNumber != null;
|
assert phoneNumber != null;
|
||||||
service.deleteDeviceByPhoneNumber(phoneNumber);
|
service.deleteDeviceByPhoneNumber(phoneNumber);
|
||||||
}
|
}
|
||||||
|
@Operation(summary = "查询设备", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "phoneNumber", description = "设备手机号", required = true)
|
||||||
|
@GetMapping("/query")
|
||||||
|
public JTDevice getDevice(Integer deviceId){
|
||||||
|
return service.getDeviceById(deviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "1078-查询部标通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "1078-查询部标通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
|||||||
@ -99,4 +99,8 @@ public interface JTTerminalMapper {
|
|||||||
"WHERE phone_number=#{phoneNumber}"+
|
"WHERE phone_number=#{phoneNumber}"+
|
||||||
" </script>"})
|
" </script>"})
|
||||||
void updateDeviceStatus(@Param("connected") boolean connected, @Param("phoneNumber") String phoneNumber);
|
void updateDeviceStatus(@Param("connected") boolean connected, @Param("phoneNumber") String phoneNumber);
|
||||||
|
|
||||||
|
@Select("SELECT * FROM wvp_jt_terminal where id=#{deviceId}")
|
||||||
|
JTDevice getDeviceById(@Param("deviceId") Integer deviceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,4 +125,7 @@ public interface Ijt1078Service {
|
|||||||
void addChannel(JTChannel channel);
|
void addChannel(JTChannel channel);
|
||||||
|
|
||||||
void deleteChannelById(Integer id);
|
void deleteChannelById(Integer id);
|
||||||
|
|
||||||
|
JTDevice getDeviceById(Integer deviceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1033,4 +1033,9 @@ public class jt1078ServiceImpl implements Ijt1078Service {
|
|||||||
public void deleteChannelById(Integer id) {
|
public void deleteChannelById(Integer id) {
|
||||||
jtChannelMapper.delete(id);
|
jtChannelMapper.delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JTDevice getDeviceById(Integer deviceId) {
|
||||||
|
return jtDeviceMapper.getDeviceById(deviceId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,16 +57,6 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.edit"
|
|
||||||
size="medium"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit-outline"
|
|
||||||
@click="handleSave(scope.row)"
|
|
||||||
>
|
|
||||||
保存
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-else
|
|
||||||
size="medium"
|
size="medium"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@ -122,9 +112,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import devicePlayer from './dialog/devicePlayer.vue'
|
import devicePlayer from './dialog/devicePlayer.vue'
|
||||||
import uiHeader from '../layout/UiHeader.vue'
|
import uiHeader from '../layout/UiHeader.vue'
|
||||||
import DeviceService from "./service/DeviceService";
|
|
||||||
import DeviceTree from "./common/DeviceTree";
|
import DeviceTree from "./common/DeviceTree";
|
||||||
import channelEdit from "./dialog/jtChannelEdit.vue";
|
import channelEdit from "./dialog/jtChannelEdit.vue";
|
||||||
|
import JTDeviceService from "./service/JTDeviceService";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'channelList',
|
name: 'channelList',
|
||||||
@ -136,7 +126,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
deviceService: new DeviceService(),
|
deviceService: new JTDeviceService(),
|
||||||
device: null,
|
device: null,
|
||||||
deviceId: this.$route.params.deviceId,
|
deviceId: this.$route.params.deviceId,
|
||||||
parentChannelId: this.$route.params.parentChannelId,
|
parentChannelId: this.$route.params.parentChannelId,
|
||||||
@ -240,9 +230,11 @@ export default {
|
|||||||
let that = this;
|
let that = this;
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/api/play/start/' + deviceId + '/' + channelId,
|
url: '/api/jt1078/live/start' + deviceId + '/' + channelId,
|
||||||
params: {
|
params: {
|
||||||
isSubStream: this.isSubStream
|
phoneNumber: deviceId,
|
||||||
|
channelId: channelId,
|
||||||
|
type: 0,
|
||||||
}
|
}
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
|||||||
@ -10,7 +10,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--设备列表-->
|
<!--设备列表-->
|
||||||
<el-table :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header">
|
<el-table :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight"
|
||||||
|
header-row-class-name="table-header">
|
||||||
<el-table-column prop="phoneNumber" label="终端手机号" min-width="160">
|
<el-table-column prop="phoneNumber" label="终端手机号" min-width="160">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="terminalId" label="终端ID" min-width="160">
|
<el-table-column prop="terminalId" label="终端ID" min-width="160">
|
||||||
@ -51,7 +52,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" min-width="450" fixed="right">
|
<el-table-column label="操作" min-width="280" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button type="text" size="medium" icon="el-icon-video-camera"
|
<el-button type="text" size="medium" icon="el-icon-video-camera"
|
||||||
@ -60,7 +61,9 @@
|
|||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button size="medium" icon="el-icon-edit" type="text" @click="edit(scope.row)">编辑</el-button>
|
<el-button size="medium" icon="el-icon-edit" type="text" @click="edit(scope.row)">编辑</el-button>
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button size="medium" icon="el-icon-delete" type="text" @click="deleteDevice(scope.row)" style="color: #f56c6c">删除</el-button>
|
<el-button size="medium" icon="el-icon-delete" type="text" @click="deleteDevice(scope.row)"
|
||||||
|
style="color: #f56c6c">删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -83,6 +86,7 @@
|
|||||||
import uiHeader from '../layout/UiHeader.vue'
|
import uiHeader from '../layout/UiHeader.vue'
|
||||||
import deviceEdit from './dialog/jtDeviceEdit.vue'
|
import deviceEdit from './dialog/jtDeviceEdit.vue'
|
||||||
import syncChannelProgress from './dialog/SyncChannelProgress.vue'
|
import syncChannelProgress from './dialog/SyncChannelProgress.vue'
|
||||||
|
import JTDeviceService from "./service/JTDeviceService";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
@ -93,12 +97,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
deviceService: new JTDeviceService(),
|
||||||
deviceList: [], //设备列表
|
deviceList: [], //设备列表
|
||||||
currentDevice: {}, //当前操作设备对象
|
|
||||||
|
|
||||||
videoComponentList: [],
|
|
||||||
updateLooper: 0, //数据刷新轮训标志
|
updateLooper: 0, //数据刷新轮训标志
|
||||||
currentDeviceChannelsLenth: 0,
|
|
||||||
winHeight: window.innerHeight - 200,
|
winHeight: window.innerHeight - 200,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
count: 15,
|
count: 15,
|
||||||
@ -106,19 +107,6 @@ export default {
|
|||||||
getListLoading: false,
|
getListLoading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
getcurrentDeviceChannels: function () {
|
|
||||||
let data = this.currentDevice['channelMap'];
|
|
||||||
let channels = null;
|
|
||||||
if (data) {
|
|
||||||
channels = Object.keys(data).map(key => {
|
|
||||||
return data[key];
|
|
||||||
});
|
|
||||||
this.currentDeviceChannelsLenth = channels.length;
|
|
||||||
}
|
|
||||||
return channels;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initData();
|
this.initData();
|
||||||
this.updateLooper = setInterval(this.initData, 10000);
|
this.updateLooper = setInterval(this.initData, 10000);
|
||||||
@ -141,23 +129,16 @@ export default {
|
|||||||
},
|
},
|
||||||
getList: function () {
|
getList: function () {
|
||||||
this.getListLoading = true;
|
this.getListLoading = true;
|
||||||
this.$axios({
|
this.deviceService.getDeviceList(this.currentPage, this.count, (data) => {
|
||||||
method: 'get',
|
if (data.code === 0) {
|
||||||
url: `/api/jt1078/terminal/list`,
|
this.total = data.data.total;
|
||||||
params: {
|
this.deviceList = data.data.list;
|
||||||
page: this.currentPage,
|
|
||||||
count: this.count
|
|
||||||
}
|
|
||||||
}).then( (res)=> {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
this.total = res.data.data.total;
|
|
||||||
this.deviceList = res.data.data.list;
|
|
||||||
}
|
}
|
||||||
this.getListLoading = false;
|
this.getListLoading = false;
|
||||||
}).catch( (error)=> {
|
}, () => {
|
||||||
console.error(error);
|
|
||||||
this.getListLoading = false;
|
this.getListLoading = false;
|
||||||
});
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
deleteDevice: function (row) {
|
deleteDevice: function (row) {
|
||||||
this.$confirm("确定删除此设备?", '提示', {
|
this.$confirm("确定删除此设备?", '提示', {
|
||||||
@ -167,17 +148,9 @@ export default {
|
|||||||
center: true,
|
center: true,
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$axios({
|
this.deviceService.deleteDevice(row.id, (data) => {
|
||||||
method: 'delete',
|
|
||||||
url: '/api/jt1078/terminal/delete',
|
|
||||||
params: {
|
|
||||||
deviceId: row.deviceId
|
|
||||||
}
|
|
||||||
}).then((res) => {
|
|
||||||
this.getList();
|
this.getList();
|
||||||
}).catch((error) => {
|
})
|
||||||
console.error(error);
|
|
||||||
});
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
173
web_src/src/components/service/JTDeviceService.js
Executable file
173
web_src/src/components/service/JTDeviceService.js
Executable file
@ -0,0 +1,173 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
class JTDeviceService{
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.$axios = axios;
|
||||||
|
}
|
||||||
|
|
||||||
|
getDeviceList(currentPage, count, callback, errorCallback){
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/jt1078/terminal/list`,
|
||||||
|
params: {
|
||||||
|
page: currentPage,
|
||||||
|
count: count
|
||||||
|
}
|
||||||
|
}).then( (res)=> {
|
||||||
|
if (typeof (callback) == "function") callback(res.data)
|
||||||
|
}).catch( (error)=> {
|
||||||
|
console.error(error);
|
||||||
|
if (typeof (errorCallback) == "function") errorCallback(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getDevice(deviceId, callback, errorCallback){
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url:`/api/jt1078/terminal/query`,
|
||||||
|
params: {
|
||||||
|
deviceId: deviceId
|
||||||
|
},
|
||||||
|
}).then((res) => {
|
||||||
|
if (typeof (callback) == "function") callback(res.data)
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
if (typeof (errorCallback) == "function") errorCallback(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteDevice(deviceId, callback, errorCallback){
|
||||||
|
this.$axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: '/api/jt1078/terminal/delete',
|
||||||
|
params: {
|
||||||
|
deviceId: deviceId
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (typeof (callback) == "function") callback(res.data)
|
||||||
|
}).catch((error) => {
|
||||||
|
if (typeof (errorCallback) == "function") errorCallback(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
getAllChannel(isCatalog, catalogUnderDevice, deviceId, callback, endCallback, errorCallback) {
|
||||||
|
let currentPage = 1;
|
||||||
|
let count = 100;
|
||||||
|
let catalogList = []
|
||||||
|
this.getAllChannelIteration(isCatalog, catalogUnderDevice, deviceId, catalogList, currentPage, count, callback, endCallback, errorCallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllChannelIteration(isCatalog, catalogUnderDevice, deviceId, catalogList, currentPage, count, callback, endCallback, errorCallback) {
|
||||||
|
this.getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, (data) => {
|
||||||
|
if (data.list) {
|
||||||
|
if (typeof (callback) == "function") callback(data.list)
|
||||||
|
catalogList = catalogList.concat(data.list);
|
||||||
|
if (catalogList.length < data.total) {
|
||||||
|
currentPage ++
|
||||||
|
this.getAllChannelIteration(isCatalog,catalogUnderDevice, deviceId, catalogList, currentPage, count, callback, errorCallback)
|
||||||
|
}else {
|
||||||
|
console.log(1)
|
||||||
|
if (typeof (endCallback) == "function") endCallback(catalogList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, errorCallback)
|
||||||
|
}
|
||||||
|
getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) {
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/device/query/devices/${deviceId}/channels`,
|
||||||
|
params:{
|
||||||
|
page: currentPage,
|
||||||
|
count: count,
|
||||||
|
query: "",
|
||||||
|
online: "",
|
||||||
|
channelType: isCatalog,
|
||||||
|
catalogUnderDevice: catalogUnderDevice
|
||||||
|
}
|
||||||
|
}).then((res) =>{
|
||||||
|
if (typeof (callback) == "function") callback(res.data)
|
||||||
|
}).catch(errorCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getAllSubChannel(isCatalog, deviceId, channelId, callback, endCallback, errorCallback) {
|
||||||
|
let currentPage = 1;
|
||||||
|
let count = 100;
|
||||||
|
let catalogList = []
|
||||||
|
this.getAllSubChannelIteration(isCatalog, deviceId, channelId, catalogList, currentPage, count, callback, endCallback, errorCallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllSubChannelIteration(isCatalog, deviceId,channelId, catalogList, currentPage, count, callback, endCallback, errorCallback) {
|
||||||
|
this.getSubChannel(isCatalog, deviceId, channelId, currentPage, count, (data) => {
|
||||||
|
if (data.list) {
|
||||||
|
if (typeof (callback) == "function") callback(data.list)
|
||||||
|
catalogList = catalogList.concat(data.list);
|
||||||
|
if (catalogList.length < data.total) {
|
||||||
|
currentPage ++
|
||||||
|
this.getAllSubChannelIteration(isCatalog, deviceId, channelId, catalogList, currentPage, count, callback, endCallback, errorCallback)
|
||||||
|
}else {
|
||||||
|
if (typeof (endCallback) == "function") endCallback(catalogList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, errorCallback)
|
||||||
|
}
|
||||||
|
getSubChannel(isCatalog, deviceId, channelId, currentPage, count, callback, errorCallback) {
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/device/query/sub_channels/${deviceId}/${channelId}/channels`,
|
||||||
|
params:{
|
||||||
|
page: currentPage,
|
||||||
|
count: count,
|
||||||
|
query: "",
|
||||||
|
online: "",
|
||||||
|
channelType: isCatalog
|
||||||
|
}
|
||||||
|
}).then((res) =>{
|
||||||
|
if (typeof (callback) == "function") callback(res.data)
|
||||||
|
}).catch(errorCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
getTree(deviceId, parentId, onlyCatalog, callback, endCallback, errorCallback) {
|
||||||
|
let currentPage = 1;
|
||||||
|
let count = 100;
|
||||||
|
let catalogList = []
|
||||||
|
this.getTreeIteration(deviceId, parentId, onlyCatalog, catalogList, currentPage, count, callback, endCallback, errorCallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
getTreeIteration(deviceId, parentId, onlyCatalog, catalogList, currentPage, count, callback, endCallback, errorCallback) {
|
||||||
|
this.getTreeInfo(deviceId, parentId, onlyCatalog, currentPage, count, (data) => {
|
||||||
|
if (data.code === 0 && data.data.list) {
|
||||||
|
if (typeof (callback) == "function") callback(data.data.list)
|
||||||
|
catalogList = catalogList.concat(data.data.list);
|
||||||
|
if (catalogList.length < data.data.total) {
|
||||||
|
currentPage ++
|
||||||
|
this.getTreeIteration(deviceId, parentId, onlyCatalog, catalogList, currentPage, count, callback, endCallback, errorCallback)
|
||||||
|
}else {
|
||||||
|
if (typeof (endCallback) == "function") endCallback(catalogList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, errorCallback)
|
||||||
|
}
|
||||||
|
getTreeInfo(deviceId, parentId, onlyCatalog, currentPage, count, callback, errorCallback) {
|
||||||
|
if (onlyCatalog == null || typeof onlyCatalog === "undefined") {
|
||||||
|
onlyCatalog = false;
|
||||||
|
}
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/device/query/tree/${deviceId}`,
|
||||||
|
params:{
|
||||||
|
page: currentPage,
|
||||||
|
count: count,
|
||||||
|
parentId: parentId,
|
||||||
|
onlyCatalog: onlyCatalog
|
||||||
|
}
|
||||||
|
}).then((res) =>{
|
||||||
|
if (typeof (callback) == "function") callback(res.data)
|
||||||
|
}).catch(errorCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default JTDeviceService;
|
||||||
Loading…
Reference in New Issue
Block a user