Ver código fonte

mc

tags/v1.2.0
lixin 1 ano atrás
pai
commit
fd420a45b1
1 arquivos alterados com 6 adições e 21 exclusões
  1. +6
    -21
      src/views/dashboard/components/OneMap.vue

+ 6
- 21
src/views/dashboard/components/OneMap.vue Ver arquivo

@@ -162,6 +162,7 @@ import { implement } from '@/api/task/index.js'
import { get as getProjection } from 'ol/proj.js'
import { getTopLeft, getWidth } from 'ol/extent.js'
import { formatDate } from '@/utils/index.js'
import { da } from 'date-fns/locale'
const projection = getProjection('EPSG:4326')
const projectionExtent = projection.getExtent()
const size = getWidth(projectionExtent) / 256
@@ -206,7 +207,6 @@ export default {
listShow: false,
// 时间范围是一周前至今天
efg: '',
clickListNum: 0,
problemPopupShow: false,
tabIndex: 1,
page: ref(1),
@@ -412,9 +412,6 @@ export default {
data.problemPopupShow = true
data.map.addOverlay(data.problemOverlay)
data.problemOverlay.setPosition(coord)

// data.problemOverlay.setPosition(coord)
// data.map.addOverlay(data.problemOverlay)
}
}
}
@@ -435,7 +432,6 @@ export default {
const hideProblemInfo = () => {
if (data.map.getOverlayById('problem_overlay')) {
data.problemDetail = {}

data.map.removeOverlay(data.problemOverlay)
}
}
@@ -509,30 +505,20 @@ export default {
// 获取日期
const getDay = (day) => {
var today = new Date()

var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day

today.setTime(targetday_milliseconds) // 注意,这行是关键代码

var tYear = today.getFullYear()

var tMonth = today.getMonth()

var tDate = today.getDate()

tMonth = doHandleMonth(tMonth + 1)

tDate = doHandleMonth(tDate)

return tYear + '-' + tMonth + '-' + tDate
}
const doHandleMonth = (month) => {
var m = month

if (month.toString().length === 1) {
m = '0' + month
}

return m
}
// 添加问题图层
@@ -655,13 +641,8 @@ export default {
* @description:是否展示列表
*/
const showList = () => {
// 判断是不是第一次点击列表按钮
// if (data.clickListNum === 0) {
// // 第一次点击列表按钮会显示问题图层
// changeDate()
// data.clickListNum += 1
// }
if (data.listChecked) {
// 关闭问题图层
if (data.problemLayerList.length > 0) {
data.problemLayerList.forEach(layer => {
if (layer !== null) {
@@ -670,6 +651,8 @@ export default {
})
data.problemLayerList.length = 0
}
// 关闭问题弹窗
hideProblemInfo()
} else {
changeDate()
}
@@ -679,6 +662,8 @@ export default {
*
*/
const handleProblemTypeValue = (value) => {
// 关闭问题弹窗
hideProblemInfo()
if (data.problemLayerList.length > 0) {
data.problemLayerList.map((layer) => {
const a = value.indexOf(layer.getProperties().type)

Carregando…
Cancelar
Salvar