From 62aa9090a07ce8cf0fc39ccbbafbd89048e52132 Mon Sep 17 00:00:00 2001 From: Mrxs <18278715334@163.com> Date: Fri, 19 Jun 2026 12:15:21 +0800 Subject: [PATCH] f --- apps/web-antd/src/api/product-manage/index.ts | 1 + .../src/api/product-manage/query-whitelist.ts | 89 +++++++++ .../product-manage/query-whitelist/data.ts | 122 +++++++++++++ .../product-manage/query-whitelist/list.vue | 171 ++++++++++++++++++ 4 files changed, 383 insertions(+) create mode 100644 apps/web-antd/src/api/product-manage/query-whitelist.ts create mode 100644 apps/web-antd/src/views/product-manage/query-whitelist/data.ts create mode 100644 apps/web-antd/src/views/product-manage/query-whitelist/list.vue diff --git a/apps/web-antd/src/api/product-manage/index.ts b/apps/web-antd/src/api/product-manage/index.ts index 3a2f69d..17798bf 100644 --- a/apps/web-antd/src/api/product-manage/index.ts +++ b/apps/web-antd/src/api/product-manage/index.ts @@ -1,2 +1,3 @@ export * from './feature'; export * from './product'; +export * from './query-whitelist'; diff --git a/apps/web-antd/src/api/product-manage/query-whitelist.ts b/apps/web-antd/src/api/product-manage/query-whitelist.ts new file mode 100644 index 0000000..e2b7faa --- /dev/null +++ b/apps/web-antd/src/api/product-manage/query-whitelist.ts @@ -0,0 +1,89 @@ +import { requestClient } from '#/api/request'; + +export namespace QueryWhitelistApi { + export interface EntryItem { + id: string; + name: string; + id_card_masked: string; + api_codes: string[]; + status: string; + remark: string; + created_at: string; + updated_at: string; + } + + export interface OpRequest { + name: string; + id_card: string; + api_codes: string[]; + remark?: string; + } + + export interface OpResponse { + tianyuan_code: number; + tianyuan_message: string; + transaction_id?: string; + entry?: EntryItem; + } + + export interface OpLogItem { + id: string; + admin_user_id: string; + admin_user_name: string; + action: string; + name: string; + id_card: string; + id_card_masked: string; + api_codes: string[]; + remark: string; + tianyuan_code: number; + tianyuan_message: string; + transaction_id: string; + entry_id: string; + entry_status: string; + entry_api_codes: string[]; + create_time: string; + } + + export interface OpLogList { + total: number; + items: OpLogItem[]; + } + + export interface OpLogListParams { + page?: number; + page_size?: number; + id_card?: string; + action?: string; + tianyuan_code?: number; + } +} + +async function createQueryWhitelist(data: QueryWhitelistApi.OpRequest) { + return requestClient.post( + '/query-whitelist/create', + data, + ); +} + +async function appendQueryWhitelist(data: QueryWhitelistApi.OpRequest) { + return requestClient.post( + '/query-whitelist/append', + data, + ); +} + +async function getQueryWhitelistOpLogList( + params: QueryWhitelistApi.OpLogListParams, +) { + return requestClient.get( + '/query-whitelist/op-log/list', + { params }, + ); +} + +export { + appendQueryWhitelist, + createQueryWhitelist, + getQueryWhitelistOpLogList, +}; diff --git a/apps/web-antd/src/views/product-manage/query-whitelist/data.ts b/apps/web-antd/src/views/product-manage/query-whitelist/data.ts new file mode 100644 index 0000000..a369c8e --- /dev/null +++ b/apps/web-antd/src/views/product-manage/query-whitelist/data.ts @@ -0,0 +1,122 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { QueryWhitelistApi } from '#/api/product-manage'; + +export const actionOptions = [ + { label: '创建规则', value: 'create' }, + { label: '追加接口', value: 'append' }, +]; + +export function useConfigFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id_card', + label: '身份证号', + rules: 'required', + componentProps: { + maxlength: 18, + placeholder: '18位中国大陆身份证号', + }, + }, + { + component: 'Input', + fieldName: 'name', + label: '姓名', + defaultValue: '*', + help: '填 * 表示仅按身份证匹配,不校验姓名', + componentProps: { + placeholder: '默认 *', + }, + }, + { + component: 'Select', + fieldName: 'api_codes', + label: '产品编码', + rules: 'required', + componentProps: { + mode: 'tags', + placeholder: '输入产品编码后回车添加', + tokenSeparators: [',', ' '], + open: false, + }, + }, + { + component: 'Input', + fieldName: 'remark', + label: '备注', + componentProps: { + maxlength: 500, + placeholder: '可选,最长500字符', + }, + }, + ]; +} + +export function useLogGridFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id_card', + label: '身份证号', + }, + { + component: 'Select', + fieldName: 'action', + label: '操作类型', + componentProps: { + allowClear: true, + options: actionOptions, + }, + }, + { + component: 'Select', + fieldName: 'tianyuan_code', + label: '业务结果', + componentProps: { + allowClear: true, + options: [{ label: '成功', value: 0 }], + }, + }, + ]; +} + +export function useLogColumns(): VxeTableGridOptions['columns'] { + return [ + { field: 'create_time', title: '操作时间', minWidth: 170 }, + { field: 'admin_user_name', title: '操作人', minWidth: 100 }, + { + field: 'action', + title: '操作类型', + minWidth: 100, + formatter: ({ cellValue }) => + cellValue === 'create' ? '创建规则' : '追加接口', + }, + { field: 'id_card', title: '身份证号', minWidth: 180 }, + { field: 'id_card_masked', title: '脱敏身份证', minWidth: 150 }, + { field: 'name', title: '姓名规则', minWidth: 90 }, + { + field: 'api_codes', + title: '提交编码', + minWidth: 200, + formatter: ({ cellValue }) => + Array.isArray(cellValue) ? cellValue.join(', ') : cellValue, + }, + { + field: 'tianyuan_code', + title: '天远码', + minWidth: 80, + formatter: ({ cellValue }) => String(cellValue ?? ''), + }, + { field: 'tianyuan_message', title: '天远描述', minWidth: 160 }, + { field: 'transaction_id', title: '流水号', minWidth: 200 }, + { + field: 'entry_api_codes', + title: '当前编码', + minWidth: 200, + formatter: ({ cellValue }) => + Array.isArray(cellValue) ? cellValue.join(', ') : cellValue || '-', + }, + { field: 'remark', title: '备注', minWidth: 120 }, + ]; +} diff --git a/apps/web-antd/src/views/product-manage/query-whitelist/list.vue b/apps/web-antd/src/views/product-manage/query-whitelist/list.vue new file mode 100644 index 0000000..6873523 --- /dev/null +++ b/apps/web-antd/src/views/product-manage/query-whitelist/list.vue @@ -0,0 +1,171 @@ + + +