完善分组通道管理

This commit is contained in:
648540858
2024-08-07 17:12:39 +08:00
parent a3f7753b84
commit 5abf5012eb
10 changed files with 122 additions and 50 deletions

View File

@@ -15,6 +15,8 @@
</el-select>
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加设备
</el-button>
<el-button icon="el-icon-info" size="mini" style="margin-right: 1rem;" type="primary" @click="showInfo">平台信息
</el-button>
<el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading"
@click="getDeviceList()"></el-button>
</div>
@@ -97,6 +99,7 @@
</el-pagination>
<deviceEdit ref="deviceEdit"></deviceEdit>
<syncChannelProgress ref="syncChannelProgress"></syncChannelProgress>
<configInfo ref="configInfo"></configInfo>
</div>
</template>
@@ -104,10 +107,12 @@
import uiHeader from '../layout/UiHeader.vue'
import deviceEdit from './dialog/deviceEdit.vue'
import syncChannelProgress from './dialog/SyncChannelProgress.vue'
import configInfo from "./dialog/configInfo.vue";
export default {
name: 'app',
components: {
configInfo,
uiHeader,
deviceEdit,
syncChannelProgress,
@@ -305,6 +310,21 @@ export default {
setTimeout(this.getDeviceList, 200)
})
},
showInfo: function (){
this.$axios({
method: 'get',
url: `/api/server/system/configInfo`,
}).then( (res)=> {
console.log(res)
if (res.data.code === 0) {
console.log(2222)
console.log(this.$refs.configInfo)
this.$refs.configInfo.openDialog(res.data.data)
}
}).catch( (error)=> {
});
}

View File

@@ -27,7 +27,7 @@
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span @click.stop >
<el-radio v-if="node.data.type === 0 && node.level > 2 " 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 > 2 " style="margin-right: 0" v-model="chooseId" @input="chooseIdChange(node.data.id, node.data.businessGroup)" :label="node.data.id">{{''}}</el-radio>
</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-shexiangtou2"></span>
@@ -232,6 +232,9 @@ export default {
console.log("移除成功")
node.parent.loaded = false
node.parent.expand();
if (this.onChannelChange) {
this.onChannelChange()
}
}
}).catch(function (error) {
console.log(error);
@@ -247,7 +250,8 @@ export default {
method: 'post',
url: `/api/common/channel/group/device/add`,
data: {
civilCode: node.data.id,
parentId: node.data.id,
businessGroup: node.data.businessGroup,
deviceIds: deviceIds,
}
}).then((res)=> {

View File

@@ -2,10 +2,6 @@
<div id="app" style="width: 100%">
<div class="page-header">
<div class="page-title">控制台</div>
<div class="page-header-btn">
<el-button icon="el-icon-info" size="mini" style="margin-right: 1rem;" type="primary" @click="showInfo">平台信息
</el-button>
</div>
</div>
<el-row style="width: 100%">
<el-col :xl="{ span: 8 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="{ span: 12 }" :xs="{ span: 24 }" >
@@ -52,7 +48,6 @@
</div>
</el-col>
</el-row>
<configInfo ref="configInfo"></configInfo>
</div>
</template>
@@ -64,7 +59,6 @@ import consoleNet from './console/ConsoleNet.vue'
import consoleNodeLoad from './console/ConsoleNodeLoad.vue'
import consoleDisk from './console/ConsoleDisk.vue'
import consoleResource from './console/ConsoleResource.vue'
import configInfo from './dialog/configInfo.vue'
import echarts from 'echarts';
@@ -79,7 +73,6 @@ export default {
consoleNodeLoad,
consoleDisk,
consoleResource,
configInfo,
},
data() {
return {
@@ -147,21 +140,6 @@ export default {
}).catch( (error)=> {
});
},
showInfo: function (){
this.$axios({
method: 'get',
url: `/api/server/system/configInfo`,
}).then( (res)=> {
console.log(res)
if (res.data.code === 0) {
console.log(2222)
console.log(this.$refs.configInfo)
this.$refs.configInfo.openDialog(res.data.data)
}
}).catch( (error)=> {
});
}
}
};

View File

@@ -27,9 +27,12 @@
<el-option label="已添加" value="true"></el-option>
<el-option label="未添加" value="false"></el-option>
</el-select>
<el-button size="mini" type="primary" @click="add()">
<el-button v-if="hasGroup !=='true'" size="mini" type="primary" @click="add()">
添加
</el-button>
<el-button v-if="hasGroup ==='true'" size="mini" type="danger" @click="remove()">
移除
</el-button>
<el-button icon="el-icon-refresh-right" circle size="mini" @click="getChannelList()"></el-button>
</div>
</div>
@@ -64,8 +67,8 @@
<el-table-column label="添加状态" min-width="100">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<el-tag size="medium" :title="scope.row.gbBusinessGroupId" v-if="scope.row.gbBusinessGroupId">已添加</el-tag>
<el-tag size="medium" type="info" v-if="!scope.row.gbBusinessGroupId">未添加</el-tag>
<el-tag size="medium" :title="scope.row.gbParentId" v-if="scope.row.gbParentId">已添加</el-tag>
<el-tag size="medium" type="info" v-if="!scope.row.gbParentId">未添加</el-tag>
</div>
</template>
</el-table-column>
@@ -110,7 +113,8 @@ export default {
total: 0,
loading: false,
loadSnap: {},
regionId: "",
groupId: "",
businessGroup: "",
multipleSelection: []
};
},
@@ -160,19 +164,23 @@ export default {
this.multipleSelection = val;
},
selectable: function (row, rowIndex) {
if (row.gbCivilCode) {
return false
if (this.hasGroup === "") {
if (row.gbParentId) {
return false
}else {
return true
}
}else {
return true
}
},
rowDblclick: function (row, rowIndex) {
if (row.gbCivilCode) {
this.$refs.groupTree.refresh(row.gbCivilCode)
if (row.gbParentId) {
this.$refs.groupTree.refresh(row.gbParentId)
}
},
add: function (row) {
if (!this.regionId) {
if (!this.groupId) {
this.$message.info("请选择左侧行政区划节点")
return;
}
@@ -188,9 +196,10 @@ export default {
this.$axios({
method: 'post',
url: `/api/common/channel/region/add`,
url: `/api/common/channel/group/add`,
data: {
civilCode: this.regionId,
parentId: this.groupId,
businessGroup: this.businessGroup,
channelIds: channels
}
}).then((res)=> {
@@ -198,7 +207,7 @@ export default {
this.$message.success("保存成功")
this.getChannelList()
// 刷新树节点
this.$refs.groupTree.refresh(this.regionId)
this.$refs.groupTree.refresh(this.groupId)
}else {
this.$message.error(res.data.msg)
}
@@ -209,6 +218,37 @@ export default {
});
},
remove: function (row) {
let channels = []
for (let i = 0; i < this.multipleSelection.length; i++) {
channels.push(this.multipleSelection[i].gbId)
}
if (channels.length === 0) {
this.$message.info("请选择右侧通道")
return;
}
this.loading = true
this.$axios({
method: 'post',
url: `/api/common/channel/group/delete`,
data: {
channelIds: channels
}
}).then((res)=> {
if (res.data.code === 0) {
this.$message.success("保存成功")
this.getChannelList()
// 刷新树节点
this.$refs.groupTree.refresh(this.groupId)
}else {
this.$message.error(res.data.msg)
}
this.loading = false
}).catch((error)=> {
this.$message.error(error)
this.loading = false
});
},
getSnap: function (row) {
let baseUrl = window.baseUrl ? window.baseUrl : "";
@@ -225,8 +265,9 @@ export default {
treeNodeClickEvent: function (device, data, isCatalog) {
},
chooseIdChange: function (id) {
this.regionId = id;
chooseIdChange: function (id, businessGroup) {
this.groupId = id;
this.businessGroup = businessGroup;
},
}
};

View File

@@ -14,7 +14,6 @@
<template slot="title">通道管理</template>
<el-menu-item index="/channel/region">行政区划</el-menu-item>
<el-menu-item index="/channel/group">业务分组</el-menu-item>
<el-menu-item index="/channel/list">通道列表</el-menu-item>
</el-submenu>
<el-menu-item index="/cloudRecord">云端录像</el-menu-item>
<el-menu-item index="/mediaServerManger">节点管理</el-menu-item>