Browse Source

feat: [工作台] 数量统计

lkf
memorylkf 3 months ago
parent
commit
a6d12d76bd
7 changed files with 150 additions and 1 deletions
  1. +9
    -0
      src/api/business/home/home.js
  2. BIN
      src/assets/images/home-icon1.jpg
  3. +3
    -0
      src/lang/en.js
  4. +9
    -0
      src/lang/en/business/home/home.js
  5. +3
    -0
      src/lang/zh.js
  6. +9
    -0
      src/lang/zh/business/home/home.js
  7. +117
    -1
      src/views/index.vue

+ 9
- 0
src/api/business/home/home.js View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function home_count(query) {
return request({
url: '/system/business/home/count',
method: 'get',
params: query
})
}

BIN
src/assets/images/home-icon1.jpg View File

Before After
Width: 72  |  Height: 72  |  Size: 1.5 KiB

+ 3
- 0
src/lang/en.js View File

@ -1,3 +1,5 @@
// 工作台-首页
import home from './en/business/home/home'
//系统管理 //系统管理
// 菜单管理 // 菜单管理
import menu from './en/system/menu' import menu from './en/system/menu'
@ -140,6 +142,7 @@ export default {
template template
}, },
business: { business: {
home: home,
resource: { resource: {
resource: resource, resource: resource,
zcg: zcg, zcg: zcg,

+ 9
- 0
src/lang/en/business/home/home.js View File

@ -0,0 +1,9 @@
export default {
jrxzbd: 'Recent Record',
ytjbd: 'Submitted',
dtjbd: 'Saved',
bzxzsy: 'Weekly New Study',
ywcsy: 'Completed Study',
xttz: 'Notification'
}

+ 3
- 0
src/lang/zh.js View File

@ -1,3 +1,5 @@
// 工作台-首页
import home from './zh/business/home/home'
//系统管理 //系统管理
// 菜单管理 // 菜单管理
import menu from './zh/system/menu' import menu from './zh/system/menu'
@ -135,6 +137,7 @@ export default {
template template
}, },
business: { business: {
home: home,
resource: { resource: {
resource: resource, resource: resource,
zcg: zcg, zcg: zcg,

+ 9
- 0
src/lang/zh/business/home/home.js View File

@ -0,0 +1,9 @@
export default {
jrxzbd: '今日新增表单',
ytjbd: '已提交表单',
dtjbd: '待提交表单',
bzxzsy: '本周新增试验',
ywcsy: '已完成试验',
xttz: '系统通知'
}

+ 117
- 1
src/views/index.vue View File

@ -1,21 +1,137 @@
<template> <template>
<div class="app-container home"> <div class="app-container home">
<h1>{{ $t('system.title') }}</h1>
<el-card class="box-card home-top">
<div class="count-box">
<div class="count-item">
<div class="count-left">
<img src="@/assets/images/home-icon1.jpg" />
</div>
<div class="count-right">
<div class="count-count">{{count.formTodayCount}}</div>
<div class="count-tip">{{$t('page.business.home.jrxzbd')}}</div>
</div>
</div>
<div class="count-item">
<div class="count-left">
<img src="@/assets/images/home-icon1.jpg" />
</div>
<div class="count-right">
<div class="count-count">{{count.formYtjCount}}</div>
<div class="count-tip">{{$t('page.business.home.ytjbd')}}</div>
</div>
</div>
<div class="count-item">
<div class="count-left">
<img src="@/assets/images/home-icon1.jpg" />
</div>
<div class="count-right">
<div class="count-count">{{count.formTbzCount}}</div>
<div class="count-tip">{{$t('page.business.home.dtjbd')}}</div>
</div>
</div>
<div class="count-item">
<div class="count-left">
<img src="@/assets/images/home-icon1.jpg" />
</div>
<div class="count-right">
<div class="count-count">{{count.studyFinishCount}}</div>
<div class="count-tip">{{$t('page.business.home.bzxzsy')}}</div>
</div>
</div>
<div class="count-item">
<div class="count-left">
<img src="@/assets/images/home-icon1.jpg" />
</div>
<div class="count-right">
<div class="count-count">{{count.studyWeekCount}}</div>
<div class="count-tip">{{$t('page.business.home.ywcsy')}}</div>
</div>
</div>
</div>
</el-card>
<el-card class="box-card home-content">
</el-card>
</div> </div>
</template> </template>
<script> <script>
import { home_count} from "@/api/business/home/home";
export default { export default {
name: "Index", name: "Index",
data() { data() {
return { return {
count:{
formTodayCount:'',
formYtjCount:'',
formTbzCount:'',
studyFinishCount:'',
studyWeekCount:'',
},
} }
}, },
created(){
this.getCount()
},
methods: { methods: {
getCount(){
this.count = {
formTodayCount:'',
formYtjCount:'',
formTbzCount:'',
studyFinishCount:'',
studyWeekCount:'',
}
this.$modal.loading()
home_count().then(response => {
this.count = response.data
})
.finally(() => {
this.$modal.closeLoading()
})
}
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.home{
.home-top{
margin-bottom: 20px;
.count-box{
display: flex;
flex-direction: row;
align-items: center;
.count-item{
flex-shrink: 0;
width: 20%;
display: flex;
flex-direction: row;
align-items: center;
.count-left{
flex-shrink: 0;
img{
width: 60px;
}
}
.count-right{
flex-grow: 1;
margin-left: 20px;
.count-count{
font-size: 20px;
font-weight: bold;
}
.count-tip{
margin-top: 10px;
}
}
}
}
}
.home-content{
min-height: 400px;
}
}
</style> </style>

Loading…
Cancel
Save