Merge branch 'wvp-28181-2.0' of https://github.com/648540858/wvp-GB28181-pro into wvp-28181-2.0
commit
b675101380
14
pom.xml
14
pom.xml
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<groupId>com.genersoft</groupId>
|
<groupId>com.genersoft</groupId>
|
||||||
<artifactId>wvp-pro</artifactId>
|
<artifactId>wvp-pro</artifactId>
|
||||||
<version>2.0</version>
|
<version>2.0.2</version>
|
||||||
<name>web video platform</name>
|
<name>web video platform</name>
|
||||||
<description>国标28181视频平台</description>
|
<description>国标28181视频平台</description>
|
||||||
|
|
||||||
|
@ -148,12 +148,14 @@
|
||||||
<version>1.3.0-91</version>
|
<version>1.3.0-91</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 取代log4j -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>log4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>log4j-over-slf4j</artifactId>
|
||||||
<version>1.2.17</version>
|
<version>1.7.35</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- xml解析库 -->
|
<!-- xml解析库 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dom4j</groupId>
|
<groupId>org.dom4j</groupId>
|
||||||
|
@ -228,6 +230,10 @@
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<!-- <scope>test</scope>-->
|
<!-- <scope>test</scope>-->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.offline.OfflineEvent;
|
import com.genersoft.iot.vmp.gb28181.event.offline.OfflineEvent;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.platformKeepaliveExpire.PlatformKeepaliveExpireEvent;
|
import com.genersoft.iot.vmp.gb28181.event.platformKeepaliveExpire.PlatformKeepaliveExpireEvent;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.event.platformNotRegister.PlatformCycleRegisterEvent;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.platformNotRegister.PlatformNotRegisterEvent;
|
import com.genersoft.iot.vmp.gb28181.event.platformNotRegister.PlatformNotRegisterEvent;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||||
import com.genersoft.iot.vmp.media.zlm.event.ZLMOfflineEvent;
|
import com.genersoft.iot.vmp.media.zlm.event.ZLMOfflineEvent;
|
||||||
|
@ -67,6 +68,16 @@ public class EventPublisher {
|
||||||
platformNotRegisterEvent.setPlatformGbID(platformGbId);
|
platformNotRegisterEvent.setPlatformGbID(platformGbId);
|
||||||
applicationEventPublisher.publishEvent(platformNotRegisterEvent);
|
applicationEventPublisher.publishEvent(platformNotRegisterEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台周期注册事件
|
||||||
|
* @param paltformGbId
|
||||||
|
*/
|
||||||
|
public void platformRegisterCycleEventPublish(String paltformGbId) {
|
||||||
|
PlatformCycleRegisterEvent platformCycleRegisterEvent = new PlatformCycleRegisterEvent(this);
|
||||||
|
platformCycleRegisterEvent.setPlatformGbID(paltformGbId);
|
||||||
|
applicationEventPublisher.publishEvent(platformCycleRegisterEvent);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备报警事件
|
* 设备报警事件
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class KeepaliveTimeoutListenerForPlatform extends RedisKeyExpirationEvent
|
||||||
}else if (expiredKey.startsWith(PLATFORM_REGISTER_PREFIX)) {
|
}else if (expiredKey.startsWith(PLATFORM_REGISTER_PREFIX)) {
|
||||||
String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length());
|
String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length());
|
||||||
|
|
||||||
publisher.platformNotRegisterEventPublish(platformGBId);
|
publisher.platformRegisterCycleEventPublish(platformGBId);
|
||||||
}else if (expiredKey.startsWith(KEEPLIVEKEY_PREFIX)){
|
}else if (expiredKey.startsWith(KEEPLIVEKEY_PREFIX)){
|
||||||
String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
|
String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
|
||||||
publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX);
|
publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX);
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.genersoft.iot.vmp.gb28181.event.platformNotRegister;
|
||||||
|
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
|
||||||
|
public class PlatformCycleRegisterEvent extends ApplicationEvent {
|
||||||
|
/**
|
||||||
|
* Add default serial version ID
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String platformGbID;
|
||||||
|
|
||||||
|
public String getPlatformGbID() {
|
||||||
|
return platformGbID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlatformGbID(String platformGbID) {
|
||||||
|
this.platformGbID = platformGbID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlatformCycleRegisterEvent(Object source) {
|
||||||
|
super(source);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.genersoft.iot.vmp.gb28181.event.platformNotRegister;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.ApplicationListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class PlatformCycleRegisterEventLister implements ApplicationListener<PlatformCycleRegisterEvent> {
|
||||||
|
@Autowired
|
||||||
|
private IVideoManagerStorager storager;
|
||||||
|
@Autowired
|
||||||
|
private ISIPCommanderForPlatform sipCommanderFroPlatform;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onApplicationEvent(PlatformCycleRegisterEvent event) {
|
||||||
|
log.info("上级平台周期注册事件");
|
||||||
|
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(event.getPlatformGbID());
|
||||||
|
if (parentPlatform == null) {
|
||||||
|
log.info("[ 平台未注册事件 ] 平台已经删除!!! 平台国标ID:" + event.getPlatformGbID());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Timer timer = new Timer();
|
||||||
|
SipSubscribe.Event okEvent = (responseEvent)->{
|
||||||
|
timer.cancel();
|
||||||
|
};
|
||||||
|
sipCommanderFroPlatform.register(parentPlatform, null, okEvent);
|
||||||
|
timer.schedule(new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
log.info("[平台注册]再次向平台注册,平台国标ID:" + event.getPlatformGbID());
|
||||||
|
sipCommanderFroPlatform.register(parentPlatform, null, okEvent);
|
||||||
|
}
|
||||||
|
}, 15*1000 ,Long.parseLong(parentPlatform.getExpires())* 1000);
|
||||||
|
}
|
||||||
|
}
|
|
@ -77,7 +77,14 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
sipSubscribe.getErrorSubscribe(callIdHeader.getCallId()).response(eventResult);
|
sipSubscribe.getErrorSubscribe(callIdHeader.getCallId()).response(eventResult);
|
||||||
};
|
};
|
||||||
}else {
|
}else {
|
||||||
Element rootElement = getRootElement(evt);
|
Element rootElement = null;
|
||||||
|
try {
|
||||||
|
rootElement = getRootElement(evt);
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
logger.warn("解析XML消息内容异常", e);
|
||||||
|
// 不存在则回复404
|
||||||
|
responseAck(evt, Response.BAD_REQUEST, e.getMessage());
|
||||||
|
}
|
||||||
String name = rootElement.getName();
|
String name = rootElement.getName();
|
||||||
IMessageHandler messageHandler = messageHandlerMap.get(name);
|
IMessageHandler messageHandler = messageHandlerMap.get(name);
|
||||||
if (messageHandler != null) {
|
if (messageHandler != null) {
|
||||||
|
@ -98,8 +105,6 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
logger.warn("参数无效", e);
|
logger.warn("参数无效", e);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
logger.warn("SIP回复时解析异常", e);
|
logger.warn("SIP回复时解析异常", e);
|
||||||
} catch (DocumentException e) {
|
|
||||||
logger.warn("解析XML消息内容异常", e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StreamPushItem> getPushList(String mediaServerId) {
|
public List<StreamPushItem> getPushList(String mediaServerId) {
|
||||||
return streamPushMapper.selectAllByMediaServerId(mediaServerId);
|
return streamPushMapper.selectAllByMediaServerIdWithOutGbID(mediaServerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -204,7 +204,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
Map<String, MediaItem> streamInfoPushItemMap = new HashMap<>();
|
Map<String, MediaItem> streamInfoPushItemMap = new HashMap<>();
|
||||||
if (pushList.size() > 0) {
|
if (pushList.size() > 0) {
|
||||||
for (StreamPushItem streamPushItem : pushList) {
|
for (StreamPushItem streamPushItem : pushList) {
|
||||||
pushItemMap.put(streamPushItem.getApp() + streamPushItem.getStream(), streamPushItem);
|
if (StringUtils.isEmpty(streamPushItem.getGbId())) {
|
||||||
|
pushItemMap.put(streamPushItem.getApp() + streamPushItem.getStream(), streamPushItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mediaItems.size() > 0) {
|
if (mediaItems.size() > 0) {
|
||||||
|
@ -268,7 +270,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void zlmServerOffline(String mediaServerId) {
|
public void zlmServerOffline(String mediaServerId) {
|
||||||
List<StreamPushItem> streamPushItems = streamPushMapper.selectAllByMediaServerId(mediaServerId);
|
List<StreamPushItem> streamPushItems = streamPushMapper.selectAllByMediaServerIdWithOutGbID(mediaServerId);
|
||||||
// 移除没有GBId的推流
|
// 移除没有GBId的推流
|
||||||
streamPushMapper.deleteWithoutGBId(mediaServerId);
|
streamPushMapper.deleteWithoutGBId(mediaServerId);
|
||||||
gbStreamMapper.deleteWithoutGBId("push", mediaServerId);
|
gbStreamMapper.deleteWithoutGBId("push", mediaServerId);
|
||||||
|
|
|
@ -470,4 +470,6 @@ public interface IVideoManagerStorager {
|
||||||
void delCatalogByPlatformId(String serverGBId);
|
void delCatalogByPlatformId(String serverGBId);
|
||||||
|
|
||||||
void delRelationByPlatformId(String serverGBId);
|
void delRelationByPlatformId(String serverGBId);
|
||||||
|
|
||||||
|
PlatformCatalog queryDefaultCatalogInPlatform(String platformId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,4 +41,7 @@ public interface PlatformCatalogMapper {
|
||||||
|
|
||||||
@Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id) as childrenCount FROM platform_catalog pc WHERE pc.platformId=#{platformId}")
|
@Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id) as childrenCount FROM platform_catalog pc WHERE pc.platformId=#{platformId}")
|
||||||
List<PlatformCatalog> selectByPlatForm(String platformId);
|
List<PlatformCatalog> selectByPlatForm(String platformId);
|
||||||
|
|
||||||
|
@Select("SELECT pc.* FROM platform_catalog pc WHERE pc.id = (SELECT pp.catalogId from parent_platform pp WHERE pp.serverGBId=#{platformId})")
|
||||||
|
PlatformCatalog selectDefaultByPlatFormId(String platformId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,14 @@ public interface StreamPushMapper {
|
||||||
@Delete("DELETE FROM stream_push WHERE app=#{app} AND stream=#{stream}")
|
@Delete("DELETE FROM stream_push WHERE app=#{app} AND stream=#{stream}")
|
||||||
int del(String app, String stream);
|
int del(String app, String stream);
|
||||||
|
|
||||||
|
@Delete("<script> "+
|
||||||
|
"DELETE sp FROM stream_push sp left join gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where " +
|
||||||
|
"<foreach collection='streamPushItems' item='item' separator='or'>" +
|
||||||
|
"(sp.app=#{item.app} and sp.stream=#{item.stream} and gs.gbId is null) " +
|
||||||
|
"</foreach>" +
|
||||||
|
"</script>")
|
||||||
|
int delAllWithoutGBId(List<StreamPushItem> streamPushItems);
|
||||||
|
|
||||||
@Delete("<script> "+
|
@Delete("<script> "+
|
||||||
"DELETE FROM stream_push where " +
|
"DELETE FROM stream_push where " +
|
||||||
"<foreach collection='streamPushItems' item='item' separator='or'>" +
|
"<foreach collection='streamPushItems' item='item' separator='or'>" +
|
||||||
|
@ -62,10 +70,13 @@ public interface StreamPushMapper {
|
||||||
@Delete("DELETE FROM stream_push")
|
@Delete("DELETE FROM stream_push")
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
@Delete("DELETE FROM stream_push WHERE mediaServerId=#{mediaServerId}")
|
@Delete("DELETE sp FROM stream_push sp left join gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.mediaServerId=#{mediaServerId} and gs.gbId is null ")
|
||||||
void deleteWithoutGBId(String mediaServerId);
|
void deleteWithoutGBId(String mediaServerId);
|
||||||
|
|
||||||
@Select("SELECT * FROM stream_push WHERE mediaServerId=#{mediaServerId}")
|
@Select("SELECT * FROM stream_push WHERE mediaServerId=#{mediaServerId}")
|
||||||
List<StreamPushItem> selectAllByMediaServerId(String mediaServerId);
|
List<StreamPushItem> selectAllByMediaServerId(String mediaServerId);
|
||||||
|
|
||||||
|
@Select("SELECT sp.* FROM stream_push sp left join gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.mediaServerId=#{mediaServerId} and gs.gbId is null")
|
||||||
|
List<StreamPushItem> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1058,4 +1058,9 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||||
platformGbStreamMapper.delByPlatformId(serverGBId);
|
platformGbStreamMapper.delByPlatformId(serverGBId);
|
||||||
platformChannelMapper.delByPlatformId(serverGBId);
|
platformChannelMapper.delByPlatformId(serverGBId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlatformCatalog queryDefaultCatalogInPlatform(String platformId) {
|
||||||
|
return catalogMapper.selectDefaultByPlatFormId(platformId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -465,25 +465,30 @@ public class PlatformController {
|
||||||
})
|
})
|
||||||
@DeleteMapping("/catalog/del")
|
@DeleteMapping("/catalog/del")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity<WVPResult<List<PlatformCatalog>>> delCatalog(String id){
|
public ResponseEntity<WVPResult<String>> delCatalog(String id, String platformId){
|
||||||
|
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("删除目录,{}", id);
|
logger.debug("删除目录,{}", id);
|
||||||
}
|
}
|
||||||
// 如果删除的是默认目录则根目录设置为默认目录
|
WVPResult<String> result = new WVPResult<>();
|
||||||
PlatformCatalog catalog = storager.getCatalog(id);
|
|
||||||
if (catalog != null) {
|
if (StringUtils.isEmpty(id) || StringUtils.isEmpty(platformId)) {
|
||||||
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(catalog.getPlatformId());
|
result.setCode(-1);
|
||||||
if (parentPlatform != null) {
|
result.setMsg("param error");
|
||||||
if (id.equals(parentPlatform.getCatalogId())) {
|
return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
|
||||||
storager.setDefaultCatalog(parentPlatform.getServerGBId(), parentPlatform.getServerGBId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
result.setCode(0);
|
||||||
|
|
||||||
int delResult = storager.delCatalog(id);
|
int delResult = storager.delCatalog(id);
|
||||||
WVPResult<List<PlatformCatalog>> result = new WVPResult<>();
|
// 如果删除的是默认目录则根目录设置为默认目录
|
||||||
result.setCode(0);
|
PlatformCatalog parentPlatform = storager.queryDefaultCatalogInPlatform(platformId);
|
||||||
|
|
||||||
|
// 默认节点被移除
|
||||||
|
if (parentPlatform == null) {
|
||||||
|
storager.setDefaultCatalog(platformId, platformId);
|
||||||
|
result.setData(platformId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (delResult > 0) {
|
if (delResult > 0) {
|
||||||
result.setMsg("success");
|
result.setMsg("success");
|
||||||
|
|
|
@ -20,7 +20,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
# 使用mysql 打开23-28行注释, 删除29-36行
|
# 使用mysql 打开23-28行注释, 删除29-36行
|
||||||
name: wvp
|
name: wvp
|
||||||
url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
|
url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false
|
||||||
username:
|
username:
|
||||||
password:
|
password:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
@ -49,7 +49,7 @@ sip:
|
||||||
#zlm 默认服务器配置
|
#zlm 默认服务器配置
|
||||||
media:
|
media:
|
||||||
# [必须修改] zlm服务器的内网IP
|
# [必须修改] zlm服务器的内网IP
|
||||||
ip: 127.0.0.1
|
ip:
|
||||||
# [必须修改] zlm服务器的http.port
|
# [必须修改] zlm服务器的http.port
|
||||||
http-port: 80
|
http-port: 80
|
||||||
# [可选] zlm服务器的hook.admin_params=secret
|
# [可选] zlm服务器的hook.admin_params=secret
|
||||||
|
|
|
@ -20,7 +20,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
# 使用mysql 打开23-28行注释, 删除29-36行
|
# 使用mysql 打开23-28行注释, 删除29-36行
|
||||||
name: wvp
|
name: wvp
|
||||||
url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
|
url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: root
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
|
|
@ -52,13 +52,7 @@ export default {
|
||||||
chooseChannelForCatalog,
|
chooseChannelForCatalog,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// getPlayerShared: function () {
|
|
||||||
// return {
|
|
||||||
// sharedUrl: window.location.host + '/' + this.videoUrl,
|
|
||||||
// sharedIframe: '<iframe src="' + window.location.host + '/' + this.videoUrl + '"></iframe>',
|
|
||||||
// sharedRtmp: this.videoUrl
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -84,14 +78,6 @@ export default {
|
||||||
this.closeCallback = closeCallback
|
this.closeCallback = closeCallback
|
||||||
},
|
},
|
||||||
tabClick (tab, event){
|
tabClick (tab, event){
|
||||||
console.log(tab.label)
|
|
||||||
if (tab.label === "gbChannel") {
|
|
||||||
this.$refs.chooseChannelForGb.catalogIdChange(this.catalogId);
|
|
||||||
this.$refs.chooseChannelForGb.initData();
|
|
||||||
}else {
|
|
||||||
this.$refs.chooseChannelFoStream.catalogIdChange(this.catalogId);
|
|
||||||
this.$refs.chooseChannelFoStream.initData();
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
|
@ -125,11 +111,6 @@ export default {
|
||||||
catalogIdChange: function (id) {
|
catalogIdChange: function (id) {
|
||||||
console.log("中间模块收到: " + id)
|
console.log("中间模块收到: " + id)
|
||||||
this.catalogId = id;
|
this.catalogId = id;
|
||||||
if (this.tabActiveName === "gbChannel") {
|
|
||||||
this.$refs.chooseChannelForGb.catalogIdChange(id);
|
|
||||||
}else {
|
|
||||||
this.$refs.chooseChannelFoStream.catalogIdChange(id);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
updateChooseChannelCallback (id){
|
updateChooseChannelCallback (id){
|
||||||
console.log("中间模块收到选择通道变化: " + id)
|
console.log("中间模块收到选择通道变化: " + id)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<span v-if="node.data.type === 2" class="iconfont icon-zhibo"></span>
|
<span v-if="node.data.type === 2" class="iconfont icon-zhibo"></span>
|
||||||
<span style="padding-left: 1px">{{ node.label }}</span>
|
<span style="padding-left: 1px">{{ node.label }}</span>
|
||||||
<span>
|
<span>
|
||||||
<i style="margin-left: 5rem; color: #9d9d9d; padding-right: 20px" v-if="node.data.id === defaultCatalogId">默认</i>
|
<i style="margin-left: 5rem; color: #9d9d9d; padding-right: 20px" v-if="node.data.id === defaultCatalogIdSign">默认</i>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
|
@ -38,6 +38,8 @@ export default {
|
||||||
name: 'chooseChannelForCatalog',
|
name: 'chooseChannelForCatalog',
|
||||||
props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange'],
|
props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange'],
|
||||||
created() {
|
created() {
|
||||||
|
this.chooseId = this.defaultCatalogId;
|
||||||
|
this.defaultCatalogIdSign = this.defaultCatalogId;
|
||||||
this.initData();
|
this.initData();
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
if (this.catalogIdChange)this.catalogIdChange(this.defaultCatalogId);
|
if (this.catalogIdChange)this.catalogIdChange(this.defaultCatalogId);
|
||||||
|
@ -54,8 +56,9 @@ export default {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
isLeaf: 'leaf'
|
isLeaf: 'leaf'
|
||||||
},
|
},
|
||||||
|
defaultCatalogIdSign: null,
|
||||||
chooseNode: null,
|
chooseNode: null,
|
||||||
chooseId: this.defaultCatalogId,
|
chooseId: "",
|
||||||
catalogTree: null,
|
catalogTree: null,
|
||||||
contextmenuShow: false
|
contextmenuShow: false
|
||||||
|
|
||||||
|
@ -132,6 +135,7 @@ export default {
|
||||||
url:`/api/platform/catalog/del`,
|
url:`/api/platform/catalog/del`,
|
||||||
params: {
|
params: {
|
||||||
id: id,
|
id: id,
|
||||||
|
platformId: this.platformId,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
@ -139,8 +143,8 @@ export default {
|
||||||
console.log("移除成功")
|
console.log("移除成功")
|
||||||
node.parent.loaded = false
|
node.parent.loaded = false
|
||||||
node.parent.expand();
|
node.parent.expand();
|
||||||
if(this.defaultCatalogId === id) {
|
if (res.data.data) {
|
||||||
this.defaultCatalogId = this.platformId;
|
this.defaultCatalogIdSign = res.data.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -159,7 +163,7 @@ export default {
|
||||||
})
|
})
|
||||||
.then((res)=> {
|
.then((res)=> {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.defaultCatalogId = id;
|
this.defaultCatalogIdSign = id;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
|
@ -253,7 +257,7 @@ export default {
|
||||||
{
|
{
|
||||||
label: "设为默认",
|
label: "设为默认",
|
||||||
icon: "el-icon-folder-checked",
|
icon: "el-icon-folder-checked",
|
||||||
disabled: node.data.id === this.defaultCatalogId,
|
disabled: node.data.id === this.defaultCatalogIdSign,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.setDefaultCatalog(data.id)
|
this.setDefaultCatalog(data.id)
|
||||||
},
|
},
|
||||||
|
|
|
@ -253,10 +253,6 @@ export default {
|
||||||
handleGBSelectionChange: function() {
|
handleGBSelectionChange: function() {
|
||||||
this.initData();
|
this.initData();
|
||||||
},
|
},
|
||||||
// catalogIdChange: function(id) {
|
|
||||||
// this.catalogId = id;
|
|
||||||
// console.log("直播通道选择模块收到: " + id)
|
|
||||||
// },
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue