Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
4f163629
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,发现更多精彩内容 >>
提交
4f163629
编写于
4月 02, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试用例项目显示问题
上级
810927fe
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
44 addition
and
18 deletion
+44
-18
frontend/src/business/components/project/MsProject.vue
frontend/src/business/components/project/MsProject.vue
+5
-1
frontend/src/business/components/track/case/TestCase.vue
frontend/src/business/components/track/case/TestCase.vue
+21
-8
frontend/src/business/components/track/case/components/NodeTree.vue
...rc/business/components/track/case/components/NodeTree.vue
+8
-5
frontend/src/business/components/track/case/components/TestCaseEdit.vue
...usiness/components/track/case/components/TestCaseEdit.vue
+5
-2
frontend/src/business/components/track/case/components/TestCaseList.vue
...usiness/components/track/case/components/TestCaseList.vue
+4
-2
frontend/src/common/constants.js
frontend/src/common/constants.js
+1
-0
未找到文件。
frontend/src/business/components/project/MsProject.vue
浏览文件 @
4f163629
...
...
@@ -65,7 +65,7 @@
<
script
>
import
MsCreateBox
from
"
../settings/CreateBox
"
;
import
{
Message
}
from
"
element-ui
"
;
import
{
TokenKey
}
from
"
../../../common/constants
"
;
import
{
TokenKey
,
CURRENT_PROJECT
}
from
"
../../../common/constants
"
;
export
default
{
name
:
"
MsProject
"
,
...
...
@@ -166,6 +166,10 @@
this
.
$get
(
'
/project/delete/
'
+
row
.
id
,
()
=>
{
Message
.
success
(
this
.
$t
(
'
commons.delete_success
'
));
this
.
list
();
let
currentProject
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
));
if
(
currentProject
&&
row
.
id
===
currentProject
.
id
){
localStorage
.
removeItem
(
CURRENT_PROJECT
);
}
});
}).
catch
(()
=>
{
});
...
...
frontend/src/business/components/track/case/TestCase.vue
浏览文件 @
4f163629
...
...
@@ -9,14 +9,16 @@
<template
slot=
"title"
>
{{
currentProject
==
null
?
''
:
currentProject
.
name
}}
</
template
>
<el-scrollbar
style=
"height:500px"
>
<div
style=
"height:400px;"
>
<el-scrollbar
style=
"height:100%"
>
<label
v-for=
"(item,index) in projects"
:key=
"index"
>
<el-menu-item
@
click=
"changeProject(item)"
>
{{item.name}}
<i
class=
"el-icon-check"
v-if=
"item.id === currentProject.id"
></i>
</el-menu-item>
</label>
</el-scrollbar>
</el-scrollbar>
</div>
</el-submenu>
</el-menu>
<node-tree
class=
"node_tree"
...
...
@@ -47,7 +49,7 @@
import
NodeTree
from
'
./components/NodeTree
'
;
import
TestCaseEdit
from
'
./components/TestCaseEdit
'
;
import
{
WORKSPACE_ID
}
from
'
../../../../common/constants
'
;
import
{
WORKSPACE_ID
,
CURRENT_PROJECT
}
from
'
../../../../common/constants
'
;
import
TestCaseList
from
"
./components/TestCaseList
"
;
export
default
{
...
...
@@ -74,17 +76,28 @@
this
.
projectId
=
this
.
$route
.
params
.
projectId
;
this
.
getProjects
();
},
watch
:
{
'
$route
'
(
to
,
from
)
{
console
.
log
(
from
);
console
.
log
(
to
);
if
(
from
.
name
.
indexOf
(
"
Project
"
)
>
0
){
this
.
getProjects
();
}
}
},
methods
:
{
getProjects
()
{
this
.
$get
(
"
/project/listAll
"
,
(
response
)
=>
{
if
(
response
.
success
)
{
this
.
projects
=
response
.
data
;
this
.
initProjects
=
this
.
projects
.
slice
(
0
,
4
);
if
(
localStorage
.
getItem
(
'
currentProject
'
))
{
this
.
currentProject
=
JSON
.
parse
(
localStorage
.
getItem
(
'
currentProject
'
));
if
(
localStorage
.
getItem
(
CURRENT_PROJECT
))
{
this
.
currentProject
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
));
}
else
{
this
.
currentProject
=
this
.
projects
[
0
];
localStorage
.
setItem
(
'
currentProject
'
,
JSON
.
stringify
(
this
.
projects
[
0
]));
if
(
this
.
projects
.
length
>
0
){
localStorage
.
setItem
(
CURRENT_PROJECT
,
JSON
.
stringify
(
this
.
projects
[
0
]));
}
}
}
else
{
this
.
$message
()({
...
...
@@ -93,7 +106,7 @@
});
}
this
.
loadingRequire
.
project
=
false
;
this
.
checkProject
();
//
this.checkProject();
});
},
checkProject
()
{
...
...
@@ -108,7 +121,7 @@
},
changeProject
(
project
)
{
this
.
currentProject
=
project
;
localStorage
.
setItem
(
'
currentProject
'
,
JSON
.
stringify
(
project
));
localStorage
.
setItem
(
CURRENT_PROJECT
,
JSON
.
stringify
(
project
));
this
.
$refs
.
testCaseList
.
initTableData
()
this
.
$refs
.
nodeTree
.
getNodeTree
();
},
...
...
frontend/src/business/components/track/case/components/NodeTree.vue
浏览文件 @
4f163629
...
...
@@ -60,6 +60,9 @@
</
template
>
<
script
>
import
{
CURRENT_PROJECT
}
from
'
../../../../../common/constants
'
;
export
default
{
name
:
"
NodeTree
"
,
data
()
{
...
...
@@ -133,7 +136,7 @@
},
getChildNodeId
(
rootNode
,
nodeIds
)
{
//递归获取所有子节点ID
nodeIds
.
push
(
rootNode
.
data
.
id
)
nodeIds
.
push
(
rootNode
.
data
.
id
)
;
for
(
let
i
=
0
;
i
<
rootNode
.
childNodes
.
length
;
i
++
){
this
.
getChildNodeId
(
rootNode
.
childNodes
[
i
],
nodeIds
);
}
...
...
@@ -153,8 +156,8 @@
this
.
dialogFormVisible
=
true
;
},
getNodeTree
()
{
if
(
localStorage
.
getItem
(
'
currentProject
'
))
{
let
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
'
currentProject
'
)).
id
;
if
(
localStorage
.
getItem
(
CURRENT_PROJECT
))
{
let
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
)).
id
;
this
.
$get
(
"
/case/node/list/
"
+
projectId
,
response
=>
{
this
.
treeNodes
=
response
.
data
;
});
...
...
@@ -180,8 +183,8 @@
param
.
name
=
this
.
form
.
name
;
param
.
label
=
this
.
form
.
name
;
if
(
localStorage
.
getItem
(
'
currentProject
'
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
'
currentProject
'
)).
id
;
if
(
localStorage
.
getItem
(
CURRENT_PROJECT
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
)).
id
;
}
this
.
$post
(
url
,
param
,
response
=>
{
...
...
frontend/src/business/components/track/case/components/TestCaseEdit.vue
浏览文件 @
4f163629
...
...
@@ -180,6 +180,9 @@
</template>
<
script
>
import
{
CURRENT_PROJECT
}
from
'
../../../../../common/constants
'
;
export
default
{
name
:
"
TestCaseEdit
"
,
data
()
{
...
...
@@ -261,8 +264,8 @@
param
.
nodePath
=
item
.
path
;
}
});
if
(
localStorage
.
getItem
(
'
currentProject
'
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
'
currentProject
'
)).
id
;
if
(
localStorage
.
getItem
(
CURRENT_PROJECT
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
)).
id
;
}
this
.
$post
(
'
/test/case/
'
+
this
.
operationType
,
param
,
()
=>
{
this
.
$message
.
success
(
this
.
$t
(
'
commons.save_success
'
));
...
...
frontend/src/business/components/track/case/components/TestCaseList.vue
浏览文件 @
4f163629
...
...
@@ -119,6 +119,8 @@
</template>
<
script
>
import
{
CURRENT_PROJECT
}
from
'
../../../../../common/constants
'
;
export
default
{
name
:
"
TestCaseList
"
,
data
()
{
...
...
@@ -146,8 +148,8 @@
};
param
.
nodeIds
=
nodeIds
;
if
(
localStorage
.
getItem
(
'
currentProject
'
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
'
currentProject
'
)).
id
;
if
(
localStorage
.
getItem
(
CURRENT_PROJECT
))
{
param
.
projectId
=
JSON
.
parse
(
localStorage
.
getItem
(
CURRENT_PROJECT
)).
id
;
}
this
.
$post
(
this
.
buildPagePath
(
'
/test/case/list
'
),
param
,
response
=>
{
...
...
frontend/src/common/constants.js
浏览文件 @
4f163629
...
...
@@ -7,3 +7,4 @@ export const ROLE_TEST_USER = 'test_user';
export
const
ROLE_TEST_VIEWER
=
'
test_viewer
'
;
export
const
WORKSPACE_ID
=
'
workspace_id
'
;
export
const
CURRENT_PROJECT
=
'
current_project
'
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录