Dragon 1 year ago
parent 555078446a
commit b6ab065561

2
components.d.ts vendored

@ -38,6 +38,8 @@ declare module 'vue' {
NSpace: typeof import('naive-ui')['NSpace'] NSpace: typeof import('naive-ui')['NSpace']
NSpin: typeof import('naive-ui')['NSpin'] NSpin: typeof import('naive-ui')['NSpin']
NSwitch: typeof import('naive-ui')['NSwitch'] NSwitch: typeof import('naive-ui')['NSwitch']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTag: typeof import('naive-ui')['NTag'] NTag: typeof import('naive-ui')['NTag']
NTooltip: typeof import('naive-ui')['NTooltip'] NTooltip: typeof import('naive-ui')['NTooltip']
NUpload: typeof import('naive-ui')['NUpload'] NUpload: typeof import('naive-ui')['NUpload']

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

@ -1,17 +1,17 @@
<script lang="ts"> <script lang="ts">
import { useUser } from "@/store/modules/user"; import { useDialog, useMessage } from 'naive-ui'
import { getImgUrl } from "@/utils/urlUtils"; import { defineComponent, reactive, ref, toRefs, unref, watch } from 'vue'
import { useDialog, useMessage } from "naive-ui"; import { useRoute, useRouter } from 'vue-router'
import { defineComponent, reactive, ref, toRefs, unref, watch } from "vue"; import QuillModal from './QuillModal.vue'
import { useRoute, useRouter } from "vue-router"; import RecycleModal from './RecycleModal.vue'
import QuillModal from "./QuillModal.vue"; import SearchModal from './SearchModal.vue'
import RecycleModal from "./RecycleModal.vue"; import ShortcutModal from './ShortcutModal.vue'
import SearchModal from "./SearchModal.vue"; import UserSettings from './UserSettings.vue'
import ShortcutModal from "./ShortcutModal.vue"; import { getImgUrl } from '@/utils/urlUtils'
import UserSettings from "./UserSettings.vue"; import { useUser } from '@/store/modules/user'
export default defineComponent({ export default defineComponent({
name: "PageHeader", name: 'PageHeader',
components: { components: {
UserSettings, UserSettings,
QuillModal, QuillModal,
@ -27,108 +27,112 @@ export default defineComponent({
type: Boolean, type: Boolean,
}, },
}, },
emits: ["update:collapsed"], emits: ['update:collapsed'],
setup() { setup() {
const message = useMessage(); const message = useMessage()
const dialog = useDialog(); const dialog = useDialog()
const userStore = useUser(); const userStore = useUser()
const useInfo = userStore.getUserInfo; const useInfo = userStore.getUserInfo
const name = ""; const name = ''
const state = reactive({ const state = reactive({
username: name ?? "", username: name ?? '',
fullscreenIcon: "FullscreenOutlined", fullscreenIcon: 'FullscreenOutlined',
}); })
const router = useRouter(); const router = useRouter()
const route = useRoute(); const route = useRoute()
const routename = ref(route.meta.title); const routename = ref(route.meta.title)
watch( watch(
() => route.fullPath, () => route.fullPath,
() => { () => {
routename.value = route.meta.title; routename.value = route.meta.title
} },
); )
const dropdownSelect = (key) => { const dropdownSelect = (key) => {
router.push({ name: key }); router.push({ name: key })
}; }
// 退 // 退
const doLogout = () => { const doLogout = () => {
dialog.info({ dialog.info({
title: "提示", title: '提示',
content: "您确定要退出登录吗", content: '您确定要退出登录吗',
positiveText: "确定", positiveText: '确定',
negativeText: "取消", negativeText: '取消',
onPositiveClick: () => { onPositiveClick: () => {
userStore.logout().then(() => { userStore.logout().then(() => {
message.success("成功退出登录"); message.success('成功退出登录')
router router
.replace({ .replace({
name: "Login", name: 'Login',
query: { query: {
redirect: route.fullPath, redirect: route.fullPath,
}, },
}) })
.finally(() => location.reload()); .finally(() => location.reload())
}); })
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}); })
}; }
const quillModalRef = ref(null); const quillModalRef = ref(null)
const shortcutModal = ref(null); const shortcutModal = ref(null)
const recycleModalRef = ref(null); const recycleModalRef = ref(null)
const SearchModalRef = ref(null); const SearchModalRef = ref(null)
function quillHandler() { function quillHandler() {
const modal = unref(quillModalRef)! as any; const modal = unref(quillModalRef)! as any
modal.showModal(); modal.showModal()
} }
function shortcutHandler() { function shortcutHandler() {
const modal = unref(shortcutModal)! as any; const modal = unref(shortcutModal)! as any
modal.showModal(); modal.showModal()
} }
function recycleHandler() { function recycleHandler() {
const modal = unref(recycleModalRef)! as any; const modal = unref(recycleModalRef)! as any
modal.showModal(); modal.showModal()
} }
function searchHandler() { function searchHandler() {
const modal = unref(SearchModalRef)! as any; const modal = unref(SearchModalRef)! as any
modal.showModal(); modal.showModal()
}
function goMessage() {
router.push({ name: 'message-main' })
} }
// //
const iconList = [ const iconList = [
{ {
icon: "magnifying-1", icon: 'magnifying-1',
handle: searchHandler, handle: searchHandler,
}, },
{ {
icon: "shortcut-keys", icon: 'shortcut-keys',
handle: shortcutHandler, handle: shortcutHandler,
}, },
{ {
icon: "suspicious-folder", icon: 'suspicious-folder',
handle: recycleHandler, handle: recycleHandler,
}, },
{ {
icon: "memo", icon: 'memo',
handle: quillHandler, handle: quillHandler,
}, },
{ {
icon: "newmessage", icon: 'newmessage',
handle: shortcutHandler, handle: goMessage,
}, },
]; ]
return { return {
...toRefs(state), ...toRefs(state),
@ -146,9 +150,9 @@ export default defineComponent({
recycleHandler, recycleHandler,
useInfo, useInfo,
getImgUrl, getImgUrl,
}; }
}, },
}); })
</script> </script>
<template> <template>

@ -25,6 +25,7 @@ const routes: Array<RouteRecordRaw> = [
svgsize: 22, svgsize: 22,
sort: 2, sort: 2,
disabled: true, disabled: true,
hidden: true,
}, },
children: [ children: [
{ {

@ -1,6 +1,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, ref, toRefs } from 'vue' import { reactive, ref, toRefs } from 'vue'
import { useMessage } from 'naive-ui' import { useMessage } from 'naive-ui'
import { format } from 'date-fns'
import { msgOne, readMsg } from '@/api/message/message' import { msgOne, readMsg } from '@/api/message/message'
const props = defineProps({ const props = defineProps({
@ -41,13 +43,13 @@ getDetail()
<div class="title"> <div class="title">
{{ detail.titile }} {{ detail.titile }}
</div> </div>
<div class="content" v-html="detail.msgContent" />
</div> </div>
<div class="right-card"> <div class="right-card">
<img class="icon-set" src="@/assets/images/message/set.png" alt=""> <img class="icon-set" src="@/assets/images/message/set.png" alt="">
<div class="title"> <div class="title">
系统消息 系统消息
</div> </div>
<div class="content" v-html="detail.msgContent" />
<div class="form"> <div class="form">
<div class="form-item flex"> <div class="form-item flex">
<img class="icon" src="@/assets/images/message/user.png" alt=""> <img class="icon" src="@/assets/images/message/user.png" alt="">
@ -55,7 +57,7 @@ getDetail()
创建人 创建人
</div> </div>
<div class="value"> <div class="value">
{{ detail.titile }} {{ detail.createBy }}
</div> </div>
</div> </div>
<div class="form-item flex"> <div class="form-item flex">
@ -64,7 +66,7 @@ getDetail()
发布时间 发布时间
</div> </div>
<div class="value time"> <div class="value time">
{{ detail.titile }} {{ format(detail.sendTime * 1000, 'yyyy-MM-dd HH:mm:ss') }}
</div> </div>
</div> </div>
<div class="form-item flex margin-no"> <div class="form-item flex margin-no">
@ -110,6 +112,10 @@ getDetail()
margin-bottom: 32px; margin-bottom: 32px;
} }
.content{
padding: 0 32px;
}
} }
.right-card{ .right-card{

Loading…
Cancel
Save