Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
1f84e55c
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,发现更多精彩内容 >>
提交
1f84e55c
编写于
5月 29, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决全屏对话框浏览器回退问题
上级
18eee8c2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
67 addition
and
24 deletion
+67
-24
backend/src/main/java/io/metersphere/service/ProjectService.java
.../src/main/java/io/metersphere/service/ProjectService.java
+9
-7
backend/src/main/java/io/metersphere/track/service/TestCaseService.java
...in/java/io/metersphere/track/service/TestCaseService.java
+9
-7
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
...in/java/io/metersphere/track/service/TestPlanService.java
+9
-7
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue
...onents/track/plan/view/comonents/TestPlanTestCaseEdit.vue
+15
-2
frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue
...plan/view/comonents/report/TestCaseReportTemplateEdit.vue
+13
-1
frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue
...s/track/plan/view/comonents/report/TestCaseReportView.vue
+12
-0
未找到文件。
backend/src/main/java/io/metersphere/service/ProjectService.java
浏览文件 @
1f84e55c
...
...
@@ -130,13 +130,15 @@ public class ProjectService {
}
private
void
checkProjectExist
(
Project
project
)
{
ProjectExample
example
=
new
ProjectExample
();
example
.
createCriteria
()
.
andNameEqualTo
(
project
.
getName
())
.
andWorkspaceIdEqualTo
(
SessionUtils
.
getCurrentWorkspaceId
())
.
andIdNotEqualTo
(
project
.
getId
());
if
(
projectMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
MSException
.
throwException
(
Translator
.
get
(
"project_name_already_exists"
));
if
(
project
.
getName
()
!=
null
)
{
ProjectExample
example
=
new
ProjectExample
();
example
.
createCriteria
()
.
andNameEqualTo
(
project
.
getName
())
.
andWorkspaceIdEqualTo
(
SessionUtils
.
getCurrentWorkspaceId
())
.
andIdNotEqualTo
(
project
.
getId
());
if
(
projectMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
MSException
.
throwException
(
Translator
.
get
(
"project_name_already_exists"
));
}
}
}
...
...
backend/src/main/java/io/metersphere/track/service/TestCaseService.java
浏览文件 @
1f84e55c
...
...
@@ -97,13 +97,15 @@ public class TestCaseService {
}
private
void
checkTestCaseExist
(
TestCaseWithBLOBs
testCase
)
{
TestCaseExample
example
=
new
TestCaseExample
();
example
.
createCriteria
()
.
andNameEqualTo
(
testCase
.
getName
())
.
andProjectIdEqualTo
(
testCase
.
getProjectId
())
.
andIdNotEqualTo
(
testCase
.
getId
());
if
(
testCaseMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
MSException
.
throwException
(
Translator
.
get
(
"test_case_already_exists"
));
if
(
testCase
.
getName
()
!=
null
)
{
TestCaseExample
example
=
new
TestCaseExample
();
example
.
createCriteria
()
.
andNameEqualTo
(
testCase
.
getName
())
.
andProjectIdEqualTo
(
testCase
.
getProjectId
())
.
andIdNotEqualTo
(
testCase
.
getId
());
if
(
testCaseMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
MSException
.
throwException
(
Translator
.
get
(
"test_case_already_exists"
));
}
}
}
...
...
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
浏览文件 @
1f84e55c
...
...
@@ -95,13 +95,15 @@ public class TestPlanService {
}
private
void
checkTestPlanExist
(
TestPlan
testPlan
)
{
TestPlanExample
example
=
new
TestPlanExample
();
example
.
createCriteria
()
.
andNameEqualTo
(
testPlan
.
getName
())
.
andWorkspaceIdEqualTo
(
SessionUtils
.
getCurrentWorkspaceId
())
.
andIdNotEqualTo
(
testPlan
.
getId
());
if
(
testPlanMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
MSException
.
throwException
(
Translator
.
get
(
"plan_name_already_exists"
));
if
(
testPlan
.
getName
()
!=
null
)
{
TestPlanExample
example
=
new
TestPlanExample
();
example
.
createCriteria
()
.
andNameEqualTo
(
testPlan
.
getName
())
.
andWorkspaceIdEqualTo
(
SessionUtils
.
getCurrentWorkspaceId
())
.
andIdNotEqualTo
(
testPlan
.
getId
());
if
(
testPlanMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
MSException
.
throwException
(
Translator
.
get
(
"plan_name_already_exists"
));
}
}
}
...
...
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue
浏览文件 @
1f84e55c
...
...
@@ -232,11 +232,23 @@
}
},
methods
:
{
handleClose
(
done
)
{
listenGoBack
()
{
//监听浏览器返回操作,关闭该对话框
if
(
window
.
history
&&
window
.
history
.
pushState
)
{
history
.
pushState
(
null
,
null
,
document
.
URL
);
window
.
addEventListener
(
'
popstate
'
,
this
.
goBack
,
false
);
}
},
goBack
()
{
this
.
handleClose
();
},
handleClose
()
{
//移除监听,防止监听其他页面
window
.
removeEventListener
(
'
popstate
'
,
this
.
goBack
,
false
);
this
.
showDialog
=
false
;
},
cancel
()
{
this
.
showDialog
=
false
;
this
.
handleClose
()
;
this
.
$emit
(
'
refreshTable
'
);
},
statusChange
(
status
)
{
...
...
@@ -299,6 +311,7 @@
},
openTestCaseEdit
(
testCase
)
{
this
.
showDialog
=
true
;
this
.
listenGoBack
();
this
.
initData
(
testCase
);
},
initTest
()
{
...
...
frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue
浏览文件 @
1f84e55c
...
...
@@ -91,6 +91,16 @@
}
},
methods
:
{
listenGoBack
()
{
//监听浏览器返回操作,关闭该对话框
if
(
window
.
history
&&
window
.
history
.
pushState
)
{
history
.
pushState
(
null
,
null
,
document
.
URL
);
window
.
addEventListener
(
'
popstate
'
,
this
.
goBack
,
false
);
}
},
goBack
()
{
this
.
handleClose
();
},
open
(
id
,
isReport
)
{
if
(
isReport
)
{
this
.
isReport
=
isReport
;
...
...
@@ -112,6 +122,7 @@
this
.
initComponents
();
}
this
.
showDialog
=
true
;
this
.
listenGoBack
();
},
initComponents
()
{
this
.
componentMap
.
forEach
((
value
,
key
)
=>
{
...
...
@@ -134,6 +145,7 @@
});
},
handleClose
()
{
window
.
removeEventListener
(
'
popstate
'
,
this
.
goBack
,
false
);
this
.
showDialog
=
false
;
},
change
(
evt
)
{
...
...
@@ -221,7 +233,7 @@
}
this
.
$post
(
url
+
this
.
type
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
this
.
showDialog
=
false
;
this
.
handleClose
()
;
this
.
$emit
(
'
refresh
'
);
});
},
...
...
frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue
浏览文件 @
1f84e55c
...
...
@@ -78,12 +78,23 @@
}
},
methods
:
{
listenGoBack
()
{
//监听浏览器返回操作,关闭该对话框
if
(
window
.
history
&&
window
.
history
.
pushState
)
{
history
.
pushState
(
null
,
null
,
document
.
URL
);
window
.
addEventListener
(
'
popstate
'
,
this
.
goBack
,
false
);
}
},
goBack
()
{
this
.
handleClose
();
},
open
(
id
)
{
if
(
id
)
{
this
.
reportId
=
id
;
}
this
.
getReport
();
this
.
showDialog
=
true
;
this
.
listenGoBack
();
},
getReport
()
{
this
.
result
=
this
.
$get
(
'
/case/report/get/
'
+
this
.
reportId
,
response
=>
{
...
...
@@ -113,6 +124,7 @@
});
},
handleClose
()
{
window
.
removeEventListener
(
'
popstate
'
,
this
.
goBack
,
false
);
this
.
showDialog
=
false
;
},
handleEdit
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录