2023-06-15 20:13:46 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="ma-content-block lg:flex justify-between p-4">
|
|
|
|
|
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
|
|
|
|
|
<!-- CRUD组件 -->
|
|
|
|
|
<ma-crud :options="crudOptions" :columns="crudColumns"></ma-crud>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref } from "vue"
|
|
|
|
|
import { useRoute, useRouter } from "vue-router"
|
2023-06-19 19:51:12 +08:00
|
|
|
import dutApi from "@/api/project/dut"
|
2023-06-15 20:13:46 +08:00
|
|
|
const route = useRoute()
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
|
|
// crud组件
|
|
|
|
|
const crudOptions = ref({
|
2023-06-19 19:51:12 +08:00
|
|
|
api: dutApi.getDutList,
|
2023-06-15 20:13:46 +08:00
|
|
|
parameters: {
|
|
|
|
|
projectId: route.query.id,
|
|
|
|
|
round: route.query.key
|
|
|
|
|
},
|
|
|
|
|
showIndex: false,
|
|
|
|
|
rowSelection: { showCheckedAll: true },
|
|
|
|
|
add: { show: true },
|
|
|
|
|
edit: { show: true },
|
|
|
|
|
delete: { show: true },
|
|
|
|
|
searchColNumber: 3,
|
|
|
|
|
tablePagination: true,
|
|
|
|
|
operationColumn: true,
|
|
|
|
|
formOption: {
|
2023-06-19 19:51:12 +08:00
|
|
|
width: 500
|
2023-06-15 20:13:46 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const crudColumns = ref([
|
|
|
|
|
{
|
|
|
|
|
title: "ID",
|
|
|
|
|
width: 50,
|
2023-06-19 19:51:12 +08:00
|
|
|
align:'center',
|
2023-06-15 20:13:46 +08:00
|
|
|
dataIndex: "id",
|
|
|
|
|
search: true,
|
|
|
|
|
commonRules: [{ required: true, message: "标识是必填" }],
|
|
|
|
|
validateTrigger: "blur"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "标识",
|
2023-06-19 19:51:12 +08:00
|
|
|
width: 150,
|
|
|
|
|
align:'center',
|
2023-06-15 20:13:46 +08:00
|
|
|
dataIndex: "ident",
|
|
|
|
|
search: true,
|
|
|
|
|
commonRules: [{ required: true, message: "标识是必填" }],
|
|
|
|
|
validateTrigger: "blur"
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-06-19 19:51:12 +08:00
|
|
|
title: "被测件名",
|
|
|
|
|
width: 120,
|
2023-06-15 20:13:46 +08:00
|
|
|
dataIndex: "name",
|
|
|
|
|
search: true,
|
|
|
|
|
commonRules: [{ required: true, message: "需求名称是必填" }],
|
|
|
|
|
validateTrigger: "blur"
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-06-19 19:51:12 +08:00
|
|
|
title:"空行",
|
|
|
|
|
hide:true,
|
|
|
|
|
align:'center',
|
|
|
|
|
dataIndex:"black_line"
|
2023-06-15 20:13:46 +08:00
|
|
|
},
|
|
|
|
|
{
|
2023-06-19 19:51:12 +08:00
|
|
|
title:"纯注释",
|
|
|
|
|
hide:true,
|
|
|
|
|
align:'center',
|
|
|
|
|
dataIndex:"pure_code_line"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:"混合行",
|
|
|
|
|
hide:true,
|
|
|
|
|
align:'center',
|
|
|
|
|
dataIndex:"mix_line"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:"总注释",
|
|
|
|
|
hide:true,
|
|
|
|
|
align:'center',
|
|
|
|
|
dataIndex:"total_comment_line"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:"总代码",
|
|
|
|
|
align:'center',
|
|
|
|
|
dataIndex:"total_code_line"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:"总行数",
|
|
|
|
|
align:'center',
|
|
|
|
|
dataIndex:"total_line"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:"注释率",
|
|
|
|
|
align:'center',
|
|
|
|
|
dataIndex:"comment_line",
|
|
|
|
|
commonRules: [{ required: true, message: "注释率必填" }],
|
|
|
|
|
},
|
2023-06-15 20:13:46 +08:00
|
|
|
])
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped></style>
|