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

修改资源统计为固定值

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