feat:重新对接首页接口
This commit is contained in:
@@ -5,49 +5,54 @@
|
||||
<div class="statistics">
|
||||
<div class="statistics-item">
|
||||
<div class="flex align-center">
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-primary.svg" alt="" />
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-primary.svg" />
|
||||
<span class="statistics-item__label">今日消息总条数</span>
|
||||
</div>
|
||||
<div class="statistics-item__value--primary">
|
||||
<countup end-val="45678" />
|
||||
<countup :end-val="countInfo.total" />
|
||||
<span class="statistics-item__value-suffix">条</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="statistics-item">
|
||||
<div class="flex align-center">
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-error.svg" alt="" />
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-error.svg" />
|
||||
<span class="statistics-item__label">紧急消息</span>
|
||||
</div>
|
||||
<div class="statistics-item__value--error">
|
||||
<countup end-val="45678" />
|
||||
<countup :end-val="countInfo.warn" />
|
||||
<span class="statistics-item__value-suffix">条</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="statistics-item">
|
||||
<div class="flex align-center">
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-warning.svg" alt="" />
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-warning.svg" />
|
||||
<span class="statistics-item__label">重要消息</span>
|
||||
</div>
|
||||
<div class="statistics-item__value--warning">
|
||||
<countup end-val="45678" />
|
||||
<countup :end-val="countInfo.important" />
|
||||
<span class="statistics-item__value-suffix">条</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="statistics-item">
|
||||
<div class="flex align-center">
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-success.svg" alt="" />
|
||||
<img class="statistics-item__icon" src="@/assets/images/dot-success.svg" />
|
||||
<span class="statistics-item__label">普通消息</span>
|
||||
</div>
|
||||
<div class="statistics-item__value--success">
|
||||
<countup end-val="45678" />
|
||||
<countup :end-val="countInfo.normal" />
|
||||
<span class="statistics-item__value-suffix">条</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart-box">
|
||||
<pie :width="150" :height="150" />
|
||||
<pie :width="150" :height="150" />
|
||||
<pie :width="150" :height="150" />
|
||||
<pie
|
||||
v-for="(item, index) in newsStateList"
|
||||
:key="index"
|
||||
:value="item.value"
|
||||
:label="item.name"
|
||||
:width="150"
|
||||
:height="150"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-box-1">
|
||||
@@ -75,14 +80,22 @@
|
||||
import pie from './pie.vue'
|
||||
import { getNewsListApi, getNewsStateApi, getNewsTotalApi } from '@/api/news'
|
||||
|
||||
const list = ref([])
|
||||
|
||||
let list = ref([])
|
||||
let countInfo = ref({
|
||||
important: 0,
|
||||
normal: 0,
|
||||
total: 0,
|
||||
warn: 0
|
||||
})
|
||||
let newsStateList = ref([])
|
||||
const getNewsTotal = async () => {
|
||||
let res = await getNewsTotalApi()
|
||||
console.log(res, '============')
|
||||
countInfo.value = res.data
|
||||
}
|
||||
const getNewsState = async () => {
|
||||
let res = await getNewsStateApi()
|
||||
newsStateList.value = res.data
|
||||
console.log(newsStateList.value, '=================')
|
||||
}
|
||||
const getNewsList = async () => {
|
||||
let res = await getNewsListApi()
|
||||
|
||||
Reference in New Issue
Block a user