Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
0ff2be30
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 3 年多
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0ff2be30
编写于
12月 16, 2020
作者:
F
fit2-zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(接口定义): 增加批量方法
上级
884fc213
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
169 addition
and
22 deletion
+169
-22
backend/src/main/java/io/metersphere/xpack
backend/src/main/java/io/metersphere/xpack
+1
-1
frontend/src/business/components/api/definition/components/basis/BatchAddParameter.vue
...nts/api/definition/components/basis/BatchAddParameter.vue
+63
-0
frontend/src/business/components/api/definition/components/body/ApiBody.vue
...ess/components/api/definition/components/body/ApiBody.vue
+36
-4
frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue
...definition/components/request/http/ApiHttpRequestForm.vue
+54
-5
frontend/src/business/components/xpack
frontend/src/business/components/xpack
+1
-1
frontend/src/i18n/en-US.js
frontend/src/i18n/en-US.js
+1
-0
frontend/src/i18n/zh-CN.js
frontend/src/i18n/zh-CN.js
+2
-1
frontend/src/i18n/zh-TW.js
frontend/src/i18n/zh-TW.js
+11
-10
未找到文件。
xpack
@
1fe20ba1
比较
bb494fc6
...
1fe20ba1
Subproject commit
bb494fc68a2367359c9048fa7250c7618de4afb6
Subproject commit
1fe20ba15a7ca3fe9f77ddf866021e7c7dfe5969
frontend/src/business/components/api/definition/components/basis/BatchAddParameter.vue
0 → 100644
浏览文件 @
0ff2be30
<
template
>
<div>
<el-dialog
:title=
"$t('commons.batch_add')"
:visible.sync=
"dialogVisible"
width=
"60%"
class=
"batch-edit-dialog"
:destroy-on-close=
"true"
@
close=
"handleClose"
>
<div>
<div>
格式:参数名,必填,参数值,备注 如:Accept-Encoding,必填,utf-8,编码
</div>
<div
style=
"height: 200px"
>
<ms-code-edit
:enable-format=
"false"
mode=
"text"
:data.sync=
"parameters"
theme=
"eclipse"
:modes=
"['text']"
ref=
"codeEdit"
/>
</div>
</div>
<template
v-slot:footer
>
<ms-dialog-footer
@
cancel=
"dialogVisible = false"
@
confirm=
"confirm()"
/>
</
template
>
</el-dialog>
</div>
</template>
<
script
>
import
MsDialogFooter
from
"
../../../../common/components/MsDialogFooter
"
;
import
{
listenGoBack
,
removeGoBackListener
}
from
"
@/common/js/utils
"
;
import
MsCodeEdit
from
"
../../../../common/components/MsCodeEdit
"
;
export
default
{
name
:
"
BatchAddParameter
"
,
components
:
{
MsDialogFooter
,
MsCodeEdit
},
props
:
{},
data
()
{
return
{
dialogVisible
:
false
,
parameters
:
""
,
}
},
methods
:
{
open
()
{
this
.
dialogVisible
=
true
;
listenGoBack
(
this
.
handleClose
);
},
handleClose
()
{
this
.
parameters
=
""
;
removeGoBackListener
(
this
.
handleClose
);
},
confirm
()
{
this
.
dialogVisible
=
false
;
this
.
$emit
(
"
batchSave
"
,
this
.
parameters
);
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/business/components/api/definition/components/body/ApiBody.vue
浏览文件 @
0ff2be30
...
...
@@ -25,6 +25,10 @@
{{
$t
(
'
api_test.definition.request.body_binary
'
)
}}
</el-radio>
</el-radio-group>
<el-row
v-if=
"body.type == 'Form Data' || body.type == 'WWW_FORM'"
>
<el-link
class=
"ms-el-link"
@
click=
"batchAdd"
>
{{
$t
(
"
commons.batch_add
"
)
}}
</el-link>
</el-row>
<ms-api-variable
:is-read-only=
"isReadOnly"
:parameters=
"body.kvs"
:isShowEnable=
"isShowEnable"
...
...
@@ -55,12 +59,14 @@
type=
"body"
v-if=
"body.type == 'BINARY'"
/>
<batch-add-parameter
@
batchSave=
"batchSave"
ref=
"batchAddParameter"
/>
</div>
</
template
>
<
script
>
import
MsApiKeyValue
from
"
../ApiKeyValue
"
;
import
{
BODY_
FORMAT
,
BODY_
TYPE
,
KeyValue
}
from
"
../../model/ApiTestModel
"
;
import
{
BODY_TYPE
,
KeyValue
}
from
"
../../model/ApiTestModel
"
;
import
MsCodeEdit
from
"
../../../../common/components/MsCodeEdit
"
;
import
MsJsonCodeEdit
from
"
../../../../common/components/MsJsonCodeEdit
"
;
...
...
@@ -68,6 +74,7 @@
import
MsApiVariable
from
"
../ApiVariable
"
;
import
MsApiBinaryVariable
from
"
./ApiBinaryVariable
"
;
import
MsApiFromUrlVariable
from
"
./ApiFromUrlVariable
"
;
import
BatchAddParameter
from
"
../basis/BatchAddParameter
"
;
export
default
{
name
:
"
MsApiBody
"
,
...
...
@@ -78,7 +85,8 @@
MsApiKeyValue
,
MsApiBinaryVariable
,
MsApiFromUrlVariable
,
MsJsonCodeEdit
MsJsonCodeEdit
,
BatchAddParameter
},
props
:
{
body
:
{},
...
...
@@ -147,9 +155,29 @@
},
jsonError
(
e
)
{
this
.
$error
(
e
);
}
},
},
batchAdd
()
{
this
.
$refs
.
batchAddParameter
.
open
();
},
batchSave
(
data
)
{
if
(
data
)
{
let
params
=
data
.
split
(
"
\n
"
);
let
keyValues
=
[];
params
.
forEach
(
item
=>
{
let
line
=
item
.
split
(
/,|,/
);
let
required
=
false
;
if
(
line
[
1
]
===
'
必填
'
||
line
[
1
]
===
'
true
'
)
{
required
=
true
;
}
keyValues
.
push
(
new
KeyValue
({
name
:
line
[
0
],
required
:
required
,
value
:
line
[
2
],
description
:
line
[
3
],
type
:
"
text
"
,
valid
:
false
,
file
:
false
,
encode
:
true
,
enable
:
true
,
contentType
:
"
text/plain
"
}));
})
keyValues
.
forEach
(
item
=>
{
this
.
body
.
kvs
.
unshift
(
item
);
})
}
},
},
created
()
{
if
(
!
this
.
body
.
type
)
{
this
.
body
.
type
=
BODY_TYPE
.
FORM_DATA
;
...
...
@@ -187,4 +215,8 @@
margin-top
:
15px
;
}
.ms-el-link
{
float
:
right
;
margin-right
:
45px
;
}
</
style
>
frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue
浏览文件 @
0ff2be30
...
...
@@ -13,7 +13,6 @@
</div>
</span>
</el-tooltip>
<ms-api-key-value
:is-read-only=
"isReadOnly"
:isShowEnable=
"isShowEnable"
:suggestions=
"headerSuggestions"
:items=
"headers"
/>
</el-tab-pane>
...
...
@@ -25,7 +24,9 @@
<div
class=
"el-step__icon-inner"
>
{{
request
.
arguments
.
length
-
1
}}
</div>
</div></span>
</el-tooltip>
<el-row>
<el-link
class=
"ms-el-link"
@
click=
"batchAdd"
>
{{
$t
(
"
commons.batch_add
"
)
}}
</el-link>
</el-row>
<ms-api-variable
:is-read-only=
"isReadOnly"
:isShowEnable=
"isShowEnable"
:parameters=
"request.arguments"
/>
</el-tab-pane>
...
...
@@ -39,6 +40,9 @@
</div>
</span>
</el-tooltip>
<el-row>
<el-link
class=
"ms-el-link"
@
click=
"batchAdd"
>
{{
$t
(
"
commons.batch_add
"
)
}}
</el-link>
</el-row>
<ms-api-variable
:is-read-only=
"isReadOnly"
:isShowEnable=
"isShowEnable"
:parameters=
"request.rest"
/>
</el-tab-pane>
...
...
@@ -71,6 +75,9 @@
<!--提取规则-->
<ms-api-extract
:is-read-only=
"isReadOnly"
@
copyRow=
"copyRow"
@
remove=
"remove"
v-if=
"row.type==='Extract'"
:extract=
"row"
/>
</div>
<batch-add-parameter
@
batchSave=
"batchSave"
ref=
"batchAddParameter"
/>
</div>
</el-col>
<!--操作按钮-->
...
...
@@ -98,15 +105,24 @@
import
{
createComponent
}
from
"
../../jmeter/components
"
;
import
MsApiAssertions
from
"
../../assertion/ApiAssertions
"
;
import
MsApiExtract
from
"
../../extract/ApiExtract
"
;
import
{
Assertions
,
Body
,
Extract
}
from
"
../../../model/ApiTestModel
"
;
import
{
Assertions
,
Body
,
Extract
,
KeyValue
}
from
"
../../../model/ApiTestModel
"
;
import
{
getUUID
}
from
"
@/common/js/utils
"
;
import
BatchAddParameter
from
"
../../basis/BatchAddParameter
"
;
export
default
{
name
:
"
MsApiHttpRequestForm
"
,
components
:
{
MsJsr233Processor
,
MsApiAdvancedConfig
,
MsApiVariable
,
ApiRequestMethodSelect
,
MsApiExtract
,
MsApiAuthConfig
,
MsApiBody
,
MsApiKeyValue
,
MsApiAssertions
BatchAddParameter
,
MsApiVariable
,
ApiRequestMethodSelect
,
MsApiExtract
,
MsApiAuthConfig
,
MsApiBody
,
MsApiKeyValue
,
MsApiAssertions
},
props
:
{
request
:
{},
...
...
@@ -149,7 +165,7 @@
},
headerSuggestions
:
REQUEST_HEADERS
,
isReloadData
:
false
,
isBodyShow
:
true
isBodyShow
:
true
,
}
},
...
...
@@ -216,6 +232,35 @@
this
.
$nextTick
(()
=>
{
this
.
isBodyShow
=
true
;
});
},
batchAdd
()
{
this
.
$refs
.
batchAddParameter
.
open
();
},
batchSave
(
data
)
{
if
(
data
)
{
let
params
=
data
.
split
(
"
\n
"
);
let
keyValues
=
[];
params
.
forEach
(
item
=>
{
let
line
=
item
.
split
(
/,|,/
);
let
required
=
false
;
if
(
line
[
1
]
===
'
必填
'
||
line
[
1
]
===
'
true
'
)
{
required
=
true
;
}
keyValues
.
push
(
new
KeyValue
({
name
:
line
[
0
],
required
:
required
,
value
:
line
[
2
],
description
:
line
[
3
],
type
:
"
text
"
,
valid
:
false
,
file
:
false
,
encode
:
true
,
enable
:
true
,
contentType
:
"
text/plain
"
}));
})
keyValues
.
forEach
(
item
=>
{
switch
(
this
.
activeName
)
{
case
"
parameters
"
:
this
.
request
.
arguments
.
unshift
(
item
);
break
;
case
"
rest
"
:
this
.
request
.
rest
.
unshift
(
item
);
break
;
default
:
break
;
}
})
}
}
}
}
...
...
@@ -273,4 +318,8 @@
border
:
#E6EEF2
;
}
.ms-el-link
{
float
:
right
;
margin-right
:
45px
;
}
</
style
>
xpack
@
29a8fc09
比较
a22a3005
...
29a8fc09
Subproject commit
a22a3005d9bd254793fcf634d72539cbdf31be3a
Subproject commit
29a8fc09602fde5708af06582ac972d98eb69836
frontend/src/i18n/en-US.js
浏览文件 @
0ff2be30
...
...
@@ -124,6 +124,7 @@ export default {
already_exists
:
'
The name already exists
'
,
modifier
:
'
Modifier
'
,
validate
:
"
Validate
"
,
batch_add
:
"
Batch add
"
,
date
:
{
select_date
:
'
Select date
'
,
start_date
:
'
Start date
'
,
...
...
frontend/src/i18n/zh-CN.js
浏览文件 @
0ff2be30
...
...
@@ -124,6 +124,7 @@ export default {
already_exists
:
'
名称不能重复
'
,
modifier
:
'
修改人
'
,
validate
:
"
校验
"
,
batch_add
:
"
批量添加
"
,
date
:
{
select_date
:
'
选择日期
'
,
start_date
:
'
开始日期
'
,
...
...
@@ -589,7 +590,7 @@ export default {
select_table
:
"
选择可见数据
"
,
select_all
:
"
选择全部数据
"
},
report_name_info
:
'
请输入报
名
名称
'
,
report_name_info
:
'
请输入报
告
名称
'
,
save_case_info
:
'
请先保存用例
'
,
reference_deleted
:
'
引用已删除
'
,
},
...
...
frontend/src/i18n/zh-TW.js
浏览文件 @
0ff2be30
...
...
@@ -124,6 +124,7 @@ export default {
already_exists
:
'
名稱不能重復
'
,
modifier
:
'
修改人
'
,
validate
:
"
校驗
"
,
batch_add
:
"
批量添加
"
,
date
:
{
select_date
:
'
選擇日期
'
,
start_date
:
'
開始日期
'
,
...
...
@@ -166,7 +167,7 @@ export default {
current_user
:
"
是當前用戶
"
}
},
monitor
:
"
監控
"
,
monitor
:
"
監控
"
,
all_label
:
{
case
:
"
全部用例
"
,
review
:
"
全部評審
"
...
...
@@ -589,7 +590,7 @@ export default {
select_table
:
"
選擇可見數據
"
,
select_all
:
"
選擇全部數據
"
},
report_name_info
:
'
請輸入報
名
名稱
'
,
report_name_info
:
'
請輸入報
告
名稱
'
,
save_case_info
:
'
請先保存用例
'
,
reference_deleted
:
'
引用已删除
'
,
},
...
...
@@ -829,14 +830,14 @@ export default {
not_exist
:
"
測試報告不存在
"
,
},
api_monitor
:
{
to
:
"
到
"
,
start_time
:
"
開始時間
"
,
end_time
:
"
結束時間
"
,
today
:
"
今天
"
,
this_week
:
"
本週
"
,
this_mouth
:
"
本月
"
,
please_search
:
"
請搜索
"
,
date
:
"
日期
"
to
:
"
到
"
,
start_time
:
"
開始時間
"
,
end_time
:
"
結束時間
"
,
today
:
"
今天
"
,
this_week
:
"
本週
"
,
this_mouth
:
"
本月
"
,
please_search
:
"
請搜索
"
,
date
:
"
日期
"
},
test_track
:
{
test_track
:
"
測試跟蹤
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录