增加批量修改通道的业务分组以及行政区划,支持筛选业务分组和行政区划,支持抽稀还原,国标通道编辑增加表单校验
This commit is contained in:
@@ -104,16 +104,26 @@ public class ChannelController {
|
||||
@Parameter(name = "online", description = "是否在线")
|
||||
@Parameter(name = "hasRecordPlan", description = "是否已设置录制计划")
|
||||
@Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理")
|
||||
@Parameter(name = "civilCode", description = "行政区划")
|
||||
@Parameter(name = "parentDeviceId", description = "父节点编码")
|
||||
@GetMapping("/list")
|
||||
public PageInfo<CommonGBChannel> queryList(int page, int count,
|
||||
@RequestParam(required = false) String query,
|
||||
@RequestParam(required = false) Boolean online,
|
||||
@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)){
|
||||
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))
|
||||
@@ -481,4 +491,13 @@ public class ChannelController {
|
||||
public void saveLevel(@RequestBody List<ChannelForThin> channels){
|
||||
channelService.saveLevel(channels);
|
||||
}
|
||||
|
||||
@Operation(summary = "为地图去除抽稀结果", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@PostMapping("/map/reset-level")
|
||||
public void resetLevel(){
|
||||
channelService.resetLevel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -474,7 +474,8 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryList")
|
||||
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 wvp_device_channel " +
|
||||
@@ -668,4 +669,8 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryMeetingChannelList")
|
||||
List<CameraChannel> queryMeetingChannelList(@Param("business") String business);
|
||||
|
||||
@Update("UPDATE wvp_device_channel SET map_level=null")
|
||||
int resetLevel();
|
||||
|
||||
}
|
||||
|
||||
@@ -289,6 +289,12 @@ public class ChannelProvider {
|
||||
if (params.get("dataType") != null) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public interface IGbChannelService {
|
||||
|
||||
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);
|
||||
|
||||
@@ -104,4 +104,7 @@ public interface IGbChannelService {
|
||||
void saveLevel(List<ChannelForThin> channels);
|
||||
|
||||
CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel);
|
||||
|
||||
void resetLevel();
|
||||
|
||||
}
|
||||
|
||||
@@ -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.event.EventPublisher;
|
||||
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.IPlatformChannelService;
|
||||
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.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -68,9 +68,12 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "缺少通道数据类型或通道数据关联设备ID");
|
||||
}
|
||||
CommonGBChannel commonGBChannelInDb = commonGBChannelMapper.queryByDataId(commonGBChannel.getDataType(), commonGBChannel.getDataDeviceId());
|
||||
if (commonGBChannelInDb != null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "此推流已经关联通道");
|
||||
}
|
||||
Assert.isNull(commonGBChannelInDb, "此推流已经关联通道");
|
||||
|
||||
// 检验国标编号是否重复
|
||||
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByDeviceId(commonGBChannel.getGbDeviceId());
|
||||
Assert.isTrue(channelList.isEmpty(), "国标编号已经存在");
|
||||
|
||||
commonGBChannel.setCreateTime(DateUtil.getNow());
|
||||
commonGBChannel.setUpdateTime(DateUtil.getNow());
|
||||
int result = commonGBChannelMapper.insert(commonGBChannel);
|
||||
@@ -741,14 +744,15 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
}
|
||||
|
||||
@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);
|
||||
if (query != null) {
|
||||
query = query.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);
|
||||
}
|
||||
|
||||
@@ -826,7 +830,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
|
||||
@Override
|
||||
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
|
||||
@@ -850,4 +854,9 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
public CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel) {
|
||||
return commonGBChannelMapper.queryCommonChannelByDeviceChannel(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetLevel() {
|
||||
commonGBChannelMapper.resetLevel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,9 +285,9 @@ public class GroupServiceImpl implements IGroupService, CommandLineRunner {
|
||||
if (group == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "虚拟组织不存在");
|
||||
}
|
||||
groupList.add(group);
|
||||
List<Group> allParent = getAllParent(group);
|
||||
groupList.addAll(allParent);
|
||||
groupList.add(group);
|
||||
return groupList;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||
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.RedisGroupMessage;
|
||||
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.error("[REDIS消息-业务分组同步回复] 异常内容: ", e);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public class CameraGroup extends Group {
|
||||
}
|
||||
|
||||
public void addChild(CameraGroup child) {
|
||||
if (child == null) {
|
||||
return;
|
||||
}
|
||||
this.child.add(child);
|
||||
if (this.parent != null) {
|
||||
this.parent.addChild(child);
|
||||
|
||||
@@ -401,23 +401,12 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
public CameraChannel queryOne(String deviceId, String deviceCode, String geoCoordSys) {
|
||||
List<CameraChannel> cameraChannels = channelMapper.queryGbChannelByChannelDeviceIdAndGbDeviceId(deviceId, deviceCode);
|
||||
Assert.isTrue(cameraChannels.isEmpty(), "通道不存在");
|
||||
CameraChannel channel = cameraChannels.get(0);
|
||||
if (geoCoordSys != null && channel.getGbLongitude() != null && channel.getGbLatitude() != null
|
||||
&& 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]);
|
||||
}
|
||||
}
|
||||
List<CameraChannel> channels = addIconPathAndPositionForCameraChannelList(cameraChannels, geoCoordSys);
|
||||
CameraChannel channel = channels.get(0);
|
||||
if (deviceCode != null) {
|
||||
channel.setDeviceCode(deviceCode);
|
||||
}
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export function add(data) {
|
||||
}
|
||||
|
||||
export function getList(params) {
|
||||
const { page, count, query, online, hasRecordPlan, channelType } = params
|
||||
const { page, count, query, online, hasRecordPlan, channelType, civilCode, parentDeviceId } = params
|
||||
return request({
|
||||
method: 'get',
|
||||
url: '/api/common/channel/list',
|
||||
@@ -70,7 +70,9 @@ export function getList(params) {
|
||||
channelType: channelType,
|
||||
query: query,
|
||||
online: online,
|
||||
hasRecordPlan: hasRecordPlan
|
||||
hasRecordPlan: hasRecordPlan,
|
||||
civilCode: civilCode,
|
||||
parentDeviceId: parentDeviceId
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -605,6 +607,12 @@ export function saveLevel(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function resetLevel() {
|
||||
return request({
|
||||
method: 'post',
|
||||
url: '/api/common/channel/map/reset-level'
|
||||
})
|
||||
}
|
||||
export function test() {
|
||||
return request({
|
||||
method: 'get',
|
||||
|
||||
@@ -48,7 +48,7 @@ import {
|
||||
stopPlayback,
|
||||
pausePlayback,
|
||||
resumePlayback,
|
||||
seekPlayback, speedPlayback, getAllForMap, test, saveLevel
|
||||
seekPlayback, speedPlayback, getAllForMap, test, saveLevel, resetLevel
|
||||
} from '@/api/commonChannel'
|
||||
|
||||
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 }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
test().then(response => {
|
||||
|
||||
@@ -132,7 +132,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
channelList: [],
|
||||
tableHeight: `calc(100vh - 190px)`,
|
||||
tableHeight: 'calc(100vh - 190px)',
|
||||
searchStr: '',
|
||||
channelType: '',
|
||||
online: '',
|
||||
|
||||
@@ -37,6 +37,35 @@
|
||||
<el-option v-for="item in Object.values($channelTypeList)" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</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-button icon="el-icon-refresh-right" circle @click="refresh()" title="刷新表格"/>
|
||||
</el-form-item>
|
||||
@@ -48,7 +77,9 @@
|
||||
height="calc(100% - 64px)"
|
||||
style="width: 100%; font-size: 12px;"
|
||||
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="gbDeviceId" label="编号" min-width="180" />
|
||||
<el-table-column prop="gbManufacturer" label="厂家" min-width="100" />
|
||||
@@ -128,7 +159,7 @@
|
||||
style="text-align: right"
|
||||
:current-page="currentPage"
|
||||
:page-size="count"
|
||||
:page-sizes="[15, 25, 35, 50]"
|
||||
:page-sizes="[15, 25, 35, 50, 100, 500, 1000]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@@ -138,6 +169,8 @@
|
||||
|
||||
<devicePlayer ref="devicePlayer" />
|
||||
<channel-edit v-if="editId" :id="editId" :close-edit="closeEdit" />
|
||||
<chooseCivilCode ref="chooseCivilCode" />
|
||||
<chooseGroup ref="chooseGroup" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -145,11 +178,17 @@
|
||||
<script>
|
||||
import devicePlayer from '@/views/common/channelPlayer/index.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 {
|
||||
name: 'ChannelList',
|
||||
components: {
|
||||
ChooseGroup,
|
||||
devicePlayer,
|
||||
ChooseCivilCode,
|
||||
ChannelEdit: Edit
|
||||
},
|
||||
props: {
|
||||
@@ -203,7 +242,15 @@ export default {
|
||||
count: this.defaultCount | 15,
|
||||
total: 0,
|
||||
beforeUrl: '/device',
|
||||
editId: null
|
||||
editId: null,
|
||||
civilCodeName: null,
|
||||
civilCodeDeviceId: null,
|
||||
|
||||
groupName: null,
|
||||
groupDeviceId: null,
|
||||
groupBusiness: null,
|
||||
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -214,6 +261,9 @@ export default {
|
||||
clearTimeout(this.updateLooper)
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange: function(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
initData: function() {
|
||||
this.getChannelList()
|
||||
},
|
||||
@@ -236,7 +286,9 @@ export default {
|
||||
count: this.count,
|
||||
query: this.searchStr,
|
||||
online: this.online,
|
||||
channelType: this.channelType
|
||||
channelType: this.channelType,
|
||||
civilCode: this.civilCodeDeviceId,
|
||||
parentDeviceId: this.groupDeviceId
|
||||
}).then(data => {
|
||||
this.total = data.total
|
||||
this.channelList = data.list
|
||||
@@ -334,6 +386,114 @@ export default {
|
||||
} else if (command === 'cloudRecords') {
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
channelList: [],
|
||||
tableHeight: `calc(100vh - ${this.$refs.queryForm.offsetHeight}px)`,
|
||||
tableHeight: 'calc(100vh - 190px)',
|
||||
searchStr: '',
|
||||
channelType: '',
|
||||
online: '',
|
||||
@@ -148,6 +148,7 @@ export default {
|
||||
|
||||
created() {
|
||||
this.initData()
|
||||
this.tableHeight = `calc(100vh - ${this.$refs.queryForm.offsetHeight}px)`
|
||||
},
|
||||
destroyed() {
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<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">
|
||||
<el-form-item label="名称">
|
||||
<el-form-item label="名称" prop="gbName">
|
||||
<el-input v-model="form.gbName" placeholder="请输入通道名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="编码">
|
||||
<el-form-item label="编码" prop="gbDeviceId">
|
||||
<el-input v-model="form.gbDeviceId" placeholder="请输入通道编码">
|
||||
<template v-slot:append>
|
||||
<el-button @click="buildDeviceIdCode(form.gbDeviceId)">生成</el-button>
|
||||
@@ -13,7 +13,7 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备厂商">
|
||||
<el-input v-model="form.gbManufacturer" placeholder="请输入设备厂商" />
|
||||
<el-input v-model="gbManufacturer" placeholder="请输入设备厂商" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备型号">
|
||||
<el-autocomplete
|
||||
@@ -40,18 +40,36 @@
|
||||
<el-form-item label="安装地址">
|
||||
<el-input v-model="form.gbAddress" 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-form-item label="监视方位">
|
||||
<el-select v-model="form.gbDirectionType" style="width: 100%" placeholder="请选择监视方位">
|
||||
<el-option label="东(西向东)" :value="1" />
|
||||
<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-form-item>
|
||||
|
||||
<el-form-item label="父节点编码">
|
||||
<el-input v-model="form.gbParentId" placeholder="请输入父节点编码或选择所属虚拟组织">
|
||||
<el-input v-model="form.gbParentId" placeholder="请输入父节点编码或选择所属虚拟组织" @change="getPaths">
|
||||
<template v-slot:append>
|
||||
<el-button @click="chooseGroup()">选择</el-button>
|
||||
</template>
|
||||
</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 label="设备状态">
|
||||
<el-select v-model="form.gbStatus" style="width: 100%" placeholder="请选择设备状态">
|
||||
@@ -80,12 +98,12 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="业务分组编号">
|
||||
<el-input v-model="form.gbBusinessGroupId" placeholder="请输入业务分组编号" @change="getPaths"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="警区">
|
||||
<el-input v-model="form.gbBlock" placeholder="请输入警区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备归属">
|
||||
<el-input v-model="form.gbOwner" placeholder="请输入设备归属" />
|
||||
</el-form-item>
|
||||
<el-form-item label="信令安全模式">
|
||||
<el-select v-model="form.gbSafetyWay" style="width: 100%" placeholder="请选择信令安全模式">
|
||||
<el-option label="不采用" :value="0" />
|
||||
@@ -138,8 +156,14 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="业务分组编号">
|
||||
<el-input v-model="form.gbBusinessGroupId" placeholder="请输入业务分组编号" />
|
||||
<el-form-item label="设备归属">
|
||||
<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 label="位置类型">
|
||||
<el-select v-model="form.gbPositionType" style="width: 100%" placeholder="请选择位置类型">
|
||||
@@ -226,10 +250,9 @@
|
||||
<el-form-item >
|
||||
<el-checkbox v-model="form.enableBroadcastForBool" >语音对讲(非标属性)</el-checkbox>
|
||||
</el-form-item>
|
||||
|
||||
<div style="float: right;">
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button v-if="cancel" @click="cancelSubmit">取消</el-button>
|
||||
<div style="text-align: right">
|
||||
<el-button type="primary" @click="onSubmit" >保存</el-button>
|
||||
<el-button v-if="cancel" @click="cancelSubmit" >取消</el-button>
|
||||
<el-button v-if="form.dataType === 1" @click="reset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -256,8 +279,17 @@ export default {
|
||||
props: ['id', 'dataForm', 'saveSuccess', 'cancel'],
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
gbName: [
|
||||
{ required: true, message: '请输入通道名称', trigger: 'blur' }
|
||||
],
|
||||
gbDeviceId: [
|
||||
{ required: true, message: '请输入通道编号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
loading: false,
|
||||
modelList: [],
|
||||
parentPath: [],
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
@@ -276,8 +308,8 @@ export default {
|
||||
if (!this.dataForm.gbDeviceId) {
|
||||
this.dataForm.gbDeviceId = ''
|
||||
}
|
||||
console.log(this.dataForm)
|
||||
this.form = this.dataForm
|
||||
this.getPaths()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -289,38 +321,42 @@ export default {
|
||||
callback(results)
|
||||
},
|
||||
onSubmit: function() {
|
||||
this.loading = true
|
||||
if (this.form.gbDownloadSpeedArray) {
|
||||
this.form.gbDownloadSpeed = this.form.gbDownloadSpeedArray.join('/')
|
||||
}
|
||||
this.form.enableBroadcast = this.form.enableBroadcastForBool ? 1 : 0
|
||||
if (this.form.gbId) {
|
||||
this.$store.dispatch('commonChanel/update', this.form)
|
||||
.then(data => {
|
||||
this.$message.success({
|
||||
showClose: true,
|
||||
message: '保存成功'
|
||||
this.$refs.channelForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
if (this.form.gbDownloadSpeedArray) {
|
||||
this.form.gbDownloadSpeed = this.form.gbDownloadSpeedArray.join('/')
|
||||
}
|
||||
this.form.enableBroadcast = this.form.enableBroadcastForBool ? 1 : 0
|
||||
if (this.form.gbId) {
|
||||
this.$store.dispatch('commonChanel/update', this.form)
|
||||
.then(data => {
|
||||
this.$message.success({
|
||||
showClose: true,
|
||||
message: '保存成功'
|
||||
})
|
||||
if (this.saveSuccess) {
|
||||
this.saveSuccess()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
if (this.saveSuccess) {
|
||||
this.saveSuccess()
|
||||
}
|
||||
}).finally(() => [
|
||||
this.loading = false
|
||||
])
|
||||
} else {
|
||||
this.$store.dispatch('commonChanel/add', this.form)
|
||||
.then(data => {
|
||||
this.$message.success({
|
||||
showClose: true,
|
||||
message: '保存成功'
|
||||
} else {
|
||||
this.$store.dispatch('commonChanel/add', this.form)
|
||||
.then(data => {
|
||||
this.$message.success({
|
||||
showClose: true,
|
||||
message: '保存成功'
|
||||
})
|
||||
if (this.saveSuccess) {
|
||||
this.saveSuccess()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
if (this.saveSuccess) {
|
||||
this.saveSuccess()
|
||||
}
|
||||
}).finally(() => [
|
||||
this.loading = false
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
reset: function() {
|
||||
this.$confirm('确定重置为默认内容?', '提示', {
|
||||
@@ -346,9 +382,9 @@ export default {
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error(error)
|
||||
}).finally(() => [
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
])
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
@@ -362,6 +398,7 @@ export default {
|
||||
}
|
||||
this.form = data
|
||||
this.$set(this.form, 'enableBroadcastForBool', this.form.enableBroadcast === 1)
|
||||
this.getPaths()
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false
|
||||
@@ -369,10 +406,7 @@ export default {
|
||||
},
|
||||
buildDeviceIdCode: function(deviceId) {
|
||||
this.$refs.channelCode.openDialog(code => {
|
||||
console.log(this.form)
|
||||
console.log('code===> ' + code)
|
||||
this.form.gbDeviceId = code
|
||||
console.log('code22===> ' + code)
|
||||
}, deviceId)
|
||||
},
|
||||
chooseCivilCode: function() {
|
||||
@@ -382,16 +416,32 @@ export default {
|
||||
},
|
||||
chooseGroup: function() {
|
||||
this.$refs.chooseGroup.openDialog((deviceId, businessGroupId) => {
|
||||
console.log(deviceId)
|
||||
console.log(businessGroupId)
|
||||
this.form.gbBusinessGroupId = businessGroupId
|
||||
this.form.gbParentId = deviceId
|
||||
this.getPaths()
|
||||
})
|
||||
},
|
||||
cancelSubmit: function() {
|
||||
if (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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ export default {
|
||||
*/
|
||||
timeSegments: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
default: () => {}
|
||||
},
|
||||
// 时间轴背景颜色
|
||||
backgroundColor: {
|
||||
|
||||
@@ -135,9 +135,9 @@ export default {
|
||||
.then(data => {
|
||||
this.total = data.total
|
||||
this.deviceList = data.list
|
||||
}).finally(() => [
|
||||
}).finally(() => {
|
||||
this.getDeviceListLoading = false
|
||||
])
|
||||
})
|
||||
},
|
||||
openDialog: function(callback) {
|
||||
this.listChangeCallback = callback
|
||||
|
||||
@@ -45,7 +45,8 @@ export default {
|
||||
return {
|
||||
showDialog: false,
|
||||
endCallback: false,
|
||||
regionDeviceId: ''
|
||||
regionDeviceId: '',
|
||||
regionName: ''
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
@@ -54,10 +55,12 @@ export default {
|
||||
openDialog: function(callback) {
|
||||
this.showDialog = true
|
||||
this.endCallback = callback
|
||||
this.regionDeviceId = ''
|
||||
this.regionName = ''
|
||||
},
|
||||
onSubmit: function() {
|
||||
if (this.endCallback) {
|
||||
this.endCallback(this.regionDeviceId)
|
||||
this.endCallback(this.regionDeviceId, this.regionName)
|
||||
}
|
||||
this.close()
|
||||
},
|
||||
@@ -66,6 +69,7 @@ export default {
|
||||
},
|
||||
treeNodeClickEvent: function(region) {
|
||||
this.regionDeviceId = region.deviceId
|
||||
this.regionName = region.name
|
||||
},
|
||||
onChannelChange: function(deviceId) {
|
||||
//
|
||||
|
||||
@@ -47,6 +47,7 @@ export default {
|
||||
showDialog: false,
|
||||
endCallback: false,
|
||||
groupDeviceId: '',
|
||||
groupName: '',
|
||||
businessGroup: ''
|
||||
}
|
||||
},
|
||||
@@ -56,10 +57,13 @@ export default {
|
||||
openDialog: function(callback) {
|
||||
this.showDialog = true
|
||||
this.endCallback = callback
|
||||
this.groupDeviceId = ''
|
||||
this.groupName = ''
|
||||
this.businessGroup = ''
|
||||
},
|
||||
onSubmit: function() {
|
||||
if (this.endCallback) {
|
||||
this.endCallback(this.groupDeviceId, this.businessGroup)
|
||||
this.endCallback(this.groupDeviceId, this.businessGroup, this.groupName)
|
||||
}
|
||||
this.close()
|
||||
},
|
||||
@@ -74,6 +78,7 @@ export default {
|
||||
}
|
||||
this.groupDeviceId = group.deviceId
|
||||
this.businessGroup = group.businessGroup
|
||||
this.groupName = group.name
|
||||
},
|
||||
onChannelChange: function(deviceId) {
|
||||
//
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<div style="margin-left: 10px; line-height: 38px;">
|
||||
<el-button :loading="quicklyDrawThinLoading" @click="quicklyDrawThin" size="mini">快速抽稀</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 type="warning" size="mini" @click="showDrawThinBox(false)">取消</el-button>
|
||||
</div>
|
||||
@@ -308,7 +309,7 @@ export default {
|
||||
status: data.gbStatus
|
||||
}
|
||||
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])
|
||||
},
|
||||
@@ -358,7 +359,7 @@ export default {
|
||||
channelLayer = this.$refs.mapComponent.updatePointLayer(channelLayer, cameraList, true)
|
||||
}else {
|
||||
console.log(cameraList.length)
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
channelLayer = this.$refs.mapComponent.addPointLayer(cameraList, clientEvent, null)
|
||||
})
|
||||
}
|
||||
@@ -368,7 +369,7 @@ export default {
|
||||
if (channelLayer) {
|
||||
channelLayer = this.$refs.mapComponent.updatePointLayer(channelLayer, cameraList, true)
|
||||
}else {
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
channelLayer = this.$refs.mapComponent.addPointLayer(cameraList, clientEvent, {
|
||||
declutter: true
|
||||
})
|
||||
@@ -506,7 +507,7 @@ export default {
|
||||
this.clean()
|
||||
this.$refs.queryTrace.openDialog(data, (channelPositions) => {
|
||||
if (channelPositions.length === 0) {
|
||||
this.$message.info({
|
||||
this.$message.warning({
|
||||
showClose: true,
|
||||
message: '未查询到轨迹信息'
|
||||
})
|
||||
@@ -519,7 +520,7 @@ export default {
|
||||
|
||||
}
|
||||
if (positions.length === 0) {
|
||||
this.$message.info({
|
||||
this.$message.warning({
|
||||
showClose: true,
|
||||
message: '未查询到轨迹信息'
|
||||
})
|
||||
@@ -587,7 +588,7 @@ export default {
|
||||
})
|
||||
},
|
||||
boxDrawThin: function (){
|
||||
this.$message.info({
|
||||
this.$message.warning({
|
||||
showClose: true,
|
||||
message: '点击地图进行框选'
|
||||
})
|
||||
@@ -598,7 +599,7 @@ export default {
|
||||
if (channelLayer) {
|
||||
this.$refs.mapComponent.clearLayer(channelLayer)
|
||||
}
|
||||
this.$message.info({
|
||||
this.$message.warning({
|
||||
showClose: true,
|
||||
message: '正在抽稀,请稍等'
|
||||
})
|
||||
@@ -808,6 +809,21 @@ export default {
|
||||
this.saveDrawThinLoading = false
|
||||
})
|
||||
|
||||
},
|
||||
resetDrawThinData(){
|
||||
this.$confirm('确定移除抽稀结果?', '操作提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$store.dispatch('commonChanel/resetLevel')
|
||||
.then(() => {
|
||||
this.$message.success({
|
||||
showClose: true,
|
||||
message: '数据还原成功'
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user