|
@@ -1,72 +1,72 @@
|
|
|
<template>
|
|
|
<div id="drafts">
|
|
|
- <div class="tit">草稿箱</div>
|
|
|
- <div class="conent">
|
|
|
- <div class="left-nav">
|
|
|
- <Tree :data="treeData" @change="change"></Tree>
|
|
|
-<!-- <el-tree ref="tree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" node-key="id" :expand-on-click-node="false"-->
|
|
|
-<!-- :current-node-key="currentNodekey"-->
|
|
|
-<!-- :default-expanded-keys="expandedkeys">-->
|
|
|
-<!-- <span class="span-ellipsis" slot-scope="{ node, data }">-->
|
|
|
-<!-- <span :title="node.label">{{ node.label }}</span>-->
|
|
|
-<!-- </span>-->
|
|
|
-<!-- </el-tree>-->
|
|
|
+ <div class="tit">草稿箱</div>
|
|
|
+ <div class="conent">
|
|
|
+ <div class="left-nav">
|
|
|
+ <Tree :data="treeData" @change="change"></Tree>
|
|
|
+ <!-- <el-tree ref="tree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" node-key="id" :expand-on-click-node="false"-->
|
|
|
+ <!-- :current-node-key="currentNodekey"-->
|
|
|
+ <!-- :default-expanded-keys="expandedkeys">-->
|
|
|
+ <!-- <span class="span-ellipsis" slot-scope="{ node, data }">-->
|
|
|
+ <!-- <span :title="node.label">{{ node.label }}</span>-->
|
|
|
+ <!-- </span>-->
|
|
|
+ <!-- </el-tree>-->
|
|
|
+ </div>
|
|
|
+ <div class="conent-right">
|
|
|
+ <div class="conent-tit">
|
|
|
+ <div class="tit-left" v-if="floorName">{{systemName}}-{{floorName}}</div>
|
|
|
+ <div class="tit-right">
|
|
|
+ <a-button @click="deleteBtn" :disabled="!floorName">删除</a-button>
|
|
|
+ <a-button @click="publishBtn" :disabled="!floorName">发布</a-button>
|
|
|
+ <a-button type="primary" @click="goToEditer" :disabled="!floorName">编辑</a-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="conent-right">
|
|
|
- <div class="conent-tit">
|
|
|
- <div class="tit-left" v-if="floorName">{{systemName}}-{{floorName}}</div>
|
|
|
- <div class="tit-right">
|
|
|
- <a-button @click="deleteBtn" :disabled="!floorName">删除</a-button>
|
|
|
- <a-button @click="publishBtn" :disabled="!floorName">发布</a-button>
|
|
|
- <a-button type="primary" @click="goToEditer" :disabled="!floorName">编辑</a-button>
|
|
|
+ <div class="concent-bottom">
|
|
|
+ <div class="map">
|
|
|
+ <div class="canvas-container" ref="draftsCanvas">
|
|
|
+ <div id="fengMap"></div>
|
|
|
+ <canvas
|
|
|
+ id="canvas"
|
|
|
+ :width="canvasWidth"
|
|
|
+ :height="canvasHeight"
|
|
|
+ ref="canvas"
|
|
|
+ tabindex="0"
|
|
|
+ ></canvas>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="concent-bottom">
|
|
|
- <div class="map">
|
|
|
- <div class="canvas-container" ref="draftsCanvas">
|
|
|
- <div id="fengMap"></div>
|
|
|
- <canvas
|
|
|
- id="canvas"
|
|
|
- :width="canvasWidth"
|
|
|
- :height="canvasHeight"
|
|
|
- ref="canvas"
|
|
|
- tabindex="0"
|
|
|
- ></canvas>
|
|
|
+ <div v-show="!legend" class="legend-btn" @click="legend = !legend">
|
|
|
+ <a-icon type="left" style="color: #8D9399;font-size: 10px" />
|
|
|
+ </div>
|
|
|
+ <div v-show="legend" class="legend-btn legend-btn-close" @click="legend = !legend">
|
|
|
+ <a-icon type="right" style="color: #8D9399;font-size: 10px" />
|
|
|
+ </div>
|
|
|
+ <div class="legend" v-if="legend">
|
|
|
+ <div
|
|
|
+ style="font-size:14px;color: #1F2429;padding-left: 12px;height: 40px;line-height: 40px"
|
|
|
+ >可能需要补充的图例</div>
|
|
|
+ <a-table
|
|
|
+ v-loading="legendLoading"
|
|
|
+ :columns="columns"
|
|
|
+ :rowKey="(record,index)=>{return index}"
|
|
|
+ :data-source="legendData"
|
|
|
+ size="middle"
|
|
|
+ :pagination="false"
|
|
|
+ >
|
|
|
+ <div slot="Url" slot-scope="text,record">
|
|
|
+ <img
|
|
|
+ v-if="record.Url"
|
|
|
+ style=" width: 20px;height: 22px;"
|
|
|
+ :src="'/serve/topology-wanda/Picture/query/'+ record.Url"
|
|
|
+ alt
|
|
|
+ />
|
|
|
+ <span v-else>---</span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div v-show="!legend" class="legend-btn" @click="legend = !legend">
|
|
|
- <a-icon type="left" style="color: #8D9399;font-size: 10px" />
|
|
|
- </div>
|
|
|
- <div v-show="legend" class="legend-btn legend-btn-close" @click="legend = !legend">
|
|
|
- <a-icon type="right" style="color: #8D9399;font-size: 10px" />
|
|
|
- </div>
|
|
|
- <div class="legend" v-if="legend">
|
|
|
- <div
|
|
|
- style="font-size:14px;color: #1F2429;padding-left: 12px;height: 40px;line-height: 40px"
|
|
|
- >可能需要补充的图例</div>
|
|
|
- <a-table
|
|
|
- v-loading="legendLoading"
|
|
|
- :columns="columns"
|
|
|
- :rowKey="(record,index)=>{return index}"
|
|
|
- :data-source="legendData"
|
|
|
- size="middle"
|
|
|
- :pagination="false"
|
|
|
- >
|
|
|
- <div slot="Url" slot-scope="text,record">
|
|
|
- <img
|
|
|
- v-if="record.Url"
|
|
|
- style=" width: 20px;height: 22px;"
|
|
|
- :src="'/serve/topology-wanda/Picture/query/'+ record.Url"
|
|
|
- alt
|
|
|
- />
|
|
|
- <span v-else>---</span>
|
|
|
- </div>
|
|
|
- <span></span>
|
|
|
- </a-table>
|
|
|
- </div>
|
|
|
+ <span></span>
|
|
|
+ </a-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -87,7 +87,7 @@ import { STopologyParser } from "./../lib/parsers/STopologyParser";
|
|
|
import { uuid } from "@/components/mapClass/until";
|
|
|
import { SImageItem } from "@saga-web/graph/lib";
|
|
|
import store from "../store";
|
|
|
-import {Loading} from "element-ui";
|
|
|
+import { Loading } from "element-ui";
|
|
|
let fengmap = null;
|
|
|
export default {
|
|
|
components: { Tree },
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
BuildingID: "1", // 建筑id
|
|
|
categoryId: "", //系统类id
|
|
|
currentNodekey: "", //默认选中的节点树
|
|
|
- expandedkeys: [], //默认展开的节点树
|
|
|
+ expandedkeys: [] //默认展开的节点树
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -147,11 +147,12 @@ export default {
|
|
|
// this.checkFloor(data.Gname);
|
|
|
// }
|
|
|
// },
|
|
|
+ //初始化获取蜂鸟所有底图数据
|
|
|
init() {
|
|
|
// const loadings = this.$loading({type: 'global'});
|
|
|
document.getElementById(`canvas`).focus();
|
|
|
- this.clearGraphy();
|
|
|
this.scene = new EditScence();
|
|
|
+ this.clearGraphy();
|
|
|
fengmap = new SFengParser(
|
|
|
"fengMap",
|
|
|
this.mapServerURL + "/fmap/" + this.fmapID,
|
|
@@ -159,6 +160,17 @@ export default {
|
|
|
this.appName,
|
|
|
null
|
|
|
);
|
|
|
+ fengmap.loadMap(this.fmapID, resp => {
|
|
|
+ this.floorList = resp;
|
|
|
+ fengmap
|
|
|
+ .loadTheme(
|
|
|
+ `${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`
|
|
|
+ )
|
|
|
+ .then(response => {
|
|
|
+ // 获取楼层数据数据
|
|
|
+ this.getTreeData();
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
clearGraphy() {
|
|
|
if (this.view) {
|
|
@@ -211,8 +223,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- change(id){
|
|
|
- let data = this.treeData;
|
|
|
+ change(id) {
|
|
|
+ const data = this.treeData;
|
|
|
(function recursion(newObj) {
|
|
|
newObj.map(function(item, index) {
|
|
|
item.open = false;
|
|
@@ -224,30 +236,30 @@ export default {
|
|
|
});
|
|
|
})(data);
|
|
|
let items = null;
|
|
|
- data.forEach(ele=>{
|
|
|
- ele.children.forEach(item=>{
|
|
|
- if(item.children){
|
|
|
- item.children.forEach(item1=>{
|
|
|
- if(item1.id==id.id){
|
|
|
+ data.forEach(ele => {
|
|
|
+ ele.children.forEach(item => {
|
|
|
+ if (item.children) {
|
|
|
+ item.children.forEach(item1 => {
|
|
|
+ if (item1.id == id.id) {
|
|
|
items = item;
|
|
|
- item.open=true;
|
|
|
- ele.open=true;
|
|
|
- item1.checked='checked';
|
|
|
+ item.open = true;
|
|
|
+ ele.open = true;
|
|
|
+ item1.checked = "checked";
|
|
|
}
|
|
|
- })
|
|
|
- }else{
|
|
|
- if(item.id==id.id){
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (item.id == id.id) {
|
|
|
items = ele;
|
|
|
- ele.open=true;
|
|
|
- item.checked='checked';
|
|
|
+ ele.open = true;
|
|
|
+ item.checked = "checked";
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
+ });
|
|
|
+ });
|
|
|
this.legendData = [];
|
|
|
this.systemName = "";
|
|
|
this.floorName = "";
|
|
|
- this.systemName = items.Gcode;
|
|
|
+ this.systemName = items.Gcode;
|
|
|
this.floorName = id.Gcode;
|
|
|
this.floorId = id.Gname;
|
|
|
this.categoryId = items.Id;
|
|
@@ -259,10 +271,10 @@ export default {
|
|
|
queryDraftGroup({ projectId: this.projectId }).then(res => {
|
|
|
console.log(res);
|
|
|
if (res.Result == "success") {
|
|
|
- let data = res.Data;
|
|
|
+ const data = res.Data;
|
|
|
(function recursion(newObj) {
|
|
|
newObj.map(function(item, index) {
|
|
|
- item.id = item.Id||item.Gname;
|
|
|
+ item.id = item.Id || item.Gname;
|
|
|
item.name = item.Gcode;
|
|
|
|
|
|
item.checked = false;
|
|
@@ -273,41 +285,38 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
})(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.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;
|
|
|
+ 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;
|
|
|
+ } 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);
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
this.treeData = [];
|
|
|
this.$message.error("获取楼层结构失败");
|
|
@@ -322,7 +331,7 @@ export default {
|
|
|
projectId: this.projectId,
|
|
|
flag: true,
|
|
|
graphId: this.graphId,
|
|
|
- pub:false
|
|
|
+ pub: false
|
|
|
}).then(res => {
|
|
|
console.log(res);
|
|
|
this.legendLoading = false;
|
|
@@ -373,13 +382,13 @@ export default {
|
|
|
FloorID: this.floorId,
|
|
|
GraphId: this.graphId,
|
|
|
ProjectID: this.projectId,
|
|
|
- Pub:false,
|
|
|
+ Pub: false,
|
|
|
PubUser: ""
|
|
|
};
|
|
|
publishGraph(data).then(res => {
|
|
|
loadings.close();
|
|
|
if (res.Result == "success") {
|
|
|
- this.$message.success('发布成功');
|
|
|
+ this.$message.success("发布成功");
|
|
|
this.getTreeData();
|
|
|
this.legendData = [];
|
|
|
} else {
|
|
@@ -394,7 +403,7 @@ export default {
|
|
|
projectId: this.projectId,
|
|
|
BuildingID: this.BuildingID, // 建筑ID
|
|
|
FloorID: floorid, // 楼层id
|
|
|
- Pub:false
|
|
|
+ Pub: false
|
|
|
};
|
|
|
return readGroup(data);
|
|
|
},
|
|
@@ -418,19 +427,8 @@ export default {
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
|
- fengmap.loadMap(this.fmapID, resp => {
|
|
|
- this.floorList = resp;
|
|
|
- fengmap
|
|
|
- .loadTheme(
|
|
|
- `${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`
|
|
|
- )
|
|
|
- .then(response => {
|
|
|
- console.log("获取rf成功", response);
|
|
|
- this.parserData(floorid);
|
|
|
- });
|
|
|
- this.view.fitSceneToView();
|
|
|
- // 获取
|
|
|
- // 获取主题数据
|
|
|
+ setTimeout(() => {
|
|
|
+ this.parserData(floorid);
|
|
|
this.readGroup(floorid).then(data => {
|
|
|
this.graphId = data.Data[0].ID;
|
|
|
if (data.Data) {
|
|
@@ -472,7 +470,7 @@ export default {
|
|
|
this.getLegend();
|
|
|
}
|
|
|
});
|
|
|
- });
|
|
|
+ },100);
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -496,7 +494,6 @@ export default {
|
|
|
this.projectId = obj.projectId ? obj.projectId : "1000423";
|
|
|
this.fmapID = obj.fmapID ? obj.fmapID : "1000423_120";
|
|
|
this.init();
|
|
|
- this.getTreeData();
|
|
|
}
|
|
|
};
|
|
|
</script>
|