| | |
| | | return { |
| | | YXState: true, |
| | | yxImg: require("../../assets/img/Screen/yximg.png"), |
| | | currMenu: "项目展示", |
| | | currProject: "全球管网图", |
| | | currMenu: "专题展示", |
| | | currProject: "", |
| | | searchName: "", |
| | | menuList: [ |
| | | { |
| | | menuName: "项目展示", |
| | | menuName: "专题展示", |
| | | children: [ |
| | | { |
| | | name: "全国管网图", |
| | |
| | | ], |
| | | }, |
| | | { |
| | | menuName: "工程展示", |
| | | menuName: "项目展示", |
| | | children: [ |
| | | { |
| | | name: "中俄东线管道工程", |
| | |
| | | }, |
| | | created() { |
| | | this.getCountProjectDisplay() |
| | | this.getCountProjectTour() |
| | | }, |
| | | methods: { |
| | | ChangeBaseLayer() { |
| | |
| | | case "工程巡视": |
| | | this.showPathLine(child) |
| | | break |
| | | case "工程展示": |
| | | case "项目展示": |
| | | this.DisplayCurrentProject(child) |
| | | this.changeProject(child) |
| | | break |
| | | case "专题展示": |
| | | this.changeProject(child) |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | }, |
| | | |
| | | //工程巡视 |
| | | async showPathLine(params) { |
| | | const line = wktToGeoJSON(params.wkt) |
| | | const position = line.coordinates[0] |
| | | const result = [] |
| | | position.forEach(pos => { |
| | | pos.push(50) |
| | | // 添加漫游高度,后续修改SDK源码可以适配为地面高程 |
| | | pos.push(1000) |
| | | result.push(...pos) |
| | | }) |
| | | // |
| | | console.log("line", position) |
| | | // 西气东输二线西段干线 |
| | | // console.log("PipeLine", PipeLine) |
| | | const features = PipeLine.features |
| | | // features.forEach(item => { |
| | | // const name = item.properties.pipename |
| | | // const rawArr = item.geometry.coordinates |
| | | // }) |
| | | // const pipeline = features.find( |
| | | // item => item.properties.pipename == "西气东输一线" |
| | | // ) |
| | | // const name = pipeline.properties.pipename |
| | | // const rawArr = pipeline.geometry.coordinates[0] |
| | | // const result = [] |
| | | // rawArr.forEach(pos => { |
| | | // pos.push(50) |
| | | // result.push(...pos) |
| | | // }) |
| | | // console.log("result", result); |
| | | // sgworld.Command.execute(2, 3, "", data => { |
| | | // data.showPoint = false |
| | | // data.showLine = true |
| | | // data.mode = 1 |
| | | // // 弹窗数据 |
| | | // window.PathAnimationData = { |
| | | // flyData: data, |
| | | // } |
| | | // window.PathAnimationData.winIndex = layer.open({ |
| | | // type: 2, |
| | | // title: "路径动画", |
| | | // shade: false, |
| | | // area: ["352px", "690px"], |
| | | // offset: "r", |
| | | // skin: "other-class", |
| | | // content: SmartEarthRootUrl + "Workers/path/Path.html", |
| | | // end: function () { |
| | | // PathAnimationData.fly && PathAnimationData.fly.exit() |
| | | // }, |
| | | // }) |
| | | // }) |
| | | // console.log("line", position) |
| | | |
| | | window.sgworld.Creator.getFlyData(result, data => { |
| | | data.showPoint = false |
| | | data.showLine = true |
| | | data.mode = 1 |
| | | data.height = 2000 |
| | | data.mode = 0 |
| | | data.height = 5000 |
| | | |
| | | // 弹窗数据 |
| | | window.PathAnimationData = { |
| | |
| | | } |
| | | window.PathAnimationData.winIndex = layer.open({ |
| | | type: 2, |
| | | title: "路径动画", |
| | | title: "工程巡视", |
| | | shade: false, |
| | | area: ["352px", "690px"], |
| | | offset: "r", |
| | | skin: "other-class", |
| | | content: SmartEarthRootUrl + "Workers/path/Path.html", |
| | | content: SmartEarthRootUrl + "Workers/path/ProjectPath.html", |
| | | end: function () { |
| | | PathAnimationData.fly && PathAnimationData.fly.exit() |
| | | }, |
| | |
| | | async getCountProjectDisplay() { |
| | | const res = await countProjectLocation() |
| | | if (res.code === 200) { |
| | | const menu = this.menuList.find(item => item.menuName == "工程展示") |
| | | const menu = this.menuList.find(item => item.menuName == "项目展示") |
| | | menu.children = res.result.map(item => { |
| | | return { |
| | | name: item.projname, |
| | | id: item.projname, |
| | | wkt: item.st_astext, |
| | | wkt: item.wkt, |
| | | } |
| | | }) |
| | | console.log(menu.children.length) |
| | | |
| | | } |
| | | }, |
| | | async getCountProjectTour() { |
| | |
| | | wkt: item.wkt, |
| | | } |
| | | }) |
| | | console.log(menu.children.length) |
| | | |
| | | } |
| | | }, |
| | | //专题展示 |
| | | changeProject(params) { |
| | | this.$bus.$emit('changeProject', params.name) |
| | | } |
| | | }, |
| | | } |
| | | </script> |