<template>
|
<div class="bot" v-if="showfield">
|
<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="区域:" prop="name">
|
<el-select v-model="form.points" placeholder="请选择活动区域" @change="changeplase">
|
<el-option
|
v-for="(item, index) in region"
|
:key="index"
|
:label="item.vname"
|
:value="item.vlatlngs"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="起始时间" prop="starttime">
|
<el-date-picker
|
v-model="form.starttime"
|
:picker-options="pickerOptions"
|
@change="change"
|
format="yyyy-MM-dd"
|
placeholder="选择日期"
|
type="date"
|
value-format="yyyyMMddHHmmss"
|
></el-date-picker>
|
</el-form-item>
|
<el-form-item label="结束时间" prop="endtime">
|
<el-date-picker
|
v-model="form.endtime"
|
:picker-options="pickerOptions"
|
@change="change1"
|
format="yyyy-MM-dd"
|
placeholder="选择日期"
|
type="date"
|
value-format="yyyyMMddHHmmss"
|
></el-date-picker>
|
</el-form-item>
|
<el-form-item label="无线电业务:" prop="name">
|
<el-select
|
@change="choose"
|
v-model="form.functionID"
|
placeholder="请选择活动区域"
|
>
|
<el-option
|
v-for="(item1, index) in radio"
|
:key="index"
|
:label="item1.bussName"
|
:value="item1.startFreq + '-' + item1.endFreq"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="门限:">
|
<el-input v-model="form.threshold">
|
<i slot="suffix" style="margin-right: 10px; font-size: 35px"
|
>dBμV/m</i
|
>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="网格倍数:">
|
<el-input v-model="form.gridval"></el-input>
|
</el-form-item>
|
<el-form-item label="频率范围:">
|
<el-input v-model="form.freqStart" style="width: 270px">
|
<i slot="suffix" style="margin-right: 10px; font-size: 35px">MHz</i>
|
</el-input>
|
<span style="font-size: 40px">-</span>
|
<el-input v-model="form.freqEnd" style="width: 270px">
|
<i slot="suffix" style="margin-right: 10px; font-size: 35px">MHz</i>
|
</el-input>
|
</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 { getbounds, createPic, FrequencyBand } from "../../api/http";
|
import bus from "../../utils/bus";
|
|
import changePic from "../common/color.vue";
|
let Base64 = require("js-base64").Base64;
|
export default {
|
components: {
|
changePic,
|
},
|
data() {
|
return {
|
form: {
|
points: "",
|
functionID: "",
|
threshold: "60",
|
starttime: new Date("2016-06-01"),
|
endtime: new Date("2016-06-30"),
|
gridval: "5",
|
freqStart: "",
|
freqEnd: "",
|
},
|
colorContainer: {},
|
region: "",
|
pickerOptions: {},
|
showfield: false,
|
imageid: null,
|
showpic: false,
|
radio: "",
|
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,
|
};
|
},
|
mounted() {
|
bus.$on("clearEve", (e) => {
|
this.reset();
|
});
|
bus.$on("areaData", (e) => {
|
this.region = e;
|
});
|
bus.$on("radioData", (e) => {
|
this.radio = e;
|
});
|
bus.$on("showdio", (e) => {
|
this.showfield = e == 3;
|
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);
|
},
|
getdata(data) {
|
this.colorContainer = data;
|
},
|
choose(value) {
|
let arr = value.split("-");
|
this.form.freqStart = arr[0];
|
this.form.freqEnd = arr[1];
|
},
|
close() {
|
this.showfield = false;
|
},
|
analysis() {
|
if (this.imageid) {
|
window.Viewer.entities.removeById(this.imageid);
|
this.imageid = null;
|
}
|
var that = this;
|
|
//频段占用分布图
|
let data_pd = {
|
colorName: "-100,0000FF;120,FF0000",
|
freqStart: 87000000,
|
freqEnd: 108000000,
|
starttime: 20160601000000,
|
endtime: 20160630000000,
|
points:
|
"[[31.1140916,121.2643433],[31.3641911,121.2643433],[31.3641911,121.6488647],[31.1140916,121.6488647]]",
|
radius: 0,
|
gridval: 5,
|
threshold: 60,
|
analysisType: "2",
|
analysisAction: "5",
|
functionID: "SpectrumAna",
|
};
|
let obj;
|
obj = { ...data_pd, ...that.form };
|
obj.functionID = data_pd.functionID;
|
obj.freqStart = obj.freqStart + "000000";
|
obj.freqEnd = obj.freqEnd + "000000";
|
if (this.showdata1) {
|
obj.starttime = 20160601000000;
|
this.chooseplase && this.chooseplase == "上海"
|
? (obj.starttime = 20160601000000)
|
: (obj.starttime = 20191008000000);
|
}
|
if (this.showdata2) {
|
obj.endtime = 20160630000000;
|
this.chooseplase && this.chooseplase == "上海"
|
? (obj.endtime = 20160630000000)
|
: (obj.endtime = 20191016000000);
|
}
|
|
const loading = that.$loading({
|
lock: true,
|
text: "计算中",
|
spinner: "el-icon-loading",
|
background: "rgba(0, 0, 0, 0.7)",
|
});
|
FrequencyBand(obj)
|
.then((res) => {
|
if (res.message === "Success") {
|
getbounds({ file: Base64.encode(res.data.url) })
|
.then((res1) => {
|
if (res1.message === "Success") {
|
let points = res1.data.points;
|
let datapic = {
|
colorSchemes: 1,
|
file: Base64.encode(res.data.url),
|
maxColor: "FF0000",
|
maxValue: 100,
|
minColor: "0000FF",
|
minValue: 0,
|
showBounds: this.form.points,
|
};
|
datapic = { ...datapic, ...this.colorContainer };
|
createPic(datapic)
|
.then((res2) => {
|
if (res2.message === "Success") {
|
that.showpic = true;
|
let rectangle = sgworld.Creator.addSimpleGraphic(
|
"rectangle",
|
{
|
removeEdit: true,
|
coordinates: Cesium.Rectangle.fromDegrees(
|
points[0].x,
|
points[0].y,
|
points[1].x,
|
points[1].y
|
),
|
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;
|
|
window.Viewer.camera.flyTo({
|
destination: rec,
|
});
|
|
loading.close();
|
that.$message({
|
message: "计算成功",
|
type: "success",
|
});
|
}
|
})
|
.catch((error) => {
|
loading.close();
|
});
|
}
|
})
|
.catch((error) => {
|
loading.close();
|
});
|
}
|
})
|
.catch((error) => {
|
loading.close();
|
});
|
obj = {};
|
},
|
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;
|
transform: translate(1800px, 200px);
|
height: 1150px;
|
background: url(~@/assets/image/test/22.png);
|
background-size: 100% 100%;
|
background-repeat: no-repeat;
|
position: absolute;
|
left: 2120px;
|
top: 480px;
|
}
|
.top1 {
|
width: 96%;
|
height: 10%;
|
font-size: 40px;
|
font-weight: bold;
|
margin: 0px auto;
|
border-bottom: 2px solid #fff;
|
color: #fff;
|
letter-spacing: 3px;
|
}
|
.icon {
|
position: absolute;
|
left: 60px;
|
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: 100px;
|
}
|
.close {
|
position: absolute;
|
font-size: 50px;
|
right: 60px;
|
top: 25px;
|
font-weight: 400;
|
}
|
.close:hover {
|
color: red;
|
transition: color 1s;
|
cursor: pointer;
|
}
|
.next {
|
width: 89%;
|
height: 79%;
|
margin: 0px auto;
|
transform: translateY(20px);
|
}
|
.next >>> .el-form-item {
|
margin-top: 40px;
|
}
|
.next >>> .el-input {
|
width: 560px;
|
}
|
.next >>> .el-date-editor {
|
width: 560px;
|
}
|
.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: 50px;
|
width: 100%;
|
height: 70px;
|
transform: translateX(-0px);
|
display: flex;
|
justify-content: center;
|
}
|
.btns > span {
|
display: block;
|
width: 200px;
|
height: 70px;
|
border: 1px solid #000;
|
text-align: center;
|
margin: 0 40px;
|
font-size: 35px;
|
line-height: 70px;
|
cursor: pointer;
|
}
|
.btns >>> .el-date-table__row {
|
color: #000 !important;
|
}
|
.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: 50px;
|
}
|
</style>
|