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 @@