Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
fdc9b1c2
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 大约 3 年
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fdc9b1c2
编写于
8月 04, 2020
作者:
S
shiziyuan9527
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(测试跟踪): 测试用例批量编辑
上级
5fb0fc59
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
81 addition
and
13 deletion
+81
-13
frontend/src/business/components/track/case/components/BatchEdit.vue
...c/business/components/track/case/components/BatchEdit.vue
+59
-5
frontend/src/business/components/track/case/components/ShowMoreBtn.vue
...business/components/track/case/components/ShowMoreBtn.vue
+1
-1
frontend/src/business/components/track/case/components/TestCaseList.vue
...usiness/components/track/case/components/TestCaseList.vue
+21
-7
未找到文件。
frontend/src/business/components/track/case/components/BatchEdit.vue
浏览文件 @
fdc9b1c2
...
...
@@ -10,7 +10,7 @@
>
<el-form
:model=
"form"
label-position=
"right"
label-width=
"150px"
size=
"medium"
ref=
"form"
:rules=
"rules"
>
<el-form-item
:label=
"$t('test_track.case.batch_update', [size])"
prop=
"type"
>
<el-select
v-model=
"form.type"
style=
"width: 80%"
>
<el-select
v-model=
"form.type"
style=
"width: 80%"
@
change=
"changeType"
>
<el-option
label=
"用例等级"
value=
"priority"
/>
<el-option
label=
"类型"
value=
"type"
/>
<el-option
label=
"测试方式"
value=
"method"
/>
...
...
@@ -18,9 +18,13 @@
</el-select>
</el-form-item>
<el-form-item
label=
"更新后属性值为"
prop=
"value"
>
<el-select
v-model=
"form.value"
style=
"width: 80%"
>
<el-option
label=
"值1"
value=
"value1"
/>
<el-option
label=
"值2"
value=
"value2"
/>
<el-select
v-model=
"form.value"
style=
"width: 80%"
:filterable=
"filterable"
>
<el-option
v-for=
"(option, index) in options"
:key=
"index"
:value=
"option.id"
:label=
"option.name"
>
<!--
<div
v-if=
"option.email"
>
-->
<!--
<span
style=
"float: left"
>
{{
option
.
name
}}
</span>
-->
<!--
<span
style=
"float: right;color: #8492a6;"
>
{{
option
.
email
}}
</span>
-->
<!--
</div>
-->
</el-option>
</el-select>
</el-form-item>
</el-form>
...
...
@@ -35,12 +39,16 @@
<
script
>
import
MsDialogFooter
from
"
../../../common/components/MsDialogFooter
"
;
import
{
WORKSPACE_ID
}
from
"
../../../../../common/js/constants
"
;
export
default
{
name
:
"
BatchEdit
"
,
components
:
{
MsDialogFooter
},
created
()
{
this
.
getMaintainerOptions
();
},
data
()
{
return
{
dialogVisible
:
false
,
...
...
@@ -50,13 +58,32 @@
type
:
{
required
:
true
,
message
:
"
请选择属性
"
,
trigger
:
[
'
blur
'
,
'
change
'
]},
value
:
{
required
:
true
,
message
:
"
请选择属性对应的值
"
,
trigger
:
[
'
blur
'
,
'
change
'
]}
},
options
:
[],
priorities
:
[
{
name
:
'
P0
'
,
id
:
'
P0
'
},
{
name
:
'
P1
'
,
id
:
'
P1
'
},
{
name
:
'
P2
'
,
id
:
'
P2
'
},
{
name
:
'
P3
'
,
id
:
'
P3
'
}
],
types
:
[
{
name
:
this
.
$t
(
'
commons.functional
'
),
id
:
'
functional
'
},
{
name
:
this
.
$t
(
'
commons.performance
'
),
id
:
'
performance
'
},
{
name
:
this
.
$t
(
'
commons.api
'
),
id
:
'
api
'
}
],
methods
:
[
{
name
:
this
.
$t
(
'
test_track.case.manual
'
),
id
:
'
manual
'
},
{
name
:
this
.
$t
(
'
test_track.case.auto
'
),
id
:
'
auto
'
}
],
maintainers
:
[],
filterable
:
false
,
}
},
methods
:
{
submit
(
form
)
{
this
.
$refs
[
form
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$emit
(
"
submit
"
,
this
.
form
);
this
.
$emit
(
"
batchEdit
"
,
this
.
form
);
this
.
dialogVisible
=
false
;
}
else
{
return
false
;
}
...
...
@@ -68,6 +95,33 @@
},
handleClose
()
{
this
.
form
=
{};
},
changeType
(
val
)
{
this
.
$set
(
this
.
form
,
"
value
"
,
""
);
this
.
filterable
=
val
===
"
maintainer
"
;
switch
(
val
)
{
case
"
priority
"
:
this
.
options
=
this
.
priorities
;
break
;
case
"
type
"
:
this
.
options
=
this
.
types
;
break
;
case
"
method
"
:
this
.
options
=
this
.
methods
;
break
;
case
"
maintainer
"
:
this
.
options
=
this
.
maintainers
;
break
;
default
:
this
.
options
=
[];
}
},
getMaintainerOptions
()
{
let
workspaceId
=
localStorage
.
getItem
(
WORKSPACE_ID
);
this
.
$post
(
'
/user/ws/member/tester/list
'
,
{
workspaceId
:
workspaceId
},
response
=>
{
this
.
maintainers
=
response
.
data
;
});
}
}
}
...
...
frontend/src/business/components/track/case/components/ShowMoreBtn.vue
浏览文件 @
fdc9b1c2
...
...
@@ -56,7 +56,7 @@
.show-more-btn-title
{
color
:
#696969
;
background-color
:
#
C0C0C0
;
background-color
:
#
e2e2e2
;
padding
:
5px
;
}
...
...
frontend/src/business/components/track/case/components/TestCaseList.vue
浏览文件 @
fdc9b1c2
...
...
@@ -120,7 +120,7 @@
</el-card>
<batch-edit
ref=
"batchEdit"
/>
<batch-edit
ref=
"batchEdit"
@
batchEdit=
"batchEdit"
/>
</div>
</template>
...
...
@@ -333,17 +333,19 @@
this
.
$set
(
row
,
"
showMore
"
,
false
);
this
.
selectRows
.
delete
(
row
);
}
else
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
this
.
selectRows
.
add
(
row
);
}
// todo
if
(
this
.
selectRows
.
size
>
1
)
{
Array
.
from
(
this
.
selectRows
).
forEach
(
row
=>
{
let
arr
=
Array
.
from
(
this
.
selectRows
);
// 选中1个以上的用例时显示更多操作
if
(
this
.
selectRows
.
size
===
1
)
{
this
.
$set
(
arr
[
0
],
"
showMore
"
,
false
);
}
else
if
(
this
.
selectRows
.
size
===
2
)
{
arr
.
forEach
(
row
=>
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
})
}
else
if
(
this
.
selectRows
.
size
===
1
)
{
let
arr
=
Array
.
from
(
this
.
selectRows
);
this
.
$set
(
arr
[
0
],
"
showMore
"
,
false
);
}
},
importTestCase
()
{
...
...
@@ -391,6 +393,18 @@
this
.
exportTestCase
();
}
},
batchEdit
(
form
)
{
let
ids
=
Array
.
from
(
this
.
selectRows
).
map
(
row
=>
row
.
id
);
let
param
=
{};
param
[
form
.
type
]
=
form
.
value
;
param
.
ids
=
ids
;
// todo 功能测试 的测试方式修改为 自动 时不通过
// 测试类型为自动时不能修改为 功能测试
this
.
$post
(
'
/test/case/batch/edit
'
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
this
.
refresh
();
});
},
filter
(
filters
)
{
_filter
(
filters
,
this
.
condition
);
this
.
initTableData
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录