Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
cdf371a7
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,发现更多精彩内容 >>
提交
cdf371a7
编写于
2月 15, 2022
作者:
m0_58228130
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/main' into main
上级
b45e5300
a18d1c2a
变更
27
展开全部
显示空白变更内容
内联
并排
Showing
27 changed file
with
549 addition
and
467 deletion
+549
-467
Makefile
Makefile
+4
-4
client/forge.config.js
client/forge.config.js
+1
-1
client/package-lock.json
client/package-lock.json
+102
-102
client/package.json
client/package.json
+5
-0
internal/comm/consts/var.go
internal/comm/consts/var.go
+3
-3
internal/comm/helper/script/asset.go
internal/comm/helper/script/asset.go
+1
-1
internal/comm/helper/zentao/case.go
internal/comm/helper/zentao/case.go
+3
-3
internal/command/config/config.go
internal/command/config/config.go
+10
-12
internal/command/index.go
internal/command/index.go
+1
-1
internal/pkg/lib/common/utils.go
internal/pkg/lib/common/utils.go
+5
-5
internal/pkg/lib/file/file.go
internal/pkg/lib/file/file.go
+31
-28
internal/server/config/init.go
internal/server/config/init.go
+17
-3
internal/server/core/dao/index.go
internal/server/core/dao/index.go
+6
-1
internal/server/modules/v1/controller/project.go
internal/server/modules/v1/controller/project.go
+8
-20
internal/server/modules/v1/controller/test-exec.go
internal/server/modules/v1/controller/test-exec.go
+6
-0
internal/server/modules/v1/controller/zentao.go
internal/server/modules/v1/controller/zentao.go
+5
-0
internal/server/modules/v1/index/project.go
internal/server/modules/v1/index/project.go
+0
-1
internal/server/modules/v1/service/project.go
internal/server/modules/v1/service/project.go
+1
-1
ui/src/layouts/IndexLayout/components/RightTopProject.vue
ui/src/layouts/IndexLayout/components/RightTopProject.vue
+13
-3
ui/src/layouts/IndexLayout/index.vue
ui/src/layouts/IndexLayout/index.vue
+0
-1
ui/src/locales/en-US.ts
ui/src/locales/en-US.ts
+2
-0
ui/src/locales/zh-CN.ts
ui/src/locales/zh-CN.ts
+2
-0
ui/src/views/config/index.vue
ui/src/views/config/index.vue
+7
-2
ui/src/views/exec/history/index.vue
ui/src/views/exec/history/index.vue
+215
-209
ui/src/views/refresh/test.vue
ui/src/views/refresh/test.vue
+18
-0
ui/src/views/script/index/main.vue
ui/src/views/script/index/main.vue
+8
-2
ui/src/views/sync/index.vue
ui/src/views/sync/index.vue
+75
-64
未找到文件。
Makefile
浏览文件 @
cdf371a7
...
...
@@ -27,19 +27,19 @@ compile_all: compile_win64 compile_win32 compile_linux compile_mac
compile_win64
:
@
echo
'start compile win64'
@
CGO_ENABLED
=
1
GOOS
=
windows
GOARCH
=
amd64 go build
-o
${BIN_WIN64}
ztf
.exe cmd/server/main.go
@
CGO_ENABLED
=
1
CC
=
x86_64-w64-mingw32-gcc
CXX
=
x86_64-w64-mingw32-g++
GOOS
=
windows
GOARCH
=
amd64 go build
-x
-v
-ldflags
"-s -w"
-o
${BIN_WIN64}${BINARY}
.exe cmd/server/main.go
compile_win32
:
@
echo
'start compile win32'
@
CGO_ENABLED
=
1
GOOS
=
windows
GOARCH
=
386 go build
-o
${BIN_WIN32}
ztf
.exe cmd/server/main.go
@
CGO_ENABLED
=
1
CC
=
i686-w64-mingw32-gcc
CXX
=
i686-w64-mingw32-g++
GOOS
=
windows
GOARCH
=
386 go build
-x
-v
-ldflags
"-s -w"
-o
${BIN_WIN32}${BINARY}
.exe cmd/server/main.go
compile_linux
:
@
echo
'start compile linux'
CGO_ENABLED
=
1
GOOS
=
linux
GOARCH
=
amd64
go build
-o
${BIN_LINUX}
ztf
cmd/server/main.go
CGO_ENABLED
=
1
GOOS
=
linux
GOARCH
=
amd64
CC
=
/usr/local/gcc-4.8.1-for-linux64/bin/x86_64-pc-linux-gcc
CXX
=
/usr/local/gcc-4.8.1-for-linux64/bin/x86_64-pc-linux-g++ go build
-o
${BIN_LINUX}${BINARY}
cmd/server/main.go
compile_mac
:
@
echo
'start compile mac'
@
CGO_ENABLED
=
1
GOOS
=
darwin
GOARCH
=
amd64 go build
-o
${BIN_MAC}
ztf
cmd/server/main.go
@
CGO_ENABLED
=
1
GOOS
=
darwin
GOARCH
=
amd64 go build
-o
${BIN_MAC}
${BINARY}
cmd/server/main.go
copy_files
:
@
echo
'start copy files'
...
...
client/forge.config.js
浏览文件 @
cdf371a7
...
...
@@ -9,7 +9,7 @@ module.exports = {
{
name
:
'
@electron-forge/maker-squirrel
'
,
config
:
{
name
:
'
ztf
_client
'
name
:
'
ztf
'
}
},
{
...
...
client/package-lock.json
浏览文件 @
cdf371a7
此差异已折叠。
点击以展开。
client/package.json
浏览文件 @
cdf371a7
...
...
@@ -7,6 +7,10 @@
"scripts"
:
{
"start"
:
"NODE_ENV=development electron-forge start"
,
"package"
:
"electron-forge package"
,
"package-mac"
:
"npm run package"
,
"package-linux"
:
"npm run package -- --platform=linux"
,
"package-win64"
:
"npm run package -- --platform=win32 --arch=ia32"
,
"package-win32"
:
"npm run package -- --platform=win32 --arch=x64"
,
"make"
:
"electron-forge make"
,
"publish"
:
"electron-forge publish"
,
"lint"
:
"echo
\"
No linting configured
\"
"
...
...
@@ -30,6 +34,7 @@
"@vercel/webpack-asset-relocator-loader"
:
"^1.7.0"
,
"css-loader"
:
"^6.5.1"
,
"electron"
:
"16.0.6"
,
"electron-packager"
:
"^15.4.0"
,
"node-loader"
:
"^2.0.0"
,
"style-loader"
:
"^3.3.1"
},
...
...
internal/comm/consts/var.go
浏览文件 @
cdf371a7
...
...
@@ -11,7 +11,7 @@ var (
Verbose
=
true
IsRelease
bool
ExeDir
string
//
ExeDir string
WorkDir
string
ExecLogDir
string
LogDir
string
...
...
internal/comm/helper/script/asset.go
浏览文件 @
cdf371a7
...
...
@@ -21,7 +21,7 @@ func LoadScriptTree(dir string) (asset serverDomain.TestAsset, err error) {
return
}
commonUtils
.
ChangeScriptForDebug
(
&
dir
)
//
commonUtils.ChangeScriptForDebug(&dir)
asset
=
serverDomain
.
TestAsset
{
Path
:
dir
,
Title
:
fileUtils
.
GetDirName
(
dir
),
IsDir
:
true
,
Slots
:
iris
.
Map
{
"icon"
:
"icon"
}}
LoadScriptNodesInDir
(
dir
,
&
asset
,
0
)
...
...
internal/comm/helper/zentao/case.go
浏览文件 @
cdf371a7
...
...
@@ -33,7 +33,7 @@ func GetCasesByModule(productId int, moduleId int, projectPath string) (cases []
caseIdMap
[
id
]
=
""
}
commonUtils
.
ChangeScriptForDebug
(
&
projectPath
)
//
commonUtils.ChangeScriptForDebug(&projectPath)
scriptUtils
.
GetScriptByIdsInDir
(
projectPath
,
caseIdMap
,
&
cases
)
return
...
...
@@ -54,7 +54,7 @@ func GetCasesBySuite(productId int, suiteId int, projectPath string) (cases []st
caseIdMap
[
id
]
=
""
}
commonUtils
.
ChangeScriptForDebug
(
&
projectPath
)
//
commonUtils.ChangeScriptForDebug(&projectPath)
scriptUtils
.
GetScriptByIdsInDir
(
projectPath
,
caseIdMap
,
&
cases
)
return
...
...
@@ -75,7 +75,7 @@ func GetCasesByTask(productId int, taskId int, projectPath string) (cases []stri
caseIdMap
[
id
]
=
""
}
commonUtils
.
ChangeScriptForDebug
(
&
projectPath
)
//
commonUtils.ChangeScriptForDebug(&projectPath)
scriptUtils
.
GetScriptByIdsInDir
(
projectPath
,
caseIdMap
,
&
cases
)
return
...
...
internal/command/config/config.go
浏览文件 @
cdf371a7
...
...
@@ -7,13 +7,11 @@ import (
"github.com/aaronchen2k/deeptest/internal/pkg/consts"
commonUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/common"
"github.com/aaronchen2k/deeptest/internal/pkg/lib/display"
fileUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/file"
i118Utils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/i118"
logUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/log"
stdinUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/stdin"
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/repo"
"github.com/fatih/color"
"os"
"reflect"
)
...
...
@@ -21,16 +19,16 @@ type ConfigCtrl struct {
ProjectRepo
*
repo
.
ProjectRepo
`inject:""`
}
func
CheckConfigPermission
()
{
//err := syscall.Access(vari.ExeDir, syscall.O_RDWR)
err
:=
fileUtils
.
MkDirIfNeeded
(
commConsts
.
ExeDir
+
"conf"
)
if
err
!=
nil
{
msg
:=
i118Utils
.
Sprintf
(
"perm_deny"
,
commConsts
.
ExeDir
)
logUtils
.
ExecConsolef
(
color
.
FgRed
,
msg
)
os
.
Exit
(
0
)
}
}
//
func CheckConfigPermission() {
//
//err := syscall.Access(vari.ExeDir, syscall.O_RDWR)
//
//
err := fileUtils.MkDirIfNeeded(commConsts.ExeDir + "conf")
//
if err != nil {
//
msg := i118Utils.Sprintf("perm_deny", commConsts.ExeDir)
//
logUtils.ExecConsolef(color.FgRed, msg)
//
os.Exit(0)
//
}
//
}
func
InitScreenSize
()
{
w
,
h
:=
display
.
GetScreenSize
()
...
...
internal/command/index.go
浏览文件 @
cdf371a7
...
...
@@ -13,7 +13,7 @@ func InitConfig() {
serverConfig
.
Init
()
serverConfig
.
InitLog
()
commandConfig
.
CheckConfigPermission
()
//
commandConfig.CheckConfigPermission()
// screen size
commandConfig
.
InitScreenSize
()
...
...
internal/pkg/lib/common/utils.go
浏览文件 @
cdf371a7
...
...
@@ -136,11 +136,11 @@ func AddSlashForUrl(url string) string {
return
url
}
func
ChangeScriptForDebug
(
dir
*
string
)
{
if
!
IsRelease
()
{
// debug in ide
*
dir
=
filepath
.
Join
(
*
dir
,
"demo"
,
"sample"
)
}
}
//
func ChangeScriptForDebug(dir *string) {
//
if !IsRelease() { // debug in ide
//
*dir = filepath.Join(*dir, "demo", "sample")
//
}
//
}
func
GetDebugParamForRun
(
args
[]
string
)
(
debug
string
,
ret
[]
string
)
{
index
:=
-
1
...
...
internal/pkg/lib/file/file.go
浏览文件 @
cdf371a7
...
...
@@ -213,39 +213,42 @@ func GetWorkDir() string { // where we run file in
return
dir
}
func
GetExeDir
(
workDir
string
)
string
{
// where zd.exe file in
var
dir
string
arg1
:=
strings
.
ToLower
(
os
.
Args
[
0
])
name
:=
filepath
.
Base
(
arg1
)
if
strings
.
Index
(
name
,
"zd"
)
==
0
&&
strings
.
Index
(
arg1
,
"go-build"
)
<
0
{
p
,
_
:=
exec
.
LookPath
(
os
.
Args
[
0
])
if
strings
.
Index
(
p
,
string
(
os
.
PathSeparator
))
>
-
1
{
dir
=
p
[
:
strings
.
LastIndex
(
p
,
string
(
os
.
PathSeparator
))]
}
}
else
{
// debug
dir
=
workDir
}
dir
,
_
=
filepath
.
Abs
(
dir
)
dir
=
AddSepIfNeeded
(
dir
)
return
dir
}
func
GetUserHome
()
(
string
,
error
)
{
//
func GetExeDir(workDir string) string { // where zd.exe file in
//
var dir string
//
arg1 := strings.ToLower(os.Args[0])
//
//
name := filepath.Base(arg1)
//
if strings.Index(name, "zd") == 0 && strings.Index(arg1, "go-build") < 0 {
//
p, _ := exec.LookPath(os.Args[0])
//
if strings.Index(p, string(os.PathSeparator)) > -1 {
//
dir = p[:strings.LastIndex(p, string(os.PathSeparator))]
//
}
//
} else { // debug
//
dir = workDir
//
}
//
//
dir, _ = filepath.Abs(dir)
//
dir = AddSepIfNeeded(dir)
//
//
return dir
//
}
func
GetUserHome
()
(
dir
string
,
err
error
)
{
user
,
err
:=
user
.
Current
()
if
nil
==
err
{
return
user
.
HomeDir
,
nil
}
dir
=
user
.
HomeDir
}
else
{
// cross compile support
// cross compile support
if
"windows"
==
runtime
.
GOOS
{
return
homeWindows
()
if
"windows"
==
runtime
.
GOOS
{
// windows
dir
,
err
=
homeWindows
()
}
else
{
// Unix-like system, so just assume Unix
dir
,
err
=
homeUnix
()
}
}
dir
=
AddSepIfNeeded
(
dir
)
// Unix-like system, so just assume Unix
return
homeUnix
()
return
}
func
homeUnix
()
(
string
,
error
)
{
...
...
internal/server/config/init.go
浏览文件 @
cdf371a7
...
...
@@ -14,11 +14,15 @@ import (
func
Init
()
{
commConsts
.
IsRelease
=
commonUtils
.
IsRelease
()
commConsts
.
WorkDir
=
fileUtils
.
GetWorkDir
()
commConsts
.
ExeDir
=
fileUtils
.
GetExeDir
(
commConsts
.
WorkDir
)
//commConsts.ExeDir = fileUtils.GetExeDir(commConsts.WorkDir)
commConsts
.
WorkDir
=
GetServerWorDir
()
if
commConsts
.
IsRelease
{
commConsts
.
Verbose
=
true
}
if
commConsts
.
Verbose
{
fmt
.
Printf
(
"
\n
launch %s%s in %s
\n
"
,
commConsts
.
ExeDir
,
commConsts
.
App
,
commConsts
.
WorkDir
)
fmt
.
Printf
(
"
\n
launch %s%s in %s
\n
"
,
""
,
commConsts
.
App
,
commConsts
.
WorkDir
)
}
v
:=
viper
.
New
()
...
...
@@ -38,3 +42,13 @@ func Init() {
return
}
func
GetServerWorDir
()
(
ret
string
)
{
home
,
_
:=
fileUtils
.
GetUserHome
()
ret
=
filepath
.
Join
(
home
,
commConsts
.
App
)
ret
=
fileUtils
.
AddPathSepIfNeeded
(
ret
)
fileUtils
.
MkDirIfNeeded
(
ret
)
return
}
internal/server/core/dao/index.go
浏览文件 @
cdf371a7
...
...
@@ -20,10 +20,15 @@ var (
// GetDB 数据库单例
func
GetDB
()
*
gorm
.
DB
{
if
db
!=
nil
{
return
db
}
conn
:=
DBFile
()
dialector
:=
sqlite
.
Open
(
conn
)
db
,
err
:=
gorm
.
Open
(
dialector
,
&
gorm
.
Config
{
var
err
error
db
,
err
=
gorm
.
Open
(
dialector
,
&
gorm
.
Config
{
SkipDefaultTransaction
:
false
,
Logger
:
logger
.
Default
.
LogMode
(
logger
.
Info
),
NamingStrategy
:
schema
.
NamingStrategy
{
...
...
internal/server/modules/v1/controller/project.go
浏览文件 @
cdf371a7
...
...
@@ -2,6 +2,7 @@ package controller
import
(
commConsts
"github.com/aaronchen2k/deeptest/internal/comm/consts"
commDomain
"github.com/aaronchen2k/deeptest/internal/comm/domain"
serverDomain
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/domain"
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/model"
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/service"
...
...
@@ -17,25 +18,6 @@ func NewProjectCtrl() *ProjectCtrl {
return
&
ProjectCtrl
{}
}
// Query 分页列表
func
(
c
*
ProjectCtrl
)
List
(
ctx
iris
.
Context
)
{
var
req
serverDomain
.
ProjectReqPaginate
err
:=
ctx
.
ReadQuery
(
&
req
)
if
err
!=
nil
{
ctx
.
JSON
(
c
.
ErrResp
(
commConsts
.
ParamErr
,
err
.
Error
()))
return
}
req
.
ConvertParams
()
data
,
err
:=
c
.
ProjectService
.
Paginate
(
req
)
if
err
!=
nil
{
ctx
.
JSON
(
c
.
ErrResp
(
commConsts
.
Failure
,
err
.
Error
()))
return
}
ctx
.
JSON
(
c
.
SuccessResp
(
data
))
}
// Create 添加
func
(
c
*
ProjectCtrl
)
Create
(
ctx
iris
.
Context
)
{
req
:=
model
.
Project
{}
...
...
@@ -75,7 +57,13 @@ func (c *ProjectCtrl) GetByUser(ctx iris.Context) {
projectPath
:=
ctx
.
URLParam
(
"currProject"
)
if
projectPath
==
""
{
projectPath
=
commConsts
.
WorkDir
data
:=
iris
.
Map
{
"projects"
:
make
([]
model
.
Project
,
0
),
"currProject"
:
model
.
Project
{},
"currConfig"
:
commDomain
.
ProjectConf
{},
"scriptTree"
:
serverDomain
.
TestAsset
{}}
ctx
.
JSON
(
c
.
SuccessResp
(
data
))
return
}
projects
,
currProject
,
currProjectConfig
,
scriptTree
,
err
:=
c
.
ProjectService
.
GetByUser
(
projectPath
)
...
...
internal/server/modules/v1/controller/test-exec.go
浏览文件 @
cdf371a7
...
...
@@ -2,6 +2,7 @@ package controller
import
(
commConsts
"github.com/aaronchen2k/deeptest/internal/comm/consts"
serverDomain
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/domain"
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/service"
"github.com/kataras/iris/v12"
)
...
...
@@ -19,6 +20,11 @@ func NewTestExecCtrl() *TestExecCtrl {
func
(
c
*
TestExecCtrl
)
List
(
ctx
iris
.
Context
)
{
projectPath
:=
ctx
.
URLParam
(
"currProject"
)
if
projectPath
==
""
{
ctx
.
JSON
(
c
.
SuccessResp
(
make
([]
serverDomain
.
TestReportSummary
,
0
)))
return
}
data
,
err
:=
c
.
TestExecService
.
List
(
projectPath
)
if
err
!=
nil
{
ctx
.
JSON
(
c
.
ErrResp
(
commConsts
.
Failure
,
err
.
Error
()))
...
...
internal/server/modules/v1/controller/zentao.go
浏览文件 @
cdf371a7
...
...
@@ -4,6 +4,7 @@ import (
commConsts
"github.com/aaronchen2k/deeptest/internal/comm/consts"
commDomain
"github.com/aaronchen2k/deeptest/internal/comm/domain"
zentaoUtils
"github.com/aaronchen2k/deeptest/internal/comm/helper/zentao"
serverDomain
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/domain"
"github.com/kataras/iris/v12"
)
...
...
@@ -17,6 +18,10 @@ func NewZentaoCtrl() *ZentaoCtrl {
func
(
c
*
ZentaoCtrl
)
ListProduct
(
ctx
iris
.
Context
)
{
projectPath
:=
ctx
.
URLParam
(
"currProject"
)
if
projectPath
==
""
{
ctx
.
JSON
(
c
.
SuccessResp
(
make
([]
serverDomain
.
ZentaoProduct
,
0
)))
return
}
data
,
err
:=
zentaoUtils
.
ListProduct
(
projectPath
)
if
err
!=
nil
{
...
...
internal/server/modules/v1/index/project.go
浏览文件 @
cdf371a7
...
...
@@ -20,7 +20,6 @@ func (m *ProjectModule) Party() module.WebModule {
handler
:=
func
(
index
iris
.
Party
)
{
index
.
Use
(
middleware
.
InitCheck
())
index
.
Get
(
"/"
,
m
.
ProjectCtrl
.
List
)
.
Name
=
"项目列表"
index
.
Post
(
"/"
,
m
.
ProjectCtrl
.
Create
)
.
Name
=
"创建项目"
index
.
Delete
(
"/"
,
m
.
ProjectCtrl
.
Delete
)
.
Name
=
"删除项目"
...
...
internal/server/modules/v1/service/project.go
浏览文件 @
cdf371a7
...
...
@@ -99,7 +99,7 @@ func (s *ProjectService) GetByUser(currProjectPath string) (
}
name
:=
fileUtils
.
GetDirName
(
currProjectPath
)
newLocalProject
:=
model
.
Project
{
Path
:
currProjectPath
,
Name
:
name
}
newLocalProject
:=
model
.
Project
{
Path
:
currProjectPath
,
Name
:
name
,
Type
:
commConsts
.
TestFunc
}
_
,
err
=
s
.
ProjectRepo
.
Create
(
newLocalProject
)
if
err
!=
nil
{
...
...
ui/src/layouts/IndexLayout/components/RightTopProject.vue
浏览文件 @
cdf371a7
<
template
>
<div>
<a-dropdown
class=
"dropdown"
:trigger=
"['click']"
>
<a
class=
" t-link-btn"
@
click.prevent
>
<div
v-if=
"projects.length == 0"
class=
"create-link"
@
click=
"selectProject('')"
>
{{
t
(
'
create_project
'
)
}}
</div>
<a-dropdown
v-if=
"projects.length > 0"
class=
"dropdown"
>
<a
class=
"t-link-btn"
@
click.prevent
>
<span
class=
"name"
>
{{
currProject
.
name
}}
</span>
<DownOutlined
/>
</a>
...
...
@@ -21,7 +25,7 @@
<a-menu-divider
/>
<a-menu-item
key=
""
>
<div
class=
"t-link name"
@
click=
"selectProject('')"
>
{{ t('create') }}
</div>
<div
class=
"t-link name"
@
click=
"selectProject('')"
>
{{ t('create
_project
') }}
</div>
</a-menu-item>
</a-menu>
</template>
...
...
@@ -145,6 +149,12 @@ export default defineComponent({
</
script
>
<
style
lang=
"less"
>
.create-link {
padding: 14px 10px;
width: 150px;
cursor: pointer;
text-align: right;
}
.dropdown {
display: inline-block;
padding: 13px 0;
...
...
ui/src/layouts/IndexLayout/index.vue
浏览文件 @
cdf371a7
...
...
@@ -88,7 +88,6 @@ export default defineComponent({
// 右侧顶部是否固定
const
headFixed
=
computed
<
boolean
>
(()
=>
store
.
state
.
global
.
headFixed
);
// 左侧选择菜单key
const
selectedKeys
=
computed
<
string
[]
>
(()
=>
{
const
selectedKey
=
getSelectLeftMenuPath
(
routeItem
.
value
);
...
...
ui/src/locales/en-US.ts
浏览文件 @
cdf371a7
...
...
@@ -81,6 +81,8 @@ export default {
'
save_fail
'
:
'
Save failed.
'
,
'
wrong_url
'
:
'
Please input right ZenTao URL.
'
,
'
create_project
'
:
'
Create Project
'
,
'
pls_create_project
'
:
'
Please create project to continue.
'
,
'
pls_product
'
:
'
Please select product.
'
,
'
pls_lang
'
:
'
Please select language.
'
,
'
sync_success
'
:
'
Sync successfully.
'
,
...
...
ui/src/locales/zh-CN.ts
浏览文件 @
cdf371a7
...
...
@@ -82,6 +82,8 @@ export default {
'
expand_all
'
:
'
展开全部
'
,
'
collapse_all
'
:
'
收缩全部
'
,
'
wrong_url
'
:
'
请输入正确的的URL地址,以http或https开头。
'
,
'
create_project
'
:
'
新建项目
'
,
'
pls_create_project
'
:
'
请点击右上角链接新建项目
'
,
'
pls_product
'
:
'
请选择产品
'
,
'
pls_lang
'
:
'
请选择语言
'
,
'
sync_success
'
:
'
同步成功
'
,
...
...
ui/src/views/config/index.vue
浏览文件 @
cdf371a7
<
template
>
<div
v-if=
"!currProject.path"
>
<a-empty
:image=
"simpleImage"
:description=
"t('pls_create_project')"
/>
</div>
<a-card
:title=
"t('edit_config')"
>
<a-card
v-if=
"currProject.path"
:title=
"t('edit_config')"
>
<a-form
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-form-item
:label=
"t('zentao_url')"
v-bind=
"validateInfos.url"
>
<a-input
v-model:value=
"model.url"
...
...
@@ -75,7 +78,7 @@ import {defineComponent, ref, reactive, computed, watch, ComputedRef, Ref, toRaw
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
Props
,
validateInfos
}
from
'
ant-design-vue/lib/form/useForm
'
;
import
{
message
,
Form
,
notification
}
from
'
ant-design-vue
'
;
import
{
message
,
Form
,
notification
,
Empty
}
from
'
ant-design-vue
'
;
import
_
from
"
lodash
"
;
const
useForm
=
Form
.
useForm
;
...
...
@@ -122,6 +125,7 @@ interface ConfigFormSetupData {
deleteInterpreter
:
(
item
)
=>
void
;
updateFormCancel
:
()
=>
void
;
updateSubmit
:
(
values
:
any
,
resetFields
:
(
newValues
?:
Props
|
undefined
)
=>
void
)
=>
Promise
<
void
>
;
simpleImage
:
any
}
export
default
defineComponent
({
...
...
@@ -274,6 +278,7 @@ export default defineComponent({
editInterpreter
,
deleteInterpreter
,
updateSubmit
,
simpleImage
:
Empty
.
PRESENTED_IMAGE_SIMPLE
,
}
}
...
...
ui/src/views/exec/history/index.vue
浏览文件 @
cdf371a7
<
template
>
<div
class=
"indexlayout-main-conent"
>
<div
v-if=
"!currProject.path"
>
<a-empty
:image=
"simpleImage"
:description=
"t('pls_create_project')"
/>
</div>
<div
v-if=
"currProject.path"
class=
"indexlayout-main-conent"
>
<a-card
:bordered=
"false"
>
<template
#title
>
{{
t
(
'
test_exec
'
)
}}
...
...
@@ -7,14 +11,14 @@
<
template
#extra
>
<div
class=
"opt"
>
<template
v-if=
"currProject.type === 'func'"
>
<a-button
@
click=
"execCase"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
case
'
)
}}
</a-button>
<a-button
@
click=
"execModule"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
module
'
)
}}
</a-button>
<a-button
@
click=
"execSuite"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
suite
'
)
}}
</a-button>
<a-button
@
click=
"execTask"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
task
'
)
}}
</a-button>
<a-button
@
click=
"execCase"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
case
'
)
}}
</a-button>
<a-button
@
click=
"execModule"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
module
'
)
}}
</a-button>
<a-button
@
click=
"execSuite"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
suite
'
)
}}
</a-button>
<a-button
@
click=
"execTask"
type=
"primary"
>
{{
t
(
'
exec
'
)
}}{{
t
(
'
task
'
)
}}
</a-button>
</
template
>
<
template
v-if=
"currProject.type === 'unit'"
>
<a-button
@
click=
"execUnit"
type=
"primary"
>
{{
t
(
'
execute_unit_or_automated
'
)
}}
</a-button>
<a-button
@
click=
"execUnit"
type=
"primary"
>
{{
t
(
'
execute_unit_or_automated
'
)
}}
</a-button>
</
template
>
</div>
</template>
...
...
@@ -28,7 +32,7 @@
:pagination=
"false"
>
<
template
#seq=
"{ text }"
>
{{
text
}}
{{
text
}}
</
template
>
<
template
#execBy=
"{ record }"
>
{{
execBy
(
record
)
}}
...
...
@@ -37,18 +41,19 @@
<span
v-if=
"record.startTime"
>
{{
momentTime
(
record
.
startTime
)
}}
</span>
</
template
>
<
template
#duration=
"{ record }"
>
{{
record
.
duration
}}
秒
{{
record
.
duration
}}
秒
</
template
>
<
template
#result=
"{ record }"
>
合计
{{
record
.
total
}}
:
<span
class=
"t-pass"
>
{{
record
.
pass
}}
(
{{
percent
(
record
.
pass
,
record
.
total
)
}}
)
{{
t
(
'
pass
'
)
}}
</span>
,
<span
class=
"t-fail"
>
{{
record
.
fail
}}
(
{{
percent
(
record
.
fail
,
record
.
total
)
}}
)
{{
t
(
'
fail
'
)
}}
</span>
,
<span
class=
"t-skip"
>
{{
record
.
skip
}}
(
{{
percent
(
record
.
skip
,
record
.
total
)
}}
)
{{
t
(
'
ignore
'
)
}}
</span>
。
合计
{{
record
.
total
}}
:
<span
class=
"t-pass"
>
{{
record
.
pass
}}
(
{{
percent
(
record
.
pass
,
record
.
total
)
}}
)
{{
t
(
'
pass
'
)
}}
</span>
,
<span
class=
"t-fail"
>
{{
record
.
fail
}}
(
{{
percent
(
record
.
fail
,
record
.
total
)
}}
)
{{
t
(
'
fail
'
)
}}
</span>
,
<span
class=
"t-skip"
>
{{
record
.
skip
}}
(
{{
percent
(
record
.
skip
,
record
.
total
)
}}
)
{{
t
(
'
ignore
'
)
}}
</span>
。
</
template
>
<
template
#action=
"{ record }"
>
<a-button
@
click=
"() => viewResult(record)"
type=
"link"
size=
"small"
>
{{
t
(
'
view
'
)
}}
</a-button>
<a-button
@
click=
"() => deleteExec(record)"
type=
"link"
size=
"small"
:loading=
"deleteLoading.includes(record.seq)"
>
{{
t
(
'
delete
'
)
}}
</a-button>
:loading=
"deleteLoading.includes(record.seq)"
>
{{
t
(
'
delete
'
)
}}
</a-button>
</
template
>
</a-table>
...
...
@@ -58,13 +63,11 @@
</template>
<
script
lang=
"ts"
>
import
{
ComputedRef
,
defineComponent
,
ref
,
Ref
,
reactive
,
computed
,
onMounted
,
watch
}
from
"
vue
"
;
import
{
computed
,
ComputedRef
,
defineComponent
,
onMounted
,
ref
,
Ref
,
watch
}
from
"
vue
"
;
import
{
Execution
}
from
'
../data.d
'
;
import
{
useStore
}
from
"
vuex
"
;
import
{
message
,
Modal
,
Form
}
from
"
ant-design-vue
"
;
const
useForm
=
Form
.
useForm
;
import
{
Empty
,
Form
,
message
,
Modal
}
from
"
ant-design-vue
"
;
import
{
StateType
}
from
"
../store
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
momentTimeDef
,
percentDef
}
from
"
@/utils/datetime
"
;
...
...
@@ -74,6 +77,8 @@ import {hideMenu} from "@/utils/dom";
import
throttle
from
"
lodash.debounce
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
const
useForm
=
Form
.
useForm
;
interface
ListExecSetupData
{
t
:
(
key
:
string
|
number
)
=>
string
;
currProject
:
ComputedRef
;
...
...
@@ -96,14 +101,14 @@ interface ListExecSetupData {
execBy
:
(
item
)
=>
string
;
momentTime
:
(
tm
)
=>
string
;
percent
:
(
numb
,
total
)
=>
string
;
simpleImage
:
any
}
export
default
defineComponent
({
name
:
'
ExecListPage
'
,
components
:
{
},
components
:
{},
setup
():
ListExecSetupData
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
projectStore
=
useStore
<
{
project
:
ProjectData
}
>
();
const
currProject
=
computed
<
any
>
(()
=>
projectStore
.
state
.
project
.
currProject
);
...
...
@@ -112,17 +117,17 @@ export default defineComponent({
const
momentTime
=
momentTimeDef
const
percent
=
percentDef
const
columns
=
[
const
columns
=
[
{
title
:
t
(
'
index
'
),
dataIndex
:
'
index
'
,
width
:
150
,
customRender
:
({
text
,
index
}:
{
text
:
any
;
index
:
number
})
=>
index
+
1
,
customRender
:
({
text
,
index
}:
{
text
:
any
;
index
:
number
})
=>
index
+
1
,
},
{
title
:
t
(
'
exec_type
'
),
dataIndex
:
'
execBy
'
,
slots
:
{
customRender
:
'
execBy
'
},
slots
:
{
customRender
:
'
execBy
'
},
},
{
title
:
t
(
'
exec_type
'
),
...
...
@@ -131,28 +136,28 @@ export default defineComponent({
{
title
:
t
(
'
start_time
'
),
dataIndex
:
'
startTime
'
,
slots
:
{
customRender
:
'
startTime
'
},
slots
:
{
customRender
:
'
startTime
'
},
},
{
title
:
t
(
'
duration
'
),
dataIndex
:
'
duration
'
,
slots
:
{
customRender
:
'
duration
'
},
slots
:
{
customRender
:
'
duration
'
},
},
{
title
:
t
(
'
result
'
),
dataIndex
:
'
result
'
,
slots
:
{
customRender
:
'
result
'
},
slots
:
{
customRender
:
'
result
'
},
},
{
title
:
t
(
'
opt
'
),
key
:
'
action
'
,
width
:
260
,
slots
:
{
customRender
:
'
action
'
},
slots
:
{
customRender
:
'
action
'
},
},
];
const
router
=
useRouter
();
const
store
=
useStore
<
{
History
:
StateType
}
>
();
const
store
=
useStore
<
{
History
:
StateType
}
>
();
const
models
=
computed
<
any
[]
>
(()
=>
store
.
state
.
History
.
items
);
const
loading
=
ref
<
boolean
>
(
true
);
...
...
@@ -241,6 +246,7 @@ export default defineComponent({
execBy
,
momentTime
,
percent
,
simpleImage
:
Empty
.
PRESENTED_IMAGE_SIMPLE
,
}
}
...
...
ui/src/views/refresh/test.vue
0 → 100644
浏览文件 @
cdf371a7
<
template
>
TEST
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
export
default
defineComponent
({
name
:
'
Test
'
,
components
:
{},
setup
(
props
)
{
return
}
})
</
script
>
<
style
lang=
"less"
scoped
>
</
style
>
\ No newline at end of file
ui/src/views/script/index/main.vue
浏览文件 @
cdf371a7
<
template
>
<div
class=
"indexlayout-main-conent"
>
<div
v-if=
"!currProject.path"
>
<a-empty
:image=
"simpleImage"
:description=
"t('pls_create_project')"
/>
</div>
<div
v-if=
"currProject.path"
class=
"indexlayout-main-conent"
>
<div
v-if=
"currProject.type === 'unit'"
class=
"panel"
>
{{
t
(
'
no_script_for_unittest
'
)
}}
</div>
...
...
@@ -56,7 +60,7 @@ import {ProjectData} from "@/store/project";
import
{
ScriptData
}
from
"
../store
"
;
import
{
resizeWidth
}
from
"
@/utils/dom
"
;
import
throttle
from
"
lodash.debounce
"
;
import
{
message
,
notification
}
from
"
ant-design-vue
"
;
import
{
Empty
,
message
,
notification
}
from
"
ant-design-vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
interface
ListScriptPageSetupData
{
...
...
@@ -74,6 +78,7 @@ interface ListScriptPageSetupData {
expandAll
:
(
e
)
=>
void
;
extract
:
()
=>
void
;
expandedKeys
:
Ref
<
string
[]
>
simpleImage
:
any
}
export
default
defineComponent
({
...
...
@@ -170,6 +175,7 @@ export default defineComponent({
tree
,
expandedKeys
,
script
,
simpleImage
:
Empty
.
PRESENTED_IMAGE_SIMPLE
,
}
}
...
...
ui/src/views/sync/index.vue
浏览文件 @
cdf371a7
<
template
>
<div
v-if=
"!currProject.path"
>
<a-empty
:image=
"simpleImage"
:description=
"t('pls_create_project')"
/>
</div>
<div
v-if=
"currProject.path"
>
<div
v-if=
"currProject.type === 'unit'"
class=
"panel"
>
{{
t
(
'
no_sync_for_unittest
'
)
}}
</div>
<div
class=
"main"
v-if=
"currProject.type === 'func'"
>
<a-card
:title=
"t('sync_from_zentao')"
>
...
...
@@ -64,19 +68,21 @@
</a-card>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
computed
,
ComputedRef
,
defineComponent
,
reactive
,
ref
,
watch
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
validateInfos
}
from
'
ant-design-vue/lib/form/useForm
'
;
import
{
Form
,
notification
}
from
'
ant-design-vue
'
;
import
{
Empty
,
Form
,
notification
}
from
'
ant-design-vue
'
;
import
{
SyncSettings
}
from
'
./data.d
'
;
import
{
useStore
}
from
"
vuex
"
;
import
{
ProjectData
}
from
"
@/store/project
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
syncFromZentao
,
syncToZentao
}
from
"
@/views/sync/service
"
;
import
throttle
from
"
lodash.debounce
"
;
import
{
useRouter
}
from
"
vue-router
"
;
const
useForm
=
Form
.
useForm
;
...
...
@@ -108,6 +114,7 @@ interface ConfigFormSetupData {
validateCommit
:
any
validateInfosCommit
:
validateInfos
resetFieldsTo
:
()
=>
void
;
simpleImage
:
any
}
export
default
defineComponent
({
...
...
@@ -115,6 +122,7 @@ export default defineComponent({
components
:
{},
setup
(
props
):
ConfigFormSetupData
{
const
{
t
}
=
useI18n
();
const
router
=
useRouter
();
const
storeProject
=
useStore
<
{
project
:
ProjectData
}
>
();
const
currConfig
=
computed
<
any
>
(()
=>
storeProject
.
state
.
project
.
currConfig
);
...
...
@@ -129,7 +137,9 @@ export default defineComponent({
const
fetchProducts
=
throttle
(():
void
=>
{
store
.
dispatch
(
'
zentao/fetchLangs
'
)
store
.
dispatch
(
'
zentao/fetchProducts
'
)
store
.
dispatch
(
'
zentao/fetchProducts
'
).
catch
((
error
)
=>
{
if
(
error
.
response
.
data
.
code
===
2000
)
router
.
push
(
`/config`
)
})
},
600
)
fetchProducts
()
watch
(
currConfig
,
()
=>
{
...
...
@@ -257,6 +267,7 @@ export default defineComponent({
validateInfosCommit
,
resetFieldsTo
,
syncToZentaoSubmit
,
simpleImage
:
Empty
.
PRESENTED_IMAGE_SIMPLE
,
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录