feta: 触控评价

This commit is contained in:
zhanghao 2026-03-10 16:56:34 +08:00
parent 8ec9912550
commit a7671691c0
6 changed files with 143 additions and 43 deletions

View File

@ -54,3 +54,23 @@ export const projectExecute = (data) => {
data
})
}
export const executeProject = (data) => {
return request({
url: '/ti/project/evaluation',
method: 'post',
data
})
}
/**
* 获取评估
* @param {*} projectId
* @returns
*/
export function getValuationProject(projectId) {
return request({
url: '/ti/project/evaluation/' + projectId,
method: 'get'
})
}

View File

@ -75,12 +75,13 @@ import { ref, watch } from "vue";
import { ElMessage } from "element-plus";
import { addValueProperty, formatTableData } from "@/utils/flow";
import { listTerminal } from "@/api/device/terminal.js";
import { getExecuteRunParams, projectExecute } from "@/api/is/project/index.js";
import { getExecuteRunParams, projectExecute, executeProject } from "@/api/is/project/index.js";
const props = defineProps({
drawer: Boolean,
projectId: String,
functionIds: Array
});
const emits = defineEmits(["close"]);
@ -112,7 +113,6 @@ const getProjectParams = async () => {
const res = await getExecuteRunParams({ projectId: props.projectId });
if (res.code === 200) {
const data = parseConfig(res.data)
console.log('data', data)
formData.value.tableData = data
handleGetTerminalGroup();
}
@ -138,7 +138,9 @@ const confirm = () => {
const data = formatTableData(item.config)
runParams[item.itemId] = data
})
const res = await projectExecute({ runParams, projectId: props.projectId, terminalId: formData.value.terminalId })
// const res = await projectExecute({ runParams, projectId: props.projectId, terminalId: formData.value.terminalId })
//
const res = await executeProject(props.functionIds)
if (res.code === 200) {
ruleFormRef.value.resetFields();
ElMessage.success('执行成功')

View File

@ -3,40 +3,41 @@
<Info :infoData="projectData" />
<div class="test-container">
<div class="title">测试结果</div>
<div>
<el-button @click="handler('重庆')">生成报告</el-button>
<el-button>导出结果</el-button>
<div class="report-container">
<div class="report-item">成功率 {{ reportData?.successRate || '' }}</div>
<div class="report-item">成功率得分 {{ reportData?.successRateScore || '' }}</div>
<!-- <el-button @click="handler('重庆')">生成报告</el-button>
<el-button>导出结果</el-button> -->
</div>
</div>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="id" label="结果ID" />
<el-table-column prop="time" label="时间" />
<el-table-column prop="text" label="语料文本" />
<el-table-column prop="rate" label="字识别率" show-overflow-tooltip>
<template #default="{ row }">
<div v-if="row.rate">{{ row.rate }}</div>
<div v-else><el-tag type="info">未测试</el-tag></div>
</template>
</el-table-column>
<el-table-column prop="result" label="测试结果">
<template #default="{ row }">
<el-tag :type="row.result ? 'success' : 'warning'">{{ row.result ? '通过' : '分析中' }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="can" label="CAN结果">
<template #default="{ row }">
<div v-if="row.rate">{{ row.can }}</div>
<div v-else><el-tag type="danger">未测试</el-tag></div>
</template>
</el-table-column>
<el-table-column prop="responseTime" label="响应时间" />
<el-table-column prop="flag" label="结果标记 " />
</el-table>
<el-table-column prop="aeId" width="150" show-overflow-tooltip label="结果ID" />
<el-table-column prop="content" label="功能" width="260" show-overflow-tooltip />
<el-table-column prop="status" label="状态" show-overflow-tooltip>
<template #default="{ row }">
<el-tag :type="statusType[row.status] || 'info'">{{ statusTypeContext[row.status] }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="videoPath" label="视频路径" show-overflow-tooltip>
<template #default="{ row }">
<el-text class="mx-1" type="primary" @click="openVideoDialog(row)">播放视频</el-text>
</template>
</el-table-column>
<el-table-column prop="itemResponseTime" label="响应时间" />
<el-table-column prop="failureReason" label="失败原因"></el-table-column>
<el-table-column prop="executionDetail" label="执行详情" />
</el-table>
<el-dialog v-model="centerDialogVisible" title="播放视频" width="800" center>
<Video :src="videoSrc" />
</el-dialog>
</div>
</template>
<script setup>
import Info from './info.vue';
import { getValuationProject } from '@/api/is/project'
import Video from '@/components/Video/index.vue'
const route = useRoute();
@ -45,6 +46,42 @@ const projectData = route.query.data
: {};
const tableData = ref([]);
const reportData = ref(null)
const getListScheme = async () => {
const res = await getValuationProject(projectData.projectId)
if (res.code === 200) {
reportData.value = {
successRate: res.data.successRate,
successRateScore: res.data.successRateScore
}
tableData.value = res.data.itemDetails
}
}
const statusType = {
0: 'info',
1: 'conductedState',
2: 'successfulState',
3: 'danger'
}
const statusTypeContext = {
0: '待评估',
1: '评估中',
2: '评估成功',
3: '评估失败'
}
const centerDialogVisible = ref(false)
const videoSrc = ref('')
const openVideoDialog = (row) => {
videoSrc.value = row.videoPath
centerDialogVisible.value = true
}
onMounted(() => {
getListScheme()
})
</script>
<style lang="scss" scoped>
@ -68,6 +105,11 @@ const tableData = ref([]);
font-size: 20px;
font-weight: bold;
}
.report-container {
display: flex;
gap: 12px;
}
}
.context-container {

View File

@ -2,11 +2,11 @@
<div class="info">
<div class="item">
<div class="label">项目名称:</div>
<div class="text">{{ infoData.projectName }}</div>
<div class="text" :title="infoData.projectName">{{ infoData.projectName }}</div>
</div>
<div class="item">
<div class="label">项目编号:</div>
<div class="text">{{ infoData.projectId }}</div>
<div class="text" :title="infoData.projectId">{{ infoData.projectId }}</div>
</div>
<div class="item">
<div class="label">测试人员:</div>
@ -18,7 +18,7 @@
</div>
<div class="item">
<div class="label">样品名称:</div>
<div class="text">{{ infoData.sampleName }}</div>
<div class="text" :title="infoData.sampleName">{{ infoData.sampleName }}</div>
</div>
<div class="item">
<div class="label">委托单位:</div>
@ -60,10 +60,18 @@ const props = defineProps({
flex: 0 0 25%;
display: flex;
align-items: center;
flex: 1 1 min(25%, 400px);
.label {
margin: 10px;
}
.text {
max-width: 60%;
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏溢出的内容 */
text-overflow: ellipsis; /* 显示省略符号来代表被修剪的文本 */
}
}
}
</style>

View File

@ -331,8 +331,9 @@
<Run
:drawer="executeOpen"
@close="executeOpen = false"
@close="closeRun"
:projectId="executeProjectId"
:functionIds="functionIds"
/>
</div>
</template>
@ -545,7 +546,8 @@ const handleUpdate = (row) => {
isAdd.value = false;
title.value = "修改测试项目";
form.value = row;
form.value.testFuncIds = form.value.testFuncIds.split(',').map(item => Number(item));
form.value.testFuncIds = JSON.parse(form.value.testFuncIds);
getFuncList(form.value.vehicleConfigId)
};
const handleDelete = (row) => {
@ -578,30 +580,43 @@ const getIndicatorData = () => {
ElMessage.error("网络异常,加载评价指标失败");
});
}
const { proxy } = getCurrentInstance()
const { ti_function_config } = proxy.useDict("ti_function_config")
const funcIdOptions = ref([])
const vehicleConfigChange = (value) => {
form.value.testFuncIds = null
funcIdOptions.value = []
getFuncList(value)
}
const getFuncList = (value) => {
getFunction({
pageNum: 1,
pageSize: 10000,
vehicleConfigId: value
}).then((res) => {
if (res.code === 200) {
funcIdOptions.value = (res.rows || []).map(item => ({
label: item.remark,
value: item.id
}))
funcIdOptions.value = (res.rows || []).map(item => {
const label = ti_function_config.value.find(func => {
return func.value === item.funcKey
}).label
return {
label: label,
value: item.id
}
})
}
})
}
const executeOpen = ref(false);
const executeProjectId = ref(null);
const functionIds = ref([])
const handleExecute = (row) => {
executeOpen.value = true;
executeProjectId.value = row.projectId;
//
functionIds.value = JSON.parse(row.testFuncIds)
}
const router = useRouter()
@ -615,6 +630,11 @@ const handleEvaluate = (row) => {
})
}
const closeRun = () => {
executeOpen.value = false
getList()
}
onMounted(() => {
getList();
getTreeData();

View File

@ -6,7 +6,7 @@
</div>
<div class="item">
<div class="label">项目编号:</div>
<div class="text">{{ infoData.projectId }}</div>
<div class="text" :title="infoData.projectId">{{ infoData.projectId }}</div>
</div>
<div class="item">
<div class="label">测试人员:</div>
@ -14,11 +14,11 @@
</div>
<div class="item">
<div class="label">计划测试时间:</div>
<div class="text">{{ parseTime(infoData.planStart) }}</div>
<div class="text" >{{ parseTime(infoData.planStart) }}</div>
</div>
<div class="item">
<div class="label">样品名称:</div>
<div class="text">{{ infoData.sampleName }}</div>
<div class="text" :title="infoData.sampleName">{{ infoData.sampleName }}</div>
</div>
<div class="item">
<div class="label">委托单位:</div>
@ -49,6 +49,7 @@ const props = defineProps({
flex-wrap: wrap;
padding: 12px;
background: #fff;
gap: 12px;
border: 1px solid #e4e7ed;
border-radius: 8px;
@ -57,13 +58,20 @@ const props = defineProps({
}
.item {
flex: 0 0 25%;
display: flex;
align-items: center;
flex: 1 1 min(25%, 400px);
.label {
margin: 10px;
}
.text {
max-width: 60%;
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏溢出的内容 */
text-overflow: ellipsis; /* 显示省略符号来代表被修剪的文本 */
}
}
}
</style>