临时提交
parent
e285257f24
commit
112cb2dfd8
|
@ -86,13 +86,15 @@ public class CommonChannelController {
|
||||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||||
@Parameter(name = "query", description = "查询内容")
|
@Parameter(name = "query", description = "查询内容")
|
||||||
@Parameter(name = "online", description = "是否在线")
|
@Parameter(name = "online", description = "是否在线")
|
||||||
|
@Parameter(name = "hasCivilCode", description = "是否分配行政区划")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public PageInfo<CommonGBChannel> queryList(int page, int count,
|
public PageInfo<CommonGBChannel> queryList(int page, int count,
|
||||||
@RequestParam(required = false) String query,
|
@RequestParam(required = false) String query,
|
||||||
@RequestParam(required = false) Boolean online){
|
@RequestParam(required = false) Boolean online,
|
||||||
|
@RequestParam(required = false) Boolean hasCivilCode){
|
||||||
if (ObjectUtils.isEmpty(query)){
|
if (ObjectUtils.isEmpty(query)){
|
||||||
query = null;
|
query = null;
|
||||||
}
|
}
|
||||||
return channelService.queryList(page, count, query, online);
|
return channelService.queryList(page, count, query, online, hasCivilCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,7 +306,7 @@ public interface CommonGBChannelMapper {
|
||||||
CommonGBChannel queryByStreamProxyId(@Param("streamProxyId") Integer streamProxyId);
|
CommonGBChannel queryByStreamProxyId(@Param("streamProxyId") Integer streamProxyId);
|
||||||
|
|
||||||
@SelectProvider(type = ChannelProvider.class, method = "queryList")
|
@SelectProvider(type = ChannelProvider.class, method = "queryList")
|
||||||
List<CommonGBChannel> queryList(String query, Boolean online);
|
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online, @Param("hasCivilCode") Boolean hasCivilCode);
|
||||||
|
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
" select " +
|
" select " +
|
||||||
|
|
|
@ -83,6 +83,12 @@ public class ChannelProvider {
|
||||||
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
||||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
||||||
}
|
}
|
||||||
|
if (params.get("hasCivilCode") != null && (Boolean)params.get("hasCivilCode")) {
|
||||||
|
sqlBuild.append(" AND gb_civil_code is not null");
|
||||||
|
}
|
||||||
|
if (params.get("hasCivilCode") != null && !(Boolean)params.get("hasCivilCode")) {
|
||||||
|
sqlBuild.append(" AND gb_civil_code is null");
|
||||||
|
}
|
||||||
return sqlBuild.toString();
|
return sqlBuild.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ public interface IGbChannelService {
|
||||||
|
|
||||||
void reset(int id);
|
void reset(int id);
|
||||||
|
|
||||||
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online);
|
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasCivilCode);
|
||||||
|
|
||||||
void removeCivilCode(List<Region> allChildren);
|
void removeCivilCode(List<Region> allChildren);
|
||||||
}
|
}
|
||||||
|
|
|
@ -319,9 +319,9 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online) {
|
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasCivilCode) {
|
||||||
PageHelper.startPage(page, count);
|
PageHelper.startPage(page, count);
|
||||||
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online);
|
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasCivilCode);
|
||||||
return new PageInfo<>(all);
|
return new PageInfo<>(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,7 @@ export default {
|
||||||
label: "删除节点",
|
label: "删除节点",
|
||||||
icon: "el-icon-delete",
|
icon: "el-icon-delete",
|
||||||
disabled: node.level === 1,
|
disabled: node.level === 1,
|
||||||
|
divided: true,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.$confirm('确定删除?', '提示', {
|
this.$confirm('确定删除?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
|
@ -261,6 +262,22 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "添加设备",
|
||||||
|
icon: "el-icon-plus",
|
||||||
|
disabled: node.level === 1,
|
||||||
|
onClick: () => {
|
||||||
|
this.addChannelFormDevice(data.id, node)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "移除设备",
|
||||||
|
icon: "el-icon-delete",
|
||||||
|
disabled: node.level === 1,
|
||||||
|
onClick: () => {
|
||||||
|
this.removeChannelFormDevice(data.id, node)
|
||||||
|
}
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// label: "导出",
|
// label: "导出",
|
||||||
// icon: "el-icon-download",
|
// icon: "el-icon-download",
|
||||||
|
@ -307,6 +324,12 @@ export default {
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
addChannelFormDevice: function (id, node) {
|
||||||
|
|
||||||
|
},
|
||||||
|
removeChannelFormDevice: function (id, node) {
|
||||||
|
|
||||||
},
|
},
|
||||||
refreshNode: function (node) {
|
refreshNode: function (node) {
|
||||||
node.loaded = false
|
node.loaded = false
|
||||||
|
|
|
@ -0,0 +1,138 @@
|
||||||
|
<template>
|
||||||
|
<div id="addUser" v-loading="getDeviceListLoading">
|
||||||
|
<el-dialog
|
||||||
|
title="选择设备"
|
||||||
|
width="40%"
|
||||||
|
top="2rem"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="showDialog"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
@close="close()"
|
||||||
|
>
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-header-btn">
|
||||||
|
搜索:
|
||||||
|
<el-input @input="getDeviceList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
|
||||||
|
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
||||||
|
在线状态:
|
||||||
|
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getDeviceList" v-model="online" placeholder="请选择"
|
||||||
|
default-first-option>
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="在线" value="true"></el-option>
|
||||||
|
<el-option label="离线" value="false"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading"
|
||||||
|
@click="getDeviceList()"></el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--设备列表-->
|
||||||
|
<el-table :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="name" label="名称" min-width="160">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="deviceId" label="设备编号" min-width="200" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="manufacturer" label="厂家" min-width="120" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" min-width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div slot="reference" class="name-wrapper">
|
||||||
|
<el-tag size="medium" v-if="scope.row.onLine">在线</el-tag>
|
||||||
|
<el-tag size="medium" type="info" v-if="!scope.row.onLine">离线</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
style="float: right"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
:current-page="currentPage"
|
||||||
|
:page-size="count"
|
||||||
|
:page-sizes="[15, 25, 35, 50, 200, 1000, 50000]"
|
||||||
|
layout="total, sizes, prev, pager, next"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "gbDeviceSelect",
|
||||||
|
props: {},
|
||||||
|
computed: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showDialog: false,
|
||||||
|
deviceList: [], //设备列表
|
||||||
|
currentDevice: {}, //当前操作设备对象
|
||||||
|
searchSrt: "",
|
||||||
|
online: null,
|
||||||
|
videoComponentList: [],
|
||||||
|
updateLooper: 0, //数据刷新轮训标志
|
||||||
|
currentDeviceChannelsLenth: 0,
|
||||||
|
winHeight: window.innerHeight - 200,
|
||||||
|
currentPage: 1,
|
||||||
|
count: 15,
|
||||||
|
total: 0,
|
||||||
|
getDeviceListLoading: false,
|
||||||
|
multipleSelection: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initData: function () {
|
||||||
|
this.getDeviceList();
|
||||||
|
},
|
||||||
|
currentChange: function (val) {
|
||||||
|
this.currentPage = val;
|
||||||
|
this.getDeviceList();
|
||||||
|
},
|
||||||
|
handleSizeChange: function (val) {
|
||||||
|
this.count = val;
|
||||||
|
this.getDeviceList();
|
||||||
|
},
|
||||||
|
handleSelectionChange: function (val){
|
||||||
|
this.multipleSelection = val;
|
||||||
|
},
|
||||||
|
getDeviceList: function () {
|
||||||
|
this.getDeviceListLoading = true;
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/device/query/devices`,
|
||||||
|
params: {
|
||||||
|
page: this.currentPage,
|
||||||
|
count: this.count,
|
||||||
|
query: this.searchSrt,
|
||||||
|
status: this.online,
|
||||||
|
}
|
||||||
|
}).then( (res)=> {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.total = res.data.data.total;
|
||||||
|
this.deviceList = res.data.data.list;
|
||||||
|
}
|
||||||
|
this.getDeviceListLoading = false;
|
||||||
|
}).catch( (error)=> {
|
||||||
|
console.error(error);
|
||||||
|
this.getDeviceListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openDialog: function (callback) {
|
||||||
|
this.listChangeCallback = callback;
|
||||||
|
this.showDialog = true;
|
||||||
|
},
|
||||||
|
onSubmit: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
close: function () {
|
||||||
|
this.showDialog = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -20,6 +20,13 @@
|
||||||
<el-option label="在线" value="true"></el-option>
|
<el-option label="在线" value="true"></el-option>
|
||||||
<el-option label="离线" value="false"></el-option>
|
<el-option label="离线" value="false"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
添加状态:
|
||||||
|
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="hasCivilCode" placeholder="请选择"
|
||||||
|
default-first-option>
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="已添加" value="true"></el-option>
|
||||||
|
<el-option label="未添加" value="false"></el-option>
|
||||||
|
</el-select>
|
||||||
<el-button size="mini" type="primary" @click="add()">
|
<el-button size="mini" type="primary" @click="add()">
|
||||||
添加
|
添加
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -40,14 +47,14 @@
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div slot="reference" class="name-wrapper">
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-tag size="medium" v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
<el-tag size="medium" v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
||||||
<el-tag size="medium" type="info" v-if="scope.row.status !== 'ON'">离线</el-tag>
|
<el-tag size="medium" type="info" v-if="scope.row.gbStatus !== 'ON'">离线</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="添加状态" min-width="100">
|
<el-table-column label="添加状态" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div slot="reference" class="name-wrapper">
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-tag size="medium" v-if="scope.row.civilCode">已添加</el-tag>
|
<el-tag size="medium" v-if="scope.row.civilCode">已添加({{scope.row.civilCode}})</el-tag>
|
||||||
<el-tag size="medium" type="info" v-if="!scope.row.civilCode">未添加</el-tag>
|
<el-tag size="medium" type="info" v-if="!scope.row.civilCode">未添加</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -86,6 +93,7 @@ export default {
|
||||||
searchSrt: "",
|
searchSrt: "",
|
||||||
channelType: "",
|
channelType: "",
|
||||||
online: "",
|
online: "",
|
||||||
|
hasCivilCode: "",
|
||||||
winHeight: window.innerHeight - 180,
|
winHeight: window.innerHeight - 180,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
count: 15,
|
count: 15,
|
||||||
|
@ -114,27 +122,27 @@ export default {
|
||||||
this.getChannelList();
|
this.getChannelList();
|
||||||
},
|
},
|
||||||
getChannelList: function () {
|
getChannelList: function () {
|
||||||
let that = this;
|
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/api/common/channel/list`,
|
url: `/api/common/channel/list`,
|
||||||
params: {
|
params: {
|
||||||
page: that.currentPage,
|
page: this.currentPage,
|
||||||
count: that.count,
|
count: this.count,
|
||||||
query: that.searchSrt,
|
query: this.searchSrt,
|
||||||
online: that.online
|
online: this.online,
|
||||||
|
hasCivilCode: this.hasCivilCode
|
||||||
}
|
}
|
||||||
}).then(function (res) {
|
}).then((res)=> {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
that.total = res.data.data.total;
|
this.total = res.data.data.total;
|
||||||
that.channelList = res.data.data.list;
|
this.channelList = res.data.data.list;
|
||||||
// 防止出现表格错位
|
// 防止出现表格错位
|
||||||
that.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
that.$refs.channelListTable.doLayout();
|
this.$refs.channelListTable.doLayout();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch(function (error) {
|
}).catch((error)=> {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -160,7 +160,7 @@ create table wvp_device_channel (
|
||||||
gb_ip_address character varying(50),
|
gb_ip_address character varying(50),
|
||||||
gb_port integer,
|
gb_port integer,
|
||||||
gb_password character varying(50),
|
gb_password character varying(50),
|
||||||
gb_status character varying(50) default 'OFF',
|
gb_status character varying(50),
|
||||||
gb_longitude double,
|
gb_longitude double,
|
||||||
gb_latitude double,
|
gb_latitude double,
|
||||||
gb_business_group_id character varying(50),
|
gb_business_group_id character varying(50),
|
||||||
|
|
Loading…
Reference in New Issue