Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
96c5ce38
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
96c5ce38
编写于
5月 11, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
list sites with products
上级
c7b00f73
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
111 addition
and
34 deletion
+111
-34
internal/comm/helper/zentao/zentao.go
internal/comm/helper/zentao/zentao.go
+6
-11
internal/server/modules/v1/domain/zentao.go
internal/server/modules/v1/domain/zentao.go
+5
-2
internal/server/modules/v1/service/site.go
internal/server/modules/v1/service/site.go
+4
-9
ui/src/layouts/MainLayout/components/SiteNav.vue
ui/src/layouts/MainLayout/components/SiteNav.vue
+91
-12
xdoc/notes.txt
xdoc/notes.txt
+5
-0
未找到文件。
internal/comm/helper/zentao/zentao.go
浏览文件 @
96c5ce38
...
...
@@ -108,22 +108,17 @@ func LoadSiteProduct(currSite serverDomain.ZentaoSite, currProductId int) (
return
}
var
first
serverDomain
.
ZentaoProduct
for
idx
,
product
:=
range
products
{
product
:=
serverDomain
.
ZentaoProduct
{
Id
:
product
.
Id
,
Name
:
product
.
Name
}
currIndex
:=
0
for
idx
,
item
:=
range
products
{
product
:=
serverDomain
.
ZentaoProduct
{
Id
:
item
.
Id
,
Name
:
item
.
Name
}
if
currProductId
==
product
.
Id
{
currProduct
=
product
}
if
idx
==
0
{
first
=
product
currIndex
=
idx
}
}
if
currProduct
.
Id
==
0
{
// not found, use the first one
currProduct
=
first
}
currProduct
=
products
[
currIndex
]
products
[
currIndex
]
.
Checked
=
true
return
}
...
...
internal/server/modules/v1/domain/zentao.go
浏览文件 @
96c5ce38
...
...
@@ -27,10 +27,13 @@ type ZentaoSite struct {
Url
string
`json:"url"`
Username
string
`json:"username"`
Password
string
`json:"password"`
Checked
bool
`json:"checked"`
}
type
ZentaoProduct
struct
{
Id
int
`json:"id"`
Name
string
`json:"name"`
Id
int
`json:"id"`
Name
string
`json:"name"`
Checked
bool
`json:"checked"`
}
type
ZentaoModule
struct
{
...
...
internal/server/modules/v1/service/site.go
浏览文件 @
96c5ce38
...
...
@@ -98,7 +98,7 @@ func (s *SiteService) LoadSites(currSiteId int) (sites []serverDomain.ZentaoSite
}
sites
=
[]
serverDomain
.
ZentaoSite
{}
var
first
serverDomain
.
ZentaoSite
currIndex
:=
0
for
idx
,
item
:=
range
pos
{
site
:=
serverDomain
.
ZentaoSite
{
Id
:
int
(
item
.
ID
),
...
...
@@ -109,19 +109,14 @@ func (s *SiteService) LoadSites(currSiteId int) (sites []serverDomain.ZentaoSite
}
if
uint
(
currSiteId
)
==
item
.
ID
{
currSite
=
site
}
if
idx
==
0
{
first
=
site
currIndex
=
idx
}
sites
=
append
(
sites
,
site
)
}
if
currSite
.
Id
==
0
{
// not found, use the first one
currSite
=
first
}
currSite
=
sites
[
currIndex
]
// default is first one
sites
[
currIndex
]
.
Checked
=
true
return
}
...
...
ui/src/layouts/MainLayout/components/SiteNav.vue
浏览文件 @
96c5ce38
<
template
>
<ButtonGroup
class=
"space-left"
>
<Button
class=
"rounded border lighten-16"
icon=
"zentao"
iconColor=
"var(--color-blue)"
iconClass=
"off-off"
label=
"当前禅道站点"
suffix-icon=
"caret-down"
id=
"siteMenuToggle"
/>
<Button
class=
"rounded border lighten-16"
icon=
"cube"
label=
"当前产品"
suffix-icon=
"caret-down"
id=
"productMenuToggle"
/>
<Button
id=
"siteMenuToggle"
:label=
"currSite.name"
icon=
"zentao"
class=
"rounded border lighten-16"
iconColor=
"var(--color-blue)"
iconClass=
"off-off"
suffix-icon=
"caret-down"
/>
<Button
id=
"productMenuToggle"
:label=
"currProduct.name"
icon=
"cube"
class=
"rounded border lighten-16"
suffix-icon=
"caret-down"
/>
</ButtonGroup>
<DropdownMenu
:items=
"[
{checked: false, title: 'product 1'},
{checked: false, title: 'product 2'},
{checked: true, title: 'product 3', active: true},
{checked: false, title: 'product 4'}
]"
toggle="#productMenuToggle"
/>
<DropdownMenu
toggle=
"#siteMenuToggle"
>
<div>
custom site menu
</div>
toggle=
"#siteMenuToggle"
:items=
"sites"
:replaceFields=
"replaceFields"
>
</DropdownMenu>
<DropdownMenu
toggle=
"#productMenuToggle"
:items=
"products"
:replaceFields=
"replaceFields"
/>
</
template
>
<
script
setup
lang=
"ts"
>
import
Button
from
'
./Button.vue
'
;
import
ButtonGroup
from
'
./ButtonGroup.vue
'
;
import
DropdownMenu
from
'
./DropdownMenu.vue
'
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
computed
,
onMounted
,
watch
}
from
"
vue
"
;
import
{
getInitStatus
}
from
"
@/utils/cache
"
;
import
{
notification
}
from
"
ant-design-vue
"
;
const
{
t
}
=
useI18n
();
const
router
=
useRouter
();
const
store
=
useStore
<
{
Zentao
:
ZentaoData
}
>
();
const
sites
=
computed
<
any
[]
>
(()
=>
store
.
state
.
Zentao
.
sites
);
const
products
=
computed
<
any
>
(()
=>
store
.
state
.
Zentao
.
products
);
const
currSite
=
computed
<
any
>
(()
=>
store
.
state
.
Zentao
.
currSite
);
const
currProduct
=
computed
<
any
>
(()
=>
store
.
state
.
Zentao
.
currProduct
);
store
.
dispatch
(
'
Zentao/fetchSitesAndProduct
'
,
{}).
then
((
payload
)
=>
{
showZentaoMsg
(
payload
)
})
watch
(
currSite
,
()
=>
{
console
.
log
(
`watch currSite id =
${
currSite
.
value
.
id
}
`
)
if
(
currSite
.
value
.
id
<=
0
)
{
getInitStatus
().
then
((
initStatus
)
=>
{
console
.
log
(
'
initStatus
'
,
initStatus
)
if
(
!
initStatus
)
{
router
.
push
(
`/site/list`
)
}
})
}
})
onMounted
(()
=>
{
console
.
log
(
'
onMounted
'
)
})
const
showZentaoMsg
=
(
payload
):
void
=>
{
if
(
payload
.
zentaoErr
)
{
notification
.
error
({
message
:
t
(
'
zentao_request_failed_title
'
),
description
:
t
(
'
zentao_request_failed_desc
'
),
duration
:
null
,
});
}
}
const
selectSite
=
(
site
):
void
=>
{
console
.
log
(
'
selectSite
'
,
site
)
store
.
dispatch
(
'
Zentao/fetchSitesAndProduct
'
,
{
currSiteId
:
site
.
id
}).
then
((
payload
)
=>
{
showZentaoMsg
(
payload
)
})
}
const
selectProduct
=
(
product
):
void
=>
{
console
.
log
(
'
selectProduct
'
,
product
)
store
.
dispatch
(
'
Zentao/fetchSitesAndProduct
'
,
{
currProductId
:
product
.
id
}).
then
((
payload
)
=>
{
showZentaoMsg
(
payload
)
})
}
const
replaceFields
=
{
title
:
'
name
'
,
}
</
script
>
xdoc/notes.txt
浏览文件 @
96c5ce38
...
...
@@ -46,3 +46,8 @@ client/out/ztf-darwin-x64/ztf.app/Contents/MacOS/ztf
任务列表
用例树状列表(按模块组织,可以根据模块、套件、任务过滤)
sonar-scanner \
-Dsonar.projectKey=ztf \
-Dsonar.sources=. \
-Dsonar.host.url=http://10.8.1.10:59000 \
-Dsonar.login=412093d8c90b99378b48139915fbf275509092ad
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录