| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="公告标题">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="公告标题" prop="noticeTitle">
|
| | | <el-input
|
| | | v-model="queryParams.noticeTitle"
|
| | | placeholder="请输入公告标题"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="操作人员">
|
| | | <el-form-item label="操作人员" prop="createBy">
|
| | | <el-input
|
| | | v-model="queryParams.createBy"
|
| | | placeholder="请输入操作人员"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="类型">
|
| | | <el-form-item label="类型" prop="noticeType">
|
| | | <el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in typeOptions"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:notice:add']">新增</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="noticeList">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:notice:add']"
|
| | | >新增</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:notice:edit']"
|
| | | >修改</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:notice:remove']"
|
| | | >删除</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="序号" align="center" prop="noticeId" width="100" />
|
| | | <el-table-column
|
| | | label="公告标题"
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
|
| | | import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice";
|
| | | import Editor from '@/components/Editor';
|
| | |
|
| | | export default {
|
| | |
| | | return {
|
| | | // 遮罩层
|
| | | loading: true,
|
| | | // 选中数组
|
| | | ids: [],
|
| | | // 非单个禁用
|
| | | single: true,
|
| | | // 非多个禁用
|
| | | multiple: true,
|
| | | // 总条数
|
| | | total: 0,
|
| | | // 公告表格数据
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** 重置按钮操作 */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // 多选框选中数据
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.noticeId)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** 新增按钮操作 */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | |
| | | /** 修改按钮操作 */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getNotice(row.noticeId).then(response => {
|
| | | const noticeId = row.noticeId || this.ids
|
| | | getNotice(noticeId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "修改公告";
|
| | |
| | | },
|
| | | /** 删除按钮操作 */
|
| | | handleDelete(row) {
|
| | | this.$confirm('是否确认删除公告标题为"' + row.noticeTitle + '"的数据项?', "警告", {
|
| | | const noticeIds = row.noticeId || this.ids
|
| | | this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", {
|
| | | confirmButtonText: "确定",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delNotice(row.noticeId);
|
| | | return delNotice(noticeIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("删除成功");
|