修正bug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "testplant",
|
||||
"private": true,
|
||||
"version": "0.0.6",
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
<th class="arco-table-th" :width="20">
|
||||
<span class="arco-table-cell arco-table-cell-align-center">
|
||||
<a-tooltip content="添加步骤">
|
||||
<a-button type="primary" size="mini" shape="round" @click="addItem">
|
||||
新增步骤+
|
||||
</a-button>
|
||||
<a-button :tabindex="-1" type="primary" size="mini" shape="round" @click="addItem"> 新增步骤+ </a-button>
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</th>
|
||||
@@ -28,16 +26,13 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- 根据subStep渲染 -->
|
||||
<template
|
||||
v-if="modelValue && modelValue.length > 0"
|
||||
v-for="(stepItem, index) in modelValue"
|
||||
:key="index"
|
||||
>
|
||||
<template v-if="modelValue && modelValue.length > 0" v-for="(stepItem, index) in modelValue" :key="index">
|
||||
<tr class="arco-table-tr">
|
||||
<td class="arco-table-td">
|
||||
<span class="arco-table-cell justify-center gap-1.5">
|
||||
<!-- 删除单项按钮 -->
|
||||
<a-button
|
||||
:tabindex="-1"
|
||||
type="primary"
|
||||
status="danger"
|
||||
size="mini"
|
||||
@@ -48,23 +43,17 @@
|
||||
<template #icon><icon-close /></template>
|
||||
</a-button>
|
||||
<a-tooltip content="复制该项添加">
|
||||
<a-button
|
||||
type="primary"
|
||||
status="warning"
|
||||
size="mini"
|
||||
shape="round"
|
||||
@click="copyItem(index)"
|
||||
>
|
||||
<a-button :tabindex="-1" type="primary" status="warning" size="mini" shape="round" @click="copyItem(index)">
|
||||
<template #icon>
|
||||
<icon-copy />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<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 />
|
||||
</a-button>
|
||||
<a-button type="primary" @click="moveDown(index)">
|
||||
<a-button :tabindex="-1" type="primary" @click="moveDown(index)">
|
||||
<icon-arrow-fall />
|
||||
</a-button>
|
||||
</a-button-group>
|
||||
|
||||
@@ -36,35 +36,30 @@
|
||||
<a-space>
|
||||
<!-- 修改源码:添加向上和向下 -->
|
||||
<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>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<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>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<icon-oblique-line />
|
||||
<!-- 修改源码:新增复制该项新增 -->
|
||||
<a-tooltip content="复制该项添加" v-if="!(props.component.hideAdd ?? false)">
|
||||
<a-button
|
||||
@click.stop="addItem(item)"
|
||||
type="primary"
|
||||
size="small"
|
||||
shape="round"
|
||||
status="warning"
|
||||
>
|
||||
<a-button :tabindex="-1" @click.stop="addItem(item)" type="primary" size="small" shape="round" status="warning">
|
||||
<template #icon><icon-copy /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<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>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip content="删除该子项" v-if="!(props.component.hideDelete ?? false)">
|
||||
<a-button
|
||||
:tabindex="-1"
|
||||
@click.stop="deleteItem(itemIndex)"
|
||||
:disabled="formModel[props.component.dataIndex].length === 1"
|
||||
type="primary"
|
||||
@@ -72,7 +67,7 @@
|
||||
shape="round"
|
||||
status="danger"
|
||||
>
|
||||
<template #icon><icon-minus /></template>
|
||||
<template #icon><icon-close /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
@@ -99,7 +94,7 @@
|
||||
<tr class="arco-table-tr">
|
||||
<th class="arco-table-th" width="60">
|
||||
<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>
|
||||
<icon-plus />
|
||||
</template>
|
||||
@@ -126,6 +121,7 @@
|
||||
<td class="arco-table-td">
|
||||
<span class="arco-table-cell">
|
||||
<a-button
|
||||
:tabindex="-1"
|
||||
type="primary"
|
||||
status="danger"
|
||||
size="small"
|
||||
@@ -133,7 +129,7 @@
|
||||
:disabled="formModel[props.component.dataIndex].length === 1"
|
||||
@click="deleteItem(index)"
|
||||
>
|
||||
<template #icon><icon-minus /></template>
|
||||
<template #icon><icon-close /></template>
|
||||
</a-button>
|
||||
</span>
|
||||
</td>
|
||||
@@ -212,8 +208,7 @@ watch(
|
||||
)
|
||||
// ~~~~修改源码-end
|
||||
|
||||
const rv = async (ev, value = undefined) =>
|
||||
await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
|
||||
const rv = async (ev, value = undefined) => await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
|
||||
|
||||
const defaultOpenKeys = [0]
|
||||
|
||||
@@ -269,9 +264,7 @@ function updateChongFen() {
|
||||
const subItemFormData = formModel.value.testContent
|
||||
const mapRes = subItemFormData.map((subItem) => subItem.subName || "")
|
||||
formModel.value.adequacy &&
|
||||
(formModel.value.adequacy = `测试用例覆盖${mapRes.join(
|
||||
"、"
|
||||
)}子项要求的全部内容。\n所有用例执行完毕,对于未执行的用例说明未执行原因。`)
|
||||
(formModel.value.adequacy = `测试用例覆盖${mapRes.join("、")}子项要求的全部内容。\n所有用例执行完毕,对于未执行的用例说明未执行原因。`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<!--
|
||||
- @Author XXX
|
||||
- @Link XXX
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<slot :name="`form-${props.component.dataIndex}`" v-bind="props.component">
|
||||
@@ -36,8 +32,7 @@ const props = defineProps({
|
||||
const formModel = inject("formModel")
|
||||
const getColumnService = inject("getColumnService")
|
||||
const columns = inject("columns")
|
||||
const rv = async (ev, value = undefined) =>
|
||||
await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
|
||||
const rv = async (ev, value = undefined) => await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
|
||||
|
||||
rv("onCreated")
|
||||
onMounted(() => rv("onMounted"))
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<!--
|
||||
- @Author XXX
|
||||
- @Link XXX
|
||||
-->
|
||||
<template>
|
||||
<ma-form-item
|
||||
v-if="typeof props.component.display == 'undefined' || props.component.display === true"
|
||||
@@ -35,7 +31,7 @@
|
||||
><template #icon><icon-plus /></template
|
||||
></a-button>
|
||||
<a-button size="small" type="primary" @click="minus(rowIndex)"
|
||||
><template #icon><icon-minus /></template
|
||||
><template #icon><icon-close /></template
|
||||
></a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<!--
|
||||
- @Author XXX
|
||||
- @Link XXX
|
||||
-->
|
||||
<template>
|
||||
<ma-form-item
|
||||
v-if="typeof props.component.display == 'undefined' || props.component.display === true"
|
||||
@@ -42,13 +38,10 @@ const dictList = inject("dictList")
|
||||
const formLoading = inject("formLoading")
|
||||
const getColumnService = inject("getColumnService")
|
||||
const columns = inject("columns")
|
||||
const rv = async (ev, value = undefined) =>
|
||||
await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
|
||||
const rv = async (ev, value = undefined) => await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
|
||||
|
||||
const index = props.customField ?? props.component.dataIndex
|
||||
const dictIndex = index.match(/^(\w+\.)\d+\./)
|
||||
? index.match(/^(\w+\.)\d+\./)[1] + props.component.dataIndex
|
||||
: props.component.dataIndex
|
||||
const dictIndex = index.match(/^(\w+\.)\d+\./) ? index.match(/^(\w+\.)\d+\./)[1] + props.component.dataIndex : props.component.dataIndex
|
||||
const value = ref(get(formModel.value, index, ""))
|
||||
|
||||
watch(
|
||||
@@ -65,11 +58,7 @@ watch(
|
||||
|
||||
if (value.value === "") {
|
||||
value.value = undefined
|
||||
} else if (
|
||||
!isUndefined(value.value) &&
|
||||
props.component.dict &&
|
||||
(props.component.dict.name || props.component.dict.data)
|
||||
) {
|
||||
} else if (!isUndefined(value.value) && props.component.dict && (props.component.dict.name || props.component.dict.data)) {
|
||||
value.value = value.value + ""
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,17 @@ export default function () {
|
||||
const tempCaseInfo = ref<any>(null)
|
||||
// 项目id和当前case的key
|
||||
const { id, key } = route.query
|
||||
onMounted(async () => {
|
||||
const fetchCaseOneStatus = async () => {
|
||||
try {
|
||||
const res = await caseApi.getCaseOne({ key, projectId: id })
|
||||
tempCaseInfo.value = res.data
|
||||
} catch (err) {
|
||||
Message.error("获取用例信息失败,请检查服务器")
|
||||
}
|
||||
}
|
||||
// 在初次加载时更新状态,如何在用例更新后再次加载呢
|
||||
onMounted(() => {
|
||||
fetchCaseOneStatus()
|
||||
})
|
||||
// hook里面判断函数:判断是否该用例未执行或未通过
|
||||
const caseIsNotPassedOrNotExe = function (): boolean {
|
||||
@@ -34,7 +38,8 @@ export default function () {
|
||||
}
|
||||
return {
|
||||
tempCaseInfo,
|
||||
caseIsNotPassedOrNotExe
|
||||
caseIsNotPassedOrNotExe,
|
||||
fetchCaseOneStatus
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,16 @@
|
||||
</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>
|
||||
</div>
|
||||
</a-layout-sider>
|
||||
@@ -428,10 +438,34 @@ const { paoVisible, paoContainer, pao2Visible, pao2Container, ondrop, allowdrop,
|
||||
}
|
||||
.font-icon {
|
||||
font-size: 20px;
|
||||
margin-bottom: -2px;
|
||||
margin-bottom: -2.8px;
|
||||
}
|
||||
.font-icon:hover {
|
||||
color: #f53f3fed;
|
||||
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>
|
||||
|
||||
@@ -17,11 +17,7 @@
|
||||
</template>
|
||||
</ma-crud>
|
||||
</div>
|
||||
<problem-choose
|
||||
ref="problemchoose"
|
||||
@deleted="related_reload"
|
||||
@relatedOrunrelated="related_reload"
|
||||
></problem-choose>
|
||||
<problem-choose ref="problemchoose" @deleted="related_reload" @relatedOrunrelated="related_reload"></problem-choose>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -33,10 +29,13 @@ import { useTreeDataStore } from "@/store"
|
||||
import ProblemChoose from "./components/ProblemChoose.vue"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
import getCaseInfoHook from "@/hooks/workarea/currentCasePage"
|
||||
import { useUserStore } from "@/store"
|
||||
|
||||
const treeDataStore = useTreeDataStore()
|
||||
const userStore = useUserStore()
|
||||
const route = useRoute()
|
||||
// hook-获取当前用例信息
|
||||
const { tempCaseInfo, caseIsNotPassedOrNotExe } = getCaseInfoHook()
|
||||
const { tempCaseInfo, caseIsNotPassedOrNotExe, fetchCaseOneStatus } = getCaseInfoHook()
|
||||
|
||||
// const router = useRouter()
|
||||
const roundNumber = route.query.key.split("-")[0]
|
||||
@@ -118,6 +117,8 @@ const crudOptions = ref({
|
||||
},
|
||||
// 请求后置处理-用于新增/删除更新树状的用例关联问题单状态
|
||||
afterRequest(tableData) {
|
||||
// 调用更新是否有未通过变量
|
||||
fetchCaseOneStatus()
|
||||
const caseQuery = { key: route.query.key }
|
||||
treeDataStore.updateCaseTreeData(caseQuery, route.query.id)
|
||||
// 新版本mime必须返回
|
||||
@@ -384,6 +385,7 @@ const crudColumns = ref([
|
||||
search: true,
|
||||
align: "center",
|
||||
formType: "select",
|
||||
addDefaultValue: userStore.name,
|
||||
commonRules: [{ required: true, message: "测试人员必填" }],
|
||||
dict: {
|
||||
url: "system/user/list",
|
||||
|
||||
@@ -51,7 +51,7 @@ export default function () {
|
||||
dataIndex: "testMethod",
|
||||
align: "center",
|
||||
slotName: "testMethod",
|
||||
width: 210
|
||||
width: 220
|
||||
},
|
||||
{
|
||||
title: "测试类型",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<template #title>替换执行时间</template>
|
||||
<div class="content-container">
|
||||
<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-form-item>
|
||||
</a-form>
|
||||
|
||||
@@ -246,7 +246,7 @@ const handlePerpleModal = () => {
|
||||
}
|
||||
|
||||
// 10.批量修改时间
|
||||
const replaceExetimeModalRef = ref<InstanceType<typeof ReplacePerson>>()
|
||||
const replaceExetimeModalRef = ref<InstanceType<typeof ReplaceExetime>>()
|
||||
const handleExetimeModal = () => {
|
||||
replaceExetimeModalRef.value!.open(undefined)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user