Skip to content

Commit 5ebdaa0

Browse files
committed
style: 优化公告相关样式
1 parent 921950b commit 5ebdaa0

File tree

5 files changed

+34
-199
lines changed

5 files changed

+34
-199
lines changed

src/views/home/components/NoticeCard.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@
1212
style="overflow: hidden"
1313
>
1414
<template #content>
15-
<div class="content">
15+
<a-space>
1616
<GiCellTag :value="item.type" :dict="notice_type" />
17-
<p>
18-
<a-link @click="onDetail(item.id)">{{ item.title }}</a-link>
19-
</p>
20-
</div>
17+
<a-link @click="onDetail(item.id)">
18+
<a-typography-paragraph
19+
:ellipsis="{
20+
rows: 1,
21+
showTooltip: true,
22+
css: true,
23+
}"
24+
>
25+
{{ item.title }}
26+
</a-typography-paragraph>
27+
</a-link>
28+
</a-space>
2129
</template>
2230
</a-comment>
2331
</a-card>
@@ -62,14 +70,6 @@ onMounted(() => {
6270
color: var(--color-text-4);
6371
}
6472
65-
.content {
66-
display: flex;
67-
align-items: center;
68-
> p {
69-
margin-left: 6px;
70-
}
71-
}
72-
7373
.arco-link {
7474
color: rgb(var(--gray-8));
7575
}

src/views/system/notice/NoticeAddModal.vue

Lines changed: 0 additions & 173 deletions
This file was deleted.

src/views/system/notice/index.vue

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,10 @@
4848
</a-space>
4949
</template>
5050
</GiTable>
51-
<NoticeAddModal ref="NoticeAddModalRef" @save-success="search" />
52-
<NoticeDetailModal ref="NoticeDetailModalRef" />
5351
</div>
5452
</template>
5553

5654
<script lang="ts" setup>
57-
import NoticeAddModal from './NoticeAddModal.vue'
58-
import NoticeDetailModal from './NoticeDetailModal.vue'
5955
import { type NoticeQuery, type NoticeResp, deleteNotice, listNotice } from '@/apis/system'
6056
import type { TableInstanceColumns } from '@/components/GiTable/type'
6157
import { useTable } from '@/hooks'
@@ -119,23 +115,18 @@ const onDelete = (record: NoticeResp) => {
119115
})
120116
}
121117
122-
const NoticeAddModalRef = ref<InstanceType<typeof NoticeAddModal>>()
123118
// 新增
124119
const onAdd = () => {
125-
// NoticeAddModalRef.value?.onAdd()
126120
router.push({ path: '/system/notice/add' })
127121
}
128122
129123
// 修改
130124
const onUpdate = (record: NoticeResp) => {
131-
// NoticeAddModalRef.value?.onUpdate(record.id)
132125
router.push({ path: '/system/notice/add', query: { id: record.id, type: 'edit' } })
133126
}
134127
135-
const NoticeDetailModalRef = ref<InstanceType<typeof NoticeDetailModal>>()
136128
// 详情
137129
const onDetail = (record: NoticeResp) => {
138-
// NoticeDetailModalRef.value?.onDetail(record.id)
139130
router.push({ path: '/system/notice/detail', query: { id: record.id } })
140131
}
141132
</script>

src/views/system/notice/page/add.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
<a-affix :target="(containerRef as HTMLElement)">
55
<a-page-header title="通知公告" :subtitle="type === 'edit' ? '修改' : '新增'" @back="onBack">
66
<template #extra>
7-
<a-button type="primary" @click="onReleased">{{ type === 'edit' ? '修改' : '发布' }}</a-button>
7+
<a-button type="primary" @click="onReleased">
8+
<template #icon>
9+
<icon-save v-if="type === 'edit'" />
10+
<icon-send v-else />
11+
</template>
12+
<template #default>
13+
{{ type === 'edit' ? '保存' : '发布' }}
14+
</template>
15+
</a-button>
816
</template>
917
</a-page-header>
1018
</a-affix>

src/views/system/notice/page/detail.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</a-page-header>
77
</a-affix>
88
</div>
9-
<div class="detail_content" style="display: flex; flex-direction: column;">
9+
<div class="detail_content">
1010
<h1 class="title">{{ form?.title }}</h1>
1111
<div class="info">
1212
<a-space>
@@ -22,6 +22,12 @@
2222
<span>{{ form?.effectiveTime ? form?.effectiveTime : form?.createTime
2323
}}</span>
2424
</span>
25+
<a-divider v-if="form?.updateTime" direction="vertical" />
26+
<span v-if="form?.updateTime">
27+
<icon-schedule class="icon" />
28+
<span>更新时间:</span>
29+
<span>{{ form?.updateTime }}</span>
30+
</span>
2531
</a-space>
2632
</div>
2733
<div style="flex: 1;">
@@ -71,8 +77,11 @@ onMounted(() => {
7177
}
7278
7379
.info {
74-
text-align: right;
75-
padding: 20px;
80+
text-align: center;
81+
}
82+
83+
.icon {
84+
margin-right: 3px;
7685
}
7786
}
7887
</style>

0 commit comments

Comments
 (0)