feat: 看板数据
This commit is contained in:
parent
a24733f6ea
commit
9d37c56b8d
@ -37,3 +37,10 @@ export function getCorpusListApi(params) {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function getDashboardApi() {
|
||||
return request({
|
||||
url: '/tts/corpus/dashboard/stats',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -18,38 +18,54 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import SvgIcon from "@/components/SvgIcon";
|
||||
import { getDashboardApi } from '@/api/corpusManger/corpus.js'
|
||||
import { onMounted } from "vue";
|
||||
|
||||
const stats = [
|
||||
const stats = ref([
|
||||
{
|
||||
iconName: 'task',
|
||||
label: '语料总量(条)',
|
||||
value: '856,420',
|
||||
value: 14,
|
||||
trend: '+12.4%',
|
||||
trendClass: 'up'
|
||||
},
|
||||
{
|
||||
iconName: 'add',
|
||||
label: '核心功能分类(个)',
|
||||
value: '12,680',
|
||||
value: '4',
|
||||
trend: '+8.7%',
|
||||
trendClass: 'up',
|
||||
},
|
||||
{
|
||||
iconName: 'language',
|
||||
label: '多语种数量(种)',
|
||||
value: '12',
|
||||
value: 2,
|
||||
trend: '—',
|
||||
trendClass: 'neutral'
|
||||
},
|
||||
{
|
||||
iconName: 'consuming',
|
||||
label: '今日新增语料(条)',
|
||||
value: '36',
|
||||
value: 3,
|
||||
trend: '+3.2%',
|
||||
trendClass: 'up'
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
const getDashboard = async () => {
|
||||
const res = await getDashboardApi()
|
||||
if (res.code === 200) {
|
||||
stats.value[0].value = res.data.totalCorpus
|
||||
stats.value[2].value = res.data.totalLanguages
|
||||
stats.value[3].value = res.data.todayCorpus
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDashboard()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -19,8 +19,9 @@
|
||||
|
||||
<script setup>
|
||||
import SvgIcon from "@/components/SvgIcon";
|
||||
import { getDashboardApi } from '@/api/corpusManger/speech_synthesis.js'
|
||||
|
||||
const stats = [
|
||||
const stats = ref([
|
||||
{
|
||||
iconName: 'task',
|
||||
label: '合成任务总数(条)',
|
||||
@ -56,7 +57,25 @@ const stats = [
|
||||
trend: '-5.6%',
|
||||
trendClass: 'down'
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
const getDashboard = async () => {
|
||||
const res = await getDashboardApi()
|
||||
if (res.code === 200) {
|
||||
stats.value[0].value = res.data.totalTasks
|
||||
stats.value[0].trend = res.data.totalTasksGrowth
|
||||
stats.value[1].value = res.data.todayTasks
|
||||
stats.value[1].trend = res.data.todayTasksGrowth
|
||||
stats.value[2].value = res.data.totalLanguages
|
||||
stats.value[3].value = res.data.totalVoices
|
||||
stats.value[4].value = res.data.avgDuration
|
||||
stats.value[4].trend = res.data.avgDurationGrowth
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDashboard()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user