Skip to content

Commit

Permalink
style: 优化公告相关样式
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 11, 2024
1 parent 921950b commit 5ebdaa0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 199 deletions.
26 changes: 13 additions & 13 deletions src/views/home/components/NoticeCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@
style="overflow: hidden"
>
<template #content>
<div class="content">
<a-space>
<GiCellTag :value="item.type" :dict="notice_type" />
<p>
<a-link @click="onDetail(item.id)">{{ item.title }}</a-link>
</p>
</div>
<a-link @click="onDetail(item.id)">
<a-typography-paragraph
:ellipsis="{
rows: 1,
showTooltip: true,
css: true,
}"
>
{{ item.title }}
</a-typography-paragraph>
</a-link>
</a-space>
</template>
</a-comment>
</a-card>
Expand Down Expand Up @@ -62,14 +70,6 @@ onMounted(() => {
color: var(--color-text-4);
}
.content {
display: flex;
align-items: center;
> p {
margin-left: 6px;
}
}
.arco-link {
color: rgb(var(--gray-8));
}
Expand Down
173 changes: 0 additions & 173 deletions src/views/system/notice/NoticeAddModal.vue

This file was deleted.

9 changes: 0 additions & 9 deletions src/views/system/notice/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@
</a-space>
</template>
</GiTable>
<NoticeAddModal ref="NoticeAddModalRef" @save-success="search" />
<NoticeDetailModal ref="NoticeDetailModalRef" />
</div>
</template>

<script lang="ts" setup>
import NoticeAddModal from './NoticeAddModal.vue'
import NoticeDetailModal from './NoticeDetailModal.vue'
import { type NoticeQuery, type NoticeResp, deleteNotice, listNotice } from '@/apis/system'
import type { TableInstanceColumns } from '@/components/GiTable/type'
import { useTable } from '@/hooks'
Expand Down Expand Up @@ -119,23 +115,18 @@ const onDelete = (record: NoticeResp) => {
})
}
const NoticeAddModalRef = ref<InstanceType<typeof NoticeAddModal>>()
// 新增
const onAdd = () => {
// NoticeAddModalRef.value?.onAdd()
router.push({ path: '/system/notice/add' })
}
// 修改
const onUpdate = (record: NoticeResp) => {
// NoticeAddModalRef.value?.onUpdate(record.id)
router.push({ path: '/system/notice/add', query: { id: record.id, type: 'edit' } })
}
const NoticeDetailModalRef = ref<InstanceType<typeof NoticeDetailModal>>()
// 详情
const onDetail = (record: NoticeResp) => {
// NoticeDetailModalRef.value?.onDetail(record.id)
router.push({ path: '/system/notice/detail', query: { id: record.id } })
}
</script>
Expand Down
10 changes: 9 additions & 1 deletion src/views/system/notice/page/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
<a-affix :target="(containerRef as HTMLElement)">
<a-page-header title="通知公告" :subtitle="type === 'edit' ? '修改' : '新增'" @back="onBack">
<template #extra>
<a-button type="primary" @click="onReleased">{{ type === 'edit' ? '修改' : '发布' }}</a-button>
<a-button type="primary" @click="onReleased">
<template #icon>
<icon-save v-if="type === 'edit'" />
<icon-send v-else />
</template>
<template #default>
{{ type === 'edit' ? '保存' : '发布' }}
</template>
</a-button>
</template>
</a-page-header>
</a-affix>
Expand Down
15 changes: 12 additions & 3 deletions src/views/system/notice/page/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</a-page-header>
</a-affix>
</div>
<div class="detail_content" style="display: flex; flex-direction: column;">
<div class="detail_content">
<h1 class="title">{{ form?.title }}</h1>
<div class="info">
<a-space>
Expand All @@ -22,6 +22,12 @@
<span>{{ form?.effectiveTime ? form?.effectiveTime : form?.createTime
}}</span>
</span>
<a-divider v-if="form?.updateTime" direction="vertical" />
<span v-if="form?.updateTime">
<icon-schedule class="icon" />
<span>更新时间:</span>
<span>{{ form?.updateTime }}</span>
</span>
</a-space>
</div>
<div style="flex: 1;">
Expand Down Expand Up @@ -71,8 +77,11 @@ onMounted(() => {
}
.info {
text-align: right;
padding: 20px;
text-align: center;
}
.icon {
margin-right: 3px;
}
}
</style>

0 comments on commit 5ebdaa0

Please sign in to comment.