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

@ -53,4 +53,24 @@ export const projectExecute = (data) => {
method: 'post', method: 'post',
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 { ElMessage } from "element-plus";
import { addValueProperty, formatTableData } from "@/utils/flow"; import { addValueProperty, formatTableData } from "@/utils/flow";
import { listTerminal } from "@/api/device/terminal.js"; 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({ const props = defineProps({
drawer: Boolean, drawer: Boolean,
projectId: String, projectId: String,
functionIds: Array
}); });
const emits = defineEmits(["close"]); const emits = defineEmits(["close"]);
@ -112,7 +113,6 @@ const getProjectParams = async () => {
const res = await getExecuteRunParams({ projectId: props.projectId }); const res = await getExecuteRunParams({ projectId: props.projectId });
if (res.code === 200) { if (res.code === 200) {
const data = parseConfig(res.data) const data = parseConfig(res.data)
console.log('data', data)
formData.value.tableData = data formData.value.tableData = data
handleGetTerminalGroup(); handleGetTerminalGroup();
} }
@ -138,7 +138,9 @@ const confirm = () => {
const data = formatTableData(item.config) const data = formatTableData(item.config)
runParams[item.itemId] = data 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) { if (res.code === 200) {
ruleFormRef.value.resetFields(); ruleFormRef.value.resetFields();
ElMessage.success('执行成功') ElMessage.success('执行成功')

View File

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

View File

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

View File

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

View File

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