任务下发

master
刘妍 2023-08-14 09:36:35 +08:00
parent 1ccfe7ab44
commit cb97f2981b
2 changed files with 335 additions and 2 deletions

View File

@ -145,6 +145,10 @@
<div class="report" v-if="appTools['reportbox']">
<reportbox @getAllReportList="getAllReportList"></reportbox>
</div>
<!-- 任务下发 -->
<div class="task" v-if="taskDeliveryShow">
<taskDelivery @closeTask="closeTask" :globalmap="globalmap" :lng="lng" :lat="lng"></taskDelivery>
</div>
<!-- 脚部 -->
<div class="footer">
<div class="base-layer-change-button" @click="addTileLayer('vec_d')"></div>
@ -176,6 +180,7 @@ import gridbox from './widget/gridbox.vue';
import LCmonitorbox from './widget/LCmonitorbox.vue'
import HKmonitorbox from './widget/HKmonitorbox.vue'
import personnel from './widget/personnel.vue';
import taskDelivery from './widget/taskDelivery.vue'
import axios from 'axios';
import jQuery from 'jquery';
import { mask } from '@turf/turf';
@ -200,7 +205,8 @@ export default {
LCmonitorbox,
HKmonitorbox,
mergebox,
personnel
personnel,
taskDelivery
},
data() {
@ -251,6 +257,7 @@ export default {
checkList:[],
mergeboxShow:false,
mergeSuccessRandom:1,
taskDeliveryShow:true,
}
},
@ -282,6 +289,9 @@ export default {
window.lookMonitorByMonitorLayer = this.lookMonitorByMonitorLayer
},
methods: {
closeTask(){
this.taskDeliveryShow = false
},
mergeSuccess(){
this.mergeboxShow = false;
@ -646,7 +656,13 @@ export default {
top:130px;
left:25px;
}
.task{
width: 480px;
height: calc( 100vh - 600px);
position: absolute;
top: 130px;
left: 290px;
}
.tools-box{
width:250px;
height:100%;

View File

@ -0,0 +1,317 @@
<template>
<div class="box">
<div class="box-title">下发任务</div>
<div class="box-container">
<div class="inputer">
<span>位置</span>
<el-input size="mini" style="width:256px;" v-model="location"></el-input>
<el-button icon="el-icon-location-outline" size="mini" type="primary"
style="float:left;position:relative;left:4px;" @click="initDrawLayer()"></el-button>
</div>
<div class="inputer">
<span>任务详情</span>
<el-input type="textarea" :rows="6" style="width:300px;" placeholder="请输入内容" v-model="content">
</el-input>
</div>
</div>
<div style="text-align:right;margin:0px 28px;">
<el-button size="mini" @click="close"></el-button>
<el-button type="primary" size="mini" @click="onSubmit"></el-button>
</div>
</div>
</template>
<script>
import axios from 'axios'
import { parse } from '../lib/handleGeojson';
export default {
name: 'taskDelivery',
props: ['globalmap','lng','lat'],
data() {
return {
location: '',
content: '',
pathPointGraphicLayer: null,
}
},
watch: {
},
created() {
},
mounted() {
},
methods: {
initDrawLayer() { //
this.pathPointGraphicLayer = new mars3d.layer.GraphicLayer({
name: "标绘图层",
id: 10101,
isRestorePositions: true,
hasEdit: true,
isAutoEditing: true //
})
this.globalmap.addLayer(this.pathPointGraphicLayer)
// layer
let _this = this;
this.pathPointGraphicLayer.on(mars3d.EventType.click, function (e) {
_this.showEditor(e)
})
this.pathPointGraphicLayer.on(mars3d.EventType.drawCreated, function (e) {
})
this.pathPointGraphicLayer.on(mars3d.EventType.editStop, function (e) {
mars3d.widget.disable("widgets/plotAttr/widget.js")
})
this.drawMarker()
},
drawMarker() { //
var img = '/img/homeimg/5.png';
this.pathPointGraphicLayer.startDraw({
type: "billboard",
style: {
scale: 0.6,
clampToGround: true,
image: img,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
}
})
},
showEditor(e) {
var graphic = e.graphic
const cartesian = e.cartesian
const point = mars3d.LngLatPoint.fromCartesian(cartesian)
point.format()
this.location = point.lng + "," + point.lat;
this.lng = point.lng
this.lat = point.lat
if (!graphic._conventStyleJson) {
graphic.options.style = graphic.toJSON().style //json
graphic._conventStyleJson = true //
}
var plotAttr = mars3d.widget.getClass("widgets/plotAttr/widget.js")
if (plotAttr && plotAttr.isActivate) {
plotAttr.startEditing(graphic, graphic.coordinates)
} else {
mars3d.widget.activate({
map: this.globalmap,
uri: "widgets/plotAttr/widget.js",
name: "属性编辑",
graphic: graphic,
lonlats: graphic.coordinates
})
}
},
bindMapClick(type) { //
if (this.pathPointGraphicLayer == null) {
this.pathPointGraphicLayer = new mars3d.layer.GraphicLayer();
this.globalmap.addLayer(this.pathPointGraphicLayer);
}
let _this = this;
this.globalmap.setCursor(true)
this.globalmap.on(mars3d.EventType.click, function (event) {
_this.globalmap.setCursor(false)
const cartesian = event.cartesian
const point = mars3d.LngLatPoint.fromCartesian(cartesian)
point.format()
_this.location = point.lng + "," + point.lat;
_this.drawPoint(type, point.lng, point.lat, point.z);
})
},
drawPoint(type, lng, lat, z) { //
let image = '/img/homeimg/5.png';
this.pathPointGraphicLayer.clear();
var graphic = new mars3d.graphic.BillboardEntity({
position: [lng, lat, z],
style: {
image: image,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
clampToGround: true
},
attr: { remark: '任务点' }
})
this.pathPointGraphicLayer.addGraphic(graphic) //
},
close() {
if (this.pathPointGraphicLayer != null) {
this.pathPointGraphicLayer.clear();
this.globalmap.off(mars3d.EventType.click)
}
this.$emit('closeTask')
},
onSubmit() {
var querys = {
content: this.content,
lng: this.lng,
lat: this.lat,
}
if(this.lng == ''){
this.$message.warning("请选择位置");
return;
}
var url = process.env.VUE_APP_BASE_API + '/FireManagement/FireClueTask'
var _this = this
axios({
method: "post",
url: url,
data: querys,
headers: {
'X-Token': localStorage.getItem("X-Token")
}
}).then(res => {
if (res.data.code == 200) {
console.log(res)
this.$message.success(res.data.msg);
_this.close()
}else{
this.$message.success(res.data.msg);
}
})
}
}
}
</script>
<style scoped>
.box {
width: 100%;
height: 100%;
background-image: url(/img/huoqing-bg.png);
background-size: 100% 100%;
}
.box-container {
width: calc(100% - 0px);
padding: 0px 12px;
height: calc(100% - 100px);
}
.box-title {
width: 100%;
height: 45px;
line-height: 45px;
color: #fff;
text-indent: 30px;
text-align: left;
}
.tab-container {
width: 210px;
height: 60px;
border-bottom: 1px solid #2F5D55;
padding-top: 10px;
margin: 0px auto;
}
.inputer {
width: 84%;
margin: 0px auto;
line-height: 40px;
color: #fff;
display: flex;
align-items: center;
justify-content: flex-end;
}
::v-deep .el-input__inner {
background: none;
border-color: #00fff0;
color: #fff;
}
::v-deep .el-textarea__inner {
background: none;
border-color: #00fff0;
color: #fff;
}
.upload-iocn-box {
width: 240px;
height: 210px;
float: left;
text-align: center;
position: relative;
margin-top: 25px;
margin-left: 10px;
}
.upload-icon-bg {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
background: #193632;
z-index: 2;
}
.upload-iocn-box::after {
content: "";
width: 40px;
height: 40px;
background: #00fff0;
position: absolute;
top: -3px;
left: -3px;
z-index: 1;
border-radius: 1px;
}
.upload-iocn-box::before {
content: "";
width: 40px;
height: 40px;
background: #00fff0;
position: absolute;
top: -3px;
right: -3px;
border-radius: 1px;
z-index: 1;
}
.upload-icon-bg2::after {
content: "";
width: 40px;
height: 40px;
background: #00fff0;
position: absolute;
bottom: -3px;
left: -3px;
border-radius: 1px;
z-index: 1;
}
.upload-icon-bg2::before {
content: "";
width: 40px;
height: 40px;
background: #00fff0;
position: absolute;
bottom: -3px;
right: -3px;
border-radius: 1px;
z-index: 1;
}
.upload-iocn-box img {
width: 80px;
}
.upload-iocn {
margin-top: 10px;
}
.upload-icon-text {
font-size: 14px;
color: #ccc;
margin: 16px 0px;
}
</style>