添加关联问题单功能
This commit is contained in:
14
cdTMP/src/api/generate/jlGenerate.js
Normal file
14
cdTMP/src/api/generate/jlGenerate.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { request } from "@/api/request"
|
||||||
|
export default {
|
||||||
|
/**
|
||||||
|
* 生成测试用例记录那一堆表格
|
||||||
|
* @returns Promise(message)
|
||||||
|
*/
|
||||||
|
createJLcaserecord(params = {}) {
|
||||||
|
return request({
|
||||||
|
url: `/generateJL/create/caserecord`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,4 +45,38 @@ export default {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/* 预览问题单/关联问题单的请求table接口 */
|
||||||
|
/**
|
||||||
|
* 关联问题单界面-查询所有的问题单
|
||||||
|
* @returns 一个项目的所有问题单(分页)
|
||||||
|
*/
|
||||||
|
searchAllProblem(params = {}) {
|
||||||
|
return request({
|
||||||
|
url: "/project/problem/searchAllProblem",
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 单独去掉dut、designDemand、test等等的更新请求
|
||||||
|
* @returns 去掉各种id只留projectId请求后端的接口
|
||||||
|
*/
|
||||||
|
modalupdate(id, data = {}) {
|
||||||
|
return request({
|
||||||
|
url: "/project/problem/modalupdate/" + id,
|
||||||
|
method: "put",
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 1.case信息 2.问题单的id 3.现在的值是什么
|
||||||
|
* @returns 让case关联问题单
|
||||||
|
*/
|
||||||
|
relateProblem(params = {}) {
|
||||||
|
return request({
|
||||||
|
url: "/project/problem/relateProblem",
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,19 +71,4 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 根据项目名、树节点等级和key查找问题单
|
|
||||||
* @returns 返回问题单problem
|
|
||||||
*/
|
|
||||||
getProblemInfo(projectId, key, level) {
|
|
||||||
return request({
|
|
||||||
url: `project/getProblemInfo`,
|
|
||||||
method: "get",
|
|
||||||
params: {
|
|
||||||
projectId: projectId,
|
|
||||||
key: key,
|
|
||||||
level: level
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
<!--
|
|
||||||
- MineAdmin is committed to providing solutions for quickly building web applications
|
|
||||||
- Please view the LICENSE file that was distributed with this source code,
|
|
||||||
- For the full copyright and license information.
|
|
||||||
- Thank you very much for using MineAdmin.
|
|
||||||
-
|
|
||||||
- @Author X.Mo<root@imoi.cn>
|
|
||||||
- @Link https://gitee.com/xmo/mineadmin-vue
|
|
||||||
-->
|
|
||||||
<template>
|
<template>
|
||||||
<ma-form-item
|
<ma-form-item
|
||||||
v-if="typeof props.component.display == 'undefined' || props.component.display === true"
|
v-if="typeof props.component.display == 'undefined' || props.component.display === true"
|
||||||
|
|||||||
@@ -218,14 +218,6 @@ const pointNode = (value, data) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (data.node.level == "4") {
|
|
||||||
projectApi.getProblemInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
|
||||||
data.node.children = res.data
|
|
||||||
if (!expandedKeys.value.includes(value[0])) {
|
|
||||||
expandedKeys.value.push(value[0])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
count = 0
|
count = 0
|
||||||
clearTimeout(timerId)
|
clearTimeout(timerId)
|
||||||
timerId = null
|
timerId = null
|
||||||
@@ -246,9 +238,9 @@ const pointNode = (value, data) => {
|
|||||||
if (data.node.level === "4") {
|
if (data.node.level === "4") {
|
||||||
router.push({ name: "case", query: { ...projectInfo.value, key: data.node.key } })
|
router.push({ name: "case", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
}
|
}
|
||||||
if (data.node.level === "5") {
|
// if (data.node.level === "5") {
|
||||||
router.push({ name: "problem", query: { ...projectInfo.value, key: data.node.key } })
|
// router.push({ name: "problem", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
}
|
// }
|
||||||
treeDataStore.setCurrentNode(data.node.key)
|
treeDataStore.setCurrentNode(data.node.key)
|
||||||
// 单击设置选择的key
|
// 单击设置选择的key
|
||||||
selectedKeys.value = catch_selected_key
|
selectedKeys.value = catch_selected_key
|
||||||
@@ -291,13 +283,6 @@ const loadMore = (nodeData) => {
|
|||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (nodeData.level == "4") {
|
|
||||||
return new Promise(async (resolve) => {
|
|
||||||
const res = await projectApi.getProblemInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
|
||||||
nodeData.children = res.data
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~~~~ 表单弹窗组件功能
|
//~~~~ 表单弹窗组件功能
|
||||||
|
|||||||
@@ -75,20 +75,6 @@ const useTreeDataStore = defineStore("treeDataStore", {
|
|||||||
const res = await projectApi.getCaseInfo(projrctId, nodeKey, "3")
|
const res = await projectApi.getCaseInfo(projrctId, nodeKey, "3")
|
||||||
this.treeData[roundKey].children[dutKey].children[designKey].children[testKey].children = res.data
|
this.treeData[roundKey].children[dutKey].children[designKey].children[testKey].children = res.data
|
||||||
},
|
},
|
||||||
// 新增删除problem后tree显示
|
|
||||||
async updateProblemTreeData(data, projrctId) {
|
|
||||||
let temp = data.key.split("-")
|
|
||||||
temp.pop(-1)
|
|
||||||
let roundKey = temp[0]
|
|
||||||
let dutKey = temp[1]
|
|
||||||
let designKey = temp[2]
|
|
||||||
let testKey = temp[3]
|
|
||||||
let caseKey = temp[4]
|
|
||||||
const nodeKey = temp.join("-")
|
|
||||||
const res = await projectApi.getProblemInfo(projrctId, nodeKey, "4")
|
|
||||||
this.treeData[roundKey].children[dutKey].children[designKey].children[testKey].children[caseKey].children =
|
|
||||||
res.data
|
|
||||||
},
|
|
||||||
setCurrentNode(nodeKey) {
|
setCurrentNode(nodeKey) {
|
||||||
this.currentNode = nodeKey
|
this.currentNode = nodeKey
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ const columns = ref([
|
|||||||
addDefaultValue: "1",
|
addDefaultValue: "1",
|
||||||
formType: "radio",
|
formType: "radio",
|
||||||
dict: { name: "data_status", props: { label: "title", value: "key" } },
|
dict: { name: "data_status", props: { label: "title", value: "key" } },
|
||||||
addDefaultValue: "1",
|
|
||||||
width: 70
|
width: 70
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
388
cdTMP/src/views/project/case/components/ProblemChoose.vue
Normal file
388
cdTMP/src/views/project/case/components/ProblemChoose.vue
Normal file
@@ -0,0 +1,388 @@
|
|||||||
|
<template>
|
||||||
|
<a-modal v-model:visible="visible" width="1200px" :footer="false">
|
||||||
|
<template #title>关联添加问题单</template>
|
||||||
|
<!-- crud组件 -->
|
||||||
|
<div class="lg:w-full w-full">
|
||||||
|
<ma-crud :options="crudOptions" :columns="columns" ref="crudRef">
|
||||||
|
<!-- 自定义字段名为 related 的插槽 -->
|
||||||
|
<!-- record 当前数据行的数据、column 当前列信息、rowIndex 当前数据行索引 -->
|
||||||
|
<template #related="{ record }">
|
||||||
|
<a-switch
|
||||||
|
v-model="record.related"
|
||||||
|
@change="handleRelatedChange(record)"
|
||||||
|
type="round"
|
||||||
|
checked-color="green"
|
||||||
|
unchecked-color="#F53F3F"
|
||||||
|
:loading="loading"
|
||||||
|
>
|
||||||
|
<template #checked> 已关联 </template>
|
||||||
|
<template #unchecked> 未关联 </template>
|
||||||
|
</a-switch>
|
||||||
|
</template>
|
||||||
|
</ma-crud>
|
||||||
|
</div>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="jsx">
|
||||||
|
import { ref } from "vue"
|
||||||
|
import problemApi from "@/api/project/problem"
|
||||||
|
import { Message } from "@arco-design/web-vue"
|
||||||
|
import { useRoute, useRouter } from "vue-router"
|
||||||
|
const route = useRoute()
|
||||||
|
// 定义emits
|
||||||
|
const emits = defineEmits(["deleted"])
|
||||||
|
|
||||||
|
// ~~~定义关联的switch-值改变处理~~~ 该函数返回false或返回Promise[reject]则停止切换
|
||||||
|
/// 定义个switch的加载loading属性
|
||||||
|
const loading = ref(false)
|
||||||
|
const handleRelatedChange = async (record) => {
|
||||||
|
// 因为switch绑定了record.related所以可以动态改变
|
||||||
|
loading.value = true
|
||||||
|
const res = await problemApi
|
||||||
|
.relateProblem({
|
||||||
|
case_key: route.query.key,
|
||||||
|
problem_id: record.id,
|
||||||
|
val: record.related
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
// 如果出错则保持不变
|
||||||
|
record.related = !record.related
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
if (!res.data.isOK) {
|
||||||
|
// 后台说没关联成功则保持不变
|
||||||
|
record.related = !record.related
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
loading.value = false
|
||||||
|
Message.success(res.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据定义
|
||||||
|
const crudRef = ref()
|
||||||
|
const visible = ref(false)
|
||||||
|
|
||||||
|
// 定义open事件
|
||||||
|
const open = (row) => {
|
||||||
|
crudRef.value.requestData() // 手动请求数据
|
||||||
|
visible.value = true
|
||||||
|
}
|
||||||
|
// crudOptions设置
|
||||||
|
const crudOptions = ref({
|
||||||
|
autoRequest: false, // 取消自己请求数据,后续自己调用方法请求
|
||||||
|
api: problemApi.searchAllProblem, // 请求数据的API
|
||||||
|
showIndex: false,
|
||||||
|
rowSelection: { showCheckedAll: true },
|
||||||
|
operationWidth: 160,
|
||||||
|
operationColumnAlign: "center",
|
||||||
|
edit: { show: true, api: problemApi.modalupdate },
|
||||||
|
delete: { show: true, api: problemApi.delete },
|
||||||
|
parameters: {
|
||||||
|
projectId: route.query.id,
|
||||||
|
key: route.query.key
|
||||||
|
},
|
||||||
|
showTools: false, // 不显示工具栏
|
||||||
|
tablePagination: false,
|
||||||
|
operationColumn: true,
|
||||||
|
operationColumnAlign: "center", // 操作列居中
|
||||||
|
isDbClickEdit: false, // 双击不编辑当前列
|
||||||
|
formOption: {
|
||||||
|
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" }] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// 添加删除后置处理方法:让父组件知道我删除了,你必须刷新表格
|
||||||
|
afterDelete(response, record) {
|
||||||
|
emits("deleted")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// columns数据
|
||||||
|
const columns = ref([
|
||||||
|
{
|
||||||
|
title: "名称",
|
||||||
|
align: "left",
|
||||||
|
search: true,
|
||||||
|
dataIndex: "name",
|
||||||
|
commonRules: [{ required: true, message: "名称是必填" }],
|
||||||
|
validateTrigger: "blur"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "标识",
|
||||||
|
align: "center",
|
||||||
|
sortable: { sortDirections: ["ascend"] },
|
||||||
|
width: 140,
|
||||||
|
search: true,
|
||||||
|
dataIndex: "ident",
|
||||||
|
editDisabled: true,
|
||||||
|
addDisabled: true,
|
||||||
|
addDefaultValue: `${route.query.ident}`,
|
||||||
|
validateTrigger: "blur"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "缺陷状态",
|
||||||
|
align: "center",
|
||||||
|
width: 80,
|
||||||
|
search: true,
|
||||||
|
dataIndex: "status",
|
||||||
|
formType: "radio",
|
||||||
|
addDefaultValue: "2",
|
||||||
|
commonRules: [{ required: true, message: "缺陷状态是必填" }],
|
||||||
|
dict: {
|
||||||
|
name: "problemStatu",
|
||||||
|
translation: true,
|
||||||
|
props: { label: "title", value: "key" },
|
||||||
|
tagColors: { 1: "green", 2: "blue", 3: "#FF7D00", 4: "red" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "缺陷类型",
|
||||||
|
align: "center",
|
||||||
|
width: 80,
|
||||||
|
dataIndex: "type",
|
||||||
|
search: true,
|
||||||
|
addDefaultValue: "3",
|
||||||
|
formType: "radio",
|
||||||
|
commonRules: [{ required: true, message: "缺陷类型必选" }],
|
||||||
|
dict: {
|
||||||
|
name: "problemType",
|
||||||
|
translation: true,
|
||||||
|
props: { label: "title", value: "key" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "缺陷等级",
|
||||||
|
align: "center",
|
||||||
|
width: 80,
|
||||||
|
dataIndex: "grade",
|
||||||
|
search: true,
|
||||||
|
addDefaultValue: "1",
|
||||||
|
formType: "radio",
|
||||||
|
commonRules: [{ required: true, message: "缺陷等级必填" }],
|
||||||
|
dict: {
|
||||||
|
name: "problemGrade",
|
||||||
|
translation: true,
|
||||||
|
props: { label: "title", value: "key" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "闭环方式",
|
||||||
|
align: "center",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "closeMethod",
|
||||||
|
addDefaultValue: ["2"],
|
||||||
|
search: true,
|
||||||
|
formType: "checkbox",
|
||||||
|
dict: {
|
||||||
|
name: "closeMethod",
|
||||||
|
translation: true,
|
||||||
|
props: { label: "title", value: "key" }
|
||||||
|
},
|
||||||
|
customRender: ({ record }) => {
|
||||||
|
// 判断是否具有1:修改文档
|
||||||
|
if (!record.closeMethod.hasOwnProperty("0")) {
|
||||||
|
if (!record.closeMethod.hasOwnProperty("1")) {
|
||||||
|
return (
|
||||||
|
<a-tag size="small" bordered color="magenta">
|
||||||
|
还未闭环
|
||||||
|
</a-tag>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const tagObj = []
|
||||||
|
for (let item in record.closeMethod) {
|
||||||
|
if (record.closeMethod[item] === "1") {
|
||||||
|
tagObj.push(
|
||||||
|
<a-tag size="small" bordered color="blue">
|
||||||
|
修改文档
|
||||||
|
</a-tag>
|
||||||
|
)
|
||||||
|
} else if (record.closeMethod[item] === "2") {
|
||||||
|
tagObj.push(
|
||||||
|
<a-tag size="small" bordered color="green">
|
||||||
|
修改程序
|
||||||
|
</a-tag>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return <a-space size="mini">{tagObj}</a-space>
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "问题操作",
|
||||||
|
hide: true,
|
||||||
|
search: true,
|
||||||
|
dataIndex: "operation",
|
||||||
|
formType: "editor",
|
||||||
|
addDefaultValue: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "期望结果",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "expect",
|
||||||
|
addDefaultValue: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "问题结果",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "result",
|
||||||
|
formType: "editor",
|
||||||
|
addDefaultValue: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "违反规则",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "rules",
|
||||||
|
addDefaultValue: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "修改建议",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "suggest",
|
||||||
|
addDefaultValue: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "提单人",
|
||||||
|
dataIndex: "postPerson",
|
||||||
|
search: true,
|
||||||
|
formType: "select",
|
||||||
|
commonRules: [{ required: true, message: "提单人必填" }],
|
||||||
|
dict: { url: "system/user/list", translation: true, props: { label: "name", value: "name" } }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "是否关联",
|
||||||
|
dataIndex: "related",
|
||||||
|
align: "center",
|
||||||
|
formType: "switch",
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "提单日期",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "postDate",
|
||||||
|
formType: "date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "设师上级",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "designerPerson",
|
||||||
|
commonRules: [{ required: true, message: "提单人必填" }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "确认日期",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "designDate",
|
||||||
|
formType: "date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "验证人",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "verifyPerson",
|
||||||
|
formType: "select",
|
||||||
|
commonRules: [{ required: true, message: "提单人必填" }],
|
||||||
|
dict: { url: "system/user/list", translation: true, props: { label: "name", value: "name" } }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "验证日期",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "verifyDate",
|
||||||
|
formType: "date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "撤销人",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "revokePerson",
|
||||||
|
formType: "select",
|
||||||
|
commonRules: [{ required: true, message: "提单人必填" }],
|
||||||
|
dict: { url: "system/user/list", translation: true, props: { label: "name", value: "name" } }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "撤销日期",
|
||||||
|
hide: true,
|
||||||
|
dataIndex: "revokeDate",
|
||||||
|
formType: "date"
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
// 暴露自己的open方法
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -4,10 +4,20 @@
|
|||||||
<!-- CRUD组件 -->
|
<!-- CRUD组件 -->
|
||||||
<ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef">
|
<ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef">
|
||||||
<template #ident="{ record }">
|
<template #ident="{ record }">
|
||||||
{{ "PT_" + route.query.ident + "_" + record.ident.padStart(3,"0") }}
|
{{ "PT_" + route.query.ident + "_" + record.ident.padStart(3, "0") }}
|
||||||
|
</template>
|
||||||
|
<!-- 表格前置扩展槽:添加关联按钮 -->
|
||||||
|
<template #tableAfterButtons>
|
||||||
|
<a-button type="outline" status="warning" @click="handleRelatedProblem">
|
||||||
|
<template #icon>
|
||||||
|
<icon-plus-circle />
|
||||||
|
</template>
|
||||||
|
关联添加问题单
|
||||||
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
</ma-crud>
|
</ma-crud>
|
||||||
</div>
|
</div>
|
||||||
|
<problem-choose ref="problemchoose" @deleted="related_reload"></problem-choose>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -16,6 +26,7 @@ import { ref } from "vue"
|
|||||||
import { useRoute, useRouter } from "vue-router"
|
import { useRoute, useRouter } from "vue-router"
|
||||||
import problemApi from "@/api/project/problem"
|
import problemApi from "@/api/project/problem"
|
||||||
import { useTreeDataStore } from "@/store"
|
import { useTreeDataStore } from "@/store"
|
||||||
|
import ProblemChoose from "./components/ProblemChoose.vue"
|
||||||
const treeDataStore = useTreeDataStore()
|
const treeDataStore = useTreeDataStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -26,11 +37,23 @@ const testDemandNumber = route.query.key.split("-")[3]
|
|||||||
const caseNumber = route.query.key.split("-")[4]
|
const caseNumber = route.query.key.split("-")[4]
|
||||||
const crudRef = ref()
|
const crudRef = ref()
|
||||||
const projectId = ref(route.query.id)
|
const projectId = ref(route.query.id)
|
||||||
|
const problemchoose = ref()
|
||||||
|
// ~~~~关联问题单逻辑~~~~
|
||||||
|
//// 点击关联按钮
|
||||||
|
const handleRelatedProblem = () => {
|
||||||
|
problemchoose.value.open()
|
||||||
|
}
|
||||||
|
//// 当关联a-modal删除一个问题单时,通知我刷新表格
|
||||||
|
const related_reload = () => {
|
||||||
|
crudRef.value.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
const crudOptions = ref({
|
const crudOptions = ref({
|
||||||
api: problemApi.getProblemList,
|
api: problemApi.getProblemList,
|
||||||
add: { show: true, api: problemApi.save },
|
add: { show: true, api: problemApi.save },
|
||||||
edit: { show: true, api: problemApi.update },
|
edit: { show: true, api: problemApi.update },
|
||||||
delete: { show: true, api: problemApi.delete },
|
delete: { show: true, api: problemApi.delete },
|
||||||
|
operationColumnAlign: "center", // 操作列居中
|
||||||
beforeOpenAdd: function () {
|
beforeOpenAdd: function () {
|
||||||
let key_split = route.query.key.split("-")
|
let key_split = route.query.key.split("-")
|
||||||
let round_key = key_split[0]
|
let round_key = key_split[0]
|
||||||
@@ -62,19 +85,6 @@ const crudOptions = ref({
|
|||||||
>用例[${record.name}]-`
|
>用例[${record.name}]-`
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
afterAdd: (res) => {
|
|
||||||
console.log(res)
|
|
||||||
let id = projectId.value
|
|
||||||
treeDataStore.updateProblemTreeData(res.data, id)
|
|
||||||
},
|
|
||||||
afterEdit: (res) => {
|
|
||||||
let id = projectId.value
|
|
||||||
treeDataStore.updateProblemTreeData(res.data, id)
|
|
||||||
},
|
|
||||||
afterDelete: (res, record) => {
|
|
||||||
let id = projectId.value
|
|
||||||
treeDataStore.updateProblemTreeData(record, id)
|
|
||||||
},
|
|
||||||
parameters: {
|
parameters: {
|
||||||
projectId: route.query.id,
|
projectId: route.query.id,
|
||||||
round: roundNumber,
|
round: roundNumber,
|
||||||
@@ -263,13 +273,13 @@ const crudColumns = ref([
|
|||||||
}
|
}
|
||||||
const tagObj = []
|
const tagObj = []
|
||||||
for (let item in record.closeMethod) {
|
for (let item in record.closeMethod) {
|
||||||
if (item === "0") {
|
if (record.closeMethod[item] === "1") {
|
||||||
tagObj.push(
|
tagObj.push(
|
||||||
<a-tag size="small" bordered color="blue">
|
<a-tag size="small" bordered color="blue">
|
||||||
修改文档
|
修改文档
|
||||||
</a-tag>
|
</a-tag>
|
||||||
)
|
)
|
||||||
} else if (item === "1") {
|
} else if (record.closeMethod[item] === "2") {
|
||||||
tagObj.push(
|
tagObj.push(
|
||||||
<a-tag size="small" bordered color="green">
|
<a-tag size="small" bordered color="green">
|
||||||
修改程序
|
修改程序
|
||||||
|
|||||||
@@ -14,8 +14,13 @@
|
|||||||
<template #content>
|
<template #content>
|
||||||
<p><a-link @click="createDgItem(record)">大纲二段文档</a-link></p>
|
<p><a-link @click="createDgItem(record)">大纲二段文档</a-link></p>
|
||||||
<p><a-link @click="createSmItem(record)">说明二段文档</a-link></p>
|
<p><a-link @click="createSmItem(record)">说明二段文档</a-link></p>
|
||||||
<p><a-link @click="createSeitaiDagang(record)"><icon-eye />[测试]生成最后大纲</a-link></p>
|
<p><a-link @click="createJLItem(record)">记录二级文档</a-link></p>
|
||||||
<p><a-link @click="createSeitaiShuoming(record)"><icon-eye />[测试]生成最后说明</a-link></p>
|
<p>
|
||||||
|
<a-link @click="createSeitaiDagang(record)"><icon-eye />[测试]生成最后大纲</a-link>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a-link @click="createSeitaiShuoming(record)"><icon-eye />[测试]生成最后说明</a-link>
|
||||||
|
</p>
|
||||||
</template>
|
</template>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
<a-link @click="enterWorkPlant(record)">进入工作区</a-link>
|
<a-link @click="enterWorkPlant(record)">进入工作区</a-link>
|
||||||
@@ -40,6 +45,7 @@ import preview from "./cpns/preview.vue"
|
|||||||
import dgGenerateApi from "@/api/generate/dgGenerate"
|
import dgGenerateApi from "@/api/generate/dgGenerate"
|
||||||
import seitaiGenerateApi from "@/api/generate/seitaiGenerate"
|
import seitaiGenerateApi from "@/api/generate/seitaiGenerate"
|
||||||
import smGenerateApi from "@/api/generate/smGenerate"
|
import smGenerateApi from "@/api/generate/smGenerate"
|
||||||
|
import jlGenerateApi from "@/api/generate/jlGenerate"
|
||||||
import { Message } from "@arco-design/web-vue"
|
import { Message } from "@arco-design/web-vue"
|
||||||
import Progress from "./cpns/progress.vue"
|
import Progress from "./cpns/progress.vue"
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -87,6 +93,13 @@ const createSeitaiDagang = async (record) => {
|
|||||||
Message.success(st.message)
|
Message.success(st.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录生成二级文档
|
||||||
|
const createJLItem = async (record) => {
|
||||||
|
const st = await jlGenerateApi.createJLcaserecord({ id: record.id })
|
||||||
|
|
||||||
|
Message.success(st.message)
|
||||||
|
}
|
||||||
|
|
||||||
// 说明生成二级文档
|
// 说明生成二级文档
|
||||||
const createSmItem = async (record) => {
|
const createSmItem = async (record) => {
|
||||||
// 生成测评对象 - 和大纲一样 - 可能会删除
|
// 生成测评对象 - 和大纲一样 - 可能会删除
|
||||||
|
|||||||
Reference in New Issue
Block a user