Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
|
1c8c452183 |
|
@ -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) {
|
||||
return request({
|
||||
|
@ -41,4 +63,4 @@ export function delNotice(noticeId) {
|
|||
url: '/system/notice/' + noticeId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
||||
|
||||
<div class="right-menu">
|
||||
|
||||
<template v-if="device!=='mobile'">
|
||||
<i class="el-icon-message-solid" @click="noticeTableList"></i>
|
||||
<search id="header-search" class="right-menu-item"/>
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
||||
|
||||
|
@ -35,6 +37,83 @@
|
|||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
|
@ -46,8 +125,51 @@ import Hamburger from '@/components/Hamburger'
|
|||
import Screenfull from '@/components/Screenfull'
|
||||
import SizeSelect from '@/components/SizeSelect'
|
||||
import Search from '@/components/HeaderSearch'
|
||||
import {getNoticeList,updateAsUserDept} from "@/api/system/notice";
|
||||
|
||||
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: {
|
||||
Breadcrumb,
|
||||
TopNav,
|
||||
|
@ -80,6 +202,23 @@ export default {
|
|||
}
|
||||
},
|
||||
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() {
|
||||
this.$store.dispatch('app/toggleSideBar')
|
||||
},
|
||||
|
|
|
@ -234,7 +234,9 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listDept(this.queryParams).then(response => {
|
||||
console.log(response.data)
|
||||
this.deptList = this.handleTree(response.data, "deptId");
|
||||
console.log(this.deptList)
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -99,6 +99,14 @@
|
|||
</el-table-column>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||
<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
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
icon="el-icon-edit"
|
||||
|
@ -148,6 +156,19 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</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-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
|
@ -166,23 +187,93 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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 {
|
||||
name: "Notice",
|
||||
dicts: ['sys_notice_status', 'sys_notice_type'],
|
||||
data() {
|
||||
return {
|
||||
sectionList:[],
|
||||
personnelList:[],
|
||||
props: { multiple: true },
|
||||
options1: [],
|
||||
options: [],
|
||||
activeName: '部门',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -209,6 +300,13 @@ export default {
|
|||
createBy: undefined,
|
||||
status: undefined
|
||||
},
|
||||
queryParam: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
|
@ -219,13 +317,36 @@ export default {
|
|||
noticeType: [
|
||||
{required: true, message: "公告类型不能为空", trigger: "change"}
|
||||
]
|
||||
}
|
||||
},
|
||||
asUserDeptNum: {},
|
||||
numVisable: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
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)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
|
||||
},
|
||||
/** 查询公告列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -247,7 +368,9 @@ export default {
|
|||
noticeTitle: undefined,
|
||||
noticeType: undefined,
|
||||
noticeContent: undefined,
|
||||
status: "0"
|
||||
status: "0",
|
||||
sectionList:[],
|
||||
personnelList:[]
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
@ -272,6 +395,24 @@ export default {
|
|||
this.reset();
|
||||
this.open = true;
|
||||
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) {
|
||||
|
|
|
@ -374,6 +374,8 @@ import {
|
|||
import {getToken} from "@/utils/auth";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {forceLogout,list} from "@/api/monitor/online";
|
||||
import item from "@/layout/components/Sidebar/Item.vue";
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
|
@ -615,6 +617,7 @@ export default {
|
|||
},
|
||||
/** 重置密码按钮操作 */
|
||||
handleResetPwd(row) {
|
||||
console.log(row)
|
||||
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -624,6 +627,21 @@ export default {
|
|||
}).then(({value}) => {
|
||||
resetUserPwd(row.userId, value).then(response => {
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
list().then(
|
||||
res=>{
|
||||
console.log(res)
|
||||
res.data.rows.forEach(item=>{
|
||||
if (item.userName == row.userName){
|
||||
forceLogout(item.tokenId).then(
|
||||
response=>{
|
||||
this.$modal.msgSuccess("强制退出")
|
||||
this.getList()
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue