临时提交
This commit is contained in:
@@ -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 !== 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 > 2 " style="margin-right: 0" v-model="chooseId" @input="chooseIdChange" :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>
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
isLeaf: false,
|
||||
type: 0
|
||||
}]);
|
||||
} else if (node.data.id.length <= 8) {
|
||||
} else {
|
||||
this.$axios({
|
||||
method: 'get',
|
||||
url: `/api/group/tree/list`,
|
||||
@@ -90,8 +90,6 @@ export default {
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
},
|
||||
reset: function () {
|
||||
@@ -145,7 +143,7 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
label: node.level === 1?"新建业务分组":"新建虚拟组织",
|
||||
label: "新建节点",
|
||||
icon: "el-icon-plus",
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
@@ -153,11 +151,11 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "重命名",
|
||||
label: "编辑节点",
|
||||
icon: "el-icon-edit",
|
||||
disabled: node.level === 1,
|
||||
onClick: () => {
|
||||
this.editCatalog(data, node);
|
||||
this.editGroup(data, node);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -180,7 +178,7 @@ export default {
|
||||
{
|
||||
label: "添加设备",
|
||||
icon: "el-icon-plus",
|
||||
disabled: node.level === 1,
|
||||
disabled: node.level <= 2,
|
||||
onClick: () => {
|
||||
this.addChannelFormDevice(data.id, node)
|
||||
}
|
||||
@@ -188,7 +186,7 @@ export default {
|
||||
{
|
||||
label: "移除设备",
|
||||
icon: "el-icon-delete",
|
||||
disabled: node.level === 1,
|
||||
disabled: node.level <= 2,
|
||||
onClick: () => {
|
||||
this.removeChannelFormDevice(data.id, node)
|
||||
}
|
||||
@@ -227,7 +225,7 @@ export default {
|
||||
method: "delete",
|
||||
url: `/api/group/delete`,
|
||||
params: {
|
||||
deviceId: id,
|
||||
id: node.data.dbId,
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.data.code === 0) {
|
||||
@@ -312,12 +310,29 @@ export default {
|
||||
},
|
||||
addGroup: function (id, node) {
|
||||
this.$refs.groupEdit.openDialog({
|
||||
id: null
|
||||
id: 0,
|
||||
name: "",
|
||||
deviceId: "",
|
||||
parentDeviceId: node.level > 2 ? node.data.id:"",
|
||||
businessGroup: node.level > 2 ? node.data.businessGroup: node.data.id,
|
||||
},form => {
|
||||
node.loaded = false
|
||||
node.expand();
|
||||
}, id);
|
||||
},
|
||||
editGroup: function (id, node) {
|
||||
console.log(node)
|
||||
this.$refs.groupEdit.openDialog({
|
||||
id: node.data.dbId,
|
||||
name: node.data.label,
|
||||
deviceId: node.data.id,
|
||||
parentDeviceId: node.data.parentDeviceId,
|
||||
businessGroup: node.data.businessGroup,
|
||||
},form => {
|
||||
node.parent.loaded = false
|
||||
node.parent.expand();
|
||||
}, id);
|
||||
},
|
||||
nodeClickHandler: function (data, node, tree) {
|
||||
console.log(data)
|
||||
console.log(node)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div id="addUser" v-loading="getDeviceListLoading">
|
||||
<el-dialog
|
||||
title="添加国标设备通道到行政区划"
|
||||
title="添加国标设备通道"
|
||||
width="60%"
|
||||
top="2rem"
|
||||
:close-on-click-modal="false"
|
||||
@@ -34,6 +34,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="deviceId" label="设备编号" min-width="200" >
|
||||
</el-table-column>
|
||||
<el-table-column prop="channelCount" label="通道数" min-width="120" >
|
||||
</el-table-column>
|
||||
<el-table-column prop="manufacturer" label="厂家" min-width="120" >
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" min-width="160" >
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
@close="close()"
|
||||
>
|
||||
<div id="shared" style="margin-top: 1rem;margin-right: 100px;">
|
||||
<el-form ref="form" :rules="rules" :model="group" label-width="140px" >
|
||||
<el-form ref="form" :model="group" label-width="140px" >
|
||||
<el-form-item label="节点编号" prop="id" >
|
||||
<el-input v-model="group.deviceId" placeholder="请输入编码">
|
||||
<el-button slot="append" @click="buildDeviceIdCode(group.deviceId)">生成</el-button>
|
||||
@@ -50,13 +50,23 @@ export default {
|
||||
showDialog: false,
|
||||
loading: false,
|
||||
level: 0,
|
||||
group: {},
|
||||
group: {
|
||||
id: 0,
|
||||
deviceId: "",
|
||||
name: "",
|
||||
parentDeviceId: "",
|
||||
businessGroup: "",
|
||||
platformId: "",
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
openDialog: function (group, callback) {
|
||||
console.log(group)
|
||||
this.group = group;
|
||||
if (group) {
|
||||
this.group = group;
|
||||
}
|
||||
this.showDialog = true;
|
||||
this.submitCallback = callback;
|
||||
},
|
||||
@@ -64,7 +74,7 @@ export default {
|
||||
|
||||
this.$axios({
|
||||
method:"post",
|
||||
url: this.group.id ? '/api/group/add':'/api/group/update',
|
||||
url: this.group.id ? '/api/group/update':'/api/group/add',
|
||||
data: this.group
|
||||
}).then((res)=> {
|
||||
if (res.data.code === 0) {
|
||||
@@ -88,13 +98,11 @@ export default {
|
||||
});
|
||||
},
|
||||
buildDeviceIdCode: function (deviceId){
|
||||
|
||||
console.log(this.group)
|
||||
let lockContent = this.group.businessGroup ? "216":"215"
|
||||
this.$refs.channelCode.openDialog(code=>{
|
||||
console.log(this.form)
|
||||
console.log("code===> " + code)
|
||||
this.group.deviceId = code;
|
||||
console.log("code22===> " + code)
|
||||
}, deviceId);
|
||||
}, deviceId, 5 , lockContent);
|
||||
},
|
||||
close: function () {
|
||||
this.showDialog = false;
|
||||
|
||||
Reference in New Issue
Block a user