|
|
|
|
@ -195,14 +195,15 @@
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-card shadow="always" style="margin-top: 12px;">
|
|
|
|
|
<div v-for="i in list" style="margin-bottom: 12px;">
|
|
|
|
|
<el-input disabled v-model="i.value1" style="width: 200px"/>
|
|
|
|
|
<el-input disabled v-model="i.value2" style="width: 200px;margin-left: 20px;"/>
|
|
|
|
|
<el-button type="primary" @click="onSubmit" style=" margin-left: 20px;">获取</el-button>
|
|
|
|
|
<div v-for="(i,k) in points" style="margin-bottom: 12px;">
|
|
|
|
|
<el-input disabled v-model="i.name" style="width: 100px"/>
|
|
|
|
|
<el-input v-model="i.lon" style="width: 150px;margin-left: 20px;"/>
|
|
|
|
|
<el-input v-model="i.lat" style="width: 150px;margin-left: 20px;"/>
|
|
|
|
|
<el-button type="primary" @click="getPoint(k)" style=" margin-left: 20px;">获取</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
<div style="text-align: center;margin-top: 12px;">
|
|
|
|
|
<el-button type="primary" @click="onSubmit" style=" margin-left: 20px;">提交</el-button>
|
|
|
|
|
<el-button type="primary" @click="savePoint" style=" margin-left: 20px;">提交</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="itemsId === 3" class="tabsItem">
|
|
|
|
|
@ -474,6 +475,30 @@ let area = {
|
|
|
|
|
"LonMax": 120.39109582218,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const points = ref([
|
|
|
|
|
{
|
|
|
|
|
lon: 120.38532472236,
|
|
|
|
|
lat: 36.14505053622,
|
|
|
|
|
name: '点位1',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
lon: 120.38532472236,
|
|
|
|
|
lat: 36.15302618219,
|
|
|
|
|
name: '点位2',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
lon: 120.39109582218,
|
|
|
|
|
lat: 36.15302618219,
|
|
|
|
|
name: '点位3',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
lon: 120.39109582218,
|
|
|
|
|
lat: 36.14505053622,
|
|
|
|
|
name: '点位4',
|
|
|
|
|
},
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const list = ref([
|
|
|
|
|
{
|
|
|
|
|
value1: '点位1',
|
|
|
|
|
@ -545,6 +570,8 @@ const setItemsId = (e) => {
|
|
|
|
|
itemsId.value = e
|
|
|
|
|
}
|
|
|
|
|
const locationData = ref({})
|
|
|
|
|
const currentPosition = ref({})
|
|
|
|
|
|
|
|
|
|
const processData = (data) => {
|
|
|
|
|
// console.log('data',data.ty)
|
|
|
|
|
console.log('FodName', data.FodName)
|
|
|
|
|
@ -559,6 +586,10 @@ const processData = (data) => {
|
|
|
|
|
if (data.ty === 3) {
|
|
|
|
|
}
|
|
|
|
|
if (data.ty === 4) {
|
|
|
|
|
currentPosition.value = {
|
|
|
|
|
lon: data.Longitude,
|
|
|
|
|
lat: data.Latitude,
|
|
|
|
|
}
|
|
|
|
|
// console.log(data.Longitude > area.LonMin, data.Longitude < area.LonMax, data.Latitude > area.LatMin, data.Latitude < area.LatMax)
|
|
|
|
|
if (data.Longitude > area.LonMin && data.Longitude < area.LonMax && data.Latitude > area.LatMin && data.Latitude < area.LatMax) {
|
|
|
|
|
let location = {
|
|
|
|
|
@ -711,7 +742,32 @@ const RestartWorkBtn = () => {
|
|
|
|
|
const ShutDownWorkBtn = () => {
|
|
|
|
|
ShutDownWork()
|
|
|
|
|
}
|
|
|
|
|
const getPoint = (k) => {
|
|
|
|
|
points.value[k].lon = currentPosition.value.lon
|
|
|
|
|
points.value[k].lat = currentPosition.value.lat
|
|
|
|
|
}
|
|
|
|
|
const savePoint = () => {
|
|
|
|
|
let data = points.value
|
|
|
|
|
|
|
|
|
|
let latMin = data[0].lat;
|
|
|
|
|
let latMax = data[0].lat;
|
|
|
|
|
let lonMin = data[0].lon;
|
|
|
|
|
let lonMax = data[0].lon;
|
|
|
|
|
|
|
|
|
|
for (let i = 1; i < data.length; i++) {
|
|
|
|
|
const p = data[i];
|
|
|
|
|
if (p.lat < latMin) latMin = p.lat;
|
|
|
|
|
if (p.lat > latMax) latMax = p.lat;
|
|
|
|
|
if (p.lon < lonMin) lonMin = p.lon;
|
|
|
|
|
if (p.lon > lonMax) lonMax = p.lon;
|
|
|
|
|
}
|
|
|
|
|
area = {
|
|
|
|
|
LatMin: latMin,
|
|
|
|
|
LatMax: latMax,
|
|
|
|
|
LonMin: lonMin,
|
|
|
|
|
LonMax: lonMax,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.app-container {
|
|
|
|
|
|