This commit is contained in:
2023-06-16 19:30:36 +08:00
parent 95bf839308
commit 57c772a913
7 changed files with 417 additions and 29 deletions

View File

@@ -34,9 +34,86 @@ const crudOptions = ref({
searchColNumber: 3,
tablePagination: true,
operationColumn: true,
scroll:{ x: '100%', y: '100%' },
scroll: { x: "100%", y: "100%" },
formOption: {
width: 1000
width: 1000,
layout: [
{
formType: "grid",
customClass: ["mt-0"],
cols: [
{ span: 12, formList: [{ dataIndex: "name" }] },
{ span: 12, formList: [{ dataIndex: "ident" }] }
]
},
{
formType: "grid",
customClass: ["ml-4"],
cols: [
{ span: 12, formList: [{ dataIndex: "status" }] },
{ span: 12, formList: [{ dataIndex: "closeMethod" }] }
]
},
{
formType: "grid",
customClass: ["ml-4"],
cols: [
{ span: 12, formList: [{ dataIndex: "grade" }] },
{ span: 12, formList: [{ dataIndex: "type" }] }
]
},
{
formType: "divider",
title: "问题详情"
},
{
dataIndex:"operation"
},
{
dataIndex:"expect"
},
{
dataIndex:"result"
},
{
dataIndex:"rules"
},
{
dataIndex:"suggest"
},
{
formType: "divider",
title: "人员信息"
},
{
formType: "grid",
cols: [
{ span: 12, formList: [{ dataIndex: "postPerson" }] },
{ span: 12, formList: [{ dataIndex: "postDate" }] }
]
},
{
formType: "grid",
cols: [
{ span: 12, formList: [{ dataIndex: "designerPerson" }] },
{ span: 12, formList: [{ dataIndex: "designDate" }] }
]
},
{
formType: "grid",
cols: [
{ span: 12, formList: [{ dataIndex: "verifyPerson" }] },
{ span: 12, formList: [{ dataIndex: "verifyDate" }] }
]
},
{
formType: "grid",
cols: [
{ span: 12, formList: [{ dataIndex: "revokePerson" }] },
{ span: 12, formList: [{ dataIndex: "revokeDate" }] }
]
},
]
}
})
const crudColumns = ref([
@@ -54,6 +131,7 @@ const crudColumns = ref([
width: 140,
search: true,
dataIndex: "ident",
addDefaultValue: `PT_${route.query.ident}_`,
commonRules: [{ required: true, message: "标识是必填" }],
validateTrigger: "blur"
},
@@ -108,9 +186,9 @@ const crudColumns = ref([
align: "center",
width: 150,
dataIndex: "closeMethod",
addDefaultValue: "2",
addDefaultValue: ["2"],
search: true,
formType: "radio",
formType: "checkbox",
dict: {
name: "closeMethod",
translation: true,
@@ -120,22 +198,34 @@ const crudColumns = ref([
// 判断是否具有1修改文档
if (!record.closeMethod.hasOwnProperty("0")) {
if (!record.closeMethod.hasOwnProperty("1")) {
return <a-tag size="small" bordered color="magenta">还未闭环</a-tag>
return (
<a-tag size="small" bordered color="magenta">
还未闭环
</a-tag>
)
}
}
const tagObj = []
for (let item in record.closeMethod) {
if (item === "0") {
tagObj.push(<a-tag size="small" bordered color="blue">修改文档</a-tag>)
tagObj.push(
<a-tag size="small" bordered color="blue">
修改文档
</a-tag>
)
} else if (item === "1") {
tagObj.push(<a-tag size="small" bordered color="green">修改程序</a-tag>)
tagObj.push(
<a-tag size="small" bordered color="green">
修改程序
</a-tag>
)
}
}
return <a-space size='mini'>{tagObj}</a-space>
return <a-space size="mini">{tagObj}</a-space>
}
},
{
title: "操作",
title: "问题操作",
hide: true,
search: true,
dataIndex: "operation",
@@ -152,6 +242,11 @@ const crudColumns = ref([
dataIndex: "result",
formType: "editor"
},
{
title: "违反规则",
hide: true,
dataIndex: "rules"
},
{
title: "修改建议",
hide: true,
@@ -166,24 +261,22 @@ const crudColumns = ref([
dict: { url: "system/user/index", translation: true, props: { label: "name", value: "name" } }
},
{
title:'提单日期',
title: "提单日期",
hide: true,
dataIndex:"postDate",
formType:'date'
dataIndex: "postDate",
formType: "date"
},
{
title: "设师上级",
title: "设师上级",
hide: true,
dataIndex: "designerPerson",
formType: "select",
commonRules: [{ required: true, message: "提单人必填" }],
dict: { url: "system/user/index", translation: true, props: { label: "name", value: "name" } }
},
{
title:'提单日期',
title: "提单日期",
hide: true,
dataIndex:"designDate",
formType:'date'
dataIndex: "designDate",
formType: "date"
},
{
title: "验证人",
@@ -194,10 +287,10 @@ const crudColumns = ref([
dict: { url: "system/user/index", translation: true, props: { label: "name", value: "name" } }
},
{
title:'验证日期',
title: "验证日期",
hide: true,
dataIndex:"verifyDate",
formType:'date'
dataIndex: "verifyDate",
formType: "date"
},
{
title: "撤销人",
@@ -208,11 +301,11 @@ const crudColumns = ref([
dict: { url: "system/user/index", translation: true, props: { label: "name", value: "name" } }
},
{
title:'撤销日期',
title: "撤销日期",
hide: true,
dataIndex:"revokeDate",
formType:'date'
},
dataIndex: "revokeDate",
formType: "date"
}
])
</script>

View File

@@ -0,0 +1,207 @@
<template>
<div class="description">
<div v-if="isProblemData">
<a-empty></a-empty>
</div>
<div v-else>
<a-alert title="提示">对平台有什么意见如修改操作和修改格式都可以提出</a-alert>
<a-tabs v-model:active-key="activeTab" class="atabs">
<a-tab-pane title="基本信息" key="basic_detail">
<a-row :gutter="24" class="flex items-center ml-0 pl-0">
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>问题单编号:</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph type="primary">
{{ props.data.ident }}
</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>问题名称:</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>
{{ props.data.name }}
</a-typography-paragraph>
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0">
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>问题状态:</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>
{{ problem_status }}
</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>闭环方式:</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>
<a-space size="mini">
<template v-if="problem_method.length > 0">
<template v-for="item of problem_method">
<a-tag :color="item === '修改文档' ? 'blue' : 'green'">{{ item }} </a-tag>
</template>
</template>
<template v-else>
<a-tag color="red">还未闭环</a-tag>
</template>
</a-space>
</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>缺陷等级:</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>
{{ problem_grade }}
</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>缺陷类型:</a-typography-paragraph>
</a-col>
<a-col :xs="12" :md="8" :xl="6">
<a-typography-paragraph>
{{ problem_type }}
</a-typography-paragraph>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane title="问题详情" key="problem_detail">
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 操作步骤 </a-col>
<a-col :xs="8" :md="16" :xl="12">
{{ props.data.operation }}
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 期望结果 </a-col>
<a-col :xs="8" :md="16" :xl="12">
{{ props.data.expect }}
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 问题结果 </a-col>
<a-col :xs="8" :md="16" :xl="12">
{{ props.data.result }}
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 违反规则 </a-col>
<a-col :xs="8" :md="16" :xl="12">
{{ props.data.rules }}
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 修改建议 </a-col>
<a-col :xs="8" :md="16" :xl="12">
{{ props.data.suggest }}
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane title="人员信息" key="person_detail">
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 提单人员 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.postPerson }}
</a-col>
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 提单时间 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.postDate }}
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 设计师上级 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.designerPerson }}
</a-col>
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 签署时间 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.designDate }}
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 验证人员 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.verifyPerson }}
</a-col>
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 签署时间 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.verifyDate }}
</a-col>
</a-row>
<a-row :gutter="24" class="flex items-center ml-0 pl-0 leading-10">
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 撤销人 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.revokePerson }}
</a-col>
<a-col :xs="12" :md="8" :xl="6" class="text-center"> 签署时间 </a-col>
<a-col :xs="12" :md="8" :xl="6">
{{ props.data.revokeDate }}
</a-col>
</a-row>
</a-tab-pane>
</a-tabs>
</div>
</div>
</template>
<script setup>
import { ref } from "vue"
import commonApi from "@/api/common"
const props = defineProps({
data: {
type: Object,
default: () => ({})
}
})
const isProblemData = ref(false)
// 当前tab栏
const activeTab = ref("basic_detail")
// 处理字典
const problem_status = ref("")
const problem_type = ref("")
const problem_grade = ref("")
const problem_method = ref([])
const getDict = async () => {
let problemStatu = await commonApi.getDict("problemStatu")
let problemType = await commonApi.getDict("problemType")
let problemGrade = await commonApi.getDict("problemGrade")
let closeMethod = await commonApi.getDict("closeMethod")
problemStatu.data.forEach((item) => {
if (item.key === props.data.status) {
problem_status.value = item.title
}
})
problemType.data.forEach((item) => {
if (item.key === props.data.type) {
problem_type.value = item.title
}
})
problemGrade.data.forEach((item) => {
if (item.key === props.data.grade) {
problem_grade.value = item.title
}
})
closeMethod.data.forEach((item) => {
for (let method in props.data.closeMethod) {
if (item.key == props.data.closeMethod[method]) {
problem_method.value.push(item.title)
}
}
})
}
getDict()
</script>
<style lang="less" scoped>
.description {
width: 1076px;
}
.atabs {
text-align: left;
padding-left: 5px;
}
</style>

View File

@@ -0,0 +1,53 @@
<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">
<a-spin :loading="loading" tip="正在加载中,请稍等...">
<template #icon>
<icon-sync />
</template>
<problemDescription :data="data"></problemDescription>
</a-spin>
</div>
</div>
</template>
<script setup>
import { ref } from "vue"
import problemDescription from "./cpns/problemDescription.vue"
import { useRoute } from "vue-router"
import singleProblemApi from "@/api/project/singleProblem"
import { Message } from "@arco-design/web-vue"
const route = useRoute()
const data = ref([])
const loading = ref(true)
const roundNumber = route.query.key.split("-")[0]
const designDemandNumber = route.query.key.split("-")[1]
const testDemandNumber = route.query.key.split("-")[2]
const caseNumber = route.query.key.split("-")[3]
const problemNumber = route.query.key.split("-")[4]
// 请求展示problem数据函数
const fetchProblemData = async (
params = {
projectId: route.query.id,
round: roundNumber,
designDemand: designDemandNumber,
testDemand: testDemandNumber,
case: caseNumber,
problem: problemNumber
}
) => {
loading.value = true
try {
const problemData = await singleProblemApi.getSingleProblem(params)
data.value = problemData.data // 是个对象
console.log(data.value);
} catch (e) {
Message.error("请求失败,请检测网络")
} finally {
loading.value = false
}
}
fetchProblemData()
</script>
<style lang="less" scoped></style>