Skip to content

Commit

Permalink
fix: 修复公告显示及详情页跳转错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 30, 2024
1 parent b9ebbca commit 6b265f7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
24 changes: 12 additions & 12 deletions src/apis/system/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 9 additions & 5 deletions src/views/system/notice/NoticeDetailModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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 })
Expand Down
2 changes: 2 additions & 0 deletions src/views/system/notice/page/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Expand All @@ -62,6 +63,7 @@ const onDetail = async (id: string) => {
Object.assign(form, res.data)
}
const onBack = () => {
router.back()
tabsStore.closeCurrent(route.path)
}
Expand Down

0 comments on commit 6b265f7

Please sign in to comment.