临时提交

This commit is contained in:
648540858
2024-07-23 18:00:47 +08:00
parent 05fabc87a2
commit 6bd0cdd37b
70 changed files with 603 additions and 436 deletions

View File

@@ -14,6 +14,8 @@
<script type="text/javascript" src="./static/js/liveplayer-lib.min.js"></script>
<script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script>
<script type="text/javascript" src="./static/js/config.js"></script>
<script type="text/javascript" src="./static/js/jquery-3.7.1.min.js"></script>
<div id="app"></div>
</body>

View File

@@ -26,7 +26,6 @@
"vue-clipboards": "^1.3.0",
"vue-contextmenujs": "^1.3.13",
"vue-cookies": "^1.8.3",
"vue-giant-tree": "^0.1.5",
"vue-router": "^3.1.6",
"vue-ztree-2.0": "^1.0.4"
},

View File

@@ -0,0 +1,191 @@
<template>
<div id="DeviceTree" style="width: 100%;height: 100%; background-color: #FFFFFF; overflow: auto">
<el-container>
<el-header>设备列表</el-header>
<el-main style="background-color: #ffffff;">
<div class="device-tree-main-box">
<tree :nodes="nodes" @onClick="onClick"
@onCheck="onCheck"
@onCreated="handleCreated"></tree>
</div>
</el-main>
</el-container>
</div>
</template>
<script>
import tree from "vue-giant-tree";
export default {
name: 'DeviceTree',
components: {
tree
},
data() {
return {
nodes: [
{ id:1, pid:0, name:"随意勾选 1", open:true},
{ id:11, pid:1, name:"随意勾选 1-1", open:true},
{ id:111, pid:11, name:"随意勾选 1-1-1"},
{ id:112, pid:11, name:"随意勾选 1-1-2"},
{ id:12, pid:1, name:"随意勾选 1-2", open:true},
{ id:121, pid:12, name:"随意勾选 1-2-1"},
{ id:122, pid:12, name:"随意勾选 1-2-2"},
{ id:2, pid:0, name:"随意勾选 2", checked:true, open:true},
{ id:21, pid:2, name:"随意勾选 2-1"},
{ id:22, pid:2, name:"随意勾选 2-2", open:true},
{ id:221, pid:22, name:"随意勾选 2-2-1", checked:true},
{ id:222, pid:22, name:"随意勾选 2-2-2"},
{ id:23, pid:2, name:"随意勾选 2-3"}
]
}
},
props: ['device', 'onlyCatalog', 'clickEvent', 'contextMenuEvent'],
methods: {
onClick(evt, treeId, treeNode) {
},
onCheck(evt, treeId, treeNode) {
},
handleCreated(ztreeObj) {
},
handleNodeClick(data,node,element) {
let deviceNode = this.$refs.gdTree.getNode(data.userData.deviceId)
if(typeof (this.clickEvent) == "function") {
this.clickEvent(deviceNode.data.userData, data.userData, data.type === 2)
}
},
handleContextMenu(event,data,node,element) {
console.log("右键点击事件")
let deviceNode = this.$refs.gdTree.getNode(data.userData.deviceId)
if(typeof (this.contextMenuEvent) == "function") {
this.contextMenuEvent(deviceNode.data.userData, event, data.userData, data.type === 2)
}
},
loadNode: function(node, resolve){
console.log(this.device)
if (node.level === 0) {
if (this.device) {
let node = {
name: this.device.name || this.device.deviceId,
isLeaf: false,
id: this.device.deviceId,
type: this.device.online,
online: this.device.online === 1,
userData: this.device
}
resolve([node])
}else {
this.deviceService.getAllDeviceList((data)=>{
console.log(data)
if (data.length > 0) {
let nodeList = []
for (let i = 0; i < data.length; i++) {
console.log(data[i].name)
let node = {
name: data[i].name || data[i].deviceId,
isLeaf: false,
id: data[i].deviceId,
type: data[i].online,
online: data[i].online === 1,
userData: data[i]
}
nodeList.push(node);
}
resolve(nodeList)
}else {
resolve([])
}
}, (list)=>{
console.log("设备加载完成")
}, (error)=>{
})
}
}else {
let channelArray = []
this.deviceService.getTree(node.data.userData.deviceId, node.data.id, this.onlyCatalog, catalogData =>{
console.log(catalogData)
channelArray = channelArray.concat(catalogData)
this.channelDataHandler(channelArray, resolve)
},(endCatalogData) => {
})
}
},
channelDataHandler: function (data, resolve) {
if (data.length > 0) {
let nodeList = []
for (let i = 0; i <data.length; i++) {
let item = data[i];
let type = 3;
if (item.id.length <= 10) {
type = 2;
}else {
if (item.id.length > 14) {
let channelType = item.id.substring(10, 13)
console.log("channelType: " + channelType)
if (channelType === '215' || channelType === '216') {
type = 2;
}
console.log(type)
if (item.basicData.ptzType === 1 ) { // 1-球机;2-半球;3-固定枪机;4-遥控枪机
type = 4;
}else if (item.basicData.ptzType === 2) {
type = 5;
}else if (item.basicData.ptzType === 3 || item.basicData.ptzType === 4) {
type = 6;
}
}else {
if (item.basicData.subCount > 0 || item.basicData.parental === 1) {
type = 2;
}
}
}
let node = {
name: item.name || item.basicData.channelId,
isLeaf: type !== 2,
id: item.id,
deviceId: item.deviceId,
type: type,
online: item.basicData.status === 1,
hasGPS: item.basicData.longitude*item.basicData.latitude !== 0,
userData: item.basicData
}
nodeList.push(node);
}
resolve(nodeList)
}else {
resolve([])
}
},
reset: function (){
this.$forceUpdate();
}
},
destroyed() {
// if (this.jessibuca) {
// this.jessibuca.destroy();
// }
// this.playing = false;
// this.loaded = false;
// this.performance = "";
},
}
</script>
<style>
.device-tree-main-box{
text-align: left;
}
.device-online{
color: #252525;
}
.device-offline{
color: #727272;
}
</style>

224
web_src/src/components/region.vue Executable file
View File

@@ -0,0 +1,224 @@
<template>
<div id="region" style="width: 100%">
<el-container v-if="!editId" v-loading="loading" style="height: 82vh;">
<el-aside width="auto" style="height: 82vh; background-color: #ffffff; overflow: auto">
<RegionTree ref="regionTree" :edit="true" :clickEvent="treeNodeClickEvent"></RegionTree>
</el-aside>
<el-main style="padding: 5px;">
<el-table ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%"
header-row-class-name="table-header">
<el-table-column prop="gbName" label="名称" min-width="180">
</el-table-column>
<el-table-column prop="gbDeviceId" label="编号" min-width="180">
</el-table-column>
<el-table-column prop="gbManufacturer" label="厂家" min-width="100">
</el-table-column>
<el-table-column label="状态" min-width="100">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<el-tag size="medium" v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
<el-tag size="medium" type="info" v-if="scope.row.status !== 'ON'">离线</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="操作" min-width="340" fixed="right">
<template slot-scope="scope">
<el-button size="medium" icon="el-icon-video-play" type="text" @click="add(scope.row)">
添加
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button size="medium" type="text" icon="el-icon-edit" @click="remove(scope.row)">
移除
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
style="float: right"
@size-change="handleSizeChange"
@current-change="currentChange"
:current-page="currentPage"
:page-size="count"
:page-sizes="[15, 25, 35, 50]"
layout="total, sizes, prev, pager, next"
:total="total">
</el-pagination>
</el-main>
</el-container>
</div>
</template>
<script>
import uiHeader from '../layout/UiHeader.vue'
import DeviceService from "./service/DeviceService";
import RegionTree from "./common/RegionTree.vue";
export default {
name: 'channelList',
components: {
uiHeader,
RegionTree,
},
data() {
return {
channelList: [],
searchSrt: "",
channelType: "",
online: "",
winHeight: window.innerHeight - 200,
currentPage: 1,
count: 15,
total: 0,
loading: false,
loadSnap: {},
};
},
mounted() {
this.initData();
},
destroyed() {},
methods: {
initData: function () {
if (typeof (this.parentChannelId) == "undefined" || this.parentChannelId == 0) {
this.channelList();
} else {
this.showSubchannels();
}
},
initParam: function () {
this.deviceId = this.$route.params.deviceId;
this.parentChannelId = this.$route.params.parentChannelId;
this.currentPage = 1;
this.count = 15;
if (this.parentChannelId == "" || this.parentChannelId == 0) {
this.beforeUrl = "/deviceList"
}
},
currentChange: function (val) {
this.currentPage = val;
this.initData();
},
handleSizeChange: function (val) {
this.count = val;
this.channelList();
},
channelList: function () {
let that = this;
if (typeof (this.$route.params.deviceId) == "undefined") return;
this.$axios({
method: 'get',
url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,
params: {
page: that.currentPage,
count: that.count,
query: that.searchSrt,
online: that.online,
channelType: that.channelType
}
}).then(function (res) {
if (res.data.code === 0) {
that.total = res.data.data.total;
that.deviceChannelList = res.data.data.list;
that.deviceChannelList.forEach(e => {
e.ptzType = e.ptzType + "";
that.$set(e, "location", "");
if (e.longitude && e.latitude) {
that.$set(e, "location", e.longitude + "," + e.latitude);
}
});
// 防止出现表格错位
that.$nextTick(() => {
that.$refs.channelListTable.doLayout();
})
}
}).catch(function (error) {
console.log(error);
});
},
add: function (row) {
},
remove: function (row) {
},
getSnap: function (row) {
let baseUrl = window.baseUrl ? window.baseUrl : "";
return ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) + '/api/device/query/snap/' + this.deviceId + '/' + row.deviceId;
},
search: function () {
this.currentPage = 1;
this.total = 0;
this.initData();
},
refresh: function () {
this.initData();
},
treeNodeClickEvent: function (device, data, isCatalog) {
console.log(device)
if (!!!data.channelId) {
this.parentChannelId = device.deviceId;
} else {
this.parentChannelId = data.channelId;
}
this.initData();
},
}
};
</script>
<style>
.videoList {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
}
.video-item {
position: relative;
width: 15rem;
height: 10rem;
margin-right: 1rem;
background-color: #000000;
}
.video-item-img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 100%;
height: 100%;
}
.video-item-img:after {
content: "";
display: inline-block;
position: absolute;
z-index: 2;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 3rem;
height: 3rem;
background-image: url("../assets/loading.png");
background-size: cover;
background-color: #000000;
}
.video-item-title {
position: absolute;
bottom: 0;
color: #000000;
background-color: #ffffff;
line-height: 1.5rem;
padding: 0.3rem;
width: 14.4rem;
}
</style>

View File

@@ -10,6 +10,12 @@
<el-menu-item index="/map">电子地图</el-menu-item>
<el-menu-item index="/streamPushList">推流列表</el-menu-item>
<el-menu-item index="/streamProxyList">拉流代理</el-menu-item>
<el-submenu >
<template slot="title">通道管理</template>
<el-menu-item index="/region">行政区划</el-menu-item>
<el-menu-item index="/group">业务分组</el-menu-item>
<el-menu-item index="/commonChannelList">通道列表</el-menu-item>
</el-submenu>
<el-menu-item index="/cloudRecord">云端录像</el-menu-item>
<el-menu-item index="/mediaServerManger">节点管理</el-menu-item>
<el-menu-item index="/parentPlatformList/15/1">国标级联</el-menu-item>

View File

@@ -23,6 +23,7 @@ import userManager from '../components/UserManager.vue'
import userApiKeyManager from '../components/UserApiKeyManager.vue'
import wasmPlayer from '../components/common/jessibuca.vue'
import rtcPlayer from '../components/dialog/rtcPlayer.vue'
import region from '../components/region.vue'
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
@@ -130,6 +131,11 @@ export default new VueRouter({
path: '/userApiKeyManager/:userId',
name: 'userApiKeyManager',
component: userApiKeyManager,
},
{
path: '/region',
name: 'region',
component: region,
}
,
]