verce-vue-test 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  const isCollapse = ref(false)
20
20
  const route = useRoute()
21
21
  const isFullscreenRoute = computed(() => route.meta.fullscreen === true)
22
+ const isNoticeRoute = computed(() => route.path.startsWith('/notice-announcement'))
22
23
 
23
24
  function toggleCollapse() {
24
25
  isCollapse.value = !isCollapse.value
@@ -121,9 +122,38 @@ function toggleCollapse() {
121
122
  </el-dropdown>
122
123
  </el-header>
123
124
 
124
- <el-main style="height: calc(100vh - 60px); overflow-y: auto">
125
+ <el-main
126
+ class="app-main"
127
+ :class="{ 'is-notice-route': isNoticeRoute }"
128
+ style="height: calc(100vh - 60px); overflow-y: auto"
129
+ >
125
130
  <RouterView />
126
131
  </el-main>
127
132
  </el-container>
128
133
  </el-container>
129
134
  </template>
135
+
136
+ <style scoped>
137
+ .app-main.is-notice-route {
138
+ scrollbar-width: thin;
139
+ scrollbar-color: #8fa7c9 #edf4ff;
140
+ }
141
+
142
+ .app-main.is-notice-route::-webkit-scrollbar {
143
+ width: 8px;
144
+ }
145
+
146
+ .app-main.is-notice-route::-webkit-scrollbar-track {
147
+ background: #edf4ff;
148
+ }
149
+
150
+ .app-main.is-notice-route::-webkit-scrollbar-thumb {
151
+ border: 2px solid #edf4ff;
152
+ border-radius: 999px;
153
+ background: #8fa7c9;
154
+ }
155
+
156
+ .app-main.is-notice-route::-webkit-scrollbar-thumb:hover {
157
+ background: #6f8cb7;
158
+ }
159
+ </style>
@@ -1,38 +1,53 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
+ import { useRouter } from 'vue-router'
3
4
  import { Search, Top } from '@element-plus/icons-vue'
4
5
  import noticeHeroBanner from '@/assets/notice-hero-banner.jpg'
5
6
 
6
7
  interface NoticeItem {
8
+ id: number
7
9
  title: string
8
10
  date: string
9
11
  pinned?: boolean
10
- detailPath?: string
11
12
  }
12
13
 
13
14
  const notices: NoticeItem[] = [
14
15
  {
16
+ id: 1001,
15
17
  title: '关于系统维护升级的公告(2024年6月15日)',
16
18
  date: '2024-06-10',
17
19
  pinned: true,
18
- detailPath: '/notice-announcement/detail',
19
20
  },
20
- { title: '关于优化预填报流程的通知', date: '2024-06-08' },
21
- { title: '端午节放假安排通知', date: '2024-06-05' },
22
- { title: '系统性能优化完成公告', date: '2024-06-03' },
23
- { title: '数据安全重要提醒', date: '2024-05-30' },
24
- { title: '关于系统新增功能的使用说明', date: '2024-05-28' },
25
- { title: '五一劳动节放假安排通知', date: '2024-04-25' },
26
- { title: '系统升级完成公告', date: '2024-04-15' },
21
+ { id: 1002, title: '关于优化预填报流程的通知', date: '2024-06-08' },
22
+ { id: 1003, title: '端午节放假安排通知', date: '2024-06-05' },
23
+ { id: 1004, title: '系统性能优化完成公告', date: '2024-06-03' },
24
+ { id: 1005, title: '数据安全重要提醒', date: '2024-05-30' },
25
+ { id: 1006, title: '关于系统新增功能的使用说明', date: '2024-05-28' },
26
+ { id: 1007, title: '五一劳动节放假安排通知', date: '2024-04-25' },
27
+ { id: 1008, title: '系统升级完成公告', date: '2024-04-15' },
27
28
  ]
28
29
 
29
30
  const currentPage = ref(1)
31
+ const router = useRouter()
32
+
33
+ function goToNoticeDetail(item: NoticeItem) {
34
+ router.push({
35
+ name: 'noticeDetail',
36
+ query: { id: String(item.id) },
37
+ })
38
+ }
30
39
  </script>
31
40
 
32
41
  <template>
33
42
  <main class="notice-page">
34
43
  <section class="notice-hero" aria-label="通知公告">
35
- <img class="notice-hero__image" :src="noticeHeroBanner" alt="" aria-hidden="true" />
44
+ <img
45
+ class="notice-hero__image"
46
+ :src="noticeHeroBanner"
47
+ alt=""
48
+ aria-hidden="true"
49
+ decoding="async"
50
+ />
36
51
 
37
52
  <div class="notice-hero__copy">
38
53
  <h1>通知公告</h1>
@@ -54,13 +69,13 @@ const currentPage = ref(1)
54
69
 
55
70
  <ul class="notice-list">
56
71
  <li v-for="item in notices" :key="`${item.title}-${item.date}`" class="notice-row">
57
- <RouterLink class="notice-title" :to="item.detailPath || '/notice-announcement/detail'">
72
+ <button class="notice-title" type="button" @click="goToNoticeDetail(item)">
58
73
  <span v-if="item.pinned" class="pin-tag">
59
74
  <el-icon :size="18"><Top /></el-icon>
60
75
  置顶
61
76
  </span>
62
77
  <span>{{ item.title }}</span>
63
- </RouterLink>
78
+ </button>
64
79
  <time :datetime="item.date">{{ item.date }}</time>
65
80
  </li>
66
81
  </ul>
@@ -81,13 +96,10 @@ const currentPage = ref(1)
81
96
 
82
97
  <style scoped>
83
98
  .notice-page {
84
- height: 100vh;
85
- min-height: 100vh;
86
- overflow-x: hidden;
87
- overflow-y: auto;
99
+ min-height: 100%;
100
+ overflow: visible;
88
101
  color: #10182d;
89
102
  background:
90
- radial-gradient(circle at 86% 20%, rgba(26, 111, 255, 0.1), transparent 24%),
91
103
  linear-gradient(180deg, #f9fbff 0%, #f4f7fc 42%, #f7f9fd 100%);
92
104
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
93
105
  }
@@ -95,10 +107,11 @@ const currentPage = ref(1)
95
107
  .notice-hero {
96
108
  position: relative;
97
109
  overflow: hidden;
98
- min-height: 283px;
99
- padding: 56px clamp(28px, 4.6vw, 72px) 34px;
110
+ min-height: 150px;
111
+ padding: 32px clamp(28px, 4.6vw, 72px) 24px;
100
112
  border-bottom: 1px solid rgba(219, 226, 237, 0.82);
101
113
  background: #eef6ff;
114
+ transform: translateZ(0);
102
115
  }
103
116
 
104
117
  .notice-hero__image {
@@ -120,7 +133,7 @@ const currentPage = ref(1)
120
133
 
121
134
  .notice-hero__copy h1 {
122
135
  margin: 0;
123
- font-size: clamp(32px, 3vw, 42px);
136
+ font-size: clamp(28px, 2.6vw, 36px);
124
137
  line-height: 1.18;
125
138
  font-weight: 800;
126
139
  letter-spacing: 0;
@@ -128,8 +141,8 @@ const currentPage = ref(1)
128
141
  }
129
142
 
130
143
  .notice-hero__copy p {
131
- margin: 22px 0 0;
132
- font-size: 17px;
144
+ margin: 18px 0 0;
145
+ font-size: 15px;
133
146
  line-height: 1.7;
134
147
  color: #748098;
135
148
  }
@@ -142,7 +155,7 @@ const currentPage = ref(1)
142
155
  display: flex;
143
156
  align-items: center;
144
157
  width: min(288px, calc(100vw - 56px));
145
- height: 45px;
158
+ height: 42px;
146
159
  padding: 0 15px 0 16px;
147
160
  border: 1px solid #d5ddea;
148
161
  border-radius: 8px;
@@ -157,7 +170,7 @@ const currentPage = ref(1)
157
170
  color: #24314b;
158
171
  background: transparent;
159
172
  font: inherit;
160
- font-size: 16px;
173
+ font-size: 14px;
161
174
  }
162
175
 
163
176
  .notice-search input::placeholder {
@@ -174,11 +187,11 @@ const currentPage = ref(1)
174
187
  z-index: 4;
175
188
  width: calc(100% - clamp(36px, 3.7vw, 56px));
176
189
  margin: -1px auto 32px;
177
- padding: 37px 42px 22px;
190
+ padding: 32px 42px 20px;
178
191
  border: 1px solid #e1e7f0;
179
192
  border-radius: 8px;
180
193
  background: rgba(255, 255, 255, 0.93);
181
- box-shadow: 0 14px 42px rgba(32, 58, 95, 0.06);
194
+ box-shadow: 0 8px 24px rgba(32, 58, 95, 0.05);
182
195
  }
183
196
 
184
197
  .notice-table__head,
@@ -190,11 +203,11 @@ const currentPage = ref(1)
190
203
  }
191
204
 
192
205
  .notice-table__head {
193
- height: 44px;
206
+ height: 40px;
194
207
  padding: 0 23px;
195
208
  border-bottom: 1px solid #dfe6f0;
196
209
  color: #6e7b94;
197
- font-size: 17px;
210
+ font-size: 15px;
198
211
  font-weight: 500;
199
212
  }
200
213
 
@@ -205,7 +218,7 @@ const currentPage = ref(1)
205
218
  }
206
219
 
207
220
  .notice-row {
208
- min-height: 67px;
221
+ min-height: 60px;
209
222
  padding: 0 23px;
210
223
  border-bottom: 1px solid #e8edf5;
211
224
  }
@@ -215,11 +228,17 @@ const currentPage = ref(1)
215
228
  align-items: center;
216
229
  min-width: 0;
217
230
  gap: 16px;
231
+ padding: 0;
232
+ border: 0;
218
233
  color: #0e172b;
234
+ background: transparent;
235
+ cursor: pointer;
219
236
  text-decoration: none;
220
- font-size: 18px;
237
+ font-size: 16px;
221
238
  line-height: 1.45;
222
239
  font-weight: 500;
240
+ font-family: inherit;
241
+ text-align: left;
223
242
  }
224
243
 
225
244
  .notice-title:hover {
@@ -236,13 +255,13 @@ const currentPage = ref(1)
236
255
  border-radius: 4px;
237
256
  color: #ff2e25;
238
257
  background: #ffe8e6;
239
- font-size: 16px;
258
+ font-size: 14px;
240
259
  font-weight: 600;
241
260
  }
242
261
 
243
262
  .notice-row time {
244
263
  color: #71809c;
245
- font-size: 18px;
264
+ font-size: 16px;
246
265
  line-height: 1.4;
247
266
  }
248
267
 
@@ -256,8 +275,8 @@ const currentPage = ref(1)
256
275
 
257
276
  @media (max-width: 920px) {
258
277
  .notice-hero {
259
- min-height: 300px;
260
- padding-top: 94px;
278
+ min-height: 150px;
279
+ padding-top: 68px;
261
280
  }
262
281
 
263
282
  .notice-hero__image {
@@ -283,8 +302,8 @@ const currentPage = ref(1)
283
302
 
284
303
  @media (max-width: 640px) {
285
304
  .notice-hero {
286
- min-height: 260px;
287
- padding: 86px 22px 26px;
305
+ min-height: 150px;
306
+ padding: 64px 22px 20px;
288
307
  }
289
308
 
290
309
  .notice-search {
@@ -334,55 +353,4 @@ const currentPage = ref(1)
334
353
  }
335
354
  }
336
355
 
337
- :deep(.el-pagination) {
338
- --el-pagination-button-width: 45px;
339
- --el-pagination-button-height: 43px;
340
- --el-pagination-border-radius: 7px;
341
- --el-pagination-bg-color: #ffffff;
342
- --el-pagination-button-color: #0f1729;
343
- --el-pagination-hover-color: #0b75ff;
344
- --el-pagination-font-size: 17px;
345
- align-items: center;
346
- gap: 11px;
347
- font-weight: 400;
348
- }
349
-
350
- :deep(.el-pagination.is-background .btn-prev),
351
- :deep(.el-pagination.is-background .btn-next),
352
- :deep(.el-pagination.is-background .el-pager li) {
353
- margin: 0;
354
- border: 1px solid #dde4ee;
355
- background: #ffffff;
356
- box-shadow: 0 5px 14px rgba(31, 59, 94, 0.04);
357
- }
358
-
359
- :deep(.el-pagination.is-background .el-pager li.is-active) {
360
- border-color: #0075ff;
361
- background: linear-gradient(180deg, #1486ff, #006df0);
362
- box-shadow: 0 8px 18px rgba(0, 110, 245, 0.24);
363
- }
364
-
365
- :deep(.el-pagination__jump) {
366
- margin-left: 28px;
367
- color: #6a778f;
368
- font-size: 17px;
369
- }
370
-
371
- :deep(.el-pagination__goto) {
372
- margin-right: 12px;
373
- }
374
-
375
- :deep(.el-pagination__classifier) {
376
- margin-left: 12px;
377
- }
378
-
379
- :deep(.el-pagination__editor.el-input) {
380
- width: 67px;
381
- height: 43px;
382
- }
383
-
384
- :deep(.el-pagination__editor.el-input .el-input__wrapper) {
385
- border-radius: 7px;
386
- box-shadow: 0 0 0 1px #dde4ee inset, 0 5px 14px rgba(31, 59, 94, 0.04);
387
- }
388
356
  </style>
@@ -1,60 +1,129 @@
1
1
  <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import { useRoute } from 'vue-router'
2
4
  import { Top } from '@element-plus/icons-vue'
5
+
6
+ interface ArticleSection {
7
+ heading: string
8
+ paragraphs?: string[]
9
+ items?: string[]
10
+ }
11
+
12
+ interface NoticeDetail {
13
+ id: number
14
+ title: string
15
+ publishTime: string
16
+ views: number
17
+ pinned?: boolean
18
+ salutation: string
19
+ intro: string
20
+ sections: ArticleSection[]
21
+ closing: string
22
+ team: string
23
+ signatureDate: string
24
+ }
25
+
26
+ const noticeDetails: NoticeDetail[] = [
27
+ {
28
+ id: 1001,
29
+ title: '关于系统维护升级的公告(2024年6月15日)',
30
+ publishTime: '2024-06-10 10:00:00',
31
+ views: 1268,
32
+ pinned: true,
33
+ salutation: '尊敬的用户:',
34
+ intro: '为提供更稳定、高效的服务,系统将于以下时间进行维护升级。维护期间,系统部分功能将受到影响,给您带来的不便,敬请谅解!',
35
+ sections: [
36
+ {
37
+ heading: '一、维护时间',
38
+ paragraphs: ['2024年6月15日(周六)02:00 - 06:00(预计4小时)'],
39
+ },
40
+ {
41
+ heading: '二、维护范围',
42
+ paragraphs: ['系统整体升级维护,期间将暂停服务。'],
43
+ },
44
+ {
45
+ heading: '三、影响范围',
46
+ items: [
47
+ '系统登录、项目管理、任务协作等功能将无法使用;',
48
+ '维护期间可能无法正常访问平台;',
49
+ '已进行的操作将在系统恢复后正常保存。',
50
+ ],
51
+ },
52
+ {
53
+ heading: '四、注意事项',
54
+ items: [
55
+ '请您提前安排好相关工作,避免在维护期间进行重要操作;',
56
+ '维护完成后,系统将自动恢复服务,无需您进行任何操作;',
57
+ '如有紧急问题,请联系管理员。',
58
+ ],
59
+ },
60
+ ],
61
+ closing: '感谢您对我们工作的支持与理解!',
62
+ team: '项目管理平台运营团队',
63
+ signatureDate: '2024年6月10日',
64
+ },
65
+ {
66
+ id: 1002,
67
+ title: '关于优化预填报流程的通知',
68
+ publishTime: '2024-06-08 09:30:00',
69
+ views: 986,
70
+ salutation: '尊敬的用户:',
71
+ intro: '为提升预填报效率,平台已对填报步骤、校验提示和保存逻辑进行优化,请您在办理相关业务时关注页面提示。',
72
+ sections: [
73
+ { heading: '一、优化内容', items: ['精简重复填写字段;', '优化必填项校验提示;', '增强草稿保存稳定性。'] },
74
+ { heading: '二、生效时间', paragraphs: ['本次优化自2024年6月8日起正式生效。'] },
75
+ ],
76
+ closing: '感谢您的配合。',
77
+ team: '项目管理平台运营团队',
78
+ signatureDate: '2024年6月8日',
79
+ },
80
+ ]
81
+
82
+ const route = useRoute()
83
+ const noticeId = computed(() => Number(route.query.id))
84
+ const notice = computed(() => noticeDetails.find((item) => item.id === noticeId.value))
3
85
  </script>
4
86
 
5
87
  <template>
6
88
  <main class="notice-detail-page">
7
- <article class="notice-article">
8
- <div class="pin-tag">
89
+ <article v-if="notice" class="notice-article">
90
+ <div v-if="notice.pinned" class="pin-tag">
9
91
  <el-icon :size="18"><Top /></el-icon>
10
92
  置顶
11
93
  </div>
12
94
 
13
- <h1>关于系统维护升级的公告(2024年6月15日)</h1>
95
+ <h1>{{ notice.title }}</h1>
14
96
 
15
97
  <div class="article-meta">
16
- <span>发布时间: 2024-06-10 10:00:00</span>
17
- <span>浏览量: 1268</span>
98
+ <span>发布时间: {{ notice.publishTime }}</span>
99
+ <span>浏览量: {{ notice.views }}</span>
18
100
  </div>
19
101
 
20
102
  <div class="article-divider"></div>
21
103
 
22
104
  <section class="article-content">
23
- <p class="salutation">尊敬的用户:</p>
105
+ <p class="salutation">{{ notice.salutation }}</p>
24
106
 
25
- <p class="indent">
26
- 为提供更稳定、高效的服务,系统将于以下时间进行维护升级。维护期间,系统部分功能将受到影响,
27
- 给您带来的不便,敬请谅解!
28
- </p>
107
+ <p class="indent">{{ notice.intro }}</p>
29
108
 
30
- <h2>一、维护时间</h2>
31
- <p>2024年6月15日(周六)02:00 - 06:00(预计4小时)</p>
109
+ <template v-for="section in notice.sections" :key="section.heading">
110
+ <h2>{{ section.heading }}</h2>
111
+ <p v-for="paragraph in section.paragraphs" :key="paragraph">{{ paragraph }}</p>
112
+ <ol v-if="section.items?.length">
113
+ <li v-for="item in section.items" :key="item">{{ item }}</li>
114
+ </ol>
115
+ </template>
32
116
 
33
- <h2>二、维护范围</h2>
34
- <p>系统整体升级维护,期间将暂停服务。</p>
35
-
36
- <h2>三、影响范围</h2>
37
- <ol>
38
- <li>系统登录、项目管理、任务协作等功能将无法使用;</li>
39
- <li>维护期间可能无法正常访问平台;</li>
40
- <li>已进行的操作将在系统恢复后正常保存。</li>
41
- </ol>
42
-
43
- <h2>四、注意事项</h2>
44
- <ol>
45
- <li>请您提前安排好相关工作,避免在维护期间进行重要操作;</li>
46
- <li>维护完成后,系统将自动恢复服务,无需您进行任何操作;</li>
47
- <li>如有紧急问题,请联系管理员。</li>
48
- </ol>
49
-
50
- <p>感谢您对我们工作的支持与理解!</p>
117
+ <p>{{ notice.closing }}</p>
51
118
 
52
119
  <footer class="article-signature">
53
- <p>项目管理平台运营团队</p>
54
- <p>2024年6月10日</p>
120
+ <p>{{ notice.team }}</p>
121
+ <p>{{ notice.signatureDate }}</p>
55
122
  </footer>
56
123
  </section>
57
124
  </article>
125
+
126
+ <el-empty v-else class="notice-empty" description="未找到公告详情" />
58
127
  </main>
59
128
  </template>
60
129
 
@@ -162,6 +231,16 @@ import { Top } from '@element-plus/icons-vue'
162
231
  margin: 0 0 8px;
163
232
  }
164
233
 
234
+ .notice-empty {
235
+ width: min(100%, 1174px);
236
+ min-height: 420px;
237
+ margin: 0 auto;
238
+ border: 1px solid #e1e7f0;
239
+ border-radius: 8px;
240
+ background: rgba(255, 255, 255, 0.96);
241
+ box-shadow: 0 14px 42px rgba(32, 58, 95, 0.06);
242
+ }
243
+
165
244
  @media (max-width: 768px) {
166
245
  .notice-detail-page {
167
246
  padding: 0 0 20px;