feat(测试): ActiveMq topic发送测试
This commit is contained in:
parent
a18853d1a8
commit
b552bba543
10
src/api/mes/print/topic-send-test.js
Normal file
10
src/api/mes/print/topic-send-test.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/router/axios'
|
||||
import {nlv_print} from "@/api/prefix";
|
||||
|
||||
export function send(query) {
|
||||
return request({
|
||||
url: nlv_print('/topic-send-test/send'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -76,5 +76,14 @@ export default [
|
||||
meta: {
|
||||
keepAlive: true
|
||||
}
|
||||
}, {
|
||||
path: '/test/topic-send-msg',
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "page" */ '@/views/mes/print/topic-send-test'),
|
||||
name: 'TOPIC发送测试',
|
||||
meta: {
|
||||
keepAlive: true,
|
||||
isAuth: false,
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
45
src/views/mes/print/topic-send-test/index.vue
Normal file
45
src/views/mes/print/topic-send-test/index.vue
Normal file
@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<div class="execution">
|
||||
<el-input type="textarea" v-model="formObj.msg" clearable/>
|
||||
<el-button type="primary" @click="sendMsg">发送测试</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
send
|
||||
} from '@/api/mes/print/topic-send-test'
|
||||
import {showLoading, hideLoading} from "@/const/loading";
|
||||
|
||||
export default {
|
||||
name: "topic-send-test",
|
||||
data() {
|
||||
return {
|
||||
formObj: {
|
||||
msg: ''
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
//显示操作弹窗框
|
||||
sendMsg() {
|
||||
let message = {value: this.formObj.msg}
|
||||
showLoading();
|
||||
send({topicName: 'dashboard-test', message: JSON.stringify(message)}).then(response => {
|
||||
hideLoading();
|
||||
this.$message.success("发送成功")
|
||||
})
|
||||
.catch(() => {
|
||||
hideLoading();
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user