通知公告更改
parent
770d9da1b6
commit
b1ae09169f
|
@ -9,6 +9,28 @@ export function listNotice(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateAsUserDept(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/userDept/UpdateAsUserDept?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getNum(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/userDept/GetNum?noticeId=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getNoticeList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/GetNoticeList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询公告详细
|
// 查询公告详细
|
||||||
export function getNotice(noticeId) {
|
export function getNotice(noticeId) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -41,4 +63,4 @@ export function delNotice(noticeId) {
|
||||||
url: '/system/notice/' + noticeId,
|
url: '/system/notice/' + noticeId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,13 @@
|
||||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
|
<!-- <el-badge :value="messageTotal" class="item" style="margin-bottom: 25px;margin-right: 10px">-->
|
||||||
|
<!-- <el-button size="small" @click="noticeTableList()">公告</el-button>-->
|
||||||
|
<!-- </el-badge>-->
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
|
<i class="el-icon-message-solid" @click="noticeTableList"></i>
|
||||||
<search id="header-search" class="right-menu-item"/>
|
<search id="header-search" class="right-menu-item"/>
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
||||||
|
|
||||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
@ -35,6 +38,81 @@
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="公告"
|
||||||
|
:visible.sync="noticeTableVisible"
|
||||||
|
width="50%">
|
||||||
|
<el-radio-group v-model="form.noticeType" @change="getNoticeList">
|
||||||
|
<el-radio-button label="">全部</el-radio-button>
|
||||||
|
<el-radio-button label="1">通知</el-radio-button>
|
||||||
|
<el-radio-button label="2">公告</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<br> <br>
|
||||||
|
<el-radio-group v-model="form.isRead" @change="getNoticeList">
|
||||||
|
<el-radio-button label="">全部</el-radio-button>
|
||||||
|
<el-radio-button label="0">已读</el-radio-button>
|
||||||
|
<el-radio-button label="1">未读</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<br><br><br>
|
||||||
|
<el-card class="box-card" v-for="notice in noticeAttr">
|
||||||
|
|
||||||
|
<!-- <div slot="header" class="clearfix">-->
|
||||||
|
<!-- <span>卡片名称</span>-->
|
||||||
|
<!-- <el-button style="float: right">阅 读 消 息</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div v-for="o in 4" :key="o" class="text item">-->
|
||||||
|
<!-- {{'列表内容 ' + o }}-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<el-descriptions class="margin-top" :title="notice.noticeTitle" :column="2" :size="size" border>
|
||||||
|
<template slot="extra">
|
||||||
|
<el-button size="small" @click="readNotice(notice)">阅读消息</el-button>
|
||||||
|
</template>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-user"></i>
|
||||||
|
消息发布时间
|
||||||
|
</template>
|
||||||
|
{{notice.createTime}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-user"></i>
|
||||||
|
消息发布人
|
||||||
|
</template>
|
||||||
|
{{notice.createBy}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-tickets"></i>
|
||||||
|
消息类型
|
||||||
|
</template>
|
||||||
|
<dict-tag :options="dict.type.sys_notice_type" :value="notice.noticeType"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-office-building"></i>
|
||||||
|
消息当前状态
|
||||||
|
</template>
|
||||||
|
<dict-tag :options="dict.type.is_read" :value="notice.isRead"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="noticeTableVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="noticeTableVisible = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
:title="noticeInfo.noticeTitle"
|
||||||
|
:visible.sync="noticeVisble"
|
||||||
|
width="30%">
|
||||||
|
<editor v-model="noticeInfo.noticeContent" :min-height="192"/>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="noticeVisble = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="noticeVisble = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -46,8 +124,51 @@ import Hamburger from '@/components/Hamburger'
|
||||||
import Screenfull from '@/components/Screenfull'
|
import Screenfull from '@/components/Screenfull'
|
||||||
import SizeSelect from '@/components/SizeSelect'
|
import SizeSelect from '@/components/SizeSelect'
|
||||||
import Search from '@/components/HeaderSearch'
|
import Search from '@/components/HeaderSearch'
|
||||||
|
import {getNoticeList, updateAsUserDept} from "@/api/system/notice";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
dicts: ['is_read', 'sys_notice_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
noticeVisble: false,
|
||||||
|
noticeInfo: {},
|
||||||
|
noticeAttr: [
|
||||||
|
{
|
||||||
|
createTime: '',
|
||||||
|
createBy: 'admin',
|
||||||
|
noticeType: '1',
|
||||||
|
isRead: '1',
|
||||||
|
noticeTitle: '哈哈',
|
||||||
|
noticeContent: '嘻嘻嘻嘻嘻',
|
||||||
|
noticeId: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
createTime: '',
|
||||||
|
createBy: 'admin',
|
||||||
|
noticeType: '2',
|
||||||
|
isRead: '0',
|
||||||
|
noticeTitle: '哈撒大大哈',
|
||||||
|
noticeContent: '嘻嘻嘻嘻阿尽快嘻',
|
||||||
|
noticeId: 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
createTime: '',
|
||||||
|
createBy: 'admin',
|
||||||
|
noticeType: '1',
|
||||||
|
isRead: '0',
|
||||||
|
noticeTitle: '哈哈是',
|
||||||
|
noticeContent: '嘻嘻嘻萨达嘻嘻',
|
||||||
|
noticeId: 3,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
form: {
|
||||||
|
noticeType: '',
|
||||||
|
isRead: ''
|
||||||
|
},
|
||||||
|
messageTotal: undefined,
|
||||||
|
noticeTableVisible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
TopNav,
|
TopNav,
|
||||||
|
@ -80,6 +201,23 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getNoticeList() {
|
||||||
|
getNoticeList(this.form).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.noticeAttr = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
readNotice(row) {
|
||||||
|
this.noticeInfo = row
|
||||||
|
this.noticeVisble = true
|
||||||
|
updateAsUserDept(row.id).then(res => {
|
||||||
|
this.getNoticeList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
noticeTableList() {
|
||||||
|
this.getNoticeList()
|
||||||
|
this.noticeTableVisible = true
|
||||||
|
},
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
||||||
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
|
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
|
||||||
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
||||||
|
|
||||||
<div :class="{'fixed-header':fixedHeader}">
|
<div :class="{'fixed-header':fixedHeader}">
|
||||||
<navbar/>
|
<navbar/>
|
||||||
<tags-view v-if="needTagsView"/>
|
<tags-view v-if="needTagsView"/>
|
||||||
|
|
|
@ -234,7 +234,9 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listDept(this.queryParams).then(response => {
|
listDept(this.queryParams).then(response => {
|
||||||
|
console.log(response.data)
|
||||||
this.deptList = this.handleTree(response.data, "deptId");
|
this.deptList = this.handleTree(response.data, "deptId");
|
||||||
|
console.log(this.deptList)
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -99,6 +99,14 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['system:notice:edit']"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="noticeDetails(scope.row.noticeId)"
|
||||||
|
>通知详情
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:notice:edit']"
|
v-hasPermi="['system:notice:edit']"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
@ -148,6 +156,17 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col v-show="form.noticeType == 2">
|
||||||
|
<span style="margin-right: 15px;margin-left: 10px"><b>公告时间</b></span>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.time"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status">
|
||||||
|
@ -171,18 +190,85 @@
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
<el-tabs v-show="form.noticeType == 1" v-model="activeName" @tab-click="handleClick">
|
||||||
|
<el-tab-pane label="部门" name="section">
|
||||||
|
{{ form.sectionList }}
|
||||||
|
<el-cascader
|
||||||
|
v-model="form.sectionList"
|
||||||
|
:options="options1"
|
||||||
|
:props="props"
|
||||||
|
style="width: 350px"
|
||||||
|
clearable>
|
||||||
|
</el-cascader>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="特定人员" name="personnel">
|
||||||
|
{{ form.personnelList }}
|
||||||
|
<el-select v-model="form.personnelList" multiple placeholder="请选择特定人员">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.userId"
|
||||||
|
:label="item.nickName"
|
||||||
|
:value="item.userId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="通知详情"
|
||||||
|
:visible.sync="numVisable"
|
||||||
|
width="40%">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="6">
|
||||||
|
<div>
|
||||||
|
<el-statistic
|
||||||
|
:value="asUserDeptNum.num"
|
||||||
|
title="总共通知数量"
|
||||||
|
></el-statistic>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div>
|
||||||
|
<el-statistic
|
||||||
|
:value="asUserDeptNum.readNum"
|
||||||
|
title="已阅读通知数量"
|
||||||
|
></el-statistic>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div>
|
||||||
|
<el-statistic
|
||||||
|
:value="asUserDeptNum.noReadNum"
|
||||||
|
title="未阅读通知数量"
|
||||||
|
></el-statistic>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="numVisable = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="numVisable = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addNotice, delNotice, getNotice, listNotice, updateNotice} from "@/api/system/notice";
|
import {addNotice, delNotice, getNotice, getNum, listNotice, updateNotice} from "@/api/system/notice";
|
||||||
|
import {listDept} from "@/api/system/dept";
|
||||||
|
import {listUser} from "@/api/system/user";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Notice",
|
name: "Notice",
|
||||||
dicts: ['sys_notice_status', 'sys_notice_type'],
|
dicts: ['sys_notice_status', 'sys_notice_type'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
sectionList:[],
|
||||||
|
personnelList:[],
|
||||||
|
props: { multiple: true },
|
||||||
|
options1: [],
|
||||||
|
options: [],
|
||||||
|
activeName: '部门',
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -209,6 +295,13 @@ export default {
|
||||||
createBy: undefined,
|
createBy: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
},
|
},
|
||||||
|
queryParam: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
noticeTitle: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
status: undefined
|
||||||
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
@ -219,13 +312,37 @@ export default {
|
||||||
noticeType: [
|
noticeType: [
|
||||||
{required: true, message: "公告类型不能为空", trigger: "change"}
|
{required: true, message: "公告类型不能为空", trigger: "change"}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
asUserDeptNum: {},
|
||||||
|
numVisable: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
noticeDetails(noticeId) {
|
||||||
|
this.numVisable = true
|
||||||
|
getNum(noticeId).then(res => {
|
||||||
|
this.asUserDeptNum = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//部门递归
|
||||||
|
recursion(data) {
|
||||||
|
data.forEach(da => {
|
||||||
|
this.$set(da, 'value', da.deptId);
|
||||||
|
delete da.deptId;
|
||||||
|
this.$set(da, 'label', da.deptName);
|
||||||
|
delete da.deptName;
|
||||||
|
if (da.children){
|
||||||
|
this.recursion(da.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//tab选择
|
||||||
|
handleClick(tab, event) {
|
||||||
|
|
||||||
|
},
|
||||||
/** 查询公告列表 */
|
/** 查询公告列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -247,7 +364,9 @@ export default {
|
||||||
noticeTitle: undefined,
|
noticeTitle: undefined,
|
||||||
noticeType: undefined,
|
noticeType: undefined,
|
||||||
noticeContent: undefined,
|
noticeContent: undefined,
|
||||||
status: "0"
|
status: "0",
|
||||||
|
sectionList:[],
|
||||||
|
personnelList:[]
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -272,6 +391,24 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加公告";
|
this.title = "添加公告";
|
||||||
|
listDept(this.queryParam).then(response => {
|
||||||
|
this.options1 = this.handleTree(response.data, "deptId");
|
||||||
|
console.log(this.options1)
|
||||||
|
this.options1.forEach(op => {
|
||||||
|
this.$set(op, 'value', op.deptId);
|
||||||
|
delete op.deptId;
|
||||||
|
this.$set(op, 'label', op.deptName);
|
||||||
|
delete op.deptName;
|
||||||
|
if (op.children){
|
||||||
|
this.recursion(op.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
listUser(this.addDateRange(this.queryParams, [])).then(response => {
|
||||||
|
this.options = response.data.rows;
|
||||||
|
console.log(this.options)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|
|
@ -630,6 +630,7 @@ export default {
|
||||||
}).then(({value}) => {
|
}).then(({value}) => {
|
||||||
resetUserPwd(row.userId, value).then(response => {
|
resetUserPwd(row.userId, value).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||||
|
|
||||||
list(this.queryParam).then(res=>{
|
list(this.queryParam).then(res=>{
|
||||||
const userList = res.data.rows
|
const userList = res.data.rows
|
||||||
userList.forEach(userInfo=>{
|
userList.forEach(userInfo=>{
|
||||||
|
|
|
@ -182,6 +182,7 @@ export default {
|
||||||
submitForm() {
|
submitForm() {
|
||||||
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
|
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
|
||||||
const genForm = this.$refs.genInfo.$refs.genInfoForm;
|
const genForm = this.$refs.genInfo.$refs.genInfoForm;
|
||||||
|
|
||||||
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
|
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
|
||||||
const validateResult = res.data.every(item => !!item);
|
const validateResult = res.data.every(item => !!item);
|
||||||
if (validateResult) {
|
if (validateResult) {
|
||||||
|
|
Loading…
Reference in New Issue