提交 e13978e5 authored 作者: 王鹏飞's avatar 王鹏飞

修改资源统计为固定值

上级 9e6ace2f
......@@ -43,6 +43,7 @@ const bytesToSize = (bytes: number) => {
// flex-wrap: wrap;
margin-top: -20px;
.item {
flex: 1;
padding-top: 15px;
min-width: 10%;
height: 140px;
......@@ -53,7 +54,7 @@ const bytesToSize = (bytes: number) => {
margin-top: 20px;
&:nth-child(1) {
.icon {
background-image: url(/center_resource/home-icon1.png);
background-image: url(/center_resource/home-icon5.png);
}
}
&:nth-child(2) {
......@@ -73,7 +74,7 @@ const bytesToSize = (bytes: number) => {
}
&:nth-child(5) {
.icon {
background-image: url(/center_resource/home-icon5.png);
background-image: url(/center_resource/home-icon1.png);
}
}
&:nth-child(6) {
......
......@@ -9,28 +9,27 @@ const data = reactive<{ statistics: object[]; latest: object[]; hot: object[]; l
statistics: [],
latest: [],
hot: [],
learn: []
learn: [],
})
// 所有数据
getUtilData().then(res => {
getUtilData().then((res) => {
flag = true
let { latest = [], hot = [], learn = [] }: { latest: object[]; hot: object[]; learn: object[] } = res.data
if (learn === null) learn = []
// 统计资源数据整合
const statisticsData = [
{ key: 'video_count', unit: '个', number: 0, text: '视频资源' },
{ key: 'courseware_count', unit: '个', number: 0, text: '课件资源' },
{ key: 'other_information_count', unit: '个', number: 0, text: '其他资料' },
{ key: 'question_count', unit: '个', number: 0, text: '题库资源' },
{ key: 'paper_count', unit: '套', number: 0, text: '试卷资源' },
{ key: 'memory_size', unit: '', number: 0, text: '资源总体量' },
{ key: 'length', unit: '小时', number: 0, text: '资源总时长' },
{ key: 'learn_times', unit: '人次', number: 0, text: '总学习人次' },
{ key: 'learn_time_length', unit: '小时', number: 0, text: '总学习时长' }
{ key: '1', unit: '个', number: 10, text: '案例数量' },
{ key: '2', unit: '个', number: 79, text: '案例PPT资源数量' },
{ key: '3', unit: '个', number: 87, text: '案例指导书数量' },
{ key: '4', unit: '个', number: 19, text: '案例数据集' },
{ key: '5', unit: '个', number: 149, text: '案例操作视频' },
{ key: '6', unit: '个', number: 84, text: '行业数据集' },
{ key: '7', unit: 'GB', number: 15.7, text: '资源总体量' },
{ key: '8', unit: '小时', number: 22.63, text: '资源总时长' },
]
data.statistics = statisticsData.map((item: any) => {
item.number = res.data[item.key] || 0
// item.number = res.data[item.key] || 0
return item
})
// 最近数据
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论