From dc1ad009c7b9f9da265604eb21356d42e8be290d Mon Sep 17 00:00:00 2001 From: zjc <1034206993@qq.com> Date: Thu, 26 Dec 2024 18:30:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=AF=B9=E6=8E=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E3=80=81=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request.js | 1 - src/api/sentiment.js | 5 +- src/components/Line/index.vue | 86 +- src/components/PieRow/index.vue | 1 - src/hooks/echart.js | 19 +- .../components/{age-ratio.vue => age.vue} | 51 +- src/views/home/components/box-1.vue | 104 +-- src/views/home/components/box-2.vue | 350 ++++++++ src/views/home/components/box-3.vue | 744 +++++++++++------- src/views/home/components/box-4.vue | 536 ------------- .../{lodging-ratio.vue => occupancy.vue} | 15 +- src/views/home/components/top.vue | 365 +++------ src/views/home/index.vue | 6 +- src/views/sentiment/components/area.vue | 18 +- src/views/sentiment/components/wordCloud.vue | 19 +- src/views/sentiment/index.vue | 11 +- 16 files changed, 1085 insertions(+), 1246 deletions(-) rename src/views/home/components/{age-ratio.vue => age.vue} (55%) create mode 100644 src/views/home/components/box-2.vue delete mode 100644 src/views/home/components/box-4.vue rename src/views/home/components/{lodging-ratio.vue => occupancy.vue} (94%) diff --git a/src/api/request.js b/src/api/request.js index 61a752c..d344cc1 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -106,7 +106,6 @@ const instance = axios.create({ */ instance.interceptors.request.use( (config) => { - console.log(config, 'config') // 规范写法 不可随意自定义 let urlParams = {} if (config.params) { diff --git a/src/api/sentiment.js b/src/api/sentiment.js index 1b78cdf..737dcd8 100644 --- a/src/api/sentiment.js +++ b/src/api/sentiment.js @@ -50,10 +50,11 @@ export function getLineChartApi(data) { } // 地域分析 -export function getAreaApi() { +export function getAreaApi(data) { return request({ url: '/api/largeScreen/gsdata/area', - method: 'post' + method: 'get', + params: data }) } diff --git a/src/components/Line/index.vue b/src/components/Line/index.vue index 7ccb961..ad57f47 100644 --- a/src/components/Line/index.vue +++ b/src/components/Line/index.vue @@ -38,18 +38,29 @@ default: () => {} } }) - const { id, setOption, initChart } = useEchart() + + const { id, setOption } = useEchart() let timer = null let currentIndex = -1 + let params = null var defaultColors = ['#06E2FF', '#02FFB8', '#FF465F', '#FFCA36', '#9A4BFC', '#044EFF'] - - let defaultSeriesConfig = { - type: 'line', - smooth: true, - symbol: 'none', - symbolSize: fitChartSize(8) + const defaultSeriesConfig = (index) => { + return { + type: 'line', + smooth: true, + symbol: 'none', + symbolSize: fitChartSize(8), + itemStyle: { + color: '#0B2F63', + borderColor: defaultColors[index], + borderWidth: fitChartSize(4) + }, + lineStyle: { + color: defaultColors[index] + } + } } let defaultConfig = { colors: defaultColors, @@ -57,9 +68,9 @@ trigger: 'axis', backgroundColor: 'transparent', borderWidth: 0, - formatter: (params) => { + formatter: (e) => { let valueStr = '' - params.map((item) => { + e.map((item) => { valueStr += `
${item.seriesName}:${item.value}
` }) let str = `
+
diff --git a/src/views/home/components/box-3.vue b/src/views/home/components/box-3.vue index 4c0e2f8..c9df6bf 100644 --- a/src/views/home/components/box-3.vue +++ b/src/views/home/components/box-3.vue @@ -1,118 +1,268 @@ diff --git a/src/views/home/components/box-4.vue b/src/views/home/components/box-4.vue deleted file mode 100644 index 0715fa7..0000000 --- a/src/views/home/components/box-4.vue +++ /dev/null @@ -1,536 +0,0 @@ - - - - - diff --git a/src/views/home/components/lodging-ratio.vue b/src/views/home/components/occupancy.vue similarity index 94% rename from src/views/home/components/lodging-ratio.vue rename to src/views/home/components/occupancy.vue index 54fb2cb..4fd2980 100644 --- a/src/views/home/components/lodging-ratio.vue +++ b/src/views/home/components/occupancy.vue @@ -27,15 +27,7 @@ bottom: '-10%', containLabel: true }, - xAxis: [ - { - splitLine: { - show: false - }, - type: 'value', - show: false - } - ], + xAxis: [{ max: 100, show: false }], yAxis: [ { splitLine: { @@ -55,7 +47,6 @@ }, { type: 'category', - inverse: true, axisTick: 'none', axisLine: 'none', show: true, @@ -65,7 +56,7 @@ fontSize: fitChartSize(12) }, verticalAlign: 'bottom', - padding: [0, 0, 6, 0], + padding: [0, 0, fitChartSize(6), 0], inside: true, formatter: function (value) { return `{value|${value}}` @@ -101,7 +92,7 @@ }, label: { show: true, - offset: [10, -13], + offset: [fitChartSize(10), -fitChartSize(20)], color: '#D3E5FF', fontWeight: 500, position: 'left', diff --git a/src/views/home/components/top.vue b/src/views/home/components/top.vue index 2349b52..024ba91 100644 --- a/src/views/home/components/top.vue +++ b/src/views/home/components/top.vue @@ -1,246 +1,143 @@