blob: 25a9e5f20cc2fb12f9e847c18b60889f00b9cd2f [file] [log] [blame]
<template>
<div class="app-container">
<div class="filter-container">
<el-row :gutter="20">
<el-col :span="4">
<el-select clearable class="filter-item" v-model="listQuery.gglx" placeholder="类型名称">
<el-option v-for="item in gglxList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="公告标题" v-model="listQuery.ggbt">
</el-input>
</el-col>
<el-col :span="12">
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查询</el-button>
<el-button class="filter-item" style="margin-left: 10px;" @click="handleReset" type="primary" icon="el-icon-edit">重置</el-button>
</el-col>
</el-row>
</div>
<el-table :height="height" :data="items" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
<el-table-column align="center" type="index" label='序号' width="95">
</el-table-column>
<el-table-column label="类型名称" align="center">
<template slot-scope="scope">
{{scope.row.gglx}}
</template>
</el-table-column>
<el-table-column label="公告标题" align="center">
<template slot-scope="scope">
<a href="javascript:void(0);" @click="showDetail(scope.row)">{{scope.row.ggbt}}</a>
</template>
</el-table-column>
<el-table-column label="接收对象类型" align="center">
<template slot-scope="scope">
{{scope.row.jszlx}}
</template>
</el-table-column>
<el-table-column label="发布人" align="center">
<template slot-scope="scope">
{{scope.row.fbr}}
</template>
</el-table-column>
<el-table-column label="发布日期" align="center">
<template slot-scope="scope">
{{scope.row.fbrq}}
</template>
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.pageIndex" :page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="recordCount">
</el-pagination>
</div>
<el-dialog :visible.sync="dialogFormVisible" width="80%" top="10vh">
<el-row>
<el-col :span="24">
<h3 class="news-title">
{{title}}
</h3>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="news-bar">
{{subtitle}}
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="news-content" v-html="content">
</div>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer" style="text-align:center">
<el-button @click="dialogFormVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getList } from '@/api/newspublish-api'
import { getDicList } from '@/api/dictionary-api'
import waves from '@/directive/waves' // 水波纹指令
import { resetForm } from '@/utils'
import { crudPageList } from '@/utils/crud'
import mixindata from '@/utils/crud'
export default {
name: 'newview',
directives: {
waves
},
mixins: [mixindata],
data() {
return {
title: null,
subtitle: null,
content: null,
gglxList: []
}
},
created() {
this.getGglxList()
this.handlePageList()
this.height = window.innerHeight - 216
},
methods: {
showDetail(item) {
this.title = item.ggbt
this.subtitle = '发布人: ' + item.fbr + ' ' + '发布时间:' + item.fbrq
this.content = item.ggnr
this.dialogFormVisible = true
},
getGglxList() {
getDicList({ dicType: 'gglx' }).then(response => {
this.gglxList = response.items
})
},
handlePageList() {
crudPageList(this, getList)
},
handleReset() {
resetForm(this.listQuery)
},
handleFilter() {
this.listQuery.pageIndex = 1
this.handlePageList()
},
handleSizeChange(val) {
this.listQuery.pageSize = val
this.handlePageList()
},
handleCurrentChange(val) {
this.listQuery.pageIndex = val
this.handlePageList()
}
}
}
</script>
<style scoped>
.app-container a {
color: #00a4f4;
text-decoration: none;
}
.news-title {
color: #f8043d;
font-family: "黑体";
font-size: 20px;
clear: both;
padding-top: 15px;
padding-bottom: 15px;
padding-right: 20px;
padding-left: 20px;
line-height: 1.5em;
text-align: center;
font-weight: bold;
border-bottom: 3px #c4d8f7 solid;
margin: 10px 0px;
}
.news-bar {
text-align: center;
color: #666;
font-size: 12px;
}
.news-content {
padding: 20px;
}
</style>