Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
06ee1108
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
06ee1108
编写于
8月 03, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix code review issues
上级
0465bd86
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
31 addition
and
45 deletion
+31
-45
ui/src/store/websoket.ts
ui/src/store/websoket.ts
+1
-1
ui/src/utils/cache.ts
ui/src/utils/cache.ts
+2
-2
ui/src/utils/localCache.ts
ui/src/utils/localCache.ts
+0
-1
ui/src/utils/routes.ts
ui/src/utils/routes.ts
+0
-1
ui/src/views/script/TreeContextMenu.vue
ui/src/views/script/TreeContextMenu.vue
+1
-1
ui/src/views/script/component/tree.vue
ui/src/views/script/component/tree.vue
+2
-4
ui/src/views/script/index.vue
ui/src/views/script/index.vue
+2
-4
ui/src/views/script/service.ts
ui/src/views/script/service.ts
+6
-11
ui/src/views/script/store.ts
ui/src/views/script/store.ts
+13
-16
ui/src/views/site/store.ts
ui/src/views/site/store.ts
+2
-2
ui/src/views/workspace/store.ts
ui/src/views/workspace/store.ts
+2
-2
未找到文件。
ui/src/store/websoket.ts
浏览文件 @
06ee1108
import
{
Mutation
,
Action
,
ActionContext
}
from
'
vuex
'
;
import
{
Mutation
,
Action
}
from
'
vuex
'
;
import
{
StoreModuleType
}
from
"
@/utils/store
"
;
import
{
StoreModuleType
}
from
"
@/utils/store
"
;
import
{
WebSocket
}
from
"
@/services/websocket
"
;
import
{
WebSocket
}
from
"
@/services/websocket
"
;
...
...
ui/src/utils/cache.ts
浏览文件 @
06ee1108
...
@@ -12,14 +12,14 @@ export const setExecBy = async (execBy) => {
...
@@ -12,14 +12,14 @@ export const setExecBy = async (execBy) => {
}
}
export
const
getInitStatus
=
async
()
=>
{
export
const
getInitStatus
=
async
()
=>
{
return
await
getCache
(
settings
.
initStatus
);
return
getCache
(
settings
.
initStatus
);
}
}
export
const
setInitStatus
=
async
()
=>
{
export
const
setInitStatus
=
async
()
=>
{
await
setCache
(
settings
.
initStatus
,
true
);
await
setCache
(
settings
.
initStatus
,
true
);
}
}
export
const
getCurrSiteId
=
async
()
=>
{
export
const
getCurrSiteId
=
async
()
=>
{
return
await
getCache
(
settings
.
currSiteId
);
return
getCache
(
settings
.
currSiteId
);
}
}
export
const
setCurrSiteId
=
async
(
val
)
=>
{
export
const
setCurrSiteId
=
async
(
val
)
=>
{
await
setCache
(
settings
.
currSiteId
,
val
);
await
setCache
(
settings
.
currSiteId
,
val
);
...
...
ui/src/utils/localCache.ts
浏览文件 @
06ee1108
import
localforage
from
'
localforage
'
;
import
localforage
from
'
localforage
'
;
import
settings
from
'
@/config/settings
'
;
export
const
getCache
=
async
(
key
:
string
):
Promise
<
any
|
null
>
=>
{
export
const
getCache
=
async
(
key
:
string
):
Promise
<
any
|
null
>
=>
{
return
localforage
.
getItem
(
key
);
return
localforage
.
getItem
(
key
);
...
...
ui/src/utils/routes.ts
浏览文件 @
06ee1108
...
@@ -18,7 +18,6 @@ import { RouteRecordRaw, RouteLocationNormalizedLoaded } from 'vue-router';
...
@@ -18,7 +18,6 @@ import { RouteRecordRaw, RouteLocationNormalizedLoaded } from 'vue-router';
*/
*/
export
type
TabNavType
=
'
path
'
|
'
querypath
'
;
export
type
TabNavType
=
'
path
'
|
'
querypath
'
;
import
'
vue-router
'
declare
module
'
vue-router
'
{
declare
module
'
vue-router
'
{
/**
/**
* 自定义补充扩展 - 路由 - 类型字段
* 自定义补充扩展 - 路由 - 类型字段
...
...
ui/src/views/script/TreeContextMenu.vue
浏览文件 @
06ee1108
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
computed
,
defineComponent
,
PropType
,
ref
,
Ref
}
from
"
vue
"
;
import
{
computed
,
defineComponent
,
PropType
,
ref
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
...
...
ui/src/views/script/component/tree.vue
浏览文件 @
06ee1108
...
@@ -161,7 +161,6 @@
...
@@ -161,7 +161,6 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
import
{
computed
,
computed
,
defineComponent
,
onMounted
,
onUnmounted
,
onMounted
,
onUnmounted
,
ref
,
ref
,
watch
watch
...
@@ -170,7 +169,7 @@ import {useStore} from "vuex";
...
@@ -170,7 +169,7 @@ import {useStore} from "vuex";
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
ScriptData
}
from
"
../store
"
;
import
{
ScriptData
}
from
"
../store
"
;
import
{
Empty
,
Modal
,
notification
}
from
"
ant-design-vue
"
;
import
{
Modal
,
notification
}
from
"
ant-design-vue
"
;
import
bus
from
"
@/utils/eventBus
"
;
import
bus
from
"
@/utils/eventBus
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
...
@@ -198,7 +197,6 @@ import {isWindows} from "@/utils/comm";
...
@@ -198,7 +197,6 @@ import {isWindows} from "@/utils/comm";
import
{
testToolMap
}
from
"
@/utils/testing
"
;
import
{
testToolMap
}
from
"
@/utils/testing
"
;
import
{
ExecStatus
}
from
"
@/store/exec
"
;
import
{
ExecStatus
}
from
"
@/store/exec
"
;
import
debounce
from
"
lodash.debounce
"
;
import
debounce
from
"
lodash.debounce
"
;
import
throttle
from
"
lodash.debounce
"
;
import
TreeContextMenu
from
"
./treeContextMenu.vue
"
import
TreeContextMenu
from
"
./treeContextMenu.vue
"
import
{
ZentaoCasePrefix
}
from
"
@/utils/const
"
;
import
{
ZentaoCasePrefix
}
from
"
@/utils/const
"
;
...
@@ -495,7 +493,7 @@ import {isInArray} from "@/utils/array";
...
@@ -495,7 +493,7 @@ import {isInArray} from "@/utils/array";
const
nameFormVisible
=
ref
(
false
)
const
nameFormVisible
=
ref
(
false
)
const
treeDataMap
=
{}
const
treeDataMap
=
{}
const
getNodeMapCall
=
throttl
e
(
async
()
=>
{
const
getNodeMapCall
=
debounc
e
(
async
()
=>
{
getNodeMap
(
treeData
.
value
[
0
],
treeDataMap
)
getNodeMap
(
treeData
.
value
[
0
],
treeDataMap
)
},
300
)
},
300
)
...
...
ui/src/views/script/index.vue
浏览文件 @
06ee1108
...
@@ -20,15 +20,13 @@ import {
...
@@ -20,15 +20,13 @@ import {
computed
,
computed
,
defineComponent
,
defineComponent
,
onMounted
,
onMounted
,
ref
,
watch
}
from
"
vue
"
;
}
from
"
vue
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
ScriptData
}
from
"
./store
"
;
import
{
ScriptData
}
from
"
./store
"
;
import
{
resizeWidth
,
resizeHeight
}
from
"
@/utils/dom
"
;
import
{
resizeWidth
}
from
"
@/utils/dom
"
;
import
{
Empty
,
notification
}
from
"
ant-design-vue
"
;
import
{
Empty
}
from
"
ant-design-vue
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
...
...
ui/src/views/script/service.ts
浏览文件 @
06ee1108
...
@@ -218,27 +218,22 @@ export const getFileNodesUnderParent = (node): string[] => {
...
@@ -218,27 +218,22 @@ export const getFileNodesUnderParent = (node): string[] => {
getNodeMap
(
node
,
nodeMap
)
getNodeMap
(
node
,
nodeMap
)
const
arr
=
[]
as
string
[]
const
arr
=
[]
as
string
[]
Object
.
keys
(
nodeMap
).
forEach
((
k
,
v
)
=>
{
Object
.
keys
(
nodeMap
).
forEach
((
k
,
_
v
)
=>
{
const
node
=
nodeMap
[
k
]
const
item
=
nodeMap
[
k
]
if
(
node
.
type
===
'
file
'
)
{
if
(
item
.
type
===
'
file
'
)
{
node
.
childrem
=
null
item
.
childrem
=
null
arr
.
push
(
node
)
arr
.
push
(
item
)
}
}
})
})
return
arr
return
arr
}
}
export
function
getSyncToInfoFromMenu
(
key
:
string
,
node
:
any
):
any
{
return
}
export
function
scriptTreeAddAttr
(
treeData
)
{
export
function
scriptTreeAddAttr
(
treeData
)
{
if
(
treeData
==
undefined
){
if
(
treeData
==
undefined
){
return
treeData
;
return
treeData
;
}
}
treeData
=
treeData
.
map
((
item
,
index
)
=>
{
treeData
=
treeData
.
map
((
item
)
=>
{
item
.
id
=
item
.
path
;
item
.
id
=
item
.
path
;
item
.
checkable
=
item
.
workspaceType
==
'
ztf
'
?
true
:
false
;
item
.
checkable
=
item
.
workspaceType
==
'
ztf
'
?
true
:
false
;
if
(
item
.
isLeaf
)
{
if
(
item
.
isLeaf
)
{
...
...
ui/src/views/script/store.ts
浏览文件 @
06ee1108
...
@@ -107,7 +107,7 @@ const StoreModel: ModuleType = {
...
@@ -107,7 +107,7 @@ const StoreModel: ModuleType = {
commit
(
'
setQueryParams
'
,
playload
);
commit
(
'
setQueryParams
'
,
playload
);
return
true
;
return
true
;
},
},
async
loadChildren
(
{
commit
}
,
treeNode
:
any
)
{
async
loadChildren
(
_ctx
,
treeNode
:
any
)
{
console
.
log
(
'
load node children
'
,
treeNode
.
dataRef
.
workspaceType
)
console
.
log
(
'
load node children
'
,
treeNode
.
dataRef
.
workspaceType
)
if
(
treeNode
.
dataRef
.
workspaceType
===
'
ztf
'
)
if
(
treeNode
.
dataRef
.
workspaceType
===
'
ztf
'
)
return
true
return
true
...
@@ -118,19 +118,16 @@ const StoreModel: ModuleType = {
...
@@ -118,19 +118,16 @@ const StoreModel: ModuleType = {
})
})
},
},
async
getScript
({
commit
,
dispatch
},
script
:
any
)
{
async
getScript
({
commit
},
script
:
any
)
{
if
(
!
script
||
script
.
type
!==
'
file
'
)
{
if
(
!
script
||
script
.
type
!==
'
file
'
)
{
commit
(
'
setItem
'
,
null
);
commit
(
'
setItem
'
,
null
);
return
true
;
}
else
if
(
script
.
path
.
indexOf
(
'
zentao-
'
)
===
0
)
{
}
if
(
script
.
path
.
indexOf
(
'
zentao-
'
)
===
0
)
{
commit
(
'
setItem
'
,
{
id
:
script
.
caseId
,
workspaceId
:
script
.
workspaceId
,
code
:
ScriptFileNotExist
});
commit
(
'
setItem
'
,
{
id
:
script
.
caseId
,
workspaceId
:
script
.
workspaceId
,
code
:
ScriptFileNotExist
});
return
true
;
}
else
{
const
response
:
ResponseData
=
await
get
(
script
.
path
,
script
.
workspaceId
);
commit
(
'
setItem
'
,
response
.
data
);
}
}
const
response
:
ResponseData
=
await
get
(
script
.
path
,
script
.
workspaceId
);
commit
(
'
setItem
'
,
response
.
data
);
return
true
;
return
true
;
},
},
...
@@ -150,7 +147,7 @@ const StoreModel: ModuleType = {
...
@@ -150,7 +147,7 @@ const StoreModel: ModuleType = {
return
resp
return
resp
},
},
async
syncToZentao
({
commit
,
dispatch
,
state
},
payload
:
any
)
{
async
syncToZentao
({
dispatch
,
state
},
payload
:
any
)
{
const
resp
=
await
syncToZentao
(
payload
)
const
resp
=
await
syncToZentao
(
payload
)
if
(
resp
.
code
===
0
)
{
if
(
resp
.
code
===
0
)
{
...
@@ -170,7 +167,7 @@ const StoreModel: ModuleType = {
...
@@ -170,7 +167,7 @@ const StoreModel: ModuleType = {
return
data
.
done
return
data
.
done
},
},
async
createScript
({
commit
,
dispatch
,
state
},
payload
:
any
)
{
async
createScript
({
dispatch
,
state
},
payload
:
any
)
{
try
{
try
{
const
jsn
=
await
create
(
payload
);
const
jsn
=
await
create
(
payload
);
const
path
=
jsn
.
data
const
path
=
jsn
.
data
...
@@ -182,7 +179,7 @@ const StoreModel: ModuleType = {
...
@@ -182,7 +179,7 @@ const StoreModel: ModuleType = {
return
''
return
''
}
}
},
},
async
updateScript
(
{
commit
}
,
payload
:
any
)
{
async
updateScript
(
_ctx
,
payload
:
any
)
{
try
{
try
{
const
{
id
,
...
params
}
=
payload
;
const
{
id
,
...
params
}
=
payload
;
await
update
(
id
,
{
...
params
});
await
update
(
id
,
{
...
params
});
...
@@ -192,7 +189,7 @@ const StoreModel: ModuleType = {
...
@@ -192,7 +189,7 @@ const StoreModel: ModuleType = {
}
}
},
},
async
updateCode
({
commit
,
dispatch
,
state
},
payload
:
any
)
{
async
updateCode
({
dispatch
,
state
},
payload
:
any
)
{
try
{
try
{
await
updateCode
(
payload
);
await
updateCode
(
payload
);
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
...
@@ -202,7 +199,7 @@ const StoreModel: ModuleType = {
...
@@ -202,7 +199,7 @@ const StoreModel: ModuleType = {
}
}
},
},
async
pasteScript
({
commit
,
dispatch
,
state
},
data
:
any
)
{
async
pasteScript
({
dispatch
,
state
},
data
:
any
)
{
try
{
try
{
await
paste
(
data
);
await
paste
(
data
);
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
...
@@ -213,7 +210,7 @@ const StoreModel: ModuleType = {
...
@@ -213,7 +210,7 @@ const StoreModel: ModuleType = {
}
}
},
},
async
moveScript
({
commit
,
dispatch
,
state
},
data
:
any
)
{
async
moveScript
({
dispatch
,
state
},
data
:
any
)
{
try
{
try
{
await
move
(
data
);
await
move
(
data
);
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
...
@@ -224,7 +221,7 @@ const StoreModel: ModuleType = {
...
@@ -224,7 +221,7 @@ const StoreModel: ModuleType = {
}
}
},
},
async
deleteScript
({
commit
,
dispatch
,
state
},
path
:
string
)
{
async
deleteScript
({
dispatch
,
state
},
path
:
string
)
{
try
{
try
{
await
remove
(
path
);
await
remove
(
path
);
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
await
dispatch
(
'
listScript
'
,
state
.
queryParams
)
...
...
ui/src/views/site/store.ts
浏览文件 @
06ee1108
...
@@ -76,7 +76,7 @@ const StoreModel: ModuleType = {
...
@@ -76,7 +76,7 @@ const StoreModel: ModuleType = {
commit
(
'
setDetailResult
'
,
data
);
commit
(
'
setDetailResult
'
,
data
);
return
true
;
return
true
;
},
},
async
save
(
{
commit
}
,
payload
)
{
async
save
(
_ctx
,
payload
)
{
try
{
try
{
await
save
(
payload
);
await
save
(
payload
);
return
true
;
return
true
;
...
@@ -84,7 +84,7 @@ const StoreModel: ModuleType = {
...
@@ -84,7 +84,7 @@ const StoreModel: ModuleType = {
return
false
;
return
false
;
}
}
},
},
async
delete
({
commit
,
dispatch
,
state
},
id
:
number
)
{
async
delete
({
dispatch
,
state
},
id
:
number
)
{
try
{
try
{
await
remove
(
id
);
await
remove
(
id
);
dispatch
(
'
list
'
,
{})
dispatch
(
'
list
'
,
{})
...
...
ui/src/views/workspace/store.ts
浏览文件 @
06ee1108
...
@@ -97,7 +97,7 @@ const StoreModel: ModuleType = {
...
@@ -97,7 +97,7 @@ const StoreModel: ModuleType = {
commit
(
'
setDetailResult
'
,
data
);
commit
(
'
setDetailResult
'
,
data
);
return
true
;
return
true
;
},
},
async
save
(
{
commit
}
,
payload
)
{
async
save
(
_ctx
,
payload
)
{
try
{
try
{
await
save
(
payload
);
await
save
(
payload
);
return
true
;
return
true
;
...
@@ -105,7 +105,7 @@ const StoreModel: ModuleType = {
...
@@ -105,7 +105,7 @@ const StoreModel: ModuleType = {
return
false
;
return
false
;
}
}
},
},
async
delete
({
commit
,
dispatch
,
state
},
id
:
number
)
{
async
delete
({
dispatch
},
id
:
number
)
{
try
{
try
{
await
remove
(
id
);
await
remove
(
id
);
dispatch
(
'
list
'
,
{})
dispatch
(
'
list
'
,
{})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录