|
@@ -4,25 +4,36 @@
|
|
|
<div class="select-box">
|
|
|
<div class="search-icon">
|
|
|
<i class="el-icon-search"></i>
|
|
|
- <span> 筛选搜查</span>
|
|
|
+ <span> 筛选搜查</span>
|
|
|
<div class="search-button">
|
|
|
- <el-button @click="resetQuery">重置</el-button>
|
|
|
- <el-button type="primary" @click="handleQuery">查询搜索</el-button>
|
|
|
+ <el-button @click="resetQuery">重置</el-button>
|
|
|
+ <el-button type="primary" @click="handleQuery">查询搜索</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
|
|
- <el-form-item class="inline" label="公告标题: " prop="noticeTitle">
|
|
|
- <el-input v-model="queryParams.noticeTitle" placeholder="筛选公告标题" clearable
|
|
|
- @keyup.enter.native="handleQuery" />
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
|
|
+ <el-form-item class="inline" label="公告标题: " prop="noticeTitle" >
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.noticeTitle"
|
|
|
+ placeholder="筛选公告标题"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="inline" label="发布时间: " prop="createTime">
|
|
|
- <el-date-picker v-model="queryParams.createTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期" placeholder="选择时间范围" @keyup.enter.native="handleQuery" unlink-panels>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.createTime"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ placeholder="选择时间范围"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ unlink-panels >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
|
|
|
<!-- 标题 -->
|
|
|
<el-row>
|
|
@@ -38,53 +49,51 @@
|
|
|
</el-row>
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
- <el-table v-loading="loading" :data="noticeList">
|
|
|
+ <el-table v-loading="loading" :data="noticeList" border>
|
|
|
<el-table-column label="ID" align="center" prop="noticeId" width="100" />
|
|
|
- <el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column
|
|
|
+ label="公告标题"
|
|
|
+ align="center"
|
|
|
+ prop="noticeTitle"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ />
|
|
|
<el-table-column label="发布时间" align="center" prop="createTime" width="170">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="170">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['system:notice:edit']">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['system:notice:remove']">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDetail(scope.row)"
|
|
|
+ >查看详情</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ >删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<!-- 分页 -->
|
|
|
- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList" />
|
|
|
-
|
|
|
- <!-- 添加或修改公告对话框 -->
|
|
|
- <el-dialog title="修改公告" :visible.sync="open" width="780px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="公告标题" prop="noticeTitle">
|
|
|
- <el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="内容">
|
|
|
- <editor v-model="form.noticeContent" :min-height="192" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ :current-page="pagination.current"
|
|
|
+ :page-size="pagination.pageSize"
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :total="pagination.total"
|
|
|
+ @pagination="getList"
|
|
|
+ @current-change="onPageChange"
|
|
|
+ class="paper"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
|
|
|
+import { getNoticeList, deleteNotice } from '@/api/announce/list';
|
|
|
|
|
|
export default {
|
|
|
name: "Notice",
|
|
@@ -108,6 +117,12 @@ export default {
|
|
|
createBy: undefined,
|
|
|
status: undefined
|
|
|
},
|
|
|
+ // 分页参数
|
|
|
+ pagination:{
|
|
|
+ total:0,
|
|
|
+ current:1,
|
|
|
+ pageSize:10,
|
|
|
+ },
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
@@ -125,16 +140,17 @@ export default {
|
|
|
/** 查询公告列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listNotice(this.queryParams).then(response => {
|
|
|
- this.noticeList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
+ getNoticeList({
|
|
|
+ pageIndex: this.pagination.current,
|
|
|
+ pageSize: this.pagination.pageSize
|
|
|
+ }).then( res =>{
|
|
|
+ // console.log("数据",res);
|
|
|
+ let data = res.data.data;
|
|
|
+ this.noticeList = data.noticeList;
|
|
|
+ this.pagination.total = data.total;
|
|
|
+ this.pagination.current = data.pageIndex;
|
|
|
this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
+ })
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
@@ -159,44 +175,27 @@ export default {
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
- this.$router.push({
|
|
|
- path: '/announcement/announcementAdd'
|
|
|
- })
|
|
|
// 路由跳转
|
|
|
+ this.$router.push({name:"announcementAdd"});
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const noticeId = row.noticeId;
|
|
|
- getNotice(noticeId).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改公告";
|
|
|
- });
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm: function () {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.noticeId != undefined) {
|
|
|
- updateNotice(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ // 查看详情
|
|
|
+ handleDetail(row) {
|
|
|
+ this.$router.push({name:"announcementDetail",params:{row}});
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const noticeIds = row.noticeId;
|
|
|
- this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function () {
|
|
|
- return delNotice(noticeIds);
|
|
|
+ this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
|
|
|
+ return deleteNotice({id:noticeIds});
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => { });
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ // 页号发生变化
|
|
|
+ onPageChange(number){
|
|
|
+ this.pagination.current=number;
|
|
|
+ this.getList();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -206,7 +205,6 @@ export default {
|
|
|
.el-row {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
-
|
|
|
.list-title {
|
|
|
height: 50px;
|
|
|
width: 100%;
|
|
@@ -226,22 +224,22 @@ export default {
|
|
|
margin: 10px;
|
|
|
float: right;
|
|
|
}
|
|
|
-
|
|
|
-.select-box {
|
|
|
- border: 1px solid rgb(0, 0, 0, 0.1);
|
|
|
- margin-bottom: 20px;
|
|
|
+.select-box{
|
|
|
+ border: 1px solid rgb(0, 0, 0,0.1);
|
|
|
+ margin-bottom:20px;
|
|
|
padding: 20px;
|
|
|
}
|
|
|
-
|
|
|
-.inline {
|
|
|
+.inline{
|
|
|
margin-right: 30px;
|
|
|
}
|
|
|
-
|
|
|
-.search-icon {
|
|
|
+.search-icon{
|
|
|
padding-bottom: 20px
|
|
|
}
|
|
|
-
|
|
|
-.search-button {
|
|
|
+.search-button{
|
|
|
+ float: right;
|
|
|
+}
|
|
|
+.paper{
|
|
|
float: right;
|
|
|
+ margin-top: 10px;
|
|
|
}
|
|
|
</style>
|