增加批量修改通道的业务分组以及行政区划,支持筛选业务分组和行政区划,支持抽稀还原,国标通道编辑增加表单校验

This commit is contained in:
lin 2025-10-30 15:05:50 +08:00
parent 091d6e67ee
commit fa9aaf3fa2
20 changed files with 395 additions and 104 deletions

View File

@ -104,16 +104,26 @@ public class ChannelController {
@Parameter(name = "online", description = "是否在线") @Parameter(name = "online", description = "是否在线")
@Parameter(name = "hasRecordPlan", description = "是否已设置录制计划") @Parameter(name = "hasRecordPlan", description = "是否已设置录制计划")
@Parameter(name = "channelType", description = "通道类型, 0国标设备1推流设备2拉流代理") @Parameter(name = "channelType", description = "通道类型, 0国标设备1推流设备2拉流代理")
@Parameter(name = "civilCode", description = "行政区划")
@Parameter(name = "parentDeviceId", 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 hasRecordPlan, @RequestParam(required = false) Boolean hasRecordPlan,
@RequestParam(required = false) Integer channelType){ @RequestParam(required = false) Integer channelType,
@RequestParam(required = false) String civilCode,
@RequestParam(required = false) String parentDeviceId){
if (ObjectUtils.isEmpty(query)){ if (ObjectUtils.isEmpty(query)){
query = null; query = null;
} }
return channelService.queryList(page, count, query, online, hasRecordPlan, channelType); if (ObjectUtils.isEmpty(civilCode)){
civilCode = null;
}
if (ObjectUtils.isEmpty(parentDeviceId)){
parentDeviceId = null;
}
return channelService.queryList(page, count, query, online, hasRecordPlan, channelType, civilCode, parentDeviceId);
} }
@Operation(summary = "获取关联行政区划通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Operation(summary = "获取关联行政区划通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
@ -481,4 +491,13 @@ public class ChannelController {
public void saveLevel(@RequestBody List<ChannelForThin> channels){ public void saveLevel(@RequestBody List<ChannelForThin> channels){
channelService.saveLevel(channels); channelService.saveLevel(channels);
} }
@Operation(summary = "为地图去除抽稀结果", security = @SecurityRequirement(name = JwtUtils.HEADER))
@PostMapping("/map/reset-level")
public void resetLevel(){
channelService.resetLevel();
}
} }

View File

@ -474,7 +474,8 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryList") @SelectProvider(type = ChannelProvider.class, method = "queryList")
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online, List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online,
@Param("hasRecordPlan") Boolean hasRecordPlan, @Param("dataType") Integer dataType); @Param("hasRecordPlan") Boolean hasRecordPlan, @Param("dataType") Integer dataType,
@Param("civilCode") String civilCode, @Param("parentDeviceId") String parentDeviceId);
@Update(value = {" <script>" + @Update(value = {" <script>" +
" UPDATE wvp_device_channel " + " UPDATE wvp_device_channel " +
@ -668,4 +669,8 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryMeetingChannelList") @SelectProvider(type = ChannelProvider.class, method = "queryMeetingChannelList")
List<CameraChannel> queryMeetingChannelList(@Param("business") String business); List<CameraChannel> queryMeetingChannelList(@Param("business") String business);
@Update("UPDATE wvp_device_channel SET map_level=null")
int resetLevel();
} }

View File

@ -289,6 +289,12 @@ public class ChannelProvider {
if (params.get("dataType") != null) { if (params.get("dataType") != null) {
sqlBuild.append(" AND data_type = #{dataType}"); sqlBuild.append(" AND data_type = #{dataType}");
} }
if (params.get("civilCode") != null) {
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) = #{civilCode}");
}
if (params.get("parentDeviceId") != null) {
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{parentDeviceId}");
}
return sqlBuild.toString(); return sqlBuild.toString();
} }

View File

@ -85,7 +85,7 @@ public interface IGbChannelService {
List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList); List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList);
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType); PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType, String civilCode, String parentDeviceId);
PageInfo<CommonGBChannel> queryListByCivilCodeForUnusual(int page, int count, String query, Boolean online, Integer channelType); PageInfo<CommonGBChannel> queryListByCivilCodeForUnusual(int page, int count, String query, Boolean online, Integer channelType);
@ -104,4 +104,7 @@ public interface IGbChannelService {
void saveLevel(List<ChannelForThin> channels); void saveLevel(List<ChannelForThin> channels);
CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel); CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel);
void resetLevel();
} }

View File

@ -10,7 +10,6 @@ import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.RegionMapper; import com.genersoft.iot.vmp.gb28181.dao.RegionMapper;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.channel.ChannelEvent; import com.genersoft.iot.vmp.gb28181.event.channel.ChannelEvent;
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.IPlatformChannelService; import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
@ -23,6 +22,7 @@ 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;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList; import java.util.ArrayList;
@ -68,9 +68,12 @@ public class GbChannelServiceImpl implements IGbChannelService {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "缺少通道数据类型或通道数据关联设备ID"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "缺少通道数据类型或通道数据关联设备ID");
} }
CommonGBChannel commonGBChannelInDb = commonGBChannelMapper.queryByDataId(commonGBChannel.getDataType(), commonGBChannel.getDataDeviceId()); CommonGBChannel commonGBChannelInDb = commonGBChannelMapper.queryByDataId(commonGBChannel.getDataType(), commonGBChannel.getDataDeviceId());
if (commonGBChannelInDb != null) { Assert.isNull(commonGBChannelInDb, "此推流已经关联通道");
throw new ControllerException(ErrorCode.ERROR100.getCode(), "此推流已经关联通道");
} // 检验国标编号是否重复
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByDeviceId(commonGBChannel.getGbDeviceId());
Assert.isTrue(channelList.isEmpty(), "国标编号已经存在");
commonGBChannel.setCreateTime(DateUtil.getNow()); commonGBChannel.setCreateTime(DateUtil.getNow());
commonGBChannel.setUpdateTime(DateUtil.getNow()); commonGBChannel.setUpdateTime(DateUtil.getNow());
int result = commonGBChannelMapper.insert(commonGBChannel); int result = commonGBChannelMapper.insert(commonGBChannel);
@ -741,14 +744,15 @@ public class GbChannelServiceImpl implements IGbChannelService {
} }
@Override @Override
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType) { public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan,
Integer channelType, String civilCode, String parentDeviceId) {
PageHelper.startPage(page, count); PageHelper.startPage(page, count);
if (query != null) { if (query != null) {
query = query.replaceAll("/", "//") query = query.replaceAll("/", "//")
.replaceAll("%", "/%") .replaceAll("%", "/%")
.replaceAll("_", "/_"); .replaceAll("_", "/_");
} }
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType); List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType, civilCode, parentDeviceId);
return new PageInfo<>(all); return new PageInfo<>(all);
} }
@ -826,7 +830,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override @Override
public List<CommonGBChannel> queryListForMap(String query, Boolean online, Boolean hasRecordPlan, Integer channelType) { public List<CommonGBChannel> queryListForMap(String query, Boolean online, Boolean hasRecordPlan, Integer channelType) {
return commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType); return commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType, null, null);
} }
@Override @Override
@ -850,4 +854,9 @@ public class GbChannelServiceImpl implements IGbChannelService {
public CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel) { public CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel) {
return commonGBChannelMapper.queryCommonChannelByDeviceChannel(channel); return commonGBChannelMapper.queryCommonChannelByDeviceChannel(channel);
} }
@Override
public void resetLevel() {
commonGBChannelMapper.resetLevel();
}
} }

View File

@ -285,9 +285,9 @@ public class GroupServiceImpl implements IGroupService, CommandLineRunner {
if (group == null) { if (group == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "虚拟组织不存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "虚拟组织不存在");
} }
groupList.add(group);
List<Group> allParent = getAllParent(group); List<Group> allParent = getAllParent(group);
groupList.addAll(allParent); groupList.addAll(allParent);
groupList.add(group);
return groupList; return groupList;
} }

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.bean.Group; import com.genersoft.iot.vmp.gb28181.bean.Group;
import com.genersoft.iot.vmp.gb28181.bean.RedisGroupMessage; import com.genersoft.iot.vmp.gb28181.bean.RedisGroupMessage;
import com.genersoft.iot.vmp.gb28181.service.IGroupService; import com.genersoft.iot.vmp.gb28181.service.IGroupService;
@ -163,7 +164,9 @@ public class RedisGroupMsgListener implements MessageListener {
} }
} }
} catch (Exception e) { } catch (ControllerException e) {
log.warn("[REDIS消息-业务分组同步回复] 失败, \r\n{}", e.getMsg());
}catch (Exception e) {
log.warn("[REDIS消息-业务分组同步回复] 发现未处理的异常, \r\n{}", new String(msg.getBody())); log.warn("[REDIS消息-业务分组同步回复] 发现未处理的异常, \r\n{}", new String(msg.getBody()));
log.error("[REDIS消息-业务分组同步回复] 异常内容: ", e); log.error("[REDIS消息-业务分组同步回复] 异常内容: ", e);
} }

View File

@ -23,6 +23,9 @@ public class CameraGroup extends Group {
} }
public void addChild(CameraGroup child) { public void addChild(CameraGroup child) {
if (child == null) {
return;
}
this.child.add(child); this.child.add(child);
if (this.parent != null) { if (this.parent != null) {
this.parent.addChild(child); this.parent.addChild(child);

View File

@ -401,23 +401,12 @@ public class CameraChannelService implements CommandLineRunner {
public CameraChannel queryOne(String deviceId, String deviceCode, String geoCoordSys) { public CameraChannel queryOne(String deviceId, String deviceCode, String geoCoordSys) {
List<CameraChannel> cameraChannels = channelMapper.queryGbChannelByChannelDeviceIdAndGbDeviceId(deviceId, deviceCode); List<CameraChannel> cameraChannels = channelMapper.queryGbChannelByChannelDeviceIdAndGbDeviceId(deviceId, deviceCode);
Assert.isTrue(cameraChannels.isEmpty(), "通道不存在"); Assert.isTrue(cameraChannels.isEmpty(), "通道不存在");
CameraChannel channel = cameraChannels.get(0); List<CameraChannel> channels = addIconPathAndPositionForCameraChannelList(cameraChannels, geoCoordSys);
if (geoCoordSys != null && channel.getGbLongitude() != null && channel.getGbLatitude() != null CameraChannel channel = channels.get(0);
&& channel.getGbLongitude() > 0 && channel.getGbLatitude() > 0) {
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
Double[] position = Coordtransform.WGS84ToGCJ02(channel.getGbLongitude(), channel.getGbLatitude());
channel.setGbLongitude(position[0]);
channel.setGbLatitude(position[1]);
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
Double[] gcj02Position = Coordtransform.WGS84ToGCJ02(channel.getGbLongitude(), channel.getGbLatitude());
Double[] position = Coordtransform.GCJ02ToBD09(gcj02Position[0], gcj02Position[1]);
channel.setGbLongitude(position[0]);
channel.setGbLatitude(position[1]);
}
}
if (deviceCode != null) { if (deviceCode != null) {
channel.setDeviceCode(deviceCode); channel.setDeviceCode(deviceCode);
} }
return channel; return channel;
} }

View File

@ -60,7 +60,7 @@ export function add(data) {
} }
export function getList(params) { export function getList(params) {
const { page, count, query, online, hasRecordPlan, channelType } = params const { page, count, query, online, hasRecordPlan, channelType, civilCode, parentDeviceId } = params
return request({ return request({
method: 'get', method: 'get',
url: '/api/common/channel/list', url: '/api/common/channel/list',
@ -70,7 +70,9 @@ export function getList(params) {
channelType: channelType, channelType: channelType,
query: query, query: query,
online: online, online: online,
hasRecordPlan: hasRecordPlan hasRecordPlan: hasRecordPlan,
civilCode: civilCode,
parentDeviceId: parentDeviceId
} }
}) })
} }
@ -605,6 +607,12 @@ export function saveLevel(data) {
data: data data: data
}) })
} }
export function resetLevel() {
return request({
method: 'post',
url: '/api/common/channel/map/reset-level'
})
}
export function test() { export function test() {
return request({ return request({
method: 'get', method: 'get',

View File

@ -48,7 +48,7 @@ import {
stopPlayback, stopPlayback,
pausePlayback, pausePlayback,
resumePlayback, resumePlayback,
seekPlayback, speedPlayback, getAllForMap, test, saveLevel seekPlayback, speedPlayback, getAllForMap, test, saveLevel, resetLevel
} from '@/api/commonChannel' } from '@/api/commonChannel'
const actions = { const actions = {
@ -582,6 +582,16 @@ const actions = {
}) })
}) })
}, },
resetLevel({ commit }) {
return new Promise((resolve, reject) => {
resetLevel().then(response => {
const { data } = response
resolve(data)
}).catch(error => {
reject(error)
})
})
},
test({ commit }) { test({ commit }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
test().then(response => { test().then(response => {

View File

@ -132,7 +132,7 @@ export default {
data() { data() {
return { return {
channelList: [], channelList: [],
tableHeight: `calc(100vh - 190px)`, tableHeight: 'calc(100vh - 190px)',
searchStr: '', searchStr: '',
channelType: '', channelType: '',
online: '', online: '',

View File

@ -37,6 +37,35 @@
<el-option v-for="item in Object.values($channelTypeList)" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in Object.values($channelTypeList)" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item >
<el-input placeholder="请选择行政区划" v-model="civilCodeName" readonly style="width: 12rem; margin-right: 1rem;">
<span slot="suffix" v-show="civilCodeName" style="height: 100%; display: flex; align-items: center; width: 22px;"
@click="civilCodeClear">
<i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
</span>
<el-button slot="append" @click="civilCodeFilter">选择</el-button>
</el-input>
</el-form-item>
<el-form-item >
<el-input placeholder="请选择业务分组" v-model="groupName" readonly style="width: 12rem; margin-right: 1rem;">
<span slot="suffix" v-show="groupName" style="height: 100%; display: flex; align-items: center; width: 22px;"
@click="groupClear">
<i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
</span>
<el-button slot="append" @click="groupFilter">选择</el-button>
</el-input>
</el-form-item>
<el-form-item >
<el-dropdown >
<el-button type="primary">
批量操作<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="batchChangeRegion">行政区划</el-dropdown-item>
<el-dropdown-item @click.native="batchChangeGroup">业务分组</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-form-item>
<el-form-item style="float: right;"> <el-form-item style="float: right;">
<el-button icon="el-icon-refresh-right" circle @click="refresh()" title="刷新表格"/> <el-button icon="el-icon-refresh-right" circle @click="refresh()" title="刷新表格"/>
</el-form-item> </el-form-item>
@ -48,7 +77,9 @@
height="calc(100% - 64px)" height="calc(100% - 64px)"
style="width: 100%; font-size: 12px;" style="width: 100%; font-size: 12px;"
header-row-class-name="table-header" header-row-class-name="table-header"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" />
<el-table-column prop="gbName" label="名称" min-width="180" /> <el-table-column prop="gbName" label="名称" min-width="180" />
<el-table-column prop="gbDeviceId" label="编号" min-width="180" /> <el-table-column prop="gbDeviceId" label="编号" min-width="180" />
<el-table-column prop="gbManufacturer" label="厂家" min-width="100" /> <el-table-column prop="gbManufacturer" label="厂家" min-width="100" />
@ -128,7 +159,7 @@
style="text-align: right" style="text-align: right"
:current-page="currentPage" :current-page="currentPage"
:page-size="count" :page-size="count"
:page-sizes="[15, 25, 35, 50]" :page-sizes="[15, 25, 35, 50, 100, 500, 1000]"
layout="total, sizes, prev, pager, next" layout="total, sizes, prev, pager, next"
:total="total" :total="total"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@ -138,6 +169,8 @@
<devicePlayer ref="devicePlayer" /> <devicePlayer ref="devicePlayer" />
<channel-edit v-if="editId" :id="editId" :close-edit="closeEdit" /> <channel-edit v-if="editId" :id="editId" :close-edit="closeEdit" />
<chooseCivilCode ref="chooseCivilCode" />
<chooseGroup ref="chooseGroup" />
</div> </div>
</template> </template>
@ -145,11 +178,17 @@
<script> <script>
import devicePlayer from '@/views/common/channelPlayer/index.vue' import devicePlayer from '@/views/common/channelPlayer/index.vue'
import Edit from './edit.vue' import Edit from './edit.vue'
import ChooseCivilCode from '../dialog/chooseCivilCode.vue'
import ChooseGroup from '@/views/dialog/chooseGroup.vue'
import { MessageBox } from 'element-ui'
import store from '@/store'
export default { export default {
name: 'ChannelList', name: 'ChannelList',
components: { components: {
ChooseGroup,
devicePlayer, devicePlayer,
ChooseCivilCode,
ChannelEdit: Edit ChannelEdit: Edit
}, },
props: { props: {
@ -203,7 +242,15 @@ export default {
count: this.defaultCount | 15, count: this.defaultCount | 15,
total: 0, total: 0,
beforeUrl: '/device', beforeUrl: '/device',
editId: null editId: null,
civilCodeName: null,
civilCodeDeviceId: null,
groupName: null,
groupDeviceId: null,
groupBusiness: null,
multipleSelection: []
} }
}, },
mounted() { mounted() {
@ -214,6 +261,9 @@ export default {
clearTimeout(this.updateLooper) clearTimeout(this.updateLooper)
}, },
methods: { methods: {
handleSelectionChange: function(val) {
this.multipleSelection = val
},
initData: function() { initData: function() {
this.getChannelList() this.getChannelList()
}, },
@ -236,7 +286,9 @@ export default {
count: this.count, count: this.count,
query: this.searchStr, query: this.searchStr,
online: this.online, online: this.online,
channelType: this.channelType channelType: this.channelType,
civilCode: this.civilCodeDeviceId,
parentDeviceId: this.groupDeviceId
}).then(data => { }).then(data => {
this.total = data.total this.total = data.total
this.channelList = data.list this.channelList = data.list
@ -334,6 +386,114 @@ export default {
} else if (command === 'cloudRecords') { } else if (command === 'cloudRecords') {
this.queryCloudRecords(itemData) this.queryCloudRecords(itemData)
} }
},
getCheckIds: function() {
const channelIds = []
for (let i = 0; i < this.multipleSelection.length; i++) {
channelIds.push(this.multipleSelection[i].gbId)
}
if (channelIds.length === 0) {
this.$message.warning({
showClose: true,
message: '请选择通道'
})
return []
}
return channelIds
},
batchChangeRegion: function() {
let ids = this.getCheckIds()
if (ids.length === 0) {
return
}
this.$refs.chooseCivilCode.openDialog((code, name) => {
this.$confirm(`确定添加${ids.length}个通道到${name}?`, '批量操作', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('commonChanel/addToRegion', {
civilCode: code,
channelIds: ids
})
.then(data => {
this.$message.success({
showClose: true,
message: '保存成功'
})
})
.catch((error) => {
this.$message.error({
showClose: true,
message: error
})
})
.finally(() => {
this.loading = false
})
})
})
},
batchChangeGroup: function() {
let ids = this.getCheckIds()
if (ids.length === 0) {
return
}
this.$refs.chooseGroup.openDialog((code, businessGroupId, name) => {
this.$confirm(`确定添加${ids.length}个通道到${name}?`, '批量操作', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('commonChanel/addToGroup', {
parentId: code,
businessGroup: businessGroupId,
channelIds: ids
})
.then(data => {
this.$message.success({
showClose: true,
message: '保存成功'
})
this.getChannelList()
})
.catch((error) => {
this.$message.error({
showClose: true,
message: error
})
})
.finally(() => {
this.loading = false
})
})
})
},
civilCodeFilter() {
this.$refs.chooseCivilCode.openDialog((code, name) => {
this.civilCodeName = name
this.civilCodeDeviceId = code
this.getChannelList()
})
},
groupFilter() {
this.$refs.chooseGroup.openDialog((code, businessGroupId, name) => {
this.groupDeviceId = code
this.groupBusiness = businessGroupId
this.groupName = name
this.getChannelList()
})
},
civilCodeClear(){
this.civilCodeDeviceId = null
this.civilCodeName = null
this.getChannelList()
},
groupClear(){
this.groupName = null
this.groupDeviceId = null
this.groupBusiness = null
this.getChannelList()
} }
} }
} }

View File

@ -130,7 +130,7 @@ export default {
data() { data() {
return { return {
channelList: [], channelList: [],
tableHeight: `calc(100vh - ${this.$refs.queryForm.offsetHeight}px)`, tableHeight: 'calc(100vh - 190px)',
searchStr: '', searchStr: '',
channelType: '', channelType: '',
online: '', online: '',
@ -148,6 +148,7 @@ export default {
created() { created() {
this.initData() this.initData()
this.tableHeight = `calc(100vh - ${this.$refs.queryForm.offsetHeight}px)`
}, },
destroyed() { destroyed() {
}, },

View File

@ -1,11 +1,11 @@
<template> <template>
<div id="CommonChannelEdit" v-loading="loading" style="width: 100%"> <div id="CommonChannelEdit" v-loading="loading" style="width: 100%">
<el-form ref="passwordForm" status-icon label-width="160px" class="channel-form"> <el-form ref="channelForm" :model="form" :rules="rules" status-icon label-width="160px" class="channel-form" size="medium">
<div class="form-box"> <div class="form-box">
<el-form-item label="名称"> <el-form-item label="名称" prop="gbName">
<el-input v-model="form.gbName" placeholder="请输入通道名称" /> <el-input v-model="form.gbName" placeholder="请输入通道名称" />
</el-form-item> </el-form-item>
<el-form-item label="编码"> <el-form-item label="编码" prop="gbDeviceId">
<el-input v-model="form.gbDeviceId" placeholder="请输入通道编码"> <el-input v-model="form.gbDeviceId" placeholder="请输入通道编码">
<template v-slot:append> <template v-slot:append>
<el-button @click="buildDeviceIdCode(form.gbDeviceId)">生成</el-button> <el-button @click="buildDeviceIdCode(form.gbDeviceId)">生成</el-button>
@ -13,7 +13,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备厂商"> <el-form-item label="设备厂商">
<el-input v-model="form.gbManufacturer" placeholder="请输入设备厂商" /> <el-input v-model="gbManufacturer" placeholder="请输入设备厂商" />
</el-form-item> </el-form-item>
<el-form-item label="设备型号"> <el-form-item label="设备型号">
<el-autocomplete <el-autocomplete
@ -40,18 +40,36 @@
<el-form-item label="安装地址"> <el-form-item label="安装地址">
<el-input v-model="form.gbAddress" placeholder="请输入安装地址" /> <el-input v-model="form.gbAddress" placeholder="请输入安装地址" />
</el-form-item> </el-form-item>
<el-form-item label="子设备"> <el-form-item label="监视方位">
<el-select v-model="form.gbParental" style="width: 100%" placeholder="请选择是否有子设备"> <el-select v-model="form.gbDirectionType" style="width: 100%" placeholder="请选择监视方位">
<el-option label="有" :value="1" /> <el-option label="东(西向东)" :value="1" />
<el-option label="无" :value="0" /> <el-option label="西(东向西)" :value="2" />
<el-option label="南(北向南)" :value="3" />
<el-option label="北(南向北)" :value="4" />
<el-option label="东南(西北到东南)" :value="5" />
<el-option label="东北(西南到东北)" :value="6" />
<el-option label="西南(东北到西南)" :value="7" />
<el-option label="西北(东南到西北)" :value="8" />
<el-option label="左(非标)" :value="91" />
<el-option label="后(非标)" :value="92" />
<el-option label="前(非标)" :value="93" />
<el-option label="右(非标)" :value="94" />
<el-option label="左前(非标)" :value="95" />
<el-option label="右前(非标)" :value="96" />
<el-option label="左后(非标)" :value="97" />
<el-option label="右后(非标)" :value="98" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="父节点编码"> <el-form-item label="父节点编码">
<el-input v-model="form.gbParentId" placeholder="请输入父节点编码或选择所属虚拟组织"> <el-input v-model="form.gbParentId" placeholder="请输入父节点编码或选择所属虚拟组织" @change="getPaths">
<template v-slot:append> <template v-slot:append>
<el-button @click="chooseGroup()">选择</el-button> <el-button @click="chooseGroup()">选择</el-button>
</template> </template>
</el-input> </el-input>
<el-breadcrumb v-if="parentPath.length > 0" separator="/" style="display: block; margin-top: 8px; font-size: 14px;">
<el-breadcrumb-item v-for="key in parentPath" :key="key">{{ key }}</el-breadcrumb-item>
</el-breadcrumb>
</el-form-item> </el-form-item>
<el-form-item label="设备状态"> <el-form-item label="设备状态">
<el-select v-model="form.gbStatus" style="width: 100%" placeholder="请选择设备状态"> <el-select v-model="form.gbStatus" style="width: 100%" placeholder="请选择设备状态">
@ -80,12 +98,12 @@
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
<el-form-item label="业务分组编号">
<el-input v-model="form.gbBusinessGroupId" placeholder="请输入业务分组编号" @change="getPaths"/>
</el-form-item>
<el-form-item label="警区"> <el-form-item label="警区">
<el-input v-model="form.gbBlock" placeholder="请输入警区" /> <el-input v-model="form.gbBlock" placeholder="请输入警区" />
</el-form-item> </el-form-item>
<el-form-item label="设备归属">
<el-input v-model="form.gbOwner" placeholder="请输入设备归属" />
</el-form-item>
<el-form-item label="信令安全模式"> <el-form-item label="信令安全模式">
<el-select v-model="form.gbSafetyWay" style="width: 100%" placeholder="请选择信令安全模式"> <el-select v-model="form.gbSafetyWay" style="width: 100%" placeholder="请选择信令安全模式">
<el-option label="不采用" :value="0" /> <el-option label="不采用" :value="0" />
@ -138,8 +156,14 @@
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
<el-form-item label="业务分组编号"> <el-form-item label="设备归属">
<el-input v-model="form.gbBusinessGroupId" placeholder="请输入业务分组编号" /> <el-input v-model="form.gbOwner" placeholder="请输入设备归属" />
</el-form-item>
<el-form-item label="子设备">
<el-select v-model="form.gbParental" style="width: 100%" placeholder="请选择是否有子设备">
<el-option label="有" :value="1" />
<el-option label="无" :value="0" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="位置类型"> <el-form-item label="位置类型">
<el-select v-model="form.gbPositionType" style="width: 100%" placeholder="请选择位置类型"> <el-select v-model="form.gbPositionType" style="width: 100%" placeholder="请选择位置类型">
@ -226,10 +250,9 @@
<el-form-item > <el-form-item >
<el-checkbox v-model="form.enableBroadcastForBool" >语音对讲(非标属性)</el-checkbox> <el-checkbox v-model="form.enableBroadcastForBool" >语音对讲(非标属性)</el-checkbox>
</el-form-item> </el-form-item>
<div style="text-align: right">
<div style="float: right;"> <el-button type="primary" @click="onSubmit" >保存</el-button>
<el-button type="primary" @click="onSubmit">保存</el-button> <el-button v-if="cancel" @click="cancelSubmit" >取消</el-button>
<el-button v-if="cancel" @click="cancelSubmit">取消</el-button>
<el-button v-if="form.dataType === 1" @click="reset">重置</el-button> <el-button v-if="form.dataType === 1" @click="reset">重置</el-button>
</div> </div>
</div> </div>
@ -256,8 +279,17 @@ export default {
props: ['id', 'dataForm', 'saveSuccess', 'cancel'], props: ['id', 'dataForm', 'saveSuccess', 'cancel'],
data() { data() {
return { return {
rules: {
gbName: [
{ required: true, message: '请输入通道名称', trigger: 'blur' }
],
gbDeviceId: [
{ required: true, message: '请输入通道编号', trigger: 'blur' }
]
},
loading: false, loading: false,
modelList: [], modelList: [],
parentPath: [],
form: {} form: {}
} }
}, },
@ -276,8 +308,8 @@ export default {
if (!this.dataForm.gbDeviceId) { if (!this.dataForm.gbDeviceId) {
this.dataForm.gbDeviceId = '' this.dataForm.gbDeviceId = ''
} }
console.log(this.dataForm)
this.form = this.dataForm this.form = this.dataForm
this.getPaths()
} }
}, },
methods: { methods: {
@ -289,38 +321,42 @@ export default {
callback(results) callback(results)
}, },
onSubmit: function() { onSubmit: function() {
this.loading = true this.$refs.channelForm.validate((valid) => {
if (this.form.gbDownloadSpeedArray) { if (valid) {
this.form.gbDownloadSpeed = this.form.gbDownloadSpeedArray.join('/') this.loading = true
} if (this.form.gbDownloadSpeedArray) {
this.form.enableBroadcast = this.form.enableBroadcastForBool ? 1 : 0 this.form.gbDownloadSpeed = this.form.gbDownloadSpeedArray.join('/')
if (this.form.gbId) { }
this.$store.dispatch('commonChanel/update', this.form) this.form.enableBroadcast = this.form.enableBroadcastForBool ? 1 : 0
.then(data => { if (this.form.gbId) {
this.$message.success({ this.$store.dispatch('commonChanel/update', this.form)
showClose: true, .then(data => {
message: '保存成功' this.$message.success({
showClose: true,
message: '保存成功'
})
if (this.saveSuccess) {
this.saveSuccess()
}
}).finally(() => {
this.loading = false
}) })
if (this.saveSuccess) { } else {
this.saveSuccess() this.$store.dispatch('commonChanel/add', this.form)
} .then(data => {
}).finally(() => [ this.$message.success({
this.loading = false showClose: true,
]) message: '保存成功'
} else { })
this.$store.dispatch('commonChanel/add', this.form) if (this.saveSuccess) {
.then(data => { this.saveSuccess()
this.$message.success({ }
showClose: true, }).finally(() => {
message: '保存成功' this.loading = false
}) })
if (this.saveSuccess) { }
this.saveSuccess() }
} })
}).finally(() => [
this.loading = false
])
}
}, },
reset: function() { reset: function() {
this.$confirm('确定重置为默认内容?', '提示', { this.$confirm('确定重置为默认内容?', '提示', {
@ -346,9 +382,9 @@ export default {
} }
}).catch((error) => { }).catch((error) => {
console.error(error) console.error(error)
}).finally(() => [ }).finally(() => {
this.loading = false this.loading = false
]) })
}).catch(() => { }).catch(() => {
}) })
@ -362,6 +398,7 @@ export default {
} }
this.form = data this.form = data
this.$set(this.form, 'enableBroadcastForBool', this.form.enableBroadcast === 1) this.$set(this.form, 'enableBroadcastForBool', this.form.enableBroadcast === 1)
this.getPaths()
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
@ -369,10 +406,7 @@ export default {
}, },
buildDeviceIdCode: function(deviceId) { buildDeviceIdCode: function(deviceId) {
this.$refs.channelCode.openDialog(code => { this.$refs.channelCode.openDialog(code => {
console.log(this.form)
console.log('code===> ' + code)
this.form.gbDeviceId = code this.form.gbDeviceId = code
console.log('code22===> ' + code)
}, deviceId) }, deviceId)
}, },
chooseCivilCode: function() { chooseCivilCode: function() {
@ -382,16 +416,32 @@ export default {
}, },
chooseGroup: function() { chooseGroup: function() {
this.$refs.chooseGroup.openDialog((deviceId, businessGroupId) => { this.$refs.chooseGroup.openDialog((deviceId, businessGroupId) => {
console.log(deviceId)
console.log(businessGroupId)
this.form.gbBusinessGroupId = businessGroupId this.form.gbBusinessGroupId = businessGroupId
this.form.gbParentId = deviceId this.form.gbParentId = deviceId
this.getPaths()
}) })
}, },
cancelSubmit: function() { cancelSubmit: function() {
if (this.cancel) { if (this.cancel) {
this.cancel() this.cancel()
} }
},
getPaths: function() {
this.parentPath = []
if (this.form.gbParentId && this.form.gbBusinessGroupId) {
this.$store.dispatch('group/getPath', {
deviceId: this.form.gbParentId,
businessGroup: this.form.gbBusinessGroupId
})
.then(data => {
console.log(data)
const path = []
for (let i = 0; i < data.length; i++) {
path.push(data[i].name)
}
this.parentPath = path
})
}
} }
} }
} }

View File

@ -149,7 +149,7 @@ export default {
*/ */
timeSegments: { timeSegments: {
type: Array, type: Array,
default: () => [] default: () => {}
}, },
// //
backgroundColor: { backgroundColor: {

View File

@ -135,9 +135,9 @@ export default {
.then(data => { .then(data => {
this.total = data.total this.total = data.total
this.deviceList = data.list this.deviceList = data.list
}).finally(() => [ }).finally(() => {
this.getDeviceListLoading = false this.getDeviceListLoading = false
]) })
}, },
openDialog: function(callback) { openDialog: function(callback) {
this.listChangeCallback = callback this.listChangeCallback = callback

View File

@ -45,7 +45,8 @@ export default {
return { return {
showDialog: false, showDialog: false,
endCallback: false, endCallback: false,
regionDeviceId: '' regionDeviceId: '',
regionName: ''
} }
}, },
computed: {}, computed: {},
@ -54,10 +55,12 @@ export default {
openDialog: function(callback) { openDialog: function(callback) {
this.showDialog = true this.showDialog = true
this.endCallback = callback this.endCallback = callback
this.regionDeviceId = ''
this.regionName = ''
}, },
onSubmit: function() { onSubmit: function() {
if (this.endCallback) { if (this.endCallback) {
this.endCallback(this.regionDeviceId) this.endCallback(this.regionDeviceId, this.regionName)
} }
this.close() this.close()
}, },
@ -66,6 +69,7 @@ export default {
}, },
treeNodeClickEvent: function(region) { treeNodeClickEvent: function(region) {
this.regionDeviceId = region.deviceId this.regionDeviceId = region.deviceId
this.regionName = region.name
}, },
onChannelChange: function(deviceId) { onChannelChange: function(deviceId) {
// //

View File

@ -47,6 +47,7 @@ export default {
showDialog: false, showDialog: false,
endCallback: false, endCallback: false,
groupDeviceId: '', groupDeviceId: '',
groupName: '',
businessGroup: '' businessGroup: ''
} }
}, },
@ -56,10 +57,13 @@ export default {
openDialog: function(callback) { openDialog: function(callback) {
this.showDialog = true this.showDialog = true
this.endCallback = callback this.endCallback = callback
this.groupDeviceId = ''
this.groupName = ''
this.businessGroup = ''
}, },
onSubmit: function() { onSubmit: function() {
if (this.endCallback) { if (this.endCallback) {
this.endCallback(this.groupDeviceId, this.businessGroup) this.endCallback(this.groupDeviceId, this.businessGroup, this.groupName)
} }
this.close() this.close()
}, },
@ -74,6 +78,7 @@ export default {
} }
this.groupDeviceId = group.deviceId this.groupDeviceId = group.deviceId
this.businessGroup = group.businessGroup this.businessGroup = group.businessGroup
this.groupName = group.name
}, },
onChannelChange: function(deviceId) { onChannelChange: function(deviceId) {
// //

View File

@ -74,6 +74,7 @@
<div style="margin-left: 10px; line-height: 38px;"> <div style="margin-left: 10px; line-height: 38px;">
<el-button :loading="quicklyDrawThinLoading" @click="quicklyDrawThin" size="mini">快速抽稀</el-button> <el-button :loading="quicklyDrawThinLoading" @click="quicklyDrawThin" size="mini">快速抽稀</el-button>
<el-button size="mini" @click="boxDrawThin" >局部抽稀</el-button> <el-button size="mini" @click="boxDrawThin" >局部抽稀</el-button>
<el-button size="mini" @click="resetDrawThinData()">数据还原</el-button>
<el-button :loading="saveDrawThinLoading" type="primary" :disabled="!layerGroupSource" size="mini" @click="saveDrawThin()">保存</el-button> <el-button :loading="saveDrawThinLoading" type="primary" :disabled="!layerGroupSource" size="mini" @click="saveDrawThin()">保存</el-button>
<el-button type="warning" size="mini" @click="showDrawThinBox(false)">取消</el-button> <el-button type="warning" size="mini" @click="showDrawThinBox(false)">取消</el-button>
</div> </div>
@ -308,7 +309,7 @@ export default {
status: data.gbStatus status: data.gbStatus
} }
if (!this.$refs.mapComponent.hasFeature(channelLayer, data.gbId)) { if (!this.$refs.mapComponent.hasFeature(channelLayer, data.gbId)) {
this.$refs.mapComponent.addFeature(channelLayer, cameraData, ) this.$refs.mapComponent.addFeature(channelLayer, cameraData)
} }
this.infoBoxId = this.$refs.mapComponent.openInfoBox(position, this.$refs.infobox, [0, -50]) this.infoBoxId = this.$refs.mapComponent.openInfoBox(position, this.$refs.infobox, [0, -50])
}, },
@ -358,7 +359,7 @@ export default {
channelLayer = this.$refs.mapComponent.updatePointLayer(channelLayer, cameraList, true) channelLayer = this.$refs.mapComponent.updatePointLayer(channelLayer, cameraList, true)
}else { }else {
console.log(cameraList.length) console.log(cameraList.length)
setTimeout(()=>{ setTimeout(() => {
channelLayer = this.$refs.mapComponent.addPointLayer(cameraList, clientEvent, null) channelLayer = this.$refs.mapComponent.addPointLayer(cameraList, clientEvent, null)
}) })
} }
@ -368,7 +369,7 @@ export default {
if (channelLayer) { if (channelLayer) {
channelLayer = this.$refs.mapComponent.updatePointLayer(channelLayer, cameraList, true) channelLayer = this.$refs.mapComponent.updatePointLayer(channelLayer, cameraList, true)
}else { }else {
setTimeout(()=>{ setTimeout(() => {
channelLayer = this.$refs.mapComponent.addPointLayer(cameraList, clientEvent, { channelLayer = this.$refs.mapComponent.addPointLayer(cameraList, clientEvent, {
declutter: true declutter: true
}) })
@ -506,7 +507,7 @@ export default {
this.clean() this.clean()
this.$refs.queryTrace.openDialog(data, (channelPositions) => { this.$refs.queryTrace.openDialog(data, (channelPositions) => {
if (channelPositions.length === 0) { if (channelPositions.length === 0) {
this.$message.info({ this.$message.warning({
showClose: true, showClose: true,
message: '未查询到轨迹信息' message: '未查询到轨迹信息'
}) })
@ -519,7 +520,7 @@ export default {
} }
if (positions.length === 0) { if (positions.length === 0) {
this.$message.info({ this.$message.warning({
showClose: true, showClose: true,
message: '未查询到轨迹信息' message: '未查询到轨迹信息'
}) })
@ -587,7 +588,7 @@ export default {
}) })
}, },
boxDrawThin: function (){ boxDrawThin: function (){
this.$message.info({ this.$message.warning({
showClose: true, showClose: true,
message: '点击地图进行框选' message: '点击地图进行框选'
}) })
@ -598,7 +599,7 @@ export default {
if (channelLayer) { if (channelLayer) {
this.$refs.mapComponent.clearLayer(channelLayer) this.$refs.mapComponent.clearLayer(channelLayer)
} }
this.$message.info({ this.$message.warning({
showClose: true, showClose: true,
message: '正在抽稀,请稍等' message: '正在抽稀,请稍等'
}) })
@ -808,6 +809,21 @@ export default {
this.saveDrawThinLoading = false this.saveDrawThinLoading = false
}) })
},
resetDrawThinData(){
this.$confirm('确定移除抽稀结果?', '操作提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('commonChanel/resetLevel')
.then(() => {
this.$message.success({
showClose: true,
message: '数据还原成功'
})
})
})
} }
} }