This commit is contained in:
2024-06-13 19:41:57 +08:00
parent b8df6f3403
commit b6f56fe5d8
31 changed files with 691 additions and 273 deletions

View File

@@ -0,0 +1,105 @@
<template>
<div class="round-info-container">
<div class="ma-content-block rounded-sm flex-column justify-between w-full p-3 bg-color">
<div class="title">{{ props.data.name }}信息</div>
<div class="info-list">
<a-list :gridProps="{ gutter: 0, span: 6 }" class="list-container">
<template #header><div class="header">设计需求下面测试项/用例统计信息</div></template>
<a-list-item v-for="(item, index) in props.data.desings" :key="index">
<a-list-item-meta class="meta" :title="`${item.name}`"></a-list-item-meta>
<div class="item-count">
测试项数 : <span class="count">{{ item.demand_count }}</span>
</div>
<div class="item-count">
用例数 : <span class="count">{{ item.case_count }}</span>
</div>
</a-list-item>
</a-list>
<a-list class="list-container">
<template #header><div class="header">测试类型统计信息</div></template>
<a-table
:bordered="false"
:data="resolveData"
:columns="columns"
size="small"
:pagination="false"
></a-table>
</a-list>
</div>
</div>
</div>
</template>
<script setup>
import { computed } from "vue"
import columns from "./tableColumn.js"
const props = defineProps({
data: {
type: Object,
required: true
}
})
const resolveData = computed(() => {
let resData = []
let res = props.data.method_demand
Object.keys(res).forEach((key) => {
const value = res[key]
resData.push({
name: key,
demand_count: value,
case_count: 0
})
})
let res2 = props.data.method_case
Object.keys(res2).forEach((key) => {
const value = res2[key]
resData.forEach((item) => {
if (item.name === key) {
item.case_count = value
}
})
})
return resData
})
</script>
<style lang="less" scoped>
.round-info-container {
width: 100%;
height: 100%;
}
.title {
margin: 10px;
font-weight: 700;
font-size: 1rem;
}
.count {
font-weight: 700;
}
.meta {
font-size: 15px;
width: 80%;
border-bottom: 1px dashed var(--color-text-4);
margin-bottom: 2px;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
}
.list-container {
transition: all 0.3s;
&:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
}
.info-list {
display: flex;
flex-direction: column;
gap: 5px;
}
.header {
font-size: 14px;
font-weight: 700;
color: var(--color-text-3);
}
</style>

View File

@@ -0,0 +1,67 @@
<template>
<div class="time-line-container">
<div class="ma-content-block rounded-sm flex-column justify-between w-full p-3 bg-color">
<div class="title">填写的项目时间轴</div>
<a-timeline direction="horizontal" class="timeline" mode="alternate">
<a-timeline-item :label="pInfo.time_line.start_time">
<a-row :style="{ display: 'inline-flex', alignItems: 'center' }">
<div>开始时间</div>
</a-row>
</a-timeline-item>
<a-timeline-item
v-for="(item, index) in pInfo.time_line.round_time"
:key="index"
:label="`结束时间 : ${item.end}`"
>
<a-col>
<div>{{ item.name }}</div>
<div class="a-col-title">开始时间 : {{ item.start }}</div>
</a-col>
</a-timeline-item>
<a-timeline-item :label="pInfo.time_line.end_time">
<a-row :style="{ display: 'inline-flex', alignItems: 'center' }">
<div>结束时间</div>
</a-row>
</a-timeline-item>
<div class="info">
<a-alert>测试人员填写的项目开始时间结束时间轮次时间均会影响生成文档的时间!</a-alert>
</div>
</a-timeline>
</div>
</div>
</template>
<script setup>
// 1.定义props
const props = defineProps({
pInfo: {
type: Object,
required: true
}
})
</script>
<style lang="less" scoped>
.title {
margin: 10px;
font-weight: 700;
font-size: 1rem;
}
.timeline {
position: relative;
padding: 50px;
width: 100%;
.info {
width: 180px;
position: absolute;
right: 30px;
top: 1rem;
}
}
.a-col-title {
font-size: 12px;
margin-bottom: -5px;
margin-top: 5px;
color: var(--color-text-3);
}
</style>

View File

@@ -0,0 +1,89 @@
<template>
<div class="title-container">
<div class="ma-content-block rounded-sm flex-col justify-between w-full p-3 bg-color">
<a-page-header
@back="handleBackClick"
:style="{ background: 'var(--color-bg-2)' }"
:title="props.pInfo.ident"
>
<template #subtitle>
<a-space>
<span>{{ props.pInfo.name }}</span>
<a-tag color="red" size="small">{{ props.pInfo.step }}</a-tag>
</a-space>
</template>
</a-page-header>
<div class="title">基本信息</div>
<div class="item-container">
<a-card
class="item"
v-for="(val, key) in pInfo.title_info"
:style="{ width: '360px' }"
:title="key"
:key="key"
hoverable
>
<ul class="li-container">
<li v-for="(v, k) in val" :key="k">
<div class="key">{{ k }}:</div>
<div class="value">{{ v }}</div>
</li>
</ul>
</a-card>
</div>
</div>
</div>
</template>
<script setup>
import { useRoute, useRouter } from "vue-router"
const router = useRouter()
// 1.头部-点击返回
const handleBackClick = () => {
router.go(-1)
}
// 2.定义props
const props = defineProps({
pInfo: {
type: Object,
required: true
}
})
</script>
<style lang="less" scoped>
:deep(.arco-page-header-main) {
align-items: center;
}
.item-container {
display: flex;
align-items: center;
justify-content: space-around;
.item {
height: 11rem;
.li-container {
display: flex;
flex-direction: column;
gap: 5px;
li {
display: flex;
line-height: 1.5;
gap: 5px;
.value {
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
font-weight: 700;
}
}
}
}
}
.title {
margin: 10px;
font-weight: 700;
font-size: 1rem;
}
</style>

View File

@@ -0,0 +1,18 @@
export default [
{
title: "测试类型",
dataIndex: "name",
ellipsis: true,
align: "center"
},
{
title: "测试项数量",
dataIndex: "demand_count",
align: "center"
},
{
title: "用例数量",
dataIndex: "case_count",
align: "center"
}
]

View File

@@ -0,0 +1,33 @@
<template>
<div class="proj-board-container" v-loading="isDataLoading">
<a-layout-content class="flex flex-col gap-2" v-if="!isDataLoading">
<!-- 返回前面一页的按钮以及项目整体情况 -->
<Title :pInfo="loadingData"></Title>
<!-- 时间线显示项目情况 -->
<time-line :pInfo="loadingData"></time-line>
<!-- 以轮次为合集展示需求下面的测试项数用例数测试类型下面测试项和用例数量 -->
<round-info v-for="item in loadingData.statistics" :data="item"></round-info>
</a-layout-content>
</div>
</template>
<script setup>
import Title from "./cpns/Title.vue"
import TimeLine from "./cpns/TimeLine.vue"
import projectApi from "@/api/project/project"
import { useRoute } from "vue-router"
import RoundInfo from "./cpns/RoundInfo.vue"
const route = useRoute()
// hooks
import useFetchData from "@/hooks/fetchData"
const fetchData = async () => {
return projectApi.getBoardInfo(route.params.projectId)
}
const { loadingData, isDataLoading } = useFetchData({}, fetchData)
</script>
<style lang="less" scoped>
:deep(.ma-content-block) {
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
</style>

View File

@@ -2,7 +2,13 @@
<!-- 描述列表组件 -->
<a-modal width="1000px" v-model:visible="visible" :footer="false">
<template #title>项目名称{{ previewRecord.name }}</template>
<ma-info :columns="props.columns" :data="previewRecord" :column="1" size="mini"></ma-info>
<ma-info
class="my-custom-class"
:columns="props.columns"
:data="previewRecord"
:column="1"
size="mini"
></ma-info>
</a-modal>
</template>
@@ -26,4 +32,13 @@ defineExpose({ open })
// MA-INFO的columns
</script>
<style lang="less" scoped></style>
<style lang="less" scoped>
.my-custom-class {
:deep(.arco-space-horizontal) {
flex-wrap: wrap;
}
:deep(.arco-space-item){
margin-bottom: 2px;
}
}
</style>

View File

@@ -93,6 +93,7 @@
工作区
</a-button>
<a-link @click="previewRef.open(record)"><icon-eye />预览</a-link>
<a-link @click="handleBoardClick(record)"><icon-dashboard />项目看板</a-link>
</template>
</ma-crud>
</div>
@@ -328,6 +329,15 @@ const createWtdItem = async (record) => {
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 1.跳转到项目看板页面
const handleBoardClick = (record) => {
router.push({
name: "projBoard",
params: {
projectId: record.id
}
})
}
// CRUD-OPTIONS
const crudRef = ref()
@@ -343,7 +353,7 @@ const crudOptions = ref({
operationWidth: 500,
showIndex: false,
showTools: false,
operationColumnWidth: 220, // 操作列宽度
operationColumnWidth: 280, // 操作列宽度
operationColumnAlign: "center", // 操作列对齐方式
// 处理弹窗的title
beforeOpenAdd: function () {
@@ -386,30 +396,27 @@ const crudOptions = ref({
{ span: 12, formList: [{ dataIndex: "member" }] },
{ span: 6, formList: [{ dataIndex: "soft_type" }] },
{ span: 6, formList: [{ dataIndex: "devplant" }] },
{ span: 24, formList: [{ dataIndex: "abbreviation" }] },
{ span: 8, formList: [{ dataIndex: "quality_person" }] },
{ span: 8, formList: [{ dataIndex: "vise_person" }] },
{ span: 8, formList: [{ dataIndex: "config_person" }] }
{ span: 6, formList: [{ dataIndex: "abbreviation" }] },
{ span: 6, formList: [{ dataIndex: "quality_person" }] },
{ span: 6, formList: [{ dataIndex: "vise_person" }] },
{ span: 6, formList: [{ dataIndex: "config_person" }] }
]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "security_level" }] }]
},
{
formType: "grid",
cols: [
{ span: 12, formList: [{ dataIndex: "test_level" }] },
{ span: 6, formList: [{ dataIndex: "security_level" }] },
{ span: 6, formList: [{ dataIndex: "language" }] },
{ span: 12, formList: [{ dataIndex: "plant_type" }] }
]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "report_type" }] }]
cols: [{ span: 24, formList: [{ dataIndex: "test_level" }] }]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "language" }] }]
cols: [{ span: 24, formList: [{ dataIndex: "report_type" }] }]
},
{
formType: "grid",
@@ -484,6 +491,7 @@ const crudColumns = ref([
},
{
title: "项目名称",
width: 110,
dataIndex: "name",
search: true,
commonRules: [{ required: true, message: "名称是必填" }]
@@ -491,7 +499,7 @@ const crudColumns = ref([
{ title: "工程型号", dataIndex: "engin_model", hide: true },
{ title: "分系统", dataIndex: "section_system", hide: true },
{ title: "子系统", dataIndex: "sub_system", hide: true },
{ title: "设备", dataIndex: "device", hide: true },
{ title: "设备名称", dataIndex: "device", hide: true },
{
title: "开始日期",
dataIndex: "beginTime",
@@ -502,7 +510,7 @@ const crudColumns = ref([
title: "结束时间",
dataIndex: "endTime",
formType: "date",
extra: "注意:开始时间和结束时间影响大纲、报告多个时间,谨慎填写",
extra: "注意:结束时间需要晚于最后一轮结束时间",
commonRules: [
{
required: true,
@@ -626,7 +634,7 @@ const crudColumns = ref([
title: "测试级别",
dataIndex: "test_level",
commonRules: [{ required: true, message: "请至少选择一个测试级别" }],
addDefaultValue: ["6"],
addDefaultValue: ["4"],
hide: true,
formType: "checkbox",
dict: { name: "test_level", props: { label: "title", value: "key" } }
@@ -643,7 +651,7 @@ const crudColumns = ref([
{
title: "报告类型",
dataIndex: "report_type",
addDefaultValue: "1",
addDefaultValue: "9",
search: true,
commonRules: [{ required: true, message: "报告类型必填" }],
// 字典-report_type
@@ -656,16 +664,18 @@ const crudColumns = ref([
addDefaultValue: ["1"],
commonRules: [{ required: true, message: "请至少选择一个" }],
hide: true,
formType: "checkbox",
formType: "select",
multiple: true,
dict: { name: "language", props: { label: "title", value: "key" } }
},
{
title: "依据标准",
dataIndex: "standard",
addDefaultValue: ["1"],
addDefaultValue: ["1", "2", "3", "4", "9"],
commonRules: [{ required: true, message: "请至少选择一个" }],
hide: true,
formType: "checkbox",
multiple: true,
formType: "select",
dict: { name: "standard", props: { label: "title", value: "key" } }
},
{
@@ -681,21 +691,27 @@ const crudColumns = ref([
title: "联系人",
dataIndex: "entrust_contact",
hide: true,
rules: [{ required: true, message: "联系人必填" }]
commonRules: [{ required: true, message: "联系人必填" }]
},
{
formType: "input",
title: "联系电话",
maxLength: 11,
dataIndex: "entrust_contact_phone",
hide: true,
rules: [{ required: true, message: "联系电话必填" }]
commonRules: [
{ required: true, message: "联系电话必填" },
{
match: /^1[3456789]\d{9}$/,
message: "电话号码格式错误"
}
]
},
{
formType: "input",
title: "电子邮箱",
dataIndex: "entrust_email",
hide: true,
rules: [{ required: true, message: "电子邮箱必填" }]
hide: true
},
{
title: "单位",
@@ -710,21 +726,27 @@ const crudColumns = ref([
title: "联系人",
dataIndex: "dev_contact",
hide: true,
rules: [{ required: true, message: "联系人必填" }]
commonRules: [{ required: true, message: "联系人必填" }]
},
{
formType: "input",
title: "联系电话",
maxLength: 11,
dataIndex: "dev_contact_phone",
hide: true,
rules: [{ required: true, message: "联系电话必填" }]
commonRules: [
{ required: true, message: "联系电话必填" },
{
match: /^1[3456789]\d{9}$/,
message: "电话号码格式错误"
}
]
},
{
formType: "input",
title: "电子邮箱",
dataIndex: "dev_email",
hide: true,
rules: [{ required: true, message: "电子邮箱必填" }]
hide: true
},
{
title: "单位",
@@ -739,21 +761,27 @@ const crudColumns = ref([
title: "联系人",
dataIndex: "test_contact",
hide: true,
rules: [{ required: true, message: "联系人必填" }]
commonRules: [{ required: true, message: "联系人必填" }]
},
{
formType: "input",
title: "联系电话",
dataIndex: "test_contact_phone",
hide: true,
rules: [{ required: true, message: "联系电话必填" }]
maxLength: 11,
commonRules: [
{ required: true, message: "联系电话必填" },
{
match: /^1[3456789]\d{9}$/,
message: "电话号码格式错误"
}
]
},
{
formType: "input",
title: "电子邮箱",
dataIndex: "test_email",
hide: true,
rules: [{ required: true, message: "电子邮箱必填" }]
hide: true
},
{
title: "状态",