refactor(platform): remove deprecated reporting and audit modules
This commit is contained in:
@@ -10,7 +10,6 @@ export type ResourceFieldType =
|
||||
| 'boolean'
|
||||
| 'date'
|
||||
| 'datetime'
|
||||
| 'json'
|
||||
| 'textarea';
|
||||
export type ResourceField = {
|
||||
key: string;
|
||||
@@ -175,14 +174,17 @@ const datetimeFields = new Set([
|
||||
'handled_at',
|
||||
'created_at',
|
||||
]);
|
||||
const jsonFields = new Set([
|
||||
// 大文本字段按普通文本处理,不再要求或解析 JSON。
|
||||
const textareaFields = new Set([
|
||||
'body',
|
||||
'content',
|
||||
'reason',
|
||||
'opinion',
|
||||
'payload',
|
||||
'threshold',
|
||||
'gray_scope',
|
||||
'product_snapshot',
|
||||
'field_scope',
|
||||
]);
|
||||
const textareaFields = new Set(['body', 'content', 'reason', 'opinion']);
|
||||
const fieldType = (key: string): ResourceFieldType => {
|
||||
if (key === 'platform_role_code') return 'role-code';
|
||||
if (key === 'menu_identities') return 'menu-identities';
|
||||
@@ -192,7 +194,6 @@ const fieldType = (key: string): ResourceFieldType => {
|
||||
if (booleanFields.has(key)) return 'boolean';
|
||||
if (dateFields.has(key)) return 'date';
|
||||
if (datetimeFields.has(key)) return 'datetime';
|
||||
if (jsonFields.has(key)) return 'json';
|
||||
if (textareaFields.has(key)) return 'textarea';
|
||||
return 'text';
|
||||
};
|
||||
@@ -237,8 +238,7 @@ const titles: Record<string, string> = {
|
||||
fin_payment: '支付记录',
|
||||
fin_settlement: '财务结算',
|
||||
fin_reconciliation: '财务对账',
|
||||
cnt_content: '内容管理',
|
||||
ntf_template: '通知模板',
|
||||
cms_content: '内容管理',
|
||||
cs_ticket: '客服工单',
|
||||
platfrom_account: '平台账户',
|
||||
platform_role: '平台角色',
|
||||
@@ -247,12 +247,6 @@ const titles: Record<string, string> = {
|
||||
wallet_ledger: '钱包流水',
|
||||
wallet_recharge: '钱包充值',
|
||||
wallet_withdrawal: '钱包提现',
|
||||
report: '报表',
|
||||
report_item: '报表项目',
|
||||
report_metric_snapshot: '指标快照',
|
||||
audit_operation_log: '操作审计',
|
||||
audit_export_log: '导出审计',
|
||||
audit_approval: '审批审计',
|
||||
};
|
||||
const define = (
|
||||
name: string,
|
||||
@@ -523,18 +517,13 @@ export const resources: ResourceUiDefinition[] = [
|
||||
'list',
|
||||
['channel!', 'bill_date!', 'difference_amount!'],
|
||||
),
|
||||
define('cnt_content', '/content/cnt_content', 'writable', 'list', [
|
||||
define('cms_content', '/content/cms_content', 'writable', 'list', [
|
||||
'content_type!',
|
||||
'title!',
|
||||
'body!',
|
||||
'version_no',
|
||||
'publish_status',
|
||||
]),
|
||||
define('ntf_template', '/notification/ntf_template', 'writable', 'list', [
|
||||
'template_code!',
|
||||
'channel!',
|
||||
'content!',
|
||||
]),
|
||||
define('cs_ticket', '/customer_service/cs_ticket', 'writable', 'list', [
|
||||
'user_account_identity!',
|
||||
'ticket_no!',
|
||||
@@ -592,62 +581,6 @@ export const resources: ResourceUiDefinition[] = [
|
||||
'amount',
|
||||
'status',
|
||||
]),
|
||||
define('report', '/report/report', 'readonly', 'list', [
|
||||
'report_code',
|
||||
'report_type',
|
||||
'stat_period',
|
||||
'generated_at',
|
||||
'status',
|
||||
]),
|
||||
define('report_item', '/report/report_item', 'readonly', 'list', [
|
||||
'report_identity',
|
||||
'dimension',
|
||||
'metric_code',
|
||||
'metric_value',
|
||||
]),
|
||||
define(
|
||||
'report_metric_snapshot',
|
||||
'/report/report_metric_snapshot',
|
||||
'readonly',
|
||||
'list',
|
||||
['metric_code', 'scope_type', 'stat_at', 'metric_value'],
|
||||
),
|
||||
define('audit_operation_log', '/audit/audit_operation_log', 'readonly', 'list', [
|
||||
'operator_identity',
|
||||
'action',
|
||||
'object_identity',
|
||||
'created_at',
|
||||
]),
|
||||
define('audit_export_log', '/audit/audit_export_log', 'readonly', 'list', [
|
||||
'applicant_identity',
|
||||
'purpose',
|
||||
'field_scope',
|
||||
'approved_at',
|
||||
'file_uri',
|
||||
]),
|
||||
define(
|
||||
'audit_approval',
|
||||
'/audit/audit_approval',
|
||||
'readonly',
|
||||
'list',
|
||||
[
|
||||
'business_type',
|
||||
'business_identity',
|
||||
'applicant_identity',
|
||||
'opinion',
|
||||
'handler_identity',
|
||||
'status',
|
||||
'handled_at',
|
||||
],
|
||||
[
|
||||
action('同意', '/audit/audit_approval/:identity/approve', ['opinion'], {
|
||||
status: 'approved',
|
||||
}),
|
||||
action('驳回', '/audit/audit_approval/:identity/approve', ['opinion!'], {
|
||||
status: 'rejected',
|
||||
}),
|
||||
],
|
||||
),
|
||||
];
|
||||
|
||||
export const resourceByName = Object.fromEntries(
|
||||
|
||||
Reference in New Issue
Block a user