feat(测试): ActiveMq topic发送测试

This commit is contained in:
syngna_qiao 2025-01-02 08:40:20 +08:00
parent a18853d1a8
commit b552bba543
3 changed files with 64 additions and 0 deletions

View 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
})
}

View File

@ -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,
}
},
]

View 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>