优化通道管理/业务分组页面逻辑
parent
9a29f44c86
commit
35e3ec5c54
|
@ -98,23 +98,40 @@ public class CommonChannelController {
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "获取关联行政区划通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "page", description = "当前页", required = true)
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
@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 = "civilCode", description = "行政区划")
|
@Parameter(name = "civilCode", description = "行政区划")
|
||||||
@Parameter(name = "groupDeviceId", description = "业务分组下的父节点ID")
|
@GetMapping("/civilcode/list")
|
||||||
@GetMapping("/list")
|
public PageInfo<CommonGBChannel> queryListByCivilCode(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) String civilCode,
|
@RequestParam(required = false) Integer channelType,
|
||||||
|
@RequestParam(required = false) String civilCode){
|
||||||
|
if (ObjectUtils.isEmpty(query)){
|
||||||
|
query = null;
|
||||||
|
}
|
||||||
|
return channelService.queryListByCivilCode(page, count, query, online, channelType, civilCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取关联业务分组通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
|
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||||
|
@Parameter(name = "query", description = "查询内容")
|
||||||
|
@Parameter(name = "online", description = "是否在线")
|
||||||
|
@Parameter(name = "groupDeviceId", description = "业务分组下的父节点ID")
|
||||||
|
@GetMapping("/parent/list")
|
||||||
|
public PageInfo<CommonGBChannel> queryListByParentId(int page, int count,
|
||||||
|
@RequestParam(required = false) String query,
|
||||||
|
@RequestParam(required = false) Boolean online,
|
||||||
|
@RequestParam(required = false) Integer channelType,
|
||||||
@RequestParam(required = false) String groupDeviceId){
|
@RequestParam(required = false) String groupDeviceId){
|
||||||
if (ObjectUtils.isEmpty(query)){
|
if (ObjectUtils.isEmpty(query)){
|
||||||
query = null;
|
query = null;
|
||||||
}
|
}
|
||||||
return channelService.queryList(page, count, query, online, civilCode, groupDeviceId);
|
return channelService.queryListByParentId(page, count, query, online, channelType, groupDeviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "通道设置行政区划", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "通道设置行政区划", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
|
|
@ -40,12 +40,13 @@ public class GroupController {
|
||||||
@GetMapping("/tree/list")
|
@GetMapping("/tree/list")
|
||||||
public List<GroupTree> queryForTree(
|
public List<GroupTree> queryForTree(
|
||||||
@RequestParam(required = false) String query,
|
@RequestParam(required = false) String query,
|
||||||
@RequestParam(required = false) Integer parent
|
@RequestParam(required = false) Integer parent,
|
||||||
|
@RequestParam(required = false) Boolean hasChannel
|
||||||
){
|
){
|
||||||
if (ObjectUtils.isEmpty(query)) {
|
if (ObjectUtils.isEmpty(query)) {
|
||||||
query = null;
|
query = null;
|
||||||
}
|
}
|
||||||
return groupService.queryForTree(query, parent);
|
return groupService.queryForTree(query, parent, hasChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "更新分组")
|
@Operation(summary = "更新分组")
|
||||||
|
@ -68,6 +69,14 @@ public class GroupController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取所属的行政区划下的行政区划")
|
||||||
|
@Parameter(name = "deviceId", description = "当前的行政区划", required = false)
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/path")
|
||||||
|
public List<Group> getPath(String deviceId, String businessGroup){
|
||||||
|
return groupService.getPath(deviceId, businessGroup);
|
||||||
|
}
|
||||||
|
|
||||||
// @Operation(summary = "根据分组Id查询分组")
|
// @Operation(summary = "根据分组Id查询分组")
|
||||||
// @Parameter(name = "groupDeviceId", description = "分组节点编号", required = true)
|
// @Parameter(name = "groupDeviceId", description = "分组节点编号", required = true)
|
||||||
// @ResponseBody
|
// @ResponseBody
|
||||||
|
|
|
@ -255,9 +255,17 @@ public interface CommonGBChannelMapper {
|
||||||
@SelectProvider(type = ChannelProvider.class, method = "queryByStreamProxyId")
|
@SelectProvider(type = ChannelProvider.class, method = "queryByStreamProxyId")
|
||||||
CommonGBChannel queryByStreamProxyId(@Param("streamProxyId") Integer streamProxyId);
|
CommonGBChannel queryByStreamProxyId(@Param("streamProxyId") Integer streamProxyId);
|
||||||
|
|
||||||
@SelectProvider(type = ChannelProvider.class, method = "queryList")
|
@SelectProvider(type = ChannelProvider.class, method = "queryListByCivilCode")
|
||||||
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online,
|
List<CommonGBChannel> queryListByCivilCode(@Param("query") String query, @Param("online") Boolean online,
|
||||||
@Param("civilCode") String civilCode, @Param("groupDeviceId") String groupDeviceId);
|
@Param("channelType") Integer channelType, @Param("civilCode") String civilCode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@SelectProvider(type = ChannelProvider.class, method = "queryListByParentId")
|
||||||
|
List<CommonGBChannel> queryListByParentId(@Param("query") String query, @Param("online") Boolean online,
|
||||||
|
@Param("channelType") Integer channelType, @Param("groupDeviceId") String groupDeviceId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
" select " +
|
" select " +
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class ChannelProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String queryList(Map<String, Object> params ){
|
public String queryListByCivilCode(Map<String, Object> params ){
|
||||||
StringBuilder sqlBuild = new StringBuilder();
|
StringBuilder sqlBuild = new StringBuilder();
|
||||||
sqlBuild.append(BASE_SQL);
|
sqlBuild.append(BASE_SQL);
|
||||||
sqlBuild.append(" where channel_type = 0 ");
|
sqlBuild.append(" where channel_type = 0 ");
|
||||||
|
@ -134,9 +134,50 @@ public class ChannelProvider {
|
||||||
}
|
}
|
||||||
if (params.get("civilCode") != null) {
|
if (params.get("civilCode") != null) {
|
||||||
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) = #{civilCode}");
|
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) = #{civilCode}");
|
||||||
|
}else {
|
||||||
|
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) is null");
|
||||||
|
}
|
||||||
|
if (params.get("channelType") != null) {
|
||||||
|
if ((Integer)params.get("channelType") == 0) {
|
||||||
|
sqlBuild.append(" AND device_db_id is not null");
|
||||||
|
}else if ((Integer)params.get("channelType") == 1) {
|
||||||
|
sqlBuild.append(" AND stream_push_id is not null");
|
||||||
|
}else if ((Integer)params.get("channelType") == 2) {
|
||||||
|
sqlBuild.append(" AND stream_proxy_id is not null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sqlBuild.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String queryListByParentId(Map<String, Object> params ){
|
||||||
|
StringBuilder sqlBuild = new StringBuilder();
|
||||||
|
sqlBuild.append(BASE_SQL);
|
||||||
|
sqlBuild.append(" where channel_type = 0 ");
|
||||||
|
if (params.get("query") != null) {
|
||||||
|
sqlBuild.append(" AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%')" +
|
||||||
|
" OR coalesce(gb_name, name) LIKE concat('%',#{query},'%') )")
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if (params.get("online") != null && (Boolean)params.get("online")) {
|
||||||
|
sqlBuild.append(" AND coalesce(gb_status, status) = 'ON'");
|
||||||
|
}
|
||||||
|
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
||||||
|
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
||||||
}
|
}
|
||||||
if (params.get("groupDeviceId") != null) {
|
if (params.get("groupDeviceId") != null) {
|
||||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId}");
|
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId}");
|
||||||
|
}else {
|
||||||
|
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.get("channelType") != null) {
|
||||||
|
if ((Integer)params.get("channelType") == 0) {
|
||||||
|
sqlBuild.append(" AND device_db_id is not null");
|
||||||
|
}else if ((Integer)params.get("channelType") == 1) {
|
||||||
|
sqlBuild.append(" AND stream_push_id is not null");
|
||||||
|
}else if ((Integer)params.get("channelType") == 2) {
|
||||||
|
sqlBuild.append(" AND stream_proxy_id is not null");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return sqlBuild.toString();
|
return sqlBuild.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,9 @@ public interface IGbChannelService {
|
||||||
|
|
||||||
void reset(int id);
|
void reset(int id);
|
||||||
|
|
||||||
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, String civilCode, String groupDeviceId);
|
PageInfo<CommonGBChannel> queryListByCivilCode(int page, int count, String query, Boolean online, Integer channelType, String civilCode);
|
||||||
|
|
||||||
|
PageInfo<CommonGBChannel> queryListByParentId(int page, int count, String query, Boolean online, Integer channelType, String groupDeviceId);
|
||||||
|
|
||||||
void removeCivilCode(List<Region> allChildren);
|
void removeCivilCode(List<Region> allChildren);
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,13 @@ public interface IGroupService {
|
||||||
|
|
||||||
Group queryGroupByDeviceId(String regionDeviceId);
|
Group queryGroupByDeviceId(String regionDeviceId);
|
||||||
|
|
||||||
List<GroupTree> queryForTree(String query, Integer parent);
|
List<GroupTree> queryForTree(String query, Integer parent, Boolean hasChannel);
|
||||||
|
|
||||||
void syncFromChannel();
|
void syncFromChannel();
|
||||||
|
|
||||||
boolean delete(int id);
|
boolean delete(int id);
|
||||||
|
|
||||||
boolean batchAdd(List<Group> groupList);
|
boolean batchAdd(List<Group> groupList);
|
||||||
|
|
||||||
|
List<Group> getPath(String deviceId, String businessGroup);
|
||||||
}
|
}
|
||||||
|
|
|
@ -388,9 +388,16 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, String civilCode, String groupDeviceId) {
|
public PageInfo<CommonGBChannel> queryListByCivilCode(int page, int count, String query, Boolean online, Integer channelType, String civilCode) {
|
||||||
PageHelper.startPage(page, count);
|
PageHelper.startPage(page, count);
|
||||||
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, civilCode, groupDeviceId);
|
List<CommonGBChannel> all = commonGBChannelMapper.queryListByCivilCode(query, online, channelType, civilCode);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<CommonGBChannel> queryListByParentId(int page, int count, String query, Boolean online, Integer channelType, String groupDeviceId) {
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
List<CommonGBChannel> all = commonGBChannelMapper.queryListByParentId(query, online, channelType, groupDeviceId);
|
||||||
return new PageInfo<>(all);
|
return new PageInfo<>(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.service.impl;
|
package com.genersoft.iot.vmp.gb28181.service.impl;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.CommonGBChannelMapper;
|
import com.genersoft.iot.vmp.gb28181.dao.CommonGBChannelMapper;
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.GroupMapper;
|
import com.genersoft.iot.vmp.gb28181.dao.GroupMapper;
|
||||||
|
@ -8,6 +9,7 @@ import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IGroupService;
|
import com.genersoft.iot.vmp.gb28181.service.IGroupService;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -15,10 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区域管理类
|
* 区域管理类
|
||||||
|
@ -154,7 +153,7 @@ public class GroupServiceImpl implements IGroupService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GroupTree> queryForTree(String query, Integer parentId) {
|
public List<GroupTree> queryForTree(String query, Integer parentId, Boolean hasChannel) {
|
||||||
|
|
||||||
List<GroupTree> groupTrees = groupManager.queryForTree(query, parentId);
|
List<GroupTree> groupTrees = groupManager.queryForTree(query, parentId);
|
||||||
if (parentId == null) {
|
if (parentId == null) {
|
||||||
|
@ -162,7 +161,7 @@ public class GroupServiceImpl implements IGroupService {
|
||||||
}
|
}
|
||||||
// 查询含有的通道
|
// 查询含有的通道
|
||||||
Group parentGroup = groupManager.queryOne(parentId);
|
Group parentGroup = groupManager.queryOne(parentId);
|
||||||
if (parentGroup != null ) {
|
if (parentGroup != null && hasChannel != null && hasChannel) {
|
||||||
List<GroupTree> groupTreesForChannel = commonGBChannelMapper.queryForGroupTreeByParentId(query, parentGroup.getDeviceId());
|
List<GroupTree> groupTreesForChannel = commonGBChannelMapper.queryForGroupTreeByParentId(query, parentGroup.getDeviceId());
|
||||||
if (!ObjectUtils.isEmpty(groupTreesForChannel)) {
|
if (!ObjectUtils.isEmpty(groupTreesForChannel)) {
|
||||||
groupTrees.addAll(groupTreesForChannel);
|
groupTrees.addAll(groupTreesForChannel);
|
||||||
|
@ -247,4 +246,37 @@ public class GroupServiceImpl implements IGroupService {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Group> getPath(String deviceId, String businessGroup) {
|
||||||
|
Group businessGroupInDb = groupManager.queryBusinessGroup(businessGroup);
|
||||||
|
if (businessGroupInDb == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "业务分组不存在");
|
||||||
|
}
|
||||||
|
List<Group> groupList = new LinkedList<>();
|
||||||
|
groupList.add(businessGroupInDb);
|
||||||
|
Group group = groupManager.queryOneByDeviceId(deviceId, businessGroup);
|
||||||
|
if (group == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "虚拟组织不存在");
|
||||||
|
}
|
||||||
|
groupList.add(group);
|
||||||
|
List<Group> allParent = getAllParent(group);
|
||||||
|
groupList.addAll(allParent);
|
||||||
|
return groupList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Group> getAllParent(Group group) {
|
||||||
|
if (group.getParentId() == null || group.getBusinessGroup() == null) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Group> groupList = new ArrayList<>();
|
||||||
|
Group parent = groupManager.queryOneByDeviceId(group.getParentDeviceId(), group.getBusinessGroup());
|
||||||
|
if (parent == null) {
|
||||||
|
return groupList;
|
||||||
|
}
|
||||||
|
List<Group> allParent = getAllParent(parent);
|
||||||
|
allParent.add(parent);
|
||||||
|
return allParent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,13 +242,14 @@ public class RegionServiceImpl implements IRegionService {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Region> regionList = new ArrayList<>();
|
List<Region> regionList = new LinkedList<>();
|
||||||
Region parent = regionMapper.queryByDeviceId(region.getParentDeviceId());
|
Region parent = regionMapper.queryByDeviceId(region.getParentDeviceId());
|
||||||
if (parent == null) {
|
if (parent == null) {
|
||||||
return regionList;
|
return regionList;
|
||||||
}
|
}
|
||||||
|
regionList.add(parent);
|
||||||
List<Region> allParent = getAllParent(parent);
|
List<Region> allParent = getAllParent(parent);
|
||||||
allParent.add(parent);
|
regionList.addAll(allParent);
|
||||||
return allParent;
|
return regionList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
"@wchbrad/vue-easy-tree": "^1.0.12",
|
"@wchbrad/vue-easy-tree": "^1.0.12",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"core-js": "^2.6.5",
|
"core-js": "^2.6.5",
|
||||||
"defineProperty": "link:@babel/runtime/helpers/defineProperty",
|
|
||||||
"echarts": "^4.9.0",
|
"echarts": "^4.9.0",
|
||||||
"element-ui": "^2.15.14",
|
"element-ui": "^2.15.14",
|
||||||
"fingerprintjs2": "^2.1.2",
|
"fingerprintjs2": "^2.1.2",
|
||||||
|
@ -24,7 +23,6 @@
|
||||||
"ol": "^6.14.1",
|
"ol": "^6.14.1",
|
||||||
"postcss-pxtorem": "^5.1.1",
|
"postcss-pxtorem": "^5.1.1",
|
||||||
"screenfull": "5.1.0",
|
"screenfull": "5.1.0",
|
||||||
"slicedToArray": "link:@babel/runtime/helpers/slicedToArray",
|
|
||||||
"strip-ansi": "^7.1.0",
|
"strip-ansi": "^7.1.0",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"v-charts": "^1.19.0",
|
"v-charts": "^1.19.0",
|
||||||
|
|
|
@ -4,14 +4,15 @@
|
||||||
<div class="page-title">业务分组</div>
|
<div class="page-title">业务分组</div>
|
||||||
<div class="page-header-btn">
|
<div class="page-header-btn">
|
||||||
<div style="display: inline;">
|
<div style="display: inline;">
|
||||||
<el-input @input="search" style="visibility:hidden; margin-right: 1rem; width: 12rem;" size="mini" placeholder="关键字"
|
<el-input @input="search" style="visibility:hidden; margin-right: 1rem; width: 12rem;" size="mini"
|
||||||
|
placeholder="关键字"
|
||||||
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
||||||
|
|
||||||
<el-checkbox v-model="showCode">显示编号</el-checkbox>
|
<el-checkbox v-model="showCode">显示编号</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showHeader" style="height: 2rem; background-color: #FFFFFF" ></div>
|
<div v-if="showHeader" style="height: 2rem; background-color: #FFFFFF"></div>
|
||||||
<div>
|
<div>
|
||||||
<vue-easy-tree
|
<vue-easy-tree
|
||||||
class="flow-tree"
|
class="flow-tree"
|
||||||
|
@ -29,10 +30,8 @@
|
||||||
>
|
>
|
||||||
<template v-slot:default="{ node, data }">
|
<template v-slot:default="{ node, data }">
|
||||||
<span class="custom-tree-node">
|
<span class="custom-tree-node">
|
||||||
<span @click.stop v-if="edit">
|
<span v-if="node.data.type === 0 && chooseId !== node.data.deviceId" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span>
|
||||||
<el-radio v-if="node.data.type === 0 && node.level > 2" style="margin-right: 0" v-model="chooseId" @input="chooseIdChange(node.data.treeId, node.data.deviceId, node.data.businessGroup)" :label="node.data.deviceId">{{''}}</el-radio>
|
<span v-if="node.data.type === 0 && chooseId === node.data.deviceId" style="color: #c60135;" class="iconfont icon-bianzubeifen3"></span>
|
||||||
</span>
|
|
||||||
<span v-if="node.data.type === 0" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span>
|
|
||||||
<span v-if="node.data.type === 1 && node.data.status === 'ON'" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span>
|
<span v-if="node.data.type === 1 && node.data.status === 'ON'" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span>
|
||||||
<span v-if="node.data.type === 1 && node.data.status !== 'ON'" style="color: #808181" class="iconfont icon-shexiangtou2"></span>
|
<span v-if="node.data.type === 1 && node.data.status !== 'ON'" style="color: #808181" class="iconfont icon-shexiangtou2"></span>
|
||||||
<span style=" padding-left: 1px" v-if="node.data.deviceId !=='' && showCode" :title="node.data.deviceId">{{ node.label }}(编号:{{ node.data.deviceId }})</span>
|
<span style=" padding-left: 1px" v-if="node.data.deviceId !=='' && showCode" :title="node.data.deviceId">{{ node.label }}(编号:{{ node.data.deviceId }})</span>
|
||||||
|
@ -43,6 +42,7 @@
|
||||||
</div>
|
</div>
|
||||||
<groupEdit ref="groupEdit"></groupEdit>
|
<groupEdit ref="groupEdit"></groupEdit>
|
||||||
<gbDeviceSelect ref="gbDeviceSelect"></gbDeviceSelect>
|
<gbDeviceSelect ref="gbDeviceSelect"></gbDeviceSelect>
|
||||||
|
<gbChannelSelect ref="gbChannelSelect"></gbChannelSelect>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -50,10 +50,12 @@
|
||||||
import VueEasyTree from "@wchbrad/vue-easy-tree";
|
import VueEasyTree from "@wchbrad/vue-easy-tree";
|
||||||
import groupEdit from './../dialog/groupEdit'
|
import groupEdit from './../dialog/groupEdit'
|
||||||
import gbDeviceSelect from './../dialog/GbDeviceSelect'
|
import gbDeviceSelect from './../dialog/GbDeviceSelect'
|
||||||
|
import GbChannelSelect from "../dialog/GbChannelSelect.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DeviceTree',
|
name: 'DeviceTree',
|
||||||
components: {
|
components: {
|
||||||
|
GbChannelSelect,
|
||||||
VueEasyTree, groupEdit, gbDeviceSelect
|
VueEasyTree, groupEdit, gbDeviceSelect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -68,7 +70,7 @@ export default {
|
||||||
treeData: [],
|
treeData: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: ['edit', 'clickEvent', 'chooseIdChange', 'onChannelChange', 'showHeader'],
|
props: ['edit', 'clickEvent', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToGroup'],
|
||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -94,7 +96,8 @@ export default {
|
||||||
url: `/api/group/tree/list`,
|
url: `/api/group/tree/list`,
|
||||||
params: {
|
params: {
|
||||||
query: this.searchSrt,
|
query: this.searchSrt,
|
||||||
parent: node.data.id
|
parent: node.data.id,
|
||||||
|
hasChannel: this.hasChannel
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
|
@ -113,42 +116,7 @@ export default {
|
||||||
if (!this.edit) {
|
if (!this.edit) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(node.level)
|
if (node.data.type === 0) {
|
||||||
if (node.data.type === 1) {
|
|
||||||
data.parentId = node.parent.data.id;
|
|
||||||
this.$contextmenu({
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: "移除通道",
|
|
||||||
icon: "el-icon-delete",
|
|
||||||
disabled: false,
|
|
||||||
onClick: () => {
|
|
||||||
console.log(data)
|
|
||||||
this.$axios({
|
|
||||||
method: "post",
|
|
||||||
url: `/api/common/channel/group/delete`,
|
|
||||||
data: {
|
|
||||||
channelIds: [data.id]
|
|
||||||
}
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("移除成功")
|
|
||||||
console.log(node)
|
|
||||||
if (this.onChannelChange) {
|
|
||||||
this.onChannelChange()
|
|
||||||
}
|
|
||||||
node.parent.loaded = false
|
|
||||||
node.parent.expand();
|
|
||||||
}).catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
event, // 鼠标事件信息
|
|
||||||
customClass: "custom-class", // 自定义菜单 class
|
|
||||||
zIndex: 3000, // 菜单样式 z-index
|
|
||||||
});
|
|
||||||
} else if (node.data.type === 0) {
|
|
||||||
this.$contextmenu({
|
this.$contextmenu({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
@ -204,10 +172,19 @@ export default {
|
||||||
label: "移除设备",
|
label: "移除设备",
|
||||||
icon: "el-icon-delete",
|
icon: "el-icon-delete",
|
||||||
disabled: node.level <= 2,
|
disabled: node.level <= 2,
|
||||||
|
divided: true,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.removeChannelFormDevice(data.id, node)
|
this.removeChannelFormDevice(data.id, node)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "添加通道",
|
||||||
|
icon: "el-icon-plus",
|
||||||
|
disabled: node.level <= 2,
|
||||||
|
onClick: () => {
|
||||||
|
this.addChannel(data.id, node)
|
||||||
|
}
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// label: "导出",
|
// label: "导出",
|
||||||
// icon: "el-icon-download",
|
// icon: "el-icon-download",
|
||||||
|
@ -250,7 +227,7 @@ export default {
|
||||||
node.parent.loaded = false
|
node.parent.loaded = false
|
||||||
node.parent.expand();
|
node.parent.expand();
|
||||||
if (this.onChannelChange) {
|
if (this.onChannelChange) {
|
||||||
this.onChannelChange()
|
this.onChannelChange(node.data.deviceId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
|
@ -258,7 +235,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
addChannelFormDevice: function (id, node) {
|
addChannelFormDevice: function (id, node) {
|
||||||
this.$refs.gbDeviceSelect.openDialog((rows)=>{
|
this.$refs.gbDeviceSelect.openDialog((rows) => {
|
||||||
let deviceIds = []
|
let deviceIds = []
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
deviceIds.push(rows[i].id)
|
deviceIds.push(rows[i].id)
|
||||||
|
@ -271,7 +248,7 @@ export default {
|
||||||
businessGroup: node.data.businessGroup,
|
businessGroup: node.data.businessGroup,
|
||||||
deviceIds: deviceIds,
|
deviceIds: deviceIds,
|
||||||
}
|
}
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
|
@ -283,14 +260,14 @@ export default {
|
||||||
console.log(node)
|
console.log(node)
|
||||||
node.loaded = false
|
node.loaded = false
|
||||||
node.expand();
|
node.expand();
|
||||||
}else {
|
} else {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: res.data.msg
|
message: res.data.msg
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch((error)=> {
|
}).catch((error) => {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: error
|
message: error
|
||||||
|
@ -300,7 +277,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
removeChannelFormDevice: function (id, node) {
|
removeChannelFormDevice: function (id, node) {
|
||||||
this.$refs.gbDeviceSelect.openDialog((rows)=>{
|
this.$refs.gbDeviceSelect.openDialog((rows) => {
|
||||||
let deviceIds = []
|
let deviceIds = []
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
deviceIds.push(rows[i].id)
|
deviceIds.push(rows[i].id)
|
||||||
|
@ -311,7 +288,7 @@ export default {
|
||||||
data: {
|
data: {
|
||||||
deviceIds: deviceIds,
|
deviceIds: deviceIds,
|
||||||
}
|
}
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
|
@ -322,14 +299,14 @@ export default {
|
||||||
}
|
}
|
||||||
node.loaded = false
|
node.loaded = false
|
||||||
node.expand();
|
node.expand();
|
||||||
}else {
|
} else {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: res.data.msg
|
message: res.data.msg
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch((error)=> {
|
}).catch((error) => {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: error
|
message: error
|
||||||
|
@ -338,6 +315,13 @@ export default {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
addChannel: function (id, node) {
|
||||||
|
this.$refs.gbChannelSelect.openDialog((data) => {
|
||||||
|
console.log("选择的数据")
|
||||||
|
console.log(data)
|
||||||
|
this.addChannelToGroup(node.data.deviceId, node.data.businessGroup, data)
|
||||||
|
})
|
||||||
|
},
|
||||||
refreshNode: function (node) {
|
refreshNode: function (node) {
|
||||||
console.log(node)
|
console.log(node)
|
||||||
node.loaded = false
|
node.loaded = false
|
||||||
|
@ -358,10 +342,10 @@ export default {
|
||||||
name: "",
|
name: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
civilCode: "",
|
civilCode: "",
|
||||||
parentDeviceId: node.level > 2 ? node.data.deviceId:"",
|
parentDeviceId: node.level > 2 ? node.data.deviceId : "",
|
||||||
parentId: node.data.id,
|
parentId: node.data.id,
|
||||||
businessGroup: node.level > 2 ? node.data.businessGroup: node.data.deviceId,
|
businessGroup: node.level > 2 ? node.data.businessGroup : node.data.deviceId,
|
||||||
},form => {
|
}, form => {
|
||||||
console.log(node)
|
console.log(node)
|
||||||
node.loaded = false
|
node.loaded = false
|
||||||
node.expand();
|
node.expand();
|
||||||
|
@ -369,13 +353,14 @@ export default {
|
||||||
},
|
},
|
||||||
editGroup: function (id, node) {
|
editGroup: function (id, node) {
|
||||||
console.log(node)
|
console.log(node)
|
||||||
this.$refs.groupEdit.openDialog(node.data,form => {
|
this.$refs.groupEdit.openDialog(node.data, form => {
|
||||||
console.log(node)
|
console.log(node)
|
||||||
node.parent.loaded = false
|
node.parent.loaded = false
|
||||||
node.parent.expand();
|
node.parent.expand();
|
||||||
}, id);
|
}, id);
|
||||||
},
|
},
|
||||||
nodeClickHandler: function (data, node, tree) {
|
nodeClickHandler: function (data, node, tree) {
|
||||||
|
this.chooseId = data.deviceId;
|
||||||
if (this.clickEvent) {
|
if (this.clickEvent) {
|
||||||
this.clickEvent(data)
|
this.clickEvent(data)
|
||||||
}
|
}
|
||||||
|
@ -404,6 +389,7 @@ export default {
|
||||||
.device-offline {
|
.device-offline {
|
||||||
color: #727272;
|
color: #727272;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-tree-node .el-radio__label {
|
.custom-tree-node .el-radio__label {
|
||||||
padding-left: 4px !important;
|
padding-left: 4px !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<template class="custom-tree-node" v-slot:default="{ node, data }">
|
<template class="custom-tree-node" v-slot:default="{ node, data }">
|
||||||
<span class="custom-tree-node" >
|
<span class="custom-tree-node" >
|
||||||
<span v-if="node.data.type === 0 && chooseId !== node.data.deviceId" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span>
|
<span v-if="node.data.type === 0 && chooseId !== node.data.deviceId" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span>
|
||||||
<span v-if="node.data.type === 0 && chooseId === node.data.deviceId" style="color: #013e83;" class="iconfont icon-bianzubeifen3"></span>
|
<span v-if="node.data.type === 0 && chooseId === node.data.deviceId" style="color: #c60135;" class="iconfont icon-bianzubeifen3"></span>
|
||||||
<span v-if="node.data.type === 1 && node.data.status === 'ON'" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span>
|
<span v-if="node.data.type === 1 && node.data.status === 'ON'" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span>
|
||||||
<span v-if="node.data.type === 1 && node.data.status !== 'ON'" style="color: #808181" class="iconfont icon-shexiangtou2"></span>
|
<span v-if="node.data.type === 1 && node.data.status !== 'ON'" style="color: #808181" class="iconfont icon-shexiangtou2"></span>
|
||||||
<span style=" padding-left: 1px" v-if="node.data.deviceId !=='' && showCode" :title="node.data.deviceId">{{ node.label }}(编号:{{ node.data.deviceId }})</span>
|
<span style=" padding-left: 1px" v-if="node.data.deviceId !=='' && showCode" :title="node.data.deviceId">{{ node.label }}(编号:{{ node.data.deviceId }})</span>
|
||||||
|
@ -41,6 +41,7 @@
|
||||||
</div>
|
</div>
|
||||||
<regionEdit ref="regionEdit"></regionEdit>
|
<regionEdit ref="regionEdit"></regionEdit>
|
||||||
<gbDeviceSelect ref="gbDeviceSelect"></gbDeviceSelect>
|
<gbDeviceSelect ref="gbDeviceSelect"></gbDeviceSelect>
|
||||||
|
<GbChannelSelect ref="gbChannelSelect" dataType="civilCode"></GbChannelSelect>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -48,10 +49,12 @@
|
||||||
import VueEasyTree from "@wchbrad/vue-easy-tree";
|
import VueEasyTree from "@wchbrad/vue-easy-tree";
|
||||||
import regionEdit from './../dialog/regionEdit'
|
import regionEdit from './../dialog/regionEdit'
|
||||||
import gbDeviceSelect from './../dialog/GbDeviceSelect'
|
import gbDeviceSelect from './../dialog/GbDeviceSelect'
|
||||||
|
import GbChannelSelect from "../dialog/GbChannelSelect.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DeviceTree',
|
name: 'DeviceTree',
|
||||||
components: {
|
components: {
|
||||||
|
GbChannelSelect,
|
||||||
VueEasyTree, regionEdit, gbDeviceSelect
|
VueEasyTree, regionEdit, gbDeviceSelect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -65,7 +68,7 @@ export default {
|
||||||
treeData: [],
|
treeData: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: ['edit', 'clickEvent', 'onChannelChange', 'showHeader', 'hasChannel'],
|
props: ['edit', 'clickEvent', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToCivilCode'],
|
||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -249,7 +252,7 @@ export default {
|
||||||
message: "保存成功"
|
message: "保存成功"
|
||||||
})
|
})
|
||||||
if (this.onChannelChange) {
|
if (this.onChannelChange) {
|
||||||
this.onChannelChange(node.data.deviceId)
|
this.onChannelChange()
|
||||||
}
|
}
|
||||||
node.loaded = false
|
node.loaded = false
|
||||||
node.expand();
|
node.expand();
|
||||||
|
@ -309,43 +312,10 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addChannel: function (id, node) {
|
addChannel: function (id, node) {
|
||||||
this.$refs.gbDeviceSelect.openDialog((rows)=>{
|
this.$refs.gbChannelSelect.openDialog((data) => {
|
||||||
let deviceIds = []
|
console.log("选择的数据")
|
||||||
for (let i = 0; i < rows.length; i++) {
|
console.log(data)
|
||||||
deviceIds.push(rows[i].id)
|
this.addChannelToCivilCode(node.data.deviceId, data)
|
||||||
}
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: `/api/common/channel/region/device/add`,
|
|
||||||
data: {
|
|
||||||
civilCode: node.data.deviceId,
|
|
||||||
deviceIds: deviceIds,
|
|
||||||
}
|
|
||||||
}).then((res)=> {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
this.$message.success({
|
|
||||||
showClose: true,
|
|
||||||
message: "保存成功"
|
|
||||||
})
|
|
||||||
if (this.onChannelChange) {
|
|
||||||
this.onChannelChange(node.data.deviceId)
|
|
||||||
}
|
|
||||||
node.loaded = false
|
|
||||||
node.expand();
|
|
||||||
}else {
|
|
||||||
this.$message.error({
|
|
||||||
showClose: true,
|
|
||||||
message: res.data.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loading = false
|
|
||||||
}).catch((error)=> {
|
|
||||||
this.$message.error({
|
|
||||||
showClose: true,
|
|
||||||
message: error
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
refreshNode: function (node) {
|
refreshNode: function (node) {
|
||||||
|
@ -383,8 +353,7 @@ export default {
|
||||||
}, node.data);
|
}, node.data);
|
||||||
},
|
},
|
||||||
nodeClickHandler: function (data, node, tree) {
|
nodeClickHandler: function (data, node, tree) {
|
||||||
console.log(data)
|
|
||||||
console.log(node)
|
|
||||||
this.chooseId = data.deviceId;
|
this.chooseId = data.deviceId;
|
||||||
if (this.clickEvent) {
|
if (this.clickEvent) {
|
||||||
this.clickEvent(data)
|
this.clickEvent(data)
|
||||||
|
|
|
@ -0,0 +1,185 @@
|
||||||
|
<template>
|
||||||
|
<div id="gbChannelSelect" v-loading="getChannelListLoading">
|
||||||
|
<el-dialog
|
||||||
|
title="添加国标通道"
|
||||||
|
width="60%"
|
||||||
|
top="2rem"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="showDialog"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
append-to-body
|
||||||
|
@close="close()"
|
||||||
|
>
|
||||||
|
<div class="page-header" style="width: 100%">
|
||||||
|
<div class="page-header-btn" style="width: 100%; text-align: left">
|
||||||
|
搜索:
|
||||||
|
<el-input @input="getChannelList" 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="getChannelList" 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-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getChannelList" v-model="channelType" placeholder="请选择"
|
||||||
|
default-first-option>
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="国标设备" :value="0"></el-option>
|
||||||
|
<el-option label="推流设备" :value="1"></el-option>
|
||||||
|
<el-option label="拉流代理" :value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button size="mini" :loading="getChannelListLoading"
|
||||||
|
@click="getChannelList()">刷新</el-button>
|
||||||
|
<el-button type="primary" size="mini" style="float: right" @click="onSubmit">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--通道列表-->
|
||||||
|
<el-table size="small" ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%;"
|
||||||
|
header-row-class-name="table-header" @selection-change="handleSelectionChange" >
|
||||||
|
<el-table-column type="selection" width="55" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="gbName" label="名称" min-width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="gbDeviceId" label="编号" min-width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="gbManufacturer" label="厂家" min-width="100">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="类型" min-width="100">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<div slot="reference" class="name-wrapper">
|
||||||
|
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId">国标设备</el-tag>
|
||||||
|
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId">推流设备</el-tag>
|
||||||
|
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId">拉流代理</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" min-width="100">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<div slot="reference" class="name-wrapper">
|
||||||
|
<el-tag size="medium" v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
||||||
|
<el-tag size="medium" type="info" v-if="scope.row.gbStatus !== 'ON'">离线</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
style="text-align: right"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
:current-page="currentPage"
|
||||||
|
:page-size="count"
|
||||||
|
:page-sizes="[10, 25, 35, 50, 200, 1000, 50000]"
|
||||||
|
layout="total, sizes, prev, pager, next"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "gbChannelSelect",
|
||||||
|
props: ['dataType', "selected"],
|
||||||
|
computed: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showDialog: false,
|
||||||
|
channelList: [], //设备列表
|
||||||
|
currentDevice: {}, //当前操作设备对象
|
||||||
|
searchSrt: "",
|
||||||
|
online: null,
|
||||||
|
channelType: "",
|
||||||
|
videoComponentList: [],
|
||||||
|
updateLooper: 0, //数据刷新轮训标志
|
||||||
|
currentDeviceChannelsLenth: 0,
|
||||||
|
winHeight: 580,
|
||||||
|
currentPage: 1,
|
||||||
|
count: 10,
|
||||||
|
total: 0,
|
||||||
|
getChannelListLoading: false,
|
||||||
|
multipleSelection: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initData: function () {
|
||||||
|
this.getChannelList();
|
||||||
|
},
|
||||||
|
currentChange: function (val) {
|
||||||
|
this.currentPage = val;
|
||||||
|
this.getChannelList();
|
||||||
|
},
|
||||||
|
handleSizeChange: function (val) {
|
||||||
|
this.count = val;
|
||||||
|
this.getChannelList();
|
||||||
|
},
|
||||||
|
handleSelectionChange: function (val){
|
||||||
|
this.multipleSelection = val;
|
||||||
|
},
|
||||||
|
getChannelList: function () {
|
||||||
|
this.getChannelListLoading = true;
|
||||||
|
if (this.dataType === "civilCode") {
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/common/channel/civilcode/list`,
|
||||||
|
params: {
|
||||||
|
page: this.currentPage,
|
||||||
|
count: this.count,
|
||||||
|
channelType: this.channelType,
|
||||||
|
query: this.searchSrt,
|
||||||
|
online: this.online,
|
||||||
|
}
|
||||||
|
}).then( (res)=> {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.total = res.data.data.total;
|
||||||
|
this.channelList = res.data.data.list;
|
||||||
|
}
|
||||||
|
this.getChannelListLoading = false;
|
||||||
|
}).catch( (error)=> {
|
||||||
|
console.error(error);
|
||||||
|
this.getChannelListLoading = false;
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/common/channel/parent/list`,
|
||||||
|
params: {
|
||||||
|
page: this.currentPage,
|
||||||
|
count: this.count,
|
||||||
|
query: this.searchSrt,
|
||||||
|
channelType: this.channelType,
|
||||||
|
online: this.online,
|
||||||
|
}
|
||||||
|
}).then( (res)=> {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.total = res.data.data.total;
|
||||||
|
this.channelList = res.data.data.list;
|
||||||
|
}
|
||||||
|
this.getChannelListLoading = false;
|
||||||
|
}).catch( (error)=> {
|
||||||
|
console.error(error);
|
||||||
|
this.getChannelListLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
openDialog: function (callback) {
|
||||||
|
this.listChangeCallback = callback;
|
||||||
|
this.showDialog = true;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
onSubmit: function () {
|
||||||
|
if (this.listChangeCallback ) {
|
||||||
|
this.listChangeCallback(this.multipleSelection)
|
||||||
|
}
|
||||||
|
this.showDialog = false;
|
||||||
|
},
|
||||||
|
close: function () {
|
||||||
|
this.showDialog = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -1,12 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="region" style="width: 100%">
|
<div id="region" style="width: 100%">
|
||||||
<el-container v-loading="loading" >
|
<el-container v-loading="loading">
|
||||||
<el-aside width="400px" >
|
<el-aside width="400px">
|
||||||
<GroupTree ref="groupTree" :show-header="true" :edit="true" :clickEvent="treeNodeClickEvent" :chooseIdChange="chooseIdChange" :onChannelChange="getChannelList"></GroupTree>
|
<GroupTree ref="groupTree" :show-header="true" :edit="true" :clickEvent="treeNodeClickEvent"
|
||||||
|
:onChannelChange="onChannelChange" :addChannelToGroup="addChannelToGroup"></GroupTree>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-main style="padding: 5px;">
|
<el-main style="padding: 5px;">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-title">通道列表</div>
|
<div class="page-title">
|
||||||
|
<el-breadcrumb separator="/">
|
||||||
|
<el-breadcrumb-item v-for="key in regionParents" key="key">{{ key }}</el-breadcrumb-item>
|
||||||
|
</el-breadcrumb>
|
||||||
|
</div>
|
||||||
<div class="page-header-btn">
|
<div class="page-header-btn">
|
||||||
<div style="display: inline;">
|
<div style="display: inline;">
|
||||||
搜索:
|
搜索:
|
||||||
|
@ -14,32 +19,36 @@
|
||||||
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
||||||
|
|
||||||
在线状态:
|
在线状态:
|
||||||
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="online" placeholder="请选择"
|
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="online"
|
||||||
|
placeholder="请选择"
|
||||||
default-first-option>
|
default-first-option>
|
||||||
<el-option label="全部" value=""></el-option>
|
<el-option label="全部" value=""></el-option>
|
||||||
<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="hasGroup" placeholder="请选择"
|
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getChannelList"
|
||||||
|
v-model="channelType" placeholder="请选择"
|
||||||
default-first-option>
|
default-first-option>
|
||||||
<el-option label="全部" value=""></el-option>
|
<el-option label="全部" value=""></el-option>
|
||||||
<el-option label="已添加" value="true"></el-option>
|
<el-option label="国标设备" :value="0"></el-option>
|
||||||
<el-option label="未添加" value="false"></el-option>
|
<el-option label="推流设备" :value="1"></el-option>
|
||||||
|
<el-option label="拉流代理" :value="2"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button v-if="hasGroup !=='true'" size="mini" type="primary" @click="add()">
|
<el-button size="mini" type="primary" @click="add()">
|
||||||
添加
|
添加通道
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="hasGroup ==='true'" size="mini" type="danger" @click="remove()">
|
<el-button v-bind:disabled="multipleSelection.length === 0" size="mini" type="danger" @click="remove()">
|
||||||
移除
|
移除通道
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button icon="el-icon-refresh-right" circle size="mini" @click="getChannelList()"></el-button>
|
<el-button icon="el-icon-refresh-right" circle size="mini" @click="getChannelList()"></el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table size="medium" ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%"
|
<el-table size="medium" ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%"
|
||||||
header-row-class-name="table-header" @selection-change="handleSelectionChange" @row-dblclick="rowDblclick">
|
header-row-class-name="table-header" @selection-change="handleSelectionChange"
|
||||||
<el-table-column type="selection" width="55" :selectable="selectable">
|
@row-dblclick="rowDblclick">
|
||||||
|
<el-table-column type="selection" width="55" >
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="gbName" label="名称" min-width="180">
|
<el-table-column prop="gbName" label="名称" min-width="180">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -64,14 +73,6 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="添加状态" min-width="100">
|
|
||||||
<template v-slot:default="scope">
|
|
||||||
<div slot="reference" class="name-wrapper">
|
|
||||||
<el-tag size="medium" :title="scope.row.gbParentId" v-if="scope.row.gbParentId">已添加</el-tag>
|
|
||||||
<el-tag size="medium" type="info" v-if="!scope.row.gbParentId">未添加</el-tag>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="text-align: right"
|
style="text-align: right"
|
||||||
|
@ -85,7 +86,7 @@
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
<GbChannelSelect ref="gbChannelSelect" dataType="civilCode"></GbChannelSelect>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -93,10 +94,12 @@
|
||||||
import uiHeader from '../layout/UiHeader.vue'
|
import uiHeader from '../layout/UiHeader.vue'
|
||||||
import DeviceService from "./service/DeviceService";
|
import DeviceService from "./service/DeviceService";
|
||||||
import GroupTree from "./common/GroupTree.vue";
|
import GroupTree from "./common/GroupTree.vue";
|
||||||
|
import GbChannelSelect from "./dialog/GbChannelSelect.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'channelList',
|
name: 'channelList',
|
||||||
components: {
|
components: {
|
||||||
|
GbChannelSelect,
|
||||||
uiHeader,
|
uiHeader,
|
||||||
GroupTree,
|
GroupTree,
|
||||||
},
|
},
|
||||||
|
@ -116,6 +119,7 @@ export default {
|
||||||
groupDeviceId: "",
|
groupDeviceId: "",
|
||||||
groupId: "",
|
groupId: "",
|
||||||
businessGroup: "",
|
businessGroup: "",
|
||||||
|
regionParents: ["请选择虚拟组织"],
|
||||||
multipleSelection: []
|
multipleSelection: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -123,7 +127,8 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.initData();
|
this.initData();
|
||||||
},
|
},
|
||||||
destroyed() {},
|
destroyed() {
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData: function () {
|
initData: function () {
|
||||||
this.getChannelList();
|
this.getChannelList();
|
||||||
|
@ -139,15 +144,16 @@ export default {
|
||||||
getChannelList: function () {
|
getChannelList: function () {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/api/common/channel/list`,
|
url: `/api/common/channel/parent/list`,
|
||||||
params: {
|
params: {
|
||||||
page: this.currentPage,
|
page: this.currentPage,
|
||||||
count: this.count,
|
count: this.count,
|
||||||
query: this.searchSrt,
|
query: this.searchSrt,
|
||||||
online: this.online,
|
online: this.online,
|
||||||
hasGroup: this.hasGroup
|
channelType: this.channelType,
|
||||||
|
groupDeviceId: this.groupDeviceId
|
||||||
}
|
}
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.total = res.data.data.total;
|
this.total = res.data.data.total;
|
||||||
this.channelList = res.data.data.list;
|
this.channelList = res.data.data.list;
|
||||||
|
@ -157,45 +163,37 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((error)=> {
|
}).catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSelectionChange: function (val){
|
handleSelectionChange: function (val) {
|
||||||
this.multipleSelection = val;
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
selectable: function (row, rowIndex) {
|
|
||||||
if (this.hasGroup === "") {
|
|
||||||
if (row.gbParentId) {
|
|
||||||
return false
|
|
||||||
}else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rowDblclick: function (row, rowIndex) {
|
rowDblclick: function (row, rowIndex) {
|
||||||
|
|
||||||
},
|
},
|
||||||
add: function (row) {
|
add: function (row) {
|
||||||
if (!this.groupDeviceId) {
|
if (this.regionDeviceId === "") {
|
||||||
this.$message.info({
|
this.$message.info({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: "请选择左侧行政区划节点"
|
message: "请选择左侧虚拟组织节点"
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.$refs.gbChannelSelect.openDialog((data) => {
|
||||||
|
console.log("选择的数据")
|
||||||
|
console.log(data)
|
||||||
|
this.addChannelToGroup(this.groupDeviceId, this.businessGroup, data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addChannelToGroup: function (groupDeviceId, businessGroup, data) {
|
||||||
|
if (data.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let channels = []
|
let channels = []
|
||||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
channels.push(this.multipleSelection[i].gbId)
|
channels.push(data[i].gbId)
|
||||||
}
|
|
||||||
if (channels.length === 0) {
|
|
||||||
this.$message.info({
|
|
||||||
showClose: true,
|
|
||||||
message: "请选择右侧通道"
|
|
||||||
})
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
||||||
|
@ -203,27 +201,25 @@ export default {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: `/api/common/channel/group/add`,
|
url: `/api/common/channel/group/add`,
|
||||||
data: {
|
data: {
|
||||||
parentId: this.groupDeviceId,
|
parentId: groupDeviceId,
|
||||||
businessGroup: this.businessGroup,
|
businessGroup: businessGroup,
|
||||||
channelIds: channels
|
channelIds: channels
|
||||||
}
|
}
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: "保存成功"
|
message: "保存成功"
|
||||||
})
|
})
|
||||||
this.getChannelList()
|
this.getChannelList()
|
||||||
// 刷新树节点
|
} else {
|
||||||
this.$refs.groupTree.refresh(this.groupId)
|
|
||||||
}else {
|
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: res.data.msg
|
message: res.data.msg
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch((error)=> {
|
}).catch((error) => {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: error
|
message: error
|
||||||
|
@ -240,7 +236,7 @@ export default {
|
||||||
if (channels.length === 0) {
|
if (channels.length === 0) {
|
||||||
this.$message.info({
|
this.$message.info({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: "请选择右侧通道"
|
message: "请选择通道"
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -252,7 +248,7 @@ export default {
|
||||||
data: {
|
data: {
|
||||||
channelIds: channels
|
channelIds: channels
|
||||||
}
|
}
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
|
@ -261,14 +257,14 @@ export default {
|
||||||
this.getChannelList()
|
this.getChannelList()
|
||||||
// 刷新树节点
|
// 刷新树节点
|
||||||
this.$refs.groupTree.refresh(this.groupDeviceId)
|
this.$refs.groupTree.refresh(this.groupDeviceId)
|
||||||
}else {
|
} else {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: res.data.msg
|
message: res.data.msg
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch((error)=> {
|
}).catch((error) => {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: error
|
message: error
|
||||||
|
@ -288,13 +284,38 @@ export default {
|
||||||
refresh: function () {
|
refresh: function () {
|
||||||
this.initData();
|
this.initData();
|
||||||
},
|
},
|
||||||
treeNodeClickEvent: function (device, data, isCatalog) {
|
treeNodeClickEvent: function (group) {
|
||||||
|
if (group.deviceId === "" || group.deviceId === group.businessGroup) {
|
||||||
|
this.channelList = []
|
||||||
|
this.regionParents = ["请选择虚拟组织"];
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.groupDeviceId = group.deviceId;
|
||||||
|
this.businessGroup = group.businessGroup;
|
||||||
|
this.initData();
|
||||||
|
// 获取regionDeviceId对应的节点信息
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/group/path`,
|
||||||
|
params: {
|
||||||
|
deviceId: this.groupDeviceId,
|
||||||
|
businessGroup: this.businessGroup,
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
let path = []
|
||||||
|
for (let i = 0; i < res.data.data.length; i++) {
|
||||||
|
path.push(res.data.data[i].name)
|
||||||
|
}
|
||||||
|
this.regionParents = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
chooseIdChange: function (id, deviceId, businessGroup) {
|
onChannelChange: function (deviceId) {
|
||||||
this.groupId = id;
|
//
|
||||||
this.groupDeviceId = deviceId;
|
|
||||||
this.businessGroup = businessGroup;
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
<el-container v-loading="loading">
|
<el-container v-loading="loading">
|
||||||
<el-aside width="400px">
|
<el-aside width="400px">
|
||||||
<RegionTree ref="regionTree" :showHeader=true :edit="true" :clickEvent="treeNodeClickEvent"
|
<RegionTree ref="regionTree" :showHeader=true :edit="true" :clickEvent="treeNodeClickEvent"
|
||||||
:onChannelChange="onChannelChange"></RegionTree>
|
:onChannelChange="onChannelChange" :addChannelToCivilCode="addChannelToCivilCode"></RegionTree>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-main style="padding: 5px;">
|
<el-main style="padding: 5px;">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<el-breadcrumb separator="/">
|
<el-breadcrumb separator="/">
|
||||||
<el-breadcrumb-item v-for="key in regionParents" >{{key}}</el-breadcrumb-item>
|
<el-breadcrumb-item v-for="key in regionParents" key="key">{{ key }}</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-header-btn">
|
<div class="page-header-btn">
|
||||||
|
@ -26,6 +26,14 @@
|
||||||
<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="getChannelList" v-model="channelType" placeholder="请选择"
|
||||||
|
default-first-option>
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="国标设备" :value="0"></el-option>
|
||||||
|
<el-option label="推流设备" :value="1"></el-option>
|
||||||
|
<el-option label="拉流代理" :value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
<el-button size="mini" type="primary" @click="add()">
|
<el-button size="mini" type="primary" @click="add()">
|
||||||
添加通道
|
添加通道
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -77,7 +85,7 @@
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
<GbChannelSelect ref="gbChannelSelect" dataType="civilCode"></GbChannelSelect>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -85,10 +93,12 @@
|
||||||
import uiHeader from '../layout/UiHeader.vue'
|
import uiHeader from '../layout/UiHeader.vue'
|
||||||
import DeviceService from "./service/DeviceService";
|
import DeviceService from "./service/DeviceService";
|
||||||
import RegionTree from "./common/RegionTree.vue";
|
import RegionTree from "./common/RegionTree.vue";
|
||||||
|
import GbChannelSelect from "./dialog/GbChannelSelect.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'channelList',
|
name: 'channelList',
|
||||||
components: {
|
components: {
|
||||||
|
GbChannelSelect,
|
||||||
uiHeader,
|
uiHeader,
|
||||||
RegionTree,
|
RegionTree,
|
||||||
},
|
},
|
||||||
|
@ -131,12 +141,13 @@ export default {
|
||||||
getChannelList: function () {
|
getChannelList: function () {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/api/common/channel/list`,
|
url: `/api/common/channel/civilcode/list`,
|
||||||
params: {
|
params: {
|
||||||
page: this.currentPage,
|
page: this.currentPage,
|
||||||
count: this.count,
|
count: this.count,
|
||||||
query: this.searchSrt,
|
query: this.searchSrt,
|
||||||
online: this.online,
|
online: this.online,
|
||||||
|
channelType: this.channelType,
|
||||||
civilCode: this.regionDeviceId
|
civilCode: this.regionDeviceId
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
@ -162,23 +173,26 @@ export default {
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
add: function (row) {
|
add: function (row) {
|
||||||
if (!this.regionDeviceId) {
|
if (this.regionDeviceId === "") {
|
||||||
this.$message.info({
|
this.$message.info({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: "请选择左侧行政区划节点"
|
message: "请选择左侧行政区划"
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.$refs.gbChannelSelect.openDialog((data) => {
|
||||||
|
console.log("选择的数据")
|
||||||
|
console.log(data)
|
||||||
|
this.addChannelToCivilCode(this.regionDeviceId, data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addChannelToCivilCode: function (regionDeviceId, data) {
|
||||||
|
if (data.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let channels = []
|
let channels = []
|
||||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
channels.push(this.multipleSelection[i].gbId)
|
channels.push(data[i].gbId)
|
||||||
}
|
|
||||||
if (channels.length === 0) {
|
|
||||||
this.$message.info({
|
|
||||||
showClose: true,
|
|
||||||
message: "请选择通道"
|
|
||||||
})
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
||||||
|
@ -186,7 +200,7 @@ export default {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: `/api/common/channel/region/add`,
|
url: `/api/common/channel/region/add`,
|
||||||
data: {
|
data: {
|
||||||
civilCode: this.regionDeviceId,
|
civilCode: regionDeviceId,
|
||||||
channelIds: channels
|
channelIds: channels
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
@ -196,8 +210,6 @@ export default {
|
||||||
message: "保存成功"
|
message: "保存成功"
|
||||||
})
|
})
|
||||||
this.getChannelList()
|
this.getChannelList()
|
||||||
// 刷新树节点
|
|
||||||
this.$refs.regionTree.refresh(this.regionId)
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
|
@ -271,6 +283,10 @@ export default {
|
||||||
},
|
},
|
||||||
treeNodeClickEvent: function (region) {
|
treeNodeClickEvent: function (region) {
|
||||||
this.regionDeviceId = region.deviceId;
|
this.regionDeviceId = region.deviceId;
|
||||||
|
if (region.deviceId === "") {
|
||||||
|
this.channelList = []
|
||||||
|
this.regionParents = ["请选择行政区划"];
|
||||||
|
}
|
||||||
this.initData();
|
this.initData();
|
||||||
// 获取regionDeviceId对应的节点信息
|
// 获取regionDeviceId对应的节点信息
|
||||||
this.$axios({
|
this.$axios({
|
||||||
|
@ -292,6 +308,9 @@ export default {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
gbChannelSelectEnd: function (selectedData) {
|
||||||
|
console.log(selectedData);
|
||||||
|
},
|
||||||
onChannelChange: function (deviceId) {
|
onChannelChange: function (deviceId) {
|
||||||
//
|
//
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue