Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
f1c61c91
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,发现更多精彩内容 >>
提交
f1c61c91
编写于
5月 05, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
create and delete node
上级
51865f6c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
10 deletion
+37
-10
internal/comm/consts/enum.go
internal/comm/consts/enum.go
+1
-0
internal/server/modules/v1/controller/test-script.go
internal/server/modules/v1/controller/test-script.go
+3
-3
internal/server/modules/v1/service/test-script.go
internal/server/modules/v1/service/test-script.go
+3
-3
ui/src/locales/en-US.ts
ui/src/locales/en-US.ts
+3
-0
ui/src/locales/zh-CN.ts
ui/src/locales/zh-CN.ts
+3
-0
ui/src/views/script/component/tree.vue
ui/src/views/script/component/tree.vue
+16
-0
ui/src/views/script/store.ts
ui/src/views/script/store.ts
+8
-4
未找到文件。
internal/comm/consts/enum.go
浏览文件 @
f1c61c91
...
...
@@ -24,6 +24,7 @@ var (
ResponseParseErr
=
ResponseCode
{
6000
,
"Json Parse Error"
}
NeedInitErr
=
ResponseCode
{
1000
,
"Data Not Init"
}
ErrDirNotEmpty
=
ResponseCode
{
1100
,
"Dir Not Empty Error"
}
ErrZentaoConfig
=
ResponseCode
{
2000
,
"Zentao Config Error"
}
ErrZentaoRequest
=
ResponseCode
{
3000
,
"zentao request Error"
}
ErrRecordNotExist
=
ResponseCode
{
4000
,
"Record Not Found"
}
...
...
internal/server/modules/v1/controller/test-script.go
浏览文件 @
f1c61c91
...
...
@@ -81,13 +81,13 @@ func (c *TestScriptCtrl) Create(ctx iris.Context) {
ctx
.
JSON
(
c
.
ErrResp
(
commConsts
.
CommErr
,
err
.
Error
()))
}
err
=
c
.
TestScriptService
.
CreateNode
(
req
)
pth
,
err
:
=
c
.
TestScriptService
.
CreateNode
(
req
)
if
err
!=
nil
{
ctx
.
JSON
(
c
.
ErrResp
(
commConsts
.
CommErr
,
err
.
Error
()))
return
}
ctx
.
JSON
(
c
.
SuccessResp
(
nil
))
ctx
.
JSON
(
c
.
SuccessResp
(
pth
))
}
func
(
c
*
TestScriptCtrl
)
UpdateCode
(
ctx
iris
.
Context
)
{
...
...
@@ -134,7 +134,7 @@ func (c *TestScriptCtrl) Delete(ctx iris.Context) {
err
=
c
.
TestScriptService
.
Delete
(
req
.
Path
)
if
err
!=
nil
{
ctx
.
JSON
(
c
.
ErrResp
(
commConsts
.
CommErr
,
err
.
Error
()
))
ctx
.
JSON
(
c
.
ErrResp
(
commConsts
.
ErrDirNotEmpty
,
""
))
return
}
...
...
internal/server/modules/v1/service/test-script.go
浏览文件 @
f1c61c91
...
...
@@ -126,7 +126,7 @@ func (s *TestScriptService) GetCaseIdsFromReport(workspaceId int, seq, scope str
return
}
func
(
s
*
TestScriptService
)
CreateNode
(
req
serverDomain
.
CreateScriptReq
)
(
err
error
)
{
func
(
s
*
TestScriptService
)
CreateNode
(
req
serverDomain
.
CreateScriptReq
)
(
pth
string
,
err
error
)
{
name
:=
req
.
Name
extName
:=
fileUtils
.
GetExtNameWithoutDot
(
name
)
mode
:=
req
.
Mode
...
...
@@ -146,7 +146,7 @@ func (s *TestScriptService) CreateNode(req serverDomain.CreateScriptReq) (err er
dir
=
filepath
.
Dir
(
target
)
}
pth
:
=
filepath
.
Join
(
dir
,
name
)
pth
=
filepath
.
Join
(
dir
,
name
)
if
typ
==
commConsts
.
CreateDir
{
fileUtils
.
MkDirIfNeeded
(
pth
)
}
else
{
...
...
@@ -177,7 +177,7 @@ func (s *TestScriptService) UpdateName(script serverDomain.TestScript) (err erro
}
func
(
s
*
TestScriptService
)
Delete
(
pth
string
)
(
err
error
)
{
os
.
Remove
(
pth
)
err
=
os
.
Remove
(
pth
)
return
}
ui/src/locales/en-US.ts
浏览文件 @
f1c61c91
...
...
@@ -143,6 +143,8 @@ export default {
'
error_detail
'
:
'
Error Detail
'
,
'
save_success
'
:
'
Save successfully.
'
,
'
save_fail
'
:
'
Save failed.
'
,
'
create_success
'
:
'
Create successfully.
'
,
'
create_fail
'
:
'
Create failed.
'
,
'
expand_all
'
:
'
Expand
'
,
'
collapse_all
'
:
'
Collapse
'
,
...
...
@@ -218,6 +220,7 @@ export default {
'
biz_401
'
:
'
UnAuthorized
'
,
'
biz_1000
'
:
'
Data Not Init
'
,
'
biz_1100
'
:
'
Can not delete dir that is not empty.
'
,
'
biz_2000
'
:
'
Zentao Config Failed
'
,
'
biz_4000
'
:
'
Record Not Found
'
,
'
biz_5000
'
:
'
Not Available
'
,
...
...
ui/src/locales/zh-CN.ts
浏览文件 @
f1c61c91
...
...
@@ -142,6 +142,8 @@ export default {
'
error_detail
'
:
'
错误详情
'
,
'
save_success
'
:
'
保存成功
'
,
'
save_fail
'
:
'
保存失败
'
,
'
create_success
'
:
'
创建成功
'
,
'
create_fail
'
:
'
创建失败
'
,
'
expand_all
'
:
'
展开
'
,
'
collapse_all
'
:
'
收缩
'
,
...
...
@@ -218,6 +220,7 @@ export default {
'
biz_401
'
:
'
未授权
'
,
'
biz_1000
'
:
'
数据为初始化
'
,
'
biz_1100
'
:
'
无法删除非空目录。
'
,
'
biz_2000
'
:
'
禅道配置失败
'
,
'
biz_3000
'
:
'
禅道请求错误
'
,
'
biz_4000
'
:
'
记录不存在
'
,
...
...
ui/src/views/script/component/tree.vue
浏览文件 @
f1c61c91
...
...
@@ -567,6 +567,22 @@ export default defineComponent({
scriptStore
.
dispatch
(
'
Script/createScript
'
,
{
name
:
model
.
name
,
mode
:
mode
,
type
:
type
,
target
:
rightClickedNode
.
path
,
workspaceId
:
rightClickedNode
.
workspaceId
,
productId
:
currProduct
.
value
.
id
,
}).
then
((
result
)
=>
{
if
(
result
)
{
notification
.
success
({
message
:
t
(
'
create_success
'
)});
nameFormVisible
.
value
=
false
if
(
mode
==
'
child
'
)
{
expandedKeys
.
value
.
push
(
rightClickedNode
.
path
)
}
if
(
type
===
'
dir
'
)
{
expandedKeys
.
value
.
push
(
result
)
}
setExpandedKeys
(
currSite
.
value
.
id
,
currProduct
.
value
.
id
,
expandedKeys
.
value
)
}
else
{
notification
.
error
({
message
:
t
(
'
create_fail
'
)});
}
})
}
...
...
ui/src/views/script/store.ts
浏览文件 @
f1c61c91
...
...
@@ -138,12 +138,16 @@ const StoreModel: ModuleType = {
return
data
.
done
},
async
createScript
({
commit
},
payload
:
any
)
{
async
createScript
({
commit
,
dispatch
,
state
},
payload
:
any
)
{
try
{
await
create
(
payload
);
return
true
;
const
jsn
=
await
create
(
payload
);
const
path
=
jsn
.
data
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
return
path
;
}
catch
(
error
)
{
return
false
;
return
''
}
},
async
updateScript
({
commit
},
payload
:
any
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录