diff --git a/src/service/api/highRisk.ts b/src/service/api/highRisk.ts index b0c4c57..a9966b6 100644 --- a/src/service/api/highRisk.ts +++ b/src/service/api/highRisk.ts @@ -15,3 +15,12 @@ export function analysisRecordListApi(id:number) { method: 'get', }); } + +// 历史分析检索 +export function historyAnalysisListApi(params:{kw:string,method:string}) { + return request({ + url: `/api/analysis-records/search`, + method: 'get', + params, + }); +} diff --git a/src/views/my/highRisk/modules/history.vue b/src/views/my/highRisk/modules/history.vue index 53bb6fc..495b2cf 100644 --- a/src/views/my/highRisk/modules/history.vue +++ b/src/views/my/highRisk/modules/history.vue @@ -3,25 +3,11 @@ import { ref, computed, onMounted } from 'vue'; import { Icon } from '@iconify/vue' import { useThemeStore } from '@/store/modules/theme'; import { useRouterPush } from '@/hooks/common/router'; -import { systemConfigApi } from '@/service/api/system'; -import { orgListApi } from '@/service/api/user'; -import { highRiskListApi } from '@/service/api/highRisk'; +import { historyAnalysisListApi } from '@/service/api/highRisk'; const themeStore = useThemeStore(); const { routerPushByKey } = useRouterPush(); -const keyword = ref(""); -const currentTab = ref("history"); -const method = ref("全部"); -const list = ref([]); -const historyList = [ - { id: "HAZOP-2025-018", change: "MOC-2025-R01-0023 常压炉燃料气切断阀改造", method: "HAZOP", unit: "01-常减压装置", scope: "燃料气系统节点", rows: 12, date: "2025-10-20" }, - { id: "HAZOP-2024-006", change: "MOC-2024-R01-0003 减一线换热器 E-108 芯子更换", method: "HAZOP", unit: "01-常减压装置", scope: "换热系统节点", rows: 8, date: "2024-03-15" }, - { id: "JSA-2025-041", change: "MOC-2025-R02-0014 再生器旋风分离器更换", method: "JSA", unit: "02-催化裂化装置", scope: "受限空间作业", rows: 6, date: "2025-05-08" }, - { id: "JSA-2026-012", change: "MOC-2026-R01-0035 搅拌电机更换", method: "JSA", unit: "01-常减压装置", scope: "检维修作业", rows: 5, date: "2026-07-29" }, - { id: "SCL-2025-033", change: "MOC-2025-R02-0021 气压机出口压力联锁逻辑修改", method: "检查表", unit: "02-催化裂化装置", scope: "联锁系统", rows: 14, date: "2025-09-18" }, - { id: "AI-2026-008", change: "MOC-2026-R03-0008 聚合釜搅拌器密封形式变更", method: "AI 预分析", unit: "03-聚合装置", scope: "—", rows: 4, date: "2026-05-06" }, -]; // 查看历史分析检索 const viewHistory = (id: string) => { window.$message?.info(`演示:在线查看 ${id} 完整分析记录`) @@ -32,58 +18,48 @@ const copyHistory = (id: string) => { } const loading = ref(false); -// 组织树 -const orgTree = ref([]); -// 筛选条件 -const formInfo = ref({ - kw: '', - org_id: 1, - from: null, - to: null, -}); -const pagination = ref<{page: number, pageSize: number, itemCount: number}>({ - page: 1, - pageSize: 20, - itemCount: 0, -}) -// 变更类型列表 -const typeList = ref([{ label: "全部", value: null }]); -// 变更等级列表 -const levelList = ref([{ label: "全部", value: null }]); +// 搜索关键词 +const keyword = ref(""); +// 插件筛选 +const plugin = ref(""); +// 插件列表 +const pluginList = ref([ + { label: "全部", value: '' }, + { label: "风险预分析", value: 'RISK' }, + { label: "HAZOP", value: 'HAZOP' }, + { label: "FMEA", value: 'FMEA' }, + { label: "风险检查表", value: 'RISK_CHECK' }, +]); +const list = ref([]); + +// 插件筛选 +const pluginChange = (v: string) => { + plugin.value = v; + getList(); +} +// 重置 +const reset = () => { + keyword.value = ''; + plugin.value = ''; + getList(); +}; // 获取列表 const getList = async () => { loading.value = true; - const {data,error} = await highRiskListApi({ - kw: formInfo.value.kw, - org_id: formInfo.value.org_id, - from: formInfo.value.from, - to: formInfo.value.to, - page_num: pagination.value.page, - page_size: pagination.value.pageSize, + const {data,error} = await historyAnalysisListApi({ + kw: keyword.value, + method: plugin.value, }); if(!error){ - list.value = data?.list ?? []; - pagination.value.itemCount = data?.total ?? 0; + console.log(data); + list.value = data ?? []; } loading.value = false; } -// 切换tab -const tabChange = async (k: string) => { - list.value = [] - currentTab.value = k; - loading.value = true; - if(k === 'history'){ - setTimeout(() => { - list.value = historyList; - loading.value = false; - }, 1000); - } -} - onMounted(() => { - tabChange('history'); + getList(); }) @@ -97,23 +73,26 @@ onMounted(() => {

历史分析记录检索(企业风险知识资产)

- + + + 重置 +
- {{ m }} + {{ p.label }} {{ list.length }} 条记录
@@ -122,11 +101,11 @@ onMounted(() => {
- {{ h.id }} - {{ h.method }} - {{ h.change }} + {{ h.change_no }} + {{ h.method==='RISK'?'风险预分析':h.method==='RISK_CHECK'?'风险检查': h.method }} + {{ h.title }}
-
{{ h.unit }} · 范围:{{ h.scope }} · {{ h.rows }} 行分析记录 · {{ h.date }}
+
{{ h.org_name }} · {{ h.rows }} 行分析记录 · {{ h?.analysis_time?.slice(0,10) || '' }}
@@ -142,7 +121,7 @@ onMounted(() => { diff --git a/src/views/my/highRisk/modules/risk.vue b/src/views/my/highRisk/modules/risk.vue index 37d1cc2..2346024 100644 --- a/src/views/my/highRisk/modules/risk.vue +++ b/src/views/my/highRisk/modules/risk.vue @@ -4,7 +4,7 @@ import { Icon } from '@iconify/vue' import { useThemeStore } from '@/store/modules/theme'; import { useRouterPush } from '@/hooks/common/router'; import { getTimeRangeStamp, formatTimestamp } from '@/utils/common'; -import { systemConfigApi, matrixConfigApi } from '@/service/api/system'; +import { matrixConfigApi } from '@/service/api/system'; import { orgListApi } from '@/service/api/user'; import { highRiskListApi } from '@/service/api/highRisk'; @@ -59,10 +59,6 @@ const pagination = ref<{page: number, pageSize: number, itemCount: number}>({ pageSize: 20, itemCount: 0, }) -// 变更类型列表 -const typeList = ref([{ label: "全部", value: null }]); -// 变更等级列表 -const levelList = ref([{ label: "全部", value: null }]); // 自定义渲染展开图标 const renderSwitcherIcon = (node:any) => { @@ -129,30 +125,12 @@ const getList = async () => { }); if(!error){ list.value = data?.list ?? []; - console.log(list.value); pagination.value.itemCount = data?.total ?? 0; } loading.value = false; } -// 获取配置 -const getConfig = async () => { - const {data,error} = await systemConfigApi(); - if(!error){ - // 解析 变更类型设置 - const changeTypeGroup = data.find((group:{group_key:string}) => group.group_key === 'change_type'); - if (changeTypeGroup) { - typeList.value = typeList.value.concat(changeTypeGroup.items); - } - // 解析 变更等级设置 - const changeLevelGroup = data.find((group:{group_key:string}) => group.group_key === 'change_level'); - if (changeLevelGroup) { - levelList.value = levelList.value.concat(changeLevelGroup.items); - } - } -} - -// // 获取组织列表 +// 获取组织列表 const getOrgList = async () => { loading.value = true; const {data,error} = await orgListApi(); @@ -185,7 +163,6 @@ const matchRiskLevel = (configList:any,name: string) => { onMounted(async () => { matrixConfig(); - await getConfig(); getOrgList(); })