Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
de3faf3c
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,发现更多精彩内容 >>
提交
de3faf3c
编写于
5月 09, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用例模块等允许带空格
上级
366ae5e9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
15 deletion
+32
-15
backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java
...a/io/metersphere/excel/listener/TestCaseDataListener.java
+12
-3
frontend/src/business/components/track/case/components/TestCaseEdit.vue
...usiness/components/track/case/components/TestCaseEdit.vue
+6
-1
frontend/src/business/components/track/case/components/TestCaseMove.vue
...usiness/components/track/case/components/TestCaseMove.vue
+2
-7
frontend/src/business/components/track/common/NodeEdit.vue
frontend/src/business/components/track/common/NodeEdit.vue
+6
-3
frontend/src/business/components/track/plan/components/TestPlanEdit.vue
...usiness/components/track/plan/components/TestPlanEdit.vue
+6
-1
未找到文件。
backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java
浏览文件 @
de3faf3c
...
...
@@ -7,7 +7,9 @@ import io.metersphere.base.domain.TestCaseWithBLOBs;
import
io.metersphere.commons.constants.TestCaseConstants
;
import
io.metersphere.commons.utils.BeanUtils
;
import
io.metersphere.service.TestCaseService
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.UUID
;
...
...
@@ -38,12 +40,19 @@ public class TestCaseDataListener extends EasyExcelListener<TestCaseExcelData> {
public
String
validate
(
TestCaseExcelData
data
,
String
errMsg
)
{
String
nodePath
=
data
.
getNodePath
();
StringBuilder
stringBuilder
=
new
StringBuilder
(
errMsg
);
if
(
nodePath
.
split
(
"/"
).
length
>
TestCaseConstants
.
MAX_NODE_DEPTH
+
1
)
{
String
[]
nodes
=
nodePath
.
split
(
"/"
);
if
(
nodes
.
length
>
TestCaseConstants
.
MAX_NODE_DEPTH
+
1
)
{
stringBuilder
.
append
(
"节点最多为"
+
TestCaseConstants
.
MAX_NODE_DEPTH
+
"层;"
);
}
if
(
nodePath
.
trim
().
contains
(
" "
))
{
stringBuilder
.
append
(
"所属模块不能包含空格"
);
for
(
int
i
=
0
;
i
<
nodes
.
length
;
i
++)
{
if
(
i
!=
0
&&
StringUtils
.
equals
(
nodes
[
i
].
trim
(),
""
))
{
stringBuilder
.
append
(
"所属模块不能为空格"
);
break
;
}
}
if
(!
userIds
.
contains
(
data
.
getMaintainer
()))
{
stringBuilder
.
append
(
"该工作空间下无该用户:"
+
data
.
getMaintainer
()
+
";"
);
}
...
...
frontend/src/business/components/track/case/components/TestCaseEdit.vue
浏览文件 @
de3faf3c
...
...
@@ -13,7 +13,7 @@
:label=
"$t('test_track.case.name')"
:label-width=
"formLabelWidth"
prop=
"name"
>
<el-input
:disabled=
"readOnly"
v-model
.trim
=
"form.name"
></el-input>
<el-input
:disabled=
"readOnly"
v-model=
"form.name"
></el-input>
</el-form-item>
</el-col>
...
...
@@ -313,6 +313,11 @@
if
(
localStorage
.
getItem
(
CURRENT_PROJECT
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
)).
id
;
}
param
.
name
=
param
.
name
.
trim
();
if
(
param
.
name
==
''
)
{
this
.
$warning
(
this
.
$t
(
'
test_track.case.input_name
'
));
return
;
}
this
.
$post
(
'
/test/case/
'
+
this
.
operationType
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
this
.
dialogFormVisible
=
false
;
...
...
frontend/src/business/components/track/case/components/TestCaseMove.vue
浏览文件 @
de3faf3c
...
...
@@ -5,7 +5,7 @@
:before-close=
"close"
width=
"20%"
>
<el-select
v-model
.trim
=
"module"
<el-select
v-model=
"module"
:placeholder=
"$t('test_track.case.move')"
filterable
>
<el-option
v-for=
"item in moduleOptions"
:key=
"item.id"
...
...
@@ -40,7 +40,7 @@
methods
:
{
save
()
{
if
(
this
.
module
===
''
)
{
this
.
$warning
(
this
.
$t
(
'
test_track.
plan_view.select_execute_result
'
));
this
.
$warning
(
this
.
$t
(
'
test_track.
case.input_module
'
));
return
;
}
let
param
=
{};
...
...
@@ -50,11 +50,6 @@
param
.
nodePath
=
item
.
path
;
}
});
if
(
this
.
module
===
''
)
{
this
.
$warning
(
this
.
$t
(
'
test_track.plan_view.select_executor
'
));
return
;
}
param
.
ids
=
[...
this
.
selectIds
];
this
.
$post
(
'
/test/case/batch/edit
'
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
...
...
frontend/src/business/components/track/common/NodeEdit.vue
浏览文件 @
de3faf3c
...
...
@@ -12,7 +12,7 @@
:label=
"$t('test_track.module.name')"
:label-width=
"formLabelWidth"
prop=
"name"
>
<el-input
v-model
.trim
=
"form.name"
autocomplete=
"off"
></el-input>
<el-input
v-model=
"form.name"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form>
</el-col>
...
...
@@ -69,7 +69,10 @@
if
(
valid
)
{
let
param
=
{};
let
url
=
this
.
buildParam
(
param
);
if
(
param
.
name
.
trim
()
==
''
)
{
this
.
$warning
(
this
.
$t
(
'
test_track.case.input_name
'
));
return
;
}
this
.
$post
(
url
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
this
.
$emit
(
'
refresh
'
);
...
...
@@ -95,7 +98,7 @@
param
.
id
=
this
.
node
.
id
;
param
.
level
=
this
.
node
.
level
;
}
param
.
name
=
this
.
form
.
name
;
param
.
name
=
this
.
form
.
name
.
trim
()
;
param
.
label
=
this
.
form
.
name
;
if
(
localStorage
.
getItem
(
CURRENT_PROJECT
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
)).
id
;
...
...
frontend/src/business/components/track/plan/components/TestPlanEdit.vue
浏览文件 @
de3faf3c
...
...
@@ -15,7 +15,7 @@
:label=
"$t('test_track.plan.plan_name')"
:label-width=
"formLabelWidth"
prop=
"name"
>
<el-input
v-model
.trim
=
"form.name"
></el-input>
<el-input
v-model=
"form.name"
></el-input>
</el-form-item>
</el-col>
...
...
@@ -149,6 +149,11 @@
if
(
valid
)
{
let
param
=
{};
Object
.
assign
(
param
,
this
.
form
);
param
.
name
=
param
.
name
.
trim
();
if
(
param
.
name
==
''
)
{
this
.
$warning
(
this
.
$t
(
'
test_track.plan.input_plan_name
'
));
return
;
}
param
.
workspaceId
=
localStorage
.
getItem
(
WORKSPACE_ID
);
this
.
$post
(
'
/test/plan/
'
+
this
.
operationType
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录