审查视图

src/views/bus/MessageNoteSearch.vue 11.9 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
                <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>
25
                                <el-tag>{{item.admin.msgid}}</el-tag>
26 27 28
                            </el-col>
                            <el-col :span="8">
                                <span>发送时间:</span>
29
                                <el-tag>{{item.msg.header.ddtm}}</el-tag>
30
                            </el-col>
31
32 33 34 35
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <span>发送人:</span>
36
                                <el-tag>{{item.msg.header.sndr}}</el-tag>
37 38 39
                            </el-col>
                            <el-col :span="3">
                                <span>消息大类:</span>
40
                                <el-tag type="success">{{item.msg.header.type}}</el-tag>
41 42 43
                            </el-col>
                            <el-col :span="3">
                                <span>消息子类:</span>
44
                                <el-tag type="success">{{item.msg.header.stype}}</el-tag>
45 46 47 48 49
                            </el-col>
                            <el-col :span="4">
                                <div>
                                    <span>路由接收者:</span>
                                </div>
50 51
                                <template  v-for="reciver  in item.admin.rcvrs">
                                    <el-tag  type="danger">{{reciver.user}}</el-tag>
52 53 54 55 56 57
                                </template>
                            </el-col>
                            <el-col :span="4">
                                <div>
                                    <span >消息接收者:</span>
                                </div>
58 59
                                <template  v-for="logitem  in item.admin.rcvlog">
                                    <el-tag  type="warning">{{logitem.user}} [{{logitem.rvtm}}]</el-tag>
60 61 62
                                </template>
                            </el-col>
                        </el-row>
63
                    </el-row>
64 65 66 67 68 69 70
                    <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">
71
                                <el-input v-model="item.msg.body" readonly type="textarea" :rows="3"></el-input>
72 73 74 75 76 77 78 79
                            </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">
109
                            <el-input v-model="messageNote_viewContentForm.msg.body" 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">
119
                        <el-button type="success" @click="xml_format(messageNote_viewContentForm.msg.body)" 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
                },
                /**
                 * messageNote,分页
                 */
                messageNote_page: {
                    // 路由键列表
                    messageNoteList: [],
                    // 总条数
                    total: 0,
                },
                /**
                 * messageNote,加载
                 */
                messageNote_loading: {
                    // 列表加载
                    listLoading: false,
                },
                /**
                 * 发送内容,是否格式化
                 */
                isViewContent: false,
                /**
                 * 发送内容,格式化之后
                 */
                xml_content: '',
                /**
                 *  messageNote,对话框管理
                 */
                messageNote_dialog: {
                    // 查看发送内容对话框
                    viewContentDialog: false,
                },
                /**
                 * 发送内容,表单
                 */
188 189 190 191 192 193
                messageNote_viewContentForm: {
                    msg:{
                        body:""
                    },
                    admin:{}
                },
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
            }
        },
        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
213 214
            searchSubmit:function () {
                this.messageNote_queryInfo.pageNum = 1;
215
                this.messageNote_queryInfo.pageSize = 10;
朱兆平 authored
216 217 218
                this.messageNote_getList();

            } ,
219 220 221 222
            /**
             * messageNote,分页查询
             */
            messageNote_getList() {
朱兆平 authored
223
                let _this = this;
224 225 226 227 228 229
                // 开启加载
                this.messageNote_loading.listLoading = true;
                selectMessageNoteList(this.messageNote_queryInfo).then((response) => {
                    let res = response.data;
                    if (res.code !== '200') {
                        // 关闭加载
朱兆平 authored
230
                        _this.messageNote_loading.listLoading = false;
231
                        return _this.$message.error('获取消息收发记录,失败!');
232 233
                    }
                    // 获取列表数据
朱兆平 authored
234
                    _this.messageNote_page.messageNoteList = res.data.content;
235
                    // 获取列表的总记录数
朱兆平 authored
236
                    _this.messageNote_page.total = res.data.totalElements;
237
                    // 关闭加载
朱兆平 authored
238 239
                    _this.messageNote_loading.listLoading = false;
                    _this.$message.success('获取消息收发记录,成功!');
240 241
                }).catch(error => {
                    // 关闭加载
朱兆平 authored
242 243
                    _this.messageNote_loading.listLoading = false;
                    _this.$message.error(error.toString());
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 270 271 272 273 274
                });
            },
            /**
             * 将消息内容,格式化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>
275 276 277 278 279 280 281 282
    .ft{
        position: relative;
    }
    .sun{
        position: absolute;
        top:100px;
        width: 100%;
    }
283
</style>