Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
f8511edd
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
f8511edd
编写于
3月 15, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zentao site admin
上级
e407781b
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
63 addition
and
81 deletion
+63
-81
internal/pkg/domain/struct.go
internal/pkg/domain/struct.go
+8
-3
internal/pkg/lib/http/url.go
internal/pkg/lib/http/url.go
+1
-1
ui/src/layouts/IndexLayout/components/RightTop.vue
ui/src/layouts/IndexLayout/components/RightTop.vue
+1
-1
ui/src/layouts/IndexLayout/components/RightTopMenu.vue
ui/src/layouts/IndexLayout/components/RightTopMenu.vue
+7
-12
ui/src/layouts/IndexLayout/routes.ts
ui/src/layouts/IndexLayout/routes.ts
+1
-1
ui/src/shims-vue.d.ts
ui/src/shims-vue.d.ts
+0
-2
ui/src/types/data.d.ts
ui/src/types/data.d.ts
+2
-2
ui/src/utils/datetime.ts
ui/src/utils/datetime.ts
+6
-2
ui/src/views/exec/history/index.vue
ui/src/views/exec/history/index.vue
+2
-2
ui/src/views/exec/history/result-func.vue
ui/src/views/exec/history/result-func.vue
+2
-2
ui/src/views/exec/history/result-unit.vue
ui/src/views/exec/history/result-unit.vue
+2
-2
ui/src/views/site/data.d.ts
ui/src/views/site/data.d.ts
+2
-0
ui/src/views/site/edit.vue
ui/src/views/site/edit.vue
+0
-1
ui/src/views/site/index.vue
ui/src/views/site/index.vue
+23
-47
ui/src/views/site/store.ts
ui/src/views/site/store.ts
+6
-3
未找到文件。
internal/pkg/domain/struct.go
浏览文件 @
f8511edd
...
...
@@ -39,6 +39,10 @@ type Response struct {
type
PageData
struct
{
Result
interface
{}
`json:"result"`
Pagination
Pagination
`json:"pagination"`
}
type
Pagination
struct
{
Total
int
`json:"total"`
Page
int
`json:"page"`
PageSize
int
`json:"pageSize"`
...
...
@@ -46,7 +50,8 @@ type PageData struct {
func
(
d
*
PageData
)
Populate
(
result
interface
{},
total
int64
,
page
,
pageSize
int
)
{
d
.
Result
=
result
d
.
Total
=
int
(
total
)
d
.
Page
=
page
d
.
PageSize
=
pageSize
d
.
Pagination
.
Total
=
int
(
total
)
d
.
Pagination
.
Page
=
page
d
.
Pagination
.
PageSize
=
pageSize
}
internal/pkg/lib/http/url.go
浏览文件 @
f8511edd
...
...
@@ -4,7 +4,7 @@ import "strings"
func
AddSepIfNeeded
(
url
string
)
(
ret
string
)
{
ret
=
url
if
strings
.
LastIndex
(
ret
,
"/"
)
!=
len
(
ret
)
{
if
strings
.
LastIndex
(
ret
,
"/"
)
!=
len
(
ret
)
-
1
{
ret
+=
"/"
}
return
...
...
ui/src/layouts/IndexLayout/components/RightTop.vue
浏览文件 @
f8511edd
...
...
@@ -7,7 +7,7 @@
</div>
<div
class=
"top-project-wrapper"
>
<
right-top-project
class=
"top-select-project"
></right-top-p
roject>
<
RightTopProject
class=
"top-select-project"
></RightTopP
roject>
</div>
<div
class=
"menu-wrapper"
>
...
...
ui/src/layouts/IndexLayout/components/RightTopMenu.vue
浏览文件 @
f8511edd
<
template
>
<div
ref=
"topMenuCon"
class=
"top-menu"
style=
"width: 100%"
>
<template
v-for=
"(item, key) in menuData"
>
<
a-l
ink
<
AL
ink
:key=
"key"
v-if=
"!item.hidden"
:to=
"item.path"
...
...
@@ -10,23 +10,16 @@
class="top-menu-li"
>
{{
t
(
item
.
title
)
}}
</
a-l
ink>
</
AL
ink>
</
template
>
</div>
</template>
<
script
lang=
"ts"
>
import
{
computed
,
ComputedRef
,
defineComponent
,
onMounted
,
PropType
,
Ref
,
ref
,
watch
}
from
"
vue
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
useStore
}
from
"
vuex
"
;
import
IconSvg
from
"
@/components/IconSvg/index
"
;
import
{
ProjectData
}
from
"
@/store/project
"
;
import
ProjectCreateForm
from
"
@/views/component/project/create.vue
"
;
import
{
createProject
}
from
"
@/services/project
"
;
import
{
hideMenu
}
from
"
@/utils/dom
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
DownOutlined
}
from
'
@ant-design/icons-vue
'
;
import
{
RoutesDataItem
}
from
"
@/utils/routes
"
;
import
ALink
from
"
@/components/ALink/index.vue
"
;
interface
RightTopMenuSetupData
{
t
:
(
key
:
string
|
number
)
=>
string
;
...
...
@@ -34,8 +27,10 @@ interface RightTopMenuSetupData {
}
export
default
defineComponent
({
name
:
'
RightTopProject
'
,
components
:
{},
name
:
'
RightTopMenu
'
,
components
:
{
ALink
},
props
:
{
menuData
:
{
type
:
Array
as
PropType
<
RoutesDataItem
[]
>
,
...
...
ui/src/layouts/IndexLayout/routes.ts
浏览文件 @
f8511edd
...
...
@@ -100,7 +100,7 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
},
{
icon
:
''
,
icon
:
'
sync
'
,
title
:
'
empty
'
,
path
:
'
/site
'
,
redirect
:
'
/site/list
'
,
...
...
ui/src/shims-vue.d.ts
浏览文件 @
f8511edd
...
...
@@ -4,5 +4,3 @@ declare module '*.vue' {
export
default
component
}
declare
module
'
@ckeditor/ckeditor5-vue
'
;
declare
module
'
@ckeditor/ckeditor5-build-decoupled-document
'
;
ui/src/types/data.d.ts
浏览文件 @
f8511edd
...
...
@@ -4,7 +4,7 @@ export interface WsMsg {
}
export
interface
QueryResult
{
data
:
any
[];
result
:
any
[];
pagination
:
PaginationConfig
;
}
...
...
@@ -17,7 +17,7 @@ export interface QueryParams {
export
interface
PaginationConfig
{
total
:
number
;
current
:
number
;
page
:
number
;
pageSize
:
number
;
showSizeChanger
:
boolean
;
showQuickJumper
:
boolean
;
...
...
ui/src/utils/datetime.ts
浏览文件 @
f8511edd
import
moment
from
"
moment
"
;
import
moment
,
{
utc
}
from
"
moment
"
;
export
function
momentTimeDef
(
tm
)
{
export
function
momentUtcDef
(
tm
)
{
return
moment
.
utc
(
tm
).
format
(
"
YYYY-MM-DD HH:mm:ss
"
)
}
export
function
momentUnixDef
(
tm
)
{
return
moment
.
unix
(
tm
).
format
(
"
YYYY-MM-DD HH:mm:ss
"
)
}
export
function
percentDef
(
numb
,
total
)
{
if
(
total
==
0
)
return
'
0%
'
return
Number
(
numb
/
total
*
100
).
toFixed
(
2
)
+
'
%
'
...
...
ui/src/views/exec/history/index.vue
浏览文件 @
f8511edd
...
...
@@ -106,7 +106,7 @@ import {useStore} from "vuex";
import
{
Empty
,
Form
,
message
,
Modal
}
from
"
ant-design-vue
"
;
import
{
StateType
}
from
"
../store
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
moment
Time
Def
,
percentDef
}
from
"
@/utils/datetime
"
;
import
{
moment
Unix
Def
,
percentDef
}
from
"
@/utils/datetime
"
;
import
{
execByDef
}
from
"
@/utils/testing
"
;
import
{
ProjectData
}
from
"
@/store/project
"
;
import
{
hideMenu
}
from
"
@/utils/dom
"
;
...
...
@@ -153,7 +153,7 @@ export default defineComponent({
const
currProject
=
computed
<
any
>
(()
=>
projectStore
.
state
.
project
.
currProject
);
const
execBy
=
execByDef
const
momentTime
=
moment
Time
Def
const
momentTime
=
moment
Unix
Def
const
percent
=
percentDef
const
columns
=
[
...
...
ui/src/views/exec/history/result-func.vue
浏览文件 @
f8511edd
...
...
@@ -138,7 +138,7 @@ import {computed, defineComponent, onMounted, ref, Ref} from "vue";
import
{
useStore
}
from
'
vuex
'
;
import
{
StateType
as
ListStateType
}
from
"
@/views/exec/store
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
moment
Time
Def
,
percentDef
}
from
"
@/utils/datetime
"
;
import
{
moment
Unix
Def
,
percentDef
}
from
"
@/utils/datetime
"
;
import
{
execByDef
,
resultStatusDef
,
testEnvDef
,
testTypeDef
}
from
"
@/utils/testing
"
;
import
{
submitResultToZentao
,
submitBugToZentao
}
from
"
@/views/exec/service
"
;
import
{
notification
}
from
"
ant-design-vue
"
;
...
...
@@ -189,7 +189,7 @@ export default defineComponent({
const
{
t
}
=
useI18n
();
const
execBy
=
execByDef
const
momentTime
=
moment
Time
Def
const
momentTime
=
moment
Unix
Def
const
percent
=
percentDef
const
testEnv
=
testEnvDef
const
testType
=
testTypeDef
...
...
ui/src/views/exec/history/result-unit.vue
浏览文件 @
f8511edd
...
...
@@ -109,7 +109,7 @@ import {computed, defineComponent, onMounted, reactive, Ref, ref} from "vue";
import
{
useStore
}
from
'
vuex
'
;
import
{
StateType
as
ListStateType
}
from
"
@/views/exec/store
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
moment
Time
Def
,
percentDef
}
from
"
@/utils/datetime
"
;
import
{
moment
Unix
Def
,
percentDef
}
from
"
@/utils/datetime
"
;
import
{
execByDef
,
resultStatusDef
,
testEnvDef
,
testTypeDef
}
from
"
@/utils/testing
"
;
import
{
jsonStrDef
}
from
"
@/utils/dom
"
;
import
{
notification
}
from
"
ant-design-vue
"
;
...
...
@@ -158,7 +158,7 @@ export default defineComponent({
const
{
t
}
=
useI18n
();
const
execBy
=
execByDef
const
momentTime
=
moment
Time
Def
const
momentTime
=
moment
Unix
Def
const
percent
=
percentDef
const
testEnv
=
testEnvDef
const
testType
=
testTypeDef
...
...
ui/src/views/site/data.d.ts
0 → 100644
浏览文件 @
f8511edd
ui/src/views/site/edit.vue
浏览文件 @
f8511edd
...
...
@@ -39,7 +39,6 @@ const useForm = Form.useForm;
import
{
useStore
}
from
"
vuex
"
;
import
{
StateType
}
from
"
@/views/site/store
"
;
import
_
from
"
lodash
"
;
interface
SiteFormSetupData
{
t
:
(
key
:
string
|
number
)
=>
string
;
...
...
ui/src/views/site/index.vue
浏览文件 @
f8511edd
...
...
@@ -21,7 +21,7 @@
<div>
<a-table
row-key=
"
seq
"
row-key=
"
id
"
:columns=
"columns"
:data-source=
"models"
:loading=
"loading"
...
...
@@ -36,38 +36,14 @@
},
}"
>
<
template
#seq=
"{ text }"
>
{{
text
}}
</
template
>
<
template
#execBy=
"{ record }"
>
{{
execBy
(
record
)
}}
</
template
>
<
template
#startTime=
"{ record }"
>
<span
v-if=
"record.startTime"
>
{{
momentTime
(
record
.
startTime
)
}}
</span>
</
template
>
<
template
#duration=
"{ record }"
>
{{
record
.
duration
}}
秒
</
template
>
<
template
#result=
"{ record }"
>
<span
class=
"t-pass t-status"
>
{{
record
.
pass
}}
<icon-svg
type=
"pass"
></icon-svg>
(
{{
percent
(
record
.
pass
,
record
.
total
)
}}
)
</span>
<span
class=
"t-fail t-status"
>
{{
record
.
fail
}}
<icon-svg
type=
"fail"
></icon-svg>
(
{{
percent
(
record
.
fail
,
record
.
total
)
}}
)
</span>
<span
class=
"t-skip t-status"
>
{{
record
.
skip
}}
<icon-svg
type=
"skip"
></icon-svg>
(
{{
percent
(
record
.
skip
,
record
.
total
)
}}
)
</span>
<
template
#createdAt=
"{ record }"
>
<span
v-if=
"record.createdAt"
>
{{
momentUtc
(
record
.
createdAt
)
}}
</span>
</
template
>
<
template
#action=
"{ record }"
>
<a-button
@
click=
"() =>
viewResult(recor
d)"
type=
"link"
size=
"small"
>
{{
t
(
'
view
'
)
}}
</a-button>
<a-button
@
click=
"() =>
deleteExec
(record)"
type=
"link"
size=
"small"
<a-button
@
click=
"() =>
edit(record.i
d)"
type=
"link"
size=
"small"
>
{{
t
(
'
view
'
)
}}
</a-button>
<a-button
@
click=
"() =>
record
(record)"
type=
"link"
size=
"small"
:loading=
"removeLoading.includes(record.seq)"
>
{{
t
(
'
delete
'
)
}}
</a-button>
</
template
>
...
...
@@ -85,9 +61,8 @@ import {useStore} from "vuex";
import
{
Empty
,
Form
,
message
,
Modal
}
from
"
ant-design-vue
"
;
import
{
StateType
}
from
"
./store
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
moment
Time
Def
}
from
"
@/utils/datetime
"
;
import
{
moment
Utc
Def
}
from
"
@/utils/datetime
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
IconSvg
from
"
@/components/IconSvg/index
"
;
import
{
PaginationConfig
,
QueryParams
}
from
"
@/types/data
"
;
import
debounce
from
"
lodash.debounce
"
;
...
...
@@ -110,18 +85,17 @@ interface SiteListSetupData {
remove
:
(
item
)
=>
void
;
onSearch
:
()
=>
void
;
moment
Time
:
(
tm
)
=>
string
;
moment
Utc
:
(
tm
)
=>
string
;
simpleImage
:
any
}
export
default
defineComponent
({
name
:
'
SiteListPage
'
,
components
:
{
IconSvg
,
},
setup
():
SiteListSetupData
{
const
{
t
}
=
useI18n
();
const
moment
Time
=
momentTime
Def
const
moment
Utc
=
momentUtc
Def
const
onSearch
=
debounce
(()
=>
{
getList
(
1
)
...
...
@@ -134,7 +108,10 @@ export default defineComponent({
const
columns
=
[
{
title
:
t
(
'
no
'
),
dataIndex
:
'
seq
'
,
dataIndex
:
'
index
'
,
width
:
80
,
customRender
:
({
text
,
index
}:
{
text
:
any
;
index
:
number
})
=>
(
pagination
.
value
.
page
-
1
)
*
pagination
.
value
.
pageSize
+
index
+
1
,
},
{
title
:
t
(
'
name
'
),
...
...
@@ -150,8 +127,8 @@ export default defineComponent({
},
{
title
:
t
(
'
create_time
'
),
dataIndex
:
'
create
Time
'
,
slots
:
{
customRender
:
'
create
Time
'
},
dataIndex
:
'
create
dAt
'
,
slots
:
{
customRender
:
'
create
dAt
'
},
},
{
title
:
t
(
'
opt
'
),
...
...
@@ -177,27 +154,26 @@ export default defineComponent({
const
router
=
useRouter
();
const
store
=
useStore
<
{
Site
:
StateType
}
>
();
const
models
=
computed
<
any
[]
>
(()
=>
store
.
state
.
Site
.
queryResult
.
data
);
const
models
=
computed
<
any
[]
>
(()
=>
store
.
state
.
Site
.
queryResult
.
result
);
const
pagination
=
computed
<
PaginationConfig
>
(()
=>
store
.
state
.
Site
.
queryResult
.
pagination
);
const
queryParams
=
ref
<
QueryParams
>
({
keywords
:
''
,
enabled
:
'
1
'
,
page
:
pagination
.
value
.
current
,
pageSize
:
pagination
.
value
.
pageSize
keywords
:
''
,
enabled
:
'
1
'
,
page
:
pagination
.
value
.
page
,
pageSize
:
pagination
.
value
.
pageSize
});
const
loading
=
ref
<
boolean
>
(
true
);
const
getList
=
(
current
:
number
)
=>
{
const
getList
=
(
page
:
number
)
=>
{
loading
.
value
=
true
;
store
.
dispatch
(
'
Site/list
'
,
{
keywords
:
queryParams
.
value
.
keywords
,
enabled
:
queryParams
.
value
.
enabled
,
pageSize
:
pagination
.
value
.
pageSize
,
page
:
current
});
page
:
page
});
loading
.
value
=
false
;
}
getList
(
1
);
onMounted
(()
=>
{
console
.
log
(
'
onMounted
'
)
getList
(
1
);
})
const
edit
=
(
id
)
=>
{
...
...
@@ -216,7 +192,7 @@ export default defineComponent({
const
res
:
boolean
=
await
store
.
dispatch
(
'
History/delete
'
,
item
.
seq
);
if
(
res
===
true
)
{
message
.
success
(
t
(
'
delete_success
'
));
await
getList
(
pagination
.
value
.
current
);
await
getList
(
pagination
.
value
.
page
);
}
removeLoading
.
value
=
[];
}
...
...
@@ -239,7 +215,7 @@ export default defineComponent({
remove
,
onSearch
,
moment
Time
,
moment
Utc
,
simpleImage
:
Empty
.
PRESENTED_IMAGE_SIMPLE
,
}
}
...
...
ui/src/views/site/store.ts
浏览文件 @
f8511edd
...
...
@@ -26,10 +26,10 @@ export interface ModuleType extends StoreModuleType<StateType> {
}
const
initState
:
StateType
=
{
queryResult
:
{
data
:
[],
result
:
[],
pagination
:
{
total
:
0
,
current
:
1
,
page
:
1
,
pageSize
:
10
,
showSizeChanger
:
true
,
showQuickJumper
:
true
,
...
...
@@ -56,9 +56,12 @@ const StoreModel: ModuleType = {
async
list
({
commit
},
params
:
QueryParams
)
{
try
{
const
response
:
ResponseData
=
await
list
(
params
);
if
(
response
.
code
!=
0
)
return
;
if
(
response
.
code
!=
0
)
{
return
;
}
const
data
=
response
.
data
;
commit
(
'
setQueryResult
'
,
data
);
console
.
log
(
'
sdfdsf
'
,
data
)
return
true
;
}
catch
(
error
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录