refactor: rename safe and audit frontend resources

This commit is contained in:
2026-07-27 14:42:14 +08:00
parent 4e1f8a13e3
commit f3fcec72b5
14 changed files with 154 additions and 57 deletions

View File

@@ -222,10 +222,10 @@ const titles: Record<string, string> = {
dev_smart_cylinder_valve: '智能钢瓶阀',
dev_device_binding: '设备绑定',
dev_telemetry: '设备遥测',
saf_rule: '安全规则',
saf_event: '安全事件',
saf_inspection: '安全检查',
saf_event_disposal: '事件处置',
safe_rule: '安全规则',
safe_event: '安全事件',
safe_inspection: '安全检查',
safe_event_disposal: '事件处置',
ec_category: '商品分类',
ec_product: '商品管理',
ec_product_attribute: '商品属性',
@@ -250,9 +250,9 @@ const titles: Record<string, string> = {
report: '报表',
report_item: '报表项目',
report_metric_snapshot: '指标快照',
aud_operation_log: '操作审计',
aud_export_log: '导出审计',
aud_approval: '审批审计',
audit_operation_log: '操作审计',
audit_export_log: '导出审计',
audit_approval: '审批审计',
};
const define = (
name: string,
@@ -412,7 +412,7 @@ export const resources: ResourceUiDefinition[] = [
'reported_at',
'payload',
]),
define('saf_rule', '/safety/saf_rule', 'writable', 'list', [
define('safe_rule', '/safety/safe_rule', 'writable', 'list', [
'rule_code!',
'version_no',
'threshold',
@@ -420,8 +420,8 @@ export const resources: ResourceUiDefinition[] = [
'gray_scope',
]),
define(
'saf_event',
'/safety/saf_event',
'safe_event',
'/safety/safe_event',
'writable',
'list',
[
@@ -432,21 +432,21 @@ export const resources: ResourceUiDefinition[] = [
'sla_at',
],
[
action('saf_event_disposal', '/safety/saf_event/:identity/disposals', [
action('safe_event_disposal', '/safety/safe_event/:identity/disposals', [
'action!',
'reason!',
]),
],
),
define('saf_inspection', '/safety/saf_inspection', 'writable', 'list', [
define('safe_inspection', '/safety/safe_inspection', 'writable', 'list', [
'user_account_identity!',
'staff_account_identity!',
'result!',
'evidence_uri',
]),
define(
'saf_event_disposal',
'/safety/saf_event/:identity/disposals',
'safe_event_disposal',
'/safety/safe_event/:identity/disposals',
'append_only',
'list',
['action!', 'reason!'],
@@ -612,13 +612,13 @@ export const resources: ResourceUiDefinition[] = [
'list',
['metric_code', 'scope_type', 'stat_at', 'metric_value'],
),
define('aud_operation_log', '/audit/aud_operation_log', 'readonly', 'list', [
define('audit_operation_log', '/audit/audit_operation_log', 'readonly', 'list', [
'operator_identity',
'action',
'object_identity',
'created_at',
]),
define('aud_export_log', '/audit/aud_export_log', 'readonly', 'list', [
define('audit_export_log', '/audit/audit_export_log', 'readonly', 'list', [
'applicant_identity',
'purpose',
'field_scope',
@@ -626,8 +626,8 @@ export const resources: ResourceUiDefinition[] = [
'file_uri',
]),
define(
'aud_approval',
'/audit/aud_approval',
'audit_approval',
'/audit/audit_approval',
'readonly',
'list',
[
@@ -640,10 +640,10 @@ export const resources: ResourceUiDefinition[] = [
'handled_at',
],
[
action('同意', '/audit/aud_approval/:identity/approve', ['opinion'], {
action('同意', '/audit/audit_approval/:identity/approve', ['opinion'], {
status: 'approved',
}),
action('驳回', '/audit/aud_approval/:identity/approve', ['opinion!'], {
action('驳回', '/audit/audit_approval/:identity/approve', ['opinion!'], {
status: 'rejected',
}),
],