修正bug

This commit is contained in:
2025-12-19 18:08:59 +08:00
parent 3bb7e027a6
commit 92783045ef
13 changed files with 77 additions and 74 deletions

View File

@@ -1,2 +1,2 @@
# cdTestPlant3 # cdTestPlant3
里面有3个项目中间那个是正确的 V0.0.1.0增加AI生成ce项功能

View File

@@ -1,7 +1,7 @@
{ {
"name": "testplant", "name": "testplant",
"private": true, "private": true,
"version": "0.0.6", "version": "0.1.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -8,9 +8,7 @@
<th class="arco-table-th" :width="20"> <th class="arco-table-th" :width="20">
<span class="arco-table-cell arco-table-cell-align-center"> <span class="arco-table-cell arco-table-cell-align-center">
<a-tooltip content="添加步骤"> <a-tooltip content="添加步骤">
<a-button type="primary" size="mini" shape="round" @click="addItem"> <a-button :tabindex="-1" type="primary" size="mini" shape="round" @click="addItem"> 新增步骤+ </a-button>
新增步骤+
</a-button>
</a-tooltip> </a-tooltip>
</span> </span>
</th> </th>
@@ -28,16 +26,13 @@
</thead> </thead>
<tbody> <tbody>
<!-- 根据subStep渲染 --> <!-- 根据subStep渲染 -->
<template <template v-if="modelValue && modelValue.length > 0" v-for="(stepItem, index) in modelValue" :key="index">
v-if="modelValue && modelValue.length > 0"
v-for="(stepItem, index) in modelValue"
:key="index"
>
<tr class="arco-table-tr"> <tr class="arco-table-tr">
<td class="arco-table-td"> <td class="arco-table-td">
<span class="arco-table-cell justify-center gap-1.5"> <span class="arco-table-cell justify-center gap-1.5">
<!-- 删除单项按钮 --> <!-- 删除单项按钮 -->
<a-button <a-button
:tabindex="-1"
type="primary" type="primary"
status="danger" status="danger"
size="mini" size="mini"
@@ -48,23 +43,17 @@
<template #icon><icon-close /></template> <template #icon><icon-close /></template>
</a-button> </a-button>
<a-tooltip content="复制该项添加"> <a-tooltip content="复制该项添加">
<a-button <a-button :tabindex="-1" type="primary" status="warning" size="mini" shape="round" @click="copyItem(index)">
type="primary"
status="warning"
size="mini"
shape="round"
@click="copyItem(index)"
>
<template #icon> <template #icon>
<icon-copy /> <icon-copy />
</template> </template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-button-group shape="round" size="mini"> <a-button-group shape="round" size="mini">
<a-button type="primary" @click="moveUp(index)"> <a-button :tabindex="-1" type="primary" @click="moveUp(index)">
<icon-arrow-rise /> <icon-arrow-rise />
</a-button> </a-button>
<a-button type="primary" @click="moveDown(index)"> <a-button :tabindex="-1" type="primary" @click="moveDown(index)">
<icon-arrow-fall /> <icon-arrow-fall />
</a-button> </a-button>
</a-button-group> </a-button-group>

View File

@@ -36,35 +36,30 @@
<a-space> <a-space>
<!-- 修改源码添加向上和向下 --> <!-- 修改源码添加向上和向下 -->
<a-tooltip content="向上移动" v-if="!(props.component.hideAdd ?? false)"> <a-tooltip content="向上移动" v-if="!(props.component.hideAdd ?? false)">
<a-button @click.stop="moveUp(itemIndex)" type="primary" size="small" shape="round"> <a-button :tabindex="-1" @click.stop="moveUp(itemIndex)" type="primary" size="small" shape="round">
<template #icon><icon-arrow-rise /></template> <template #icon><icon-arrow-rise /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip content="向下移动" v-if="!(props.component.hideAdd ?? false)"> <a-tooltip content="向下移动" v-if="!(props.component.hideAdd ?? false)">
<a-button @click.stop="moveDown(itemIndex)" type="primary" size="small" shape="round"> <a-button :tabindex="-1" @click.stop="moveDown(itemIndex)" type="primary" size="small" shape="round">
<template #icon><icon-arrow-fall /></template> <template #icon><icon-arrow-fall /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<icon-oblique-line /> <icon-oblique-line />
<!-- 修改源码新增复制该项新增 --> <!-- 修改源码新增复制该项新增 -->
<a-tooltip content="复制该项添加" v-if="!(props.component.hideAdd ?? false)"> <a-tooltip content="复制该项添加" v-if="!(props.component.hideAdd ?? false)">
<a-button <a-button :tabindex="-1" @click.stop="addItem(item)" type="primary" size="small" shape="round" status="warning">
@click.stop="addItem(item)"
type="primary"
size="small"
shape="round"
status="warning"
>
<template #icon><icon-copy /></template> <template #icon><icon-copy /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip content="添加新子项" v-if="!(props.component.hideAdd ?? false)"> <a-tooltip content="添加新子项" v-if="!(props.component.hideAdd ?? false)">
<a-button @click.stop="addItem()" type="primary" size="small" shape="round"> <a-button :tabindex="-1" @click.stop="addItem()" type="primary" size="small" shape="round">
<template #icon><icon-plus /></template> <template #icon><icon-plus /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip content="删除该子项" v-if="!(props.component.hideDelete ?? false)"> <a-tooltip content="删除该子项" v-if="!(props.component.hideDelete ?? false)">
<a-button <a-button
:tabindex="-1"
@click.stop="deleteItem(itemIndex)" @click.stop="deleteItem(itemIndex)"
:disabled="formModel[props.component.dataIndex].length === 1" :disabled="formModel[props.component.dataIndex].length === 1"
type="primary" type="primary"
@@ -72,7 +67,7 @@
shape="round" shape="round"
status="danger" status="danger"
> >
<template #icon><icon-minus /></template> <template #icon><icon-close /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
</a-space> </a-space>
@@ -99,7 +94,7 @@
<tr class="arco-table-tr"> <tr class="arco-table-tr">
<th class="arco-table-th" width="60"> <th class="arco-table-th" width="60">
<span class="arco-table-cell arco-table-cell-align-center"> <span class="arco-table-cell arco-table-cell-align-center">
<a-button type="primary" @click="addItem()" size="small" shape="round"> <a-button :tabindex="-1" type="primary" @click="addItem()" size="small" shape="round">
<template #icon> <template #icon>
<icon-plus /> <icon-plus />
</template> </template>
@@ -126,6 +121,7 @@
<td class="arco-table-td"> <td class="arco-table-td">
<span class="arco-table-cell"> <span class="arco-table-cell">
<a-button <a-button
:tabindex="-1"
type="primary" type="primary"
status="danger" status="danger"
size="small" size="small"
@@ -133,7 +129,7 @@
:disabled="formModel[props.component.dataIndex].length === 1" :disabled="formModel[props.component.dataIndex].length === 1"
@click="deleteItem(index)" @click="deleteItem(index)"
> >
<template #icon><icon-minus /></template> <template #icon><icon-close /></template>
</a-button> </a-button>
</span> </span>
</td> </td>
@@ -212,8 +208,7 @@ watch(
) )
// ~~~~修改源码-end // ~~~~修改源码-end
const rv = async (ev, value = undefined) => const rv = async (ev, value = undefined) => await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
const defaultOpenKeys = [0] const defaultOpenKeys = [0]
@@ -269,9 +264,7 @@ function updateChongFen() {
const subItemFormData = formModel.value.testContent const subItemFormData = formModel.value.testContent
const mapRes = subItemFormData.map((subItem) => subItem.subName || "") const mapRes = subItemFormData.map((subItem) => subItem.subName || "")
formModel.value.adequacy && formModel.value.adequacy &&
(formModel.value.adequacy = `测试用例覆盖${mapRes.join( (formModel.value.adequacy = `测试用例覆盖${mapRes.join("、")}子项要求的全部内容。\n所有用例执行完毕对于未执行的用例说明未执行原因。`)
"、"
)}子项要求的全部内容。\n所有用例执行完毕对于未执行的用例说明未执行原因。`)
} }
} }

View File

@@ -1,7 +1,3 @@
<!--
- @Author XXX
- @Link XXX
-->
<template> <template>
<div> <div>
<slot :name="`form-${props.component.dataIndex}`" v-bind="props.component"> <slot :name="`form-${props.component.dataIndex}`" v-bind="props.component">
@@ -36,8 +32,7 @@ const props = defineProps({
const formModel = inject("formModel") const formModel = inject("formModel")
const getColumnService = inject("getColumnService") const getColumnService = inject("getColumnService")
const columns = inject("columns") const columns = inject("columns")
const rv = async (ev, value = undefined) => const rv = async (ev, value = undefined) => await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
rv("onCreated") rv("onCreated")
onMounted(() => rv("onMounted")) onMounted(() => rv("onMounted"))

View File

@@ -1,7 +1,3 @@
<!--
- @Author XXX
- @Link XXX
-->
<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"
@@ -35,7 +31,7 @@
><template #icon><icon-plus /></template ><template #icon><icon-plus /></template
></a-button> ></a-button>
<a-button size="small" type="primary" @click="minus(rowIndex)" <a-button size="small" type="primary" @click="minus(rowIndex)"
><template #icon><icon-minus /></template ><template #icon><icon-close /></template
></a-button> ></a-button>
</a-space> </a-space>
</template> </template>

View File

@@ -1,7 +1,3 @@
<!--
- @Author XXX
- @Link XXX
-->
<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"
@@ -42,13 +38,10 @@ const dictList = inject("dictList")
const formLoading = inject("formLoading") const formLoading = inject("formLoading")
const getColumnService = inject("getColumnService") const getColumnService = inject("getColumnService")
const columns = inject("columns") const columns = inject("columns")
const rv = async (ev, value = undefined) => const rv = async (ev, value = undefined) => await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
const index = props.customField ?? props.component.dataIndex const index = props.customField ?? props.component.dataIndex
const dictIndex = index.match(/^(\w+\.)\d+\./) const dictIndex = index.match(/^(\w+\.)\d+\./) ? index.match(/^(\w+\.)\d+\./)[1] + props.component.dataIndex : props.component.dataIndex
? index.match(/^(\w+\.)\d+\./)[1] + props.component.dataIndex
: props.component.dataIndex
const value = ref(get(formModel.value, index, "")) const value = ref(get(formModel.value, index, ""))
watch( watch(
@@ -65,11 +58,7 @@ watch(
if (value.value === "") { if (value.value === "") {
value.value = undefined value.value = undefined
} else if ( } else if (!isUndefined(value.value) && props.component.dict && (props.component.dict.name || props.component.dict.data)) {
!isUndefined(value.value) &&
props.component.dict &&
(props.component.dict.name || props.component.dict.data)
) {
value.value = value.value + "" value.value = value.value + ""
} }

View File

@@ -12,13 +12,17 @@ export default function () {
const tempCaseInfo = ref<any>(null) const tempCaseInfo = ref<any>(null)
// 项目id和当前case的key // 项目id和当前case的key
const { id, key } = route.query const { id, key } = route.query
onMounted(async () => { const fetchCaseOneStatus = async () => {
try { try {
const res = await caseApi.getCaseOne({ key, projectId: id }) const res = await caseApi.getCaseOne({ key, projectId: id })
tempCaseInfo.value = res.data tempCaseInfo.value = res.data
} catch (err) { } catch (err) {
Message.error("获取用例信息失败,请检查服务器") Message.error("获取用例信息失败,请检查服务器")
} }
}
// 在初次加载时更新状态,如何在用例更新后再次加载呢
onMounted(() => {
fetchCaseOneStatus()
}) })
// hook里面判断函数判断是否该用例未执行或未通过 // hook里面判断函数判断是否该用例未执行或未通过
const caseIsNotPassedOrNotExe = function (): boolean { const caseIsNotPassedOrNotExe = function (): boolean {
@@ -34,7 +38,8 @@ export default function () {
} }
return { return {
tempCaseInfo, tempCaseInfo,
caseIsNotPassedOrNotExe caseIsNotPassedOrNotExe,
fetchCaseOneStatus
} }
} }

View File

@@ -119,6 +119,16 @@
</template> </template>
</template> </template>
</template> </template>
<!-- 节点title插槽 -->
<template #title="{ level, title }">
<template v-if="level === '0' || level === '3'">
{{ title }}
<span class="small-right-context-tip">
<i>右键</i>
</span>
</template>
<template v-else>{{ title }}</template>
</template>
</a-tree> </a-tree>
</div> </div>
</a-layout-sider> </a-layout-sider>
@@ -428,10 +438,34 @@ const { paoVisible, paoContainer, pao2Visible, pao2Container, ondrop, allowdrop,
} }
.font-icon { .font-icon {
font-size: 20px; font-size: 20px;
margin-bottom: -2px; margin-bottom: -2.8px;
} }
.font-icon:hover { .font-icon:hover {
color: #f53f3fed; color: #f53f3fed;
transition: all 0.3s; transition: all 0.3s;
} }
// 有右键菜单节点显示图标
.small-right-context-tip {
align-items: center;
background: linear-gradient(54.58deg, rgba(74, 228, 255, 0.12) -14.12%, rgba(66, 130, 255, 0.12) 47.61%, rgba(215, 104, 255, 0.12) 105.84%);
border: 1px solid #d5d7f9;
border-radius: 10px;
color: transparent;
display: inline-flex;
height: 10px;
justify-content: center;
margin-left: 2px;
padding: 0 2.5px;
position: absolute;
top: 7px;
i {
-webkit-text-fill-color: transparent !important;
zoom: 0.7;
background: linear-gradient(85.2deg, #0062ff -3.15%, #cb50ff 98.89%) !important;
background-clip: text !important;
-webkit-background-clip: text !important;
font-size: 10px;
font-style: normal;
}
}
</style> </style>

View File

@@ -17,11 +17,7 @@
</template> </template>
</ma-crud> </ma-crud>
</div> </div>
<problem-choose <problem-choose ref="problemchoose" @deleted="related_reload" @relatedOrunrelated="related_reload"></problem-choose>
ref="problemchoose"
@deleted="related_reload"
@relatedOrunrelated="related_reload"
></problem-choose>
</div> </div>
</template> </template>
@@ -33,10 +29,13 @@ import { useTreeDataStore } from "@/store"
import ProblemChoose from "./components/ProblemChoose.vue" import ProblemChoose from "./components/ProblemChoose.vue"
import { Message } from "@arco-design/web-vue" import { Message } from "@arco-design/web-vue"
import getCaseInfoHook from "@/hooks/workarea/currentCasePage" import getCaseInfoHook from "@/hooks/workarea/currentCasePage"
import { useUserStore } from "@/store"
const treeDataStore = useTreeDataStore() const treeDataStore = useTreeDataStore()
const userStore = useUserStore()
const route = useRoute() const route = useRoute()
// hook-获取当前用例信息 // hook-获取当前用例信息
const { tempCaseInfo, caseIsNotPassedOrNotExe } = getCaseInfoHook() const { tempCaseInfo, caseIsNotPassedOrNotExe, fetchCaseOneStatus } = getCaseInfoHook()
// const router = useRouter() // const router = useRouter()
const roundNumber = route.query.key.split("-")[0] const roundNumber = route.query.key.split("-")[0]
@@ -118,6 +117,8 @@ const crudOptions = ref({
}, },
// 请求后置处理-用于新增/删除更新树状的用例关联问题单状态 // 请求后置处理-用于新增/删除更新树状的用例关联问题单状态
afterRequest(tableData) { afterRequest(tableData) {
// 调用更新是否有未通过变量
fetchCaseOneStatus()
const caseQuery = { key: route.query.key } const caseQuery = { key: route.query.key }
treeDataStore.updateCaseTreeData(caseQuery, route.query.id) treeDataStore.updateCaseTreeData(caseQuery, route.query.id)
// 新版本mime必须返回 // 新版本mime必须返回
@@ -384,6 +385,7 @@ const crudColumns = ref([
search: true, search: true,
align: "center", align: "center",
formType: "select", formType: "select",
addDefaultValue: userStore.name,
commonRules: [{ required: true, message: "测试人员必填" }], commonRules: [{ required: true, message: "测试人员必填" }],
dict: { dict: {
url: "system/user/list", url: "system/user/list",

View File

@@ -51,7 +51,7 @@ export default function () {
dataIndex: "testMethod", dataIndex: "testMethod",
align: "center", align: "center",
slotName: "testMethod", slotName: "testMethod",
width: 210 width: 220
}, },
{ {
title: "测试类型", title: "测试类型",

View File

@@ -13,7 +13,7 @@
<template #title>替换执行时间</template> <template #title>替换执行时间</template>
<div class="content-container"> <div class="content-container">
<a-form ref="exeTime" :model="formData" scroll-to-first-error> <a-form ref="exeTime" :model="formData" scroll-to-first-error>
<a-form-item field="designPerson" label="执行时间"> <a-form-item field="exetime" label="执行时间">
<a-date-picker v-model="exetime" style="width: 200px" /> <a-date-picker v-model="exetime" style="width: 200px" />
</a-form-item> </a-form-item>
</a-form> </a-form>

View File

@@ -246,7 +246,7 @@ const handlePerpleModal = () => {
} }
// 10.批量修改时间 // 10.批量修改时间
const replaceExetimeModalRef = ref<InstanceType<typeof ReplacePerson>>() const replaceExetimeModalRef = ref<InstanceType<typeof ReplaceExetime>>()
const handleExetimeModal = () => { const handleExetimeModal = () => {
replaceExetimeModalRef.value!.open(undefined) replaceExetimeModalRef.value!.open(undefined)
} }