Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
ec514306
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
大约 1 年 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ec514306
编写于
1月 28, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
redirect if switch to an unittest project
上级
8ffd64bc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
55 addition
and
17 deletion
+55
-17
ui/src/layouts/IndexLayout/components/RightTopProject.vue
ui/src/layouts/IndexLayout/components/RightTopProject.vue
+14
-13
ui/src/utils/dom.ts
ui/src/utils/dom.ts
+10
-2
ui/src/views/exec/history/index.vue
ui/src/views/exec/history/index.vue
+8
-2
ui/src/views/exec/history/result-func.vue
ui/src/views/exec/history/result-func.vue
+15
-0
ui/src/views/exec/history/result-unit.vue
ui/src/views/exec/history/result-unit.vue
+8
-0
未找到文件。
ui/src/layouts/IndexLayout/components/RightTopProject.vue
浏览文件 @
ec514306
...
...
@@ -21,12 +21,13 @@
<
script
lang=
"ts"
>
import
{
computed
,
ComputedRef
,
defineComponent
,
onMounted
,
Ref
,
ref
,
watch
}
from
"
vue
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
ProjectData
}
from
"
@/store/project
"
;
import
ProjectCreateForm
from
"
@/views/component/project/create.vue
"
;
import
{
createProject
}
from
"
@/services/project
"
;
import
{
addClass
,
removeClass
}
from
"
@/utils/dom
"
;
import
{
addClass
,
hideMenu
,
removeClass
}
from
"
@/utils/dom
"
;
interface
RightTopProject
{
projects
:
ComputedRef
<
any
[]
>
;
...
...
@@ -43,30 +44,30 @@ export default defineComponent({
name
:
'
RightTopProject
'
,
components
:
{
ProjectCreateForm
},
setup
():
RightTopProject
{
const
router
=
useRouter
();
const
store
=
useStore
<
{
project
:
ProjectData
}
>
();
const
projects
=
computed
<
any
[]
>
(()
=>
store
.
state
.
project
.
projects
);
const
currProject
=
computed
<
any
>
(()
=>
store
.
state
.
project
.
currProject
);
store
.
dispatch
(
'
project/fetchProject
'
,
''
);
const
hideMenu
=
(
)
=>
{
const
scriptMenu
=
document
.
getElementById
(
'
menu-script
'
)
if
(
currProject
.
value
.
type
===
'
unit
'
)
addClass
(
scriptMenu
,
'
t-hidden
'
)
else
removeClass
(
scriptMenu
,
'
t-hidden
'
)
const
scriptSync
=
document
.
getElementById
(
'
menu-sync
'
)
if
(
currProject
.
value
.
type
===
'
unit
'
)
addClass
(
scriptSync
,
'
t-hidden
'
)
else
removeClass
(
scriptSync
,
'
t-hidden
'
)
const
switchProject
=
(
newProject
)
=>
{
const
routerPath
=
router
.
currentRoute
.
value
.
path
if
(
routerPath
.
indexOf
(
'
/exec/history/
'
)
>
-
1
||
(
newProject
.
type
===
'
unit
'
&&
(
routerPath
===
'
/sync
'
||
routerPath
===
'
/script/list
'
)))
{
router
.
push
(
`/exec/history`
)
// will call hideMenu on this page
}
else
{
hideMenu
(
newProject
)
}
}
watch
(
currProject
,
(
)
=>
{
console
.
log
(
'
watch currProject
'
,
currProject
)
hideMenu
(
)
watch
(
currProject
,
(
newProject
,
oldVal
)
=>
{
console
.
log
(
'
watch currProject
'
,
newProject
.
type
)
switchProject
(
newProject
)
},
{
deep
:
true
})
onMounted
(()
=>
{
console
.
log
(
'
onMounted
'
)
hideMenu
()
})
const
selectProject
=
(
value
):
void
=>
{
...
...
ui/src/utils/dom.ts
浏览文件 @
ec514306
...
...
@@ -65,8 +65,6 @@ export function hasClass( elements, cName ){
return
!!
elements
.
className
.
match
(
new
RegExp
(
"
(
\\
s|^)
"
+
cName
+
"
(
\\
s|$)
"
)
)
}
export
function
addClass
(
elements
,
cName
){
console
.
log
(
elements
)
if
(
!
elements
)
return
if
(
!
hasClass
(
elements
,
cName
)
){
elements
.
className
+=
"
"
+
cName
...
...
@@ -82,4 +80,14 @@ export function removeClass( elements, cName ){
export
function
jsonStrDef
(
obj
)
{
const
msg
=
JSON
.
stringify
(
obj
)
return
msg
}
export
function
hideMenu
(
newVal
)
{
const
scriptMenu
=
document
.
getElementById
(
'
menu-script
'
)
if
(
newVal
.
type
===
'
unit
'
)
addClass
(
scriptMenu
,
'
t-hidden
'
)
else
removeClass
(
scriptMenu
,
'
t-hidden
'
)
const
scriptSync
=
document
.
getElementById
(
'
menu-sync
'
)
if
(
newVal
.
type
===
'
unit
'
)
addClass
(
scriptSync
,
'
t-hidden
'
)
else
removeClass
(
scriptSync
,
'
t-hidden
'
)
}
\ No newline at end of file
ui/src/views/exec/history/index.vue
浏览文件 @
ec514306
...
...
@@ -70,6 +70,7 @@ import {useRouter} from "vue-router";
import
{
momentTimeDef
,
percentDef
}
from
"
@/utils/datetime
"
;
import
{
execByDef
}
from
"
@/utils/testing
"
;
import
{
ProjectData
}
from
"
@/store/project
"
;
import
{
hideMenu
}
from
"
@/utils/dom
"
;
interface
ListExecSetupData
{
currProject
:
ComputedRef
;
...
...
@@ -157,11 +158,16 @@ export default defineComponent({
}
list
();
watch
(
currProject
,
()
=>
{
console
.
log
(
'
watch currProject
'
,
curr
Project
)
watch
(
currProject
,
(
newProject
,
oldVal
)
=>
{
console
.
log
(
'
watch currProject
'
,
new
Project
)
list
()
},
{
deep
:
true
})
onMounted
(()
=>
{
console
.
log
(
'
onMounted
'
)
hideMenu
(
currProject
.
value
)
// jump from not available page for unittest
})
// 查看
const
viewResult
=
(
item
)
=>
{
router
.
push
(
`/exec/history/
${
item
.
testType
}
/
${
item
.
seq
}
`
)
...
...
ui/src/views/exec/history/result-func.vue
浏览文件 @
ec514306
...
...
@@ -8,6 +8,10 @@
<div
class=
"opt"
>
<a-button
@
click=
"exec('all')"
type=
"primary"
>
重新执行所有用例
</a-button>
<a-button
@
click=
"exec('fail')"
type=
"primary"
>
重新执行失败用例
</a-button>
<a-button
@
click=
"submitResult()"
>
提交结果到禅道
</a-button>
<a-button
@
click=
"submitBug()"
>
提交缺陷到禅道
</a-button>
<a-button
type=
"link"
@
click=
"() => back()"
>
返回
</a-button>
</div>
</
template
>
...
...
@@ -103,6 +107,8 @@ interface DesignExecutionPageSetupData {
loading
:
Ref
<
boolean
>
;
exec
:
(
scope
)
=>
void
;
submitResult
:
()
=>
void
;
submitBug
:
()
=>
void
;
back
:
()
=>
void
;
execBy
:
(
item
)
=>
string
;
...
...
@@ -173,6 +179,13 @@ export default defineComponent({
if
(
execBy
===
'
case
'
)
router
.
push
(
`/exec/run/
${
execBy
}
/
${
seq
}
/
${
scope
}
`
)
else
router
.
push
(
`/exec/run/
${
execBy
}
/
${
productId
}
/
${
execById
}
/
${
seq
}
/
${
scope
}
`
)
}
const
submitResult
=
():
void
=>
{
console
.
log
(
'
submitResult
'
)
}
const
submitBug
=
():
void
=>
{
console
.
log
(
'
submitBug
'
)
}
const
back
=
():
void
=>
{
router
.
push
(
`/exec/history`
)
}
...
...
@@ -186,6 +199,8 @@ export default defineComponent({
columns
,
loading
,
exec
,
submitResult
,
submitBug
,
back
,
execBy
,
...
...
ui/src/views/exec/history/result-unit.vue
浏览文件 @
ec514306
...
...
@@ -6,6 +6,8 @@
</
template
>
<
template
#extra
>
<div
class=
"opt"
>
<a-button
@
click=
"submitResult()"
>
提交结果到禅道
</a-button>
<a-button
type=
"link"
@
click=
"() => back()"
>
返回
</a-button>
</div>
</
template
>
...
...
@@ -96,6 +98,7 @@ interface DesignExecutionPageSetupData {
loading
:
Ref
<
boolean
>
;
exec
:
(
scope
)
=>
void
;
submitResult
:
()
=>
void
;
back
:
()
=>
void
;
visibleMap
:
Ref
...
...
@@ -183,6 +186,10 @@ export default defineComponent({
else
router
.
push
(
`/exec/run/
${
execBy
}
/
${
productId
}
/
${
execById
}
/
${
seq
}
/
${
scope
}
`
)
}
const
submitResult
=
():
void
=>
{
console
.
log
(
'
submitResult
'
)
}
const
showInfo
=
(
id
):
void
=>
{
visibleMap
[
id
]
=
true
}
...
...
@@ -203,6 +210,7 @@ export default defineComponent({
columns
,
loading
,
exec
,
submitResult
,
back
,
visibleMap
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录