公告通知类型
parent
cc996cd31f
commit
db1a1d47e0
|
@ -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({
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
<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">
|
||||||
|
|
||||||
<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"/>
|
||||||
|
|
||||||
|
@ -35,6 +37,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 +123,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 +200,25 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getNoticeList(){
|
||||||
|
getNoticeList(this.form).then(
|
||||||
|
res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.noticeAttr=res.data;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
readNotice(row){
|
||||||
|
this.noticeIngo=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')
|
||||||
},
|
},
|
||||||
|
|
|
@ -73,7 +73,6 @@ service.interceptors.request.use(config => {
|
||||||
|
|
||||||
// 响应拦截器
|
// 响应拦截器
|
||||||
service.interceptors.response.use(res => {
|
service.interceptors.response.use(res => {
|
||||||
debugger
|
|
||||||
// 未设置状态码则默认成功状态
|
// 未设置状态码则默认成功状态
|
||||||
const code = res.data.code || 200;
|
const code = res.data.code || 200;
|
||||||
// 获取错误信息
|
// 获取错误信息
|
||||||
|
|
|
@ -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,13 @@
|
||||||
</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"
|
||||||
|
@ -160,6 +167,16 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</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="内容">
|
||||||
<editor v-model="form.noticeContent" :min-height="192"/>
|
<editor v-model="form.noticeContent" :min-height="192"/>
|
||||||
|
@ -167,22 +184,92 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-cascader
|
||||||
|
:options="options"
|
||||||
|
:props="props"
|
||||||
|
clearable v-if="form.noticeType==1"></el-cascader>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<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 {
|
||||||
|
sectionsList:[],
|
||||||
|
personne1List:[],
|
||||||
|
props: { multiple: true },
|
||||||
|
options:[],
|
||||||
|
options1:[],
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -209,6 +296,14 @@ export default {
|
||||||
createBy: undefined,
|
createBy: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
},
|
},
|
||||||
|
queryParam:{
|
||||||
|
pageNum:1,
|
||||||
|
pageSize:10,
|
||||||
|
noticeType:undefined,
|
||||||
|
createBy:undefined,
|
||||||
|
status:undefined,
|
||||||
|
},
|
||||||
|
depts:[],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
@ -219,13 +314,46 @@ export default {
|
||||||
noticeType: [
|
noticeType: [
|
||||||
{required: true, message: "公告类型不能为空", trigger: "change"}
|
{required: true, message: "公告类型不能为空", trigger: "change"}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
asUserDeptNum:{},
|
||||||
|
numVisAble:false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.getDeptList();
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
noticeDetails(noticeId){
|
||||||
|
this.numVisAble=true;
|
||||||
|
getNum(noticeId).then(res=>{
|
||||||
|
this.asUserDeptNum=res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//部门递归
|
||||||
|
recursion(data){
|
||||||
|
data.forEach(res=>{
|
||||||
|
this.$set(res,'value',res.deptId);
|
||||||
|
delete res.deptId;
|
||||||
|
this.$set(res,'label',res.deptName);
|
||||||
|
delete res.deptName;
|
||||||
|
if (res.children){
|
||||||
|
this.recursion(res.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//tab选择
|
||||||
|
handleClick(tab,event){
|
||||||
|
|
||||||
|
},
|
||||||
|
getDeptList(){
|
||||||
|
listDept(null).then(
|
||||||
|
res=>{
|
||||||
|
console.log(res.data)
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
/** 查询公告列表 */
|
/** 查询公告列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -247,7 +375,9 @@ export default {
|
||||||
noticeTitle: undefined,
|
noticeTitle: undefined,
|
||||||
noticeType: undefined,
|
noticeType: undefined,
|
||||||
noticeContent: undefined,
|
noticeContent: undefined,
|
||||||
status: "0"
|
status: "0",
|
||||||
|
sectionList:[],
|
||||||
|
personne1List:[],
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -272,6 +402,27 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加公告";
|
this.title = "添加公告";
|
||||||
|
listDept(this.queryParam).then(
|
||||||
|
res=>{
|
||||||
|
this.options1=this.handleTree(res.data,"deptId");
|
||||||
|
console.log(this.options1);
|
||||||
|
this.options1.forEach(res=>{
|
||||||
|
this.$set(res,'value',res.deptId);
|
||||||
|
delete res.deptId;
|
||||||
|
this.$set(res,'label',res.deptName);
|
||||||
|
delete res.deptName;
|
||||||
|
if (res.children){
|
||||||
|
this.recursion(res.children)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
this.loading = false;
|
||||||
|
|
||||||
|
})
|
||||||
|
listUser(this.addDateRange(this.queryParams, [])).then(response => {
|
||||||
|
this.options = response.data.rows;
|
||||||
|
console.log(this.options)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|
|
@ -352,6 +352,7 @@
|
||||||
</el-link>
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
<el-button @click="upload.open = false">取 消</el-button>
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
|
@ -382,10 +383,10 @@ export default {
|
||||||
components: {Treeselect},
|
components: {Treeselect},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParam: {
|
// queryParam: {
|
||||||
ipaddr: undefined,
|
// ipaddr: undefined,
|
||||||
userName: undefined
|
// userName: undefined
|
||||||
},
|
// },
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -629,14 +630,14 @@ 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 => {
|
||||||
if (userInfo.userName == row.userName){
|
// if (userInfo.userName == row.userName){
|
||||||
forceLogout(userInfo.tokenId);
|
// forceLogout(userInfo.tokenId);
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue