临时提交

pull/1642/head
648540858 2024-07-30 17:58:18 +08:00
parent 112cb2dfd8
commit 3ce973d2ee
17 changed files with 237 additions and 46 deletions

View File

@ -52,6 +52,16 @@ public class GlobalExceptionHandler {
public WVPResult<String> exceptionHandler(HttpRequestMethodNotSupportedException e) { public WVPResult<String> exceptionHandler(HttpRequestMethodNotSupportedException e) {
return WVPResult.fail(ErrorCode.ERROR400); return WVPResult.fail(ErrorCode.ERROR400);
} }
/**
*
* @param e
* @return
*/
@ExceptionHandler(IllegalArgumentException.class)
@ResponseStatus(HttpStatus.OK)
public WVPResult<String> exceptionHandler(IllegalArgumentException e) {
return WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMessage());
}
/** /**
@ -60,7 +70,7 @@ public class GlobalExceptionHandler {
* @return * @return
*/ */
@ExceptionHandler(ControllerException.class) @ExceptionHandler(ControllerException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseStatus(HttpStatus.OK)
public ResponseEntity<WVPResult<String>> exceptionHandler(ControllerException e) { public ResponseEntity<WVPResult<String>> exceptionHandler(ControllerException e) {
return new ResponseEntity<>(WVPResult.fail(e.getCode(), e.getMsg()), HttpStatus.OK); return new ResponseEntity<>(WVPResult.fail(e.getCode(), e.getMsg()), HttpStatus.OK);
} }

View File

@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.DeviceType; import com.genersoft.iot.vmp.gb28181.bean.DeviceType;
import com.genersoft.iot.vmp.gb28181.bean.IndustryCodeType; import com.genersoft.iot.vmp.gb28181.bean.IndustryCodeType;
import com.genersoft.iot.vmp.gb28181.bean.NetworkIdentificationType; import com.genersoft.iot.vmp.gb28181.bean.NetworkIdentificationType;
import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelToRegionParam;
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService; import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.media.service.IMediaServerService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
@ -15,6 +16,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
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.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -97,4 +99,19 @@ public class CommonChannelController {
} }
return channelService.queryList(page, count, query, online, hasCivilCode); return channelService.queryList(page, count, query, online, hasCivilCode);
} }
@Operation(summary = "通道设置行政区划", security = @SecurityRequirement(name = JwtUtils.HEADER))
@PostMapping("/region/add")
public void addChannelToRegion(@RequestBody ChannelToRegionParam param){
Assert.notEmpty(param.getChannelIds(),"通道ID不可为空");
Assert.hasLength(param.getCivilCode(),"未添加行政区划");
channelService.addChannelToRegion(param.getCivilCode(), param.getChannelIds());
}
@Operation(summary = "通道删除行政区划", security = @SecurityRequirement(name = JwtUtils.HEADER))
@PostMapping("/region/delete")
public void deleteChannelToRegion(@RequestBody ChannelToRegionParam param){
Assert.isTrue(param.getChannelIds().isEmpty() && ObjectUtils.isEmpty(param.getCivilCode()),"参数异常");
channelService.deleteChannelToRegion(param.getCivilCode(), param.getChannelIds());
}
} }

View File

@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -76,11 +77,11 @@ public class RegionController {
} }
@Operation(summary = "删除区域") @Operation(summary = "删除区域")
@Parameter(name = "regionDeviceId", description = "区域编码", required = true) @Parameter(name = "deviceId", description = "区域编码", required = true)
@ResponseBody @ResponseBody
@DeleteMapping("/delete") @DeleteMapping("/delete")
public void delete(String deviceId){ public void delete(String deviceId){
assert !ObjectUtils.isEmpty(deviceId); Assert.hasLength(deviceId, "区域编码deviceId不需要存在");
boolean result = regionService.deleteByDeviceId(deviceId); boolean result = regionService.deleteByDeviceId(deviceId);
if (!result) { if (!result) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "移除失败"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "移除失败");

View File

@ -0,0 +1,13 @@
package com.genersoft.iot.vmp.gb28181.controller.bean;
import lombok.Data;
import java.util.List;
@Data
public class ChannelToRegionParam {
private String civilCode;
private List<Integer> channelIds;
}

View File

@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.gb28181.dao.provider.ChannelProvider;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.List; import java.util.List;
@Mapper @Mapper
@ -290,7 +291,7 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryByIds") @SelectProvider(type = ChannelProvider.class, method = "queryByIds")
List<CommonGBChannel> queryByIds(List<CommonGBChannel> commonGBChannelList); List<CommonGBChannel> queryByIds(Collection<Integer> ids);
@Delete(value = {" <script>" + @Delete(value = {" <script>" +
" delete from wvp_device_channel" + " delete from wvp_device_channel" +
@ -328,4 +329,16 @@ public interface CommonGBChannelMapper {
" <foreach collection='allChildren' item='item' open='(' separator=',' close=')' > #{item.deviceId}</foreach>" + " <foreach collection='allChildren' item='item' open='(' separator=',' close=')' > #{item.deviceId}</foreach>" +
" </script>"}) " </script>"})
int removeCivilCode(List<Region> allChildren); int removeCivilCode(List<Region> allChildren);
@Update(value = {" <script>" +
" UPDATE wvp_device_channel " +
" SET gb_civil_code = #{civilCode}" +
" WHERE id in "+
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
" </script>"})
int updateRegion(@Param("civilCode") String civilCode, @Param("channelList") List<CommonGBChannel> channelList);
@SelectProvider(type = ChannelProvider.class, method = "queryByIdsOrCivilCode")
List<CommonGBChannel> queryByIdsOrCivilCode(@Param("civilCode") String civilCode, @Param("ids") List<Integer> ids);
} }

View File

@ -1,5 +1,9 @@
package com.genersoft.iot.vmp.gb28181.dao.provider; package com.genersoft.iot.vmp.gb28181.dao.provider;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
public class ChannelProvider { public class ChannelProvider {
@ -93,20 +97,64 @@ public class ChannelProvider {
} }
public String queryInListByStatus(Map<String, Object> params ){ public String queryInListByStatus(Map<String, Object> params ){
return " <script>" + getBaseSelectSql() + StringBuilder sqlBuild = new StringBuilder();
" where gb_status=#{status} and id in " + sqlBuild.append(getBaseSelectSql());
" <foreach collection='commonGBChannelList' item='item' open='(' separator=',' close=')' > " + sqlBuild.append("where gb_status=#{status} and id in ( ");
" #{item.gbId}" +
" </foreach>" + List<CommonGBChannel> commonGBChannelList = (List<CommonGBChannel>)params.get("ids");
" </script>" ; boolean first = true;
for (CommonGBChannel channel : commonGBChannelList) {
if (!first) {
sqlBuild.append(",");
}
sqlBuild.append(channel.getGbId());
first = false;
}
sqlBuild.append(" )");
return sqlBuild.toString() ;
} }
public String queryByIds(Map<String, Object> params ){ public String queryByIds(Map<String, Object> params ){
return " <script>" + getBaseSelectSql() + StringBuilder sqlBuild = new StringBuilder();
" where id in " + sqlBuild.append(getBaseSelectSql());
" <foreach collection='commonGBChannelList' item='item' open='(' separator=',' close=')' > " + sqlBuild.append("where id in ( ");
" #{item.gbId}" +
" </foreach>" + Collection<Integer> ids = (Collection<Integer>)params.get("ids");
" </script>" ; boolean first = true;
for (Integer id : ids) {
if (!first) {
sqlBuild.append(",");
}
sqlBuild.append(id);
first = false;
}
sqlBuild.append(" )");
return sqlBuild.toString() ;
}
public String queryByIdsOrCivilCode(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql());
sqlBuild.append("where ");
if (params.get("civilCode") != null) {
sqlBuild.append(" gb_civil_code = #{civilCode} ");
if (params.get("ids") != null) {
sqlBuild.append(" OR ");
}
}
if (params.get("ids") != null) {
sqlBuild.append(" id in ( ");
Collection<Integer> ids = (Collection<Integer>)params.get("ids");
boolean first = true;
for (Integer id : ids) {
if (!first) {
sqlBuild.append(",");
}
sqlBuild.append(id);
first = false;
}
sqlBuild.append(" )");
}
return sqlBuild.toString() ;
} }
} }

View File

@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.gb28181.service;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import java.util.Collection;
import java.util.List; import java.util.List;
public interface IGbChannelService { public interface IGbChannelService {
@ -13,7 +14,7 @@ public interface IGbChannelService {
int delete(int gbId); int delete(int gbId);
void delete(List<CommonGBChannel> commonGBChannelList); void delete(Collection<Integer> ids);
int update(CommonGBChannel commonGBChannel); int update(CommonGBChannel commonGBChannel);
@ -44,4 +45,8 @@ public interface IGbChannelService {
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasCivilCode); PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasCivilCode);
void removeCivilCode(List<Region> allChildren); void removeCivilCode(List<Region> allChildren);
void addChannelToRegion(String civilCode, List<Integer> channelIds);
void deleteChannelToRegion(String civilCode, List<Integer> channelIds);
} }

View File

@ -29,6 +29,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.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
@ -279,8 +280,8 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
@Override @Override
public void updateChannelStreamIdentification(DeviceChannel channel) { public void updateChannelStreamIdentification(DeviceChannel channel) {
assert !ObjectUtils.isEmpty(channel.getId()); Assert.isTrue(channel.getId() > 0, "通道ID必须存在");
assert !ObjectUtils.isEmpty(channel.getStreamIdentification()); Assert.hasLength(channel.getStreamIdentification(), "码流标识必须存在");
if (ObjectUtils.isEmpty(channel.getStreamIdentification())) { if (ObjectUtils.isEmpty(channel.getStreamIdentification())) {
log.info("[重置通道码流类型] 设备: {}, 码流: {}", channel.getDeviceId(), channel.getStreamIdentification()); log.info("[重置通道码流类型] 设备: {}, 码流: {}", channel.getDeviceId(), channel.getStreamIdentification());
}else { }else {

View File

@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -67,8 +68,8 @@ public class GbChannelServiceImpl implements IGbChannelService {
} }
@Override @Override
public void delete(List<CommonGBChannel> commonGBChannelList) { public void delete(Collection<Integer> ids) {
List<CommonGBChannel> channelListInDb = commonGBChannelMapper.queryByIds(commonGBChannelList); List<CommonGBChannel> channelListInDb = commonGBChannelMapper.queryByIds(ids);
if (channelListInDb.isEmpty()) { if (channelListInDb.isEmpty()) {
return; return;
} }
@ -331,4 +332,40 @@ public class GbChannelServiceImpl implements IGbChannelService {
// TODO 是否需要通知上级, 或者等添加新的行政区划时发送更新通知 // TODO 是否需要通知上级, 或者等添加新的行政区划时发送更新通知
} }
@Override
public void addChannelToRegion(String civilCode, List<Integer> channelIds) {
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByIds(channelIds);
if (channelList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在");
}
int result = commonGBChannelMapper.updateRegion(civilCode, channelList);
// 发送通知
if (result > 0) {
try {
// 发送catalog
eventPublisher.catalogEventPublish(null, channelList, CatalogEvent.UPDATE);
}catch (Exception e) {
log.warn("[多个通道添加行政区划] 发送失败,数量:{}", channelList.size(), e);
}
}
}
@Override
public void deleteChannelToRegion(String civilCode, List<Integer> channelIds) {
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByIdsOrCivilCode(civilCode, channelIds);
if (channelList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在");
}
int result = commonGBChannelMapper.updateRegion(civilCode, channelList);
// 发送通知
if (result > 0) {
try {
// 发送catalog
eventPublisher.catalogEventPublish(null, channelList, CatalogEvent.UPDATE);
}catch (Exception e) {
log.warn("[多个通道添加行政区划] 发送失败,数量:{}", channelList.size(), e);
}
}
}
} }

View File

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException; import org.springframework.dao.DuplicateKeyException;
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.*; import java.util.*;
@ -41,8 +42,8 @@ public class RegionServiceImpl implements IRegionService {
@Override @Override
public void add(Region region) { public void add(Region region) {
assert region.getName() != null; Assert.hasLength(region.getName(), "名称必须存在");
assert region.getDeviceId() != null; Assert.hasLength(region.getDeviceId(), "国标编号必须存在");
if (ObjectUtils.isEmpty(region.getParentDeviceId().trim())) { if (ObjectUtils.isEmpty(region.getParentDeviceId().trim())) {
region.setParentDeviceId(null); region.setParentDeviceId(null);
} }
@ -95,7 +96,7 @@ public class RegionServiceImpl implements IRegionService {
@Override @Override
public PageInfo<Region> queryChildRegionList(String regionParentId, int page, int count) { public PageInfo<Region> queryChildRegionList(String regionParentId, int page, int count) {
assert regionParentId != null; Assert.hasLength(regionParentId, "上级行政区划编号必须存在");
PageHelper.startPage(page, count); PageHelper.startPage(page, count);
List<Region> all = regionMapper.getChildren(regionParentId); List<Region> all = regionMapper.getChildren(regionParentId);
return new PageInfo<>(all); return new PageInfo<>(all);

View File

@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.ZoneOffset; import java.time.ZoneOffset;
@ -121,8 +122,8 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
public String addTask(String app, String stream, MediaServer mediaServerItem, String startTime, String endTime, public String addTask(String app, String stream, MediaServer mediaServerItem, String startTime, String endTime,
String callId, String remoteHost, boolean filterMediaServer) { String callId, String remoteHost, boolean filterMediaServer) {
// 参数校验 // 参数校验
assert app != null; Assert.notNull(app,"应用名为NULL");
assert stream != null; Assert.notNull(stream,"流ID为NULL");
if (mediaServerItem.getRecordAssistPort() == 0) { if (mediaServerItem.getRecordAssistPort() == 0) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "为配置Assist服务"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "为配置Assist服务");
} }

View File

@ -33,6 +33,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionDefinition;
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;
@ -174,7 +175,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
} }
private void delete(StreamProxy streamProxy) { private void delete(StreamProxy streamProxy) {
assert streamProxy != null; Assert.notNull(streamProxy, "代理不可为NULL");
if (streamProxy.getPulling() != null && streamProxy.getPulling()) { if (streamProxy.getPulling() != null && streamProxy.getPulling()) {
stopProxy(streamProxy); stopProxy(streamProxy);
} }

View File

@ -35,6 +35,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionDefinition;
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.*; import java.util.*;
@ -247,8 +248,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override @Override
@Transactional @Transactional
public boolean update(StreamPush streamPush) { public boolean update(StreamPush streamPush) {
Assert.notNull(streamPush, "推流信息不可为NULL");
Assert.isTrue(streamPush.getId() > 0, "推流信息ID必须存在");
log.info("[更新推流]id: {}, app: {}, stream: {}, ", streamPush.getId(), streamPush.getApp(), streamPush.getStream()); log.info("[更新推流]id: {}, app: {}, stream: {}, ", streamPush.getId(), streamPush.getApp(), streamPush.getStream());
assert streamPush.getId() != null;
StreamPush streamPushInDb = streamPushMapper.select(streamPush.getId()); StreamPush streamPushInDb = streamPushMapper.select(streamPush.getId());
if (!streamPushInDb.getApp().equals(streamPush.getApp()) || !streamPushInDb.getStream().equals(streamPush.getStream())) { if (!streamPushInDb.getApp().equals(streamPush.getApp()) || !streamPushInDb.getStream().equals(streamPush.getStream())) {
// app或者stream变化 // app或者stream变化
@ -602,6 +604,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
} }
}); });
streamPushMapper.batchDel(streamPushList); streamPushMapper.batchDel(streamPushList);
gbChannelService.delete(commonGBChannelList); gbChannelService.delete(ids);
} }
} }

View File

@ -4,9 +4,10 @@
<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="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字" <el-input @input="search" style="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>
</div> </div>
</div> </div>
</div> </div>
@ -28,9 +29,9 @@
<el-radio v-if="node.data.type === 0 && node.level !== 1 " style="margin-right: 0" v-model="chooseId" @input="chooseIdChange" :label="node.data.id">{{''}}</el-radio> <el-radio v-if="node.data.type === 0 && node.level !== 1 " style="margin-right: 0" v-model="chooseId" @input="chooseIdChange" :label="node.data.id">{{''}}</el-radio>
</span> </span>
<span v-if="node.data.type === 0" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span> <span v-if="node.data.type === 0" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span>
<span v-if="node.data.type === 1" style="color: #409EFF" class="iconfont icon-file-stream2"></span> <span v-if="node.data.type === 1" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span>
<span style=" padding-left: 1px" v-if="node.data.id !==''">{{ node.label }}({{ node.data.id }})</span> <span style=" padding-left: 1px" v-if="node.data.id !=='' && showCode">{{ node.label }}-{{ node.data.id }}</span>
<span style=" padding-left: 1px" v-if="node.data.id ===''">{{ node.label }}</span> <span style=" padding-left: 1px" v-if="node.data.id ==='' || !showCode">{{ node.label }}</span>
</span> </span>
</vue-easy-tree> </vue-easy-tree>
</div> </div>
@ -51,6 +52,7 @@ export default {
}, },
data() { data() {
return { return {
showCode: false,
searchSrt: "", searchSrt: "",
chooseId: "", chooseId: "",
// props: { // props: {
@ -201,9 +203,11 @@ export default {
disabled: false, disabled: false,
onClick: () => { onClick: () => {
this.$axios({ this.$axios({
method: "delete", method: "post",
url: "/api/platform/catalog/relation/del", url: `/api/common/channel/region/delete`,
data: data data: {
channelIds: [data.id]
}
}).then((res) => { }).then((res) => {
console.log("移除成功") console.log("移除成功")
node.parent.loaded = false node.parent.loaded = false

View File

@ -54,8 +54,8 @@
<el-table-column label="添加状态" min-width="100"> <el-table-column label="添加状态" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" v-if="scope.row.civilCode">({{scope.row.civilCode}})</el-tag> <el-tag size="medium" v-if="scope.row.gbCivilCode">-{{scope.row.gbCivilCode}}</el-tag>
<el-tag size="medium" type="info" v-if="!scope.row.civilCode"></el-tag> <el-tag size="medium" type="info" v-if="!scope.row.gbCivilCode"></el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -93,7 +93,7 @@ export default {
searchSrt: "", searchSrt: "",
channelType: "", channelType: "",
online: "", online: "",
hasCivilCode: "", hasCivilCode: "false",
winHeight: window.innerHeight - 180, winHeight: window.innerHeight - 180,
currentPage: 1, currentPage: 1,
count: 15, count: 15,
@ -150,7 +150,7 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
selectable: function (row, rowIndex) { selectable: function (row, rowIndex) {
if (row.civilCode) { if (row.gbCivilCode) {
return false return false
}else { }else {
return true return true
@ -159,15 +159,36 @@ export default {
add: function (row) { add: function (row) {
if (!this.regionId) { if (!this.regionId) {
this.$message.info("请选择左侧行政区划节点") this.$message.info("请选择左侧行政区划节点")
return;
} }
console.log(this.regionId)
console.log(this.multipleSelection)
let channels = [] let channels = []
for (let i = 0; i < this.multipleSelection.length; i++) { for (let i = 0; i < this.multipleSelection.length; i++) {
channels.push(this.multipleSelection[i].gbId) channels.push(this.multipleSelection[i].gbId)
} }
console.log(channels) if (channels.length === 0) {
this.$message.info("请选择右侧通道")
return;
}
this.loading = true
this.$axios({
method: 'post',
url: `/api/common/channel/region/add`,
data: {
civilCode: this.regionId,
channelIds: channels
}
}).then((res)=> {
if (res.data.code === 0) {
this.$message.success("保存成功")
}else {
this.$message.error(res.data.msg)
}
this.loading = false
}).catch((error)=> {
this.$message.error(error)
this.loading = false
});
}, },
remove: function (row) { remove: function (row) {
}, },

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 1291092 */ font-family: "iconfont"; /* Project id 1291092 */
src: url('iconfont.woff2?t=1673251105600') format('woff2'), src: url('iconfont.woff2?t=1722327493746') format('woff2'),
url('iconfont.woff?t=1673251105600') format('woff'), url('iconfont.woff?t=1722327493746') format('woff'),
url('iconfont.ttf?t=1673251105600') format('truetype'); url('iconfont.ttf?t=1722327493746') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-shexiangtou01:before {
content: "\e7e1";
}
.icon-Group-:before {
content: "\e7e2";
}
.icon-shexiangtou2:before {
content: "\e7e3";
}
.icon-shexiangtou3:before {
content: "\e7e4";
}
.icon-slider:before { .icon-slider:before {
content: "\e7e0"; content: "\e7e0";
} }

Binary file not shown.