فهرست منبع

feat(s8): show exception module labels

YY968XX 1 هفته پیش
والد
کامیت
766048c8f2

+ 2 - 0
Web/src/views/aidop/s8/api/s8ExceptionApi.ts

@@ -23,6 +23,8 @@ export interface S8ExceptionRow {
 	priorityLevel: string;
 	sceneCode: string;
 	sceneName?: string | null;
+	moduleCode?: string | null;
+	moduleName?: string | null;
 	responsibleDeptId?: number | null;
 	responsibleDeptName?: string | null;
 	occurrenceDeptId?: number | null;

+ 13 - 4
Web/src/views/aidop/s8/exceptions/S8ExceptionListPage.vue

@@ -14,9 +14,9 @@
 					<el-option v-for="s in filterOpts.severities" :key="s.value" :label="s.label" :value="s.value" />
 				</el-select>
 			</el-form-item>
-			<el-form-item label="场景">
-				<el-select v-model="query.sceneCode" clearable placeholder="全部" style="width: 180px">
-					<el-option v-for="s in filterOpts.scenes" :key="s.value" :label="s.label" :value="s.value" />
+			<el-form-item label="模块">
+				<el-select v-model="query.moduleCode" clearable placeholder="全部" style="width: 180px">
+					<el-option v-for="m in filterOpts.modules" :key="m.value" :label="m.label" :value="m.value" />
 				</el-select>
 			</el-form-item>
 			<el-form-item label="部门">
@@ -67,7 +67,9 @@
 		<el-table :data="rows" v-loading="loading" border stripe @row-click="onRowClick">
 			<el-table-column prop="exceptionCode" label="编号" width="160" show-overflow-tooltip />
 			<el-table-column prop="title" label="标题" min-width="200" show-overflow-tooltip />
-			<el-table-column prop="sceneName" label="场景" width="120" show-overflow-tooltip />
+			<el-table-column label="模块" width="120" show-overflow-tooltip>
+				<template #default="{ row }">{{ row.moduleName || row.moduleCode || row.sceneName || row.sceneCode || '-' }}</template>
+			</el-table-column>
 			<el-table-column prop="statusLabel" label="状态" width="100" />
 			<el-table-column prop="severityLabel" label="严重度" width="90" />
 			<el-table-column prop="priorityLevel" label="优先级" width="90" />
@@ -127,11 +129,13 @@ const filterOpts = reactive<{
 	statuses: { value: string; label: string }[];
 	severities: { value: string; label: string }[];
 	scenes: { value: string; label: string }[];
+	modules: { value: string; label: string }[];
 	departments: { value: number; label: string }[];
 }>({
 	statuses: [],
 	severities: [],
 	scenes: [],
+	modules: [],
 	departments: [],
 });
 
@@ -151,6 +155,7 @@ const query = reactive({
 	statusBucket: '' as string,
 	severity: '' as string,
 	sceneCode: '' as string,
+	moduleCode: '' as string,
 	deptId: undefined as number | undefined,
 	timeoutFlag: undefined as boolean | undefined,
 	ruleType: '' as string,
@@ -198,11 +203,13 @@ async function loadFilters() {
 		statuses: { value: string; label: string }[];
 		severities: { value: string; label: string }[];
 		scenes?: { value: string; label: string }[];
+		modules?: { value: string; label: string }[];
 		departments?: { value: number; label: string }[];
 	};
 	filterOpts.statuses = fo.statuses ?? [];
 	filterOpts.severities = fo.severities ?? [];
 	filterOpts.scenes = fo.scenes ?? [];
+	filterOpts.modules = fo.modules ?? [];
 	filterOpts.departments = fo.departments ?? [];
 }
 
@@ -217,6 +224,7 @@ async function loadList() {
 			statusBucket: query.status ? undefined : query.statusBucket || undefined,
 			severity: query.severity || undefined,
 			sceneCode: query.sceneCode || undefined,
+			moduleCode: query.moduleCode || undefined,
 			deptId: query.deptId || undefined,
 			keyword: query.keyword || undefined,
 			timeoutFlag: query.timeoutFlag,
@@ -239,6 +247,7 @@ function resetQuery() {
 	query.statusBucket = '';
 	query.severity = '';
 	query.sceneCode = '';
+	query.moduleCode = '';
 	query.deptId = undefined;
 	query.timeoutFlag = undefined;
 	query.ruleType = '';

+ 1 - 1
Web/src/views/aidop/s8/exceptions/S8TaskDetailPage.vue

@@ -215,7 +215,7 @@ onMounted(async () => {
 						<el-descriptions-item label="编号">{{ detail.exceptionCode }}</el-descriptions-item>
 						<el-descriptions-item label="状态">{{ detail.statusLabel }}</el-descriptions-item>
 						<el-descriptions-item label="严重度">{{ detail.severityLabel }}</el-descriptions-item>
-						<el-descriptions-item label="场景">{{ detail.sceneName || detail.sceneCode }}</el-descriptions-item>
+						<el-descriptions-item label="模块">{{ detail.moduleName || detail.moduleCode || detail.sceneName || detail.sceneCode || '—' }}</el-descriptions-item>
 						<!-- BUG-9/24:补异常类型,优先 typeName,回退 typeCode,无则 '—' -->
 						<el-descriptions-item label="异常类型">{{ detail.exceptionTypeName || detail.exceptionTypeCode || '—' }}</el-descriptions-item>
 						<!-- BUG-3:部门 0/"0"/null/undefined 都视为未分派,不显示裸 0 -->

+ 3 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S8/AdoS8Dtos.cs

@@ -44,6 +44,9 @@ public class AdoS8ExceptionListItemDto
     public string PriorityLevel { get; set; } = string.Empty;
     public string SceneCode { get; set; } = string.Empty;
     public string? SceneName { get; set; }
+    /// <summary>S8-EXCEPTION-MODULE-DISPLAY-1:业务展示主口径(S1-S7)。SceneCode/SceneName 保留兼容期。</summary>
+    public string? ModuleCode { get; set; }
+    public string? ModuleName { get; set; }
     public long ResponsibleDeptId { get; set; }
     public string? ResponsibleDeptName { get; set; }
     public long OccurrenceDeptId { get; set; }

+ 11 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Service/S8/S8ExceptionService.cs

@@ -79,6 +79,7 @@ public class S8ExceptionService : ITransient
                 PriorityLevel = e.PriorityLevel,
                 SceneCode = e.SceneCode,
                 SceneName = sc.SceneName,
+                ModuleCode = e.ModuleCode,
                 ResponsibleDeptId = e.ResponsibleDeptId,
                 OccurrenceDeptId = e.OccurrenceDeptId,
                 AssigneeId = e.AssigneeId,
@@ -101,6 +102,7 @@ public class S8ExceptionService : ITransient
         {
             r.StatusLabel = S8Labels.StatusLabel(r.Status);
             r.SeverityLabel = S8Labels.SeverityLabel(r.Severity);
+            r.ModuleName = string.IsNullOrWhiteSpace(r.ModuleCode) ? null : S8ModuleCode.Label(r.ModuleCode!);
         }
 
         await FillDisplayNamesAsync(list, q.FactoryId);
@@ -121,11 +123,18 @@ public class S8ExceptionService : ITransient
             .Select(x => new { value = x.Id, label = x.Descr ?? x.Department })
             .ToListAsync();
 
+        // S8-EXCEPTION-MODULE-DISPLAY-1:业务展示主口径切到 module_code(S1-S7)。
+        // scenes 保留兼容期,前端筛选已切到 modules。
+        var modules = S8ModuleCode.All
+            .Select(code => new { value = code, label = S8ModuleCode.Label(code) })
+            .ToList();
+
         return new
         {
             statuses = S8Labels.StatusOptions(),
             severities = S8Labels.SeverityOptions(),
             scenes,
+            modules,
             departments
         };
     }
@@ -151,6 +160,7 @@ public class S8ExceptionService : ITransient
                 PriorityLevel = e.PriorityLevel,
                 SceneCode = e.SceneCode,
                 SceneName = sc.SceneName,
+                ModuleCode = e.ModuleCode,
                 SourceType = e.SourceType,
                 OccurrenceDeptId = e.OccurrenceDeptId,
                 ResponsibleDeptId = e.ResponsibleDeptId,
@@ -188,6 +198,7 @@ public class S8ExceptionService : ITransient
         var d = rows[0];
         d.StatusLabel = S8Labels.StatusLabel(d.Status);
         d.SeverityLabel = S8Labels.SeverityLabel(d.Severity);
+        d.ModuleName = string.IsNullOrWhiteSpace(d.ModuleCode) ? null : S8ModuleCode.Label(d.ModuleCode!);
         await FillDisplayNamesAsync(new[] { d }, factoryId);
         return d;
     }