Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
afa2b331
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,发现更多精彩内容 >>
提交
afa2b331
编写于
3月 18, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change load scripts logic
上级
a01173e6
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
165 addition
and
177 deletion
+165
-177
internal/server/modules/v1/controller/zentao.go
internal/server/modules/v1/controller/zentao.go
+9
-4
internal/server/modules/v1/index/zentao.go
internal/server/modules/v1/index/zentao.go
+2
-1
internal/server/modules/v1/service/site.go
internal/server/modules/v1/service/site.go
+11
-0
ui/src/config/settings.ts
ui/src/config/settings.ts
+3
-0
ui/src/layouts/IndexLayout/components/TopSiteProduct.vue
ui/src/layouts/IndexLayout/components/TopSiteProduct.vue
+4
-2
ui/src/locales/en-US.ts
ui/src/locales/en-US.ts
+4
-0
ui/src/locales/zh-CN.ts
ui/src/locales/zh-CN.ts
+4
-2
ui/src/store/zentao.ts
ui/src/store/zentao.ts
+9
-7
ui/src/utils/cache.ts
ui/src/utils/cache.ts
+46
-0
ui/src/utils/request.ts
ui/src/utils/request.ts
+10
-7
ui/src/views/component/workspace/create.vue
ui/src/views/component/workspace/create.vue
+0
-138
ui/src/views/component/workspace/service.ts
ui/src/views/component/workspace/service.ts
+0
-13
ui/src/views/script/index.vue
ui/src/views/script/index.vue
+62
-1
ui/src/views/script/locales/en-US.ts
ui/src/views/script/locales/en-US.ts
+1
-2
未找到文件。
internal/server/modules/v1/controller/zentao.go
浏览文件 @
afa2b331
...
...
@@ -35,17 +35,22 @@ func (c *ZentaoCtrl) GetProfile(ctx iris.Context) {
ctx
.
JSON
(
c
.
SuccessResp
(
data
))
}
func
(
c
*
ZentaoCtrl
)
ListSiteAndProduct
(
ctx
iris
.
Context
)
{
func
(
c
*
ZentaoCtrl
)
ListSiteAndProduct
WithScripts
(
ctx
iris
.
Context
)
{
currSiteId
,
_
:=
ctx
.
URLParamInt
(
"currSiteId"
)
currProductId
,
_
:=
ctx
.
URLParamInt
(
"currProductId"
)
needLoadScript
,
_
:=
ctx
.
URLParamBool
(
"needLoadScript"
)
sites
,
currSite
,
_
:=
c
.
SiteService
.
LoadSites
(
currSiteId
)
products
,
currProduct
,
_
:=
zentaoHelper
.
LoadSiteProduct
(
currSite
,
currProductId
)
testScripts
,
_
:=
c
.
TestScriptService
.
LoadTestScriptsBySiteProduct
(
currSite
,
currProduct
)
data
:=
iris
.
Map
{
"sites"
:
sites
,
"products"
:
products
,
"testScripts"
:
testScripts
,
data
:=
iris
.
Map
{
"sites"
:
sites
,
"products"
:
products
,
"currSite"
:
currSite
,
"currProduct"
:
currProduct
}
if
needLoadScript
{
testScripts
,
_
:=
c
.
TestScriptService
.
LoadTestScriptsBySiteProduct
(
currSite
,
currProduct
)
data
[
"testScripts"
]
=
testScripts
}
ctx
.
JSON
(
c
.
SuccessResp
(
data
))
}
...
...
internal/server/modules/v1/index/zentao.go
浏览文件 @
afa2b331
...
...
@@ -23,7 +23,8 @@ func (m *ZentaoModule) Party() module.WebModule {
index
.
Get
(
"/listLang"
,
m
.
ZentaoCtrl
.
ListLang
)
.
Name
=
"脚本语言列表"
index
.
Get
(
"/getProfile"
,
m
.
ZentaoCtrl
.
GetProfile
)
.
Name
=
"脚本语言列表"
index
.
Get
(
"/listSiteAndProduct"
,
m
.
ZentaoCtrl
.
ListSiteAndProduct
)
.
Name
=
"获取禅道站点及其下产品"
index
.
Get
(
"/listSiteAndProduct"
,
m
.
ZentaoCtrl
.
ListSiteAndProductWithScripts
)
.
Name
=
"获取禅道站点及其下产品"
index
.
Get
(
"/listProduct"
,
m
.
ZentaoCtrl
.
ListProduct
)
.
Name
=
"产品列表"
index
.
Get
(
"/listModule"
,
m
.
ZentaoCtrl
.
ListModule
)
.
Name
=
"模块列表"
index
.
Get
(
"/listSuite"
,
m
.
ZentaoCtrl
.
ListSuite
)
.
Name
=
"套件列表"
...
...
internal/server/modules/v1/service/site.go
浏览文件 @
afa2b331
...
...
@@ -23,6 +23,17 @@ func (s *SiteService) Paginate(req serverDomain.ReqPaginate) (ret domain.PageDat
func
(
s
*
SiteService
)
Get
(
id
uint
)
(
site
model
.
Site
,
err
error
)
{
return
s
.
SiteRepo
.
Get
(
id
)
}
func
(
s
*
SiteService
)
GetDomainObject
(
id
uint
)
(
site
serverDomain
.
ZentaoSite
,
err
error
)
{
po
,
_
:=
s
.
SiteRepo
.
Get
(
id
)
site
=
serverDomain
.
ZentaoSite
{
Url
:
po
.
Url
,
Username
:
po
.
Username
,
Password
:
po
.
Password
,
}
return
}
func
(
s
*
SiteService
)
Create
(
site
model
.
Site
)
(
id
uint
,
err
error
)
{
id
,
err
=
s
.
SiteRepo
.
Create
(
site
)
...
...
ui/src/config/settings.ts
浏览文件 @
afa2b331
import
{
RoutesDataItem
}
from
"
@/utils/routes
"
;
import
{
getScriptFilters
}
from
"
@/utils/cache
"
;
/**
* 站点配置
...
...
@@ -28,6 +29,7 @@ export interface SettingsType {
currProductId
:
string
;
currProductIdBySite
:
string
;
currWorkspace
:
string
;
scriptFilters
:
string
;
/**
* Ajax请求头发送Token 的 Key值
...
...
@@ -55,6 +57,7 @@ const settings: SettingsType = {
currProductId
:
'
currProductId
'
,
currProductIdBySite
:
'
currProductIdBySite
'
,
currWorkspace
:
'
currWorkspace
'
,
scriptFilters
:
'
scriptFilters
'
,
ajaxHeadersTokenKey
:
'
Authorization
'
,
ajaxResponseNoVerifyUrl
:
[
...
...
ui/src/layouts/IndexLayout/components/TopSiteProduct.vue
浏览文件 @
afa2b331
...
...
@@ -74,6 +74,8 @@ export default defineComponent({
const
{
t
}
=
useI18n
();
const
router
=
useRouter
();
const
needLoadScript
=
router
.
currentRoute
.
value
.
path
===
'
/script/index
'
const
store
=
useStore
<
{
zentao
:
ZentaoData
}
>
();
const
sites
=
computed
<
any
[]
>
(()
=>
store
.
state
.
zentao
.
sites
);
...
...
@@ -82,7 +84,7 @@ export default defineComponent({
const
currSite
=
computed
<
any
>
(()
=>
store
.
state
.
zentao
.
currSite
);
const
currProduct
=
computed
<
any
>
(()
=>
store
.
state
.
zentao
.
currProduct
);
store
.
dispatch
(
'
zentao/fetchSitesAndProducts
'
,
{})
store
.
dispatch
(
'
zentao/fetchSitesAndProducts
'
,
{
needLoadScript
:
needLoadScript
})
onMounted
(()
=>
{
console
.
log
(
'
onMounted
'
)
...
...
@@ -94,7 +96,7 @@ export default defineComponent({
}
const
selectProduct
=
(
product
):
void
=>
{
console
.
log
(
'
selectProduct
'
,
product
)
store
.
dispatch
(
'
zentao/fetchSitesAndProducts
'
,
{
currProductId
:
product
.
id
})
store
.
dispatch
(
'
zentao/fetchSitesAndProducts
'
,
{
currProductId
:
product
.
id
,
needLoadScript
:
needLoadScript
})
}
return
{
...
...
ui/src/locales/en-US.ts
浏览文件 @
afa2b331
...
...
@@ -121,6 +121,8 @@ export default {
'
save_success
'
:
'
Save successfully.
'
,
'
save_fail
'
:
'
Save failed.
'
,
'
expand_all
'
:
'
Expand
'
,
'
collapse_all
'
:
'
Collapse
'
,
'
wrong_url
'
:
'
Please input right ZenTao URL.
'
,
'
extract_success
'
:
'
Extract comments to test steps and checkpoints successfully.
'
,
'
extract_fail
'
:
'
Extract comments to test steps and checkpoints failed.
'
,
...
...
@@ -132,6 +134,8 @@ export default {
'
delete_success
'
:
'
Delete successfully.
'
,
'
ws_conn_success
'
:
'
Connect to WebSocket successfully.
'
,
'
ws_conn_fail
'
:
'
Connect to WebSocket failed.
'
,
'
no_script_for_unittest
'
:
'
No scriptS for Unit Test.
'
,
'
extract_step
'
:
'
Extract Steps
'
,
'
pls_title
'
:
'
Please input title.
'
,
'
pls_name
'
:
'
Please input name.
'
,
...
...
ui/src/locales/zh-CN.ts
浏览文件 @
afa2b331
...
...
@@ -121,8 +121,8 @@ export default {
'
save_success
'
:
'
保存成功
'
,
'
save_fail
'
:
'
保存失败
'
,
'
expand_all
'
:
'
展开
全部
'
,
'
collapse_all
'
:
'
收缩
全部
'
,
'
expand_all
'
:
'
展开
'
,
'
collapse_all
'
:
'
收缩
'
,
'
wrong_url
'
:
'
请输入正确的的URL地址,以http或https开头。
'
,
'
extract_success
'
:
'
提取注释为测试步骤和验证点成功。
'
,
'
extract_fail
'
:
'
提取注释为测试步骤和验证点失败。
'
,
...
...
@@ -134,6 +134,8 @@ export default {
'
delete_success
'
:
'
删除成功
'
,
'
ws_conn_success
'
:
'
WebSocket连接成功。
'
,
'
ws_conn_fail
'
:
'
WebSocket连接失败。
'
,
'
no_script_for_unittest
'
:
'
此为单元测试工作目录,无ZTF脚本。
'
,
'
extract_step
'
:
'
提取步骤
'
,
'
pls_title
'
:
'
请输入标题
'
,
'
pls_name
'
:
'
请输入名称
'
,
...
...
ui/src/store/zentao.ts
浏览文件 @
afa2b331
...
...
@@ -4,6 +4,7 @@ import { ResponseData } from '@/utils/request';
import
{
queryLang
,
querySiteAndProduct
,
getProfile
,
queryProduct
,
queryModule
,
querySuite
,
queryTask
}
from
"
../services/zentao
"
;
import
{
getCache
,
setCache
}
from
"
@/utils/localCache
"
;
import
settings
from
"
@/config/settings
"
;
import
{
setCurrProductIdBySite
,
setCurrSiteId
}
from
"
@/utils/cache
"
;
export
interface
ZentaoData
{
langs
:
any
[]
...
...
@@ -15,6 +16,7 @@ export interface ZentaoData {
testScripts
:
any
[]
currSite
:
any
currProduct
:
any
scriptLoaded
:
boolean
modules
:
any
[]
suites
:
any
[]
...
...
@@ -56,6 +58,7 @@ const initState: ZentaoData = {
testScripts
:
[],
currSite
:
{},
currProduct
:
{},
scriptLoaded
:
false
,
modules
:
[],
suites
:
[],
...
...
@@ -80,18 +83,17 @@ const StoreModel: ModuleType = {
async
saveSitesAndProducts
(
state
,
payload
)
{
state
.
sites
=
payload
.
sites
;
state
.
products
=
payload
.
products
;
state
.
testScripts
=
[
payload
.
testScripts
];
if
(
payload
.
testScripts
)
{
state
.
testScripts
=
[
payload
.
testScripts
];
state
.
scriptLoaded
=
true
}
state
.
currSite
=
payload
.
currSite
;
state
.
currProduct
=
payload
.
currProduct
;
// cache current site and product
setCache
(
settings
.
currSiteId
,
payload
.
currSite
.
id
);
let
mp
=
await
getCache
(
settings
.
currProductIdBySite
);
if
(
!
mp
)
mp
=
{}
mp
[
payload
.
currSite
.
id
+
''
]
=
payload
.
currProduct
.
id
setCache
(
settings
.
currProductIdBySite
,
mp
);
await
setCurrSiteId
(
payload
.
currSite
.
id
);
await
setCurrProductIdBySite
(
settings
.
currProductIdBySite
,
payload
.
currProduct
.
id
);
},
saveProducts
(
state
,
payload
)
{
console
.
log
(
'
payload
'
,
payload
)
...
...
ui/src/utils/cache.ts
0 → 100644
浏览文件 @
afa2b331
import
{
getCache
,
setCache
}
from
'
./localCache
'
;
import
settings
from
'
@/config/settings
'
;
export
const
getCurrSiteId
=
async
()
=>
{
const
currSiteId
=
await
getCache
(
settings
.
currSiteId
);
return
currSiteId
}
export
const
setCurrSiteId
=
async
(
val
)
=>
{
await
setCache
(
settings
.
currSiteId
,
val
);
}
export
const
getCurrProductIdBySite
=
async
(
currSiteId
)
=>
{
const
mp
=
await
getCache
(
settings
.
currProductIdBySite
);
const
currProductId
=
mp
?
mp
[
currSiteId
]
:
0
return
currProductId
}
export
const
setCurrProductIdBySite
=
async
(
currSiteId
,
currProductId
)
=>
{
let
mp
=
await
getCache
(
settings
.
currProductIdBySite
);
if
(
!
mp
)
mp
=
{}
mp
[
currSiteId
+
''
]
=
currProductId
await
setCache
(
settings
.
currProductIdBySite
,
mp
);
}
// script filters
export
const
getScriptFilters
=
async
()
=>
{
const
mp
=
await
getCache
(
settings
.
scriptFilters
);
if
(
!
mp
)
{
return
{
by
:
'
workspace
'
,
val
:
''
}
}
const
by
=
mp
.
by
const
val
=
mp
[
by
]
return
{
by
:
by
,
val
:
val
}
}
export
const
setScriptFilters
=
async
(
by
,
val
)
=>
{
let
mp
=
await
getCache
(
settings
.
scriptFilters
);
if
(
!
mp
)
mp
=
{}
mp
.
by
=
by
mp
[
by
]
=
val
await
setCache
(
settings
.
scriptFilters
,
mp
);
}
ui/src/utils/request.ts
浏览文件 @
afa2b331
...
...
@@ -7,6 +7,7 @@ import { notification } from "ant-design-vue";
import
settings
from
'
@/config/settings
'
;
import
{
getCache
,
setCache
}
from
'
@/utils/localCache
'
;
import
i18n
from
"
@/config/i18n
"
;
import
{
getCurrProductIdBySite
,
getCurrSiteId
}
from
"
@/utils/cache
"
;
export
interface
ResponseData
{
code
:
number
;
...
...
@@ -96,18 +97,20 @@ request.interceptors.request.use(
config
.
params
=
{
...
config
.
params
,
ts
:
Date
.
now
()
};
if
(
!
config
.
params
[
settings
.
currSiteId
])
{
const
currSiteId
=
await
getC
ache
(
settings
.
currSiteId
);
const
currSiteId
=
await
getC
urrSiteId
(
);
config
.
params
=
{
...
config
.
params
,
[
settings
.
currSiteId
]:
currSiteId
,
lang
:
i18n
.
global
.
locale
.
value
};
}
if
(
!
config
.
params
[
settings
.
currProductId
])
{
const
mp
=
await
getCache
(
settings
.
currProductIdBySite
);
const
currProductId
=
mp
?
mp
[
config
.
params
[
settings
.
currSiteId
]]
:
0
const
currProductId
=
await
getCurrProductIdBySite
(
config
.
params
[
settings
.
currSiteId
])
config
.
params
=
{
...
config
.
params
,
[
settings
.
currProductId
]:
currProductId
,
lang
:
i18n
.
global
.
locale
.
value
};
}
if
(
!
config
.
params
[
settings
.
currWorkspace
])
{
const
workspacePath
=
await
getCache
(
settings
.
currWorkspace
);
config
.
params
=
{
...
config
.
params
,
[
settings
.
currWorkspace
]:
workspacePath
,
lang
:
i18n
.
global
.
locale
.
value
};
}
console
.
log
(
`currSiteId=
${
config
.
params
[
settings
.
currSiteId
]}
, currProductId=
${
config
.
params
[
settings
.
currProductId
]}
`
)
// if (!config.params[settings.currWorkspace]) {
// const workspacePath = await getCache(settings.currWorkspace);
// config.params = { ...config.params, [settings.currWorkspace]: workspacePath, lang: i18n.global.locale.value };
// }
console
.
log
(
'
=== request ===
'
,
config
.
url
,
config
)
return
config
;
...
...
ui/src/views/component/workspace/create.vue
已删除
100644 → 0
浏览文件 @
a01173e6
<
template
>
<a-modal
:destroy-on-close=
"true"
:mask-closable=
"false"
:title=
"t('create_workspace')"
:visible=
"visible"
:onCancel=
"onCancel"
>
<template
#footer
>
<a-button
key=
"submit"
type=
"primary"
@
click=
"onFinish"
>
{{
t
(
'
save
'
)
}}
</a-button>
<a-button
key=
"back"
@
click=
"() => onCancel()"
>
{{
t
(
'
cancel
'
)
}}
</a-button>
</
template
>
<div>
<a-form
:labelCol=
"{ span: 4 }"
:wrapper-col=
"{span:20}"
>
<a-form-item
:label=
"t('path')"
v-bind=
"validateInfos.path"
:placeholder=
"t('workspace_path')"
>
<a-input-search
v-if=
"isElectron"
v-model:value=
"modelRef.path"
@
search=
"selectDir"
spellcheck=
"false"
>
<
template
#enterButton
>
<a-button>
选择
</a-button>
</
template
>
</a-input-search>
<a-input
v-if=
"!isElectron"
v-model:value=
"modelRef.path"
spellcheck=
"false"
/>
</a-form-item>
<a-form-item
:label=
"t('name')"
>
<a-input
v-model:value=
"modelRef.name"
:placeholder=
"t('use_dir_name')"
/>
</a-form-item>
<a-form-item
:label=
"t('type')"
v-bind=
"validateInfos.type"
>
<a-select
v-model:value=
"modelRef.type"
>
<a-select-option
key=
"func"
value=
"func"
>
{{t('test_type_ztf')}}
</a-select-option>
<a-select-option
key=
"unit"
value=
"unit"
>
{{t('test_type_other')}}
</a-select-option>
</a-select>
</a-form-item>
</a-form>
</div>
</a-modal>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
onMounted
,
PropType
,
reactive
,
ref
,
Ref
}
from
"
vue
"
;
import
{
Interpreter
}
from
"
@/views/config/data
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
Form
}
from
"
ant-design-vue
"
;
import
{
validateInfos
}
from
'
ant-design-vue/lib/form/useForm
'
;
interface
WorkspaceCreateFormSetupData
{
t
:
(
key
:
string
|
number
)
=>
string
;
isElectron
:
Ref
<
boolean
>
;
selectDir
:
()
=>
void
;
modelRef
:
Ref
<
Interpreter
>
validateInfos
:
validateInfos
onFinish
:
()
=>
Promise
<
void
>
;
}
export
default
defineComponent
({
name
:
'
WorkspaceCreateForm
'
,
props
:
{
visible
:
{
type
:
Boolean
,
required
:
true
},
onCancel
:
{
type
:
Function
,
required
:
true
},
onSubmit
:
{
type
:
Function
as
PropType
<
(
values
:
any
)
=>
void
>
,
required
:
true
}
},
components
:
{},
setup
(
props
):
WorkspaceCreateFormSetupData
{
const
{
t
}
=
useI18n
();
const
modelRef
=
ref
<
any
>
({
path
:
''
,
type
:
'
func
'
})
const
rulesRef
=
reactive
({
path
:
[
{
required
:
true
,
message
:
t
(
'
pls_workspace_path
'
)
}
],
type
:
[
{
required
:
true
,
message
:
t
(
'
pls_workspace_type
'
)
}
],
});
const
{
validate
,
validateInfos
}
=
Form
.
useForm
(
modelRef
,
rulesRef
);
const
isElectron
=
ref
(
!!
window
.
require
)
const
selectDir
=
()
=>
{
console
.
log
(
'
selectDir
'
)
if
(
isElectron
.
value
)
{
const
{
dialog
}
=
window
.
require
(
'
@electron/remote
'
);
dialog
.
showOpenDialog
({
properties
:
[
'
openDirectory
'
]
}).
then
(
result
=>
{
if
(
result
.
filePaths
&&
result
.
filePaths
.
length
>
0
)
{
modelRef
.
value
.
path
=
result
.
filePaths
[
0
]
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
}
const
onFinish
=
async
()
=>
{
console
.
log
(
'
onFinish
'
)
validate
().
then
(()
=>
{
props
.
onSubmit
(
modelRef
);
}).
catch
(
err
=>
{
console
.
log
(
''
)
})
}
onMounted
(()
=>
{
console
.
log
(
'
onMounted
'
)
})
return
{
t
,
isElectron
,
selectDir
,
modelRef
,
validateInfos
,
onFinish
}
}
})
</
script
>
\ No newline at end of file
ui/src/views/component/workspace/service.ts
已删除
100644 → 0
浏览文件 @
a01173e6
import
request
from
'
@/utils/request
'
;
const
apiPath
=
'
file
'
;
export
async
function
listUserHome
(
parentDir
):
Promise
<
any
>
{
const
params
=
{
parentDir
:
parentDir
}
return
request
({
url
:
`/
${
apiPath
}
/listDir`
,
method
:
'
get
'
,
params
});
}
ui/src/views/script/index.vue
浏览文件 @
afa2b331
...
...
@@ -3,7 +3,33 @@
<div
id=
"main"
>
<div
id=
"left"
>
<div
class=
"toolbar"
>
<div
class=
"left"
></div>
<div
class=
"left"
>
<a-select
ref=
"select"
v-model:value=
"filerType"
@
change=
"selectFilerType"
style=
"width: 90px"
:bordered=
"false"
>
<a-select-option
value=
"workspace"
>
按目录
</a-select-option>
<a-select-option
value=
"module"
>
按模块
</a-select-option>
<a-select-option
value=
"suite"
>
按套件
</a-select-option>
<a-select-option
value=
"task"
>
按任务
</a-select-option>
</a-select>
<a-select
ref=
"select"
v-model:value=
"filerValue"
@
change=
"selectFilerValue"
style=
"width: 120px"
:bordered=
"false"
:dropdownMatchSelectWidth=
"false"
>
<a-select-option
v-for=
"item in filerItems"
:key=
"item.id"
:value=
"item.id"
>
{{
item
.
name
}}
</a-select-option>
</a-select>
</div>
<div
class=
"right"
>
<a-button
@
click=
"expandAll"
type=
"link"
>
<span
v-if=
"!isExpand"
>
{{
t
(
'
expand_all
'
)
}}
</span>
...
...
@@ -66,6 +92,7 @@ import {Empty, message, notification} from "ant-design-vue";
import
{
MonacoOptions
}
from
"
@/utils/const
"
;
import
MonacoEditor
from
"
@/components/Editor/MonacoEditor.vue
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
getScriptFilters
}
from
"
@/utils/cache
"
;
interface
ListScriptPageSetupData
{
t
:
(
key
:
string
|
number
)
=>
string
;
...
...
@@ -75,6 +102,12 @@ interface ListScriptPageSetupData {
replaceFields
:
any
,
tree
:
Ref
;
filerItems
:
Ref
<
[]
>
filerType
:
Ref
filerValue
:
Ref
selectFilerType
:
(
v
)
=>
void
;
selectFilerValue
:
(
v
)
=>
void
;
script
:
ComputedRef
scriptCode
:
Ref
<
string
>
;
lang
:
Ref
<
string
>
;
...
...
@@ -107,10 +140,31 @@ export default defineComponent({
let
isExpand
=
ref
(
false
);
const
zentaoStore
=
useStore
<
{
zentao
:
ZentaoData
}
>
();
let
scriptLoaded
=
computed
<
any
>
(()
=>
zentaoStore
.
state
.
zentao
.
scriptLoaded
);
const
currSite
=
computed
<
any
>
(()
=>
zentaoStore
.
state
.
zentao
.
currSite
);
const
currProduct
=
computed
<
any
>
(()
=>
zentaoStore
.
state
.
zentao
.
currProduct
);
const
treeData
=
computed
<
any
>
(()
=>
zentaoStore
.
state
.
zentao
.
testScripts
);
console
.
log
(
`treeData loaded
${
scriptLoaded
.
value
}
`
,
treeData
.
value
.
length
)
if
(
!
scriptLoaded
.
value
)
{
// switch to current page
zentaoStore
.
dispatch
(
'
zentao/fetchSitesAndProducts
'
,
{
needLoadScript
:
true
})
}
let
filerItems
=
ref
([]
as
any
)
const
filerType
=
ref
(
''
)
const
filerValue
=
ref
(
''
)
getScriptFilters
().
then
(
(
filter
)
=>
{
filerType
.
value
=
filter
.
by
filerValue
.
value
=
filter
.
val
// filerItems =
})
const
selectFilerType
=
(
val
)
=>
{
console
.
log
(
'
selectFilerType
'
)
}
const
selectFilerValue
=
(
val
)
=>
{
console
.
log
(
'
selectFilerValue
'
)
}
const
expandedKeys
=
ref
<
string
[]
>
([]);
const
getOpenKeys
=
(
treeNode
,
isAll
)
=>
{
...
...
@@ -195,6 +249,13 @@ export default defineComponent({
currSite
,
currProduct
,
treeData
,
filerItems
,
filerType
,
filerValue
,
selectFilerType
,
selectFilerValue
,
replaceFields
,
expandNode
,
selectNode
,
...
...
ui/src/views/script/locales/en-US.ts
浏览文件 @
afa2b331
...
...
@@ -2,8 +2,7 @@ export default {
'
index-layout.menu.script
'
:
'
Script
'
,
'
index-layout.menu.script.list
'
:
'
Script Management
'
,
'
no_script_for_unittest
'
:
'
No scriptS for Unit Test.
'
,
'
expand_all
'
:
'
Expand All
'
,
'
collapse_all
'
:
'
Collapse All
'
,
'
extract_step
'
:
'
Extract Steps
'
,
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录