mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-09 19:47:39 +08:00
fix: 新增积分趋势统计
This commit is contained in:
@@ -33,23 +33,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { LineChart } from 'echarts/charts'
|
|
||||||
import {
|
|
||||||
DataZoomComponent,
|
|
||||||
GridComponent,
|
|
||||||
TitleComponent,
|
|
||||||
TooltipComponent,
|
|
||||||
} from 'echarts/components'
|
|
||||||
import { use } from 'echarts/core'
|
|
||||||
import { CanvasRenderer } from 'echarts/renderers'
|
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import VChart from 'vue-echarts'
|
|
||||||
import { getToken } from '~/utils/auth'
|
import { getToken } from '~/utils/auth'
|
||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
const API_BASE_URL = config.public.apiBaseUrl
|
const API_BASE_URL = config.public.apiBaseUrl
|
||||||
|
|
||||||
use([LineChart, TitleComponent, TooltipComponent, GridComponent, DataZoomComponent, CanvasRenderer])
|
|
||||||
|
|
||||||
const dauOption = ref(null)
|
const dauOption = ref(null)
|
||||||
const newUserOption = ref(null)
|
const newUserOption = ref(null)
|
||||||
const postOption = ref(null)
|
const postOption = ref(null)
|
||||||
|
|||||||
@@ -185,13 +185,6 @@ import BasePlaceholder from '~/components/BasePlaceholder.vue'
|
|||||||
import { stripMarkdownLength } from '~/utils/markdown'
|
import { stripMarkdownLength } from '~/utils/markdown'
|
||||||
import TimeManager from '~/utils/time'
|
import TimeManager from '~/utils/time'
|
||||||
import BaseTabs from '~/components/BaseTabs.vue'
|
import BaseTabs from '~/components/BaseTabs.vue'
|
||||||
import { LineChart } from 'echarts/charts'
|
|
||||||
import { GridComponent, TooltipComponent } from 'echarts/components'
|
|
||||||
import { use } from 'echarts/core'
|
|
||||||
import { CanvasRenderer } from 'echarts/renderers'
|
|
||||||
import VChart from 'vue-echarts'
|
|
||||||
|
|
||||||
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer])
|
|
||||||
|
|
||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
const API_BASE_URL = config.public.apiBaseUrl
|
const API_BASE_URL = config.public.apiBaseUrl
|
||||||
@@ -248,9 +241,10 @@ const loadTrend = async () => {
|
|||||||
const values = data.map((d) => d.value)
|
const values = data.map((d) => d.value)
|
||||||
trendOption.value = {
|
trendOption.value = {
|
||||||
tooltip: { trigger: 'axis' },
|
tooltip: { trigger: 'axis' },
|
||||||
xAxis: { type: 'category', data: dates },
|
xAxis: { type: 'category', data: dates, boundaryGap: false },
|
||||||
yAxis: { type: 'value' },
|
yAxis: { type: 'value' },
|
||||||
series: [{ type: 'line', areaStyle: {}, smooth: true, data: values }],
|
series: [{ type: 'line', areaStyle: {}, smooth: true, data: values }],
|
||||||
|
dataZoom: [{ type: 'slider', start: 80 }, { type: 'inside' }],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
frontend_nuxt/plugins/echarts.client.ts
Normal file
18
frontend_nuxt/plugins/echarts.client.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
// plugins/echarts.client.ts
|
||||||
|
import { defineNuxtPlugin } from 'nuxt/app'
|
||||||
|
import VueECharts from 'vue-echarts'
|
||||||
|
import { use } from 'echarts/core'
|
||||||
|
import { CanvasRenderer } from 'echarts/renderers'
|
||||||
|
import { LineChart } from 'echarts/charts'
|
||||||
|
import {
|
||||||
|
GridComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
DataZoomComponent,
|
||||||
|
TitleComponent,
|
||||||
|
} from 'echarts/components'
|
||||||
|
|
||||||
|
use([LineChart, TitleComponent, TooltipComponent, GridComponent, DataZoomComponent, CanvasRenderer])
|
||||||
|
|
||||||
|
export default defineNuxtPlugin((nuxtApp) => {
|
||||||
|
nuxtApp.vueApp.component('VChart', VueECharts)
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user