Browse Source

mc

tags/v1.2.0
lixin 1 year ago
parent
commit
5d1d1b3926
6 changed files with 133 additions and 18 deletions
  1. +16
    -9
      src/api/dashboard/index.js
  2. BIN
      src/assets/gis/images/hzyj_select.png
  3. BIN
      src/assets/gis/images/hzyj_unselect.png
  4. BIN
      src/assets/gis/images/slxj_select.png
  5. BIN
      src/assets/gis/images/slxj_unselect.png
  6. +117
    -9
      src/views/dashboard/components/OneMap.vue

+ 16
- 9
src/api/dashboard/index.js View File

@@ -4,7 +4,7 @@ import { defAxios as request } from '@/utils/http'
* @description: 获取巡检机场
* @return {*}
*/
export function airportList (params) {
export function airportList(params) {
return request({
url: '/inspection/airport',
method: 'GET',
@@ -16,7 +16,7 @@ export function airportList (params) {
* @description: 获取航线
* @return {*}
*/
export function airportLine (id) {
export function airportLine(id) {
return request({
url: `/inspection/airport/line/${id}`,
method: 'GET'
@@ -28,7 +28,7 @@ export function airportLine (id) {
* @param {*} id 机场id
* @return {*}
*/
export function airportWeather (id) {
export function airportWeather(id) {
return request({
url: `/inspection/airport/weather/${id}`,
method: 'GET'
@@ -40,7 +40,7 @@ export function airportWeather (id) {
* @param {*} id 机场id
* @return {*}
*/
export function airportTrack (id) {
export function airportTrack(id) {
return request({
url: `/inspection/track/${id}`,
method: 'GET'
@@ -52,7 +52,7 @@ export function airportTrack (id) {
* @param {*} id 机场id
* @return {*}
*/
export function missionLive (id) {
export function missionLive(id) {
return request({
url: `/mission/live/${id}`,
method: 'GET'
@@ -62,7 +62,7 @@ export function missionLive (id) {
* @description:获取机场详细信息
* @param id 机场id
*/
export function getAirportInfo (data) {
export function getAirportInfo(data) {
return request({
url: `/index/getAirportDetail`,
method: 'POST',
@@ -74,7 +74,7 @@ export function getAirportInfo (data) {
* @param page 页数
* @param limit 每页显示数
*/
export function getMissionList (data) {
export function getMissionList(data) {
return request({
url: `/index/getMissionList`,
method: 'POST',
@@ -85,7 +85,7 @@ export function getMissionList (data) {
* @description:获取问题多选类型
*
*/
export function getQuestionType () {
export function getQuestionType() {
return request({
url: `/question/type`,
method: 'GET'
@@ -94,10 +94,17 @@ export function getQuestionType () {
/**
* @description:获取问题列表数据
*/
export function getQuestionList (data) {
export function getQuestionList(data) {
return request({
url: `/index/getQuestionList`,
method: 'POST',
data
})
}

export function warehouseList() {
return request({
url: '/warehouse/list',
method: 'GET'
})
}

BIN
src/assets/gis/images/hzyj_select.png View File

Before After
Width: 38  |  Height: 38  |  Size: 612B

BIN
src/assets/gis/images/hzyj_unselect.png View File

Before After
Width: 38  |  Height: 38  |  Size: 479B

BIN
src/assets/gis/images/slxj_select.png View File

Before After
Width: 38  |  Height: 38  |  Size: 666B

BIN
src/assets/gis/images/slxj_unselect.png View File

Before After
Width: 38  |  Height: 38  |  Size: 467B

+ 117
- 9
src/views/dashboard/components/OneMap.vue View File

@@ -10,6 +10,28 @@
<problem-info :detail="problemDetail" />
</div>

<!-- 模式选择 -->
<div class="mode-select">
<!-- 火灾预警 -->
<div class="mode" style="float: left" @click="selectFire">
<span
class="fire-waring"
:class="[modeIndex == 0 ? 'select' : 'unselect']"
/>
<p class="mode-text" :class="[modeIndex == 0 ? 'select' : 'unselect']">火灾预警</p>
</div>

<!-- 森林巡检 -->
<div class="mode" style="float: right" @click="selectForest">
<span
class="forest-patrol"
:class="[modeIndex == 1 ? 'select' : 'unselect']"
/>
<p class="mode-text" :class="[modeIndex == 1 ? 'select' : 'unselect']">森林巡检</p>
</div>

</div>

<div v-show="listChecked" class="menu">
<div class="tabBar">
<span
@@ -25,7 +47,7 @@
</div>
<div v-if="tabIndex == 1" class="listDetail">
<ul style="user-select: none;">
<li
<li
v-for="(item, index) in taskList"
:key="index"
style="font-size: 14px"
@@ -150,7 +172,8 @@ import {
airportList,
getMissionList,
getQuestionType,
getQuestionList
getQuestionList,
warehouseList
} from '@/api/dashboard/index.js'
import { getQuestions } from '@/api/task/index.js'
import { gcj02towgs84 } from '@/utils/coordinate-util.js'
@@ -218,7 +241,8 @@ export default {
problemLayerList: [],
airportPopupShow: false,
times: null,
paginationShow: false
paginationShow: false,
modeIndex: 0 // 模块选择
})
watch(
() => data.page,
@@ -244,7 +268,8 @@ export default {
const tdtImgMap = new Tile({
visible: true,
source: new XYZ({
url: 'https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=f634525a82da65f715d168d7ba1899c0'
url: 'https://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=6&x={x}&y={y}&z={z}'
// url: 'https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=f634525a82da65f715d168d7ba1899c0'
})
})
var wmsSource = new Tile({
@@ -285,6 +310,25 @@ export default {
// autoPan: true,
offset: [10, 10]
})

loadWarehouse()
}

const selectFire = () => {
data.modeIndex = 0
}

const selectForest = () => {
data.modeIndex = 1
}

const loadWarehouse = async function() {
const res = await warehouseList()
// 接口请求成功
if (res.code === 0) {
const warehouse = res.data
console.log(warehouse)
}
}

/**
@@ -310,10 +354,13 @@ export default {
if (data.airportsAll.length > 0) {
for (let i = 0; i < data.airportsAll.length; i++) {
const airport = data.airportsAll[i]
const lngLat = gcj02towgs84(
parseFloat(airport.longitude),
parseFloat(airport.latitude)
)
// const lngLat = gcj02towgs84(
// parseFloat(airport.longitude),
// parseFloat(airport.latitude)
// )
const lngLat =
[parseFloat(airport.longitude),
parseFloat(airport.latitude)]
const feature = new Feature({
geometry: new Point(fromLonLat(lngLat))
})
@@ -755,7 +802,9 @@ export default {
})
},
handleNegativeClick() {},
liveShow
liveShow,
selectFire,
selectForest
}
}
}
@@ -904,4 +953,63 @@ export default {
.n-pagination-item.n-pagination-item--disabled.n-pagination-item--button) {
background-color: rgba(0, 0, 0, 0) !important;
}

.mode-select {
width: 142px;
height: 66px;
position: absolute;
left: 15px;
top: 15px;
}

.mode-select .mode{
width: 66px;
height: 66px;
border-radius: 3px;
background: rgba(0, 0, 0, 1);
cursor: pointer;
}
.mode-select span {
width: 38px;
height: 38px;
display: inline-block;
position: relative;
left: 14px;
top: 5px;
background-size: 100% 100%;
background-repeat: no-repeat;
}

.mode-text{
position: absolute;
bottom: 5px;
width: 66px;
text-align: center;
color: white;
font-size: 12px;
}

.mode-text.select{
color: rgba(51, 133, 255, 1);
}

.mode-text.unselect{
color: rgba(255, 255, 255, 1);
}

.fire-waring.select {
background-image: url('@/assets/gis/images/hzyj_select.png');
}
.fire-waring.unselect {
background-image: url('@/assets/gis/images/hzyj_unselect.png');
}

.forest-patrol.select {
background-image: url('@/assets/gis/images/slxj_select.png');
}

.forest-patrol.unselect {
background-image: url('@/assets/gis/images/slxj_unselect.png');
}

</style>

Loading…
Cancel
Save