Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
ec0a630c
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,发现更多精彩内容 >>
提交
ec0a630c
编写于
4月 24, 2020
作者:
Q
q4speed
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
message
上级
5c40ea53
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
76 addition
and
39 deletion
+76
-39
frontend/src/business/components/api/test/ApiTestConfig.vue
frontend/src/business/components/api/test/ApiTestConfig.vue
+20
-25
frontend/src/business/components/api/test/ApiTestList.vue
frontend/src/business/components/api/test/ApiTestList.vue
+6
-14
frontend/src/business/main.js
frontend/src/business/main.js
+2
-0
frontend/src/common/js/message.js
frontend/src/common/js/message.js
+48
-0
未找到文件。
frontend/src/business/components/api/test/ApiTestConfig.vue
浏览文件 @
ec0a630c
...
...
@@ -19,7 +19,7 @@
<el-button
type=
"primary"
plain
:disabled=
"isDisabled"
@
click=
"runTest"
>
{{
$t
(
'
load_test.save_and_run
'
)
}}
</el-button>
<el-button
type=
"warning"
plain
@
click=
"c
lear"
>
{{
$t
(
'
commons.clear
'
)
}}
</el-button>
<el-button
type=
"warning"
plain
@
click=
"c
ancel"
>
{{
$t
(
'
commons.cancel
'
)
}}
</el-button>
</el-row>
</el-header>
<ms-api-scenario-config
:scenarios=
"test.scenarioDefinition"
ref=
"config"
/>
...
...
@@ -50,14 +50,7 @@
},
watch
:
{
'
$route
'
(
to
)
{
if
(
to
.
query
.
id
)
{
this
.
getTest
(
to
.
query
.
id
);
}
else
{
this
.
test
=
new
Test
();
this
.
$refs
.
config
.
reset
();
}
},
'
$route
'
:
'
init
'
,
test
:
{
handler
:
function
()
{
this
.
change
=
true
;
...
...
@@ -67,6 +60,19 @@
},
methods
:
{
init
:
function
()
{
this
.
result
=
this
.
$get
(
"
/project/listAll
"
,
response
=>
{
this
.
projects
=
response
.
data
;
})
if
(
this
.
id
)
{
this
.
getTest
(
this
.
id
);
}
else
{
this
.
test
=
new
Test
();
if
(
this
.
$refs
.
config
)
{
this
.
$refs
.
config
.
reset
();
}
}
},
getTest
:
function
(
id
)
{
this
.
result
=
this
.
$get
(
"
/api/get/
"
+
id
,
response
=>
{
let
item
=
response
.
data
;
...
...
@@ -85,10 +91,7 @@
this
.
result
=
this
.
$post
(
"
/api/save
"
,
this
.
getParam
(),
response
=>
{
this
.
test
.
id
=
response
.
data
;
this
.
$message
({
message
:
this
.
$t
(
'
commons.save_success
'
),
type
:
'
success
'
});
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
});
},
runTest
:
function
()
{
...
...
@@ -96,14 +99,11 @@
this
.
result
=
this
.
$post
(
"
/api/run
"
,
this
.
getParam
(),
response
=>
{
this
.
test
.
id
=
response
.
data
;
this
.
$message
({
message
:
this
.
$t
(
'
commons.save_success
'
),
type
:
'
success
'
});
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
});
},
c
lear
:
function
()
{
this
.
test
=
new
Test
(
);
c
ancel
:
function
()
{
this
.
$router
.
push
(
'
/api/test/list/all
'
);
},
getParam
:
function
()
{
return
{
...
...
@@ -122,12 +122,7 @@
},
created
()
{
this
.
result
=
this
.
$get
(
"
/project/listAll
"
,
response
=>
{
this
.
projects
=
response
.
data
;
})
if
(
this
.
id
)
{
this
.
getTest
(
this
.
id
);
}
this
.
init
();
}
}
</
script
>
...
...
frontend/src/business/components/api/test/ApiTestList.vue
浏览文件 @
ec0a630c
...
...
@@ -75,16 +75,11 @@
}
},
watch
:
{
'
$route
'
(
to
)
{
this
.
projectId
=
to
.
params
.
projectId
;
this
.
search
();
}
},
created
:
function
()
{
this
.
projectId
=
this
.
$route
.
params
.
projectId
;
this
.
search
();
beforeRouteEnter
(
to
,
from
,
next
)
{
next
(
self
=>
{
self
.
projectId
=
to
.
params
.
projectId
;
self
.
search
();
});
},
methods
:
{
...
...
@@ -121,10 +116,7 @@
callback
:
(
action
)
=>
{
if
(
action
===
'
confirm
'
)
{
this
.
result
=
this
.
$post
(
"
/api/delete
"
,
{
id
:
test
.
id
},
()
=>
{
this
.
$message
({
message
:
this
.
$t
(
'
commons.delete_success
'
),
type
:
'
success
'
});
this
.
$success
(
this
.
$t
(
'
commons.delete_success
'
));
this
.
search
();
});
}
...
...
frontend/src/business/main.js
浏览文件 @
ec0a630c
...
...
@@ -5,6 +5,7 @@ import icon from "../common/js/icon";
import
filters
from
"
../common/js/filter
"
;
import
ajax
from
"
../common/js/ajax
"
;
import
App
from
'
./App.vue
'
;
import
message
from
"
../common/js/message
"
;
import
router
from
"
./components/common/router/router
"
;
import
'
./permission
'
// permission control
import
i18n
from
"
../i18n/i18n
"
;
...
...
@@ -22,6 +23,7 @@ Vue.use(ElementUI, {
Vue
.
use
(
filters
);
Vue
.
use
(
ajax
);
Vue
.
use
(
chart
);
Vue
.
use
(
message
)
// v-permission
Vue
.
directive
(
'
permission
'
,
permission
);
...
...
frontend/src/common/js/message.js
0 → 100644
浏览文件 @
ec0a630c
import
{
Message
}
from
'
element-ui
'
;
export
default
{
install
(
Vue
)
{
if
(
!
Message
)
{
window
.
console
.
error
(
'
You have to install Message of ElementUI
'
);
return
}
Vue
.
prototype
.
$success
=
function
(
message
)
{
Message
.
success
({
message
:
message
,
type
:
"
success
"
,
showClose
:
true
,
duration
:
1000
})
};
Vue
.
prototype
.
$info
=
function
(
message
)
{
Message
.
info
({
message
:
message
,
type
:
"
info
"
,
showClose
:
true
,
duration
:
3000
})
};
Vue
.
prototype
.
$warning
=
function
(
message
)
{
Message
.
warning
({
message
:
message
,
type
:
"
warning
"
,
showClose
:
true
,
duration
:
2000
})
};
Vue
.
prototype
.
$error
=
function
(
message
)
{
Message
.
error
({
message
:
message
,
type
:
"
error
"
,
showClose
:
true
,
duration
:
10000
})
};
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录