|
@@ -27,9 +27,9 @@
|
|
|
<span>{{ node.label }}</span>
|
|
<span>{{ node.label }}</span>
|
|
|
<span class="treeIcon">
|
|
<span class="treeIcon">
|
|
|
<img src="../assets/img/region/add.png" height="18" width="18" @click="addLoft(node)"/>
|
|
<img src="../assets/img/region/add.png" height="18" width="18" @click="addLoft(node)"/>
|
|
|
- <img src="../assets/img/region/edit.png" height="18" width="18"/>
|
|
|
|
|
- <img src="../assets/img/region/del.png" height="18" width="18"/>
|
|
|
|
|
- <img src="../assets/img/region/watch.png" height="18" width="18"/>
|
|
|
|
|
|
|
+ <img src="../assets/img/region/edit.png" height="18" width="18" @click="editLoft(node)"/>
|
|
|
|
|
+ <img src="../assets/img/region/del.png" height="18" width="18" @click="delLoft(node)"/>
|
|
|
|
|
+ <img src="../assets/img/region/watch.png" height="18" width="18"@click="seeLoft(node)"/>
|
|
|
</span>
|
|
</span>
|
|
|
</span>
|
|
</span>
|
|
|
</el-tree>
|
|
</el-tree>
|
|
@@ -68,7 +68,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="20" v-if="dialog_level != 1">
|
|
<el-col :span="20" v-if="dialog_level != 1">
|
|
|
<label>
|
|
<label>
|
|
|
- 建筑平面图123
|
|
|
|
|
|
|
+ 建筑平面图
|
|
|
</label>
|
|
</label>
|
|
|
<el-upload
|
|
<el-upload
|
|
|
action="#"
|
|
action="#"
|
|
@@ -129,6 +129,7 @@
|
|
|
dialog: {
|
|
dialog: {
|
|
|
name: '',
|
|
name: '',
|
|
|
region: '',
|
|
region: '',
|
|
|
|
|
+ regionId: 0,
|
|
|
memo: '',
|
|
memo: '',
|
|
|
},
|
|
},
|
|
|
dialogImageUrl: '',
|
|
dialogImageUrl: '',
|
|
@@ -151,23 +152,30 @@
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 获取建筑树列表
|
|
// 获取建筑树列表
|
|
|
- getDate(){
|
|
|
|
|
|
|
+ getDate() {
|
|
|
this.tree = [{
|
|
this.tree = [{
|
|
|
label: '1号楼',
|
|
label: '1号楼',
|
|
|
|
|
+ regionId: 1,
|
|
|
children: [{
|
|
children: [{
|
|
|
label: '1号楼1楼',
|
|
label: '1号楼1楼',
|
|
|
- children: [{
|
|
|
|
|
- label: '第一会议室'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ regionId: 6,
|
|
|
|
|
+ children: [
|
|
|
{
|
|
{
|
|
|
- label: '第二会议室'
|
|
|
|
|
|
|
+ label: '第一会议室',
|
|
|
|
|
+ regionId: 10,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '第三会议室'
|
|
|
|
|
|
|
+ label: '第二会议室',
|
|
|
|
|
+ regionId: 11,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '第三会议室',
|
|
|
|
|
+ regionId: 12,
|
|
|
}]
|
|
}]
|
|
|
}]
|
|
}]
|
|
|
}, {
|
|
}, {
|
|
|
label: '2号小平房',
|
|
label: '2号小平房',
|
|
|
|
|
+ regionId: 2,
|
|
|
children: []
|
|
children: []
|
|
|
}]
|
|
}]
|
|
|
},
|
|
},
|
|
@@ -179,15 +187,42 @@
|
|
|
that.dialog_type = 1;
|
|
that.dialog_type = 1;
|
|
|
that.dialog_level = 1;
|
|
that.dialog_level = 1;
|
|
|
},
|
|
},
|
|
|
|
|
+ // 修改弹窗
|
|
|
|
|
+ editLoft(node) {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ that.dialog_state = true;
|
|
|
|
|
+ that.dialog_title = '修改';
|
|
|
|
|
+ that.dialog_type = 2;
|
|
|
|
|
+ that.dialog_level = node.level;
|
|
|
|
|
+ that.dialog.name = node.data.label;
|
|
|
|
|
+ that.dialog.regionId = node.data.regionId;
|
|
|
|
|
+ console.log(node);
|
|
|
|
|
+ // that.dialog_level = 1;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 删除楼层
|
|
|
|
|
+ delLoft(node) {
|
|
|
|
|
+ let regionId = node.data.regionId;
|
|
|
|
|
+ let name = node.data.label;
|
|
|
|
|
+ this.$alert('是否删除'+name+'区域?', '删除操作', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ callback: action => {
|
|
|
|
|
+ // ajax todo
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: `删除成功`
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// 提交主建筑
|
|
// 提交主建筑
|
|
|
confirmAddMain() {
|
|
confirmAddMain() {
|
|
|
- let that = this;
|
|
|
|
|
- // checkVal
|
|
|
|
|
- if(!that.dialog.name){
|
|
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ // checkVal
|
|
|
|
|
+ if (!that.dialog.name) {
|
|
|
this.$message.error('错了哦,主建筑名称不能空');
|
|
this.$message.error('错了哦,主建筑名称不能空');
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
- if(that.dialog.name.length > 20){
|
|
|
|
|
|
|
+ if (that.dialog.name.length > 20) {
|
|
|
this.$message.error('错了哦,主建筑名称不能超过20个字符');
|
|
this.$message.error('错了哦,主建筑名称不能超过20个字符');
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -199,8 +234,27 @@
|
|
|
type: 'success'
|
|
type: 'success'
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ confirmEdit() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ // checkVal
|
|
|
|
|
+ if (!that.dialog.name) {
|
|
|
|
|
+ this.$message.error('错了哦,建筑名称不能空');
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (that.dialog.name.length > 20) {
|
|
|
|
|
+ this.$message.error('错了哦,建筑名称不能超过20个字符');
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ // ajax todo
|
|
|
|
|
+ // ok
|
|
|
|
|
+ that.dialog_state = false;
|
|
|
|
|
+ that.$message({
|
|
|
|
|
+ message: '建筑已修改',
|
|
|
|
|
+ type: 'success'
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 添加次级建筑
|
|
// 添加次级建筑
|
|
|
- addLoft(node){
|
|
|
|
|
|
|
+ addLoft(node) {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
that.dialog_state = true;
|
|
that.dialog_state = true;
|
|
|
that.dialog_title = '添加楼层或区域';
|
|
that.dialog_title = '添加楼层或区域';
|
|
@@ -250,16 +304,24 @@
|
|
|
},
|
|
},
|
|
|
dialog_ok() {
|
|
dialog_ok() {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
- // 获取提交类型
|
|
|
|
|
- switch (parseInt(that.dialog_level)) {
|
|
|
|
|
- case 1:
|
|
|
|
|
- that.confirmAddMain();
|
|
|
|
|
- break;
|
|
|
|
|
- case 2:
|
|
|
|
|
- break;
|
|
|
|
|
- case 3:
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ // 添加类
|
|
|
|
|
+ if (that.dialog_type == 1) {
|
|
|
|
|
+ // 获取提交类型
|
|
|
|
|
+ switch (parseInt(that.dialog_level)) {
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ that.confirmAddMain();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 修改类
|
|
|
|
|
+ if (that.dialog_type == 2) {
|
|
|
|
|
+ that.confirmEdit();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// let dialog_type = that.dialog_type;
|
|
// let dialog_type = that.dialog_type;
|
|
|
// let name = that.field_name;
|
|
// let name = that.field_name;
|
|
|
// let id = that.field_id;
|
|
// let id = that.field_id;
|
|
@@ -273,7 +335,11 @@
|
|
|
},
|
|
},
|
|
|
handleDownload(file) {
|
|
handleDownload(file) {
|
|
|
console.log(file);
|
|
console.log(file);
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // 查看当前区域情况
|
|
|
|
|
+ seeLoft(node){
|
|
|
|
|
+ // todo
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
|
dialog_referrer_list
|
|
dialog_referrer_list
|
|
@@ -470,4 +536,16 @@
|
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*upload*/
|
|
|
|
|
+ /deep/ .el-upload--picture-card {
|
|
|
|
|
+ float: left;
|
|
|
|
|
+ background: none;
|
|
|
|
|
+ border: 1px solid #005EA2;
|
|
|
|
|
+ color: #005EA2;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /deep/ .el-upload--picture-card i {
|
|
|
|
|
+ color: #005EA2;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
</style>
|
|
</style>
|