通知公告完成
This commit is contained in:
@@ -8,6 +8,35 @@ export function listNotice(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询公告列表
|
||||||
|
export function getFiche() {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/fiche',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询公告列表
|
||||||
|
export function getInform() {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/inform',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询公告列表
|
||||||
|
export function read(noticeId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/read/'+noticeId,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询公告列表
|
||||||
|
export function userDel(noticeId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/del/'+noticeId,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询公告详细
|
// 查询公告详细
|
||||||
export function getNotice(noticeId) {
|
export function getNotice(noticeId) {
|
||||||
|
|||||||
@@ -1,49 +1,80 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="navbar">
|
<div>
|
||||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
<!--通告弹出框-->
|
||||||
|
<el-dialog :title="notice.noticeTitle" :visible.sync="open" width="780px" append-to-body>
|
||||||
<!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />-->
|
<span v-html="notice.noticeContent"></span>
|
||||||
<div id="notice" style="position: absolute; top: 20px; left: 300px; width: 700px;">
|
<div slot="footer" class="dialog-footer">
|
||||||
<!-- <span></span>-->
|
<el-button type="danger" @click="userDelNotice(notice.noticeId,notice.noticeType)">删 除</el-button>
|
||||||
111122222222222222222222222222222222222222
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<div id="bell_block" @mouseleave="closeBellBlock">
|
||||||
|
<ul>
|
||||||
|
<li v-for="(item,index) in informList" :key="index">
|
||||||
|
<span @click="noticeClick(item.noticeId,item.noticeType)">{{item.noticeTitle}}
|
||||||
|
<i v-if="item.status == '1'" class="dots"></i>
|
||||||
|
</span>
|
||||||
|
<el-button @click="userDelNotice(notice.noticeId,notice.noticeType)" type="danger" size="mini" icon="el-icon-delete" circle></el-button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<breadcrumb
|
|
||||||
id="breadcrumb-container"
|
|
||||||
class="breadcrumb-container"
|
|
||||||
v-if="!topNav"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />-->
|
<div class="navbar">
|
||||||
|
|
||||||
<div class="right-menu">
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
||||||
<template v-if="device!=='mobile'">
|
@toggleClick="toggleSideBar"
|
||||||
<search id="header-search" class="right-menu-item" />
|
/>
|
||||||
|
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
<!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />-->
|
||||||
|
<!-- position: absolute; top: 20px; left: 300px; width: 700px;-->
|
||||||
|
<div id="notice">
|
||||||
|
<span id="notice_text" @click="noticeClick(fiche.noticeId)">{{ fiche.noticeTitle }}</span>
|
||||||
|
</div>
|
||||||
|
<breadcrumb
|
||||||
|
id="breadcrumb-container"
|
||||||
|
class="breadcrumb-container"
|
||||||
|
v-if="!topNav"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
<!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />-->
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
|
||||||
</el-tooltip>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
<div class="right-menu">
|
||||||
<div class="avatar-wrapper">
|
|
||||||
<img :src="avatar" class="user-avatar">
|
<div id="bell">
|
||||||
<i class="el-icon-caret-bottom" />
|
<div class="el-icon-bell bell" @mouseenter="handleClickBellBlock">
|
||||||
|
<i v-if="noticeState" class="dots"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<router-link to="/user/profile">
|
<template v-if="device!=='mobile'">
|
||||||
<el-dropdown-item>个人中心</el-dropdown-item>
|
<search id="header-search" class="right-menu-item"/>
|
||||||
</router-link>
|
|
||||||
<el-dropdown-item @click.native="setting = true">
|
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
||||||
<span>布局设置</span>
|
|
||||||
</el-dropdown-item>
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||||
<el-dropdown-item divided @click.native="logout">
|
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
||||||
<span>退出登录</span>
|
</el-tooltip>
|
||||||
</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
</template>
|
||||||
</el-dropdown>
|
|
||||||
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
||||||
|
<div class="avatar-wrapper">
|
||||||
|
<img :src="avatar" class="user-avatar">
|
||||||
|
<i class="el-icon-caret-bottom"/>
|
||||||
|
</div>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<router-link to="/user/profile">
|
||||||
|
<el-dropdown-item>个人中心</el-dropdown-item>
|
||||||
|
</router-link>
|
||||||
|
<el-dropdown-item @click.native="setting = true">
|
||||||
|
<span>布局设置</span>
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item divided @click.native="logout">
|
||||||
|
<span>退出登录</span>
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -55,6 +86,7 @@ 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 { getFiche, getInform, getNotice, read, userDel } from '@/api/system/notice'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -62,7 +94,7 @@ export default {
|
|||||||
Hamburger,
|
Hamburger,
|
||||||
Screenfull,
|
Screenfull,
|
||||||
SizeSelect,
|
SizeSelect,
|
||||||
Search,
|
Search
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
@@ -83,11 +115,91 @@ export default {
|
|||||||
},
|
},
|
||||||
topNav: {
|
topNav: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.settings.topNav;
|
return this.$store.state.settings.topNav
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
noticeState: false,
|
||||||
|
fiche: {},
|
||||||
|
notice: {},
|
||||||
|
informList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
let notice_text = document.getElementById('notice_text')
|
||||||
|
notice_text.addEventListener('webkitAnimationEnd', function() {
|
||||||
|
this.style.marginLeft = 0
|
||||||
|
}, false)
|
||||||
|
this.initFiche()
|
||||||
|
this.initInform()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
userDelNotice(id,type) {
|
||||||
|
userDel(id)
|
||||||
|
setTimeout(()=>{
|
||||||
|
if (type != '1'){
|
||||||
|
this.initFiche()
|
||||||
|
}else {
|
||||||
|
this.initInform()
|
||||||
|
}
|
||||||
|
},300)
|
||||||
|
this.open = false
|
||||||
|
},
|
||||||
|
initInform(){
|
||||||
|
this.noticeState = false
|
||||||
|
this.informList = []
|
||||||
|
getInform().then(res=>{
|
||||||
|
let data = res.data
|
||||||
|
for (let datum of data) {
|
||||||
|
if (datum.status == "1"){
|
||||||
|
this.noticeState = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.informList = data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initFiche() {
|
||||||
|
getFiche().then(res => {
|
||||||
|
let data = res.data
|
||||||
|
if (data){
|
||||||
|
this.fiche = data
|
||||||
|
}else {
|
||||||
|
this.fiche.noticeTitle = ""
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
noticeClick(noticeId,type) {
|
||||||
|
getNotice(noticeId).then(res => {
|
||||||
|
this.notice = res.data
|
||||||
|
})
|
||||||
|
this.open = true
|
||||||
|
read(noticeId)
|
||||||
|
setTimeout(()=>{
|
||||||
|
if (type != '1'){
|
||||||
|
this.initFiche()
|
||||||
|
}else {
|
||||||
|
this.initInform()
|
||||||
|
}
|
||||||
|
},300)
|
||||||
|
},
|
||||||
|
handleClickBellBlock() {
|
||||||
|
let bell_block = document.getElementById('bell_block')
|
||||||
|
bell_block.style.display = 'block'
|
||||||
|
},
|
||||||
|
closeBellBlock() {
|
||||||
|
let bell_block = document.getElementById('bell_block')
|
||||||
|
bell_block.style.display = 'none'
|
||||||
|
// bell_block.onblur = function(){
|
||||||
|
// bell_block.style.display='none';
|
||||||
|
// }
|
||||||
|
},
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
},
|
},
|
||||||
@@ -100,41 +212,153 @@ export default {
|
|||||||
// this.$store.dispatch('LogOut').then(() => {
|
// this.$store.dispatch('LogOut').then(() => {
|
||||||
// location.href = '/index';
|
// location.href = '/index';
|
||||||
// }
|
// }
|
||||||
this.$store.dispatch("LogOut").then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
if (!settings.casEnable) {
|
if (!settings.casEnable) {
|
||||||
location.href = this.$router.options.base + "/index";
|
location.href = this.$router.options.base + '/index'
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@keyframes slidein {
|
@keyframes slidein {
|
||||||
from {
|
|
||||||
margin-left: 56%;
|
0% {
|
||||||
width: 300%;
|
margin-left: 100%;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
100% {
|
||||||
margin-left: 0%;
|
margin-left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#notice{
|
|
||||||
//animation-duration: 3s;
|
@media (max-width: 1660px) {
|
||||||
//animation-name: slidein;
|
#notice {
|
||||||
//animation-iteration-count: infinite;
|
width: 58% !important;
|
||||||
animation: 3s linear 1s slidein;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1500px) {
|
||||||
|
#notice {
|
||||||
|
width: 53% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1350px) {
|
||||||
|
#notice {
|
||||||
|
width: 48% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1100px) {
|
||||||
|
#notice {
|
||||||
|
width: 43% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 990px) {
|
||||||
|
#notice {
|
||||||
|
width: 38% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .el-dialog__body {
|
||||||
|
height: 600px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .el-dialog__header {
|
||||||
|
padding: 20px 30px 10px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .el-dialog__headerbtn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .el-button--mini.is-circle {
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#bell_block::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#bell_block::-webkit-scrollbar-thumb {
|
||||||
|
width: 6px;
|
||||||
|
background-color: #adacac;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#bell_block {
|
||||||
|
//display: inline-block;
|
||||||
|
width: 250px;
|
||||||
|
height: 400px;
|
||||||
|
position: absolute;
|
||||||
|
right: 80px;
|
||||||
|
top: 51px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
box-shadow: 4px 4px 15px #d7d3d3;
|
||||||
|
word-wrap: break-word;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 10px 0 10px;
|
||||||
|
z-index: 99999;
|
||||||
|
display: none;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding: 0 !important;
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
list-style-type: none;
|
||||||
|
color: #000;
|
||||||
|
font-size: 16px;
|
||||||
|
letter-spacing: 0.2px;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
line-height: 26px;
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.dots {
|
||||||
|
display: block;
|
||||||
|
background: #f00;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 0.3em;
|
||||||
|
height: 0.3em;
|
||||||
|
top: 3px;
|
||||||
|
right: 9px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
width: 26px;
|
||||||
|
height: 26px;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-top: -3px;
|
||||||
|
//line-height: 26px;
|
||||||
|
//margin-left: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
|
||||||
|
|
||||||
.hamburger-container {
|
.hamburger-container {
|
||||||
line-height: 46px;
|
line-height: 46px;
|
||||||
@@ -142,14 +366,26 @@ export default {
|
|||||||
float: left;
|
float: left;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background .3s;
|
transition: background .3s;
|
||||||
-webkit-tap-highlight-color:transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(0, 0, 0, .025)
|
background: rgba(0, 0, 0, .025)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#notice {
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
left: 300px;
|
||||||
|
//width: 950px;
|
||||||
|
width: 63%;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
#notice_text {
|
||||||
|
margin-left: 100%;
|
||||||
|
animation: 3s linear 0.1s slidein;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.breadcrumb-container {
|
.breadcrumb-container {
|
||||||
float: left;
|
float: left;
|
||||||
@@ -160,11 +396,38 @@ export default {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.right-menu {
|
.right-menu {
|
||||||
float: right;
|
float: right;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
|
|
||||||
|
#bell {
|
||||||
|
position: absolute;
|
||||||
|
right: 192px;
|
||||||
|
padding-top: 3px;
|
||||||
|
//margin-top: 4px;
|
||||||
|
.bell {
|
||||||
|
padding: 3px 7px 0 7px;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 21px;
|
||||||
|
color: #000000;
|
||||||
|
font-weight: bold;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dots {
|
||||||
|
display: block;
|
||||||
|
background: #f00;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 0.3em;
|
||||||
|
height: 0.3em;
|
||||||
|
top: 0;
|
||||||
|
right: 6px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -341,3 +341,8 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
/deep/.w-e-text{
|
||||||
|
min-height: 242px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user