From 08688bdaa700972a205c99ecce6328c0f27933b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E6=B0=91=E5=BA=B7?= Date: Wed, 16 Apr 2025 14:57:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BF=A1=E4=BB=A3=E7=A0=81=E5=BA=93-?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E8=AF=A6=E6=83=85=E5=A2=9E=E5=8A=A0=E6=81=B6?= =?UTF-8?q?=E6=84=8F=E4=BB=A3=E7=A0=81=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inboundTask/inboundTaskApi.ts | 69 +++++ src/api/inboundTask/inboundTaskType.ts | 61 ++++ src/components/TableFilter/TableFilter.vue | 210 ++++++++++++++ src/views/Jyh/Search/Components/OssQuery.vue | 12 +- .../Jyh/Version/Detail/Malware/Malware.vue | 265 +++++++++++++++++ .../Version/Detail/Malware/MalwareDetail.vue | 268 ++++++++++++++++++ src/views/Jyh/Version/Detail/index.vue | 15 +- 7 files changed, 888 insertions(+), 12 deletions(-) create mode 100644 src/api/inboundTask/inboundTaskApi.ts create mode 100644 src/api/inboundTask/inboundTaskType.ts create mode 100644 src/components/TableFilter/TableFilter.vue create mode 100644 src/views/Jyh/Version/Detail/Malware/Malware.vue create mode 100644 src/views/Jyh/Version/Detail/Malware/MalwareDetail.vue diff --git a/src/api/inboundTask/inboundTaskApi.ts b/src/api/inboundTask/inboundTaskApi.ts new file mode 100644 index 0000000..436d865 --- /dev/null +++ b/src/api/inboundTask/inboundTaskApi.ts @@ -0,0 +1,69 @@ +import request from '@/utils/request'; +import { + type ListReqResData, + type MalwareDetailType, + type MalwareListItemType, + type UnitRes +} from "@/api/inboundTask/inboundTaskType"; +import axios from 'axios'; + +export function inboundTaskReview(params: { taskId: number, isPass: number, approvalComment: string }): Promise> { + return request({ + url: `/task/storage/approvalTask`, + method: 'post', + data: params, + }); +} + +export function getMalwareListApi(params: { taskId: number, softwareId: number, current: number, size: number }): Promise>> { + return axios.request({ + url: '/gateway/detect' + `/malicious/queryPage`, + method: 'POST', + data: params, + headers: { + Authorization: 'Bearer ' + localStorage.getItem('access_token'), + }, + }); +} + +export function getMalwareDetailApi(id: string | number): Promise> { + return axios.request({ + url: '/gateway/detect' + `/maliciousDetails/detailById/${id}`, + method: 'get', + }); +} + +export function getMalwareDetailApi2(params) { + return request({ + url: `/maliciousDetails/pageList`, + method: 'post', + data: params, + }); +} + +// 17. 申请入库-保存草稿 +export function applicationTaskSave(params: any) { + return request({ + url: `/software/saveInfo`, + method: 'post', + data: params, + }).then(res => res.data || {}); +} + +// 17. 申请入库-提交 +export function applicationTaskSubmit(params: {softwareId: number}) { + return request({ + url: `/task/storage/startTask`, + method: 'post', + data: params, + }).then(res => res.data || {}); +} +// 17. 查询任务对应的入库软件id +export function queryTaskSoftwareDetail(params: {taskId: number}) { + return request({ + url: `/task/storage/taskDetail`, + method: 'post', + data: params, + }); +} + diff --git a/src/api/inboundTask/inboundTaskType.ts b/src/api/inboundTask/inboundTaskType.ts new file mode 100644 index 0000000..cf1bc7d --- /dev/null +++ b/src/api/inboundTask/inboundTaskType.ts @@ -0,0 +1,61 @@ +import { type AxiosResponse } from "axios"; + +export interface CommonRes { + code: number; + msg: string; + data: T; +} + +export type UnitRes = AxiosResponse>; + +export interface ListReqResData { + records: T[]; + total: number; + size: number; + current: number; + orders: any[]; + optimizeCountSql: boolean; + searchCount: boolean; + countId: null; + maxLimit: null; + pages: number; +} + +export interface MalwareListItemType { + id: number; + taskId: number; // 【扫描任务ID】 + softwareId: number; // 【软件ID】 + packageFullName: string; // 【包全名】 + packagePath: string; // 【包路径】 + packageName: string; // 【包名称】 + packageVersion: string; // 【包版本号】 + timestamp: string; // 【检测时间】 + llmName: string; // 【使用的LLM名称】 + totalApisCalledCount: number; // 【调用的敏感API总数】 + suspiciousFilesCount: number; // 【检测的可疑文件总数】 + isMalicious: number; // 【是否包含恶意代码】 + isModelResponded: number; // 【大模型是否正常回复】 + createTime: string; // 【创建时间】 + updateTime: string; +} + +export interface MalwareDetailType { + id: number; + resultId: number; + filePath: string; + codeType: string; + identifier: string; + tokenNum: number; + code: string; + suspiciousBehaviors: string; // 威胁信息 Array 转换成的 JSON 字符串 + apisCalled: string; // Array 转换成的 JSON 字符串 + isMalicious: number; + maliciousCodeCategory: string; + source: string; + sink: string; + flow: string; + purpose: string; + analysis: string; + createTime: string; + updateTime: string; +} diff --git a/src/components/TableFilter/TableFilter.vue b/src/components/TableFilter/TableFilter.vue new file mode 100644 index 0000000..43ac009 --- /dev/null +++ b/src/components/TableFilter/TableFilter.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/src/views/Jyh/Search/Components/OssQuery.vue b/src/views/Jyh/Search/Components/OssQuery.vue index 1aa5de3..5183544 100644 --- a/src/views/Jyh/Search/Components/OssQuery.vue +++ b/src/views/Jyh/Search/Components/OssQuery.vue @@ -110,12 +110,12 @@ @@ -76,6 +78,7 @@ import SBOM from './SBOM.vue'; import AIRepair from '../../AIRepair/index.vue'; import LicenseInfo from '../../LicenseInfo/index.vue'; import Dependence from './Dependency.vue' +import Malware from "@/views/Jyh/Version/Detail/Malware/Malware.vue"; const { namespace } = getOrgInfo(); const route = useRoute(); // 获取路由对象 const avatarUrl = '/src/assets/imgs/jyh/工程首字母图标.png';