123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <div class="header">
- <div class="header-left">
- <img src="@/assets/imgs/OA/zdww.png" alt="" />
- <p>{{ titleName }} </p>
- <div class="tips">
- <div class="left">
- <img src="../../../assets/imgs/OA/notify_icon.png" />
- <div>
- <ul :class="`scroll_ani${dailyNotifyList.length}`">
- <li v-for="(item, index) in dailyNotifyList" :key="index" @click="onLookDetail(item)">
- {{ item['content'] }}
- </li>
- </ul>
- </div>
- </div>
- <div class="more" @click="toMoreHandle">更多<span class="arrow">></span></div>
- </div>
- </div>
- <div class="header-right">
- <Weather />
- <div class="hx"></div>
- <!-- <div class="message">
- <el-badge :value="3" class="item">
- <img src="@/assets/imgs/OA/xxts.png" alt="" />
- </el-badge>
- </div> -->
- <div class="offLogin" @click="offClick">
- <img src="@/assets/imgs/OA/offLogin.png" alt="" />
- </div>
- </div>
- <el-dialog v-model="dialogVisible" width="500px" title="每日速递详情">
- <div class="dailyNotifyDetail">
- <div>
- <span class="dialog_label_icon">
- <el-icon class="icon" size="18"><UserFilled /></el-icon>
- 发布人:
- </span>
- <span>{{ formData.nickname }}</span>
- </div>
- <div>
- <span class="dialog_label_icon">
- <el-icon class="icon" size="18"><BellFilled /></el-icon>
- 发布时间:
- </span>
- <span>{{ formData.createTime }}</span>
- </div>
- <div>
- <span class="dialog_label_icon">
- <el-icon class="icon" size="18"><Comment /></el-icon>
- 发布内容:
- </span>
- <span>{{ formData.content }}</span>
- </div>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="dialogVisible = false"> 关闭 </el-button>
- </div>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup lang="ts">
- import { ElMessageBox } from 'element-plus'
- import { useAppStore } from '@/store/modules/app'
- import { useUserStore } from '@/store/modules/user'
- import request from '@/config/axios'
- import Cookies from 'js-cookie'
- import Weather from './weather.vue'
- const { replace } = useRouter()
- import { useTagsViewStore } from '@/store/modules/tagsView'
- defineOptions({ name: 'Header' })
- const appStore = useAppStore()
- const titleName = ref(appStore.title)
- const userStore = useUserStore()
- const tagsViewStore = useTagsViewStore()
- const offClick = () => {
- ElMessageBox.confirm('清除缓存并退出登录?', '警告', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- await userStore.loginOut()
- tagsViewStore.delAllViews()
- removeCokLog()
- replace('/login?redirect=/home')
- })
- }
- const removeCokLog = () => {
- var cookiesAll = document.cookie.split(';')
- for (var i = 0; i < cookiesAll.length; i++) {
- console.log(cookiesAll[i])
- Cookies.remove(cookiesAll[i])
- }
- }
- const dailyNotifyList = ref([])
- async function queryNotifyByNewThree() {
- const urlApi = `/adm/noticeAndLearn/query/page`
- const sendData = {
- pageNo: 1,
- pageSize: 3,
- type: 3,
- nickname: '',
- title: '',
- readType: 2
- }
- const result = await request.post({ url: urlApi, data: sendData })
- if (result) {
- dailyNotifyList.value = result.list
- }
- }
- queryNotifyByNewThree()
- const formData = ref({
- id: '',
- nickname: '',
- createTime: '',
- content: ''
- })
- const dialogVisible = ref(false)
- const onLookDetail = (item) => {
- if (item) {
- formData.value['id'] = item['id']
- formData.value['nickname'] = item?.['nickname']
- formData.value['createTime'] = item?.['createTime']
- formData.value['content'] = item?.['content']
- dialogVisible.value = true
- }
- }
- const router = useRouter()
- const toMoreHandle = () => {
- router.push({
- path: '/dailyNotify'
- })
- }
- /** 初始化 **/
- onMounted(() => {})
- </script>
- <style lang="scss" scoped>
- :deep(.el-dialog) {
- border-radius: 10px;
- overflow: hidden;
- .el-dialog__header {
- background: #f3f7fe;
- margin-right: 0px;
- padding: 15px 20px;
- > span {
- font-weight: bold;
- }
- }
- }
- .header {
- width: calc(100%);
- height: 60px;
- margin-bottom: 4px;
- // background: #183868;
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-sizing: border-box;
- .header-left {
- display: flex;
- align-items: center;
- min-width: 466px;
- > .tips {
- background: rgba(255, 255, 255, 0.6);
- border-radius: 10px;
- display: flex;
- align-items: center;
- padding: 5px 10px;
- margin-left: 20px;
- > .left {
- display: flex;
- align-items: center;
- color: #0e1f38;
- font-size: 14px;
- > img {
- width: 15px;
- height: 15px;
- margin-right: 4px;
- }
- > div {
- height: 22px;
- overflow: hidden;
- > ul {
- &.scroll_ani2 {
- animation: scroll2 6s infinite;
- }
- &.scroll_ani3 {
- animation: scroll3 9s infinite;
- }
- > li {
- max-width: 460px;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- cursor: pointer;
- }
- }
- }
- @keyframes scroll2 {
- 0%,
- 37% {
- transform: translateY(0);
- }
- 50%,
- 87% {
- transform: translateY(-20px);
- }
- 100% {
- transform: translateY(0);
- }
- }
- @keyframes scroll3 {
- 0%,
- 25% {
- transform: translateY(0);
- }
- 33.33%,
- 58.33% {
- transform: translateY(-20px);
- }
- 66.66%,
- 91.66% {
- transform: translateY(-41px);
- }
- 100% {
- transform: translateY(0);
- }
- }
- }
- > .more {
- margin-left: 20px;
- font-size: 12px;
- color: #333333;
- cursor: pointer;
- > .arrow {
- margin-left: 3px;
- }
- }
- }
- img {
- width: 48px;
- height: 48px;
- margin-right: 15px;
- }
- p {
- font-size: 34px;
- color: #333f56;
- font-family: AlibabaPuHuiTiB;
- }
- }
- .offLogin {
- cursor: pointer;
- }
- .header-right {
- display: flex;
- align-items: center;
- height: 100%;
- min-width: 328px;
- .hx {
- width: 1px;
- height: 30px;
- background-color: #ccd4dd;
- margin: 0 30px;
- }
- .message {
- margin-right: 30px;
- > .item {
- :deep(.el-badge__content--danger) {
- background-color: #e92727;
- }
- }
- }
- }
- }
- .dailyNotifyDetail {
- padding: 0px 20px;
- padding-bottom: 20px;
- .dialog_label_icon {
- display: inline-block;
- width: 120px;
- display: flex;
- align-items: center;
- > .icon {
- color: #0079ee;
- margin-right: 4px;
- }
- }
- > div {
- padding: 8px;
- display: flex;
- align-items: flex-start;
- > span {
- color: #333;
- font-size: 17px;
- &:nth-child(2) {
- flex: 1;
- }
- }
- }
- }
- </style>
|