From d31ca1d96763b059a536ee8a77c51adf601ac148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com> Date: Sun, 23 Apr 2023 16:53:40 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Map.vue | 262 ++++----- src/stores/index.ts | 1 + src/utils/request.js | 4 +- .../responseManagement/userResponse/index.vue | 505 ++++++++---------- 4 files changed, 314 insertions(+), 458 deletions(-) diff --git a/src/components/Map.vue b/src/components/Map.vue index 3c6c5d8..6c4740c 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -2,27 +2,25 @@
- - - \ No newline at end of file + diff --git a/src/stores/index.ts b/src/stores/index.ts index c99ca11..3d0fa72 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts @@ -56,6 +56,7 @@ export const useVariableStore = defineStore(Names.TEST, { // Data_upload_agency:"" // } ], + // 存储wkt格式数据 layerGroupPoint:null, layerGroupPoly:null, polygoncontrol:null, diff --git a/src/utils/request.js b/src/utils/request.js index 8e4e748..68714cd 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -3,8 +3,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'; import qs from 'qs'; import { Session } from '/@/utils/storage'; -export const moduleName = 'zqq-biz-vordm'; -// export const moduleName = 'biz-vordm'; +// export const moduleName = 'zqq-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 e041097..974a15e 100644 --- a/src/views/responseManagement/userResponse/index.vue +++ b/src/views/responseManagement/userResponse/index.vue @@ -1,72 +1,45 @@ From 71db5daf8016f1ca45de5a170b58ffaae5b7fd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com> Date: Sun, 23 Apr 2023 16:54:46 +0800 Subject: [PATCH 02/23] . --- src/views/responseManagement/userResponse/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/responseManagement/userResponse/index.vue b/src/views/responseManagement/userResponse/index.vue index 974a15e..8b6098d 100644 --- a/src/views/responseManagement/userResponse/index.vue +++ b/src/views/responseManagement/userResponse/index.vue @@ -276,7 +276,7 @@ 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)) + mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3)) // console.log(state.wktPoint_Poly) } const reviews = (index) => { From cf31fe552cd51074005f2c6e8a3486cd7ce12ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com> Date: Sun, 23 Apr 2023 17:35:28 +0800 Subject: [PATCH 03/23] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../responseManagement/contact/index.vue | 20 +++++++++---------- .../responseManagement/dataUpload/index.vue | 8 ++++---- src/views/responseManagement/tool/index.vue | 14 ++++++------- .../responseManagement/userResponse/index.vue | 6 +++--- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/views/responseManagement/contact/index.vue b/src/views/responseManagement/contact/index.vue index ac9e866..d97bae7 100644 --- a/src/views/responseManagement/contact/index.vue +++ b/src/views/responseManagement/contact/index.vue @@ -8,12 +8,12 @@ - - + - search + Search @@ -39,14 +39,14 @@ - - - - + + + + - - - + + + - + + -->
From ba83f4e478c7c271eac7589f2872a79ac5133d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com> Date: Mon, 24 Apr 2023 17:29:34 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Map.vue | 262 +++++------- .../responseManagement/userResponse/index.vue | 388 ++++++++---------- 2 files changed, 280 insertions(+), 370 deletions(-) diff --git a/src/components/Map.vue b/src/components/Map.vue index b22f2fd..6c4740c 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -2,27 +2,25 @@
- - - \ No newline at end of file + diff --git a/src/views/responseManagement/userResponse/index.vue b/src/views/responseManagement/userResponse/index.vue index d473e3b..a8c324b 100644 --- a/src/views/responseManagement/userResponse/index.vue +++ b/src/views/responseManagement/userResponse/index.vue @@ -1,46 +1,45 @@ - From 97f9ceec6911af888b8b45d62a21d61e6b58312e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com> Date: Mon, 24 Apr 2023 17:30:35 +0800 Subject: [PATCH 17/23] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/responseManagement/userResponse/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/responseManagement/userResponse/index.vue b/src/views/responseManagement/userResponse/index.vue index a8c324b..c44ee4d 100644 --- a/src/views/responseManagement/userResponse/index.vue +++ b/src/views/responseManagement/userResponse/index.vue @@ -99,7 +99,7 @@ From a11a10b1d39cd36cfd74d510e7b93e49c57cebb4 Mon Sep 17 00:00:00 2001 From: why <986973311@qq.com> Date: Mon, 24 Apr 2023 18:46:06 +0800 Subject: [PATCH 18/23] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/disasterInfo/index.js | 9 +- src/views/home/index.vue | 865 ++++++++++++++++++++-------------- 2 files changed, 521 insertions(+), 353 deletions(-) diff --git a/src/api/disasterInfo/index.js b/src/api/disasterInfo/index.js index f7ed885..03c4b13 100644 --- a/src/api/disasterInfo/index.js +++ b/src/api/disasterInfo/index.js @@ -50,15 +50,18 @@ export function review(data) { /** * 首页 dashborad */ -export function statistics(){ +export function statistics(param){ return request({ url: '/api/'+moduleName+'/ui/disasterInfo/statistics', - method: 'get' + method: 'get', + params:{ + year:param + } }); } export const getUserList = (name,current,size) => { return request({ - url: '/api/yyhouc-system-manager/user/list', + url: '/api/system-manager/user/list', method: 'get', params: { name, diff --git a/src/views/home/index.vue b/src/views/home/index.vue index c337e2e..69f8071 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,74 +1,140 @@ @@ -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 @@
- +