<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="item.vlatlngs"
|
>
|
</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.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-item label="门限">
|
<el-input v-model="form.threshold" style="width: 80%">
|
<i slot="suffix" style="margin-right: 10px; font-size: 35px"
|
>dBμV/m</i
|
>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="网格大小">
|
<el-select v-model="form.gridval">
|
<el-option
|
v-for="item in wgsize"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></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>
|
<changePic @colordata="getdata" />
|
</div>
|
</template>
|
|
<script>
|
import {
|
intensity,
|
getbounds,
|
createPic,
|
picurl,
|
getVectorList,
|
getRadio,
|
freqUsageAnalysis,
|
} from "../../api/http";
|
import changePic from "../common/color.vue";
|
import bus from "../../utils/bus";
|
|
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",
|
gridval: "5倍",
|
threshold: 100,
|
},
|
showsituation: false,
|
imageid: null,
|
showpic: false,
|
pickerOptions: {},
|
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,
|
wgsize: [
|
{
|
value: "1",
|
label: "1倍",
|
},
|
{
|
value: "2",
|
label: "2倍",
|
},
|
{
|
value: "3",
|
label: "3倍",
|
},
|
{
|
value: "5",
|
label: "5倍",
|
},
|
{
|
value: "10",
|
label: "10倍",
|
},
|
{
|
value: "20",
|
label: "20倍",
|
},
|
{
|
value: "50",
|
label: "50倍",
|
},
|
{
|
value: "100",
|
label: "100倍",
|
},
|
{
|
value: "500",
|
label: "500倍",
|
},
|
{
|
value: "1000",
|
label: "1000倍",
|
},
|
],
|
};
|
},
|
mounted() {
|
bus.$on("clearEve", (e) => {
|
this.reset();
|
});
|
bus.$on("radioData", (e) => {
|
this.radios = e;
|
});
|
bus.$on("areaData", (e) => {
|
this.regions = e;
|
});
|
bus.$on("showdio", (e) => {
|
this.showsituation = e == "1-4";
|
this.showdata1 = true;
|
this.showdata2 = true;
|
});
|
},
|
methods: {
|
changeplase(value) {
|
if (JSON.parse(value)[0][1] < 118) {
|
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;
|
},
|
analysis() {
|
this.reset();
|
let that = this;
|
if (that.imageid) {
|
window.Viewer.entities.removeById(that.imageid);
|
that.imageid = null;
|
}
|
let data = {
|
colorName:
|
"-9999,b0070e;10,ff0000;20,cc5600;30,cc8100;40,ffc125;50,ffff00;60,99ff00;70,32ff00;80,00ff00;90,00ac00;100,008100;",
|
endtime: 20190312300000,
|
freqEnd: 108000000,
|
freqStart: 87000000,
|
gridval: 5,
|
points: "",
|
radius: 0,
|
starttime: 20130408000000,
|
statisicSection:
|
'[{"name":"rich","from":"80","to":"10000"},{"name":"tense","from":"-10000","to":"20"},{"name":"normal","from":"20","to":"80"}]',
|
threshold: 100,
|
};
|
data = { ...data, ...this.form };
|
data.freqStart = data.freqStart + "000000";
|
data.freqEnd = data.freqEnd + "000000";
|
data.starttime = data.starttime + "000000";
|
data.endtime = data.endtime + "000000";
|
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);
|
}
|
data.gridval = data.gridval.indexOf("倍") > -1 ? 5 : data.gridval;
|
const loading = that.$loading({
|
lock: true,
|
text: "计算中",
|
spinner: "el-icon-loading",
|
background: "rgba(0, 0, 0, 0.7)",
|
});
|
freqUsageAnalysis(data)
|
.then((res) => {
|
if (res.message === "Success") {
|
let points = res.data.imgBounds;
|
var data1 = {
|
colorSchemes: 1,
|
file: Base64.encode(res.data.resultpath),
|
showBounds: this.form.points,
|
jsonStr:
|
"0_10_20_30_40_50_60_70_80_90_100_;b0070e_ff0000_cc5600_cc8100_ffc125_ffff00_99ff00_32ff00_00ff00_00ac00_008100_",
|
};
|
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),
|
});
|
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);
|
this.imageid = null;
|
}
|
},
|
},
|
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: 1200px;
|
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: 0 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/subject/可用频率.png);
|
background-position: center;
|
background-size: 100% 100%;
|
position: absolute;
|
top: 1200px;
|
right: 0px;
|
}
|
</style>
|