离校前端框架,包括数据字典、工作队伍、新闻公告模块
diff --git a/leave-school-vue/src/views/news/newview/index.vue b/leave-school-vue/src/views/news/newview/index.vue
new file mode 100644
index 0000000..09a9ab3
--- /dev/null
+++ b/leave-school-vue/src/views/news/newview/index.vue
@@ -0,0 +1,107 @@
+<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">
+ <span>{{scope.row.ggbt}}</span>
+ </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>
+ </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 {
+ gglxList: []
+ }
+ },
+ created() {
+ this.getGglxList()
+ this.handlePageList()
+ this.height = window.innerHeight - 216
+ },
+ methods: {
+ getGglxList() {
+ getDicList({ type: '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>