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 += `