verce-vue-test 0.0.110 → 0.0.112

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/denglong.vue ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -55,6 +55,7 @@ const searchableMenus: MenuSearchItem[] = [
55
55
  { value: '人民币匡算', path: '/rmb-estimation' },
56
56
  { value: '资金驾驶舱', path: '/fund-cockpit' },
57
57
  { value: '通知公告', path: '/notice-announcement' },
58
+ { value: '公告管理', path: '/notice-management' },
58
59
  { value: '占位符页面', path: '/placeholder' },
59
60
  { value: '关于', path: '/about' },
60
61
  ]
@@ -84,7 +85,13 @@ function toggleCollapse() {
84
85
  <template>
85
86
  <RouterView v-if="isFullscreenRoute" />
86
87
 
87
- <el-container v-else style="height: 100vh">
88
+ <el-container
89
+ v-else
90
+ :style="{
91
+ height: '100vh',
92
+ '--app-aside-width': isCollapse ? '64px' : '200px',
93
+ }"
94
+ >
88
95
  <el-aside :width="isCollapse ? '64px' : '200px'" style="background-color: #304156; transition: width 0.3s; overflow: hidden; height: 100vh">
89
96
  <div style="height: 50px; display: flex; align-items: center; padding-left: 20px; color: #fff; font-size: 16px; font-weight: bold; white-space: nowrap; overflow: hidden">
90
97
  <span v-if="!isCollapse">管理系统</span>
@@ -199,6 +206,10 @@ function toggleCollapse() {
199
206
  <el-icon><Bell /></el-icon>
200
207
  <span>通知公告</span>
201
208
  </el-menu-item>
209
+ <el-menu-item index="/notice-management">
210
+ <el-icon><EditPen /></el-icon>
211
+ <span>公告管理</span>
212
+ </el-menu-item>
202
213
  <el-menu-item index="/placeholder">
203
214
  <el-icon><Document /></el-icon>
204
215
  <span>占位符页面</span>
@@ -0,0 +1,153 @@
1
+ import baseHttpClient from '@/utils/baseHttpClient'
2
+
3
+ export type AnnouncementRecord = {
4
+ annouId: string
5
+ orgNo: string | null
6
+ annouTitle: string
7
+ annouSts: string
8
+ topFlag: string
9
+ createUserId: string | null
10
+ updateUserId: string | null
11
+ createTm: string
12
+ updateTm: string
13
+ annouLimitFlag: string
14
+ annouConte: string
15
+ effDt: string | null
16
+ expireDt: string | null
17
+ }
18
+
19
+ export type AnnouncementDetailRecord = AnnouncementRecord & {
20
+ orgList: unknown[]
21
+ roleList: unknown[]
22
+ userList: unknown[]
23
+ }
24
+
25
+ type AnnouncementPageData = {
26
+ total: number
27
+ list: AnnouncementRecord[]
28
+ pageNum: number
29
+ pageSize: number
30
+ size: number
31
+ pages: number
32
+ }
33
+
34
+ type AnnouncementResponse = {
35
+ code: string
36
+ message: string
37
+ data: AnnouncementPageData
38
+ }
39
+
40
+ type AnnouncementDetailResponse = {
41
+ code: string
42
+ message: string
43
+ data: Partial<AnnouncementDetailRecord>
44
+ }
45
+
46
+ export type AnnouncementPageResult = {
47
+ total: number
48
+ list: AnnouncementRecord[]
49
+ currentPage: number
50
+ pageSize: number
51
+ }
52
+
53
+ function toPositiveInteger(value: unknown, field: string) {
54
+ const number = Number(value)
55
+ if (!Number.isInteger(number) || number < 1) {
56
+ throw new Error(`公告接口返回的 ${field} 无效`)
57
+ }
58
+ return number
59
+ }
60
+
61
+ function normalizeRecord(source: Partial<AnnouncementRecord>): AnnouncementRecord {
62
+ const annouId = String(source.annouId ?? '').trim()
63
+ if (!annouId) throw new Error('公告接口返回的 annouId 为空')
64
+
65
+ return {
66
+ annouId,
67
+ orgNo: source.orgNo == null ? null : String(source.orgNo),
68
+ annouTitle: String(source.annouTitle ?? ''),
69
+ annouSts: String(source.annouSts ?? ''),
70
+ topFlag: String(source.topFlag ?? '0'),
71
+ createUserId: source.createUserId == null ? null : String(source.createUserId),
72
+ updateUserId: source.updateUserId == null ? null : String(source.updateUserId),
73
+ createTm: String(source.createTm ?? ''),
74
+ updateTm: String(source.updateTm ?? ''),
75
+ annouLimitFlag: String(source.annouLimitFlag ?? '0'),
76
+ annouConte: String(source.annouConte ?? ''),
77
+ effDt: source.effDt == null ? null : String(source.effDt),
78
+ expireDt: source.expireDt == null ? null : String(source.expireDt),
79
+ }
80
+ }
81
+
82
+ /** 查询公告管理列表,分页字段严格使用接口规定的 currentPage/pageSize。 */
83
+ export async function queryAnnouncements(
84
+ currentPage: number,
85
+ pageSize: number,
86
+ signal?: AbortSignal,
87
+ ): Promise<AnnouncementPageResult> {
88
+ const query = new URLSearchParams({
89
+ currentPage: String(currentPage),
90
+ pageSize: String(pageSize),
91
+ })
92
+ const response = await baseHttpClient.get<AnnouncementResponse>(
93
+ `/uaa/announcement/get?${query.toString()}`,
94
+ { signal },
95
+ )
96
+
97
+ if (response.code !== '0000') {
98
+ throw new Error(response.message || '公告查询失败')
99
+ }
100
+ if (!response.data || !Array.isArray(response.data.list)) {
101
+ throw new Error('公告接口返回结构不正确')
102
+ }
103
+
104
+ const total = Number(response.data.total)
105
+ if (!Number.isInteger(total) || total < 0) {
106
+ throw new Error('公告接口返回的 total 无效')
107
+ }
108
+
109
+ return {
110
+ total,
111
+ list: response.data.list.map(normalizeRecord),
112
+ currentPage: toPositiveInteger(response.data.pageNum || currentPage, 'pageNum'),
113
+ pageSize: toPositiveInteger(response.data.pageSize || pageSize, 'pageSize'),
114
+ }
115
+ }
116
+
117
+ /** 根据 annouId 查询公告详情。 */
118
+ export async function queryAnnouncementDetail(
119
+ annouId: string,
120
+ signal?: AbortSignal,
121
+ ): Promise<AnnouncementDetailRecord> {
122
+ const normalizedId = String(annouId ?? '').trim()
123
+ if (!normalizedId) {
124
+ throw new Error('公告 annouId 不能为空')
125
+ }
126
+
127
+ const query = new URLSearchParams({ annouId: normalizedId })
128
+ const response = await baseHttpClient.get<AnnouncementDetailResponse>(
129
+ `/uaa/announcement/get/id?${query.toString()}`,
130
+ { signal },
131
+ )
132
+
133
+ if (response.code !== '0000') {
134
+ throw new Error(response.message || '公告详情查询失败')
135
+ }
136
+ if (!response.data || typeof response.data !== 'object' || Array.isArray(response.data)) {
137
+ throw new Error('公告详情接口返回结构不正确')
138
+ }
139
+
140
+ const listFields = ['orgList', 'roleList', 'userList'] as const
141
+ for (const field of listFields) {
142
+ if (response.data[field] !== undefined && !Array.isArray(response.data[field])) {
143
+ throw new Error(`公告详情接口返回的 ${field} 无效`)
144
+ }
145
+ }
146
+
147
+ return {
148
+ ...normalizeRecord(response.data),
149
+ orgList: response.data.orgList ?? [],
150
+ roleList: response.data.roleList ?? [],
151
+ userList: response.data.userList ?? [],
152
+ }
153
+ }
@@ -136,6 +136,21 @@ const router = createRouter({
136
136
  name: 'noticeDetail',
137
137
  component: () => import('../views/NoticeDetailView.vue'),
138
138
  },
139
+ {
140
+ path: '/notice-management',
141
+ name: 'noticeManagement',
142
+ component: () => import('../views/notice-management/index.vue'),
143
+ },
144
+ {
145
+ path: '/notice-management/create',
146
+ name: 'noticeManagementCreate',
147
+ component: () => import('../views/notice-management/edit.vue'),
148
+ },
149
+ {
150
+ path: '/notice-management/:id/edit',
151
+ name: 'noticeManagementEdit',
152
+ component: () => import('../views/notice-management/edit.vue'),
153
+ },
139
154
  {
140
155
  path: '/placeholder',
141
156
  name: 'placeholder',
@@ -792,17 +792,31 @@ onBeforeUnmount(() => {
792
792
  <el-table-column
793
793
  column-key="operation"
794
794
  label="操作"
795
- width="248"
795
+ width="280"
796
796
  fixed="right"
797
797
  align="center"
798
798
  disabled
799
799
  >
800
800
  <template #default="{ row }">
801
801
  <div class="row-actions">
802
- <el-button link type="primary" :icon="EditPen" @click.stop="openEditEditor(row)">
802
+ <el-button
803
+ link
804
+ type="primary"
805
+ :icon="EditPen"
806
+ :disabled="Boolean(getEditRestriction(row))"
807
+ :title="getEditRestriction(row)"
808
+ @click.stop="openEditEditor(row)"
809
+ >
803
810
  修改
804
811
  </el-button>
805
- <el-button link type="danger" :icon="Delete" @click.stop="handleDelete(row)">
812
+ <el-button
813
+ link
814
+ type="danger"
815
+ :icon="Delete"
816
+ :disabled="Boolean(getDeleteRestriction(row))"
817
+ :title="getDeleteRestriction(row)"
818
+ @click.stop="handleDelete(row)"
819
+ >
806
820
  删除
807
821
  </el-button>
808
822
  <el-button
@@ -1106,6 +1120,11 @@ onBeforeUnmount(() => {
1106
1120
  white-space: nowrap;
1107
1121
  }
1108
1122
 
1123
+ .row-actions .el-button {
1124
+ width: 78px;
1125
+ justify-content: center;
1126
+ }
1127
+
1109
1128
  .row-actions .el-button + .el-button {
1110
1129
  margin-left: 0;
1111
1130
  }
@@ -1456,7 +1456,6 @@ onBeforeUnmount(() => {
1456
1456
  <el-select
1457
1457
  v-model="forecastFilterForm.ftuFilter"
1458
1458
  :append-to="overlayContainer || undefined"
1459
- :persistent="false"
1460
1459
  size="small"
1461
1460
  placeholder="请选择"
1462
1461
  clearable
@@ -1475,7 +1474,6 @@ onBeforeUnmount(() => {
1475
1474
  <el-select
1476
1475
  v-model="forecastFilterForm.direction"
1477
1476
  :append-to="overlayContainer || undefined"
1478
- :persistent="false"
1479
1477
  size="small"
1480
1478
  placeholder="请选择"
1481
1479
  clearable
@@ -1494,7 +1492,6 @@ onBeforeUnmount(() => {
1494
1492
  <el-select
1495
1493
  v-model="forecastFilterForm.currency"
1496
1494
  :append-to="overlayContainer || undefined"
1497
- :persistent="false"
1498
1495
  size="small"
1499
1496
  placeholder="请选择"
1500
1497
  filterable
@@ -1707,7 +1704,6 @@ onBeforeUnmount(() => {
1707
1704
  <el-select
1708
1705
  v-model="forecastFilterForm.ftuFilter"
1709
1706
  :append-to="overlayContainer || undefined"
1710
- :persistent="false"
1711
1707
  size="small"
1712
1708
  placeholder="请选择"
1713
1709
  clearable
@@ -1726,7 +1722,6 @@ onBeforeUnmount(() => {
1726
1722
  <el-select
1727
1723
  v-model="forecastFilterForm.direction"
1728
1724
  :append-to="overlayContainer || undefined"
1729
- :persistent="false"
1730
1725
  size="small"
1731
1726
  placeholder="请选择"
1732
1727
  clearable
@@ -1745,7 +1740,6 @@ onBeforeUnmount(() => {
1745
1740
  <el-select
1746
1741
  v-model="forecastFilterForm.currency"
1747
1742
  :append-to="overlayContainer || undefined"
1748
- :persistent="false"
1749
1743
  size="small"
1750
1744
  placeholder="请选择"
1751
1745
  filterable
@@ -1767,7 +1761,6 @@ onBeforeUnmount(() => {
1767
1761
  <el-select
1768
1762
  v-model="forecastFilterForm.businessType"
1769
1763
  :append-to="overlayContainer || undefined"
1770
- :persistent="false"
1771
1764
  size="small"
1772
1765
  placeholder="请选择"
1773
1766
  clearable
@@ -1786,7 +1779,6 @@ onBeforeUnmount(() => {
1786
1779
  <el-select
1787
1780
  v-model="forecastFilterForm.forecastWay"
1788
1781
  :append-to="overlayContainer || undefined"
1789
- :persistent="false"
1790
1782
  size="small"
1791
1783
  placeholder="请选择"
1792
1784
  clearable
@@ -1805,7 +1797,6 @@ onBeforeUnmount(() => {
1805
1797
  <el-select
1806
1798
  v-model="forecastFilterForm.verifyStatus"
1807
1799
  :append-to="overlayContainer || undefined"
1808
- :persistent="false"
1809
1800
  size="small"
1810
1801
  placeholder="请选择"
1811
1802
  clearable
@@ -1830,7 +1821,6 @@ onBeforeUnmount(() => {
1830
1821
  v-model="forecastFilterForm.bankCode"
1831
1822
  :append-to="overlayContainer || undefined"
1832
1823
  :loading="forecastAccountBankLoading"
1833
- :persistent="false"
1834
1824
  size="small"
1835
1825
  placeholder="请选择账户行"
1836
1826
  filterable
@@ -1955,7 +1945,6 @@ onBeforeUnmount(() => {
1955
1945
  <el-select
1956
1946
  v-model="flowFilterForm.direction"
1957
1947
  :append-to="overlayContainer || undefined"
1958
- :persistent="false"
1959
1948
  size="small"
1960
1949
  placeholder="请选择"
1961
1950
  clearable
@@ -1974,7 +1963,6 @@ onBeforeUnmount(() => {
1974
1963
  <el-select
1975
1964
  v-model="flowFilterForm.currency"
1976
1965
  :append-to="overlayContainer || undefined"
1977
- :persistent="false"
1978
1966
  size="small"
1979
1967
  placeholder="请选择"
1980
1968
  filterable
@@ -1996,7 +1984,6 @@ onBeforeUnmount(() => {
1996
1984
  <el-select
1997
1985
  v-model="flowFilterForm.verifyStatus"
1998
1986
  :append-to="overlayContainer || undefined"
1999
- :persistent="false"
2000
1987
  size="small"
2001
1988
  placeholder="请选择"
2002
1989
  clearable
@@ -2193,7 +2180,6 @@ onBeforeUnmount(() => {
2193
2180
  <el-select
2194
2181
  v-model="flowFilterForm.direction"
2195
2182
  :append-to="overlayContainer || undefined"
2196
- :persistent="false"
2197
2183
  size="small"
2198
2184
  placeholder="请选择"
2199
2185
  clearable
@@ -2212,7 +2198,6 @@ onBeforeUnmount(() => {
2212
2198
  <el-select
2213
2199
  v-model="flowFilterForm.currency"
2214
2200
  :append-to="overlayContainer || undefined"
2215
- :persistent="false"
2216
2201
  size="small"
2217
2202
  placeholder="请选择"
2218
2203
  filterable
@@ -2234,7 +2219,6 @@ onBeforeUnmount(() => {
2234
2219
  <el-select
2235
2220
  v-model="flowFilterForm.messageTypes"
2236
2221
  :append-to="overlayContainer || undefined"
2237
- :persistent="false"
2238
2222
  size="small"
2239
2223
  placeholder="请选择或输入代码"
2240
2224
  multiple
@@ -2259,7 +2243,6 @@ onBeforeUnmount(() => {
2259
2243
  <el-select
2260
2244
  v-model="flowFilterForm.verifyStatus"
2261
2245
  :append-to="overlayContainer || undefined"
2262
- :persistent="false"
2263
2246
  size="small"
2264
2247
  placeholder="请选择"
2265
2248
  clearable
@@ -2284,7 +2267,6 @@ onBeforeUnmount(() => {
2284
2267
  v-model="flowFilterForm.bankCode"
2285
2268
  :append-to="overlayContainer || undefined"
2286
2269
  :loading="flowAccountBankLoading"
2287
- :persistent="false"
2288
2270
  size="small"
2289
2271
  placeholder="请选择账户行"
2290
2272
  filterable
@@ -0,0 +1,33 @@
1
+ import baseHttpClient from '@/utils/baseHttpClient'
2
+ import { queryAnnouncementDetail, queryAnnouncements } from '@/api/announcement'
3
+
4
+ import type {
5
+ NoticeDetail,
6
+ NoticeListQuery,
7
+ NoticeListResponse,
8
+ NoticePayload,
9
+ } from './types'
10
+
11
+ export async function getNoticeList(query: NoticeListQuery): Promise<NoticeListResponse> {
12
+ const response = await queryAnnouncements(query.currentPage, query.pageSize)
13
+ return {
14
+ resultList: response.list,
15
+ totalCount: response.total,
16
+ }
17
+ }
18
+
19
+ export function getNoticeDetail(id: number | string) {
20
+ return queryAnnouncementDetail(String(id))
21
+ }
22
+
23
+ export function createNotice(payload: NoticePayload) {
24
+ return baseHttpClient.post<NoticeDetail>('/notices', payload)
25
+ }
26
+
27
+ export function updateNotice(id: number | string, payload: NoticePayload) {
28
+ return baseHttpClient.put<NoticeDetail>(`/notices/${id}`, payload)
29
+ }
30
+
31
+ export function deleteNotice(id: number | string) {
32
+ return baseHttpClient.delete<{ success: boolean; message: string }>(`/notices/${id}`)
33
+ }