diff --git a/src/api/request.js b/src/api/request.js index d344cc1..61a752c 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -106,6 +106,7 @@ 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 45d50cf..1b78cdf 100644 --- a/src/api/sentiment.js +++ b/src/api/sentiment.js @@ -41,10 +41,11 @@ export function getHotWordApi() { } // 舆情指数 -export function getLineChartApi() { +export function getLineChartApi(data) { return request({ url: '/api/largeScreen/gsdata/lineChart', - method: 'post' + method: 'get', + params: data }) } @@ -55,3 +56,11 @@ export function getAreaApi() { method: 'post' }) } + +// 景区选择 +export function getSpotApi() { + return request({ + url: '/api/largeScreen/gsdata/spot', + method: 'post' + }) +} diff --git a/src/components/Dropdown/index.vue b/src/components/Dropdown/index.vue index c0697d1..9e38886 100644 --- a/src/components/Dropdown/index.vue +++ b/src/components/Dropdown/index.vue @@ -8,7 +8,7 @@ @@ -27,8 +27,10 @@ default: () => [] } }) + + let emit = defineEmits(['on-change']) const handleCommand = (command) => { - console.log(command) + emit('on-change', command) } diff --git a/src/components/Line/index.vue b/src/components/Line/index.vue index dd42e75..7ccb961 100644 --- a/src/components/Line/index.vue +++ b/src/components/Line/index.vue @@ -8,10 +8,10 @@ /> diff --git a/src/views/sentiment/index.vue b/src/views/sentiment/index.vue index 3a960a4..c2ff7e1 100644 --- a/src/views/sentiment/index.vue +++ b/src/views/sentiment/index.vue @@ -24,18 +24,10 @@
-
- - +
+ +
-
@@ -46,6 +38,7 @@
+ { + console.log(e, '===') + getLineChart(e.id) + } + const getStop = async () => { + let res = await getSpotApi() + options.value = res.data + } const getTotal = async () => { let res = await getTotalApi() total.value = res.data.total @@ -92,8 +99,8 @@ stateList.value = res.data console.log(stateList.value, '------') } - const getLineChart = async () => { - let res = await getLineChartApi() + const getLineChart = async (id) => { + let res = await getLineChartApi({ id }) xAxisData.value = res.data.data seriesData.value = res.data.series } @@ -102,6 +109,7 @@ hotNewList.value = res.data } onMounted(() => { + getStop() getHotNew() getTotal() getState()