-
+
{{ v.num1 }}
-
{{ v.num2 }}
+
{{ v.num2 }}
{{ v.num3 }}
-
-
-
-
-
-
Notes on Background Response
-
-
- 更新日期:2023-03-31
- 注意事项:
- ~对用户申请进行严格审核
- ~对用户提供灾害经纬度范围进行校正
- ~如响应及时,社交媒体数据的Twitter数据直接实时获取即可
- ~数据导出时需检查是否爬取完毕
- ~如灾害发生期间没有遥感数据,在未来一段时间需及时查询更新
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -79,9 +145,15 @@ import * as echarts from 'echarts';
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
-import { statistics } from '/@/api/disasterInfo/index.js';
+import {statistics} from '/@/api/disasterInfo/index.js';
// 定义变量内容
+//响应量 发起量
const homeLineRef = ref();
+//访问量和下载量
+const homeVandDRef = ref();
+//上传次数统计
+const homeUploadRef = ref();
+
const homePieRef = ref();
const homePieRef2 = ref();
const homeBarRef = ref();
@@ -90,9 +162,14 @@ const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
const { isTagsViewCurrenFull } = storeToRefs(storesTagsViewRoutes);
const state = reactive({
-
+ param:{
+ year:''
+ },
+ year:new Date,
global: {
homeChartOne: null,
+ homeVandD:null,
+ homeUpload:null,
homeChartTwo: null,
homeCharThree: null,
homeChartFour: null,
@@ -136,104 +213,55 @@ const state = reactive({
color3: '--el-color-danger',
},
],
- homeThree: [
- {
- icon: 'iconfont icon-yangan',
- label: '浅粉红',
- value: '2.1%OBS/M',
- iconColor: '#F72B3F',
- },
- {
- icon: 'iconfont icon-wendu',
- label: '深红(猩红)',
- value: '30℃',
- iconColor: '#91BFF8',
- },
- {
- icon: 'iconfont icon-shidu',
- label: '淡紫红',
- value: '57%RH',
- iconColor: '#88D565',
- },
- {
- icon: 'iconfont icon-shidu',
- label: '弱紫罗兰红',
- value: '107w',
- iconColor: '#88D565',
- },
- {
- icon: 'iconfont icon-zaosheng',
- label: '中紫罗兰红',
- value: '57DB',
- iconColor: '#FBD4A0',
- },
- {
- icon: 'iconfont icon-zaosheng',
- label: '紫罗兰',
- value: '57PV',
- iconColor: '#FBD4A0',
- },
- {
- icon: 'iconfont icon-zaosheng',
- label: '暗紫罗兰',
- value: '517Cpd',
- iconColor: '#FBD4A0',
- },
- {
- icon: 'iconfont icon-zaosheng',
- label: '幽灵白',
- value: '12kg',
- iconColor: '#FBD4A0',
- },
- {
- icon: 'iconfont icon-zaosheng',
- label: '海军蓝',
- value: '64fm',
- iconColor: '#FBD4A0',
- },
- ],
+ homeThree: [],
myCharts: [],
charts: {
theme: '',
bgColor: '',
color: '#303133',
},
+ countryTable:[],
+ typeTable:[]
});
-// 折线图
-const initLineChart = (xData, data) => {
- console.log(xData)
- console.log(data)
+
+// 响应量和发起量
+const initLineChart = (xData,data1, data2) => {
if (!state.global.dispose.some((b) => b === state.global.homeChartOne)) state.global.homeChartOne.dispose();
state.global.homeChartOne = markRaw(echarts.init(homeLineRef.value, state.charts.theme));
const option = {
backgroundColor: state.charts.bgColor,
title: {
- text: 'Annual user application statistics',
+ text: 'Annual user response application statistics',
x: 'left',
textStyle: { fontSize: '15', color: state.charts.color },
},
grid: { top: 70, right: 20, bottom: 30, left: 30 },
tooltip: { trigger: 'axis' },
- legend: { data: ['响应量'], right: 0 },
+ legend: { data: ['response','initiate'], right: 0 },
xAxis: {
- data: xData,
+ data: xData
},
yAxis: [
{
type: 'value',
- name: '响应量',
+ name: 'response',
splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
},
+ {
+ type: 'value',
+ name: 'initiate',
+ splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
+ }
],
series: [
{
- name: '响应量',
+ name: 'response',
type: 'line',
symbolSize: 6,
symbol: 'circle',
smooth: true,
- data: data,
+ data: data1,
lineStyle: { color: '#fe9a8b' },
itemStyle: { color: '#fe9a8b', borderColor: '#fe9a8b' },
areaStyle: {
@@ -242,12 +270,200 @@ const initLineChart = (xData, data) => {
{ offset: 1, color: '#fe9a8b03' },
]),
},
- },
+ },{
+ name: 'initiate',
+ type: 'line',
+ symbolSize: 6,
+ symbol: 'circle',
+ smooth: true,
+ data: data2,
+ lineStyle: { color: '#44c05b' },
+ itemStyle: { color: '#44c05b', borderColor: '#44c05b' },
+ areaStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: '#44c05b' },
+ { offset: 1, color: '#44c05b' },
+ ]),
+ },
+ }
],
};
state.global.homeChartOne.setOption(option);
state.myCharts.push(state.global.homeChartOne);
};
+// 访问量 和下载次数
+const initLineVandDChart = (xData,data1, data2) => {
+ if (!state.global.dispose.some((b) => b === state.global.homeVandD)) state.global.homeVandD.dispose();
+ state.global.homeVandD = markRaw(echarts.init(homeVandDRef.value, state.charts.theme));
+ const option = {
+ backgroundColor: state.charts.bgColor,
+ title: {
+ text: 'Annual disaster type visits and downloads statistics',
+ x: 'left',
+ textStyle: { fontSize: '15', color: state.charts.color },
+ },
+ grid: { top: 70, right: 20, bottom: 30, left: 30 },
+ tooltip: { trigger: 'axis' },
+ legend: { data: ['visit','download'], right: 0 },
+ xAxis: {
+ data: xData,
+ },
+ yAxis: [
+ {
+ type: 'value',
+ name: 'visit',
+ splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
+ },
+ {
+ type: 'value',
+ name: 'download',
+ splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
+ }
+ ],
+ series: [
+ {
+ name: 'visit',
+ type: 'line',
+ symbolSize: 6,
+ symbol: 'circle',
+ smooth: true,
+ data: data2,
+ lineStyle: { color: '#3d91e7' },
+ itemStyle: { color: '#3d91e7', borderColor: '#3d91e7' },
+ areaStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: '#3d91e7' },
+ { offset: 1, color: '#3d91e7' },
+ ]),
+ },
+ },{
+ name: 'download',
+ type: 'line',
+ symbolSize: 6,
+ symbol: 'circle',
+ smooth: true,
+ data: data1,
+ lineStyle: { color: '#e78d3d' },
+ itemStyle: { color: '#e78d3d', borderColor: '#e78d3d' },
+ areaStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: '#e78d3d' },
+ { offset: 1, color: '#e78d3d' },
+ ]),
+ },
+ }
+ ],
+ };
+ state.global.homeVandD.setOption(option);
+ state.myCharts.push(state.global.homeVandD);
+};
+
+// Chief 管理
+const initChiefChart = (xData,yData) => {
+ if (!state.global.dispose.some((b) => b === state.global.homeUpload)) state.global.homeUpload.dispose();
+ state.global.homeUpload = echarts.init(homeUploadRef.value, state.charts.theme);
+ const option = {
+ backgroundColor: state.charts.bgColor,
+ title: {
+ text: 'Annual Chief Management Statistics TOP10',
+ x: 'left',
+ textStyle: { fontSize: '15', color: state.charts.color },
+ },
+ //tooltip: { trigger: 'item', formatter: '{c}' },
+ tooltip: {
+ show:true
+ // trigger: 'axis',
+ // axisPointer: {
+ // type: 'shadow'
+ // },
+ // formatter: '{c}'
+ },
+ legend: { data: ['chief'], right: 0 },
+ grid: { top: 70, right: 80, bottom: 30, left: 80 },
+ xAxis: [
+ {
+ type: 'category',
+ data: xData
+ },
+ ],
+ yAxis: [
+ {
+ type:'value'
+ }
+ ],
+ series: [
+ {
+ name: 'chief',
+ type: 'bar',
+ barWidth: 30,
+ itemStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: '#fe9a8bb3' },
+ { offset: 1, color: '#fe9a8b03' },
+ ]),
+ //柱状图圆角
+ borderRadius: [30, 30, 0, 0],
+ },
+ data: yData
+ }
+ ],
+ };
+ state.global.homeUpload.setOption(option);
+ state.myCharts.push(state.global.homeUpload);
+};
+// administrators 管理
+const initAdministratorsChart = (xData,yData) => {
+ if (!state.global.dispose.some((b) => b === state.global.homeCharThree)) state.global.homeCharThree.dispose();
+ state.global.homeCharThree = echarts.init(homeBarRef.value, state.charts.theme);
+ const option = {
+ backgroundColor: state.charts.bgColor,
+ title: {
+ text: 'Annual Administrators Management Statistics TOP10',
+ x: 'left',
+ textStyle: { fontSize: '15', color: state.charts.color },
+ },
+ tooltip: { trigger: 'item', formatter: '{c}' },
+ legend: { data: ['administrators'], right: 0 },
+ grid: { top: 70, right: 80, bottom: 30, left: 80 },
+ xAxis: [
+ {
+ type: 'category',
+ data: xData,
+ boundaryGap: true,
+ axisTick: { show: false },
+ },
+ ],
+ yAxis: [
+ {
+ nameLocation: 'middle',
+ nameTextStyle: { padding: [50, 4, 5, 6] },
+ splitLine: { show: false },
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { color: state.charts.color, formatter: '{value} ' },
+ },
+ ],
+ series: [
+ {
+ name: 'administrators',
+ type: 'bar',
+ barWidth: 30,
+ yAxisIndex: 0,
+ itemStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: 'rgba(108,80,243,0.3)' },
+ { offset: 1, color: 'rgba(108,80,243,0)' },
+ ]),
+ //柱状图圆角
+ borderRadius: [30, 30, 0, 0],
+ },
+ data: yData,
+ },
+ ],
+ };
+ state.global.homeCharThree.setOption(option);
+ state.myCharts.push(state.global.homeCharThree);
+};
//homePieRef 灾害发生区域占比 饼图
const initPieChart = (data) => {
if (!state.global.dispose.some((b) => b === state.global.homeChartTwo)) state.global.homeChartTwo.dispose();
@@ -262,7 +478,7 @@ const initPieChart = (data) => {
const option = {
backgroundColor: state.charts.bgColor,
title: {
- text: 'Proportion of Disaster Occurred Areas',
+ text: 'Proportion of Disaster Occurred Areas TOP15',
x: 'left',
textStyle: { fontSize: '15', color: state.charts.color },
},
@@ -330,7 +546,6 @@ const initPieChart = (data) => {
};
//homePieRef2 灾害类型占比 饼图
const initPieChart2 = (data) => {
- console.log("pie2", data)
if (!state.global.dispose.some((b) => b === state.global.homeChartFour)) state.global.homeChartFour.dispose();
state.global.homeChartFour = markRaw(echarts.init(homePieRef2.value, state.charts.theme));
// var getname = ['房屋及结构物', '专用设备', '通用设备', '文物和陈列品', '图书、档案'];
@@ -365,36 +580,6 @@ const initPieChart2 = (data) => {
},
],
},
- // legend: {
- // type: 'scroll',
- // orient: 'vertical',
- // right: '0%',
- // left: '65%',
- // top: 'center',
- // itemWidth: 14,
- // itemHeight: 14,
- // data: getname,
- // textStyle: {
- // rich: {
- // name: {
- // fontSize: 14,
- // fontWeight: 400,
- // width: 200,
- // height: 35,
- // padding: [0, 0, 0, 60],
- // color: state.charts.color,
- // },
- // rate: {
- // fontSize: 15,
- // fontWeight: 500,
- // height: 35,
- // width: 40,
- // padding: [0, 0, 0, 30],
- // color: state.charts.color,
- // },
- // },
- // },
- // },
series: [
{
type: 'pie',
@@ -409,59 +594,6 @@ const initPieChart2 = (data) => {
state.global.homeChartFour.setOption(option);
state.myCharts.push(state.global.homeChartFour);
};
-// 柱状图
-const initBarChart = (xData, yData) => {
- if (!state.global.dispose.some((b) => b === state.global.homeCharThree)) state.global.homeCharThree.dispose();
- state.global.homeCharThree = echarts.init(homeBarRef.value, state.charts.theme);
- const option = {
- backgroundColor: state.charts.bgColor,
- title: {
- text: 'Disaster response monthly distribution change',
- x: 'left',
- textStyle: { fontSize: '15', color: state.charts.color },
- },
- tooltip: { trigger: 'item', formatter: '{c}' },
- legend: { data: ['申请量'], top: 0 },
- grid: { top: 70, right: 80, bottom: 30, left: 80 },
- xAxis: [
- {
- type: 'category',
- data: xData,
- boundaryGap: true,
- axisTick: { show: false },
- },
- ],
- yAxis: [
- {
- nameLocation: 'middle',
- nameTextStyle: { padding: [50, 4, 5, 6] },
- splitLine: { show: false },
- axisLine: { show: false },
- axisTick: { show: false },
- axisLabel: { color: state.charts.color, formatter: '{value} ' },
- },
- ],
- series: [
- {
- name: '申请量',
- type: 'bar',
- barWidth: 30,
- yAxisIndex: 0,
- itemStyle: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: 'rgba(108,80,243,0.3)' },
- { offset: 1, color: 'rgba(108,80,243,0)' },
- ]),
- //柱状图圆角
- borderRadius: [30, 30, 0, 0],
- },
- data: yData,
- },
- ],
- };
- state.global.homeCharThree.setOption(option);
- state.myCharts.push(state.global.homeCharThree);
-};
// 批量设置 echarts resize
const initEchartsResizeFun = () => {
nextTick(() => {
@@ -483,47 +615,63 @@ const setHeadData = (data) => {
state.homeOne[3].num1 = data.downloadCount
}
/**
- * 设置发生区域灾害占比
- * @param data
- */
-const setDisasterArea = (data) => {
- let arr = [];
- for (let [k, v] of Object.entries(data)) {
- arr.push({ name: k, value: v });
- }
- initPieChart(arr);
-}
-/**
- * 设置灾害响应月份分布量
+ * 设置响应量和发起量
* @param data
*/
-const setResponseDisaster = (data) => {
+const setLineChart = (data) => {
let xData = [];
- let yData = [];
- data.forEach(item => {
- for (let [k, v] of Object.entries(item)) {
- xData.push(k);
- yData.push(v.value);
- }
+ //let yData = [];
+ let data1 = [];//initiate
+ let data2 = [];//response
+ data.forEach(item=>{
+ xData.push(item.key)
+ data1.push(item.initiate)
+ data2.push(item.response)
})
- initLineChart(xData, yData);
+ // 响应量和发起量
+ initLineChart(xData,data1,data2);
}
/**
- * 设置灾害申请月份分布量
+ * 设置访问量 和下载次数
* @param data
*/
-const setApplyDisaster = (data) => {
+ const setLineVandDChart = (data) => {
+ let xData = [];
+ let data1 = [];
+ let data2 = [];
+ data.forEach(item=>{
+ xData.push(item.dict_value)
+ data1.push(item.download)
+ data2.push(item.visit)
+ })
+ //访问量 和下载次数
+ initLineVandDChart(xData,data1, data2)
+}
+/**
+ * 管理员管理量
+ * @param data
+ */
+const setAdministratorsChart = (data) => {
let xData = [];
let yData = [];
- data.forEach(item => {
- for (let [k, v] of Object.entries(item)) {
- xData.push(k);
- yData.push(v.value);
- }
+ data.forEach(item=>{
+ xData.push(item.name)
+ yData.push(item.val)
})
- setTimeout(() => {
- initBarChart(xData, yData);
- }, 700);
+ initAdministratorsChart(xData,yData);
+}
+/**
+ * 管理员管理量
+ * @param data
+ */
+ const setChiefChart = (data) => {
+ let xData = [];
+ let yData = [];
+ data.forEach(item=>{
+ xData.push(item.name)
+ yData.push(item.val)
+ })
+ initChiefChart(xData,yData);
}
/**
* 设置灾种数量占比
@@ -531,20 +679,46 @@ const setApplyDisaster = (data) => {
*/
const setDisasterType = (data) => {
let arr = [];
- for (let [k, v] of Object.entries(data)) {
- arr.push({ name: k, value: v });
- }
+ data.forEach(item=>{
+ arr.push({ name: item.name, value: item.val});
+ })
+ // for(let [k , v] of Object.entries(data)){
+ // arr.push({ name: k, value: v});
+
+ // }
+ state.typeTable = arr
initPieChart2(arr)
}
+
+/**
+ * 设置发生区域灾害占比 Proportion of Disaster Occurred Areas TOP15
+ * @param data
+ */
+ const setDisasterArea = (data) => {
+ let arr = [];
+ for(let [k , v] of Object.entries(data)){
+ arr.push({ name: k, value: v});
+ }
+ state.countryTable = arr
+ initPieChart(arr);
+}
//获取控制台数据
const getDashBoradData = () => {
- statistics().then(res => {
+ state.param.year = state.year.getFullYear()
+ statistics(state.param.year).then(res=>{
console.log(res);
+ //第一栏
setHeadData(res.header);
- setDisasterArea(res.country);
- setResponseDisaster(res.responseMonth);
- setApplyDisaster(res.applyMonth);
+ //第二栏
+ setLineChart(res.line)
+ setLineVandDChart(res.vandd);
+ //第三栏
+ setAdministratorsChart(res.admin)
+ setChiefChart(res.chief)
+ //第四栏
setDisasterType(res.disasterNum);
+ //第5栏
+ setDisasterArea(res.country);
})
}
// 批量设置 echarts resize
@@ -575,18 +749,18 @@ watch(
state.charts.theme = isIsDark ? 'dark' : '';
state.charts.bgColor = isIsDark ? 'transparent' : '';
state.charts.color = isIsDark ? '#dadada' : '#303133';
- setTimeout(() => {
- //initLineChart();
- }, 500);
- setTimeout(() => {
- //initPieChart();
- }, 700);
- setTimeout(() => {
- //initPieChart2();
- }, 700);
- setTimeout(() => {
- initBarChart();
- }, 1000);
+ // setTimeout(() => {
+ // //initLineChart();
+ // }, 500);
+ // setTimeout(() => {
+ // //initPieChart();
+ // }, 700);
+ // setTimeout(() => {
+ // //initPieChart2();
+ // }, 700);
+ // setTimeout(() => {
+ // initBarChart();
+ // }, 1000);
});
},
{
@@ -598,103 +772,94 @@ watch(
From c587d3218a1165354fac86efb541b2d856e7b6c5 Mon Sep 17 00:00:00 2001
From: qqGroup0 <253114712@qq.com>
Date: Tue, 25 Apr 2023 10:14:11 +0800
Subject: [PATCH 19/23] =?UTF-8?q?zqq:=E9=81=A5=E6=84=9F=E5=BD=B1=E5=83=8F?=
=?UTF-8?q?=E9=A1=B5=E7=BB=98=E5=88=B6=E7=9F=A9=E5=BD=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Map.vue | 83 +++++++++++++++++++++++++-----------------
1 file changed, 50 insertions(+), 33 deletions(-)
diff --git a/src/components/Map.vue b/src/components/Map.vue
index 6c4740c..69608f1 100644
--- a/src/components/Map.vue
+++ b/src/components/Map.vue
@@ -11,8 +11,8 @@ import L from 'leaflet'
import 'leaflet/dist/leaflet.css'
import 'leaflet-draw/dist/leaflet.draw'
import 'leaflet-draw/dist/leaflet.draw.css'
-import '@geoman-io/leaflet-geoman-free';
-import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
+import '@geoman-io/leaflet-geoman-free';
+import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
import 'Leaflet-ImageOverlay-Rotated'
import { useVariableStore } from '/@/stores/index.ts'
import * as omnivore from '@mapbox/leaflet-omnivore'
@@ -21,6 +21,8 @@ const map = ref()
let homeMap = null
let featureLayerG_area = null
let featureLayerG_point = null
+let layerRectangle = null
+
onMounted(() => {
homeMap = L.map(map.value, {
@@ -42,7 +44,7 @@ onMounted(() => {
tileSize: 256,
zoomOffset: 1,
}).addTo(homeMap)
-
+
featureLayerG_area = L.layerGroup().addTo(homeMap)
featureLayerG_point = L.layerGroup().addTo(homeMap)
@@ -58,32 +60,32 @@ const mapOperations = {
wktParseToMap: (res) => {
let layer = omnivore.wkt.parse(res)
layer.addTo(featureLayerG_point)
-
- let attr=Object.values(layer._layers)
-
+
+ let attr = Object.values(layer._layers)
+
// 判断审核的数据类型,如果是点则直接flyTo
- if(attr[0].feature.geometry.type.indexOf('Polygon')==-1){
- homeMap.flyTo([attr[0].feature.geometry.coordinates[1],attr[0].feature.geometry.coordinates[0]],3)
+ if (attr[0].feature.geometry.type.indexOf('Polygon') == -1) {
+ homeMap.flyTo([attr[0].feature.geometry.coordinates[1], attr[0].feature.geometry.coordinates[0]], 3)
}
- // 判断审核的数据类型,如果是面则计算中心点 然后再fly
- else{
- let polygons=[];
- for(let i=0;i
turf.centroid(polygon));
// console.log(centers)
- let features=[]
- for(let i=0;i{
+ homeMap.pm.enableDraw('Polygon', { snappable: false });
+ let polygon = null;
+ homeMap.on("pm:create", (e) => {
featureLayerG_area.clearLayers()
e.layer.setStyle({
color: '#FF0080',
opacity: 1,
})
- e.layer.addTo(featureLayerG_area)
- polygon=e.layer
- })
+ e.layer.addTo(featureLayerG_area)
+ polygon = e.layer
+ })
// featureLayerG_area.clearLayers()
// variableStore.layerGroupPoly=null;
return polygon
},
clearPolygon: () => {
// console.log('1-2')
-
+
featureLayerG_area.clearLayers()
variableStore.layerGroupPoly = null
homeMap.pm.disableDraw();
@@ -326,7 +328,7 @@ const mapOperations = {
// featureLayerG_point.clearLayers()
},
drawCreated: () => {
-
+
// homeMap.on('draw:created', function (elll) {
// featureLayerG_area.clearLayers()
// variableStore.layerGroupPoly = null
@@ -342,14 +344,14 @@ const mapOperations = {
// })
// variableStore.layerGroupPoly =
// variableStore.layerGroupPoly.join('\n')
-
+
// })
},
Edit: () => {
homeMap.pm.enableGlobalEditMode({
allowSelfIntersection: false,
})
- if(featureLayerG_area.getLayers().length==1){
+ if (featureLayerG_area.getLayers().length == 1) {
featureLayerG_area.eachLayer(function (layer) {
layer.on('pm:edit', (e) => {
let features = featureLayerG_area.toGeoJSON().features
@@ -360,7 +362,7 @@ const mapOperations = {
});
});
}
- else if(featureLayerG_point.getLayers().length==1){
+ else if (featureLayerG_point.getLayers().length == 1) {
featureLayerG_point.eachLayer(function (layer) {
layer.on('pm:edit', (e) => {
let features = featureLayerG_point.toGeoJSON().features
@@ -371,12 +373,27 @@ const mapOperations = {
});
});
}
- else{
+ else {
console.log('error')
}
-
-
},
+ drawRectangle: () => {
+ if (layerRectangle != null) {
+ homeMap.removeLayer(layerRectangle)
+ layerRectangle = null
+ }
+ homeMap.pm.enableDraw('Rectangle', {
+ snappable: true,
+ snapDistance: 20,
+ });
+ homeMap.on('pm:create', (e) => {
+ L.PM.reInitLayer(e.layer);
+ layerRectangle = e.layer
+ });
+ },
+ deleteRectangle: () => {
+ homeMap.removeLayer(layerRectangle)
+ }
}
//omnivore.wkt.parse('POINT(-80 0)').addTo(homeMap);
From df9f19e6ab1d3676cd33cb082df4e059a3ca5258 Mon Sep 17 00:00:00 2001
From: glj
Date: Tue, 25 Apr 2023 10:58:09 +0800
Subject: [PATCH 20/23] =?UTF-8?q?glj-=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/dataService/multimediaData/index.vue | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/views/dataService/multimediaData/index.vue b/src/views/dataService/multimediaData/index.vue
index 4bc323b..0c4354e 100644
--- a/src/views/dataService/multimediaData/index.vue
+++ b/src/views/dataService/multimediaData/index.vue
@@ -6,7 +6,7 @@
-
+
@@ -15,7 +15,7 @@
-
+
start
@@ -272,6 +272,10 @@ const getDisasterData = () => {
}
getList(param).then(res => {
state.disasterData.data = res.records;
+ state.disasterData.data.forEach(item=>{
+ let date = item.disasterTime.slice(0,10);
+ item.disasterTime = date;
+ })
state.disasterData.total = res.total;
state.disasterData.loading = false;
})
From b370c7cc0128000f320703d0153041072ac53772 Mon Sep 17 00:00:00 2001
From: glj
Date: Tue, 25 Apr 2023 15:31:37 +0800
Subject: [PATCH 21/23] =?UTF-8?q?glj-=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/dataService/otherData/index.vue | 6 +++++-
src/views/dataService/pictureInfo/index.vue | 6 +++++-
src/views/dataService/visualData/index.vue | 6 +++++-
src/views/responseManagement/dataUpload/index.vue | 6 +++++-
4 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/views/dataService/otherData/index.vue b/src/views/dataService/otherData/index.vue
index a25a857..d324a51 100644
--- a/src/views/dataService/otherData/index.vue
+++ b/src/views/dataService/otherData/index.vue
@@ -6,7 +6,7 @@
-
+
@@ -166,6 +166,10 @@ const getDisasterData = () => {
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
state.disasterData.data = res.records;
+ state.disasterData.data.forEach(item=>{
+ let date = item.disasterTime.slice(0,10);
+ item.disasterTime = date;
+ })
state.disasterData.total = res.total;
state.disasterData.loading = false;
})
diff --git a/src/views/dataService/pictureInfo/index.vue b/src/views/dataService/pictureInfo/index.vue
index 7ea3e5f..39b678e 100644
--- a/src/views/dataService/pictureInfo/index.vue
+++ b/src/views/dataService/pictureInfo/index.vue
@@ -6,7 +6,7 @@
-
+
@@ -198,6 +198,10 @@ const getDisasterData = () => {
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => {
state.disasterData.data = res.records;
+ state.disasterData.data.forEach(item=>{
+ let date = item.disasterTime.slice(0,10);
+ item.disasterTime = date;
+ })
state.disasterData.total = res.total;
state.disasterData.loading = false;
});
diff --git a/src/views/dataService/visualData/index.vue b/src/views/dataService/visualData/index.vue
index dd4eafd..f1ab4e6 100644
--- a/src/views/dataService/visualData/index.vue
+++ b/src/views/dataService/visualData/index.vue
@@ -6,7 +6,7 @@
-
+
@@ -212,6 +212,10 @@ const getDisasterData = () => {
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
state.disasterData.data = res.records;
+ state.disasterData.data.forEach(item=>{
+ let date = item.disasterTime.slice(0,10);
+ item.disasterTime = date;
+ })
state.disasterData.total = res.total;
state.disasterData.loading = false;
})
diff --git a/src/views/responseManagement/dataUpload/index.vue b/src/views/responseManagement/dataUpload/index.vue
index 2137be6..299fb65 100644
--- a/src/views/responseManagement/dataUpload/index.vue
+++ b/src/views/responseManagement/dataUpload/index.vue
@@ -6,7 +6,7 @@
-
+
@@ -159,6 +159,10 @@ const getDisasterData = () => {
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
state.disasterData.data = res.records;
+ state.disasterData.data.forEach(item=>{
+ let date = item.disasterTime.slice(0,10);
+ item.disasterTime = date;
+ })
state.disasterData.total = res.total;
state.disasterData.loading = false;
})
From 06be21e909e2bd681e5604810968cfd31e3aff4c Mon Sep 17 00:00:00 2001
From: liyuchen <791867849@qq.com>
Date: Tue, 25 Apr 2023 16:15:15 +0800
Subject: [PATCH 22/23] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=A1=A8=E6=A0=BC?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6-liyuchen?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/form/index.vue | 13 ---
src/components/table/DisasterTable.vue | 120 +++++++++++++++++++++++++
2 files changed, 120 insertions(+), 13 deletions(-)
delete mode 100644 src/components/form/index.vue
create mode 100644 src/components/table/DisasterTable.vue
diff --git a/src/components/form/index.vue b/src/components/form/index.vue
deleted file mode 100644
index c0547b1..0000000
--- a/src/components/form/index.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/table/DisasterTable.vue b/src/components/table/DisasterTable.vue
new file mode 100644
index 0000000..17e5fd7
--- /dev/null
+++ b/src/components/table/DisasterTable.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+ Search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From f30a3ff7dcfb2ed40d7489c987cd220e4c393aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com>
Date: Tue, 25 Apr 2023 17:21:21 +0800
Subject: [PATCH 23/23] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Map.vue | 15 ++++++++++++-
src/utils/request.js | 2 +-
.../responseManagement/userResponse/index.vue | 21 ++++++++++++-------
3 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/src/components/Map.vue b/src/components/Map.vue
index 69608f1..0751013 100644
--- a/src/components/Map.vue
+++ b/src/components/Map.vue
@@ -59,6 +59,10 @@ onMounted(() => {
const mapOperations = {
wktParseToMap: (res) => {
let layer = omnivore.wkt.parse(res)
+ if(featureLayerG_area.getLayers().length != 0||featureLayerG_point.getLayers().length != 0){
+
+ return;
+ }
layer.addTo(featureLayerG_point)
let attr = Object.values(layer._layers)
@@ -66,9 +70,12 @@ const mapOperations = {
// 判断审核的数据类型,如果是点则直接flyTo
if (attr[0].feature.geometry.type.indexOf('Polygon') == -1) {
homeMap.flyTo([attr[0].feature.geometry.coordinates[1], attr[0].feature.geometry.coordinates[0]], 3)
+ variableStore.layerGroupPoint=res;
+ return {'layer':layer,'location':[attr[0].feature.geometry.coordinates[1],attr[0].feature.geometry.coordinates[0]]}
}
// 判断审核的数据类型,如果是面则计算中心点 然后再fly
else {
+ variableStore.layerGroupPoly=res;
let polygons = [];
for (let i = 0; i < attr[0].feature.geometry.coordinates.length; i++) {
console.log(attr[0].feature.geometry.coordinates[i])
@@ -83,8 +90,9 @@ const mapOperations = {
let final_center = turf.center(turf.featureCollection(features))
// console.log(final_center)
homeMap.flyTo([final_center.geometry.coordinates[1], final_center.geometry.coordinates[0]], 3)
+ return {'layer':layer,'location':null}
}
- return layer
+ // return layer
},
/** 添加点标注
@@ -313,6 +321,11 @@ const mapOperations = {
})
e.layer.addTo(featureLayerG_area)
polygon = e.layer
+ let features = featureLayerG_area.toGeoJSON().features
+ variableStore.layerGroupPoly = features.map(function (feature) {
+ return WKT.convert(feature.geometry)
+ })
+ variableStore.layerGroupPoly = variableStore.layerGroupPoly.join('\n')
})
// featureLayerG_area.clearLayers()
// variableStore.layerGroupPoly=null;
diff --git a/src/utils/request.js b/src/utils/request.js
index 23898cb..68714cd 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -4,7 +4,7 @@ import qs from 'qs';
import { Session } from '/@/utils/storage';
// export const moduleName = 'zqq-biz-vordm';
-export const moduleName = 'biz-vordm';
+export const moduleName = 'glj-biz-vordm';
export const crawlModule = 'vordm-crawl';
// 配置新建一个 axios 实例
const service = axios.create({
diff --git a/src/views/responseManagement/userResponse/index.vue b/src/views/responseManagement/userResponse/index.vue
index c44ee4d..d23c27d 100644
--- a/src/views/responseManagement/userResponse/index.vue
+++ b/src/views/responseManagement/userResponse/index.vue
@@ -111,7 +111,7 @@
-
+
Point
Area
@@ -238,7 +238,10 @@ const onOpenEditRole = (type, row) => {
if(state.wktPoint_Poly){
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
}
- state.wktPoint_Poly= mapRef.value.mapOperations.wktParseToMap(row.geometry)
+ let wkt=mapRef.value.mapOperations.wktParseToMap(row.geometry)
+ state.wktPoint_Poly= wkt.layer
+ console.log(wkt.location)
+ changelatlon(wkt.location[0],wkt.location[1]);
// mapRef.value.mapOperations.on("click", (res)=>{
// mapRef.value.mapOperations.clearPolygon()
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly)
@@ -251,7 +254,7 @@ const mapEvents = (ev)=>{
if(ev == '1'){
// mapRef.value.mapOperations.clearPolygon()
mapRef.value.mapOperations.on("click", mapClick)
- mapRef.value.mapOperations.on("mousemove", changelatlon)
+ // mapRef.value.mapOperations.on("mousemove", changelatlon)
mapRef.value.mapOperations.clearPolygon()
}else if(ev == '2'){
@@ -275,8 +278,8 @@ const ClearSubmit = () => {
}
const mapClick=(res)=>{
mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly )
- changelatlon(res);
- state.wktPoint_Poly=mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3))
+ changelatlon(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3));
+ mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3))
// console.log(state.wktPoint_Poly)
}
const reviews = (index) => {
@@ -307,10 +310,12 @@ const onHandleCurrentChange = (val) => {
state.tableData.param.pageNum = val;
getTableData();
};
-const changelatlon = (e) => {
+const changelatlon = (lat,lon) => {
//深拷贝e
- state.dislat = e.latlng.lat.toFixed(3);
- state.dislon= e.latlng.lng.toFixed(3);
+ // state.dislat = e.latlng.lat.toFixed(3);
+ // state.dislon= e.latlng.lng.toFixed(3);
+ state.dislat = lat;
+ state.dislon= lon;
// if (state.lon < 0) {
// state.lon = state.lon + 360;
// }