提交代码
parent
5210d86ae1
commit
c601c709e6
|
@ -0,0 +1,34 @@
|
|||
package com.ruoyi.common.enums;
|
||||
|
||||
/**
|
||||
* 工作新闻枚举
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum WorkJournalismEnum {
|
||||
|
||||
DFB("1", "待发布"),
|
||||
YFB("2", "已发布"),
|
||||
YCH("3", "已撤回"),
|
||||
YZD("1", "已置顶"),
|
||||
BZD("0", "不置顶");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
WorkJournalismEnum(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
|
@ -9,6 +9,15 @@ export function listWorkJournalism(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询集团新闻统计
|
||||
export function findWorkJournalismGroupStatus(query) {
|
||||
return request({
|
||||
url: '/work/workJournalism/findWorkJournalismGroupStatus',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询集团新闻详细
|
||||
export function getWorkJournalism(id) {
|
||||
return request({
|
||||
|
|
|
@ -111,7 +111,6 @@ export default {
|
|||
},
|
||||
},
|
||||
created() {
|
||||
debugger;
|
||||
this.getCode();
|
||||
this.getCookie();
|
||||
location.hash = "#/login?redirect=%2Findex";
|
||||
|
|
|
@ -525,19 +525,23 @@ export default {
|
|||
findGroupCount(this.queryParams).then((response) => {
|
||||
if (response && response.data) {
|
||||
let sum = 0;
|
||||
this.tabs.dzg = "待整改(0)";
|
||||
if (response.data.check0) {
|
||||
sum += response.data.check0;
|
||||
this.tabs.dzg = "待整改(" + response.data.check0 + ")";
|
||||
}
|
||||
this.tabs.dqr = "待复检(0)";
|
||||
if (response.data.check1) {
|
||||
sum += response.data.check1;
|
||||
this.tabs.dqr = "待复检(" + response.data.check1 + ")";
|
||||
}
|
||||
this.tabs.ycl = "整改完成(0)";
|
||||
if (response.data.check4) {
|
||||
sum += response.data.check4;
|
||||
this.tabs.ycl = "整改完成(" + response.data.check4 + ")";
|
||||
}
|
||||
this.tabs.all = "全部数据(" + sum + ")";
|
||||
this.tabs.zgcs = "整改超时(0)";
|
||||
if (response.data.check99) {
|
||||
this.tabs.zgcs = "整改超时(" + response.data.check99 + ")";
|
||||
}
|
||||
|
|
|
@ -519,19 +519,23 @@ export default {
|
|||
findGroupCount(this.queryParams).then((response) => {
|
||||
if (response && response.data) {
|
||||
let sum = 0;
|
||||
this.tabs.dzg = "待整改(0)";
|
||||
if (response.data.check0) {
|
||||
sum += response.data.check0;
|
||||
this.tabs.dzg = "待整改(" + response.data.check0 + ")";
|
||||
}
|
||||
this.tabs.dqr = "待复检(0)";
|
||||
if (response.data.check1) {
|
||||
sum += response.data.check1;
|
||||
this.tabs.dqr = "待复检(" + response.data.check1 + ")";
|
||||
}
|
||||
this.tabs.ycl = "整改完成(0)";
|
||||
if (response.data.check4) {
|
||||
sum += response.data.check4;
|
||||
this.tabs.ycl = "整改完成(" + response.data.check4 + ")";
|
||||
}
|
||||
this.tabs.all = "全部数据(" + sum + ")";
|
||||
this.tabs.zgcs = "整改超时(0)";
|
||||
if (response.data.check99) {
|
||||
this.tabs.zgcs = "整改超时(" + response.data.check99 + ")";
|
||||
}
|
||||
|
|
|
@ -1,51 +1,22 @@
|
|||
<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="标题" prop="title">
|
||||
<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="请输入标题"
|
||||
placeholder="请输入新闻标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态标识" prop="statusFlag">
|
||||
<el-select v-model="queryParams.statusFlag" placeholder="请选择状态标识" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.work_journalism_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="置顶标识" prop="topFlag">
|
||||
<el-select v-model="queryParams.topFlag" placeholder="请选择置顶标识" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.work_journalism_top"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sortNum">
|
||||
<el-input
|
||||
v-model="queryParams.sortNum"
|
||||
placeholder="请输入排序"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据状态" prop="isDel">
|
||||
<el-input
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请输入数据状态"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-form-item label="发布时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateTime"
|
||||
style="width: 240px"
|
||||
|
@ -57,7 +28,9 @@
|
|||
></el-date-picker>
|
||||
</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-search" size="mini" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -71,7 +44,8 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['work:workJournalism:add']"
|
||||
>新增</el-button>
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -82,7 +56,8 @@
|
|||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['work:workJournalism:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -93,7 +68,8 @@
|
|||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['work:workJournalism:remove']"
|
||||
>删除</el-button>
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -103,131 +79,169 @@
|
|||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['work:workJournalism:export']"
|
||||
>导出</el-button>
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="workJournalismList" @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="title" />
|
||||
<el-table-column label="主图" align="center" prop="mainImage" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.mainImage" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="简介" align="center" prop="intro" />
|
||||
<el-table-column label="内容" align="center" prop="content" />
|
||||
<el-table-column label="类型" align="center" prop="type" />
|
||||
<el-table-column label="来源" align="center" prop="source" />
|
||||
<el-table-column label="外部地址" align="center" prop="openUrl" />
|
||||
<el-table-column label="阅读次数" align="center" prop="readNum" />
|
||||
<el-table-column label="状态标识" align="center" prop="statusFlag">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.work_journalism_status" :value="scope.row.statusFlag"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="置顶标识" align="center" prop="topFlag">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.work_journalism_top" :value="scope.row.topFlag"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="相关附件" align="center" prop="files" />
|
||||
<el-table-column label="排序" align="center" prop="sortNum" />
|
||||
<el-table-column label="数据状态" align="center" prop="isDel">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建用户" align="center" prop="createUser" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane :label="tabs.all" name="all"></el-tab-pane>
|
||||
<el-tab-pane :label="tabs.yfb" name="yfb"></el-tab-pane>
|
||||
<el-tab-pane :label="tabs.dfb" name="dfb"></el-tab-pane>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="workJournalismList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="新闻标题"
|
||||
align="center"
|
||||
prop="title"
|
||||
width="150"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="新闻主图" align="center" prop="mainImage" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-image
|
||||
ref="preview"
|
||||
style="width: 200px; height: 100px"
|
||||
:src="getImageUrl(scope.row.mainImage)"
|
||||
@click="onPreview(scope.row.mainImage)"
|
||||
>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="简介" align="center" prop="intro" />
|
||||
<el-table-column label="新闻状态" align="center" prop="statusFlag">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.work_journalism_status"
|
||||
:value="scope.row.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="置顶状态" align="center" prop="topFlag">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.work_journalism_top"
|
||||
:value="scope.row.topFlag"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="显示排序"
|
||||
align="center"
|
||||
prop="sortNum"
|
||||
v-if="checkPermi(['work:workJournalism:edit'])"
|
||||
>
|
||||
<el-input-number
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['work:workJournalism:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['work:workJournalism:remove']"
|
||||
>删除</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"
|
||||
/>
|
||||
v-model="scope.row.sortNum"
|
||||
:min="1"
|
||||
:max="999"
|
||||
@change="setSort(scope.row, $event)"
|
||||
></el-input-number>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据状态" align="center" prop="isDel">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发布用户" align="center" prop="createUser" />
|
||||
<el-table-column label="发布时间" align="center" prop="updateTime" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}") }}</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.statusFlag == '1' || scope.row.statusFlag == '3'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-position"
|
||||
@click="handleUpdateStatus(scope.row, 2)"
|
||||
v-hasPermi="['work:workJournalism:edit']"
|
||||
>发布</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.statusFlag == '2'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="handleUpdateStatus(scope.row, 3)"
|
||||
v-hasPermi="['work:workJournalism:edit']"
|
||||
>撤回</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.topFlag == '0'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-sort"
|
||||
@click="handleUpdateTop(scope.row, 1)"
|
||||
v-hasPermi="['work:workJournalism:edit']"
|
||||
>置顶</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.topFlag == '1'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-sort"
|
||||
@click="handleUpdateTop(scope.row, 0)"
|
||||
v-hasPermi="['work:workJournalism:edit']"
|
||||
>取消置顶</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['work:workJournalism:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['work:workJournalism:remove']"
|
||||
>删除</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-tabs>
|
||||
<!-- 添加或修改集团新闻对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="新闻标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入新闻标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主图" prop="mainImage">
|
||||
<image-upload v-model="form.mainImage"/>
|
||||
<el-form-item label="新闻主图" prop="mainImage">
|
||||
<image-upload v-model="form.mainImage" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简介" prop="intro">
|
||||
<el-input v-model="form.intro" placeholder="请输入简介" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
<el-form-item label="新闻内容">
|
||||
<editor v-model="form.content" :min-height="192" />
|
||||
</el-form-item>
|
||||
<el-form-item label="来源" prop="source">
|
||||
<el-input v-model="form.source" placeholder="请输入来源" />
|
||||
</el-form-item>
|
||||
<el-form-item label="外部地址" prop="openUrl">
|
||||
<el-input v-model="form.openUrl" placeholder="请输入外部地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="阅读次数" prop="readNum">
|
||||
<el-input v-model="form.readNum" placeholder="请输入阅读次数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态标识" prop="statusFlag">
|
||||
<el-select v-model="form.statusFlag" placeholder="请选择状态标识">
|
||||
<el-option
|
||||
v-for="dict in dict.type.work_journalism_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="置顶标识" prop="topFlag">
|
||||
<el-select v-model="form.topFlag" placeholder="请选择置顶标识">
|
||||
<el-option
|
||||
v-for="dict in dict.type.work_journalism_top"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="相关附件" prop="files">
|
||||
<el-input v-model="form.files" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sortNum">
|
||||
<el-input v-model="form.sortNum" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据状态" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入数据状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建用户" prop="createUser">
|
||||
<el-input v-model="form.createUser" placeholder="请输入创建用户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
<el-form-item label="相关文件" prop="files">
|
||||
<FileUpload @input="fileInput" :limit="9" v-model="files" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -235,17 +249,31 @@
|
|||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="previewList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listWorkJournalism, getWorkJournalism, delWorkJournalism, addWorkJournalism, updateWorkJournalism } from "@/api/work/workJournalism";
|
||||
import {
|
||||
listWorkJournalism,
|
||||
getWorkJournalism,
|
||||
delWorkJournalism,
|
||||
addWorkJournalism,
|
||||
updateWorkJournalism,
|
||||
findWorkJournalismGroupStatus,
|
||||
} from "@/api/work/workJournalism";
|
||||
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
||||
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
|
||||
|
||||
export default {
|
||||
name: "WorkJournalism",
|
||||
dicts: ['work_journalism_status', 'work_journalism_top'],
|
||||
components: {
|
||||
ElImageViewer,
|
||||
},
|
||||
dicts: ["work_journalism_status", "work_journalism_top", "sys_common_isdel"],
|
||||
data() {
|
||||
return {
|
||||
showViewer: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -276,15 +304,40 @@ export default {
|
|||
sortNum: null,
|
||||
isDel: null,
|
||||
createTime: null,
|
||||
activeName: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
title: [
|
||||
{ required: true, message: "请输入新闻标题", trigger: "blur" },
|
||||
{ max: 20, message: "新闻标题最多30个字符", trigger: "blur" },
|
||||
],
|
||||
mainImage: [{ required: true, message: "请上传新闻主图", trigger: "blur" }],
|
||||
intro: [
|
||||
{ required: false, message: "请输入新闻简介", trigger: "blur" },
|
||||
{ max: 200, message: "新闻简介最多200个字符", trigger: "blur" },
|
||||
],
|
||||
trainTitle: [
|
||||
{ required: true, message: "请输入培训标题", trigger: "blur" },
|
||||
{ max: 20, message: "培训标题最多20个字符", trigger: "blur" },
|
||||
],
|
||||
content: [{ required: true, message: "请输入新闻内容", trigger: "blur" }],
|
||||
files: [{ required: false, message: "请上传相关附件", trigger: "blur" }],
|
||||
},
|
||||
tabs: {
|
||||
all: "全部数据(0)",
|
||||
yfb: "已发布(0)",
|
||||
dfb: "待发布(0)",
|
||||
},
|
||||
previewList: [],
|
||||
files: [],
|
||||
activeName: "yfb",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.queryParams.activeName = this.activeName;
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
@ -292,16 +345,53 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
|
||||
if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) {
|
||||
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
|
||||
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
|
||||
}
|
||||
listWorkJournalism(this.queryParams).then(response => {
|
||||
this.queryCount();
|
||||
listWorkJournalism(this.queryParams).then((response) => {
|
||||
this.workJournalismList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
queryCount() {
|
||||
findWorkJournalismGroupStatus(this.queryParams).then((response) => {
|
||||
if (response && response.data) {
|
||||
let sum = 0;
|
||||
if (response.data.status1) {
|
||||
sum += response.data.status1;
|
||||
}
|
||||
if (response.data.status3) {
|
||||
sum += response.data.status3;
|
||||
}
|
||||
this.tabs.dfb = "待发布(" + sum + ")";
|
||||
this.tabs.yfb = "已发布(0)";
|
||||
if (response.data.status2) {
|
||||
sum += response.data.status2;
|
||||
this.tabs.yfb = "已发布(" + response.data.status2 + ")";
|
||||
}
|
||||
this.tabs.all = "全部数据(" + sum + ")";
|
||||
}
|
||||
});
|
||||
},
|
||||
getImageUrl(url) {
|
||||
return process.env.VUE_APP_BASE_API + url + ".min.jpg";
|
||||
},
|
||||
onPreview(url) {
|
||||
this.previewList = [];
|
||||
this.previewList.push(process.env.VUE_APP_BASE_API + url);
|
||||
this.showViewer = true;
|
||||
},
|
||||
closeViewer() {
|
||||
this.showViewer = false;
|
||||
},
|
||||
// 页签点击
|
||||
handleClick() {
|
||||
this.queryParams.activeName = this.activeName;
|
||||
this.getList();
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
|
@ -329,7 +419,7 @@ export default {
|
|||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
@ -346,9 +436,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() {
|
||||
|
@ -359,25 +449,58 @@ export default {
|
|||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getWorkJournalism(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getWorkJournalism(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改集团新闻";
|
||||
});
|
||||
},
|
||||
//修改新闻状态
|
||||
handleUpdateStatus(row, status) {
|
||||
const id = row.id || this.ids;
|
||||
this.form.id = id;
|
||||
this.form.statusFlag = status;
|
||||
updateWorkJournalism(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
//修改新闻状态
|
||||
handleUpdateTop(row, top) {
|
||||
const id = row.id || this.ids;
|
||||
this.form.id = id;
|
||||
this.form.topFlag = top;
|
||||
updateWorkJournalism(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
//新闻排序控制
|
||||
setProjectSort(row, val) {
|
||||
let param = {
|
||||
id: row.id,
|
||||
sortNum: val,
|
||||
};
|
||||
updateWorkJournalism(param).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateWorkJournalism(this.form).then(response => {
|
||||
updateWorkJournalism(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addWorkJournalism(this.form).then(response => {
|
||||
this.form.type = 1;
|
||||
this.form.source = 1;
|
||||
addWorkJournalism(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
@ -389,19 +512,37 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除集团新闻编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delWorkJournalism(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal
|
||||
.confirm('是否确认删除集团新闻编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delWorkJournalism(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
//文件输入
|
||||
fileInput(files) {
|
||||
let file = "";
|
||||
if (files.length > 0) {
|
||||
files.forEach((item) => {
|
||||
file += "," + item.url;
|
||||
});
|
||||
this.form.files = file.substring(1);
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('work/workJournalism/export', {
|
||||
...this.queryParams
|
||||
}, `workJournalism_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
this.download(
|
||||
"work/workJournalism/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`workJournalism_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -46,6 +46,16 @@ public class WorkJournalismController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询集团新闻列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('work:workJournalism:list')")
|
||||
@GetMapping("/findWorkJournalismGroupStatus")
|
||||
public AjaxResult findWorkJournalismGroupStatus(WorkJournalism workJournalism)
|
||||
{
|
||||
return success(workJournalismService.findWorkJournalismGroupStatus(workJournalism));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出集团新闻列表
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 集团新闻对象 work_journalism
|
||||
*
|
||||
|
@ -74,6 +76,8 @@ public class WorkJournalism extends BaseEntity
|
|||
@Excel(name = "创建用户")
|
||||
private String createUser;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
@ -210,6 +214,14 @@ public class WorkJournalism extends BaseEntity
|
|||
return createUser;
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.yanzhu.jh.work.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.yanzhu.jh.work.domain.WorkJournalism;
|
||||
|
||||
/**
|
||||
|
@ -27,6 +29,14 @@ public interface WorkJournalismMapper
|
|||
*/
|
||||
public List<WorkJournalism> selectWorkJournalismList(WorkJournalism workJournalism);
|
||||
|
||||
/**
|
||||
* 查询集团新闻统计
|
||||
*
|
||||
* @param workJournalism 集团新闻
|
||||
* @return 集团新闻集合
|
||||
*/
|
||||
public List<Map<String,Object>> findWorkJournalismGroupStatus(WorkJournalism workJournalism);
|
||||
|
||||
/**
|
||||
* 新增集团新闻
|
||||
*
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.yanzhu.jh.work.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.yanzhu.jh.work.domain.WorkJournalism;
|
||||
|
||||
/**
|
||||
|
@ -27,6 +29,14 @@ public interface IWorkJournalismService
|
|||
*/
|
||||
public List<WorkJournalism> selectWorkJournalismList(WorkJournalism workJournalism);
|
||||
|
||||
/**
|
||||
* 查询集团新闻统计
|
||||
*
|
||||
* @param workJournalism 集团新闻
|
||||
* @return 集团新闻集合
|
||||
*/
|
||||
public Map<String,Object> findWorkJournalismGroupStatus(WorkJournalism workJournalism);
|
||||
|
||||
/**
|
||||
* 新增集团新闻
|
||||
*
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package com.yanzhu.jh.work.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.common.enums.WorkJournalismEnum;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -44,6 +49,22 @@ public class WorkJournalismServiceImpl implements IWorkJournalismService
|
|||
return workJournalismMapper.selectWorkJournalismList(workJournalism);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询集团新闻统计
|
||||
*
|
||||
* @param workJournalism 集团新闻
|
||||
* @return 集团新闻集合
|
||||
*/
|
||||
public Map<String,Object> findWorkJournalismGroupStatus(WorkJournalism workJournalism){
|
||||
List<Map<String, Object>> dataList = workJournalismMapper.findWorkJournalismGroupStatus(workJournalism);
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
if(dataList!=null && dataList.size()>0){
|
||||
for(Map<String, Object> map:dataList){
|
||||
dataMap.put("status"+map.get("statusFlag"),map.get("total"));
|
||||
}
|
||||
}
|
||||
return dataMap;
|
||||
}
|
||||
/**
|
||||
* 新增集团新闻
|
||||
*
|
||||
|
@ -53,6 +74,8 @@ public class WorkJournalismServiceImpl implements IWorkJournalismService
|
|||
@Override
|
||||
public int insertWorkJournalism(WorkJournalism workJournalism)
|
||||
{
|
||||
workJournalism.setStatusFlag(WorkJournalismEnum.DFB.getCode());
|
||||
workJournalism.setTopFlag(WorkJournalismEnum.BZD.getCode());
|
||||
workJournalism.setCreateBy(SecurityUtils.getUsername());
|
||||
workJournalism.setCreateTime(DateUtils.getNowDate());
|
||||
return workJournalismMapper.insertWorkJournalism(workJournalism);
|
||||
|
@ -67,6 +90,10 @@ public class WorkJournalismServiceImpl implements IWorkJournalismService
|
|||
@Override
|
||||
public int updateWorkJournalism(WorkJournalism workJournalism)
|
||||
{
|
||||
if(WorkJournalismEnum.YFB.getCode().equals(workJournalism.getStatusFlag())){
|
||||
workJournalism.setCreateUser(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
workJournalism.setCreateDate(new Date());
|
||||
}
|
||||
workJournalism.setUpdateBy(SecurityUtils.getUsername());
|
||||
workJournalism.setUpdateTime(DateUtils.getNowDate());
|
||||
return workJournalismMapper.updateWorkJournalism(workJournalism);
|
||||
|
|
|
@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="sortNum" column="sort_num" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
@ -28,19 +29,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectWorkJournalismVo">
|
||||
select id, title, main_image, intro, content, type, source, open_url, read_num, status_flag, top_flag, files, sort_num, is_del, create_user, create_by, create_time, update_by, update_time, remark from work_journalism
|
||||
select id, title, main_image, intro, content, type, source, open_url, read_num, status_flag, top_flag, files, sort_num, is_del, create_user, create_date, create_by, create_time, update_by, update_time, remark from work_journalism
|
||||
</sql>
|
||||
|
||||
<select id="selectWorkJournalismList" parameterType="WorkJournalism" resultMap="WorkJournalismResult">
|
||||
<include refid="selectWorkJournalismVo"/>
|
||||
<where>
|
||||
select id, title, main_image, intro, type, source, open_url, read_num, status_flag, top_flag, files, sort_num, is_del, create_user, create_date, create_by, create_time, update_by, update_time, remark from work_journalism
|
||||
<where>
|
||||
and is_del=0
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||
<if test="statusFlag != null and statusFlag != ''"> and status_flag = #{statusFlag}</if>
|
||||
<if test="topFlag != null and topFlag != ''"> and top_flag = #{topFlag}</if>
|
||||
<if test="sortNum != null "> and sort_num = #{sortNum}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_date between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
<if test='activeName == "dfb"'> and status_flag in (1,3)</if>
|
||||
<if test='activeName == "yfb"'> and status_flag=2</if>
|
||||
</where>
|
||||
order by top_flag desc, sort_num asc, create_date desc
|
||||
</select>
|
||||
|
||||
<select id="findWorkJournalismGroupStatus" parameterType="WorkJournalism" resultType="map">
|
||||
select status_flag as statusFlag, count(id) as total from work_journalism
|
||||
<where>
|
||||
and is_del=0
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_date between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
group by status_flag
|
||||
</select>
|
||||
|
||||
<select id="selectWorkJournalismById" parameterType="Long" resultMap="WorkJournalismResult">
|
||||
|
@ -65,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sortNum != null">sort_num,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
|
@ -86,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sortNum != null">#{sortNum},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
|
@ -111,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sortNum != null">sort_num = #{sortNum},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createUser != null">create_user = #{createUser},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
|
|
Loading…
Reference in New Issue