notice.vue 3.23 KB
<template>
	<v-layout>
		<template slot="breadcrumb">
			<el-breadcrumb-item>系统公告</el-breadcrumb-item>
		</template>
		<template slot="main">
            <div class="ibox">
            	<div class="ibox-title">
            		<h3 class="pull-left">系统介绍</h3>
            	</div>
            	<div class="ibox-content">
            		<div class="info-box" v-for="item in infoList" :key="item.id">
            			<a :href="item.pdfUrl" target="_blank">
            				<img src="../assets/images/usage.png"/>
            				<h5>{{item.bulletinName}}</h5>
            			</a>
            		</div>
            	</div>
            </div>
            <div class="ibox">
            	<div class="ibox-title">
            		<h3 class="pull-left">系统更新动态</h3>
            	</div>
            	<div class="ibox-content">
            		<div class="update-box" v-for="item in updateList" :key="item.id">
            			<a :href="item.pdfUrl" target="_blank">
            				<h4>{{item.bulletinName}}</h4>
            				<span>{{item.updateTime}}</span>
            			</a>
            		</div>
            		<el-pagination
				      @size-change="handleSizeChange"
				      @current-change="handleCurrentChange"
				      :current-page="currentPage"
				      :page-sizes="[10, 20, 30, 40]"
				      :page-size="pageSize"
				      layout="prev, pager, next"
				      :total="updateListTotal">
				    </el-pagination>
            	</div>
            </div>
		</template>
	</v-layout>
</template>
<script>

import {services} from '../api'

const SYSTEM_SERVICE =  services.system;
export default{
	data(){
		return {
			infoList: [],
			updateList: [],
			updateListTotal: 0,
			currentPage: 1,
			pageSize: 10
		}
	},
	created(){
		this.init()
	},
	methods: {
		init(){
			SYSTEM_SERVICE.getSystemInfo().then((result)=>{
				if(result.returnCode == 0){
					this.infoList = result.data;
				}
			});
			this.getUpdateData()
		},
		getUpdateData(curr=this.currentPage, size=this.pageSize){
			let params = {};
			params.currentPage = curr;
			params.pageSize = size;

			SYSTEM_SERVICE.getSystemUpdating(params).then((response)=>{
				if(Array.isArray(response.data)){
					this.updateList = response.data;
					this.updateListTotal = response.recordsTotal;
				}else{
					this.updateList = [];
					this.updateListTotal = 0;
				}
			})
		},
		handleSizeChange(val) {
	      	this.pageSize = val;
	        this.getUpdateData(this.currentPage,this.pageSize)
	    },
      	handleCurrentChange(val) {
      		this.currentPage = val;
        	this.getUpdateData(val)
      	},
    },
	components:{
		
	}
}
</script>
<style scoped>
	.info-box{
		float: left;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		width: 240px;
		height: 140px;
		border-right: 1px solid #eee;
		text-align: center;
	}
	.info-box a{
		color: inherit;
		text-decoration: none;
	}
	.info-box h5{
		margin-top: 10px;
		font-size: 14px;
		color: #333;
	}
	.update-box{
		max-width: 600px;
		border-bottom: 1px solid #eee;
		padding: 10px;
		line-height: 1.5;
	}
	.update-box:last-child{
		border-bottom: none;
	}
	.update-box a{
		color: inherit;
		text-decoration: none;
	}
	.update-box h4{
		color: #333;
		font-size: 14px;
	}
	.update-box span{
		color: #999;
	}
</style>