vue3-element-plus-app-chu 0.0.21 → 0.0.23

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/README.md CHANGED
@@ -30,8 +30,8 @@ pnpm dev:backend # 只启动后端(backend/ 目录,tsx watch)
30
30
  - 模块目录与授权页面保持一致:`api.ts` 只放接口定义,`utils.ts` 放日期、金额、表单校验等共用工具,`typs.ts` 类型,`runtime.ts` 默认交易日期,`index.vue` 为入口,`components/` 放页面外壳和列表、新增修改、详情页面。接口定义只维护在各自模块下,不再集中到 `src/api`。
31
31
  - 新增、修改、详情页面每行四列展示,窗口变窄后依次降为三列、两列、一列。
32
32
 
33
- 本地后端的预报接口当前使用通用模拟响应,写入成功响应不代表真实持久化。
33
+ 本地后端已接入 MongoDB 业务模拟,预报增删改查、核销、注资余额、匡算历史和参数均可持久化。JSON 响应统一为 `{ code, data, message }`,TAM 的 `head/body` 位于 `data` 中,前端公共请求层自动解包。服务端导入协议尚未实现时明确返回 `501`。完整运行说明见 [后端 README](backend/README.md)。
34
34
 
35
35
  ## 城银清头寸参数接口
36
36
 
37
- 新增、修改、删除、查询、详情五个接口的封装及类型位于 `src/view/dcps/city-clearing/parameters/`,本次仅提供接口层。城银清查询与详情使用 `moduleCode: '3'`。本地后端提供符合字段契约的模拟响应及参数校验,写操作不持久化;接口字段和示例见 [城银清头寸参数接口说明](docs/city-clearing-parameters-apis.md),Scalar 文档入口为后端 `/docs`。
37
+ 参数管理接口已支持持久化增删改查、关键词筛选和分页。数币页面位于 `src/view/dcps/parameters/`,使用 `moduleCode: '5'`;页面详情直接取表格行数据,不再请求详情接口。同一后端也支持城银清模块 `'3'`。参数名称全局唯一,修改和删除按名称定位;接口字段和示例见 [城银清头寸参数接口说明](docs/city-clearing-parameters-apis.md),Scalar 文档入口为后端 `/docs`。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue3-element-plus-app-chu",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -30,13 +30,13 @@ export interface TamResponseHead {
30
30
  [field: string]: unknown
31
31
  }
32
32
 
33
- /** TAM 接口直接返回公共响应头和业务体,不再增加额外包装。 */
33
+ /** 页面使用的 TAM 数据;请求层从统一响应的 data 中读取。 */
34
34
  export interface ApiResponse<T = unknown> {
35
35
  head: TamResponseHead
36
36
  body: T | null
37
37
  }
38
38
 
39
- /** 非 TAM 接口沿用原有响应格式。 */
39
+ /** 后端统一的 JSON 外层响应格式。 */
40
40
  export interface StandardApiResponse<T = unknown> {
41
41
  code: number
42
42
  data: T | null
@@ -124,7 +124,7 @@ http.interceptors.response.use(
124
124
 
125
125
  type RequestConfig = Omit<HttpRequestConfig, 'url' | 'method'>
126
126
 
127
- // 泛型 T 表示完整响应结构;直接透传服务端 JSON,保留 head、body 和公共头字段。
127
+ // TAM 接口将统一响应中的 data 解包,页面继续使用 head/body。
128
128
  export const request = async <T = ApiResponse>(
129
129
  config: HttpRequestConfig,
130
130
  ): Promise<T> => {
@@ -132,6 +132,12 @@ export const request = async <T = ApiResponse>(
132
132
  ...config,
133
133
  data: createTamEnvelope(config.data),
134
134
  })
135
+ const payload: unknown = response.data
136
+ if (/^\/TAM(?:\/|$)/i.test(config.url ?? '')
137
+ && isPlainObject(payload) && typeof payload.code === 'number') {
138
+ if (payload.code !== 0) throw new Error(typeof payload.message === 'string' ? payload.message : '请求失败')
139
+ return payload.data as T
140
+ }
135
141
  return response.data
136
142
  }
137
143
 
@@ -20,6 +20,7 @@
20
20
  - 页面入口统一命名为 `Dcps<模块>Page`。
21
21
  - 页面内部的弹窗、表格、表单不再单独拆文件,直接写在 `index.vue` 中,相关状态和方法使用页面前缀区分。
22
22
  - 路由名使用 kebab-case(如 `forecast-create`)。
23
+ - DCPS 页面接口返回按 `any` 处理,接口封装可使用 `post<any>`,页面需要时可按 `any` 读取响应;业务字段类型定义在各页面本地 `typs.ts`。不要从 `@/utils/request` 导入公共 `ApiResponse`,也不要通过 `@chic/http` 的重导出导入该类型;仍按接口实际响应字段判断业务成功与失败。
23
24
 
24
25
  ## 路由与页面文件
25
26
 
@@ -47,7 +48,8 @@
47
48
  - `forecast/index.vue` 顶部使用一个普通 `<script>` 块保存列表记录缓存,跳转修改或详情前暂存列表行,用于补齐详情接口未返回的字段。
48
49
  - 侧边菜单配置在 `src/router/menus.ts`,其中 `name` 必须与对应路由的 `name` 保持一致;分组菜单通过 `children` 配置二级页面,页面的 `meta.menu` 指向自己的菜单项。
49
50
  - “注资/预注资管理”对应 `funding` 分组,包含注资明细查询和账户行余额查询申请两个页面;访问子页面时自动展开父菜单。旧地址 `/injection`、`/balance` 保留为对应页面的别名。
50
- - 数字人民币参数管理为末尾的独立菜单,页面文件为 `parameters/index.vue`、`parameters/api.ts`、`parameters/typs.ts`。页面复用“城银清算头寸管理-头寸参数”的五个接口,查询、详情及新增固定传 `moduleCode: '5'`。本次用户确认以 `paraName` 定位修改和删除:修改时锁定原参数名称、参数标志只读;删除使用由参数名称组成的 `sysParaList` 数组。当前本地后端仍返回模拟结果,不保存参数。
51
+ - 数字人民币参数管理为末尾的独立菜单,页面文件为 `parameters/index.vue`、`parameters/api.ts`、`parameters/typs.ts`,接口与类型均独立定义在该目录,不再依赖或保留 `city-clearing/` 目录。页面复用“城银清算头寸管理-头寸参数”的列表、新增、修改、删除四个接口,详情直接取表格行数据,不再请求详情接口;`api.ts` 参照授权页面直接向 `@chic/http` 平铺传参,由 Axios 公共封装拆分为服务端所需的 `body`、`head` 等字段,不手动包装信封。页面查询调用只传 `keywords`、数字类型的 `pageIndex` 和 `pageSize`,`moduleCode: '5'` 由 API 内部固定添加,分页数字由封装层转换为字符串;新增传六个字符串表单字段,模块代码也由 API 固定添加。本次用户确认以 `paraName` 定位修改和删除:修改时锁定原参数名称、参数标志只读;删除向 API 传名称数组,由 API 转为平铺的 `sysParaList`。页面类型使用 `DigitalRmbParameter` 等独立类型,原始 Swagger 契约及 `docs/city-clearing-parameters*` 文档文件名保留。当前本地后端仍返回模拟结果,不保存参数。
52
+ - 数字人民币参数管理以数字人民币授权页面为布局参考,统一筛选区、填满剩余高度的表格以及包含摘要和分组字段的详情弹窗样式。
51
53
  - `src/layout/index.vue` 使用 `<KeepAlive include="DcpsForecastPage">` 缓存头寸预报页面;新增、修改、详情按路由 `key` 分别缓存,返回列表时自动重新查询。
52
54
 
53
55
  ## 新增页面检查清单
@@ -615,6 +615,8 @@ onBeforeUnmount(() => {
615
615
  .dcps-page {
616
616
  box-sizing: border-box;
617
617
  display: flex;
618
+ width: 100%;
619
+ max-width: 100%;
618
620
  flex-direction: column;
619
621
  gap: 5px;
620
622
  height: calc(100vh - var(--dpcs-host-layout-height));
@@ -16,22 +16,23 @@ const tableSize = 'small'
16
16
  // 历史预计调拨金额接口(140503004)预填金额,允许手工调整后重新匡算。
17
17
  // 匡算结果(140503001)以合并单元格的头寸匡算表展示,样式与业务原型一致;
18
18
  // 「今日预计调拨金额」行的收入、支付单元格就是查询条件输入框,随历史记录预填;
19
- // 导出按钮暂未接线(下载协议待确认);单击其余金额单元格按位置编码查询详情(140503003)。
19
+ // 导出按钮暂未接线(下载协议待确认);单击可查看明细的金额单元格按位置编码查询详情(140503003)。
20
20
 
21
21
  // 接口字段编码与图中报表位置的对应关系:
22
22
  // C3 城商行支付清算账户前一日余额;C6/D6 报备金额;C7/D7 未核销金额;
23
23
  // C8/D8 未核销业务流水;C11/D11 今日预计调拨金额(查询条件输入框,不查详情);
24
- // B15 当日实时余额。轧差列由前端按「收入减支出」计算:结果行随查询结果更新,
24
+ // B15 当日实时余额。C3、B15 仅展示余额,不提供明细弹窗。
25
+ // 轧差列由前端按「收入减支出」计算:结果行随查询结果更新,
25
26
  // 调拨行随输入实时更新;日初可用资金、预留金额及两条空行暂无接口字段,先按原型占位留空。
27
+
28
+ // 仅登记可查看明细的单元格;C3、B15 为余额展示,不参与详情查询。
26
29
  const cellLabels: Record<string, string> = {
27
- C3: '城商行支付清算账户前一日余额',
28
30
  C6: '报备金额(收入)',
29
31
  D6: '报备金额(支付)',
30
32
  C7: '未核销金额(收入)',
31
33
  D7: '未核销金额(支付)',
32
34
  C8: '未核销业务流水(收入)',
33
35
  D8: '未核销业务流水(支付)',
34
- B15: '当日实时余额',
35
36
  }
36
37
 
37
38
  // ---------- 页面内工具函数 ----------
@@ -380,10 +381,10 @@ onBeforeUnmount(() => {
380
381
  <tr>
381
382
  <td colspan="2" class="report-label">城商行支付清算账户前一日余额</td>
382
383
  <td colspan="2" class="report-data">
383
- <button type="button" class="report-value" @click="openDetail(cellOf('C3'))">
384
+ <div class="report-value report-value--static">
384
385
  <span class="report-amount">{{ amountText('C3') }}</span>
385
386
  <span class="report-tag">C3</span>
386
- </button>
387
+ </div>
387
388
  </td>
388
389
  <td class="report-label report-label--unit">单位:元</td>
389
390
  </tr>
@@ -498,10 +499,10 @@ onBeforeUnmount(() => {
498
499
  <tr>
499
500
  <td colspan="2" class="report-label">当日实时余额</td>
500
501
  <td colspan="3" class="report-data">
501
- <button type="button" class="report-value" @click="openDetail(cellOf('B15'))">
502
+ <div class="report-value report-value--static">
502
503
  <span class="report-amount">{{ amountText('B15') }}</span>
503
504
  <span class="report-tag">B15</span>
504
- </button>
505
+ </div>
505
506
  </td>
506
507
  </tr>
507
508
  </tbody>
@@ -633,6 +634,8 @@ onBeforeUnmount(() => {
633
634
  .dcps-page {
634
635
  box-sizing: border-box;
635
636
  display: flex;
637
+ width: 100%;
638
+ max-width: 100%;
636
639
  flex-direction: column;
637
640
  gap: 5px;
638
641
  height: calc(100vh - var(--dpcs-host-layout-height));
@@ -737,6 +740,11 @@ td.report-data--input { padding: 5px 8px; }
737
740
  }
738
741
  .report-value:hover { background: var(--el-fill-color-light); }
739
742
  .report-value:focus-visible { outline: 2px solid var(--el-color-primary); outline-offset: -2px; }
743
+ /* 无明细的余额单元格(C3、B15):保留金额与位置标注的对齐,但不响应点击。 */
744
+ .report-value--static,
745
+ .report-table:not(.is-ready) .report-value--static { cursor: default; }
746
+ .report-value--static:hover,
747
+ .report-table:not(.is-ready) .report-value--static:hover { background: transparent; }
740
748
  .report-amount { color: var(--el-color-primary-dark-2); font-variant-numeric: tabular-nums; font-weight: 600; }
741
749
  .report-tag {
742
750
  flex: 0 0 auto;
@@ -889,6 +889,8 @@ onActivated(() => {
889
889
  .dcps-page {
890
890
  box-sizing: border-box;
891
891
  display: flex;
892
+ width: 100%;
893
+ max-width: 100%;
892
894
  flex-direction: column;
893
895
  gap: 5px;
894
896
  height: calc(100vh - var(--dpcs-host-layout-height));
@@ -199,15 +199,14 @@ onBeforeUnmount(() => {
199
199
 
200
200
  <template>
201
201
  <main class="dcps-page">
202
- <!-- 标题区:页面名称、最近查询时间、发起入口与查询按钮。 -->
202
+ <!-- 标题区:最近查询时间、发起入口与账户行余额查询按钮。 -->
203
203
  <el-card class="balance-header" shadow="never" :body-style="{ padding: '10px 14px' }">
204
204
  <div class="balance-heading">
205
- <h1 class="balance-title">数字人民币账户行余额查询申请</h1>
206
- <span v-if="lastQueryTime" class="balance-updated">最近查询:{{ lastQueryTime }}</span>
207
205
  <span class="balance-actions">
208
206
  <el-button @click="openCreateDialog">注资/预注资发起</el-button>
209
- <el-button type="primary" :loading="loading" @click="query()">查询</el-button>
207
+ <el-button type="primary" :loading="loading" @click="query()">账户行余额查询</el-button>
210
208
  </span>
209
+ <span v-if="lastQueryTime" class="balance-updated">最近查询:{{ lastQueryTime }}</span>
211
210
  </div>
212
211
  </el-card>
213
212
 
@@ -297,6 +296,8 @@ onBeforeUnmount(() => {
297
296
  .dcps-page {
298
297
  box-sizing: border-box;
299
298
  display: flex;
299
+ width: 100%;
300
+ max-width: 100%;
300
301
  flex-direction: column;
301
302
  gap: 5px;
302
303
  height: calc(100vh - var(--dpcs-host-layout-height));
@@ -308,10 +309,9 @@ onBeforeUnmount(() => {
308
309
  background: var(--el-bg-color-page, #f7f8fa);
309
310
  }
310
311
  .balance-header { flex: 0 0 auto; }
311
- .balance-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
312
- .balance-title { margin: 0; color: var(--el-text-color-primary); font-size: 16px; font-weight: 600; line-height: 22px; }
312
+ .balance-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
313
313
  .balance-updated { color: var(--el-text-color-secondary); font-size: 12px; }
314
- .balance-actions { margin-left: auto; display: flex; }
314
+ .balance-actions { display: flex; }
315
315
  .balance-actions :deep(.el-button + .el-button) { margin-left: 8px; }
316
316
 
317
317
  .balance-scroll { flex: 1; min-height: 0; min-width: 0; }
@@ -424,6 +424,8 @@ onBeforeUnmount(() => {
424
424
  .dcps-page {
425
425
  box-sizing: border-box;
426
426
  display: flex;
427
+ width: 100%;
428
+ max-width: 100%;
427
429
  flex-direction: column;
428
430
  gap: 5px;
429
431
  height: calc(100vh - var(--dpcs-host-layout-height));
@@ -1,26 +1,30 @@
1
- import parameterApi from '../city-clearing/parameters/api'
2
- import type { ParameterEditBody, ParameterFormValues, ParameterQueryParams } from './typs'
1
+ import baseHttpClient from '@chic/http'
2
+ import type {
3
+ ParameterEditBody,
4
+ ParameterFormValues,
5
+ ParameterQueryParams,
6
+ } from './typs'
3
7
 
4
8
  const moduleCode = '5'
5
9
 
10
+ // 与授权页面一致,平铺传参,由 Axios 封装器拆分公共头、业务体并转换分页字段。
6
11
  export default {
7
12
  queryListApi: ({ keywords, pageIndex, pageSize }: ParameterQueryParams) =>
8
- parameterApi.queryListApi({
9
- head: { pageIndex: String(pageIndex), pageSize: String(pageSize) },
10
- body: { moduleCode, keywords },
13
+ baseHttpClient.post<any>('/TAM/0001/140305001', {
14
+ moduleCode,
15
+ keywords,
16
+ pageIndex,
17
+ pageSize,
11
18
  }),
12
19
 
13
- getDetailApi: (paraName: string) =>
14
- parameterApi.getDetailApi({ body: { moduleCode, paraName } }),
15
-
16
20
  addApi: (values: ParameterFormValues) =>
17
- parameterApi.addApi({ body: { ...values, moduleCode } }),
21
+ baseHttpClient.post<any>('/TAM/0001/120305002', { ...values, moduleCode }),
18
22
 
19
23
  // 用户确认以原参数名称定位;原始修改契约不包含 moduleCode、paraMark。
20
24
  editApi: (values: ParameterEditBody) =>
21
- parameterApi.editApi({ body: values }),
25
+ baseHttpClient.post<any>('/TAM/0001/120305003', values),
22
26
 
23
27
  // 用户确认 sysParaList 的元素为参数名称;删除契约没有模块字段。
24
28
  deleteApi: (paraNames: string[]) =>
25
- parameterApi.deleteApi({ body: { sysParaList: [...paraNames] } }),
29
+ baseHttpClient.post<any>('/TAM/0001/120305001', { sysParaList: [...paraNames] }),
26
30
  }
@@ -2,7 +2,6 @@
2
2
  import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
3
3
  import { ElConfigProvider, ElMessage } from 'element-plus'
4
4
  import { ArtDataTable, type ColumnOption, type PaginationOptions, type TableSettings } from '@/components/table'
5
- import type { ApiResponse } from '@/utils/request'
6
5
  import API from './api'
7
6
  import type { DigitalRmbParameter, ParameterFormValues, ParameterListBody } from './typs'
8
7
 
@@ -20,6 +19,11 @@ const parameterFields = [
20
19
  { key: 'remark', label: '备注', multiline: true },
21
20
  ] as const
22
21
 
22
+ const detailGroups = [
23
+ { title: '参数配置', fields: parameterFields.filter(({ key }) => key === 'paraType' || key === 'paraMark' || key === 'paraValue') },
24
+ { title: '说明信息', fields: parameterFields.filter(({ key }) => key === 'paraDesc' || key === 'remark') },
25
+ ]
26
+
23
27
  const createFormValues = (parameter: DigitalRmbParameter = {}): ParameterFormValues => ({
24
28
  paraName: parameter.paraName ?? '',
25
29
  paraType: parameter.paraType ?? '',
@@ -32,7 +36,7 @@ const createFormValues = (parameter: DigitalRmbParameter = {}): ParameterFormVal
32
36
  const errorMessage = (error: unknown): string =>
33
37
  error instanceof Error && error.message.trim() ? error.message : '请求失败,请稍后重试'
34
38
 
35
- const ensureSuccess = <T,>(response: ApiResponse<T>, fallback: string): T | null => {
39
+ const ensureSuccess = (response: any, fallback: string): any => {
36
40
  if (response?.head?.retCode !== '00000') {
37
41
  throw new Error(response?.head?.retMsg?.trim() || fallback)
38
42
  }
@@ -62,8 +66,8 @@ const keywords = ref('')
62
66
  let appliedKeywords = ''
63
67
  const rows = ref<DigitalRmbParameter[]>([])
64
68
  const selectedRows = ref<DigitalRmbParameter[]>([])
65
- const pagination = reactive({ current: 1, size: 15, total: 0 })
66
- const paginationOptions: PaginationOptions = { align: 'right', pageSizes: [15, 30, 50, 100], background: false }
69
+ const pagination = reactive({ current: 1, size: 10, total: 0 })
70
+ const paginationOptions: PaginationOptions = { align: 'right', pageSizes: [10, 20, 50], background: false }
67
71
  const tableSettings = ref<TableSettings>({ size: 'small', stripe: true, border: true, headerBackground: true })
68
72
  const tableRef = ref<InstanceType<typeof ArtDataTable> | null>(null)
69
73
  const showSearchBar = ref(true)
@@ -73,7 +77,6 @@ const pendingMutation = ref<Mutation>(null)
73
77
  const writing = computed(() => pendingMutation.value !== null)
74
78
  const listBusy = computed(() => listLoading.value || writing.value)
75
79
  let listRequestId = 0
76
- let detailRequestId = 0
77
80
  let disposed = false
78
81
 
79
82
  const textColumn = (prop: keyof DigitalRmbParameter, label: string, minWidth: number): ColumnOption<DigitalRmbParameter> => ({
@@ -83,14 +86,14 @@ const textColumn = (prop: keyof DigitalRmbParameter, label: string, minWidth: nu
83
86
 
84
87
  const tableColumns: ColumnOption<DigitalRmbParameter>[] = [
85
88
  { type: 'selection', width: 42, fixed: 'left', selectable: hasName },
86
- { type: 'globalIndex', label: '序号', width: 60, align: 'center' },
89
+ { type: 'globalIndex', label: '序号', width: 80, align: 'center' },
87
90
  { ...textColumn('paraName', '参数名称', 180), useSlot: true, slotName: 'name' },
88
91
  textColumn('paraType', '参数类型', 110),
89
92
  textColumn('paraMark', '参数标志', 110),
90
93
  { ...textColumn('paraValue', '参数值', 190), useSlot: true, slotName: 'value' },
91
94
  textColumn('paraDesc', '参数描述', 220),
92
95
  textColumn('remark', '备注', 180),
93
- { key: 'actions', label: '操作', width: 170, fixed: 'right', align: 'center', useSlot: true },
96
+ { key: 'actions', label: '操作', width: 200, fixed: 'right', align: 'center', useSlot: true },
94
97
  ]
95
98
 
96
99
  const clearSelection = () => {
@@ -162,56 +165,25 @@ const changePage = (current: number, size = pagination.size) => {
162
165
  void loadList()
163
166
  }
164
167
 
165
- // 新增、修改和详情共用弹窗;详情失败时禁用保存,避免提交未完整加载的数据。
168
+ // 新增、修改和详情共用弹窗;详情直接使用表格行数据,不再单独请求。
166
169
  const dialogVisible = ref(false)
167
170
  const dialogMode = ref<DialogMode>('create')
168
- const dialogLoading = ref(false)
169
- const dialogReady = ref(false)
170
171
  const dialogError = ref('')
171
172
  const dialogSource = ref<DigitalRmbParameter | null>(null)
172
173
  const form = ref(createFormValues())
173
174
  const formNameError = ref('')
174
- const dialogTitle = computed(() => ({ create: '新增参数', edit: '修改参数', detail: '参数详情' })[dialogMode.value])
175
- const dialogBusy = computed(() => dialogLoading.value || writing.value)
175
+ const dialogTitle = computed(() => ({ create: '新增参数', edit: '修改参数', detail: '数字人民币参数详情' })[dialogMode.value])
176
176
 
177
177
  const openCreateDialog = () => {
178
178
  if (listBusy.value) return
179
- detailRequestId += 1
180
179
  dialogMode.value = 'create'
181
180
  dialogSource.value = null
182
181
  form.value = createFormValues()
183
182
  formNameError.value = ''
184
183
  dialogError.value = ''
185
- dialogLoading.value = false
186
- dialogReady.value = true
187
184
  dialogVisible.value = true
188
185
  }
189
186
 
190
- const loadDetail = async () => {
191
- const source = dialogSource.value
192
- if (!source || !hasName(source) || disposed || writing.value) return
193
- const paraName = source.paraName!
194
- const requestId = ++detailRequestId
195
- dialogLoading.value = true
196
- dialogReady.value = false
197
- dialogError.value = ''
198
- try {
199
- const response = await API.getDetailApi(paraName)
200
- if (disposed || requestId !== detailRequestId) return
201
- const detail = readParameter(ensureSuccess(response, '读取参数详情失败'))
202
- if (!Object.keys(detail).length) throw new Error('服务端未返回参数详情')
203
- if (detail.paraName !== undefined && detail.paraName !== paraName) {
204
- throw new Error('返回的参数名称与当前记录不一致')
205
- }
206
- form.value = createFormValues({ ...source, ...detail, paraName })
207
- dialogReady.value = true
208
- } catch (error) {
209
- if (!disposed && requestId === detailRequestId) dialogError.value = errorMessage(error)
210
- } finally {
211
- if (!disposed && requestId === detailRequestId) dialogLoading.value = false
212
- }
213
- }
214
-
215
187
  const openParameterDialog = (parameter: DigitalRmbParameter, mode: 'edit' | 'detail' = 'detail') => {
216
188
  if (listBusy.value || !hasName(parameter)) return
217
189
  dialogMode.value = mode
@@ -220,19 +192,11 @@ const openParameterDialog = (parameter: DigitalRmbParameter, mode: 'edit' | 'det
220
192
  formNameError.value = ''
221
193
  dialogError.value = ''
222
194
  dialogVisible.value = true
223
- void loadDetail()
224
- }
225
-
226
- const closeParameterDialog = () => {
227
- // 关闭后即使请求继续返回,也不能更新下一次打开的弹窗。
228
- detailRequestId += 1
229
- dialogLoading.value = false
230
- dialogReady.value = false
231
195
  }
232
196
 
233
197
  const submitParameter = async () => {
234
198
  const mode = dialogMode.value
235
- if (mode === 'detail' || dialogBusy.value || !dialogReady.value || !dialogVisible.value) return
199
+ if (mode === 'detail' || writing.value || !dialogVisible.value) return
236
200
  const values = { ...form.value }
237
201
  if (!values.paraName.trim()) {
238
202
  formNameError.value = '请填写参数名称'
@@ -299,23 +263,22 @@ onMounted(loadList)
299
263
  onBeforeUnmount(() => {
300
264
  disposed = true
301
265
  listRequestId += 1
302
- detailRequestId += 1
303
266
  })
304
267
  </script>
305
268
 
306
269
  <template>
307
270
  <ElConfigProvider :size="tableSettings.size">
308
271
  <main class="dcps-page">
309
- <el-card class="parameter-header" shadow="never" :body-style="{ padding: '12px 14px' }">
310
- <h1>数字人民币参数管理</h1>
272
+ <!-- 与授权页统一:查询卡片整体显隐,筛选项上方显示标签,操作按钮靠右。 -->
273
+ <el-card v-show="showSearchBar" class="parameter-search" shadow="never" :body-style="{ padding: '10px' }">
311
274
  <el-form
312
- v-show="showSearchBar"
313
275
  class="filter-form"
276
+ :size="tableSettings.size"
314
277
  label-position="top"
315
278
  :disabled="listBusy"
316
279
  @submit.prevent="search()"
317
280
  >
318
- <el-form-item label="关键字">
281
+ <el-form-item class="filter-keywords" label="关键字">
319
282
  <el-input v-model="keywords" placeholder="输入查询关键字" clearable />
320
283
  </el-form-item>
321
284
  <el-space class="filter-actions" :size="8">
@@ -357,7 +320,7 @@ onBeforeUnmount(() => {
357
320
  </div>
358
321
  </template>
359
322
  <template #name="{ row }">
360
- <el-button v-if="hasName(row)" class="parameter-name" link type="primary" :disabled="listBusy" @click.stop="openParameterDialog(row)">
323
+ <el-button v-if="hasName(row)" class="parameter-name" link type="primary" :disabled="listBusy" @click.stop="openParameterDialog(row)" @dblclick.stop>
361
324
  {{ row.paraName }}
362
325
  </el-button>
363
326
  <span v-else>—</span>
@@ -366,9 +329,9 @@ onBeforeUnmount(() => {
366
329
  <span class="parameter-value">{{ displayValue(row.paraValue) }}</span>
367
330
  </template>
368
331
  <template #actions="{ row }">
369
- <el-button link type="primary" :disabled="listBusy || !hasName(row)" @click.stop="openParameterDialog(row)">详情</el-button>
370
- <el-button link type="primary" :disabled="listBusy || !hasName(row)" @click.stop="openParameterDialog(row, 'edit')">修改</el-button>
371
- <el-button link type="danger" :disabled="listBusy || !hasName(row)" @click.stop="openDeleteDialog([row])">删除</el-button>
332
+ <el-button text bg type="primary" :disabled="listBusy || !hasName(row)" @click.stop="openParameterDialog(row)" @dblclick.stop>详情</el-button>
333
+ <el-button text bg type="primary" :disabled="listBusy || !hasName(row)" @click.stop="openParameterDialog(row, 'edit')" @dblclick.stop>修改</el-button>
334
+ <el-button text bg type="danger" :disabled="listBusy || !hasName(row)" @click.stop="openDeleteDialog([row])" @dblclick.stop>删除</el-button>
372
335
  </template>
373
336
  </ArtDataTable>
374
337
  </div>
@@ -376,30 +339,49 @@ onBeforeUnmount(() => {
376
339
  <el-dialog
377
340
  v-model="dialogVisible"
378
341
  :title="dialogTitle"
379
- width="min(660px, calc(100vw - 32px))"
342
+ :style="dialogMode === 'detail' ? { '--el-dialog-padding-primary': '10px', padding: '10px 16px', marginBottom: '16px' } : undefined"
343
+ :width="dialogMode === 'detail' ? 'min(1280px, calc(100vw - 32px))' : 'min(540px, calc(100vw - 32px))'"
344
+ :top="dialogMode === 'detail' ? '16px' : '15vh'"
380
345
  append-to-body
381
346
  destroy-on-close
382
347
  :show-close="!writing"
383
348
  :close-on-click-modal="false"
384
349
  :close-on-press-escape="!writing"
385
- @close="closeParameterDialog"
386
350
  >
387
351
  <el-alert v-if="dialogError" class="dialog-error" :title="dialogError" type="error" show-icon :closable="false" />
388
- <el-scrollbar max-height="min(62vh, 620px)">
389
- <div v-if="dialogLoading" class="detail-loading" role="status">正在读取参数详情…</div>
390
- <dl v-else-if="dialogMode === 'detail' && dialogReady" class="detail-fields">
391
- <div v-for="field in parameterFields" :key="field.key" class="detail-field" :class="{ 'detail-field--wide': field.multiline }">
392
- <dt>{{ field.label }}</dt>
393
- <dd :class="{ 'parameter-value': field.key === 'paraValue' }">{{ displayValue(form[field.key]) }}</dd>
394
- </div>
395
- </dl>
352
+ <el-scrollbar :class="{ 'detail-scrollbar': dialogMode === 'detail' }" :max-height="dialogMode === 'detail' ? undefined : 'min(62vh, 620px)'">
353
+ <div v-if="dialogMode === 'detail'" class="detail-content">
354
+ <header class="detail-summary">
355
+ <div class="detail-reference">
356
+ <span class="detail-label">参数名称</span>
357
+ <strong>{{ displayValue(form.paraName) }}</strong>
358
+ </div>
359
+ <div>
360
+ <span class="detail-label">参数类型</span>
361
+ <strong class="detail-status">{{ displayValue(form.paraType) }}</strong>
362
+ </div>
363
+ <div>
364
+ <span class="detail-label">参数标志</span>
365
+ <strong class="detail-status">{{ displayValue(form.paraMark) }}</strong>
366
+ </div>
367
+ </header>
368
+ <section v-for="group in detailGroups" :key="group.title" class="detail-group" :aria-label="group.title">
369
+ <h3>{{ group.title }}</h3>
370
+ <dl class="detail-fields">
371
+ <div v-for="field in group.fields" :key="field.key" class="detail-field" :class="{ 'detail-field--wide': field.multiline }">
372
+ <dt>{{ field.label }}</dt>
373
+ <dd :class="{ 'parameter-value': field.key === 'paraValue' }">{{ displayValue(form[field.key]) }}</dd>
374
+ </div>
375
+ </dl>
376
+ </section>
377
+ </div>
396
378
  <el-form
397
- v-else-if="dialogMode !== 'detail' && dialogReady"
379
+ v-else
398
380
  id="parameter-editor-form"
399
381
  class="parameter-form"
400
382
  label-position="top"
401
383
  :model="form"
402
- :disabled="dialogBusy"
384
+ :disabled="writing"
403
385
  @submit.prevent="submitParameter()"
404
386
  >
405
387
  <el-form-item
@@ -422,13 +404,12 @@ onBeforeUnmount(() => {
422
404
  </el-form>
423
405
  </el-scrollbar>
424
406
  <template #footer>
425
- <el-button v-if="dialogError && !dialogReady && dialogSource" :loading="dialogLoading" @click="loadDetail">重新读取</el-button>
426
407
  <el-button :disabled="writing" @click="dialogVisible = false">{{ dialogMode === 'detail' ? '关闭' : '取消' }}</el-button>
427
408
  <el-button
428
409
  v-if="dialogMode !== 'detail'"
429
410
  type="primary"
430
411
  :loading="pendingMutation === 'create' || pendingMutation === 'edit'"
431
- :disabled="dialogLoading || !dialogReady || writing"
412
+ :disabled="writing"
432
413
  @click="submitParameter"
433
414
  >
434
415
  {{ dialogMode === 'create' ? '新增' : '保存' }}
@@ -439,7 +420,7 @@ onBeforeUnmount(() => {
439
420
  <el-dialog
440
421
  v-model="deleteDialogVisible"
441
422
  title="删除参数"
442
- width="min(460px, calc(100vw - 32px))"
423
+ width="min(540px, calc(100vw - 32px))"
443
424
  append-to-body
444
425
  destroy-on-close
445
426
  :show-close="!writing"
@@ -462,7 +443,10 @@ onBeforeUnmount(() => {
462
443
 
463
444
  <style scoped>
464
445
  .dcps-page {
446
+ box-sizing: border-box;
465
447
  display: flex;
448
+ width: 100%;
449
+ max-width: 100%;
466
450
  flex-direction: column;
467
451
  gap: 5px;
468
452
  height: calc(100vh - var(--dpcs-host-layout-height));
@@ -473,34 +457,61 @@ onBeforeUnmount(() => {
473
457
  overflow: hidden;
474
458
  background: var(--el-bg-color-page, #f7f8fa);
475
459
  }
476
- .parameter-header { flex: 0 0 auto; }
477
- .parameter-header h1 { margin: 0; font-size: 15px; font-weight: 600; line-height: 24px; }
478
- .filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 12px; }
479
- .filter-form :deep(.el-form-item) { flex: 0 1 360px; min-width: 160px; margin: 0; }
460
+ .parameter-search {
461
+ flex: 0 0 auto;
462
+ max-height: 42%;
463
+ max-height: min(42dvh, 360px);
464
+ min-height: 0;
465
+ overflow-y: auto;
466
+ }
467
+ .filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
468
+ .filter-form :deep(.el-form-item) { flex: 0 0 auto; min-width: 0; margin: 0; }
469
+ .filter-form :deep(.filter-keywords) { flex: 0 1 240px; width: 240px; max-width: 100%; }
480
470
  .filter-form :deep(.el-form-item__label) { margin-bottom: 4px; }
481
- .filter-actions { flex-shrink: 0; }
471
+ .filter-actions { flex-shrink: 0; margin-left: 0; }
482
472
  .parameter-table-region { flex: 1; min-width: 0; min-height: 0; }
483
473
  .table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
484
474
  .table-actions :deep(.el-button + .el-button) { margin-left: 0; }
485
475
  .selection-count { margin-left: 4px; color: var(--el-text-color-secondary); font-size: 12px; white-space: nowrap; }
486
476
  .parameter-name { display: inline; max-width: 100%; overflow: hidden; text-overflow: ellipsis; text-align: left; vertical-align: middle; }
487
477
  .parameter-value { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; font-variant-numeric: tabular-nums; white-space: pre-wrap; }
488
- .parameter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 2px 4px; }
478
+ .parameter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
489
479
  .form-item--wide { grid-column: 1 / -1; }
490
480
  .parameter-form :deep(.el-input__inner[readonly]) { color: var(--el-text-color-secondary); }
491
481
  .dialog-error { margin-bottom: 14px; }
492
- .detail-loading { padding: 40px 0; color: var(--el-text-color-secondary); text-align: center; }
493
- .detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--el-border-color-lighter); border-radius: 8px; background: var(--el-border-color-lighter); }
494
- .detail-field { min-width: 0; padding: 12px 14px; background: var(--el-bg-color); }
482
+ .detail-scrollbar :deep(.el-scrollbar__wrap) {
483
+ max-height: calc(100vh - 120px);
484
+ max-height: calc(100dvh - 120px);
485
+ }
486
+ .detail-content { display: grid; gap: 8px; font-size: 13px; line-height: 1.4; }
487
+ .detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px; border-radius: 8px; background: var(--el-color-primary-light-9); overflow-wrap: anywhere; }
488
+ .detail-label,
489
+ .detail-field dt { color: var(--el-text-color-secondary); font-size: 12px; }
490
+ .detail-reference { display: grid; grid-column: span 2; align-content: start; gap: 4px; }
491
+ .detail-reference strong { color: var(--el-text-color-primary); font-size: 15px; }
492
+ .detail-status { display: block; margin-top: 6px; color: var(--el-text-color-primary); font-size: 15px; }
493
+ .detail-group { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 8px; padding: 12px; border: 1px solid var(--el-border-color-lighter); border-radius: 8px; }
494
+ .detail-group h3 { margin: 4px 0 0; padding-left: 8px; border-left: 3px solid var(--el-color-primary); color: var(--el-text-color-primary); font-size: 14px; line-height: 20px; }
495
+ .detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
496
+ .detail-field { min-width: 0; padding: 8px 12px; border-radius: 6px; background: var(--el-fill-color-lighter); }
495
497
  .detail-field--wide { grid-column: 1 / -1; }
496
- .detail-field dt { margin-bottom: 6px; color: var(--el-text-color-secondary); font-size: 12px; }
497
- .detail-field dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.6; }
498
+ .detail-field dd { margin: 2px 0 0; color: var(--el-text-color-primary); font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
498
499
  .delete-description { margin: 0 0 12px; line-height: 1.6; }
499
500
  .delete-list { margin: 0 0 14px; padding: 12px 14px 12px 32px; border-radius: 8px; background: var(--el-fill-color-light); }
500
501
  .delete-list li { padding: 3px 0; overflow-wrap: anywhere; }
502
+ @media (max-width: 1024px) {
503
+ .detail-group { grid-template-columns: minmax(0, 1fr); }
504
+ .detail-group h3 { margin-top: 0; }
505
+ .detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
506
+ }
507
+ @media (max-width: 600px) {
508
+ .detail-summary, .detail-fields { grid-template-columns: minmax(0, 1fr); }
509
+ .detail-reference { grid-column: auto; }
510
+ }
501
511
  @media (max-width: 540px) {
502
- .filter-form :deep(.el-form-item) { flex-basis: 100%; }
503
- .parameter-form, .detail-fields { grid-template-columns: minmax(0, 1fr); }
512
+ .filter-form :deep(.filter-keywords) { flex: 1 1 100%; width: auto; }
513
+ .filter-actions { margin-left: 0; }
514
+ .parameter-form { grid-template-columns: minmax(0, 1fr); }
504
515
  .selection-count { width: 100%; margin-left: 0; }
505
516
  }
506
517
  </style>
@@ -1,13 +1,28 @@
1
- import type {
2
- CityClearingParameter,
3
- Tam120305003InBody,
4
- Tam140305001OutBody,
5
- } from '../city-clearing/parameters/typs'
1
+ /** 数字人民币头寸参数,字段及可选性对应原始接口契约。 */
2
+ export interface DigitalRmbParameter {
3
+ /** 参数描述 */
4
+ paraDesc?: string
5
+ /** 参数标志;接口未声明取值或枚举。 */
6
+ paraMark?: string
7
+ /** 参数名称;页面使用原名称定位详情、修改和删除。 */
8
+ paraName?: string
9
+ /** 参数类型;接口未声明取值或枚举。 */
10
+ paraType?: string
11
+ /** 参数值,保留原始字符串。 */
12
+ paraValue?: string
13
+ /** 备注 */
14
+ remark?: string
15
+ }
16
+
17
+ /** 列表响应,totalCount 按原始契约保留字符串。 */
18
+ export interface ParameterListBody {
19
+ resultList?: DigitalRmbParameter[]
20
+ totalCount?: string
21
+ }
22
+
23
+ /** 修改接口仅支持这五个参数字段,不包含模块代码和参数标志。 */
24
+ export type ParameterEditBody = Omit<DigitalRmbParameter, 'paraMark'>
6
25
 
7
- /** 数字人民币复用头寸参数契约,所有参数字段保留字符串。 */
8
- export type DigitalRmbParameter = CityClearingParameter
9
- export type ParameterListBody = Tam140305001OutBody
10
- export type ParameterEditBody = Tam120305003InBody
11
26
  export type ParameterFormValues = Required<DigitalRmbParameter>
12
27
 
13
28
  /** 模块由页面接口固定为数币,调用处只提供关键字和公共分页。 */
@@ -932,6 +932,8 @@ onBeforeUnmount(() => {
932
932
  .dcps-page {
933
933
  box-sizing: border-box;
934
934
  display: flex;
935
+ width: 100%;
936
+ max-width: 100%;
935
937
  flex-direction: column;
936
938
  gap: 5px;
937
939
  height: calc(100vh - var(--dpcs-host-layout-height));
@@ -1,36 +0,0 @@
1
- import baseHttpClient, { type ApiResponse } from '@chic/http'
2
- import type {
3
- CityClearingParameterParams,
4
- Tam120305001InBody,
5
- Tam120305001OutBody,
6
- Tam120305002InBody,
7
- Tam120305002OutBody,
8
- Tam120305003InBody,
9
- Tam120305003OutBody,
10
- Tam140305001InBody,
11
- Tam140305001OutBody,
12
- Tam140305002InBody,
13
- Tam140305002OutBody,
14
- } from './typs'
15
-
16
- export default {
17
- /** 查询头寸参数;城银清 moduleCode 为 3,分页放在公共 head 中。 */
18
- queryListApi: (params: CityClearingParameterParams<Tam140305001InBody>) =>
19
- baseHttpClient.post<ApiResponse<Tam140305001OutBody>>('/TAM/0001/140305001', params),
20
-
21
- /** 查询参数详情;附件未声明 paraName 的唯一性或必填规则。 */
22
- getDetailApi: (params: CityClearingParameterParams<Tam140305002InBody>) =>
23
- baseHttpClient.post<ApiResponse<Tam140305002OutBody>>('/TAM/0001/140305002', params),
24
-
25
- /** 新增头寸参数;当前本地接口仅返回模拟响应,不保存参数。 */
26
- addApi: (params: CityClearingParameterParams<Tam120305002InBody>) =>
27
- baseHttpClient.post<ApiResponse<Tam120305002OutBody>>('/TAM/0001/120305002', params),
28
-
29
- /** 修改头寸参数;附件未提供明确的记录定位规则。 */
30
- editApi: (params: CityClearingParameterParams<Tam120305003InBody>) =>
31
- baseHttpClient.post<ApiResponse<Tam120305003OutBody>>('/TAM/0001/120305003', params),
32
-
33
- /** 删除头寸参数;sysParaList 数组项的标识含义尚未定义。 */
34
- deleteApi: (params: CityClearingParameterParams<Tam120305001InBody>) =>
35
- baseHttpClient.post<ApiResponse<Tam120305001OutBody>>('/TAM/0001/120305001', params),
36
- }
@@ -1,82 +0,0 @@
1
- import type { DigitalRmbHead } from '@/utils/digital-rmb-request'
2
-
3
- /** 城银清算头寸参数接口类型,字段及可选性对应附件原始 schema。 */
4
- export interface CityClearingParameter {
5
- /** 参数描述 */
6
- paraDesc?: string
7
- /** 参数标志;附件未声明取值或枚举。 */
8
- paraMark?: string
9
- /** 参数名称;附件未声明唯一性。 */
10
- paraName?: string
11
- /** 参数类型;附件未声明取值或枚举。 */
12
- paraType?: string
13
- /** 参数值,保留原始字符串。 */
14
- paraValue?: string
15
- /** 备注 */
16
- remark?: string
17
- }
18
-
19
- /** Tam120305001In.Body:删除;数组项对应的标识含义尚未声明。 */
20
- export interface Tam120305001InBody {
21
- sysParaList?: string[]
22
- }
23
-
24
- /** Tam120305002In.Body:新增;原始 schema 未声明必填字段。 */
25
- export interface Tam120305002InBody extends CityClearingParameter {
26
- /** 模块代码:1 人民币、2 外币、3 城银清、4 跨境、5 数币。 */
27
- moduleCode?: string
28
- }
29
-
30
- /** Tam120305003In.Body:修改;附件没有模块代码、原始参数名称或独立标识字段。 */
31
- export interface Tam120305003InBody {
32
- /** 参数说明 */
33
- paraDesc?: string
34
- /** 参数名称,不能据此推断唯一定位规则。 */
35
- paraName?: string
36
- /** 原始字段说明为“备注”,字段名仍为 paraType。 */
37
- paraType?: string
38
- /** 参数值 */
39
- paraValue?: string
40
- /** 备注 */
41
- remark?: string
42
- }
43
-
44
- /** Tam140305001In.Body:列表查询,仅 moduleCode 在原始 schema 中必填。 */
45
- export interface Tam140305001InBody {
46
- /** 查询关键字 */
47
- keywords?: string
48
- /** 模块代码;城银清使用 3。 */
49
- moduleCode: string
50
- }
51
-
52
- /** Tam140305002In.Body:详情查询,仅 moduleCode 在原始 schema 中必填。 */
53
- export interface Tam140305002InBody {
54
- /** 模块代码;城银清使用 3。 */
55
- moduleCode: string
56
- /** 参数名称;原始 schema 未声明必填或唯一性。 */
57
- paraName?: string
58
- }
59
-
60
- /** 三个写接口的原始响应 body 均未声明业务字段。 */
61
- export type Tam120305001OutBody = Record<string, never>
62
- export type Tam120305002OutBody = Record<string, never>
63
- export type Tam120305003OutBody = Record<string, never>
64
-
65
- /** Tam140305001Out.Body */
66
- export interface Tam140305001OutBody {
67
- resultList?: CityClearingParameter[]
68
- /** 总条数,按契约保留字符串。 */
69
- totalCount?: string
70
- }
71
-
72
- /** 与列表行使用相同的六个参数字段,原始 schema 均未声明必填。 */
73
- export type Tam140305002OutBody = CityClearingParameter
74
-
75
- /** 复用现有公共头类型,支持显式 TAM 信封或业务字段平铺。 */
76
- export type CityClearingParameterParams<T> =
77
- | {
78
- body: T
79
- head?: DigitalRmbHead
80
- appHead?: { ip?: string; opType?: string }
81
- }
82
- | (T & Omit<DigitalRmbHead, 'tranDate'> & { ip?: string; opType?: string })