Browse Source

feat: [工作台] 系统提示

lkf
memorylkf 3 months ago
parent
commit
bfca3aba02
2 changed files with 67 additions and 2 deletions
  1. +7
    -0
      src/api/business/home/home.js
  2. +60
    -2
      src/views/index.vue

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

@ -7,3 +7,10 @@ export function home_count(query) {
params: query
})
}
export function home_noticeList(query) {
return request({
url: '/system/business/home/noticeList',
method: 'get',
params: query
})
}

+ 60
- 2
src/views/index.vue View File

@ -51,13 +51,30 @@
</el-card>
<el-card class="box-card home-content">
<div slot="header" class="clearfix">
<span>系统通知</span>
</div>
<div class="notice-list" v-loading="loading">
<div class="notice-item" v-for="(item,index) in noticeList" :key="index">
<div class="notice-title"><el-badge is-dot class="notice-dot"></el-badge>{{item.title}}</div>
<div class="notice-date">{{item.createTime}}</div>
</div>
<pagination
v-show="noticeTotal>0"
:total="noticeTotal"
:page.sync="searchForm.pageNum"
:limit.sync="searchForm.pageSize"
@pagination="getNoticeList"
/>
</div>
</el-card>
</div>
</template>
<script>
import { home_count} from "@/api/business/home/home";
import { home_count,home_noticeList} from "@/api/business/home/home";
export default {
name: "Index",
data() {
@ -69,10 +86,18 @@ export default {
studyFinishCount:'',
studyWeekCount:'',
},
loading:false,
searchForm: {
pageNum: 1,
pageSize: 10,
},
noticeList:[],
noticeTotal:0
}
},
created(){
this.getCount()
this.getNoticeList()
},
methods: {
getCount(){
@ -90,6 +115,17 @@ export default {
.finally(() => {
this.$modal.closeLoading()
})
},
getNoticeList(){
this.loading = true;
this.searchForm.startDate = this.daterange && this.daterange.length > 0 ? this.daterange[0] : ''
this.searchForm.endDate = this.daterange && this.daterange.length > 1 ? this.daterange[1] : ''
home_noticeList(this.searchForm).then(response => {
this.noticeList = response.rows;
this.noticeTotal = response.total;
}).finally(()=>{
this.loading = false;
})
}
}
}
@ -131,6 +167,28 @@ export default {
}
.home-content{
min-height: 400px;
.notice-list{
.notice-item{
display: flex;
flex-direction: row;
justify-content: space-between;
border-bottom: 1px solid #eee;
margin-bottom: 10px;
padding-bottom: 5px;
font-size: 12px;
.notice-title{
flex-shrink: 0;
.notice-dot{
margin-right: 2px;
margin-top: 5px;
}
}
.notice-date{
flex-grow: 1;
text-align: right;
}
}
}
}
}
</style>

Loading…
Cancel
Save