2025-11-24 14:37:40 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<div ref="topContainerRef">
|
|
|
|
|
<TableSearch
|
|
|
|
|
:queryParams="queryParams"
|
|
|
|
|
:showSearch="showSearch"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
queryRef="queryRef"
|
|
|
|
|
@refresh="resetQuery"
|
|
|
|
|
@search="handleQuery"
|
|
|
|
|
>
|
2025-11-26 17:57:21 +08:00
|
|
|
<template #one>
|
|
|
|
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
|
|
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.projectName"
|
|
|
|
|
placeholder="请输入项目名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
|
|
|
|
<el-form-item label="测试人员" prop="tester">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.tester"
|
|
|
|
|
placeholder="请输入测试人员"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</template>
|
|
|
|
|
</TableSearch>
|
2025-11-24 14:37:40 +08:00
|
|
|
|
2025-11-26 17:57:21 +08:00
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="Plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-hasPermi="['system:project:add']"
|
|
|
|
|
>新增</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2025-11-24 14:37:40 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div :style="containerHeight">
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
height="100%"
|
|
|
|
|
:data="projectList"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
2025-11-26 17:57:21 +08:00
|
|
|
<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
|
|
|
|
|
/>
|
2025-11-24 14:37:40 +08:00
|
|
|
<el-table-column label="测试人员" align="center" prop="tester" />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="计划测试开始时间"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="planStart"
|
|
|
|
|
width="180"
|
|
|
|
|
>
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ parseTime(row.planStart) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2025-11-26 17:57:21 +08:00
|
|
|
<el-table-column
|
|
|
|
|
label="计划测试结束时间"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="planEnd"
|
|
|
|
|
width="180"
|
|
|
|
|
>
|
2025-11-24 14:37:40 +08:00
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ parseTime(row.planEnd) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2025-11-26 17:57:21 +08:00
|
|
|
<el-table-column
|
|
|
|
|
label="项目描述"
|
|
|
|
|
width="200"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
align="center"
|
|
|
|
|
prop="remark"
|
|
|
|
|
/>
|
2025-11-24 14:37:40 +08:00
|
|
|
<el-table-column label="项目状态" align="center" prop="status">
|
|
|
|
|
<template #default="{ row }">
|
2025-11-26 17:57:21 +08:00
|
|
|
{{ row.status == 0 ? "已执行" : "未执行" }}
|
2025-11-24 14:37:40 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2025-11-26 17:57:21 +08:00
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
align="center"
|
|
|
|
|
width="320px"
|
|
|
|
|
class-name="small-padding fixed-width"
|
|
|
|
|
fixed="right"
|
|
|
|
|
>
|
2025-11-24 14:37:40 +08:00
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="handleSetting(row)"
|
2025-11-26 17:57:21 +08:00
|
|
|
v-hasPermi="['system:project:add', 'system:project:edit']"
|
2025-11-24 14:37:40 +08:00
|
|
|
>配置方案
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="handleUpdate(row)"
|
|
|
|
|
v-hasPermi="['system:project:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="handleDelete(row)"
|
|
|
|
|
v-hasPermi="['system:project:remove']"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="title"
|
|
|
|
|
v-model="open"
|
|
|
|
|
width="740px"
|
|
|
|
|
:append-to-body="false"
|
|
|
|
|
body-class="testProject_dialog"
|
|
|
|
|
>
|
2025-11-26 10:32:41 +08:00
|
|
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
2025-11-26 17:57:21 +08:00
|
|
|
<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="请输入测试人员" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="计划开始时间" prop="planStart">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
clearable
|
|
|
|
|
v-model="form.planStart"
|
|
|
|
|
type="datetime"
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
placeholder="请选择计划测试开始时间"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="计划结束时间" prop="planEnd">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
clearable
|
|
|
|
|
v-model="form.planEnd"
|
|
|
|
|
type="datetime"
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
placeholder="请选择计划测试结束时间"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="排序" prop="sort">
|
|
|
|
|
<el-input-number v-model="form.sort" placeholder="排序" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="项目描述" prop="remark">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form.remark"
|
|
|
|
|
type="textarea"
|
|
|
|
|
placeholder="请输入项目描述"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2025-11-24 14:37:40 +08:00
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import TableSearch from "@/components/TableSearch/index.vue";
|
|
|
|
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
2025-11-26 17:57:21 +08:00
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
import { getTreeDataApi } from '@/api/is/func/index'
|
2025-11-24 14:37:40 +08:00
|
|
|
|
|
|
|
|
const topContainerRef = ref();
|
|
|
|
|
const containerHeight = useContainerHeight(topContainerRef);
|
|
|
|
|
|
|
|
|
|
const projectList = ref([]);
|
|
|
|
|
const open = ref(false);
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const showSearch = ref(true);
|
|
|
|
|
const ids = ref([]);
|
|
|
|
|
const single = ref(true);
|
|
|
|
|
const multiple = ref(true);
|
|
|
|
|
const total = ref(0);
|
|
|
|
|
const title = ref("");
|
|
|
|
|
|
|
|
|
|
const data = reactive({
|
2025-11-26 17:57:21 +08:00
|
|
|
form: {
|
2025-11-24 14:37:40 +08:00
|
|
|
projectName: null,
|
|
|
|
|
tester: null,
|
|
|
|
|
planStart: null,
|
2025-11-26 17:57:21 +08:00
|
|
|
vehicleConfigId: null,
|
2025-11-24 14:37:40 +08:00
|
|
|
planEnd: null,
|
2025-11-26 10:32:41 +08:00
|
|
|
sort: null,
|
|
|
|
|
remark: null,
|
2025-11-24 14:37:40 +08:00
|
|
|
status: null,
|
|
|
|
|
},
|
2025-11-26 17:57:21 +08:00
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
projectName: null,
|
|
|
|
|
},
|
2025-11-24 14:37:40 +08:00
|
|
|
rules: {
|
|
|
|
|
projectName: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
|
|
|
|
|
tester: [{ required: true, message: "请输入测试人员", trigger: "blur" }],
|
|
|
|
|
planStart: [{ required: true, message: "请输入计划测试开始时间", trigger: "blur" }],
|
2025-11-26 17:57:21 +08:00
|
|
|
planEnd: [{ required: true, message: "请输入计划测试结束时间", trigger: "blur" }],
|
|
|
|
|
vehicleConfigId: [{ required: true, message: "请选择车机版本", trigger: "blur" }],
|
2025-11-24 14:37:40 +08:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
|
2025-11-26 17:57:21 +08:00
|
|
|
const treeData = ref([])
|
|
|
|
|
|
|
|
|
|
const getTreeData = async () => {
|
|
|
|
|
const res = await getTreeDataApi()
|
|
|
|
|
if (res) {
|
|
|
|
|
treeData.value = res
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-24 14:37:40 +08:00
|
|
|
/** 查询语音交互-项目列表 */
|
|
|
|
|
function getList() {
|
|
|
|
|
projectList.value = [
|
|
|
|
|
{
|
2025-11-26 17:57:21 +08:00
|
|
|
projectId: "1",
|
|
|
|
|
projectName: "test1",
|
|
|
|
|
tester: "test",
|
|
|
|
|
planStart: "2025-11-24 11:08:01",
|
|
|
|
|
planEnd: "2025-11-25 11:08:01",
|
|
|
|
|
vehicleConfigId: '1',
|
2025-11-26 10:32:41 +08:00
|
|
|
sort: 1,
|
2025-11-26 17:57:21 +08:00
|
|
|
remark: "ssssss",
|
2025-11-26 10:32:41 +08:00
|
|
|
},
|
|
|
|
|
{
|
2025-11-26 17:57:21 +08:00
|
|
|
projectId: "2",
|
|
|
|
|
projectName: "test2",
|
|
|
|
|
tester: "test",
|
|
|
|
|
vehicleConfigId: '2',
|
|
|
|
|
planStart: "2025-11-23 11:08:01",
|
|
|
|
|
planEnd: "2025-11-25 11:08:01",
|
2025-11-26 10:32:41 +08:00
|
|
|
sort: 2,
|
2025-11-26 17:57:21 +08:00
|
|
|
remark: "ssssss",
|
2025-11-26 10:32:41 +08:00
|
|
|
},
|
|
|
|
|
{
|
2025-11-26 17:57:21 +08:00
|
|
|
projectId: "3",
|
|
|
|
|
projectName: "test3",
|
|
|
|
|
tester: "test",
|
|
|
|
|
vehicleConfigId: '3',
|
|
|
|
|
planStart: "2025-11-25 11:08:01",
|
|
|
|
|
planEnd: "2025-11-27 11:08:01",
|
2025-11-26 10:32:41 +08:00
|
|
|
sort: 3,
|
2025-11-26 17:57:21 +08:00
|
|
|
remark: "ssssss",
|
|
|
|
|
},
|
|
|
|
|
];
|
2025-11-24 14:37:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
function cancel() {
|
|
|
|
|
open.value = false;
|
|
|
|
|
reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 表单重置
|
|
|
|
|
function reset() {
|
|
|
|
|
form.value = {
|
|
|
|
|
projectId: null,
|
|
|
|
|
projectName: null,
|
|
|
|
|
tester: null,
|
|
|
|
|
planStart: null,
|
|
|
|
|
planEnd: null,
|
2025-11-26 17:57:21 +08:00
|
|
|
vehicleConfigId: null,
|
2025-11-26 10:32:41 +08:00
|
|
|
sort: null,
|
2025-11-24 14:37:40 +08:00
|
|
|
remark: null,
|
2025-11-26 17:57:21 +08:00
|
|
|
status: null,
|
2025-11-24 14:37:40 +08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
function handleQuery() {
|
|
|
|
|
queryParams.value.pageNum = 1;
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
function resetQuery() {
|
|
|
|
|
handleQuery();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
function handleSelectionChange(selection) {
|
|
|
|
|
ids.value = selection.map((item) => item.projectId);
|
|
|
|
|
single.value = selection.length != 1;
|
|
|
|
|
multiple.value = !selection.length;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-26 17:57:21 +08:00
|
|
|
const isAdd = ref(false);
|
2025-11-24 14:37:40 +08:00
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
function handleAdd() {
|
|
|
|
|
reset();
|
|
|
|
|
open.value = true;
|
2025-11-26 17:57:21 +08:00
|
|
|
isAdd.value = true;
|
2025-11-24 14:37:40 +08:00
|
|
|
title.value = "添加测试项目";
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-26 17:57:21 +08:00
|
|
|
const router = useRouter();
|
2025-11-24 14:37:40 +08:00
|
|
|
const handleSetting = (row) => {
|
2025-11-26 17:57:21 +08:00
|
|
|
router.push("/is/plan/index/" + row.projectId);
|
|
|
|
|
};
|
2025-11-24 14:37:40 +08:00
|
|
|
|
2025-11-26 17:57:21 +08:00
|
|
|
const formRef = ref();
|
2025-11-26 10:32:41 +08:00
|
|
|
const submitForm = () => {
|
2025-11-26 17:57:21 +08:00
|
|
|
if (!formRef.value) return;
|
2025-11-24 14:37:40 +08:00
|
|
|
|
2025-11-26 10:32:41 +08:00
|
|
|
formRef.value.validate((valid) => {
|
2025-11-26 17:57:21 +08:00
|
|
|
if (!valid) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-11-26 10:32:41 +08:00
|
|
|
if (isAdd.value) {
|
|
|
|
|
projectList.value.unshift({
|
|
|
|
|
...form.value,
|
2025-11-26 17:57:21 +08:00
|
|
|
projectId: new Date().getTime(),
|
|
|
|
|
});
|
2025-11-26 10:32:41 +08:00
|
|
|
} else {
|
2025-11-26 17:57:21 +08:00
|
|
|
let itemToUpdate = projectList.value.find(
|
|
|
|
|
(item) => item.projectId === form.value.projectId
|
|
|
|
|
);
|
2025-11-26 10:32:41 +08:00
|
|
|
if (itemToUpdate) {
|
2025-11-26 17:57:21 +08:00
|
|
|
itemToUpdate = { ...form.value };
|
2025-11-26 10:32:41 +08:00
|
|
|
}
|
|
|
|
|
}
|
2025-11-26 17:57:21 +08:00
|
|
|
open.value = false;
|
2025-11-26 10:32:41 +08:00
|
|
|
reset();
|
2025-11-26 17:57:21 +08:00
|
|
|
});
|
|
|
|
|
};
|
2025-11-24 14:37:40 +08:00
|
|
|
|
2025-11-26 10:32:41 +08:00
|
|
|
const handleUpdate = (row) => {
|
|
|
|
|
reset();
|
|
|
|
|
open.value = true;
|
2025-11-26 17:57:21 +08:00
|
|
|
isAdd.value = false;
|
2025-11-26 10:32:41 +08:00
|
|
|
title.value = "修改测试项目";
|
2025-11-26 17:57:21 +08:00
|
|
|
form.value = row;
|
|
|
|
|
};
|
2025-11-26 10:32:41 +08:00
|
|
|
|
|
|
|
|
const handleDelete = (row) => {
|
2025-11-26 17:57:21 +08:00
|
|
|
ElMessageBox.confirm(`确定要删除项目"${row.projectName}"吗?`, "警告", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
}).then(async () => {
|
|
|
|
|
projectList.value = projectList.value.filter(
|
|
|
|
|
(item) => item.projectId !== row.projectId
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
};
|
2025-11-24 14:37:40 +08:00
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getList();
|
2025-11-26 17:57:21 +08:00
|
|
|
getTreeData()
|
|
|
|
|
});
|
2025-11-24 14:37:40 +08:00
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
:deep() {
|
|
|
|
|
.testProject_dialog {
|
|
|
|
|
.el-date-editor {
|
|
|
|
|
--el-date-editor-width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-input-number {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-26 17:57:21 +08:00
|
|
|
.form-title {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
margin-bottom: 10px;
|
2025-11-24 14:37:40 +08:00
|
|
|
|
2025-11-26 17:57:21 +08:00
|
|
|
&::before {
|
|
|
|
|
content: "";
|
|
|
|
|
width: 4px;
|
|
|
|
|
height: 16px;
|
|
|
|
|
background: blue;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin-right: 8px;
|
2025-11-24 14:37:40 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-scrollbar__view {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|