fix: 修复公告显示及详情页跳转错误

This commit is contained in:
2024-10-30 19:49:51 +08:00
parent b9ebbca0e8
commit 6b265f74bb
3 changed files with 23 additions and 17 deletions

View File

@@ -184,19 +184,19 @@ export interface DictItemPageQuery extends DictItemQuery, PageQuery {
/** 系统公告类型 */
export interface NoticeResp {
id: string
title: string
id?: string
title?: string
content: string
status: number
type: string
effectiveTime: string
terminateTime: string
noticeScope: number
noticeUsers: Array<string>
createUserString: string
createTime: string
updateUserString: string
updateTime: string
status?: number
type?: string
effectiveTime?: string
terminateTime?: string
noticeScope?: number
noticeUsers?: Array<string>
createUserString?: string
createTime?: string
updateUserString?: string
updateTime?: string
}
export interface NoticeQuery {

View File

@@ -23,7 +23,7 @@
</a-typography-paragraph>
</a-typography>
<a-divider />
<AiEditor v-if="dataDetail?.content" :model-value="dataDetail?.content" />
<AiEditor :model-value="dataDetail?.content" />
<a-divider />
<div v-if="dataDetail?.updateTime" class="update-time-row">
<span>
@@ -41,18 +41,22 @@ import AiEditor from './components/detail/index.vue'
import { type NoticeResp, getNotice } from '@/apis/system'
const { width } = useWindowSize()
const dataDetail = ref<NoticeResp>()
const dataDetail = ref<NoticeResp>({
content: '',
})
const visible = ref(false)
// 详情
const onDetail = async (id: string) => {
const res = await getNotice(id)
dataDetail.value = res.data
const { data } = await getNotice(id)
dataDetail.value = data
visible.value = true
}
// 重置
const reset = () => {
dataDetail.value = {}
dataDetail.value = {
content: '',
}
}
defineExpose({ onDetail })

View File

@@ -46,6 +46,7 @@ import { useForm } from '@/hooks'
const containerRef = ref<HTMLElement | null>()
const tabsStore = useTabsStore()
const route = useRoute()
const router = useRouter()
const { id } = route.query
const { form, resetForm } = useForm({
title: '',
@@ -62,6 +63,7 @@ const onDetail = async (id: string) => {
Object.assign(form, res.data)
}
const onBack = () => {
router.back()
tabsStore.closeCurrent(route.path)
}