国标通道编辑支持选择现有的行政区划和虚拟组织
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" >
|
||||
<el-input v-model="form.gbDeviceId" placeholder="请输入通道编码">
|
||||
<el-button slot="append" @click="buildDeviceIdCode(form.gbDeviceId)">生成</el-button>
|
||||
<template v-slot:append>
|
||||
<el-button @click="buildDeviceIdCode(form.gbDeviceId)">生成</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备厂商" >
|
||||
@@ -18,7 +20,11 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="行政区域" >
|
||||
<el-input v-model="form.gbCivilCode" placeholder="请输入行政区域"></el-input>
|
||||
<el-input v-model="form.gbCivilCode" placeholder="请输入行政区域">
|
||||
<template v-slot:append>
|
||||
<el-button @click="chooseCivilCode()">选择</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="安装地址" >
|
||||
@@ -31,7 +37,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="父节点编码" >
|
||||
<el-input v-model="form.gbParentId" placeholder="请输入父节点编码"></el-input>
|
||||
<el-input v-model="form.gbParentId" placeholder="请输入父节点编码">
|
||||
<template v-slot:append>
|
||||
<el-button @click="chooseGroup()">选择</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" >
|
||||
<el-select v-model="form.gbStatus" style="width: 100%" placeholder="请选择设备状态">
|
||||
@@ -202,16 +212,22 @@
|
||||
|
||||
</el-form>
|
||||
<channelCode ref="channelCode"></channelCode>
|
||||
<chooseCivilCode ref="chooseCivilCode"></chooseCivilCode>
|
||||
<chooseGroup ref="chooseGroup"></chooseGroup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import channelCode from './../dialog/channelCode'
|
||||
import ChooseCivilCode from "../dialog/chooseCivilCode.vue";
|
||||
import ChooseGroup from "../dialog/chooseGroup.vue";
|
||||
|
||||
export default {
|
||||
name: "CommonChannelEdit",
|
||||
props: [ 'id', 'dataForm', 'saveSuccess', 'cancel'],
|
||||
components: {
|
||||
ChooseCivilCode,
|
||||
ChooseGroup,
|
||||
channelCode,
|
||||
},
|
||||
created() {
|
||||
@@ -360,6 +376,17 @@ export default {
|
||||
console.log("code22===> " + code)
|
||||
}, deviceId);
|
||||
},
|
||||
chooseCivilCode: function (){
|
||||
this.$refs.chooseCivilCode.openDialog(code=>{
|
||||
this.form.gbCivilCode = code;
|
||||
});
|
||||
},
|
||||
chooseGroup: function (){
|
||||
this.$refs.chooseGroup.openDialog((deviceId, businessGroupId)=>{
|
||||
this.form.gbBusinessGroupId = businessGroupId;
|
||||
this.form.gbParentId = deviceId;
|
||||
});
|
||||
},
|
||||
cancelSubmit: function (){
|
||||
if(this.cancel) {
|
||||
this.cancel()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
class="flow-tree"
|
||||
ref="veTree"
|
||||
node-key="treeId"
|
||||
height="78vh"
|
||||
:height="treeHeight?treeHeight:'78vh'"
|
||||
lazy
|
||||
style="padding: 0 0 2rem 0.5rem"
|
||||
:load="loadNode"
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
treeData: [],
|
||||
}
|
||||
},
|
||||
props: ['edit', 'clickEvent', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToGroup'],
|
||||
props: ['edit','enableAddChannel', 'clickEvent', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToGroup', 'treeHeight'],
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
@@ -117,49 +117,52 @@ export default {
|
||||
return;
|
||||
}
|
||||
if (node.data.type === 0) {
|
||||
this.$contextmenu({
|
||||
items: [
|
||||
{
|
||||
label: "刷新节点",
|
||||
icon: "el-icon-refresh",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.refreshNode(node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "新建节点",
|
||||
icon: "el-icon-plus",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.addGroup(data.id, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "编辑节点",
|
||||
icon: "el-icon-edit",
|
||||
disabled: node.level === 1,
|
||||
onClick: () => {
|
||||
this.editGroup(data, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "删除节点",
|
||||
icon: "el-icon-delete",
|
||||
disabled: node.level === 1,
|
||||
divided: true,
|
||||
onClick: () => {
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.removeGroup(data.id, node)
|
||||
}).catch(() => {
|
||||
let menuItem = [
|
||||
{
|
||||
label: "刷新节点",
|
||||
icon: "el-icon-refresh",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.refreshNode(node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "新建节点",
|
||||
icon: "el-icon-plus",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.addGroup(data.id, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "编辑节点",
|
||||
icon: "el-icon-edit",
|
||||
disabled: node.level === 1,
|
||||
onClick: () => {
|
||||
this.editGroup(data, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "删除节点",
|
||||
icon: "el-icon-delete",
|
||||
disabled: node.level === 1,
|
||||
divided: true,
|
||||
onClick: () => {
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.removeGroup(data.id, node)
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
if (this.enableAddChannel) {
|
||||
menuItem.push(
|
||||
{
|
||||
label: "添加设备",
|
||||
icon: "el-icon-plus",
|
||||
@@ -168,6 +171,8 @@ export default {
|
||||
this.addChannelFormDevice(data.id, node)
|
||||
}
|
||||
},
|
||||
)
|
||||
menuItem.push(
|
||||
{
|
||||
label: "移除设备",
|
||||
icon: "el-icon-delete",
|
||||
@@ -177,6 +182,8 @@ export default {
|
||||
this.removeChannelFormDevice(data.id, node)
|
||||
}
|
||||
},
|
||||
)
|
||||
menuItem.push(
|
||||
{
|
||||
label: "添加通道",
|
||||
icon: "el-icon-plus",
|
||||
@@ -185,27 +192,11 @@ export default {
|
||||
this.addChannel(data.id, node)
|
||||
}
|
||||
},
|
||||
// {
|
||||
// label: "导出",
|
||||
// icon: "el-icon-download",
|
||||
// disabled: false,
|
||||
// children: [
|
||||
// {
|
||||
// label: "导出到文件",
|
||||
// onClick: () => {
|
||||
//
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// label: "导出到其他平台",
|
||||
// onClick: () => {
|
||||
//
|
||||
// },
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
)
|
||||
}
|
||||
|
||||
],
|
||||
this.$contextmenu({
|
||||
items: menuItem,
|
||||
event, // 鼠标事件信息
|
||||
customClass: "custom-class", // 自定义菜单 class
|
||||
zIndex: 3000, // 菜单样式 z-index
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
class="flow-tree"
|
||||
ref="veTree"
|
||||
node-key="treeId"
|
||||
height="78vh"
|
||||
:height="treeHeight?treeHeight:'78vh'"
|
||||
lazy
|
||||
style="padding: 0 0 2rem 0.5rem"
|
||||
:load="loadNode"
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
treeData: [],
|
||||
}
|
||||
},
|
||||
props: ['edit', 'clickEvent', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToCivilCode'],
|
||||
props: ['edit', 'enableAddChannel', 'clickEvent', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToCivilCode', 'treeHeight'],
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
@@ -118,49 +118,51 @@ export default {
|
||||
}
|
||||
console.log(node.level)
|
||||
if (node.data.type === 0) {
|
||||
this.$contextmenu({
|
||||
items: [
|
||||
{
|
||||
label: "刷新节点",
|
||||
icon: "el-icon-refresh",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.refreshNode(node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "新建节点",
|
||||
icon: "el-icon-plus",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.addRegion(data.id, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "编辑节点",
|
||||
icon: "el-icon-edit",
|
||||
disabled: node.level === 1,
|
||||
onClick: () => {
|
||||
this.editCatalog(data, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "删除节点",
|
||||
icon: "el-icon-delete",
|
||||
disabled: node.level === 1,
|
||||
divided: true,
|
||||
onClick: () => {
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.removeRegion(data.id, node)
|
||||
}).catch(() => {
|
||||
let menuItem = [
|
||||
{
|
||||
label: "刷新节点",
|
||||
icon: "el-icon-refresh",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.refreshNode(node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "新建节点",
|
||||
icon: "el-icon-plus",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
this.addRegion(data.id, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "编辑节点",
|
||||
icon: "el-icon-edit",
|
||||
disabled: node.level === 1,
|
||||
onClick: () => {
|
||||
this.editCatalog(data, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "删除节点",
|
||||
icon: "el-icon-delete",
|
||||
disabled: node.level === 1,
|
||||
divided: true,
|
||||
onClick: () => {
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.removeRegion(data.id, node)
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
]
|
||||
if (this.enableAddChannel) {
|
||||
menuItem.push(
|
||||
{
|
||||
label: "添加设备",
|
||||
icon: "el-icon-plus",
|
||||
@@ -168,7 +170,9 @@ export default {
|
||||
onClick: () => {
|
||||
this.addChannelFormDevice(data.id, node)
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
menuItem.push(
|
||||
{
|
||||
label: "移除设备",
|
||||
icon: "el-icon-delete",
|
||||
@@ -177,7 +181,9 @@ export default {
|
||||
onClick: () => {
|
||||
this.removeChannelFormDevice(data.id, node)
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
menuItem.push(
|
||||
{
|
||||
label: "添加通道",
|
||||
icon: "el-icon-plus",
|
||||
@@ -185,28 +191,13 @@ export default {
|
||||
onClick: () => {
|
||||
this.addChannel(data.id, node)
|
||||
}
|
||||
},
|
||||
// {
|
||||
// label: "导出",
|
||||
// icon: "el-icon-download",
|
||||
// disabled: false,
|
||||
// children: [
|
||||
// {
|
||||
// label: "导出到文件",
|
||||
// onClick: () => {
|
||||
//
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// label: "导出到其他平台",
|
||||
// onClick: () => {
|
||||
//
|
||||
// },
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
this.$contextmenu({
|
||||
items: menuItem,
|
||||
event, // 鼠标事件信息
|
||||
customClass: "custom-class", // 自定义菜单 class
|
||||
zIndex: 3000, // 菜单样式 z-index
|
||||
|
||||
Reference in New Issue
Block a user