|
@@ -1,15 +1,42 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="字典类型id(1.要闻咨询,2.政策法规,3.通知公告,4.政策解读)" prop="type">
|
|
|
- <el-select v-model="queryParams.type" placeholder="请选择字典类型id(1.要闻咨询,2.政策法规,3.通知公告,4.政策解读)" clearable filterable/>
|
|
|
+ <el-form
|
|
|
+ :model="queryParams"
|
|
|
+ ref="queryForm"
|
|
|
+ size="small"
|
|
|
+ :inline="true"
|
|
|
+ v-show="showSearch"
|
|
|
+ label-width="68px"
|
|
|
+ >
|
|
|
+ <el-form-item label="标题" prop="title">
|
|
|
+ <el-input v-model="queryParams.title" placeholder="请输入标题"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态(0.草稿,1.下架,2.审核中,3.审核驳回,4.已发布,5.已上报)" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="请选择状态(0.草稿,1.下架,2.审核中,3.审核驳回,4.已发布,5.已上报)" clearable filterable/>
|
|
|
+ <el-form-item label="新闻状态" prop="status">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.status"
|
|
|
+ placeholder="请选择新闻状态"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="status in statusOptionList"
|
|
|
+ :key="status.value"
|
|
|
+ :label="status.label"
|
|
|
+ :value="status.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ @click="handleQuery"
|
|
|
+ >搜索</el-button
|
|
|
+ >
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
@@ -22,9 +49,11 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['business:NEWS:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增新闻</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
+ <!-- 以下暂时不需要 -->
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="success"
|
|
|
plain
|
|
@@ -33,7 +62,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['business:NEWS:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -44,7 +74,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['business:NEWS:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -54,81 +85,238 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['business:NEWS:export']"
|
|
|
- >导出</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
+ </el-col> -->
|
|
|
+ <right-toolbar
|
|
|
+ :showSearch.sync="showSearch"
|
|
|
+ @queryTable="getList"
|
|
|
+ ></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="NEWSList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="主键" align="center" prop="id"/>
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime"/>
|
|
|
- <el-table-column label="创建人" align="center" prop="createBy"/>
|
|
|
- <el-table-column label="修改时间" align="center" prop="updateTime"/>
|
|
|
- <el-table-column label="修改人" align="center" prop="updateBy"/>
|
|
|
- <el-table-column label="删除标志" align="center" prop="delFlag"/>
|
|
|
- <el-table-column label="部门ID" align="center" prop="deptId"/>
|
|
|
- <el-table-column label="标题" align="center" prop="title"/>
|
|
|
- <el-table-column label="内容" align="center" prop="content"/>
|
|
|
- <el-table-column label="附件" align="center" prop="fileUrl"/>
|
|
|
- <el-table-column label="字典类型id(1.要闻咨询,2.政策法规,3.通知公告,4.政策解读)" align="center" prop="type"/>
|
|
|
- <el-table-column label="字典类型名称" align="center" prop="typeName"/>
|
|
|
- <el-table-column label="图片" align="center" prop="picture"/>
|
|
|
- <el-table-column label="状态(0.草稿,1.下架,2.审核中,3.审核驳回,4.已发布,5.已上报)" align="center" prop="status"/>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="NEWSList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection"></el-table-column>
|
|
|
+ <el-table-column label="标题" align="center" prop="title" width="250">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ scope.row.title }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="编辑日期"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ prop="updateTime"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.updateTime ? scope.row.updateTime.substr(0, 10) : "无" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="审核日期"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ prop="audit_time"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.audit_time ? scope.row.audit_time.substr(0, 10) : "无" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="上报日期"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ prop="report_date"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.row.report_date ? scope.row.report_date.substr(0, 10) : "无"
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="发布日期"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ prop="release_date"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.row.release_date ? scope.row.release_date.substr(0, 10) : "无"
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="新闻状态"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ prop="status"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.status == 0"><el-tag>草稿</el-tag></span>
|
|
|
+ <span v-if="scope.row.status == 1"
|
|
|
+ ><el-tag type="warning">审核中</el-tag></span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.status == 2"
|
|
|
+ ><el-tag type="info">审核驳回</el-tag></span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.status == 3"
|
|
|
+ ><el-tag type="success">已审核</el-tag></span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.status == 4"
|
|
|
+ ><el-tag type="success">已发布</el-tag></span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.status == 5"
|
|
|
+ ><el-tag type="danger">已下架</el-tag></span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.status == 6"><el-tag>已置顶</el-tag></span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
+ v-if="scope.row.status == 4"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDownOrUp(scope.row)"
|
|
|
+ v-hasPermi="['business:NEWS:remove']"
|
|
|
+ >下架</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.status == 0 || scope.row.status == 2"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['business:NEWS:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ v-hasPermi="['business:NEWS:remove']"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
+ v-if="scope.row.status == 5"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
+ @click="handleDownOrUp(scope.row)"
|
|
|
v-hasPermi="['business:NEWS:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >发布</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
|
|
|
- <!-- 添加或修改网站新闻对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <!-- <!– 添加或修改网站新闻对话框 –>-->
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ width="1000px"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="内容" prop="content">
|
|
|
- <editor v-model="form.content" :min-height="192"/>
|
|
|
+ <el-form-item label="标题" prop="title">
|
|
|
+ <el-input v-model="form.title" placeholder="请输入标题"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="封面图" prop="picture">
|
|
|
+ <el-upload
|
|
|
+ action="#"
|
|
|
+ list-type="picture-card"
|
|
|
+ :limit="1"
|
|
|
+ :auto-upload="true"
|
|
|
+ :http-request="httprequest"
|
|
|
+ :before-upload="beforeupload"
|
|
|
+ :file-list="fileList"
|
|
|
+ >
|
|
|
+ <i slot="default" class="el-icon-plus"></i>
|
|
|
+ <div slot="file" slot-scope="{ file }">
|
|
|
+ <img class="el-upload-list__item-thumbnail" :src="file.url" />
|
|
|
+
|
|
|
+ <!-- 放大预览 -->
|
|
|
+ <span class="el-upload-list__item-actions">
|
|
|
+ <span
|
|
|
+ class="el-upload-list__item-preview"
|
|
|
+ @click="handlePictureCardPreview(file)"
|
|
|
+ >
|
|
|
+ <i class="el-icon-zoom-in"></i>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <!-- 下载用的,暂时不需要 -->
|
|
|
+ <!-- <span
|
|
|
+ v-if="!disabled"
|
|
|
+ class="el-upload-list__item-delete"
|
|
|
+ @click="handleDownload(file)"
|
|
|
+ >
|
|
|
+ <i class="el-icon-download"></i>
|
|
|
+ </span> -->
|
|
|
+
|
|
|
+ <!-- 删除图片 -->
|
|
|
+ <span
|
|
|
+ v-if="!disabled"
|
|
|
+ class="el-upload-list__item-delete"
|
|
|
+ @click="handleRemove(file)"
|
|
|
+ >
|
|
|
+ <i class="el-icon-delete"></i>
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="字典类型id(1.要闻咨询,2.政策法规,3.通知公告,4.政策解读)" prop="type">
|
|
|
- <el-select v-model="form.type" placeholder="请选择字典类型id(1.要闻咨询,2.政策法规,3.通知公告,4.政策解读)" filterable/>
|
|
|
+
|
|
|
+ <!-- <el-form-item label="附件" prop="content"> </el-form-item> -->
|
|
|
+
|
|
|
+ <el-form-item label="新闻内容" prop="content">
|
|
|
+ <editor v-model="form.content" :min-height="192" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态(0.草稿,1.下架,2.审核中,3.审核驳回,4.已发布,5.已上报)"/>
|
|
|
</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-dialog :visible.sync="dialogVisible">
|
|
|
+ <img width="100%" :src="form.picture" alt="" />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listNEWS, getNEWS, delNEWS, addNEWS, updateNEWS } from "@/api/news/NEWS";
|
|
|
+import {
|
|
|
+ listNEWS,
|
|
|
+ getNEWS,
|
|
|
+ delNEWS,
|
|
|
+ addNEWS,
|
|
|
+ updateNEWS,
|
|
|
+ upload,
|
|
|
+} from "@/api/portal/news/NEWS.js";
|
|
|
|
|
|
export default {
|
|
|
name: "NEWS",
|
|
|
data() {
|
|
|
return {
|
|
|
+ fileList: [],
|
|
|
+ dialogVisible: false,
|
|
|
+ disabled: false,
|
|
|
// 根路径
|
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|
|
// 遮罩层
|
|
@@ -163,46 +351,48 @@ export default {
|
|
|
title: null,
|
|
|
content: null,
|
|
|
fileUrl: null,
|
|
|
- type: null,
|
|
|
+ type: 1, //要闻资讯
|
|
|
typeName: null,
|
|
|
picture: null,
|
|
|
- status: null
|
|
|
+ status: null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- id: [
|
|
|
- { required: true, message: "主键不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- delFlag: [
|
|
|
- { required: true, message: "删除标志不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- deptId: [
|
|
|
- { required: true, message: "部门ID不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- title: [
|
|
|
- { required: true, message: "标题不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- content: [
|
|
|
- { required: true, message: "内容不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- fileUrl: [
|
|
|
- { required: true, message: "附件不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
+ title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
|
|
|
+ content: [{ required: true, message: "内容不能为空", trigger: "blur" }],
|
|
|
+ fileUrl: [{ required: true, message: "附件不能为空", trigger: "blur" }],
|
|
|
type: [
|
|
|
- { required: true, message: "字典类型id(1.要闻咨询,2.政策法规,3.通知公告,4.政策解读)不能为空", trigger: "change" }
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message:
|
|
|
+ "字典类型id(1.要闻咨询,2.政策法规,3.通知公告,4.政策解读)不能为空",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
],
|
|
|
typeName: [
|
|
|
- { required: true, message: "字典类型名称不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- picture: [
|
|
|
- { required: true, message: "图片不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "字典类型名称不能为空", trigger: "blur" },
|
|
|
],
|
|
|
+ picture: [{ required: true, message: "图片不能为空", trigger: "blur" }],
|
|
|
status: [
|
|
|
- { required: true, message: "状态(0.草稿,1.下架,2.审核中,3.审核驳回,4.已发布,5.已上报)不能为空", trigger: "blur" }
|
|
|
- ]
|
|
|
- }
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message:
|
|
|
+ "状态(0.草稿,1.下架,2.审核中,3.审核驳回,4.已发布,5.已上报)不能为空",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ statusOptionList: [
|
|
|
+ { label: "草稿", value: 0 },
|
|
|
+ { label: "审核中", value: 1 },
|
|
|
+ { label: "审核驳回", value: 2 },
|
|
|
+ { label: "已审核", value: 3 },
|
|
|
+ { label: "已发布", value: 4 },
|
|
|
+ { label: "已下架", value: 5 },
|
|
|
+ { label: "已置顶", value: 6 },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -212,12 +402,54 @@ export default {
|
|
|
/** 查询网站新闻列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listNEWS(this.queryParams).then(response => {
|
|
|
+ listNEWS(this.queryParams).then((response) => {
|
|
|
this.NEWSList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ httprequest() {},
|
|
|
+ beforeupload(file) {
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("file", file);
|
|
|
+ upload(formData).then((res) => {
|
|
|
+ this.$modal.msgSuccess(res.msg);
|
|
|
+ this.form.picture = res.url;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleRemove(file) {
|
|
|
+ this.form.picture = "";
|
|
|
+ this.fileList = []
|
|
|
+ },
|
|
|
+ handlePictureCardPreview(file) {
|
|
|
+ this.form.picture = file.url;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ handleDownload(file) {
|
|
|
+ console.log(file);
|
|
|
+ },
|
|
|
+ handleDownOrUp(row) {
|
|
|
+ //修改发布、下架状态
|
|
|
+ if (row.status == 4) {
|
|
|
+ //已发布
|
|
|
+ row.status = 5;
|
|
|
+ updateNEWS(row).then((response) => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ this.reset();
|
|
|
+ });
|
|
|
+ } else if (row.status == 5) {
|
|
|
+ //已下架
|
|
|
+ row.status = 4;
|
|
|
+ updateNEWS(row).then((response) => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ this.reset();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -235,8 +467,9 @@ export default {
|
|
|
type: null,
|
|
|
typeName: null,
|
|
|
picture: null,
|
|
|
- status: "0"
|
|
|
+ status: "0",
|
|
|
};
|
|
|
+ this.fileList = [];
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
@@ -251,9 +484,9 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
@@ -264,28 +497,33 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
- getNEWS(id).then(response => {
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getNEWS(id).then((response) => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改网站新闻";
|
|
|
+ if (this.form.picture) {
|
|
|
+ this.fileList.push({ name: "xxx", url: this.form.picture });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
- updateNEWS(this.form).then(response => {
|
|
|
+ updateNEWS(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
+ this.reset();
|
|
|
});
|
|
|
} else {
|
|
|
- addNEWS(this.form).then(response => {
|
|
|
+ addNEWS(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
+ this.reset();
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -294,19 +532,27 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除网站新闻编号为"' + ids + '"的数据项?').then(function() {
|
|
|
- return delNEWS(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.$modal
|
|
|
+ .confirm('是否确认删除网站新闻编号为"' + ids + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return delNEWS(ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- this.download('business/NEWS/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `NEWS_${new Date().getTime()}.xlsx`)
|
|
|
- }
|
|
|
- }
|
|
|
+ this.download(
|
|
|
+ "business/NEWS/export",
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ },
|
|
|
+ `NEWS_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|