From 7453188ddfaef750c5f367abadb8afa1ad877909 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期四, 18 四月 2024 15:48:57 +0800 Subject: [PATCH] 菜单 --- src/components/props/situationComparison6-4.vue | 499 ++ src/components/props/situationComparison7-6.vue | 499 ++ src/components/props/situationComparison8-3.vue | 499 ++ src/components/props/situationComparison7-1.vue | 499 ++ src/components/props/situationComparison10-3.vue | 499 ++ src/components/props/situationComparison6-3.vue | 499 ++ src/components/props/situationComparison7-5.vue | 499 ++ src/components/props/situationComparison8-2.vue | 499 ++ src/components/props/situationComparison7-8.vue | 499 ++ src/components/props/situationComparison7-2-1.vue | 499 ++ src/components/props/situationComparison10-2.vue | 499 ++ src/components/props/situationComparison6-7.vue | 499 ++ src/components/props/situationComparison8-1.vue | 499 ++ src/components/props/situationComparison9-3.vue | 499 ++ src/components/props/situationComparison7-4.vue | 499 ++ src/components/props/situationComparison7-9.vue | 499 ++ src/components/props/situationComparison6-2.vue | 499 ++ src/components/wggl/left/czll.vue | 354 + src/components/props/situationComparison10-1.vue | 499 ++ src/components/props/situationComparison6-6.vue | 499 ++ src/components/viewer.vue | 120 src/components/props/situationComparison7-3-1.vue | 499 ++ src/components/props/situationComparison9-2.vue | 499 ++ src/components/props/situationComparison6-1.vue | 499 ++ src/components/props/situationComparison7-7.vue | 499 ++ src/components/props/situationComparison8-4.vue | 499 ++ src/components/props/situationComparison6-5.vue | 499 ++ src/components/props/situationComparison9-1.vue | 499 ++ src/components/props/situationComparison10-4.vue | 499 ++ 29 files changed, 13,828 insertions(+), 119 deletions(-) diff --git a/src/components/props/situationComparison10-1.vue b/src/components/props/situationComparison10-1.vue new file mode 100644 index 0000000..4653358 --- /dev/null +++ b/src/components/props/situationComparison10-1.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">鎯呮姤閾捐矾琛屽姩褰卞搷鍒嗘瀽</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="10-1" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison10-2.vue b/src/components/props/situationComparison10-2.vue new file mode 100644 index 0000000..a90b44c --- /dev/null +++ b/src/components/props/situationComparison10-2.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">鎸囨尌閾捐矾琛屽姩褰卞搷鍒嗘瀽</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="10-2" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison10-3.vue b/src/components/props/situationComparison10-3.vue new file mode 100644 index 0000000..9469ef9 --- /dev/null +++ b/src/components/props/situationComparison10-3.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">鎵撳嚮閾捐矾琛屽姩褰卞搷鍒嗘瀽</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="10-3" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison10-4.vue b/src/components/props/situationComparison10-4.vue new file mode 100644 index 0000000..1f4222a --- /dev/null +++ b/src/components/props/situationComparison10-4.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">淇濋殰閾捐矾琛屽姩褰卞搷鍒嗘瀽鍜岃瘎浼板垎鏋愮粨鏋滃睍绀�</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="10-4" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison6-1.vue b/src/components/props/situationComparison6-1.vue new file mode 100644 index 0000000..cab1866 --- /dev/null +++ b/src/components/props/situationComparison6-1.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氱敤妯$増绠$悊</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="6-1" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison6-2.vue b/src/components/props/situationComparison6-2.vue new file mode 100644 index 0000000..d62d778 --- /dev/null +++ b/src/components/props/situationComparison6-2.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊璧勬簮绠$悊</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="6-2" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison6-3.vue b/src/components/props/situationComparison6-3.vue new file mode 100644 index 0000000..e95147f --- /dev/null +++ b/src/components/props/situationComparison6-3.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊缃戠郴绠$悊</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="6-3" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison6-4.vue b/src/components/props/situationComparison6-4.vue new file mode 100644 index 0000000..3c0fd59 --- /dev/null +++ b/src/components/props/situationComparison6-4.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊鎯冲畾绠$悊</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="6-4" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison6-5.vue b/src/components/props/situationComparison6-5.vue new file mode 100644 index 0000000..9bead06 --- /dev/null +++ b/src/components/props/situationComparison6-5.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">澶氬獟浣撶礌鏉愮鐞�</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="6-5" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison6-6.vue b/src/components/props/situationComparison6-6.vue new file mode 100644 index 0000000..42419ed --- /dev/null +++ b/src/components/props/situationComparison6-6.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">浠跨湡妯″瀷绠$悊</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="6-6" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison6-7.vue b/src/components/props/situationComparison6-7.vue new file mode 100644 index 0000000..039dfed --- /dev/null +++ b/src/components/props/situationComparison6-7.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">鐢ㄦ埛绠$悊鍜岀郴缁熻缃�</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="6-7" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-1.vue b/src/components/props/situationComparison7-1.vue new file mode 100644 index 0000000..b5ad4f0 --- /dev/null +++ b/src/components/props/situationComparison7-1.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">zcTS\绛瑰垝姝ラ</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-1" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-2-1.vue b/src/components/props/situationComparison7-2-1.vue new file mode 100644 index 0000000..bf9e1a6 --- /dev/null +++ b/src/components/props/situationComparison7-2-1.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">ZC鐜鏄剧ず-涓滃崡娌挎捣銆乀D</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-2-1" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-3-1.vue b/src/components/props/situationComparison7-3-1.vue new file mode 100644 index 0000000..d7552e3 --- /dev/null +++ b/src/components/props/situationComparison7-3-1.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊鎬佸娍鏄剧ず-鍩虹珯銆佺洃娴嬬珯</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-3-1" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-4.vue b/src/components/props/situationComparison7-4.vue new file mode 100644 index 0000000..6b30595 --- /dev/null +++ b/src/components/props/situationComparison7-4.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">淇℃伅閾捐矾鏄剧ず</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-4" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-5.vue b/src/components/props/situationComparison7-5.vue new file mode 100644 index 0000000..0ca75fb --- /dev/null +++ b/src/components/props/situationComparison7-5.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">浣滄垬鎬佸娍鏄剧ず</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-5" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-6.vue b/src/components/props/situationComparison7-6.vue new file mode 100644 index 0000000..5ec4307 --- /dev/null +++ b/src/components/props/situationComparison7-6.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">鎯冲畾璧勬枡鏄剧ず</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-6" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-7.vue b/src/components/props/situationComparison7-7.vue new file mode 100644 index 0000000..96bc3fd --- /dev/null +++ b/src/components/props/situationComparison7-7.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">鎬佸娍鏄剧ず鎺у埗</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-7" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-8.vue b/src/components/props/situationComparison7-8.vue new file mode 100644 index 0000000..80f489b --- /dev/null +++ b/src/components/props/situationComparison7-8.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">澶氬獟浣撶礌鏉愭祻瑙�</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-8" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison7-9.vue b/src/components/props/situationComparison7-9.vue new file mode 100644 index 0000000..e1a551b --- /dev/null +++ b/src/components/props/situationComparison7-9.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">鎬佸娍鏍囩粯</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="7-9" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison8-1.vue b/src/components/props/situationComparison8-1.vue new file mode 100644 index 0000000..cc47775 --- /dev/null +++ b/src/components/props/situationComparison8-1.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊鏂规绠$悊</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="8-1" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison8-2.vue b/src/components/props/situationComparison8-2.vue new file mode 100644 index 0000000..1fda374 --- /dev/null +++ b/src/components/props/situationComparison8-2.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊鏂规鎷熷埗</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="8-2" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison8-3.vue b/src/components/props/situationComparison8-3.vue new file mode 100644 index 0000000..cd8aad6 --- /dev/null +++ b/src/components/props/situationComparison8-3.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊缃戠郴鏋勫缓</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="8-3" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison8-4.vue b/src/components/props/situationComparison8-4.vue new file mode 100644 index 0000000..e365996 --- /dev/null +++ b/src/components/props/situationComparison8-4.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊鏂规璁茶瘎</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="8-4" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison9-1.vue b/src/components/props/situationComparison9-1.vue new file mode 100644 index 0000000..fc2cfdf --- /dev/null +++ b/src/components/props/situationComparison9-1.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊姣佷激褰卞搷璇勪及</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="9-1" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison9-2.vue b/src/components/props/situationComparison9-2.vue new file mode 100644 index 0000000..9c92573 --- /dev/null +++ b/src/components/props/situationComparison9-2.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">閫氫俊骞叉壈褰卞搷璇勪及</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="9-2" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/props/situationComparison9-3.vue b/src/components/props/situationComparison9-3.vue new file mode 100644 index 0000000..7be2401 --- /dev/null +++ b/src/components/props/situationComparison9-3.vue @@ -0,0 +1,499 @@ +<template> + <div class="bot" + v-if="showsituation"> + <div class="top1"> + <span class="botcon"> + <span class="icon"></span> + <span class="text">杈呭姪璁$畻鍒嗘瀽</span> + </span> + <span class="close" + @click="close">x</span> + </div> + <div class="next"> + <el-form ref="form" + :model="form" + label-width="240px"> + <el-form-item label="鍖哄煙:"> + <el-select v-model="form.points" + @change="changeplase"> + <el-option v-for="(item, index) in regions" + :key="index" + :label="item.vname" + :value="{ value: item.vlatlngs, label: item.vname }"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="璧峰鏃堕棿:"> + <el-date-picker v-model="form.startTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change"> + </el-date-picker> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿:"> + <el-date-picker v-model="form.endTime" + value-format="yyyyMMdd" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + type="date" + placeholder="閫夋嫨鏃ユ湡" + @change="change1"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗘瀽绫诲瀷:"> + <el-select v-model="form.analysisType"> + <el-option label="棰戠偣" + value="1"></el-option> + <el-option label="棰戞" + value="2"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃犵嚎鐢典笟鍔�:"> + <el-select v-model="form.radio" + @change="choose"> + <el-option v-for="item in radios" + :key="item.value" + :label="item.bussName" + :value="item.startFreq + '-' + item.endFreq"> + </el-option> + </el-select> + </el-form-item> + </el-form> + <div class="btns"> + <span @click="reset">閲嶇疆</span> + <span @click="analysis">鍒嗘瀽</span> + </div> + </div> + <div class="showpic" + v-if="showpic"> + <div :style="innerbac" + @click="openDia"></div> + </div> + <changePic @colordata="getdata" /> + </div> +</template> + +<script> +import { createPic,freqBandAnalysis,showCQ } from "../../api/http"; +import changePic from "../common/color.vue"; +import bus from "../../utils/bus"; +import axios from "axios"; + +let hander,divPoint3; +let Base64=require("js-base64").Base64; +export default { + components: { + changePic, + }, + data () { + return { + form: { + points: "", + startTime: new Date("2016-06-01"), + endTime: new Date("2016-06-30"), + radio: "璋冮骞挎挱", + freqStart: "87", + freqEnd: "108", + analysisType: "棰戠偣", + }, + nowfile: "", + showsituation: false, + imageid: null, + showpic: false, + pickerOptions: {}, + chooseplase: "", + options: [], + regions: [], + radios: [], + colorContainer: {}, + innerbac: { + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: + "url("+require("@/assets/image/botbtn/color.png")+")", + backgroundPosition: "center", + backgroundSize: ` 100% 100%`, + }, + showdata1: true, + showdata2: true, + showDianci: false, + }; + }, + mounted () { + bus.$on("clearEve",(e) => { + this.reset(); + }); + bus.$on("radioData",(e) => { + this.radios=e; + }); + bus.$on("guanzhou",(e) => { + this.form.startTime=e.fromdate; + this.form.endTime=e.todate; + }); + bus.$on("areaData",(e) => { + this.regions=e; + }); + bus.$on("showdio",(e) => { + this.showsituation=e=="9-3" + this.showdata1=true; + this.showdata2=true; + }); + }, + methods: { + changeplase (value) { + if(value.label.indexOf("骞垮窞")>-1) { + this.chooseplase="骞垮窞"; + this.form.startTime=new Date("2019-10-08"); + this.form.endTime=new Date("2019-10-16"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 113.29503528791071, + 23.104708355136264, + 4109.8492337442767 + ), + orientation: { + heading: 0.8349372341578318, + pitch: -0.85222154573481174, + roll: 0, + }, + }); + } else { + this.chooseplase="涓婃捣"; + this.form.startTime=new Date("2016-06-01"); + this.form.endTime=new Date("2016-06-30"); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 121.23142475566037, + 30.314431916707203, + 101204.78027978493 + ), + orientation: { + heading: 0.149372341578318, + pitch: -0.8022154573481174, + roll: 0, + }, + }); + } + }, + change () { + this.showdata1=false; + }, + change1 () { + this.showdata2=false; + }, + openDia () { + bus.$emit("changeColor",true); + }, + choose (value) { + let arr=value.split("-"); + this.form.freqStart=arr[0]; + this.form.freqEnd=arr[1]; + }, + close () { + this.showsituation=false; + }, + getdata (data) { + this.colorContainer=data; + }, + // 鐐瑰嚮鑾峰緱鎬佸娍 + getTaishi () { + if(hander) { + return; + } + hander=new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); + let pickFeature; + // 榧犳爣鐐瑰嚮浜嬩欢 + hander.setInputAction((event) => { + // 鎷惧彇瀵硅薄 + divPoint3&&divPoint3.deleteObject(); + let clickPosition=viewer.scene.camera.pickEllipsoid(event.position); + // 杞粡绾害锛堝姬搴︼級鍧愭爣 + let radiansPos=Cesium.Cartographic.fromCartesian(clickPosition); + let lon=Cesium.Math.toDegrees(radiansPos.longitude); + let lat=Cesium.Math.toDegrees(radiansPos.latitude); + let filename=this.nowfile; + let obj={ + lat: lat, + lng: lon, + analysisAction: "-1", + analysisType: "1", + filename: filename, + }; + showCQ(obj).then((res) => { + let data=res.data; + if(data!="鏃犳暟鎹�") { + divPoint3=sgworld.Creator.createDivPoint( + "鍚堣偉", + { lon: obj.lng,lat: obj.lat }, + { + type: "custom", + offset: ["c",60], + description: ` + <div class="divPoint-custom"> + <p>${data}</p> + </div> + `, + near: 0, + far: 100000, + } + ); + } + }); + //鎶婁綘鎷惧彇鐨勪笢瑗挎墦鍗板嚭鏉ョ湅鐪嬩粈涔堝�煎彲浠ョ敤浣滃垽鏂� + },Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, + analysis () { + this.reset(); + let that=this; + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + let data={ + colorName: "-100,0000FF;120,FF0000", + startTime: "20160601000000", + endTime: 20160630000000, + freqStart: 87000000, + freqEnd: 108000000, + freqPoint: 87000000, + points: + "[[30.5504351,120.5667114],[32.0499889,120.5667114],[32.0499889,122.4453735],[30.5504351,122.4453735]]", + radius: 0, + analysisAction: "3", + analysisType: 1, + }; + data={ ...data,...this.form }; + data.freqStart=data.freqStart*1000000; + data.freqEnd=data.freqEnd*1000000; + data.startTime=data.startTime+"000000"; + data.endTime=data.endTime*1000000; + data.analysisType=="棰戠偣"? (data.analysisType=1):""; + delete data.radio; + if(this.showdata1) { + data.startTime=20160601000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.startTime=20160601000000) + :(data.startTime=20191008000000); + } + if(this.showdata2) { + data.endTime=20160630000000; + this.chooseplase&&this.chooseplase=="涓婃捣" + ? (data.endTime=20160630000000) + :(data.endTime=20191016000000); + } + const loading=that.$loading({ + lock: true, + text: "璁$畻涓�", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + data.points=data.points.value; + freqBandAnalysis(data) + .then((res) => { + if(res.message==="Success") { + let points=res.data.imgBounds; + that.nowfile=Base64.encode(res.data.url) + var data1={ + colorSchemes: 1, + file: Base64.encode(res.data.url), + maxColor: "FF0000", + maxValue: 100, + minColor: "0000FF", + minValue: 0, + showBounds: this.form.points.value, + }; + data1={ ...data1,...this.colorContainer }; + createPic(data1) + .then((res2) => { + let rectangle=sgworld.Creator.addSimpleGraphic("rectangle",{ + removeEdit: true, + coordinates: Cesium.Rectangle.fromDegrees( + points.xmin, + points.ymin, + points.xmax, + points.ymax + ), + color: "rgba(255,255,255,0.5)", + image: + "http://221.224.53.36:9081/calc/picurl?file="+ + Base64.encode(res2.data), + }); + that.showDianci=true; + // 鍥剧墖鑾峰彇鎴愬姛 寮�鍚嬀鍙� + that.getTaishi(); + if(that.imageid) { + window.Viewer.entities.removeById(that.imageid); + that.imageid=null; + } + that.imageid=rectangle.id; + + loading.close(); + that.$message({ + message: "璁$畻鎴愬姛", + type: "success", + }); + that.showpic=true; + }) + .catch((error) => { + loading.close(); + }); + } + }) + .catch((error) => { + loading.close(); + }); + }, + reset () { + //閲嶇疆 + if(this.imageid) { + window.Viewer.entities.removeById(this.imageid); + hander&& + hander.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); + hander=null; + divPoint3&&divPoint3.deleteObject(); + + this.imageid=null; + this.showDianci=false; + } + }, + }, + watch: { + colorContainer: { + deep: true, + handler (data) { + let colornow={ + width: "30%", + height: "70%", + border: "1px solid #000", + transform: "translate(40px,90px)", + backgroundImage: `linear-gradient(${data.maxColor},${data.minColor})`, + }; + this.innerbac=colornow; + }, + }, + }, +}; +</script> + +<style scoped> +.bot { + width: 1000px; + height: 1150px; + background: url(~@/assets/image/test/22.png); + background-size: 100% 100%; + background-repeat: no-repeat; + position: absolute; + left: 3920px; + top: 680px; +} +.top1 { + width: 95%; + height: 11%; + font-size: 40px; + font-weight: bold; + margin: 0px auto; + border-bottom: 2px solid #fff; + color: #fff; + letter-spacing: 3px; +} +.icon { + position: absolute; + left: 50px; + width: 50px; + height: 50px; + top: 39px; + background-size: 100% 100% !important; + background-repeat: no-repeat !important; + background-position: center !important; + background: url(~@/assets/image/subject/棰樻爣.png); +} +.text { + display: inline-block; + margin-left: 90px; +} +.close { + position: absolute; + font-size: 60px; + font-weight: 400; + right: 60px; + top: 20px; +} +.close:hover { + color: red; + transition: color 1s; + cursor: pointer; +} +.next { + width: 89%; + height: 79%; + margin: 100px auto; +} +.next >>> .el-select { + width: 95% !important; +} +.next >>> .el-form-item { + margin-top: 60px; +} +.next >>> .el-input { + width: 84%; +} +.next >>> .el-date-editor { + width: 515px; +} +.next >>> .el-form-item__label { + color: #fff; + font-size: 40px; +} +.next >>> .el-input__inner { + font-size: 30px; +} +.next >>> .el-form-item__error { + font-size: 30px; + font-weight: 700; +} +.botcon { + display: inline-block; + margin-top: 34px; +} +.btns { + margin-top: 100px; + width: 100%; + height: 70px; + display: flex; + justify-content: center; +} +.btns > span { + display: block; + width: 200px; + height: 70px; + border: 1px solid #000; + text-align: center; + font-size: 35px; + margin: 0 50px; + line-height: 70px; + cursor: pointer; +} +.btns > span:nth-child(3) { + color: #fff; + background-image: linear-gradient(#76c2f6, #6a9cf1); +} +.btns > span:nth-child(-n + 2) { + color: #000; + background: #cadaea; +} +.showpic { + width: 260px; + height: 400px; + background: url(~@/assets/image/botbtn/bac.png); + background-position: center; + background-size: 100% 100%; + position: absolute; + top: 1200px; + right: 0px; +} +</style> diff --git a/src/components/viewer.vue b/src/components/viewer.vue index ea09e92..0fe964f 100644 --- a/src/components/viewer.vue +++ b/src/components/viewer.vue @@ -18,21 +18,21 @@ light, } from "@/utils/work"; import bus from "@/utils/bus"; -import { getVectorList,getRadio } from "@/api/http"; +import { getVectorList, getRadio } from "@/api/http"; export default { name: "App", - data () { + data() { return {}; }, methods: { - init () { - const that=this; - window.currentsubindex=1; - let _core=new SmartEarth.Core(); - window.tedp=new this.$trame({ + init() { + const that = this; + window.currentsubindex = 1; + let _core = new SmartEarth.Core(); + window.tedp = new this.$trame({ elem: "app1", width: 4992, - prop: [0,0], + prop: [0, 0], height: 2560, navtop: 300, gisType: "hf", @@ -56,13 +56,13 @@ }, gisInit: (webgis) => { //杩斿洖鍦板浘瀵硅薄 - window.Sgworld=webgis; - window.sgworld=webgis; - window.Viewer=webgis.Viewer; - window.viewer=webgis.Viewer; - window.Cesium=Cesium; + window.Sgworld = webgis; + window.sgworld = webgis; + window.Viewer = webgis.Viewer; + window.viewer = webgis.Viewer; + window.Cesium = Cesium; - window.layers=window.sgworld.Viewer.scene.imageryLayers; + window.layers = window.sgworld.Viewer.scene.imageryLayers; // const blackMarble = layers.addImageryProvider( // new Cesium.IonImageryProvider({ assetId: 3812 }) // ); @@ -70,7 +70,7 @@ // blackMarble.alpha = 0.0; // blackMarble.brightness = 2.0; // 鍦扮悆棰滆壊 - Viewer.scene.globe.baseColor= + Viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString("#272d39"); // //椋炲悜骞垮窞 // window.Viewer.camera.flyTo({ @@ -97,44 +97,44 @@ roll: 0, }, }); - let urldian1= + let urldian1 = "http://183.162.245.49:8099/geoserver/SHwuxiandian/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SHwuxiandian:1GZ_POI&maxFeatures=50&outputFormat=application%2Fjson"; - let urldian= + let urldian = "http://183.162.245.49:8099/geoserver/SHP/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SHP:SH_POI1&maxFeatures=50&outputFormat=application%2Fjson"; try { - loaddian(urldian1,"[TE_DESC]","[height]"); - loaddian(urldian,"[name]","[Height]"); + loaddian(urldian1, "[TE_DESC]", "[height]"); + loaddian(urldian, "[name]", "[Height]"); loadBaimo(1); loadLW(); addRightMouseEvent(); SPPM(); loadYH(); - juhe(true,"鐩戞祴绔�"); + juhe(true, "鐩戞祴绔�"); addMpt(true); - } catch(error) { } + } catch (error) {} //寮�鍚棩鐓� - viewer.scene.globe.enableLighting=false; - viewer.shadows=false; + viewer.scene.globe.enableLighting = false; + viewer.shadows = false; addMouseEvent(); light(); getVectorList().then((res) => { - if(res.message==="Success") { - let region=res.rows; + if (res.message === "Success") { + let region = res.rows; region.forEach((item) => { - let arr=[]; + let arr = []; JSON.parse(item.vlatlngs).forEach((item2) => { - arr.push([item2[1],item2[0]]); + arr.push([item2[1], item2[0]]); }); - item.vlatlngs=JSON.stringify(arr); + item.vlatlngs = JSON.stringify(arr); }); - bus.$emit("areaData",region); + bus.$emit("areaData", region); } }); //鑾峰彇鏃犵嚎鐢垫暟鎹� getRadio().then((res) => { - if(res.message==="Success") { - let radio=res.rows; - bus.$emit("radioData",radio); + if (res.message === "Success") { + let radio = res.rows; + bus.$emit("radioData", radio); console.log(radio); } }); @@ -147,30 +147,30 @@ // window.Viewer.scene.primitives.add(baimo); //鍘垮煙杈圭晫,缃戞牸 }, - subClick (index) { + subClick(index) { let showindex; - switch(index) { + switch (index) { case 0: - showindex=1; + showindex = 1; break; case 1: - showindex=2; + showindex = 2; break; case 2: - showindex=3; + showindex = 3; break; case 3: - showindex=4; + showindex = 4; break; case 4: - showindex=5; + showindex = 5; break; default: break; } - bus.$emit("showindex",showindex); + bus.$emit("showindex", showindex); }, - prop: [970,970], + prop: [970, 970], nav: { navTop: () => import("@/components/top/navTop"), }, @@ -239,16 +239,46 @@ freeAnalyse: () => import("@/components/props/freeAnalyse"), //绌洪棽璧勬簮灞曠ず moreTZ: () => import("@/components/props/moreTZ"), //绌洪棽璧勬簮灞曠ず // SurprisePlus - showMilitaryPlot: () => import("@/components/props/militaryPlot"),//鍐涗簨鏍囩粯 - situationComparison: () => import("@/components/props/situationComparison"),//鎬佸娍瀵规瘮 - occupancyAnalysis: () => import("@/components/props/occupancyAnalysis"), //棰戣氨鍗犵敤搴﹀垎鏋� + showMilitaryPlot: () => import("@/components/props/militaryPlot"), //鍐涗簨鏍囩粯 + situationComparison: () => + import("@/components/props/situationComparison"), //鎬佸娍瀵规瘮 + occupancyAnalysis: () => + import("@/components/props/occupancyAnalysis"), //棰戣氨鍗犵敤搴﹀垎鏋� densityAnalysis: () => import("@/components/props/densityAnalysis"), //鐢ㄩ瀵嗗害鍒嗘瀽 + + SC1: () => import("@/components/props/situationComparison6-1"), + SC2: () => import("@/components/props/situationComparison6-2"), + SC3: () => import("@/components/props/situationComparison6-3"), + SC4: () => import("@/components/props/situationComparison6-4"), + SC5: () => import("@/components/props/situationComparison6-5"), + SC6: () => import("@/components/props/situationComparison6-6"), + SC7: () => import("@/components/props/situationComparison6-7"), + SC8: () => import("@/components/props/situationComparison7-1"), + SC9: () => import("@/components/props/situationComparison7-2-1"), + SC10: () => import("@/components/props/situationComparison7-3-1"), + SC11: () => import("@/components/props/situationComparison7-4"), + SC12: () => import("@/components/props/situationComparison7-5"), + SC13: () => import("@/components/props/situationComparison7-6"), + SC14: () => import("@/components/props/situationComparison7-7"), + SC15: () => import("@/components/props/situationComparison7-8"), + SC16: () => import("@/components/props/situationComparison7-9"), + SC17: () => import("@/components/props/situationComparison8-1"), + SC18: () => import("@/components/props/situationComparison8-2"), + SC19: () => import("@/components/props/situationComparison8-3"), + SC20: () => import("@/components/props/situationComparison8-4"), + SC21: () => import("@/components/props/situationComparison9-1"), + SC22: () => import("@/components/props/situationComparison9-2"), + SC23: () => import("@/components/props/situationComparison9-3"), + SC24: () => import("@/components/props/situationComparison10-1"), + SC25: () => import("@/components/props/situationComparison10-2"), + SC26: () => import("@/components/props/situationComparison10-3"), + SC27: () => import("@/components/props/situationComparison10-4"), }, }); }, }, - mounted () { + mounted() { this.init(); }, }; diff --git a/src/components/wggl/left/czll.vue b/src/components/wggl/left/czll.vue index ac5f6f6..cdee1b8 100644 --- a/src/components/wggl/left/czll.vue +++ b/src/components/wggl/left/czll.vue @@ -1,12 +1,12 @@ <template> <div class="content"> - - <div class="container" - id="moved"> - <el-menu default-active="2" - :unique-opened="true" - @select="handleSelect" - class="el-menu-vertical-demo"> + <div class="container" id="moved"> + <el-menu + default-active="2" + :unique-opened="true" + @select="handleSelect" + class="el-menu-vertical-demo" + > <el-submenu index="1"> <template slot="title"> <i class="el-icon-location"></i> @@ -64,24 +64,95 @@ </template> <el-menu-item-group> <el-menu-item index="5-1">鏁版嵁鍒嗘瀽鎶ュ憡</el-menu-item> - + </el-menu-item-group> + </el-submenu> + <el-submenu index="6"> + <template slot="title"> + <i class="el-icon-location"></i> + <span>鏁版嵁璧勬簮绠$悊瀛愮郴缁�</span> + </template> + <el-menu-item-group> + <el-menu-item index="6-1">閫氱敤妯$増绠$悊</el-menu-item> + <el-menu-item index="6-2">閫氫俊璧勬簮绠$悊</el-menu-item> + <el-menu-item index="6-3">閫氫俊缃戠郴绠$悊</el-menu-item> + <el-menu-item index="6-4">閫氫俊鎯冲畾绠$悊</el-menu-item> + <el-menu-item index="6-5">澶氬獟浣撶礌鏉愮鐞�</el-menu-item> + <el-menu-item index="6-6">浠跨湡妯″瀷绠$悊</el-menu-item> + <el-menu-item index="6-7">鐢ㄦ埛绠$悊鍜岀郴缁熻缃�</el-menu-item> + </el-menu-item-group> + </el-submenu> + <el-submenu index="7"> + <template slot="title"> + <i class="el-icon-location"></i> + <span>缁煎悎鎬佸娍鏄剧ず瀛愮郴缁�</span> + </template> + <el-menu-item-group> + <el-menu-item index="7-1">zcTS\绛瑰垝姝ラ</el-menu-item> + <el-submenu index="7-2"> + <template slot="title">ZC鐜鏄剧ず</template> + <el-menu-item index="7-2-1">涓滃崡娌挎捣銆乀D</el-menu-item> + </el-submenu> + <el-submenu index="7-3"> + <template slot="title">閫氫俊鎬佸娍鏄剧ず</template> + <el-menu-item index="7-3-1">鍩虹珯銆佺洃娴嬬珯</el-menu-item> + </el-submenu> + <el-menu-item index="7-4">淇℃伅閾捐矾鏄剧ず</el-menu-item> + <el-menu-item index="7-5">浣滄垬鎬佸娍鏄剧ず</el-menu-item> + <el-menu-item index="7-6">鎯冲畾璧勬枡鏄剧ず</el-menu-item> + <el-menu-item index="7-7">鎬佸娍鏄剧ず鎺у埗</el-menu-item> + <el-menu-item index="7-8">澶氬獟浣撶礌鏉愭祻瑙�</el-menu-item> + <el-menu-item index="7-9">鎬佸娍鏍囩粯</el-menu-item> + </el-menu-item-group> + </el-submenu> + <el-submenu index="8"> + <template slot="title"> + <i class="el-icon-location"></i> + <span>閫氫俊鏂规绛瑰垝瀛愮郴缁�</span> + </template> + <el-menu-item-group> + <el-menu-item index="8-1">閫氫俊鏂规绠$悊</el-menu-item> + <el-menu-item index="8-2">閫氫俊鏂规鎷熷埗</el-menu-item> + <el-menu-item index="8-3">閫氫俊缃戠郴鏋勫缓</el-menu-item> + <el-menu-item index="8-4">閫氫俊鏂规璁茶瘎</el-menu-item> + </el-menu-item-group> + </el-submenu> + <el-submenu index="9"> + <template slot="title"> + <i class="el-icon-location"></i> + <span>閫氫俊鏁堣兘璇勪及瀛愮郴缁�</span> + </template> + <el-menu-item-group> + <el-menu-item index="9-1">閫氫俊姣佷激褰卞搷璇勪及</el-menu-item> + <el-menu-item index="9-2">閫氫俊骞叉壈褰卞搷璇勪及</el-menu-item> + <el-menu-item index="9-3">杈呭姪璁$畻鍒嗘瀽</el-menu-item> + </el-menu-item-group> + </el-submenu> + <el-submenu index="10"> + <template slot="title"> + <i class="el-icon-location"></i> + <span>浣滄垬琛屽姩褰卞搷鍒嗘瀽瀛愮郴缁�</span> + </template> + <el-menu-item-group> + <el-menu-item index="10-1">鎯呮姤閾捐矾琛屽姩褰卞搷鍒嗘瀽</el-menu-item> + <el-menu-item index="10-2">鎸囨尌閾捐矾琛屽姩褰卞搷鍒嗘瀽</el-menu-item> + <el-menu-item index="10-3">鎵撳嚮閾捐矾琛屽姩褰卞搷鍒嗘瀽</el-menu-item> + <el-menu-item index="10-4" + >淇濋殰閾捐矾琛屽姩褰卞搷鍒嗘瀽鍜岃瘎浼板垎鏋愮粨鏋滃睍绀� + </el-menu-item> </el-menu-item-group> </el-submenu> </el-menu> - </div> <div class="bot"> - - <div :class="istrue ? 'botImg1' : 'botImg'" - @mousemove="makebig" - @mouseout="makeSmall"> - <span id="img" - @click="changeMap"> + <div + :class="istrue ? 'botImg1' : 'botImg'" + @mousemove="makebig" + @mouseout="makeSmall" + > + <span id="img" @click="changeMap"> <span class="mapinner">琛楅亾鍥�</span> </span> - <span id="img1" - @click="changeMap1" - :style="move1"> + <span id="img1" @click="changeMap1" :style="move1"> <span class="mapinner1">褰卞儚鍥�</span> </span> </div> @@ -90,12 +161,12 @@ </template> <script> -let gdMap=null; +let gdMap = null; import { addMpt } from "../../../utils/work"; import bus from "../../../utils/bus"; export default { - data () { + data() { return { move1: { transform: "translateX(-230px)", @@ -113,91 +184,226 @@ }; }, methods: { - handleSelect (key,keyPath) { - var val=keyPath[1] - switch(val) { + handleSelect(key, keyPath) { + var val = keyPath[1]; + switch (val) { case "1-3": - this.nowchoose=2; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = 2; + bus.$emit("showdio", this.nowchoose); break; - case "1-2"://null - this.nowchoose=7; - bus.$emit("showdio",this.nowchoose); + case "1-2": //null + this.nowchoose = 7; + bus.$emit("showdio", this.nowchoose); break; case "1-1": - this.nowchoose=1; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = 1; + bus.$emit("showdio", this.nowchoose); break; - case "2-6"://null - this.nowchoose=8; - bus.$emit("showdio",this.nowchoose); + case "2-6": //null + this.nowchoose = 8; + bus.$emit("showdio", this.nowchoose); break; case "2-5": - this.nowchoose=3; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = 3; + bus.$emit("showdio", this.nowchoose); break; - case "2-4"://null - this.nowchoose=9; - bus.$emit("showdio",this.nowchoose); + case "2-4": //null + this.nowchoose = 9; + bus.$emit("showdio", this.nowchoose); break; - case "2-3"://null - this.nowchoose=10; - bus.$emit("showdio",this.nowchoose); + case "2-3": //null + this.nowchoose = 10; + bus.$emit("showdio", this.nowchoose); break; case "2-2": - this.nowchoose='1-4'; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = "1-4"; + bus.$emit("showdio", this.nowchoose); break; case "3-4": - this.nowchoose=5; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = 5; + bus.$emit("showdio", this.nowchoose); break; case "3-3": - this.nowchoose="1-2"; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = "1-2"; + bus.$emit("showdio", this.nowchoose); break; case "3-2": - this.nowchoose=4; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = 4; + bus.$emit("showdio", this.nowchoose); break; case "3-1": - this.nowchoose=6; - bus.$emit("showdio",this.nowchoose); + this.nowchoose = 6; + bus.$emit("showdio", this.nowchoose); + break; + + case "4-1": + this.nowchoose = "4-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "4-2": + this.nowchoose = "4-2"; + bus.$emit("showdio", this.nowchoose); + break; + case "4-3": + this.nowchoose = "4-3"; + bus.$emit("showdio", this.nowchoose); + break; + case "4-4": + this.nowchoose = "4-4"; + bus.$emit("showdio", this.nowchoose); + break; + case "4-5": + this.nowchoose = "4-5"; + bus.$emit("showdio", this.nowchoose); + break; + case "5-1": + this.nowchoose = "5-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "6-1": + this.nowchoose = "6-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "6-2": + this.nowchoose = "6-2"; + bus.$emit("showdio", this.nowchoose); + break; + case "6-3": + this.nowchoose = "6-3"; + bus.$emit("showdio", this.nowchoose); + break; + case "6-4": + this.nowchoose = "6-4"; + bus.$emit("showdio", this.nowchoose); + break; + case "6-5": + this.nowchoose = "6-5"; + bus.$emit("showdio", this.nowchoose); + break; + case "6-6": + this.nowchoose = "6-6"; + bus.$emit("showdio", this.nowchoose); + break; + case "6-7": + this.nowchoose = "6-7"; + bus.$emit("showdio", this.nowchoose); + break; + + case "7-1": + this.nowchoose = "7-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-2-1": + this.nowchoose = "7-2-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-3-1": + this.nowchoose = "7-3-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-4": + this.nowchoose = "7-4"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-5": + this.nowchoose = "7-5"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-6": + this.nowchoose = "7-6"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-7": + this.nowchoose = "7-7"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-8": + this.nowchoose = "7-8"; + bus.$emit("showdio", this.nowchoose); + break; + case "7-9": + this.nowchoose = "7-9"; + bus.$emit("showdio", this.nowchoose); + break; + case "8-1": + this.nowchoose = "8-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "8-2": + this.nowchoose = "8-2"; + bus.$emit("showdio", this.nowchoose); + break; + case "8-3": + this.nowchoose = "8-3"; + bus.$emit("showdio", this.nowchoose); + break; + case "8-4": + this.nowchoose = "8-4"; + bus.$emit("showdio", this.nowchoose); + break; + case "9-1": + this.nowchoose = "9-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "9-2": + this.nowchoose = "9-2"; + bus.$emit("showdio", this.nowchoose); + break; + case "9-3": + this.nowchoose = "9-3"; + bus.$emit("showdio", this.nowchoose); + break; + case "10-1": + this.nowchoose = "10-1"; + bus.$emit("showdio", this.nowchoose); + break; + case "10-2": + this.nowchoose = "10-2"; + bus.$emit("showdio", this.nowchoose); + break; + case "10-3": + this.nowchoose = "10-3"; + bus.$emit("showdio", this.nowchoose); + break; + case "10-4": + this.nowchoose = "10-4"; + bus.$emit("showdio", this.nowchoose); break; } - },makebig () { - this.istrue=false; - this.move1.transform="translateX(0px)"; }, - makeSmall () { - this.istrue=true; - this.move1.transform="translateX(-230px)"; + makebig() { + this.istrue = false; + this.move1.transform = "translateX(0px)"; }, - changeMap1 () { - Viewer.imageryLayers._layers[0].show=true; + makeSmall() { + this.istrue = true; + this.move1.transform = "translateX(-230px)"; + }, + changeMap1() { + Viewer.imageryLayers._layers[0].show = true; addMpt(true); - if(gdMap) { + if (gdMap) { gdMap.setVisibility(false); - this.move1["z-index"]=2; + this.move1["z-index"] = 2; } else { return; } }, - changeMap () { - this.move1["z-index"]=0; - Viewer.imageryLayers._layers[0].show=false; + changeMap() { + this.move1["z-index"] = 0; + Viewer.imageryLayers._layers[0].show = false; addMpt(false); - if(gdMap) { + if (gdMap) { gdMap.setVisibility(true); } else { - var base={ + var base = { url: "https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer", enablePickFeatures: false, usePreCachedTilesIfAvailable: false, // 鏄惁浣跨敤鏈嶅姟鐨勫唴缃殑鍒囩墖鏂规锛屽亸绉荤籂姝i渶瑕佷娇鐢ㄥ涓嬭嚜瀹氫箟鐨勬柟妗� tilingScheme: sgworld.Core.getOffsetTilingScheme(), // 鍋忕Щ绾犳 }; - gdMap=sgworld.Creator.createArcGisImageryLayer( + gdMap = sgworld.Creator.createArcGisImageryLayer( "琛楅亾", base, "0", @@ -205,16 +411,16 @@ true, "" ); - this.isshowGD=true; + this.isshowGD = true; } }, - - },mounted () { - bus.$on("showindex",(e) => { - if(this.boxindex==e) { - this.boxindex=0; + }, + mounted() { + bus.$on("showindex", (e) => { + if (this.boxindex == e) { + this.boxindex = 0; } else { - this.boxindex=e; + this.boxindex = e; } }); }, -- Gitblit v1.9.3