审查视图

src/views/bus/MessageNoteSearch.vue 11.7 KB
1 2 3 4 5 6
<template>
    <el-container>
        <el-main>
            <el-card style="background-color: #F5F7FA">
                <div>
                    <el-row style="margin-left: 30px;">
7
                        <el-col :span="7">
8
                            <el-input v-model="messageNote_queryInfo.alias_sendContent" placeholder="发送内容"
9 10 11
                                      size="medium" clearable >
                                <template  slot="prepend" ><i class="el-icon-document-checked"></i>发送内容</template>
                            </el-input>
12
                        </el-col>
13
                        <el-col :span="8">
朱兆平 authored
14
                            <el-button type="warning" style="width:150px" size="medium" icon="el-icon-search" @click="searchSubmit">
15 16 17 18 19
                                查询
                            </el-button>
                        </el-col>
                    </el-row>
                </div>
20 21 22 23 24 25 26 27 28 29 30
                <div class="ft" :index="item.msgid+''" v-for="item in messageNote_page.messageNoteList" :key="item.msgid" style="margin-left: 30px;margin-top: 30px">
                    <el-row style="min-height: 200px">
                        <el-row>
                            <el-col :span="7">
                                <span>消息id:</span>
                                <el-tag>{{item.msgid}}</el-tag>
                            </el-col>
                            <el-col :span="8">
                                <span>发送时间:</span>
                                <el-tag>{{item.ddtm}}</el-tag>
                            </el-col>
31
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <span>发送人:</span>
                                <el-tag>{{item.sndr}}</el-tag>
                            </el-col>
                            <el-col :span="3">
                                <span>消息大类:</span>
                                <el-tag type="success">{{item.btype}}</el-tag>
                            </el-col>
                            <el-col :span="3">
                                <span>消息子类:</span>
                                <el-tag type="success">{{item.stype}}</el-tag>
                            </el-col>
                            <el-col :span="4">
                                <div>
                                    <span>路由接收者:</span>
                                </div>
                                <template  v-for="reciver  in item.rcvrs">
                                    <el-tag  type="danger">{{reciver.username}}</el-tag>
                                </template>
                            </el-col>
                            <el-col :span="4">
                                <div>
                                    <span >消息接收者:</span>
                                </div>
                                <template  v-for="logitem  in item.rcvlog">
                                    <el-tag  type="warning">{{logitem.username}} [{{logitem.rvtm}}]</el-tag>
                                </template>
                            </el-col>
                        </el-row>
63
                    </el-row>
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
                    <div class="sun">
                        <el-row>
                            <el-col :span="2">
                                <el-button type="primary" @click="messageNote_toViewContentDialogDialog(item)" size="small">查看内容
                                </el-button>
                            </el-col>
                            <el-col style="width: 45%;margin-left: -10px" :span="14">
                                <el-input v-model="item.msg" readonly type="textarea" :rows="3"></el-input>
                            </el-col>
                        </el-row>
                        <el-row>

                        </el-row>
                    </div>

80 81 82 83 84 85 86 87 88 89 90
                    <el-divider></el-divider>
                </div>

                <!--分页区域-->
                <div style="margin-top: 10px;margin-left: 20px;">
                    <el-row :gutter="24">
                        <el-col :span="10" style="margin-top: 5px">
                            <el-pagination
                                    @size-change="messageNote_handleSizeChange"
                                    @current-change="messageNote_handleCurrentChange"
                                    :current-page="messageNote_queryInfo.pageNum"
91
                                    :page-sizes="[10,50,200,500]"
92
                                    :page-size="messageNote_queryInfo.pageSize"
朱兆平 authored
93
                                    layout="total, sizes, prev, pager, next, jumper"
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
                                    :total="messageNote_page.total">
                            </el-pagination>
                        </el-col>
                    </el-row>
                </div>
            </el-card>
            <!-- 查看发送内容,对话框区域 -->
            <div>
                <el-dialog title="查看消息内容"
                           :visible.sync="messageNote_dialog.viewContentDialog"
                           style="margin-top: -80px" text-align="center" width="70%"
                           @close="messageNote_viewContentDialogClosed">
                    <el-form :inline="true" label-width="120px" status-icon style="margin-top: -10px" align="center"
                             :model="messageNote_viewContentForm" ref="messageNote_viewContentFormRef">
                        <el-form-item label="消息内容:" prop="alias_sendContent">
朱兆平 authored
109
                            <el-input v-model="messageNote_viewContentForm.msg" v-if="isViewContent === false"
110 111 112 113 114 115 116 117 118
                                      style="width:1000px" type="textarea" :rows="8">
                            </el-input>
                            <el-input v-model="xml_content" v-if="isViewContent === true"
                                      style="width:1000px" type="textarea" autosize>
                            </el-input>
                        </el-form-item>
                    </el-form>
                    <div slot="footer" class="dialog-footer" style="text-align: center;margin-top: -20px">
朱兆平 authored
119
                        <el-button type="success" @click="xml_format(messageNote_viewContentForm.msg)" size="medium"
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
                                   style="width: 100px">xml格式化
                        </el-button>

                        <el-button type="info" @click="messageNote_dialog.viewContentDialog = false" size="medium"
                                   style="width: 100px">取消
                        </el-button>
                        <el-button type="primary" @click="messageNote_dialog.viewContentDialog = false" size="medium"
                                   style="width: 100px">关闭
                        </el-button>
                    </div>
                </el-dialog>
            </div>
        </el-main>
    </el-container>
</template>

<script>
    import {selectMessageNoteList} from "../../api/message_bus";
    import vkbeautify from "vkbeautify";

    export default {
        name: "MessageNoteSearch",
        data() {
            return {
                // 抽屉
                drawer: false,
                messageNote_queryInfo: {
                    // 消息内容,别名
                    alias_sendContent: '',
                    // 当前页数
                    pageNum: 1,
                    // 每页条数
152
                    pageSize: 10
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
                },
                /**
                 * messageNote,分页
                 */
                messageNote_page: {
                    // 路由键列表
                    messageNoteList: [],
                    // 总条数
                    total: 0,
                },
                /**
                 * messageNote,加载
                 */
                messageNote_loading: {
                    // 列表加载
                    listLoading: false,
                },
                /**
                 * 发送内容,是否格式化
                 */
                isViewContent: false,
                /**
                 * 发送内容,格式化之后
                 */
                xml_content: '',
                /**
                 *  messageNote,对话框管理
                 */
                messageNote_dialog: {
                    // 查看发送内容对话框
                    viewContentDialog: false,
                },
                /**
                 * 发送内容,表单
                 */
                messageNote_viewContentForm: {},
            }
        },
        methods: {
            /**
             * 分页查询,监听 pageSize 改变的事件
             */
            messageNote_handleSizeChange(newSize) {
                this.messageNote_queryInfo.pageSize = newSize;
                //刷新列表
                this.messageNote_getList();
            },
            /**
             * 分页查询,监听 pageNum 改变的事件
             */
            messageNote_handleCurrentChange(newPage) {
                this.messageNote_queryInfo.pageNum = newPage;
                //刷新列表
                this.messageNote_getList();
            },
朱兆平 authored
208 209
            searchSubmit:function () {
                this.messageNote_queryInfo.pageNum = 1;
210
                this.messageNote_queryInfo.pageSize = 10;
朱兆平 authored
211 212 213
                this.messageNote_getList();

            } ,
214 215 216 217
            /**
             * messageNote,分页查询
             */
            messageNote_getList() {
朱兆平 authored
218
                let _this = this;
219 220 221 222 223 224
                // 开启加载
                this.messageNote_loading.listLoading = true;
                selectMessageNoteList(this.messageNote_queryInfo).then((response) => {
                    let res = response.data;
                    if (res.code !== '200') {
                        // 关闭加载
朱兆平 authored
225
                        _this.messageNote_loading.listLoading = false;
226
                        return _this.$message.error('获取消息收发记录,失败!');
227 228
                    }
                    // 获取列表数据
朱兆平 authored
229
                    _this.messageNote_page.messageNoteList = res.data.content;
230
                    // 获取列表的总记录数
朱兆平 authored
231
                    _this.messageNote_page.total = res.data.totalElements;
232
                    // 关闭加载
朱兆平 authored
233 234
                    _this.messageNote_loading.listLoading = false;
                    _this.$message.success('获取消息收发记录,成功!');
235 236
                }).catch(error => {
                    // 关闭加载
朱兆平 authored
237 238
                    _this.messageNote_loading.listLoading = false;
                    _this.$message.error(error.toString());
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
                });
            },
            /**
             * 将消息内容,格式化xml
             * @param content
             */
            xml_format(content) {
                this.isViewContent = true;
                this.xml_content = vkbeautify.xml(content);
            },
            /**
             * messageNote,查看发送内容,打开事件
             */
            messageNote_toViewContentDialogDialog(item) {
                this.messageNote_viewContentForm = Object.assign({}, item);
                this.messageNote_dialog.viewContentDialog = true;
            },
            /**
             * messageNote,查看发送内容对话框,关闭事件
             */
            messageNote_viewContentDialogClosed() {
                this.isViewContent = false;
                // 重置对话框
                this.$refs.messageNote_viewContentFormRef.resetFields();
            },
        }
    }

</script>

<style scoped>
270 271 272 273 274 275 276 277
    .ft{
        position: relative;
    }
    .sun{
        position: absolute;
        top:100px;
        width: 100%;
    }
278
</style>