作者 小范

新增三个配置管理界面

  1 +import http from './http.js'
  2 +
  3 +let baseUrl = 'dataexchange/manage'
  4 +let baseUrl1 = 'dataexchange/task'
  5 +
  6 +
  7 +//接收
  8 +export const listReceConfigs = params =>{return http.get(`${baseUrl}/listReceConfigs`, params);};
  9 +export const insertReceConfig = params =>{return http.post(`${baseUrl}/insertReceConfig`, params);};
  10 +export const deleteReceConfig = params =>{return http.get(`${baseUrl}/deleteReceConfig`, params);};
  11 +export const addrecetask = params =>{return http.delete(`${baseUrl1}/addrecetask`, params);};
  12 +export const removereceTask = params =>{return http.post(`${baseUrl1}/removereceTask`, params);};
  13 +//发送
  14 +export const listSendConfigs = params =>{return http.get(`${baseUrl}/listSendConfigs`, params);};
  15 +export const insertSendConfig = params =>{return http.post(`${baseUrl}/insertSendConfig`, params);};
  16 +export const deleteSendConfig = params =>{return http.get(`${baseUrl}/deleteSendConfig`, params);};
  17 +export const addsendtask = params =>{return http.delete(`${baseUrl1}/addsendtask`, params);};
  18 +export const removesendTask = params =>{return http.post(`${baseUrl1}/removesendTask`, params);};
  19 +//MQ
  20 +export const listRabbitConfigs = params =>{return http.get(`${baseUrl}/listRabbitConfigs`, params);};
  21 +export const insertRabbitConfig = params =>{return http.post(`${baseUrl}/insertRabbitConfig`, params);};
  22 +export const deleteRabbitConfig = params =>{return http.get(`${baseUrl}/deleteRabbitConfig`, params);};
@@ -123,6 +123,12 @@ import goods from './views/charging/goods.vue' @@ -123,6 +123,12 @@ import goods from './views/charging/goods.vue'
123 import check from './views/charging/check.vue' 123 import check from './views/charging/check.vue'
124 import sort from './views/charging/sort.vue' 124 import sort from './views/charging/sort.vue'
125 import work from './views/charging/work.vue' 125 import work from './views/charging/work.vue'
  126 +//配置管理
  127 +import receive from './views/configuration/receive.vue'
  128 +import sending from './views/configuration/sending.vue'
  129 +import mq from './views/configuration/mq.vue'
  130 +//大数据管理
  131 +import management from './views/managements/management.vue'
126 132
127 import departure from './views/airtransport/departure.vue' 133 import departure from './views/airtransport/departure.vue'
128 import declare from './views/airtransport/declare.vue' 134 import declare from './views/airtransport/declare.vue'
@@ -557,6 +563,23 @@ let routes = [ @@ -557,6 +563,23 @@ let routes = [
557 ] 563 ]
558 }, 564 },
559 { 565 {
  566 + path: '/',
  567 + component: HomeNew,
  568 + name: '配置管理',
  569 + iconCls: 'el-icon-delete-location',
  570 + children: [
  571 + {path:'/receive',component:receive,name:'接收配置管理'},
  572 + {path:'/sending',component:sending,name:'发送配置管理'},
  573 + {path:'/mq',component:mq,name:'MQ配置管理'},
  574 + ]
  575 + },
  576 + {
  577 + path: '/management',
  578 + component: management,
  579 + name: '大数据管理',
  580 + iconCls: 'el-icon-delete-location'
  581 + },
  582 + {
560 path: '/at', 583 path: '/at',
561 component: HomeNew, 584 component: HomeNew,
562 name: '在港动态', 585 name: '在港动态',
  1 +<template>
  2 + <section>
  3 + <!--工具条-->
  4 + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5 + <el-form :inline="true" :model="filters">
  6 + <el-form-item>
  7 + <el-button type="success" @click="applyAdd()">新 增</el-button>
  8 + </el-form-item>
  9 + </el-form>
  10 + </el-col>
  11 + <!--列表-->
  12 + <el-table :data="tableData" highlight-current-row style="width: 100%;"
  13 + row-key="ruleId">
  14 + <el-table-column width="120" prop="hostid" label="服务器IP" >
  15 + </el-table-column>
  16 + <el-table-column width="120" prop="port" label="端口" >
  17 + </el-table-column>
  18 + <el-table-column width="120" prop="user" label="账号" >
  19 + </el-table-column>
  20 + <el-table-column width="120" prop="pass" label="密码" >
  21 + </el-table-column>
  22 + <el-table-column width="240" label="操作" fixed="right">
  23 + <template slot-scope="scope">
  24 + <el-button type="danger" @click="batchRemove(scope.$index,scope.row)">删除</el-button>
  25 + </template>
  26 + </el-table-column>
  27 + </el-table>
  28 + <!-- 分页-->
  29 + <div class="block">
  30 + <el-pagination
  31 + :current-page="filters.pageNum"
  32 + :page-sizes="[10, 50, 100, 500]"
  33 + :page-size="filters.pageSize"
  34 + layout="total, sizes, prev, pager, next, jumper"
  35 + :total="total"
  36 + @size-change="handleSizeChange"
  37 + @current-change="handleCurrentChange"
  38 + />
  39 + </div>
  40 + <el-row>
  41 + <el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog" width="50%">
  42 + <el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 20px">
  43 + <el-row>
  44 + <el-col :span="11">
  45 + <el-form-item label="服务器IP" :label-width="formLabelWidth" prop="hostid">
  46 + <el-input v-model="addForm.hostid" autocomplete="off" size="small" style="width: 260px">
  47 + </el-input>
  48 + </el-form-item>
  49 + </el-col>
  50 + </el-row>
  51 + <el-row>
  52 + <el-col :span="12">
  53 + <el-form-item label="端口" :label-width="formLabelWidth" prop="port">
  54 + <el-input v-model="addForm.port" autocomplete="off" size="small" style="width: 260px">
  55 + </el-input>
  56 + </el-form-item>
  57 + </el-col>
  58 + </el-row>
  59 + <el-row>
  60 + <el-col :span="11">
  61 + <el-form-item label="账号" :label-width="formLabelWidth" prop="user">
  62 + <el-input v-model="addForm.user" autocomplete="off" size="small" style="width: 260px">
  63 + </el-input>
  64 + </el-form-item>
  65 + </el-col>
  66 + </el-row>
  67 + <el-row>
  68 + <el-col :span="12">
  69 + <el-form-item label="密码" :label-width="formLabelWidth" prop="pass">
  70 + <el-input v-model="addForm.pass" autocomplete="off" size="small" style="width: 260px">
  71 + </el-input>
  72 + </el-form-item>
  73 + </el-col>
  74 + </el-row>
  75 + </el-form>
  76 + <div slot="footer" class="dialog-footer">
  77 + <el-button @click="apply_dialog = false" size="small">取 消</el-button>
  78 + <el-button type="primary" @click="dialogApply==='create'?add():edit()" size="small">提 交</el-button>
  79 + </div>
  80 + </el-dialog>
  81 + </el-row>
  82 +
  83 + </section>
  84 +</template>
  85 +<script>
  86 + import {listRabbitConfigs,insertRabbitConfig,deleteRabbitConfig} from '../../api/configuration';
  87 + export default {
  88 + data() {
  89 + return {
  90 + filters: {
  91 + pageNum: 1,
  92 + pageSize: 10
  93 + },
  94 + total: 0,
  95 + tableData: [],
  96 + dialogMap: {
  97 + update: '编辑',
  98 + create: '新增'
  99 + },
  100 + dis: undefined,
  101 + dialogApply: 'create',
  102 + apply_dialog: false,
  103 + addForm: {
  104 + hostid:'',
  105 + port: '',
  106 + user: '',
  107 + pass: '',
  108 + id:''
  109 + },
  110 + formLabelWidth: '200px',
  111 + rules: {
  112 + },
  113 +
  114 + }
  115 + },
  116 + mounted() {
  117 + this.getList();
  118 + },
  119 + methods: {
  120 + //分页
  121 + handleSizeChange(val) {
  122 + this.filters.pageSize = val
  123 + this.getList()
  124 + },
  125 + handleCurrentChange(val) {
  126 + this.filters.pageNum = val
  127 + this.getList()
  128 + },
  129 + //获取列表
  130 + getList() {
  131 + const _this = this
  132 + listRabbitConfigs().then((response) => {
  133 + const res = response.data
  134 + if (res.code !== '200') {
  135 + return _this.$message.error('获取消息收发记录,失败!')
  136 + }
  137 + // 获取列表数据
  138 + _this.tableData = res.data
  139 + // 获取列表的总记录数
  140 + _this.total = res.data.total
  141 + _this.$message.success('获取消息收发记录,成功!')
  142 + }).catch(error => {
  143 + // 关闭加载
  144 + _this.$message.error(error.toString())
  145 + })
  146 + },
  147 + // 添加对话框,打开事件
  148 + applyAdd() {
  149 + this.addForm = {
  150 + hostid:'',
  151 + port: '',
  152 + user: '',
  153 + pass: '',
  154 + id:''
  155 + };
  156 + this.dialogApply= 'create';
  157 + this.dis= 'create';
  158 + this.apply_dialog = true;
  159 + },
  160 + // 添加功能
  161 + add() {
  162 + this.$refs.addForm.validate(valid => {
  163 + // 未通过,表单预校验
  164 + if (!valid) return;
  165 + insertRabbitConfig(this.addForm).then((response) => {
  166 + let res = response.data;
  167 + // 添加失败
  168 + if (res.code !== '200') {
  169 + return this.$message.error(res.msg);
  170 + }
  171 + // 添加,成功
  172 + this.$message.success(res.msg);
  173 + // 隐藏对话框
  174 + this.apply_dialog = false;
  175 + // 刷新列表
  176 + this.getList();
  177 + }).catch(error => {
  178 + this.$message.error(error.toString());
  179 + });
  180 + })
  181 + },
  182 + //删除
  183 + batchRemove(index,row) {
  184 + // 弹框询问是否删除?
  185 + this.$confirm('此操作永久删除该消息, 是否继续?', '警告', {
  186 + confirmButtonText: '确定删除',
  187 + cancelButtonText: '取消',
  188 + type: 'warning'
  189 + }
  190 + ).then(() => {
  191 + deleteRabbitConfig({id:row.id}).then((response) => {
  192 + const res = response.data
  193 + this.$message.success(res.msg)
  194 + this.getList()
  195 + }).catch(error => {
  196 + this.$message.error(error)
  197 + })
  198 + }).catch(() => {
  199 + })
  200 + },
  201 + },
  202 +
  203 +
  204 + }
  205 +</script>
  1 +<template>
  2 + <section>
  3 + <!--工具条-->
  4 + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5 + <el-form :inline="true" :model="filters">
  6 + <el-form-item>
  7 + <el-button type="success" @click="applyAdd()">新 增</el-button>
  8 + </el-form-item>
  9 + </el-form>
  10 + </el-col>
  11 + <!--列表-->
  12 + <el-table :data="tableData" highlight-current-row style="width: 100%;"
  13 + row-key="ruleId">
  14 + <el-table-column width="80" prop="hostid" label="服务器ID" >
  15 + </el-table-column>
  16 + <el-table-column width="120" prop="loaddir" label="报文落地目录" >
  17 + </el-table-column>
  18 + <el-table-column width="120" prop="readqueue" label="报文读取队列" >
  19 + </el-table-column>
  20 + <el-table-column width="80" prop="status" label="状态" >
  21 + </el-table-column>
  22 + <el-table-column width="80" prop="vr" label="虚拟机" >
  23 + </el-table-column>
  24 + <el-table-column width="240" label="操作" fixed="right">
  25 + <template slot-scope="scope">
  26 + <el-button type="success" @click="firing(scope.row)">启动</el-button>
  27 + <el-button type="warning" @click="suspend(scope.$index,scope.row)">暂停</el-button>
  28 + <el-button type="danger" @click="batchRemove(scope.$index,scope.row)">删除</el-button>
  29 + </template>
  30 + </el-table-column>
  31 + </el-table>
  32 + <!-- 分页-->
  33 + <div class="block">
  34 + <el-pagination
  35 + :current-page="filters.pageNum"
  36 + :page-sizes="[10, 50, 100, 500]"
  37 + :page-size="filters.pageSize"
  38 + layout="total, sizes, prev, pager, next, jumper"
  39 + :total="total"
  40 + @size-change="handleSizeChange"
  41 + @current-change="handleCurrentChange"
  42 + />
  43 + </div>
  44 + <el-row>
  45 + <el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog" width="50%">
  46 + <el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 20px">
  47 + <el-row>
  48 + <el-col :span="11">
  49 + <el-form-item label="服务器ID" :label-width="formLabelWidth" prop="hostid">
  50 +<!-- <el-input v-model="addForm.hostid" autocomplete="off" size="small" style="width: 260px">-->
  51 +<!-- </el-input>-->
  52 + <el-select v-model="addForm.hostid" clearable placeholder="请选择"
  53 + style="width: 260px">
  54 + <el-option
  55 + v-for="item in hostid"
  56 + :key="item.id"
  57 + :label="item.hostid"
  58 + :value="item.hostid">
  59 + </el-option>
  60 + </el-select>
  61 + </el-form-item>
  62 + </el-col>
  63 + </el-row>
  64 + <el-row>
  65 + <el-col :span="12">
  66 + <el-form-item label="虚拟机" :label-width="formLabelWidth" prop="vr">
  67 + <el-input v-model="addForm.vr" autocomplete="off" size="small" style="width: 260px">
  68 + </el-input>
  69 + </el-form-item>
  70 + </el-col>
  71 + </el-row>
  72 + <el-row>
  73 + <el-col :span="11">
  74 + <el-form-item label="报文落地目录" :label-width="formLabelWidth" prop="loaddir">
  75 + <el-input v-model="addForm.loaddir" autocomplete="off" size="small" style="width: 260px">
  76 + </el-input>
  77 + </el-form-item>
  78 + </el-col>
  79 + </el-row>
  80 + <el-row>
  81 + <el-col :span="12">
  82 + <el-form-item label="报文读取队列" :label-width="formLabelWidth" prop="readqueue">
  83 + <el-input v-model="addForm.readqueue" autocomplete="off" size="small" style="width: 260px">
  84 + </el-input>
  85 + </el-form-item>
  86 + </el-col>
  87 + </el-row>
  88 + <el-row>
  89 + <el-col :span="11">
  90 + <el-form-item label="状态" :label-width="formLabelWidth" prop="status">
  91 + <el-input v-model="addForm.status" autocomplete="off" size="small" style="width: 260px">
  92 + </el-input>
  93 + </el-form-item>
  94 + </el-col>
  95 + </el-row>
  96 + </el-form>
  97 + <div slot="footer" class="dialog-footer">
  98 + <el-button @click="apply_dialog = false" size="small">取 消</el-button>
  99 + <el-button type="primary" @click="dialogApply==='create'?add():edit()" size="small">提 交</el-button>
  100 + </div>
  101 + </el-dialog>
  102 + </el-row>
  103 + <el-dialog :visible.sync="tableData1_dialog" >
  104 + <!--列表-->
  105 + <el-table disabled :data="tableData1" highlight-current-row style="width: 100%;"
  106 + row-key="ruleId">
  107 + <el-table-column width="120" prop="hostid" label="服务器IP" >
  108 + </el-table-column>
  109 + <el-table-column width="120" prop="port" label="端口" >
  110 + </el-table-column>
  111 + <el-table-column width="120" prop="user" label="账号" >
  112 + </el-table-column>
  113 + <el-table-column width="120" prop="pass" label="密码" >
  114 + </el-table-column>
  115 + </el-table>
  116 + </el-dialog>
  117 + </section>
  118 +</template>
  119 +<script>
  120 + import {
  121 + listReceConfigs,
  122 + insertReceConfig,
  123 + deleteReceConfig,
  124 + addrecetask,
  125 + removereceTask,
  126 + listRabbitConfigs
  127 + } from '../../api/configuration';
  128 + export default {
  129 + data() {
  130 + return {
  131 + filters: {
  132 + pageNum: 1,
  133 + pageSize: 10
  134 + },
  135 + total: 0,
  136 + tableData: [],
  137 + tableData1: [],
  138 + tableData1_dialog:false,
  139 + dialogMap: {
  140 + update: '编辑',
  141 + create: '新增'
  142 + },
  143 + dis: undefined,
  144 + dialogApply: 'create',
  145 + apply_dialog: false,
  146 + hostid:[],
  147 + addForm: {
  148 + hostid:'',
  149 + loaddir: '',
  150 + readqueue: '',
  151 + vr: '',
  152 + status: '',
  153 + id:''
  154 + },
  155 + formLabelWidth: '200px',
  156 + rules: {
  157 + },
  158 +
  159 + }
  160 + },
  161 + mounted() {
  162 + this.getList();
  163 + },
  164 + methods: {
  165 + //分页
  166 + handleSizeChange(val) {
  167 + this.filters.pageSize = val
  168 + this.getList()
  169 + },
  170 + handleCurrentChange(val) {
  171 + this.filters.pageNum = val
  172 + this.getList()
  173 + },
  174 + //获取列表
  175 + getList() {
  176 + const _this = this
  177 + listReceConfigs().then((response) => {
  178 + const res = response.data
  179 + if (res.code !== '200') {
  180 + return _this.$message.error('获取消息收发记录,失败!')
  181 + }
  182 + // 获取列表数据
  183 + _this.tableData = res.data
  184 + // 获取列表的总记录数
  185 + _this.total = res.data.total
  186 + _this.$message.success('获取消息收发记录,成功!')
  187 + }).catch(error => {
  188 + // 关闭加载
  189 + _this.$message.error(error.toString())
  190 + })
  191 + },
  192 + // 添加对话框,打开事件
  193 + applyAdd() {
  194 + this.hostid=[];
  195 + const _this = this
  196 + listRabbitConfigs().then((response) => {
  197 + const res = response.data
  198 + if (res.code !== '200') {
  199 + return _this.$message.error('获取消息收发记录,失败!')
  200 + }
  201 + // 获取列表数据
  202 + _this.tableData1 = res.data
  203 + _this.hostid=_this.tableData1;
  204 + _this.$message.success('获取消息收发记录,成功!')
  205 + }).catch(error => {
  206 + // 关闭加载
  207 + _this.$message.error(error.toString())
  208 + })
  209 + this.addForm = {
  210 + hostid:'',
  211 + loaddir: '',
  212 + readqueue: '',
  213 + vr: '',
  214 + status: '',
  215 + id:''
  216 + };
  217 + this.dialogApply= 'create';
  218 + this.dis= 'create';
  219 + this.apply_dialog = true;
  220 + },
  221 + // 添加功能
  222 + add() {
  223 + this.$refs.addForm.validate(valid => {
  224 + // 未通过,表单预校验
  225 + if (!valid) return;
  226 + insertReceConfig(this.addForm).then((response) => {
  227 + let res = response.data;
  228 + // 添加失败
  229 + if (res.code !== '200') {
  230 + return this.$message.error(res.msg);
  231 + }
  232 + // 添加,成功
  233 + this.$message.success(res.msg);
  234 + // 隐藏对话框
  235 + this.apply_dialog = false;
  236 + // 刷新列表
  237 + this.getList();
  238 + }).catch(error => {
  239 + this.$message.error(error.toString());
  240 + });
  241 + })
  242 + },
  243 + // 启动功能
  244 + firing() {
  245 + // 弹框询问是否删除?
  246 + this.$confirm(' 是否继续?', '警告', {
  247 + confirmButtonText: '确定启动',
  248 + cancelButtonText: '取消',
  249 + type: 'warning'
  250 + }
  251 + ).then(() => {
  252 + addrecetask({row:this.row}).then((response) => {
  253 + const res = response.data
  254 + this.$message.success(res.msg)
  255 + this.getList()
  256 + }).catch(error => {
  257 + this.$message.error(error)
  258 + })
  259 + }).catch(() => {
  260 + })
  261 +
  262 + },
  263 + //暂停
  264 + suspend(index,row) {
  265 + // 弹框询问是否删除?
  266 + this.$confirm(' 是否继续?', '警告', {
  267 + confirmButtonText: '确定暂停',
  268 + cancelButtonText: '取消',
  269 + type: 'warning'
  270 + }
  271 + ).then(() => {
  272 + removereceTask({id:row.id}).then((response) => {
  273 + const res = response.data
  274 + this.$message.success(res.msg)
  275 + this.getList()
  276 + }).catch(error => {
  277 + this.$message.error(error)
  278 + })
  279 + }).catch(() => {
  280 + })
  281 + },
  282 + //删除
  283 + batchRemove(index,row) {
  284 + // 弹框询问是否删除?
  285 + this.$confirm('此操作永久删除该消息, 是否继续?', '警告', {
  286 + confirmButtonText: '确定删除',
  287 + cancelButtonText: '取消',
  288 + type: 'warning'
  289 + }
  290 + ).then(() => {
  291 + deleteReceConfig({id:row.id}).then((response) => {
  292 + const res = response.data
  293 + this.$message.success(res.msg)
  294 + this.getList()
  295 + }).catch(error => {
  296 + this.$message.error(error)
  297 + })
  298 + }).catch(() => {
  299 + })
  300 + },
  301 + },
  302 +
  303 +
  304 + }
  305 +</script>
  306 +
  1 +<template>
  2 + <section>
  3 + <!--工具条-->
  4 + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5 + <el-form :inline="true" :model="filters">
  6 + <el-form-item>
  7 + <el-button type="success" @click="applyAdd()">新 增</el-button>
  8 + </el-form-item>
  9 + </el-form>
  10 + </el-col>
  11 + <!--列表-->
  12 + <el-table :data="tableData" highlight-current-row style="width: 100%;"
  13 + row-key="ruleId">
  14 + <el-table-column width="80" prop="hostid" label="服务器ID" >
  15 + </el-table-column>
  16 + <el-table-column width="240" prop="localdir" label="本地发送目录" >
  17 + </el-table-column>
  18 + <el-table-column width="120" prop="destvr" label="目的地虚拟机" >
  19 + </el-table-column>
  20 + <el-table-column width="120" prop="routerkey" label="路由" >
  21 + </el-table-column>
  22 + <el-table-column width="120" prop="queue" label="队列">
  23 + </el-table-column>
  24 + <el-table-column width="120" prop="destchange" label="目的地交换">
  25 + </el-table-column>
  26 + <el-table-column width="120" prop="broadtype" label="广播类型" >
  27 + </el-table-column>
  28 + <el-table-column width="240" label="操作" fixed="right">
  29 + <template slot-scope="scope">
  30 + <el-button type="success" @click="firing(scope.row)">启动</el-button>
  31 + <el-button type="warning" @click="suspend(scope.$index,scope.row)">暂停</el-button>
  32 + <el-button type="danger" @click="batchRemove(scope.$index,scope.row)">删除</el-button>
  33 + </template>
  34 + </el-table-column>
  35 + </el-table>
  36 + <!-- 分页-->
  37 + <div class="block">
  38 + <el-pagination
  39 + :current-page="filters.pageNum"
  40 + :page-sizes="[10, 50, 100, 500]"
  41 + :page-size="filters.pageSize"
  42 + layout="total, sizes, prev, pager, next, jumper"
  43 + :total="total"
  44 + @size-change="handleSizeChange"
  45 + @current-change="handleCurrentChange"
  46 + />
  47 + </div>
  48 + <el-row>
  49 + <el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog" width="50%">
  50 + <el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 20px">
  51 + <el-row>
  52 + <el-col :span="11">
  53 + <el-form-item label="服务器ID" :label-width="formLabelWidth" prop="hostid">
  54 +<!-- <el-input v-model="addForm.hostid" autocomplete="off" size="small" style="width: 260px">-->
  55 +<!-- </el-input>-->
  56 + <el-select v-model="addForm.hostid" clearable placeholder="请选择"
  57 + style="width: 260px">
  58 + <el-option
  59 + v-for="item in hostid"
  60 + :key="item.id"
  61 + :label="item.hostid"
  62 + :value="item.hostid">
  63 + </el-option>
  64 + </el-select>
  65 + </el-form-item>
  66 + </el-col>
  67 + </el-row>
  68 + <el-row>
  69 + <el-col :span="12">
  70 + <el-form-item label="本地发送目录" :label-width="formLabelWidth" prop="localdir">
  71 + <el-input v-model="addForm.localdir" autocomplete="off" size="small" style="width: 260px">
  72 + </el-input>
  73 + </el-form-item>
  74 + </el-col>
  75 + </el-row>
  76 + <el-row>
  77 + <el-col :span="11">
  78 + <el-form-item label="目的地虚拟机" :label-width="formLabelWidth" prop="destvr">
  79 + <el-input v-model="addForm.destvr" autocomplete="off" size="small" style="width: 260px">
  80 + </el-input>
  81 + </el-form-item>
  82 + </el-col>
  83 + </el-row>
  84 + <el-row>
  85 + <el-col :span="12">
  86 + <el-form-item label="路由" :label-width="formLabelWidth" prop="routerkey">
  87 + <el-input v-model="addForm.routerkey" autocomplete="off" size="small" style="width: 260px">
  88 + </el-input>
  89 + </el-form-item>
  90 + </el-col>
  91 + </el-row>
  92 + <el-row>
  93 + <el-col :span="11">
  94 + <el-form-item label="队列" :label-width="formLabelWidth" prop="queue">
  95 + <el-input v-model="addForm.queue" autocomplete="off" size="small" style="width: 260px">
  96 + </el-input>
  97 + </el-form-item>
  98 + </el-col>
  99 + </el-row>
  100 + <el-row>
  101 + <el-col :span="11">
  102 + <el-form-item label="目的地交换" :label-width="formLabelWidth" prop="destchange">
  103 + <el-input v-model="addForm.destchange" autocomplete="off" size="small" style="width: 260px">
  104 + </el-input>
  105 + </el-form-item>
  106 + </el-col>
  107 + </el-row>
  108 + <el-row>
  109 + <el-col :span="11">
  110 + <el-form-item label="广播类型" :label-width="formLabelWidth" prop="broadtype">
  111 + <el-input v-model="addForm.broadtype" autocomplete="off" size="small" style="width: 260px">
  112 + </el-input>
  113 + </el-form-item>
  114 + </el-col>
  115 + </el-row>
  116 + </el-form>
  117 + <div slot="footer" class="dialog-footer">
  118 + <el-button @click="apply_dialog = false" size="small">取 消</el-button>
  119 + <el-button type="primary" @click="dialogApply==='create'?add():edit()" size="small">提 交</el-button>
  120 + </div>
  121 + </el-dialog>
  122 + </el-row>
  123 + <el-dialog :visible.sync="tableData1_dialog" >
  124 + <!--列表-->
  125 + <el-table disabled :data="tableData1" highlight-current-row style="width: 100%;"
  126 + row-key="ruleId">
  127 + <el-table-column width="120" prop="hostid" label="服务器IP" >
  128 + </el-table-column>
  129 + <el-table-column width="120" prop="port" label="端口" >
  130 + </el-table-column>
  131 + <el-table-column width="120" prop="user" label="账号" >
  132 + </el-table-column>
  133 + <el-table-column width="120" prop="pass" label="密码" >
  134 + </el-table-column>
  135 + </el-table>
  136 + </el-dialog>
  137 + </section>
  138 +</template>
  139 +<script>
  140 + import {
  141 + listSendConfigs,
  142 + insertSendConfig,
  143 + deleteSendConfig,
  144 + addsendtask,
  145 + removesendTask,
  146 + listRabbitConfigs
  147 + } from '../../api/configuration';
  148 + export default {
  149 + data() {
  150 + return {
  151 + filters: {
  152 + pageNum: 1,
  153 + pageSize: 10
  154 + },
  155 + total: 0,
  156 + tableData: [],
  157 + hostid:[],
  158 + tableData1: [],
  159 + tableData1_dialog:false,
  160 + dialogMap: {
  161 + update: '编辑',
  162 + create: '新增'
  163 + },
  164 + dis: undefined,
  165 + dialogApply: 'create',
  166 + apply_dialog: false,
  167 + addForm: {
  168 + hostid:'',
  169 + localdir: '',
  170 + destvr: '',
  171 + routerkey: '',
  172 + queue: '',
  173 + destchange:'',
  174 + broadtype:'',
  175 + id:'',
  176 + del: '',
  177 + durability: '',
  178 + internal: 'false',
  179 + status:'',
  180 + },
  181 + formLabelWidth: '200px',
  182 + rules: {
  183 + },
  184 +
  185 + }
  186 + },
  187 + mounted() {
  188 + this.getList();
  189 + },
  190 + methods: {
  191 + //分页
  192 + handleSizeChange(val) {
  193 + this.filters.pageSize = val
  194 + this.getList()
  195 + },
  196 + handleCurrentChange(val) {
  197 + this.filters.pageNum = val
  198 + this.getList()
  199 + },
  200 + //获取列表
  201 + getList() {
  202 + const _this = this
  203 + listSendConfigs().then((response) => {
  204 + const res = response.data
  205 + if (res.code !== '200') {
  206 + return _this.$message.error('获取消息收发记录,失败!')
  207 + }
  208 + // 获取列表数据
  209 + _this.tableData = res.data
  210 + // 获取列表的总记录数
  211 + _this.total = res.data.total
  212 + _this.$message.success('获取消息收发记录,成功!')
  213 + }).catch(error => {
  214 + // 关闭加载
  215 + _this.$message.error(error.toString())
  216 + })
  217 + },
  218 + // 添加对话框,打开事件
  219 + applyAdd() {
  220 + this.hostid=[];
  221 + const _this = this
  222 + listRabbitConfigs().then((response) => {
  223 + const res = response.data
  224 + if (res.code !== '200') {
  225 + return _this.$message.error('获取消息收发记录,失败!')
  226 + }
  227 + // 获取列表数据
  228 + _this.tableData1 = res.data
  229 + _this.hostid=_this.tableData1;
  230 + _this.$message.success('获取消息收发记录,成功!')
  231 + }).catch(error => {
  232 + // 关闭加载
  233 + _this.$message.error(error.toString())
  234 + })
  235 + this.addForm = {
  236 + hostid:'',
  237 + localdir: '',
  238 + destvr: '',
  239 + routerkey: '',
  240 + queue: '',
  241 + destchange:'',
  242 + broadtype:'',
  243 + id:'',
  244 + del: '',
  245 + durability: '',
  246 + internal: 'false',
  247 + status:'',
  248 + };
  249 + this.dialogApply= 'create';
  250 + this.dis= 'create';
  251 + this.apply_dialog = true;
  252 + },
  253 + // 添加功能
  254 + add() {
  255 + this.$refs.addForm.validate(valid => {
  256 + // 未通过,表单预校验
  257 + if (!valid) return;
  258 + insertSendConfig(this.addForm).then((response) => {
  259 + let res = response.data;
  260 + // 添加失败
  261 + if (res.code !== '200') {
  262 + return this.$message.error(res.msg);
  263 + }
  264 + // 添加,成功
  265 + this.$message.success(res.msg);
  266 + // 隐藏对话框
  267 + this.apply_dialog = false;
  268 + // 刷新列表
  269 + this.getList();
  270 + }).catch(error => {
  271 + this.$message.error(error.toString());
  272 + });
  273 + })
  274 + },
  275 + // 启动功能
  276 + firing() {
  277 + // 弹框询问是否删除?
  278 + this.$confirm(' 是否继续?', '警告', {
  279 + confirmButtonText: '确定启动',
  280 + cancelButtonText: '取消',
  281 + type: 'warning'
  282 + }
  283 + ).then(() => {
  284 + addsendtask({row:this.row}).then((response) => {
  285 + const res = response.data
  286 + this.$message.success(res.msg)
  287 + this.getList()
  288 + }).catch(error => {
  289 + this.$message.error(error)
  290 + })
  291 + }).catch(() => {
  292 + })
  293 +
  294 + },
  295 + //暂停
  296 + suspend(index,row) {
  297 + // 弹框询问是否删除?
  298 + this.$confirm(' 是否继续?', '警告', {
  299 + confirmButtonText: '确定暂停',
  300 + cancelButtonText: '取消',
  301 + type: 'warning'
  302 + }
  303 + ).then(() => {
  304 + removesendTask({id:row.id}).then((response) => {
  305 + const res = response.data
  306 + this.$message.success(res.msg)
  307 + this.getList()
  308 + }).catch(error => {
  309 + this.$message.error(error)
  310 + })
  311 + }).catch(() => {
  312 + })
  313 + },
  314 + //删除
  315 + batchRemove(index,row) {
  316 + // 弹框询问是否删除?
  317 + this.$confirm('此操作永久删除该消息, 是否继续?', '警告', {
  318 + confirmButtonText: '确定删除',
  319 + cancelButtonText: '取消',
  320 + type: 'warning'
  321 + }
  322 + ).then(() => {
  323 + deleteSendConfig({id:row.id}).then((response) => {
  324 + const res = response.data
  325 + this.$message.success(res.msg)
  326 + this.getList()
  327 + }).catch(error => {
  328 + this.$message.error(error)
  329 + })
  330 + }).catch(() => {
  331 + })
  332 + },
  333 + },
  334 +
  335 +
  336 + }
  337 +</script>