feat: 项目设计
This commit is contained in:
parent
349bb9c0d0
commit
cae784762e
@ -28,23 +28,32 @@
|
||||
<div class="right">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column prop="id" label="结果ID" />
|
||||
<el-table-column prop="uiKey" label="时间" />
|
||||
<el-table-column prop="uiUrl" label="语料文本" />
|
||||
<el-table-column prop="funcIds" label="响应时间" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="字识别率" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="测试结果" />
|
||||
<el-table-column prop="can" label="CAN结果" />
|
||||
<el-table-column prop="result" label="结果标记 " />
|
||||
<el-table-column label="操作" width="200">
|
||||
<el-table-column prop="time" label="时间" />
|
||||
<el-table-column prop="text" label="语料文本" />
|
||||
<el-table-column prop="responseTime" label="响应时间" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="handleUpdateUI(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button link type="danger" @click="handleDeleteUI(row)">
|
||||
删除
|
||||
</el-button>
|
||||
<div v-if="row.responseTime">{{ row.responseTime }}</div>
|
||||
<div v-else><el-tag type="primary">未测试</el-tag></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="flag" label="结果标记 " />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
@ -76,7 +85,58 @@ const schemaList = ref([
|
||||
},
|
||||
])
|
||||
|
||||
const tableData = ref([])
|
||||
const tableData = ref([
|
||||
{
|
||||
id: 'test result 876',
|
||||
time: '2025-11-26 16:46:23',
|
||||
text: '我想听收音机',
|
||||
responseTime: 0,
|
||||
rate: 0,
|
||||
result: 1,
|
||||
can: 0,
|
||||
flag: '无'
|
||||
},
|
||||
{
|
||||
id: 'test result 877',
|
||||
time: '2025-11-25 16:46:23',
|
||||
text: '暂停音乐',
|
||||
responseTime: 0,
|
||||
rate: 0,
|
||||
result: 1,
|
||||
can: 0,
|
||||
flag: '需复核結果 '
|
||||
},
|
||||
{
|
||||
id: 'test result 878',
|
||||
time: '2025-11-26 17:49:24',
|
||||
text: '取消静音',
|
||||
responseTime: 0,
|
||||
rate: 0,
|
||||
result: 0,
|
||||
can: 0,
|
||||
flag: '无'
|
||||
},
|
||||
{
|
||||
id: 'test result 879',
|
||||
time: '2025-11-26 16:46:23',
|
||||
text: '静音',
|
||||
responseTime: 0,
|
||||
rate: 0,
|
||||
result: 1,
|
||||
can: 0,
|
||||
flag: '无'
|
||||
},
|
||||
{
|
||||
id: 'test result 880',
|
||||
time: '2025-11-28 16:46:23',
|
||||
text: '音乐音量小点',
|
||||
responseTime: 0,
|
||||
rate: 0,
|
||||
result: 1,
|
||||
can: 0,
|
||||
flag: '无'
|
||||
}
|
||||
])
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
|
||||
@ -56,8 +56,27 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目ID" align="center" prop="projectId" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" width="150" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="项目ID"
|
||||
align="center"
|
||||
prop="projectId"
|
||||
width="150"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
align="center"
|
||||
prop="projectName"
|
||||
width="150"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="车机版本Id"
|
||||
align="center"
|
||||
prop="vehicleConfigId"
|
||||
width="150"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="测试人员" align="center" prop="tester" />
|
||||
<el-table-column
|
||||
label="计划测试开始时间"
|
||||
@ -69,31 +88,48 @@
|
||||
<span>{{ parseTime(row.planStart) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划测试结束时间" align="center" prop="planEnd" width="180">
|
||||
<el-table-column
|
||||
label="计划测试结束时间"
|
||||
align="center"
|
||||
prop="planEnd"
|
||||
width="180"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span>{{ parseTime(row.planEnd) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目描述" width="200" show-overflow-tooltip align="center" prop="remark" />
|
||||
<el-table-column
|
||||
label="项目描述"
|
||||
width="200"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
prop="remark"
|
||||
/>
|
||||
<el-table-column label="项目状态" align="center" prop="status">
|
||||
<template #default="{ row }">
|
||||
{{ row.status == 0 ? '已执行': '未执行' }}
|
||||
{{ row.status == 0 ? "已执行" : "未执行" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="320px" class-name="small-padding fixed-width" fixed="right">
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="320px"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleSetting(row)"
|
||||
v-hasPermi="['system:project:add','system:project:edit']"
|
||||
v-hasPermi="['system:project:add', 'system:project:edit']"
|
||||
>配置方案
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleExecute(row)"
|
||||
v-hasPermi="['system:project:add','system:project:edit']"
|
||||
v-hasPermi="['system:project:add', 'system:project:edit']"
|
||||
>执行
|
||||
</el-button>
|
||||
<el-button
|
||||
@ -131,14 +167,23 @@
|
||||
body-class="testProject_dialog"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<div class="card">
|
||||
<div class="form-title">项目信息</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="form.projectName" placeholder="请输入语料名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="车机版本" prop="vehicleConfigId">
|
||||
<el-tree-select
|
||||
v-model="form.vehicleConfigId"
|
||||
node-key="id"
|
||||
:data="treeData"
|
||||
:render-after-expand="false"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="测试人员" prop="tester">
|
||||
<el-input v-model="form.tester" placeholder="请输入测试人员" />
|
||||
@ -170,10 +215,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="form.sort"
|
||||
placeholder="排序"
|
||||
/>
|
||||
<el-input-number v-model="form.sort" placeholder="排序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -186,7 +228,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@ -201,7 +242,8 @@
|
||||
<script setup>
|
||||
import TableSearch from "@/components/TableSearch/index.vue";
|
||||
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { getTreeDataApi } from '@/api/is/func/index'
|
||||
|
||||
const topContainerRef = ref();
|
||||
const containerHeight = useContainerHeight(topContainerRef);
|
||||
@ -217,59 +259,75 @@ const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
form: {
|
||||
projectName: null,
|
||||
tester: null,
|
||||
planStart: null,
|
||||
vehicleConfigId: null,
|
||||
planEnd: null,
|
||||
sort: null,
|
||||
remark: null,
|
||||
status: null,
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectName: null,
|
||||
},
|
||||
rules: {
|
||||
projectName: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
|
||||
tester: [{ required: true, message: "请输入测试人员", trigger: "blur" }],
|
||||
planStart: [{ required: true, message: "请输入计划测试开始时间", trigger: "blur" }],
|
||||
planEnd: [{ required: true, message: "请输入计划测试结束时间", trigger: "blur" }]
|
||||
planEnd: [{ required: true, message: "请输入计划测试结束时间", trigger: "blur" }],
|
||||
vehicleConfigId: [{ required: true, message: "请选择车机版本", trigger: "blur" }],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const treeData = ref([])
|
||||
|
||||
const getTreeData = async () => {
|
||||
const res = await getTreeDataApi()
|
||||
if (res) {
|
||||
treeData.value = res
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询语音交互-项目列表 */
|
||||
function getList() {
|
||||
projectList.value = [
|
||||
{
|
||||
projectId: '1',
|
||||
projectName: 'test1',
|
||||
tester: 'test',
|
||||
planStart: '2025-11-24 11:08:01',
|
||||
planEnd: '2025-11-25 11:08:01',
|
||||
projectId: "1",
|
||||
projectName: "test1",
|
||||
tester: "test",
|
||||
planStart: "2025-11-24 11:08:01",
|
||||
planEnd: "2025-11-25 11:08:01",
|
||||
vehicleConfigId: '1',
|
||||
sort: 1,
|
||||
remark: 'ssssss'
|
||||
remark: "ssssss",
|
||||
},
|
||||
{
|
||||
projectId: '2',
|
||||
projectName: 'test2',
|
||||
tester: 'test',
|
||||
planStart: '2025-11-23 11:08:01',
|
||||
planEnd: '2025-11-25 11:08:01',
|
||||
projectId: "2",
|
||||
projectName: "test2",
|
||||
tester: "test",
|
||||
vehicleConfigId: '2',
|
||||
planStart: "2025-11-23 11:08:01",
|
||||
planEnd: "2025-11-25 11:08:01",
|
||||
sort: 2,
|
||||
remark: 'ssssss'
|
||||
remark: "ssssss",
|
||||
},
|
||||
{
|
||||
projectId: '3',
|
||||
projectName: 'test3',
|
||||
tester: 'test',
|
||||
planStart: '2025-11-25 11:08:01',
|
||||
planEnd: '2025-11-27 11:08:01',
|
||||
projectId: "3",
|
||||
projectName: "test3",
|
||||
tester: "test",
|
||||
vehicleConfigId: '3',
|
||||
planStart: "2025-11-25 11:08:01",
|
||||
planEnd: "2025-11-27 11:08:01",
|
||||
sort: 3,
|
||||
remark: 'ssssss'
|
||||
}
|
||||
]
|
||||
remark: "ssssss",
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
@ -286,9 +344,10 @@ function reset() {
|
||||
tester: null,
|
||||
planStart: null,
|
||||
planEnd: null,
|
||||
vehicleConfigId: null,
|
||||
sort: null,
|
||||
remark: null,
|
||||
status: null
|
||||
status: null,
|
||||
};
|
||||
}
|
||||
|
||||
@ -310,70 +369,74 @@ function handleSelectionChange(selection) {
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
const isAdd = ref(false)
|
||||
const isAdd = ref(false);
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
isAdd.value = true
|
||||
isAdd.value = true;
|
||||
title.value = "添加测试项目";
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
const handleSetting = (row) => {
|
||||
router.push('/is/plan/index/' + row.projectId)
|
||||
}
|
||||
router.push("/is/plan/index/" + row.projectId);
|
||||
};
|
||||
|
||||
const handleExecute = (row) => {
|
||||
router.push('/is/evaluate/index/' + row.projectId)
|
||||
}
|
||||
router.push("/is/evaluate/index/" + row.projectId);
|
||||
};
|
||||
|
||||
const formRef = ref()
|
||||
const formRef = ref();
|
||||
const submitForm = () => {
|
||||
if (!formRef.value) return
|
||||
if (!formRef.value) return;
|
||||
|
||||
formRef.value.validate((valid) => {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
if (isAdd.value) {
|
||||
projectList.value.unshift({
|
||||
...form.value,
|
||||
projectId: new Date().getTime()
|
||||
})
|
||||
projectId: new Date().getTime(),
|
||||
});
|
||||
} else {
|
||||
let itemToUpdate = projectList.value.find(item => item.projectId === form.value.projectId);
|
||||
let itemToUpdate = projectList.value.find(
|
||||
(item) => item.projectId === form.value.projectId
|
||||
);
|
||||
if (itemToUpdate) {
|
||||
itemToUpdate = {...form.value}
|
||||
itemToUpdate = { ...form.value };
|
||||
}
|
||||
}
|
||||
open.value =false
|
||||
open.value = false;
|
||||
reset();
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleUpdate = (row) => {
|
||||
reset();
|
||||
open.value = true;
|
||||
isAdd.value = false
|
||||
isAdd.value = false;
|
||||
title.value = "修改测试项目";
|
||||
form.value = row
|
||||
}
|
||||
form.value = row;
|
||||
};
|
||||
|
||||
const handleDelete = (row) => {
|
||||
ElMessageBox.confirm(
|
||||
`确定要删除项目"${row.projectName}"吗?`,
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(async () => {
|
||||
projectList.value = projectList.value.filter(item => item.projectId !== row.projectId)
|
||||
})
|
||||
}
|
||||
ElMessageBox.confirm(`确定要删除项目"${row.projectName}"吗?`, "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(async () => {
|
||||
projectList.value = projectList.value.filter(
|
||||
(item) => item.projectId !== row.projectId
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
getTreeData()
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep() {
|
||||
@ -386,16 +449,6 @@ onMounted(() => {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.form-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -412,7 +465,6 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-scrollbar__view {
|
||||
width: 100%;
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted } from "vue";
|
||||
import { onMounted, watch } from "vue";
|
||||
import { getDictList } from '@/api/is/project/index'
|
||||
|
||||
const props = defineProps({
|
||||
@ -103,7 +103,9 @@ const toggleRowSelection = () => {
|
||||
if (selectList.value.length > 0) {
|
||||
functionList.value.forEach((row) => {
|
||||
selectList.value.forEach((item) => {
|
||||
|
||||
if (row.dictCode === item.dictCode) {
|
||||
tableRef.value.toggleRowSelection(row, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -157,8 +159,21 @@ const cancel = () => {
|
||||
resetForm()
|
||||
};
|
||||
|
||||
const getSelectList = (corpusIds) => {
|
||||
|
||||
const getSelectList = async (funcIds) => {
|
||||
const res = await getDictList({
|
||||
dictType: 'ti_function_config'
|
||||
})
|
||||
if (res.code === 200) {
|
||||
const arr = []
|
||||
res.rows.forEach(row => {
|
||||
funcIds.forEach(id => {
|
||||
if (row.dictCode == id) {
|
||||
arr.push(row)
|
||||
}
|
||||
})
|
||||
})
|
||||
selectList.value = arr
|
||||
}
|
||||
};
|
||||
|
||||
const rowClick = (row) => {
|
||||
@ -167,10 +182,14 @@ const rowClick = (row) => {
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
if (props.corpusIds) {
|
||||
getSelectList(props.corpusIds.split(","));
|
||||
}
|
||||
});
|
||||
|
||||
watch(() => props.funcIds,
|
||||
() =>{
|
||||
getSelectList(props.funcIds.split(","));
|
||||
}, {
|
||||
immediate: true
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.btn-container {
|
||||
|
||||
@ -285,7 +285,7 @@ function handleAdd() {
|
||||
|
||||
const selectIds = ref([])
|
||||
const getSelectRows = (arr) => {
|
||||
selectIds.value = arr.map(item => item.id);
|
||||
selectIds.value = arr.map(item => item.dictCode);
|
||||
};
|
||||
|
||||
const formRef = ref()
|
||||
@ -296,9 +296,21 @@ const submitForm = () => {
|
||||
{
|
||||
...form.value,
|
||||
schemeId: new Date().getTime(),
|
||||
funcIds: selectIds.value.toString(),
|
||||
projectId: 1
|
||||
}
|
||||
)
|
||||
} else {
|
||||
let index = schemeList.value.findIndex(
|
||||
(item) => item.schemeId === form.value.schemeId
|
||||
);
|
||||
if (index !== -1) {
|
||||
schemeList.value[index] = {
|
||||
...form.value,
|
||||
hhh: 'ffff',
|
||||
funcIds: selectIds.value.toString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
reset();
|
||||
@ -309,7 +321,7 @@ const handleUpdate = (row) => {
|
||||
reset();
|
||||
open.value = true;
|
||||
isAdd.value = false
|
||||
title.value = "修改测试项目";
|
||||
title.value = "修改方案";
|
||||
form.value = row
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user