verce-vue-test 0.0.111 → 0.0.113

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.111",
3
+ "version": "0.0.113",
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
  }
@@ -1,267 +1,30 @@
1
1
  import baseHttpClient from '@/utils/baseHttpClient'
2
2
 
3
- /**
4
- * 外币手工核销页面接口。
5
- *
6
- * `baseHttpClient` 负责补充 TAM 公共报文头,当前文件只定义业务请求参数、
7
- * 交易码以及页面需要的响应归一化逻辑。
8
- */
9
-
10
- /** TAM 列表接口返回的单行原始数据,字段名保持后端原样。 */
11
- type ForeignSettlementRow = Record<string, unknown>
12
-
13
- /** 外币预报、流水查询接口的原始响应体。 */
14
- type ForeignSettlementListBody = {
15
- resultInfos?: ForeignSettlementRow[]
16
- totalCount?: number | string | null
17
- totalPage?: number | string | null
18
- }
19
-
20
- /** 页面统一使用的列表查询结果。 */
21
- export type ForeignSettlementListResult = {
22
- /** 当前页数据。 */
23
- resultList: ForeignSettlementRow[]
24
- /** 符合查询条件的数据总数。 */
25
- totalCount: number
26
- /** 总页数;接口未返回有效值时为 0。 */
27
- totalPage: number
28
- }
29
-
30
- /** 外币预报信息查询参数。 */
31
- export type ForeignSettlementForecastQueryParams = {
32
- /** 金额排序方式。 */
33
- amtOrder: string
34
- /** 授权状态。 */
35
- authorization: string
36
- /** 账户行行号。 */
37
- bankCode: string
38
- /** 所属机构代码。 */
39
- branchs: string
40
- /** 所属机构名称。 */
41
- branchsName: string
42
- /** 币种。 */
43
- ccy: string
44
- /** 客户名称。 */
45
- clientName: string
46
- /** 截止金额。 */
47
- endAmt: string
48
- /** 是否过滤 FTU 数据。 */
49
- filter: string
50
- /** 操作类型,列表查询时传空字符串。 */
51
- opType: string
52
- /** 当前页码。 */
53
- pageIndex: number
54
- /** 每页条数。 */
55
- pageSize: number
56
- /** 收支方向。 */
57
- payDirec: string
58
- /** 预报方式。 */
59
- predWay: string
60
- /** 起始金额。 */
61
- startAmt: string
62
- /** 起息日,格式为 YYYYMMDD。 */
63
- tranDate: string
64
- /** 业务类型。 */
65
- tranType: string
66
- /** 核销状态。 */
67
- vrfctnSts: string
68
- }
69
-
70
- /** 外币流水信息查询参数。 */
71
- export type ForeignSettlementFlowQueryParams = {
72
- /** 授权状态。 */
73
- authorization: string
74
- /** 账户行行号。 */
75
- bankCode: string
76
- /** 所属机构代码。 */
77
- branchs: string
78
- /** 所属机构名称。 */
79
- branchsName: string
80
- /** 币种。 */
81
- ccy: string
82
- /** 客户名称。 */
83
- clientName: string
84
- /** 截止金额。 */
85
- endAmt: string
86
- /** 操作类型,列表查询时传空字符串。 */
87
- opType: string
88
- /** 当前页码。 */
89
- pageIndex: number
90
- /** 每页条数。 */
91
- pageSize: number
92
- /** 收支方向。 */
93
- payDirec: string
94
- /** 预报方式;流水查询时传空字符串。 */
95
- predWay: string
96
- /** 起始金额。 */
97
- startAmt: string
98
- /** 交易日期,格式为 YYYYMMDD。 */
99
- tranDate: string
100
- /** 报文类型列表。 */
101
- tranType: string[]
102
- /** 核销状态。 */
103
- vrfctnSts: string
104
- }
105
-
106
- /** 手工核销请求参数;多个值按相同顺序使用英文逗号拼接。 */
107
- export type ForeignSettlementVerifyParams = {
108
- /** 预报流水号集合。 */
109
- predIds: string
110
- /** 预报金额集合。 */
111
- predAmts: string
112
- /** 已核销金额集合。 */
113
- verifyAmts: string
114
- /** 预报核销状态集合。 */
115
- preStatus: string
116
- /** 预报起息日集合。 */
117
- predValueDates: string
118
- /** 流水号集合;未选择流水时不传。 */
119
- tranSeqIds?: string
120
- /** 流水未核销金额集合;未选择流水时不传。 */
121
- tranAmts?: string
122
- /** 流水核销状态集合;未选择流水时不传。 */
123
- seqVerifyStatus?: string
124
- /** 流水起息日集合;未选择流水时不传。 */
125
- tranValueDates?: string
126
- }
127
-
128
- /** 撤销核销请求参数。 */
129
- export type ForeignSettlementCancelVerifyParams = {
130
- /** 预报已核销金额。 */
131
- predAmt: string
132
- /** 预报流水号。 */
133
- predRefNo: string
134
- /** 关联流水号集合,使用英文逗号拼接。 */
135
- tranRefNos: string
136
- }
137
-
138
- /** 自动核销请求参数。 */
139
- export type ForeignSettlementDateParams = {
140
- /** 自动核销日期,格式为 YYYYMMDD。 */
141
- tranDate: string
142
- }
143
-
144
- /** 获取流水请求参数。 */
145
- export type ForeignSettlementQueryDateParams = {
146
- /** 待获取流水的日期,格式为 YYYYMMDD。 */
147
- queryDate: string
148
- }
149
-
150
- /** 将接口返回的数量安全转换为非负数字。 */
151
- function normalizeCount(value: unknown, fallback: number) {
152
- const normalizedValue = String(value ?? '').trim()
153
- if (!normalizedValue) return fallback
154
- const count = Number(normalizedValue)
155
- return Number.isFinite(count) && count >= 0 ? count : fallback
156
- }
157
-
158
- /**
159
- * 将 TAM 的 `resultInfos` 列表结构转换为页面统一使用的分页结构。
160
- * 接口未返回数组时主动抛错,避免页面把异常响应误认为空列表。
161
- */
162
- function normalizeListBody(
163
- body: ForeignSettlementListBody,
164
- errorMessage: string,
165
- ): ForeignSettlementListResult {
166
- if (!Array.isArray(body.resultInfos)) throw new Error(errorMessage)
167
- return {
168
- resultList: body.resultInfos.map((row) => ({ ...row })),
169
- totalCount: normalizeCount(body.totalCount, body.resultInfos.length),
170
- totalPage: normalizeCount(body.totalPage, 0),
171
- }
172
- }
173
-
174
- /**
175
- * 查询外币预报信息。
176
- * @transactionCode 140202001
177
- * @returns 归一化后的预报列表及分页信息。
178
- */
179
- export async function queryForeignSettlementForecasts(
180
- params: ForeignSettlementForecastQueryParams,
181
- ) {
182
- const response = await baseHttpClient.post(
183
- '/TAM/0001/140202001',
184
- params,
185
- ) as any
186
- return normalizeListBody(response.body, '外币预报信息接口返回结构不正确')
187
- }
188
-
189
- /**
190
- * 查询外币流水信息。
191
- * @transactionCode 140202002
192
- * @returns 归一化后的流水列表及分页信息。
193
- */
194
- export async function queryForeignSettlementFlows(
195
- params: ForeignSettlementFlowQueryParams,
196
- ) {
197
- const response = await baseHttpClient.post(
198
- '/TAM/0001/140202002',
199
- params,
200
- ) as any
201
- return normalizeListBody(response.body, '外币流水信息接口返回结构不正确')
202
- }
203
-
204
- /**
205
- * 按指定起息日发起自动核销。
206
- * @transactionCode 120202001
207
- */
208
- export async function autoVerifyForeignSettlements(
209
- params: ForeignSettlementDateParams,
210
- ) {
211
- await baseHttpClient.post(
212
- '/TAM/0001/120202001',
213
- params,
214
- ) as any
215
- }
216
-
217
- /**
218
- * 获取指定日期的外币流水。
219
- * @transactionCode 120202004
220
- */
221
- export async function fetchForeignSettlementFlows(
222
- params: ForeignSettlementQueryDateParams,
223
- ) {
224
- await baseHttpClient.post(
225
- '/TAM/0001/120202004',
226
- params,
227
- ) as any
228
- }
229
-
230
- /**
231
- * 获取指定日期的外币日终流水。
232
- * @transactionCode 120202005
233
- */
234
- export async function fetchForeignSettlementEndOfDayFlows(
235
- params: ForeignSettlementQueryDateParams,
236
- ) {
237
- await baseHttpClient.post(
238
- '/TAM/0001/120202005',
239
- params,
240
- ) as any
241
- }
242
-
243
- /**
244
- * 手动核销所选外币预报及关联流水。
245
- * @transactionCode 120202002
246
- */
247
- export async function verifyForeignSettlements(
248
- params: ForeignSettlementVerifyParams,
249
- ) {
250
- await baseHttpClient.post(
251
- '/TAM/0001/120202002',
252
- params,
253
- ) as any
254
- }
255
-
256
- /**
257
- * 撤销外币预报及关联流水的核销关系。
258
- * @transactionCode 120202003
259
- */
260
- export async function cancelVerifyForeignSettlements(
261
- params: ForeignSettlementCancelVerifyParams,
262
- ) {
263
- await baseHttpClient.post(
264
- '/TAM/0001/120202003',
265
- params,
266
- ) as any
267
- }
3
+ const API = {
4
+ accountBankQueryApi: (params: any, options?: any) => {
5
+ return baseHttpClient.post('/TAM/0001/140206018', params, options)
6
+ },
7
+ forecastQueryApi: (params: any) => {
8
+ return baseHttpClient.post('/TAM/0001/140202001', params)
9
+ },
10
+ flowQueryApi: (params: any) => {
11
+ return baseHttpClient.post('/TAM/0001/140202002', params)
12
+ },
13
+ autoVerifyApi: (params: any) => {
14
+ return baseHttpClient.post('/TAM/0001/120202001', params)
15
+ },
16
+ fetchFlowApi: (params: any) => {
17
+ return baseHttpClient.post('/TAM/0001/120202004', params)
18
+ },
19
+ fetchEndOfDayFlowApi: (params: any) => {
20
+ return baseHttpClient.post('/TAM/0001/120202005', params)
21
+ },
22
+ verifyApi: (params: any) => {
23
+ return baseHttpClient.post('/TAM/0001/120202002', params)
24
+ },
25
+ cancelVerifyApi: (params: any) => {
26
+ return baseHttpClient.post('/TAM/0001/120202003', params)
27
+ },
28
+ }
29
+
30
+ export default API