refactor: rename safe and audit frontend resources
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import { platformAPI, type DashboardOverview, type OrgDeliveryPoint, type OrgGasStation, type OrgServicePerson, type PlatfromAccount, type Profile, type SafEvent } from './api/platform';
|
||||
import { platformAPI, type DashboardOverview, type OrgDeliveryPoint, type OrgGasStation, type OrgServicePerson, type PlatfromAccount, type Profile, type SafeEvent } from './api/platform';
|
||||
|
||||
type Tab = 'dashboard' | 'station' | 'delivery' | 'person' | 'user' | 'safety' | 'trade' | 'finance' | 'content' | 'track' | 'operation' | 'audit';
|
||||
type CatalogItem = { title: string; description: string; operations: string[] };
|
||||
@@ -14,7 +14,7 @@ const stations = ref<OrgGasStation[]>([]);
|
||||
const deliveryPoints = ref<OrgDeliveryPoint[]>([]);
|
||||
const servicePeople = ref<OrgServicePerson[]>([]);
|
||||
const users = ref<PlatfromAccount[]>([]);
|
||||
const safetyEvents = ref<SafEvent[]>([]);
|
||||
const safetyEvents = ref<SafeEvent[]>([]);
|
||||
const profile = ref<Profile>();
|
||||
const loginForm = reactive({ username: 'root', password: '' });
|
||||
const stationForm = reactive({ stationCode: '', name: '', principal: '', serviceArea: '' });
|
||||
@@ -48,7 +48,7 @@ async function loadData() {
|
||||
try {
|
||||
[profile.value, overview.value, stations.value, deliveryPoints.value, servicePeople.value, users.value, safetyEvents.value] = await Promise.all([
|
||||
platformAPI.getProfile(), platformAPI.getDashboard(), platformAPI.listOrgGasStation(), platformAPI.listOrgDeliveryPoint(),
|
||||
platformAPI.listOrgServicePerson(), platformAPI.listPlatfromAccount(), platformAPI.listSafEvent(),
|
||||
platformAPI.listOrgServicePerson(), platformAPI.listPlatfromAccount(), platformAPI.listSafeEvent(),
|
||||
]);
|
||||
} catch (error) {
|
||||
errorMessage.value = error instanceof Error ? error.message : '加载数据失败';
|
||||
|
||||
@@ -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',
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -4,9 +4,9 @@ const routes: AppRouteRecordRaw[] = [{
|
||||
path: '/audit', name: 'audit', component: DEFAULT_LAYOUT,
|
||||
meta: { locale: 'menu.platform.audit', requiresAuth: true, icon: 'icon-apps', order: 22 },
|
||||
children: [
|
||||
{ path: 'aud-operation-log', name: 'audit-aud-operation-log', component: () => import('@/views/audit/aud_operation_log/ListPage.vue'), meta: { locale: 'menu.platform.audit.aud_operation_log', requiresAuth: true, menuCode: 'audit' } },
|
||||
{ path: 'aud-export-log', name: 'audit-aud-export-log', component: () => import('@/views/audit/aud_export_log/ListPage.vue'), meta: { locale: 'menu.platform.audit.aud_export_log', requiresAuth: true, menuCode: 'audit' } },
|
||||
{ path: 'aud-approval', name: 'audit-aud-approval', component: () => import('@/views/audit/aud_approval/ListPage.vue'), meta: { locale: 'menu.platform.audit.aud_approval', requiresAuth: true, menuCode: 'audit' } }
|
||||
{ path: 'audit-operation-log', name: 'audit-audit-operation-log', component: () => import('@/views/audit/audit_operation_log/ListPage.vue'), meta: { locale: 'menu.platform.audit.audit_operation_log', requiresAuth: true, menuCode: 'audit' } },
|
||||
{ path: 'audit-export-log', name: 'audit-audit-export-log', component: () => import('@/views/audit/audit_export_log/ListPage.vue'), meta: { locale: 'menu.platform.audit.audit_export_log', requiresAuth: true, menuCode: 'audit' } },
|
||||
{ path: 'audit-approval', name: 'audit-audit-approval', component: () => import('@/views/audit/audit_approval/ListPage.vue'), meta: { locale: 'menu.platform.audit.audit_approval', requiresAuth: true, menuCode: 'audit' } }
|
||||
],
|
||||
}];
|
||||
export default routes;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import type { AppRouteRecordRaw } from '../types';
|
||||
const routes: AppRouteRecordRaw[] = [{ path: '/safety', name: 'safety', component: DEFAULT_LAYOUT, meta: { locale: 'menu.platform.safety', requiresAuth: true, icon: 'icon-apps', order: 15 }, children: [
|
||||
{ path: 'saf-rule', name: 'safety-saf-rule', component: () => import('@/views/safety/saf_rule/ListPage.vue'), meta: { locale: 'menu.platform.safety.saf_rule', requiresAuth: true, menuCode: 'safety' } },
|
||||
{ path: 'saf-event', name: 'safety-saf-event', component: () => import('@/views/safety/saf_event/ListPage.vue'), meta: { locale: 'menu.platform.safety.saf_event', requiresAuth: true, menuCode: 'safety' } },
|
||||
{ path: 'saf-inspection', name: 'safety-saf-inspection', component: () => import('@/views/safety/saf_inspection/ListPage.vue'), meta: { locale: 'menu.platform.safety.saf_inspection', requiresAuth: true, menuCode: 'safety' } }
|
||||
{ path: 'safe-rule', name: 'safety-safe-rule', component: () => import('@/views/safety/safe_rule/ListPage.vue'), meta: { locale: 'menu.platform.safety.safe_rule', requiresAuth: true, menuCode: 'safety' } },
|
||||
{ path: 'safe-event', name: 'safety-safe-event', component: () => import('@/views/safety/safe_event/ListPage.vue'), meta: { locale: 'menu.platform.safety.safe_event', requiresAuth: true, menuCode: 'safety' } },
|
||||
{ path: 'safe-inspection', name: 'safety-safe-inspection', component: () => import('@/views/safety/safe_inspection/ListPage.vue'), meta: { locale: 'menu.platform.safety.safe_inspection', requiresAuth: true, menuCode: 'safety' } }
|
||||
] }];
|
||||
export default routes;
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<script setup lang="ts">
|
||||
import ReadOnlyListPage from '@/views/shared/ReadOnlyListPage.vue';
|
||||
import { getResource } from '@/api/resources';
|
||||
const definition = getResource('/audit/aud_approval');
|
||||
const definition = getResource('/audit/audit_approval');
|
||||
</script>
|
||||
@@ -2,5 +2,5 @@
|
||||
<script setup lang="ts">
|
||||
import ReadOnlyListPage from '@/views/shared/ReadOnlyListPage.vue';
|
||||
import { getResource } from '@/api/resources';
|
||||
const definition = getResource('/audit/aud_export_log');
|
||||
const definition = getResource('/audit/audit_export_log');
|
||||
</script>
|
||||
@@ -2,5 +2,5 @@
|
||||
<script setup lang="ts">
|
||||
import ReadOnlyListPage from '@/views/shared/ReadOnlyListPage.vue';
|
||||
import { getResource } from '@/api/resources';
|
||||
const definition = getResource('/audit/aud_operation_log');
|
||||
const definition = getResource('/audit/audit_operation_log');
|
||||
</script>
|
||||
@@ -2,5 +2,5 @@
|
||||
<script setup lang="ts">
|
||||
import CrudListPage from '@/views/shared/CrudListPage.vue';
|
||||
import { getResource } from '@/api/resources';
|
||||
const definition = getResource('/safety/saf_event');
|
||||
const definition = getResource('/safety/safe_event');
|
||||
</script>
|
||||
@@ -2,5 +2,5 @@
|
||||
<script setup lang="ts">
|
||||
import CrudListPage from '@/views/shared/CrudListPage.vue';
|
||||
import { getResource } from '@/api/resources';
|
||||
const definition = getResource('/safety/saf_inspection');
|
||||
const definition = getResource('/safety/safe_inspection');
|
||||
</script>
|
||||
@@ -2,5 +2,5 @@
|
||||
<script setup lang="ts">
|
||||
import CrudListPage from '@/views/shared/CrudListPage.vue';
|
||||
import { getResource } from '@/api/resources';
|
||||
const definition = getResource('/safety/saf_rule');
|
||||
const definition = getResource('/safety/safe_rule');
|
||||
</script>
|
||||
Reference in New Issue
Block a user