|
@@ -3,7 +3,8 @@
|
|
<div class="tit">草稿箱</div>
|
|
<div class="tit">草稿箱</div>
|
|
<div class="conent">
|
|
<div class="conent">
|
|
<div class="left-nav">
|
|
<div class="left-nav">
|
|
- <Tree :data="treeData" @change="change"></Tree>
|
|
|
|
|
|
+ <Tree :data="treeData" @change="change" v-if="treeData.length"></Tree>
|
|
|
|
+ <div v-else style="text-align: center;margin-top: 20px;">暂无数据</div>
|
|
<!-- <el-tree ref="tree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" node-key="id" :expand-on-click-node="false"-->
|
|
<!-- <el-tree ref="tree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" node-key="id" :expand-on-click-node="false"-->
|
|
<!-- :current-node-key="currentNodekey"-->
|
|
<!-- :current-node-key="currentNodekey"-->
|
|
<!-- :default-expanded-keys="expandedkeys">-->
|
|
<!-- :default-expanded-keys="expandedkeys">-->
|
|
@@ -150,10 +151,14 @@ export default {
|
|
// },
|
|
// },
|
|
//初始化获取蜂鸟所有底图数据
|
|
//初始化获取蜂鸟所有底图数据
|
|
init() {
|
|
init() {
|
|
|
|
+ const loadings = Loading.service({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: "Loading",
|
|
|
|
+ spinner: "el-icon-loading",
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)"
|
|
|
|
+ });
|
|
// const loadings = this.$loading({type: 'global'});
|
|
// const loadings = this.$loading({type: 'global'});
|
|
document.getElementById(`canvas`).focus();
|
|
document.getElementById(`canvas`).focus();
|
|
- this.scene = new EditScence();
|
|
|
|
- this.clearGraphy();
|
|
|
|
fengmap = new SFengParser(
|
|
fengmap = new SFengParser(
|
|
"fengMap",
|
|
"fengMap",
|
|
this.mapServerURL + "/fmap/" + this.fmapID,
|
|
this.mapServerURL + "/fmap/" + this.fmapID,
|
|
@@ -170,6 +175,7 @@ export default {
|
|
)
|
|
)
|
|
.then(response => {
|
|
.then(response => {
|
|
// 获取楼层数据数据
|
|
// 获取楼层数据数据
|
|
|
|
+ loadings.close();
|
|
this.getTreeData();
|
|
this.getTreeData();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -270,59 +276,78 @@ export default {
|
|
console.log(items);
|
|
console.log(items);
|
|
},
|
|
},
|
|
getTreeData() {
|
|
getTreeData() {
|
|
|
|
+ const loadings = Loading.service({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: "Loading",
|
|
|
|
+ spinner: "el-icon-loading",
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)"
|
|
|
|
+ });
|
|
queryDraftGroup({ projectId: this.projectId }).then(res => {
|
|
queryDraftGroup({ projectId: this.projectId }).then(res => {
|
|
console.log(res);
|
|
console.log(res);
|
|
|
|
+ loadings.close();
|
|
if (res.Result == "success") {
|
|
if (res.Result == "success") {
|
|
const data = res.Data;
|
|
const data = res.Data;
|
|
- (function recursion(newObj) {
|
|
|
|
- newObj.map(function(item, index) {
|
|
|
|
- item.id = item.Id || item.Gname;
|
|
|
|
- item.name = item.Gcode;
|
|
|
|
|
|
+ this.systemName = '';
|
|
|
|
+ this.floorName = '';
|
|
|
|
+ this.floorId = '';
|
|
|
|
+ this.categoryId = '';
|
|
|
|
+ if(data.length){
|
|
|
|
+ (function recursion(newObj) {
|
|
|
|
+ newObj.map(function(item, index) {
|
|
|
|
+ item.id = item.Id || item.Gname;
|
|
|
|
+ item.name = item.Gcode;
|
|
|
|
|
|
- item.checked = false;
|
|
|
|
- if (item.Category && item.Category.length > 0) {
|
|
|
|
- item.children = item.Category;
|
|
|
|
- item.open = false;
|
|
|
|
- recursion(item.Category);
|
|
|
|
- }
|
|
|
|
|
|
+ item.checked = false;
|
|
|
|
+ if (item.Category && item.Category.length > 0) {
|
|
|
|
+ item.children = item.Category;
|
|
|
|
+ item.open = false;
|
|
|
|
+ recursion(item.Category);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })(data);
|
|
|
|
+ data.forEach(ele => {
|
|
|
|
+ ele.children.forEach(item => {
|
|
|
|
+ if (item.children) {
|
|
|
|
+ item.children.forEach(item1 => {
|
|
|
|
+ item1.id = item.Id + item1.Gname;
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ item.id = ele.Id + item.Gname;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- })(data);
|
|
|
|
- data.forEach(ele => {
|
|
|
|
- ele.children.forEach(item => {
|
|
|
|
- if (item.children) {
|
|
|
|
- item.children.forEach(item1 => {
|
|
|
|
- item1.id = item.Id + item1.Gname;
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- item.id = ele.Id + item.Gname;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- this.treeData = data;
|
|
|
|
- if (this.treeData[0].children[0].children) {
|
|
|
|
- this.treeData[0].open = true;
|
|
|
|
- this.treeData[0].children[0].open = true;
|
|
|
|
- this.treeData[0].children[0].children[0].checked = "checked";
|
|
|
|
- this.systemName = this.treeData[0].children[0].Gcode;
|
|
|
|
- this.floorName = this.treeData[0].children[0].children[0].Gcode;
|
|
|
|
- this.floorId = this.treeData[0].children[0].Gname;
|
|
|
|
- this.categoryId = this.treeData[0].children[0].Id;
|
|
|
|
- // this.getLegend();
|
|
|
|
- this.checkFloor(this.treeData[0].children[0].children[0].Gname);
|
|
|
|
- } else {
|
|
|
|
- this.treeData[0].open = true;
|
|
|
|
- this.treeData[0].children[0].checked = "checked";
|
|
|
|
- this.systemName = this.treeData[0].Gcode;
|
|
|
|
- this.floorName = this.treeData[0].children[0].Gcode;
|
|
|
|
- this.floorId = this.treeData[0].Gname;
|
|
|
|
- this.categoryId = this.treeData[0].Id;
|
|
|
|
- // this.getLegend();
|
|
|
|
- this.checkFloor(this.treeData[0].children[0].Gname);
|
|
|
|
|
|
+ this.treeData = data;
|
|
|
|
+ if ( this.treeData[0].children[0].children) {
|
|
|
|
+ this.treeData[0].open = true;
|
|
|
|
+ this.treeData[0].children[0].open = true;
|
|
|
|
+ this.treeData[0].children[0].children[0].checked = "checked";
|
|
|
|
+ this.systemName = this.treeData[0].children[0].Gcode;
|
|
|
|
+ this.floorName = this.treeData[0].children[0].children[0].Gcode;
|
|
|
|
+ this.floorId = this.treeData[0].children[0].children[0].Gname;
|
|
|
|
+ this.categoryId = this.treeData[0].children[0].Id;
|
|
|
|
+ // this.getLegend();
|
|
|
|
+ this.checkFloor(this.treeData[0].children[0].children[0].Gname);
|
|
|
|
+ } else {
|
|
|
|
+ this.treeData[0].open = true;
|
|
|
|
+ this.treeData[0].children[0].checked = "checked";
|
|
|
|
+ this.systemName = this.treeData[0].Gcode;
|
|
|
|
+ this.floorName = this.treeData[0].children[0].Gcode;
|
|
|
|
+ this.floorId = this.treeData[0].children[0].Gname;
|
|
|
|
+ this.categoryId = this.treeData[0].Id;
|
|
|
|
+ // this.getLegend();
|
|
|
|
+ this.checkFloor(this.treeData[0].children[0].Gname);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ this.treeData = data;
|
|
}
|
|
}
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
this.treeData = [];
|
|
this.treeData = [];
|
|
this.$message.error("获取楼层结构失败");
|
|
this.$message.error("获取楼层结构失败");
|
|
}
|
|
}
|
|
|
|
+ }).catch(()=>{
|
|
|
|
+ loadings.close();
|
|
|
|
+ this.$message.error('请求失败')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//获取补充图例
|
|
//获取补充图例
|
|
@@ -364,6 +389,7 @@ export default {
|
|
if (res.Result == "success") {
|
|
if (res.Result == "success") {
|
|
this.$message.success("删除成功");
|
|
this.$message.success("删除成功");
|
|
this.getTreeData();
|
|
this.getTreeData();
|
|
|
|
+ this.init();
|
|
this.legendData = [];
|
|
this.legendData = [];
|
|
} else {
|
|
} else {
|
|
this.$message.error(res.Message);
|
|
this.$message.error(res.Message);
|
|
@@ -378,6 +404,7 @@ export default {
|
|
spinner: "el-icon-loading",
|
|
spinner: "el-icon-loading",
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
});
|
|
});
|
|
|
|
+ console.log(this.floorId);
|
|
const data = {
|
|
const data = {
|
|
BuildingID: this.BuildingID,
|
|
BuildingID: this.BuildingID,
|
|
CategoryID: this.categoryId,
|
|
CategoryID: this.categoryId,
|
|
@@ -414,15 +441,34 @@ export default {
|
|
* @description t跳转editer编辑器
|
|
* @description t跳转editer编辑器
|
|
*/
|
|
*/
|
|
goToEditer() {
|
|
goToEditer() {
|
|
- const data = `categoryId=${this.categoryId}&projectId=${this.projectId}&BuildingID=1&FloorID=${this.floorId}&FloorName=${this.floorName}&fmapID=${this.fmapID}`;
|
|
|
|
- const url =
|
|
|
|
- window.location.origin +
|
|
|
|
- "/wandaEditer/editer?" +
|
|
|
|
- encodeURIComponent(data);
|
|
|
|
- window.open(url, true);
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ const token = this.$store.getters["token"];
|
|
|
|
+ const data = `categoryId=${this.categoryId}&projectId=${this.projectId}&BuildingID=1&FloorID=${this.floorId}&FloorName=${this.floorName}&fmapID=${this.fmapID}&token=${token}`;
|
|
|
|
+ const url =
|
|
|
|
+ window.location.origin +
|
|
|
|
+ "/wandaEditer/editer?" +
|
|
|
|
+ encodeURIComponent(data);
|
|
|
|
+ window.open(url, true);
|
|
|
|
+ // 发布成功跳转草稿箱
|
|
|
|
+ // const token = this.$store.getters["token"];
|
|
|
|
+ // this.$router.push({
|
|
|
|
+ // path: "editer",
|
|
|
|
+ // query: {
|
|
|
|
+ // categoryId: this.categoryId,
|
|
|
|
+ // projectId: this.projectId,
|
|
|
|
+ // BuildingID: 1,
|
|
|
|
+ // FloorName: this.floorName,
|
|
|
|
+ // FloorID: this.floorId,
|
|
|
|
+ // fmapID: this.fmapID,
|
|
|
|
+ // token:token
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ }, 1000);
|
|
},
|
|
},
|
|
// 切换草稿箱楼层
|
|
// 切换草稿箱楼层
|
|
checkFloor(floorid) {
|
|
checkFloor(floorid) {
|
|
|
|
+ this.scene = new EditScence();
|
|
|
|
+ this.clearGraphy();
|
|
const loadings = Loading.service({
|
|
const loadings = Loading.service({
|
|
lock: true,
|
|
lock: true,
|
|
text: "Loading",
|
|
text: "Loading",
|
|
@@ -472,7 +518,7 @@ export default {
|
|
this.getLegend();
|
|
this.getLegend();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- },100);
|
|
|
|
|
|
+ }, 100);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|