From 622c22ff893175449960d205a7b863b44265a4bf Mon Sep 17 00:00:00 2001 From: lixiaolong <702156524@qq.com> Date: Wed, 16 Sep 2026 17:26:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(ti):=20=E5=AE=8C=E5=96=84=E8=A7=A6?= =?UTF-8?q?=E6=8E=A7=E4=BA=A4=E4=BA=92=E6=89=A7=E8=A1=8C=E4=B8=8E=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加项目执行、重新执行和执行过程入口。 按执行实例展示检测统计、结果、异常信息及录像。 --- src/api/is/project/index.js | 14 +- src/views/is/project/evaluate/Run.vue | 7 +- src/views/is/project/evaluate/index.vue | 199 ++++++++++++------------ src/views/is/project/index.vue | 107 +++++++++++-- 4 files changed, 204 insertions(+), 123 deletions(-) diff --git a/src/api/is/project/index.js b/src/api/is/project/index.js index 79e88c6..1f86dda 100644 --- a/src/api/is/project/index.js +++ b/src/api/is/project/index.js @@ -55,11 +55,10 @@ export const projectExecute = (data) => { }) } -export const executeProject = (data) => { +export const queryExecuteInstId = (projectId) => { return request({ - url: '/ti/project/evaluation', - method: 'post', - data + url: `/ti/project/queryExecuteInstId/${projectId}`, + method: 'get' }) } @@ -68,9 +67,10 @@ export const executeProject = (data) => { * @param {*} projectId * @returns */ -export function getValuationProject(projectId) { +export function getValuationProject(projectId, instId) { return request({ url: '/ti/project/evaluation/' + projectId, - method: 'get' + method: 'get', + params: instId ? { instId } : undefined }) -} \ No newline at end of file +} diff --git a/src/views/is/project/evaluate/Run.vue b/src/views/is/project/evaluate/Run.vue index 9e14590..6264a8a 100644 --- a/src/views/is/project/evaluate/Run.vue +++ b/src/views/is/project/evaluate/Run.vue @@ -77,8 +77,7 @@ import { const props = defineProps({ drawer: Boolean, - projectId: String, - functionIds: Array + projectId: String }); const emits = defineEmits(["close"]); @@ -137,10 +136,10 @@ const confirm = () => { }) if (res.code === 200) { ruleFormRef.value.resetFields(); - ElMessage.success('执行成功') + ElMessage.success(`任务已启动,执行实例:${res.data}`) emits("close"); } else { - ElMessage.success(res.msg) + ElMessage.error(res.msg) } }) .catch((err) => { diff --git a/src/views/is/project/evaluate/index.vue b/src/views/is/project/evaluate/index.vue index b098e43..66c7c10 100644 --- a/src/views/is/project/evaluate/index.vue +++ b/src/views/is/project/evaluate/index.vue @@ -1,75 +1,122 @@ + \ No newline at end of file + diff --git a/src/views/is/project/index.vue b/src/views/is/project/index.vue index e42f61c..4017852 100644 --- a/src/views/is/project/index.vue +++ b/src/views/is/project/index.vue @@ -113,7 +113,7 @@ @@ -121,16 +121,23 @@ 执行 + >{{ row.status == '0' ? '执行' : '重新执行' }} + + 执行过程 评价 + >查看报告 + + + +
+
{{ item.name }}
+
+ +
+
+
+ +
+ @@ -345,8 +381,16 @@ import { ElMessage, ElMessageBox } from "element-plus"; import { getTreeDataApi } from '@/api/is/func/index' import { getChildrenByParentIdWithLevelLimitApi } from "@/api/evaluate/indicator.js"; import { getFunction } from "@/api/is/func/index.js"; -import { addProject, getProjectList, updateProject, deleteProject } from "@/api/is/project/index.js"; +import { + addProject, + getProjectList, + updateProject, + deleteProject, + getExecuteRunParams, + queryExecuteInstId, +} from "@/api/is/project/index.js"; import Run from "@/views/is/project/evaluate/Run.vue"; +import { appendParamsToPath } from "@/utils/fn.js"; const topContainerRef = ref(); const containerHeight = useContainerHeight(topContainerRef); @@ -618,19 +662,9 @@ const getFuncList = (value) => { const executeOpen = ref(false); const executeProjectId = ref(null); -const functionIds = ref([]) const handleExecute = (row) => { executeOpen.value = true; executeProjectId.value = row.projectId; - // 后端临时应付检查添加,后续可删除 - let arr = [] - try { - arr = JSON.parse(row.testFuncIds); - } catch { - arr = [] - } finally { - functionIds.value = arr - } } const router = useRouter() @@ -644,6 +678,47 @@ const handleEvaluate = (row) => { }) } +const executionOpen = ref(false) +const currentProject = ref({}) +const executionFlows = ref([]) +const latestInstId = ref('') + +const handleOpenExecution = async (row) => { + currentProject.value = row + executionOpen.value = true + latestInstId.value = '' + executionFlows.value = [] + try { + const [flowRes, instRes] = await Promise.all([ + getExecuteRunParams({ projectId: row.projectId }), + queryExecuteInstId(row.projectId), + ]) + latestInstId.value = instRes.data || '' + executionFlows.value = (flowRes.data || []).map((item) => ({ + id: item.itemId, + name: item.itemName || '触控交互流程', + })) + } catch (error) { + ElMessage.error(error.message || '加载执行过程失败') + } +} + +const handleFlowView = (item) => { + if (!latestInstId.value) { + ElMessage.warning('未找到执行实例') + return + } + const params = { + instId: latestInstId.value, + taskId: currentProject.value.projectId, + itemId: item.id, + name: item.name, + state: '0', + isLog: true, + } + window.open(appendParamsToPath('/flow', params), '_blank') +} + const closeRun = () => { executeOpen.value = false getList()