Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
e5860960
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
10 个月 前同步成功
通知
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 搜索 >>
提交
e5860960
编写于
5月 18, 2022
作者:
Z
zhaoke
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'morden-ui' of github.com:easysoft/zentaoatf into morden-ui
上级
89d84aae
4276f61a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
170 addition
and
11 deletion
+170
-11
ui/src/layouts/MainLayout/components/Col.vue
ui/src/layouts/MainLayout/components/Col.vue
+1
-1
ui/src/layouts/MainLayout/components/FormItem.vue
ui/src/layouts/MainLayout/components/FormItem.vue
+10
-3
ui/src/layouts/MainLayout/components/TabPage.vue
ui/src/layouts/MainLayout/components/TabPage.vue
+2
-0
ui/src/layouts/MainLayout/components/TabPageExecUnit.vue
ui/src/layouts/MainLayout/components/TabPageExecUnit.vue
+138
-0
ui/src/layouts/MainLayout/components/WorkDir.vue
ui/src/layouts/MainLayout/components/WorkDir.vue
+13
-1
ui/src/services/workspace.ts
ui/src/services/workspace.ts
+1
-1
ui/src/store/tabs.ts
ui/src/store/tabs.ts
+1
-1
ui/src/store/workspace.ts
ui/src/store/workspace.ts
+4
-4
未找到文件。
ui/src/layouts/MainLayout/components/Col.vue
浏览文件 @
e5860960
...
...
@@ -41,7 +41,7 @@ const colClass = computed(() => {
const
colStyle
=
computed
(()
=>
{
const
style
:
Record
<
string
,
any
>
=
{};
const
width
=
typeof
(
props
.
width
)
===
"
undefined
"
?
''
:
props
.
width
const
width
=
typeof
(
props
.
width
)
===
"
undefined
"
?
''
:
(
props
.
width
.
indexOf
(
'
px
'
)
>
0
?
props
.
width
:
props
.
width
+
'
%
'
)
const
span
=
typeof
(
props
.
span
)
===
"
undefined
"
?
-
1
:
props
.
span
const
flex
=
typeof
(
props
.
flex
)
===
"
undefined
"
?
-
1
:
props
.
flex
...
...
ui/src/layouts/MainLayout/components/FormItem.vue
浏览文件 @
e5860960
...
...
@@ -37,8 +37,8 @@ export interface FormItemProps {
const
props
=
defineProps
<
FormItemProps
>
();
console
.
log
(
props
)
let
labelCol
=
inject
(
'
labelCol
'
);
let
wrapperCol
=
inject
(
'
wrapperCol
'
);
let
labelCol
=
inject
(
'
labelCol
'
)
+
''
;
let
wrapperCol
=
inject
(
'
wrapperCol
'
)
+
''
;
const
size
=
ref
(
props
.
size
)
const
errorMap
=
computed
(()
=>
{
...
...
@@ -67,7 +67,7 @@ const getWidth = (val: string) => {
return
val
;
}
return
undefined
;
return
val
;
}
const
getCls
=
(
val
:
string
)
=>
{
if
(
!
val
)
return
undefined
...
...
@@ -97,10 +97,17 @@ const getCls = (val: string) => {
}
.z-form-item-wrapper {
.z-form-item-control {
height: 100%;
input, select {
width: 90%;
height: 28px;
vertical-align: middle;
}
input[type="checkbox"] {
width: auto;
height: 14px;
margin-top: 6px;
}
label {
display: inline-block;
padding: 0 3px;
...
...
ui/src/layouts/MainLayout/components/TabPage.vue
浏览文件 @
e5860960
...
...
@@ -11,6 +11,7 @@ import TabPageResult from './TabPageResult.vue';
import
TabPageScript
from
'
./TabPageScript.vue
'
;
import
TabPageSettings
from
'
./TabPageSettings.vue
'
;
import
TabPageSites
from
'
./TabPageSites.vue
'
;
import
TabPageExecUnit
from
'
./TabPageExecUnit.vue
'
;
import
TabPageUnknown
from
'
./TabPageUnknown.vue
'
;
import
{
useI18n
}
from
"
vue-i18n
"
;
const
{
t
}
=
useI18n
();
...
...
@@ -20,6 +21,7 @@ const PageTabComponent = {
settings
:
TabPageSettings
,
result
:
TabPageResult
,
sites
:
TabPageSites
,
execUnit
:
TabPageExecUnit
,
unknown
:
TabPageUnknown
,
};
...
...
ui/src/layouts/MainLayout/components/TabPageExecUnit.vue
0 → 100644
浏览文件 @
e5860960
<
template
>
<div
class=
"tab-page-exec-unit"
>
<Form
labelCol=
"180px"
wrapperCol=
"60"
>
<FormItem
name=
"cmd"
:label=
"t('test_cmd')"
:info=
"validateInfos.cmd"
>
<input
v-model=
"modelRef.cmd"
@
keydown=
"keydown"
/>
</FormItem>
<FormItem
v-if=
"currProduct.id"
name=
"submitResult"
:label=
"t('submit_result_to_zentao')"
>
<input
v-model=
"modelRef.submitResult"
type=
"checkbox"
>
</FormItem>
<FormItem>
<a-button
:disabled=
"isRunning === 'true' || !modelRef.cmd"
@
click=
"start"
type=
"primary"
class=
"t-btn-gap"
>
{{
t
(
'
exec
'
)
}}
</a-button>
<a-button
v-if=
"isRunning === 'true'"
@
click=
"stop"
class=
"t-btn-gap"
>
{{
t
(
'
stop
'
)
}}
</a-button>
</FormItem>
<FormItem>
<span
class=
"t-tips"
>
{{
t
(
'
cmd_nav
'
)
}}
</span>
</FormItem>
</Form>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
withDefaults
,
defineProps
,
computed
,
ref
,
watch
}
from
"
vue
"
;
import
{
PageTab
}
from
"
@/store/tabs
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
useForm
}
from
"
@/utils/form
"
;
const
{
t
}
=
useI18n
();
import
Form
from
"
./Form.vue
"
;
import
FormItem
from
"
./FormItem.vue
"
;
import
{
get
}
from
"
@/views/workspace/service
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
import
{
getCmdHistories
,
setCmdHistories
}
from
"
@/utils/cache
"
;
import
{
WorkspaceData
}
from
"
@/store/workspace
"
;
import
bus
from
"
@/utils/eventBus
"
;
import
settings
from
"
@/config/settings
"
;
const
props
=
withDefaults
(
defineProps
<
{
tab
:
PageTab
}
>
(),
{})
const
zentaoStore
=
useStore
<
{
Zentao
:
ZentaoData
}
>
();
const
currProduct
=
computed
<
any
>
(()
=>
zentaoStore
.
state
.
Zentao
.
currProduct
);
const
scriptStore
=
useStore
<
{
Script
:
ScriptData
}
>
();
const
currWorkspace
=
computed
<
any
>
(()
=>
scriptStore
.
state
.
Script
.
currWorkspace
);
const
workspaceId
=
computed
<
any
>
(()
=>
props
.
tab
.
data
.
workspaceId
)
const
workspaceType
=
computed
<
any
>
(()
=>
props
.
tab
.
data
.
workspaceType
)
const
modelRef
=
ref
({}
as
any
)
const
isRunning
=
ref
(
false
)
const
histories
=
ref
([]
as
any
[])
const
historyIndex
=
ref
(
0
)
const
rulesRef
=
ref
({
cmd
:
[
{
required
:
true
,
msg
:
'
Please input test command.
'
},
],
})
const
{
validate
,
reset
,
validateInfos
}
=
useForm
(
modelRef
,
rulesRef
);
const
loadWorkspaceCmd
=
async
()
=>
{
get
(
currWorkspace
.
value
.
id
).
then
((
json
)
=>
{
modelRef
.
value
=
Object
.
assign
({
cmd
:
json
.
data
.
cmd
},
currWorkspace
.
value
)
})
}
const
loadCmdHistories
=
async
()
=>
{
histories
.
value
=
await
getCmdHistories
(
currWorkspace
.
value
.
id
)
historyIndex
.
value
=
histories
.
value
?
histories
.
value
.
length
:
0
}
watch
(
currWorkspace
,
()
=>
{
console
.
log
(
'
watch currWorkspace
'
,
currWorkspace
)
loadCmdHistories
()
loadWorkspaceCmd
()
},
{
deep
:
true
})
if
(
workspaceId
.
value
>
0
&&
workspaceId
.
value
!==
currWorkspace
.
value
.
id
)
{
scriptStore
.
dispatch
(
'
Script/changeWorkspace
'
,
{
id
:
workspaceId
.
value
,
type
:
workspaceType
.
value
})
}
const
start
=
()
=>
{
console
.
log
(
'
start exec unit test
'
,
modelRef
.
value
)
addHistory
()
const
data
=
Object
.
assign
({
execType
:
'
unit
'
},
modelRef
.
value
)
bus
.
emit
(
settings
.
eventExec
,
data
);
}
const
stop
=
()
=>
{
console
.
log
(
'
stop
'
)
}
const
addHistory
=
()
=>
{
if
(
modelRef
.
value
.
cmd
!==
histories
.
value
[
histories
.
value
.
length
-
1
])
histories
.
value
.
push
(
modelRef
.
value
.
cmd
)
if
(
histories
.
value
.
length
>
10
)
histories
.
value
=
histories
.
value
.
slice
(
histories
.
value
.
length
-
10
)
setCmdHistories
(
currWorkspace
.
value
.
id
,
histories
.
value
)
historyIndex
.
value
=
histories
.
value
.
length
}
const
keydown
=
(
e
)
=>
{
console
.
log
(
'
keydown
'
,
e
.
code
)
if
(
e
.
code
===
'
ArrowUp
'
)
{
if
(
historyIndex
.
value
>
0
)
historyIndex
.
value
--
modelRef
.
value
.
cmd
=
histories
.
value
[
historyIndex
.
value
]
}
else
if
(
e
.
code
===
'
ArrowDown
'
)
{
if
(
historyIndex
.
value
<
histories
.
value
.
length
-
1
)
historyIndex
.
value
++
modelRef
.
value
.
cmd
=
histories
.
value
[
historyIndex
.
value
]
}
}
console
.
log
(
workspaceId
,
workspaceType
)
</
script
>
<
style
lang=
"less"
scoped
>
.tab-page-exec-unit {
padding: 16px;
}
</
style
>
ui/src/layouts/MainLayout/components/WorkDir.vue
浏览文件 @
e5860960
...
...
@@ -80,6 +80,7 @@ import {ExecStatus} from "@/store/exec";
import
debounce
from
"
lodash.debounce
"
;
import
throttle
from
"
lodash.debounce
"
;
import
{
isInArray
}
from
"
@/utils/array
"
;
import
{
PageType
}
from
"
@/store/tabs
"
;
const
{
t
}
=
useI18n
();
...
...
@@ -141,7 +142,18 @@ const onToolbarClicked = (e) => {
}
const
runTest
=
(
node
)
=>
{
console
.
log
(
node
)
console
.
log
(
'
runTest
'
,
node
.
value
)
store
.
dispatch
(
'
tabs/open
'
,
{
id
:
'
workspace-
'
+
node
.
value
.
workspaceId
,
title
:
node
.
value
.
title
,
type
:
'
execUnit
'
,
changed
:
false
,
data
:
{
workspaceId
:
node
.
value
.
workspaceId
,
workspaceType
:
node
.
value
.
workspaceType
,
}
});
}
const
modalClose
=
()
=>
{
...
...
ui/src/services/workspace.ts
浏览文件 @
e5860960
...
...
@@ -2,7 +2,7 @@ import request from '@/utils/request';
const
apiPath
=
'
workspaces
'
;
export
async
function
query
Workspace
(
currWorkspacePath
:
string
):
Promise
<
any
>
{
export
async
function
get
Workspace
(
currWorkspacePath
:
string
):
Promise
<
any
>
{
const
params
=
{
currWorkspace
:
currWorkspacePath
}
return
request
({
...
...
ui/src/store/tabs.ts
浏览文件 @
e5860960
...
...
@@ -5,7 +5,7 @@ import { StoreModuleType } from "@/utils/store";
* Page type(Test script, Test result, settings and sites)
* 标签页页面类型(测试脚步代码、测试结果、设置、站点管理)
*/
export
type
PageType
=
'
script
'
|
'
result
'
|
'
settings
'
|
'
sites
'
;
export
type
PageType
=
'
script
'
|
'
result
'
|
'
settings
'
|
'
sites
'
|
'
execUnit
'
;
/**
* Single page tab
...
...
ui/src/store/workspace.ts
浏览文件 @
e5860960
import
{
Mutation
,
Action
}
from
'
vuex
'
;
import
{
StoreModuleType
}
from
"
@/utils/store
"
;
import
{
ResponseData
}
from
'
@/utils/request
'
;
import
{
queryWorkspace
,
delete
Workspace
}
from
"
@/services/workspace
"
;
import
{
deleteWorkspace
,
get
Workspace
}
from
"
@/services/workspace
"
;
import
{
setCache
}
from
"
@/utils/localCache
"
;
import
settings
from
'
@/config/settings
'
;
...
...
@@ -32,7 +32,7 @@ const initState: WorkspaceData = {
const
StoreModel
:
ModuleType
=
{
namespaced
:
true
,
name
:
'
w
orkspace
'
,
name
:
'
W
orkspace
'
,
state
:
{
...
initState
},
...
...
@@ -51,7 +51,7 @@ const StoreModel: ModuleType = {
actions
:
{
async
fetchWorkspace
({
commit
},
currWorkspacePath
)
{
try
{
const
response
:
ResponseData
=
await
query
Workspace
(
currWorkspacePath
);
const
response
:
ResponseData
=
await
get
Workspace
(
currWorkspacePath
);
const
{
data
}
=
response
;
commit
(
'
saveWorkspaces
'
,
data
||
{});
...
...
@@ -64,7 +64,7 @@ const StoreModel: ModuleType = {
try
{
await
deleteWorkspace
(
selectedWorkspacePath
);
const
response
:
ResponseData
=
await
query
Workspace
(
''
);
const
response
:
ResponseData
=
await
get
Workspace
(
''
);
const
{
data
}
=
response
;
commit
(
'
saveWorkspaces
'
,
data
||
{});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录