Przeglądaj źródła

fix:更改消息文件通知内容

liujiayin 3 lat temu
rodzic
commit
22f725bfbd

+ 187 - 145
src/views/platform/message/inner/detail/dialog.vue

@@ -1,174 +1,216 @@
 <template>
-    <el-dialog :title="title" :visible.sync="dialogVisible" :close-on-click-modal="false" :close-on-press-escape="false"
-        :class="[inside ? 'inside-dialog' : 'inner-dialog']" append-to-body top="10vh" width="65%" @open="getFormData"
-        @close="closeDialog">
-        <inner-message :id="id" ref="innerMessage" :inside="inside" :readonly="readonly" @callback="handleCallback"
-            :type="type" />
-        <div slot="footer" class="el-dialog--center">
-            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
-        </div>
-    </el-dialog>
+  <el-dialog :title="title"
+             :visible.sync="dialogVisible"
+             :close-on-click-modal="false"
+             :close-on-press-escape="false"
+             :class="[inside ? 'inside-dialog' : 'inner-dialog']"
+             append-to-body
+             top="10vh"
+             width="65%"
+             @open="getFormData"
+             @close="closeDialog">
+    <inner-message :id="id"
+                   ref="innerMessage"
+                   :inside="inside"
+                   :readonly="readonly"
+                   @callback="handleCallback"
+                   :type="type" />
+    <div slot="footer"
+         class="el-dialog--center">
+      <ibps-toolbar :actions="toolbars"
+                    @action-event="handleActionEvent" />
+    </div>
+  </el-dialog>
 </template>
 <script>
 import InnerMessage from './index'
 import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
 import getDate from "@/business/platform/form/utils/custom/getDateRule.js";
 import {
-    generateUUID
+  generateUUID
 } from '@/api/platform/file/attachment'
 export default {
-    components: { InnerMessage },
-    props: {
-        inside: {
-            type: Boolean,
-            default: false
-        },
-        visible: {
-            type: Boolean,
-            default: false
-        },
-        readonly: {
-            type: Boolean,
-            default: false
-        },
-        type: {
-            type: String,
-            default: ''
-        },
-        tableId: {
-            type: String,
-            default: ''
-        },
-        id: String,
-        // 子表ID
-        subId: String,
-        title: String
+  components: { InnerMessage },
+  props: {
+    inside: {
+      type: Boolean,
+      default: false
     },
-    data() {
-        return {
-            dialogVisible: this.visible,
-            dialogLoading: false,
-            toolbars: [{ key: 'cancel', label: '关闭' }]
-        }
+    visible: {
+      type: Boolean,
+      default: false
     },
-    watch: {
-        visible: {
-            handler: function (val, oldVal) {
-                this.dialogVisible = this.visible
-            },
-            immediate: true
-        },
-        type: {
-            handler: function (val, oldVal) {
-                const btn1 = [
-                    { key: 'confirm', label: '确认' },
-                    { key: 'cancel', label: '关闭' }
-                ]
-                const btn2 = [
-                    { key: 'cancel', label: '关闭' }
-                ]
-                this.toolbars = val ? btn1 : btn2
-            }
+    readonly: {
+      type: Boolean,
+      default: false
+    },
+    // type: {
+    //   type: String,
+    //   default: ''
+    // },
+    tableId: {
+      type: String,
+      default: ''
+    },
+    tableName: {
+      type: String,
+      default: ''
+    },
+
+    id: String,
+    // 子表ID
+    subId: String,
+    title: String
+  },
+  data() {
+    return {
+      dialogVisible: this.visible,
+      dialogLoading: false,
+      toolbars: [{ key: 'cancel', label: '关闭' }],
+      type: ''
+    }
+  },
+  watch: {
+    visible: {
+      handler: function (val, oldVal) {
+        this.dialogVisible = this.visible
+      },
+      immediate: true
+    },
+    tableId: {
+      handler: function (val, oldVal) {
+        const btn1 = [
+          { key: 'confirm', label: '确认' },
+          { key: 'cancel', label: '关闭' }
+        ]
+        const btn2 = [
+          { key: 'cancel', label: '关闭' }
+        ]
+        if (val) {
+          this.toolbars = btn1
+          this.type = '1'
+        } else {
+          this.toolbars = btn2
         }
+      }
+    }
+  },
+  methods: {
+    handleActionEvent({ key }) {
+      switch (key) {
+        case 'cancel':
+          this.closeDialog()
+          break
+        case 'confirm':
+          this.confirmMsg()
+          break
+        default:
+          break
+      }
+    },
+    // 关闭当前窗口
+    closeDialog() {
+      this.$emit('close', false)
     },
-    methods: {
-        handleActionEvent({ key }) {
-            switch (key) {
-                case 'cancel':
-                    this.closeDialog()
-                    break
-                case 'confirm':
-                    this.confirmMsg()
-                    break
-                default:
-                    break
+    // 获取表单数据
+    getFormData() {
+      this.$nextTick(() => {
+        this.$refs.innerMessage.getFormData()
+        this.handleCallback(true)
+      })
+    },
+    // 消息确认,受控文件用
+    confirmMsg() {
+      // TODO
+      this.$confirm('点击确认将在系统信息管理模块查看到所通知文件的具体信息', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+        showClose: false,
+        closeOnClickModal: false
+      }).then(() => {
+        // TODO 受控文件逻辑处理
+        const perInfosId = this.$store.getters.userInfo.user.id
+        const perInfosorgId = this.$store.getters.userInfo.org.id
+        let sql = "select qian_zi_tu_wen_ FROM t_ryjbqk WHERE parent_id_ = '" + perInfosId + "'"
+        curdPost("sql", sql).then((ryjbqkRes) => {
+          let ryjbqkDatas = ryjbqkRes.variables.data
+          let tempObj = {
+            id_: generateUUID(),
+            parent_id_: this.tableId,
+            tong_zhi_bu_men_i: perInfosorgId,
+            que_ren_qian_ming: JSON.stringify([{
+              id: ryjbqkDatas[0].qian_zi_tu_wen_,
+              fileName: '确认签名'
+            }]),
+            que_ren_ri_qi_: getDate(),
+            qian_ming_id_: ryjbqkDatas[0].qian_zi_tu_wen_
+          }
+          let returnParams = {
+            tableName: this.tableName,
+            paramWhere: [tempObj]
+          }
+          // 获取所发放的文件
+          let files = this.$refs.innerMessage.form.fileMsg
+          let addwjcysqbs = []
+          for (let i of files.split(",")) {
+            let addwjcysqb = {
+              yong_hu_id_: this.$store.getters.userInfo.user.id,
+              wen_jian_id_: i,
+              shou_quan_: '1'
             }
-        },
-        // 关闭当前窗口
-        closeDialog() {
-            this.$emit('close', false)
-        },
-        // 获取表单数据
-        getFormData() {
-            this.$nextTick(() => {
-                this.$refs.innerMessage.getFormData()
-                this.handleCallback(true)
-            })
-        },
-        // 消息确认,受控文件用
-        confirmMsg() {
-            // TODO
-            this.$confirm('是否已查阅受控文件?一经确认即代表该文件已发放并通知您', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-                showClose: false,
-                closeOnClickModal: false
-            }).then(() => {
-                // TODO 受控文件逻辑处理
-                const perInfosId = this.$store.getters.userInfo.user.id
-                const perInfosorgId = this.$store.getters.userInfo.org.id
-                let sql = "select qian_zi_tu_wen_ FROM t_ryjbqk WHERE parent_id_ = '" + perInfosId + "'"
-                curdPost("sql", sql).then((ryjbqkRes) => {
-                    let ryjbqkDatas = ryjbqkRes.variables.data
-                    let tempObj = {
-                        id_: generateUUID(),
-                        parent_id_: this.tableId,
-                        tong_zhi_bu_men_i: perInfosorgId,
-                        que_ren_qian_ming: JSON.stringify([{
-                            id: ryjbqkDatas[0].qian_zi_tu_wen_,
-                            fileName: '确认签名'
-                        }]),
-                        que_ren_ri_qi_: getDate(),
-                        qian_ming_id_: ryjbqkDatas[0].qian_zi_tu_wen_
-                    }
-                    let returnParams = {
-                        tableName: this.type,
-                        paramWhere: [tempObj]
-                    }
-                    curdPost('add', JSON.stringify(returnParams)).then(() => { console.log('确认接收到发放文件') }).then(
-                        () => {
-                            this.type = ''
-                            this.getFormData()
-                        }
-                    )
-                });
-                this.closeDialog()
-            }).catch(() => { })
-        },
-        handleCallback(res) {
-            this.$emit('callback', res)
-        }
+            addwjcysqbs.push(addwjcysqb)
+          }
+          curdPost('add', JSON.stringify(returnParams)).then(() => { console.log('确认接收到发放文件') }).then(
+            () => {
+              this.type = ''
+              this.getFormData()
+            }
+          )
 
+          curdPost('add',
+            '{"tableName": "t_wjcysqb","paramWhere":' + JSON.stringify(addwjcysqbs) + '}'
+          ).then(response => {
+            console.log(response)
+          }).catch(error => {
+          })
+        });
+        this.closeDialog()
+      }).catch(() => { })
+    },
+    handleCallback(res) {
+      this.$emit('callback', res)
     }
+
+  }
 }
 </script>
 <style lang="scss">
 .inner-dialog {
-    .el-dialog__body {
-        padding: 20px 20px;
-        height: calc(40vh) !important;
-    }
+  .el-dialog__body {
+    padding: 20px 20px;
+    height: calc(40vh) !important;
+  }
 
-    .list {
-        .el-form-item__content {
-            margin-left: 0px !important;
+  .list {
+    .el-form-item__content {
+      margin-left: 0px !important;
 
-            .el-table--border {
-                height: 300px !important;
-            }
-        }
+      .el-table--border {
+        height: 300px !important;
+      }
     }
+  }
 
-    .ibps-container-crud__header {
-        display: none;
-    }
+  .ibps-container-crud__header {
+    display: none;
+  }
 }
 
 .inside-dialog {
-    .el-dialog__body {
-        padding: 20px 20px;
-        height: calc(50vh - 110px) !important;
-    }
+  .el-dialog__body {
+    padding: 20px 20px;
+    height: calc(50vh - 110px) !important;
+  }
 }
 </style>

+ 21 - 12
src/views/platform/message/inner/detail/index.vue

@@ -1,6 +1,10 @@
 <template>
-  <el-form ref="form" v-loading="loading" :element-loading-text="$t('common.loading')" :label-width="formLabelWidth"
-    class="inner-detail" @submit.native.prevent>
+  <el-form ref="form"
+           v-loading="loading"
+           :element-loading-text="$t('common.loading')"
+           :label-width="formLabelWidth"
+           class="inner-detail"
+           @submit.native.prevent>
     <el-row>
       <el-col :span="12">
         <el-form-item label="主题:">
@@ -26,7 +30,8 @@
         </el-form-item>
       </el-col>
       <el-col :span="12">
-        <el-form-item label="是否公告:" :hidden="type">
+        <el-form-item label="是否公告:"
+                      :hidden="type">
           <div class="text-border">
             <el-tag :type="form.isPublic | optionsFilter(publicOrCanreplyOptions, 'type')">{{
               form.isPublic | optionsFilter(publicOrCanreplyOptions, 'label') }}</el-tag>
@@ -34,7 +39,8 @@
         </el-form-item>
       </el-col>
       <el-col :span="12">
-        <el-form-item label="是否可回复:" :hidden="type">
+        <el-form-item label="是否可回复:"
+                      :hidden="type">
           <div class="text-border">
             <el-tag :type="form.canreply | optionsFilter(publicOrCanreplyOptions, 'type')">{{
               form.canreply | optionsFilter(publicOrCanreplyOptions, 'label') }}</el-tag>
@@ -42,13 +48,17 @@
         </el-form-item>
       </el-col>
       <el-col :span="24">
-        <el-form-item label="消息内容:" >
-          <span class="original-content" v-html="$utils.formatText(form.content)" />
+        <el-form-item label="消息内容:">
+          <span class="original-content"
+                v-html="$utils.formatText(form.content)" />
         </el-form-item>
       </el-col>
       <el-col :span="24">
         <el-form-item label="附件:">
-          <ibps-attachment-selector v-model="form.fileMsg" :download="!readonly" :readonly="readonly" multiple />
+          <ibps-attachment-selector v-model="form.fileMsg"
+                                    :download="!readonly"
+                                    :readonly="readonly"
+                                    multiple />
         </el-form-item>
       </el-col>
       <!-- <el-col v-if="!inside" :span="24">
@@ -95,7 +105,8 @@ export default {
     },
     id: String,
     title: String,
-    type: String
+    type: String,
+    getform: () => { }
   },
   data() {
     return {
@@ -155,10 +166,8 @@ export default {
 
 .text-border {
   color: #000000;
-  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 1px 0px 0 rgba(0, 0, 0, 0.1);
+  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.1),
+    0 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 0px 0 rgba(0, 0, 0, 0.1);
   padding-left: 5px;
   min-height: 38px;
   font-size: 16px;

+ 289 - 275
src/views/platform/message/inner/receive.vue

@@ -1,292 +1,306 @@
 <template>
-    <div class="receive-container">
-        <ibps-crud
-            ref="crud"
-            :height="height"
-            :data="listData"
-            :toolbars="listConfig.toolbars"
-            :search-form="listConfig.searchForm"
-            :pk-key="pkKey"
-            :columns="listConfig.columns"
-            :row-handle="listConfig.rowHandle"
-            :pagination="pagination"
-            :loading="loading"
-            :index-row="false"
-            displayField="消息中心"
-            @action-event="handleAction"
-            @sort-change="handleSortChange"
-            @column-link-click="handleLinkClick"
-            @pagination-change="handlePaginationChange"
-        >
-            <template slot="handIcon" slot-scope="scope">
-                <el-tooltip v-if="!scope.row.receiverTime" class="item" effect="dark" content="未读" placement="bottom">
-                    <i class="ibps-icon-envelope-o" />
-                </el-tooltip>
-                <el-tooltip v-else class="item" effect="dark" content="已读" placement="bottom">
-                    <i class="ibps-icon-envelope-open-o" />
-                </el-tooltip>
-                <el-tooltip v-if="scope.row.fileMsg" class="item" effect="dark" content="含附件" placement="bottom">
-                    <i class="ibps-icon-paperclip" />
-                </el-tooltip>
-            </template>
-        </ibps-crud>
-        <!-- 明细 -->
-        <detail
-            :id="editId"
+  <div class="receive-container">
+    <ibps-crud ref="crud"
+               :height="height"
+               :data="listData"
+               :toolbars="listConfig.toolbars"
+               :search-form="listConfig.searchForm"
+               :pk-key="pkKey"
+               :columns="listConfig.columns"
+               :row-handle="listConfig.rowHandle"
+               :pagination="pagination"
+               :loading="loading"
+               :index-row="false"
+               displayField="消息中心"
+               @action-event="handleAction"
+               @sort-change="handleSortChange"
+               @column-link-click="handleLinkClick"
+               @pagination-change="handlePaginationChange">
+      <template slot="handIcon"
+                slot-scope="scope">
+        <el-tooltip v-if="!scope.row.receiverTime"
+                    class="item"
+                    effect="dark"
+                    content="未读"
+                    placement="bottom">
+          <i class="ibps-icon-envelope-o" />
+        </el-tooltip>
+        <el-tooltip v-else
+                    class="item"
+                    effect="dark"
+                    content="已读"
+                    placement="bottom">
+          <i class="ibps-icon-envelope-open-o" />
+        </el-tooltip>
+        <el-tooltip v-if="scope.row.fileMsg"
+                    class="item"
+                    effect="dark"
+                    content="含附件"
+                    placement="bottom">
+          <i class="ibps-icon-paperclip" />
+        </el-tooltip>
+      </template>
+    </ibps-crud>
+    <!-- 明细 -->
+    <detail :id="editId"
             :title="title"
             :readonly="readonly"
             :visible="dialogFormVisible"
+            :tableId="tableId"
+            :tableName="tableName"
             @callback="search"
-            @close="visible => closeDetail(visible)"
-        />
-        <!-- 回复 -->
-        <reply
-            :id="editId"
-            :title="title"
-            :visible="repliFormVisible"
-            @callback="search"
-            @close="visible => (repliFormVisible = visible)"
-        />
-    </div>
+            @close="visible => closeDetail(visible)" />
+    <!-- 回复 -->
+    <reply :id="editId"
+           :title="title"
+           :visible="repliFormVisible"
+           @callback="search"
+           @close="visible => (repliFormVisible = visible)" />
+  </div>
 </template>
 
 <script>
-    import { queryReceivePageList, getMyMsgList, remove, markRead } from '@/api/platform/message/innerMessage'
-    import ActionUtils from '@/utils/action'
-    import FixHeight from '@/mixins/height'
-    import { typeOptions, renderHeader } from './constants'
-    import Detail from './detail/dialog'
-    import Reply from './reply'
-    import Bus from "@/utils/EventBus";
+import { queryReceivePageList, getMyMsgList, remove, markRead } from '@/api/platform/message/innerMessage'
+import ActionUtils from '@/utils/action'
+import FixHeight from '@/mixins/height'
+import { typeOptions, renderHeader } from './constants'
+import Detail from './detail/dialog'
+import Reply from './reply'
+import Bus from "@/utils/EventBus";
 
-    export default {
-        components: {
-            Detail,
-            Reply
-        },
-        mixins: [FixHeight],
-        data() {
-            return {
-                dialogFormVisible: false, // 弹窗
-                repliFormVisible: false, // 弹窗
-                editId: '', // 编辑dialog需要使用
-                pkKey: 'id', // 主键  如果主键不是pk需要传主键
-                title: '',
-                loading: true,
-                isEnvelope: true,
-                link: false,
-                readonly: false,
-                height: document.clientHeight,
-                listData: [],
-                pagination: {},
-                sorts: {},
-                listConfig: {
-                    toolbars: [
-                        {
-                            key: 'search'
-                        },
-                        {
-                            key: 'remove'
-                        },
-                        {
-                            key: 'markRead',
-                            icon: 'ibps-icon-check-circle',
-                            label: '标记为已读'
-                        }
-                    ],
-                    searchForm: {
-                        forms: [
-                            { prop: 'Q^subject^SL', label: '主题' },
-                            { prop: 'Q^ownerName^SL', label: '发送人' },
-                            {
-                                prop: 'Q^messageType^SL',
-                                label: '消息类型',
-                                fieldType: 'select',
-                                options: typeOptions
-                            },
-                            {
-                                prop: ['Q^beginreceiveTime^DL', 'Q^endreceiveTime^DG'],
-                                label: '发送时间',
-                                fieldType: 'daterange'
-                            }
-                        ]
-                    },
-                    // 表格字段配置
-                    columns: [
-                        {
-                            prop: 'stateIcon',
-                            label: '',
-                            slotName: 'handIcon',
-                            width: '65',
-                            renderHeader: renderHeader
-                        },
-                        {
-                            prop: 'subject',
-                            sortBy: 'SUBJECT_',
-                            label: '主题',
-                            link: 'dialog',
-                            sortable: 'custom',
-                            width: '250'
-                        },
-                        { prop: 'ownerName', label: '发送人', width: '150' },
-                        { prop: 'messageType', label: '消息类型', tags: typeOptions, width: '250' },
-                        { prop: 'content', label: '消息描述' },
-
-                        { prop: 'createTime', label: '发送时间', dateFormat: 'yyyy-MM-dd HH:mm:ss', width: '250' }
-                    ],
-                    rowHandle: {
-                        actions: [
-                            {
-                                key: 'reply',
-                                icon: 'ibps-icon-reply-all',
-                                label: '回复',
-                                hidden: function (row, index) {
-                                    return (row.canreply === 0 || row.messageType === 'system' || row.messageType === 'bulletin')
-                                }
-                            },
-                            {
-                                key: 'remove'
-                            },
-                            {
-                                key: 'detail'
-                            }
-                        ]
-                    }
-                }
+export default {
+  components: {
+    Detail,
+    Reply
+  },
+  mixins: [FixHeight],
+  data() {
+    return {
+      dialogFormVisible: false, // 弹窗
+      repliFormVisible: false, // 弹窗
+      editId: '', // 编辑dialog需要使用
+      pkKey: 'id', // 主键  如果主键不是pk需要传主键
+      title: '',
+      loading: true,
+      isEnvelope: true,
+      link: false,
+      readonly: false,
+      height: document.clientHeight,
+      listData: [],
+      pagination: {},
+      sorts: {},
+      tableId: '',
+      tableName: '',
+      listConfig: {
+        toolbars: [
+          {
+            key: 'search'
+          },
+          {
+            key: 'remove'
+          },
+          {
+            key: 'markRead',
+            icon: 'ibps-icon-check-circle',
+            label: '标记为已读'
+          }
+        ],
+        searchForm: {
+          forms: [
+            { prop: 'Q^subject^SL', label: '主题' },
+            { prop: 'Q^ownerName^SL', label: '发送人' },
+            {
+              prop: 'Q^messageType^SL',
+              label: '消息类型',
+              fieldType: 'select',
+              options: typeOptions
+            },
+            {
+              prop: ['Q^beginreceiveTime^DL', 'Q^endreceiveTime^DG'],
+              label: '发送时间',
+              fieldType: 'daterange'
             }
+          ]
         },
-        created() {
-            this.loadData()
-        },
-        methods: {
-            // 加载数据
-            loadData() {
-                this.loading = true
-                // queryReceivePageList({
-                //     parameters:[
-                //         {key: "Q^subject^SL", value: "提醒"},
-                //         {key: "Q^messageType^SL", value: "system"}
-                //     ],
-                //     requestPage:{limit: 10,pageNo: 1,totalCount: 0},
-                //     sorts: []
-                // }).then(response => {
-                getMyMsgList(this.getSearcFormData()).then(response => {
-                    const data = response.data
-                    const { pageResult = {} } = data
-                    ActionUtils.handleListData(this, data)
-                    Bus.$emit('getMessageCount', pageResult.totalCount ? pageResult.totalCount : 0)
-                    this.loading = false
-                }).catch(err => {
-                    this.loading = false
-                })
-            },
-            /**
-             * 获取格式化参数
-             */
-            getSearcFormData() {
-                return ActionUtils.formatParams(
-                    this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
-                    this.pagination,
-                    this.sorts
-                )
-            },
-            /**
-             * 处理分页事件
-             */
-            handlePaginationChange(page) {
-                ActionUtils.setPagination(this.pagination, page)
-                this.loadData()
-            },
-            /**
-             * 处理排序
-             */
-            handleSortChange(sort) {
-                ActionUtils.setSorts(this.sorts, sort)
-                this.loadData()
-            },
-            /**
-             * 查询
-             */
-            search() {
-                this.loadData()
-            },
-            handleLinkClick(data, columns) {
-                this.handleEdit(data.id, true)
-                this.title = '信息明细'
-            },
-            /**
-             * 处理按钮事件
-             */
-            handleAction(command, position, selection, data) {
-                switch (command) {
-                    case 'search': // 查询
-                        ActionUtils.setFirstPagination(this.pagination)
-                        this.search()
-                        break
-                    case 'markRead': // 标记为已读
-                        ActionUtils.selectedMultiRecord(selection).then(id => {
-                            this.handleAlreadyRead(id)
-                            // this.isEnvelope = false
-                        }).catch(() => {})
-                        break
-                    case 'reply': // 回复
-                        ActionUtils.selectedRecord(selection).then(id => {
-                            this.handleReply(id)
-                            this.title = '信息回复'
-                        }).catch(() => {})
-                        break
-                    case 'detail': // 明细
-                        ActionUtils.selectedRecord(selection).then(id => {
-                            this.handleEdit(id, true)
-                            this.title = '信息明细'
-                        }).catch(() => {})
-                        break
-                    case 'remove': // 删除
-                        ActionUtils.removeRecord(selection).then(ids => {
-                            this.handleRemove(ids)
-                        }).catch(() => {})
-                        break
-                    default:
-                        break
-                }
-            },
-            /**
-             * 标记为已读
-             */
-            handleAlreadyRead(ids) {
-                markRead({ innerMessageIds: ids }).then(response => {
-                    ActionUtils.success('标记已读成功')
-                    this.search()
-                }).catch(() => {})
-            },
-            /**
-             * 处理回复
-             */
-            handleReply(id = '') {
-                this.editId = id
-                this.repliFormVisible = true
-            },
-            /**
-             * 处理明细
-             */
-            handleEdit(id = '', readonly) {
-                this.editId = id
-                this.readonly = readonly
-                this.dialogFormVisible = true
+        // 表格字段配置
+        columns: [
+          {
+            prop: 'stateIcon',
+            label: '',
+            slotName: 'handIcon',
+            width: '65',
+            renderHeader: renderHeader
+          },
+          {
+            prop: 'subject',
+            sortBy: 'SUBJECT_',
+            label: '主题',
+            link: 'dialog',
+            sortable: 'custom',
+            width: '250'
+          },
+          { prop: 'ownerName', label: '发送人', width: '150' },
+          { prop: 'messageType', label: '消息类型', tags: typeOptions, width: '250' },
+          { prop: 'content', label: '消息描述' },
+
+          { prop: 'createTime', label: '发送时间', dateFormat: 'yyyy-MM-dd HH:mm:ss', width: '250' }
+        ],
+        rowHandle: {
+          actions: [
+            {
+              key: 'reply',
+              icon: 'ibps-icon-reply-all',
+              label: '回复',
+              hidden: function (row, index) {
+                return (row.canreply === 0 || row.messageType === 'system' || row.messageType === 'bulletin')
+              }
             },
-            /**
-             * 处理删除
-             */
-            handleRemove(ids) {
-                remove({ innerMessageIds: ids }).then(response => {
-                    ActionUtils.removeSuccessMessage()
-                    this.search()
-                }).catch(() => {})
+            {
+              key: 'remove'
             },
-            closeDetail(visible) {
-                this.dialogFormVisible = visible
-                this.search()
+            {
+              key: 'detail'
             }
+          ]
         }
+      }
+    }
+  },
+  created() {
+    this.loadData()
+  },
+  methods: {
+    // 加载数据
+    loadData() {
+      this.loading = true
+      // queryReceivePageList({
+      //     parameters:[
+      //         {key: "Q^subject^SL", value: "提醒"},
+      //         {key: "Q^messageType^SL", value: "system"}
+      //     ],
+      //     requestPage:{limit: 10,pageNo: 1,totalCount: 0},
+      //     sorts: []
+      // }).then(response => {
+      getMyMsgList(this.getSearcFormData()).then(response => {
+        const data = response.data
+        const { pageResult = {} } = data
+        ActionUtils.handleListData(this, data)
+        Bus.$emit('getMessageCount', pageResult.totalCount ? pageResult.totalCount : 0)
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
+      })
+    },
+    /**
+     * 获取格式化参数
+     */
+    getSearcFormData() {
+      return ActionUtils.formatParams(
+        this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+        this.pagination,
+        this.sorts
+      )
+    },
+    /**
+     * 处理分页事件
+     */
+    handlePaginationChange(page) {
+      ActionUtils.setPagination(this.pagination, page)
+      this.loadData()
+    },
+    /**
+     * 处理排序
+     */
+    handleSortChange(sort) {
+      ActionUtils.setSorts(this.sorts, sort)
+      this.loadData()
+    },
+    /**
+     * 查询
+     */
+    search() {
+      this.loadData()
+    },
+    handleLinkClick(data, columns) {
+      console.log('data', data)
+      this.handleEdit(data.id, true)
+      this.tableId = data.tableId
+      this.tableName = data.tableName
+      this.title = '信息明细'
+    },
+    /**
+     * 处理按钮事件
+     */
+    handleAction(command, position, selection, data) {
+      switch (command) {
+        case 'search': // 查询
+          ActionUtils.setFirstPagination(this.pagination)
+          this.search()
+          break
+        case 'markRead': // 标记为已读
+          ActionUtils.selectedMultiRecord(selection).then(id => {
+            this.handleAlreadyRead(id)
+            // this.isEnvelope = false
+          }).catch(() => { })
+          break
+        case 'reply': // 回复
+          ActionUtils.selectedRecord(selection).then(id => {
+            this.handleReply(id)
+            this.title = '信息回复'
+          }).catch(() => { })
+          break
+        case 'detail': // 明细
+          ActionUtils.selectedRecord(selection).then(id => {
+            this.handleEdit(id, true)
+            this.title = '信息明细'
+          }).catch(() => { })
+          break
+        case 'remove': // 删除
+          ActionUtils.removeRecord(selection).then(ids => {
+            this.handleRemove(ids)
+          }).catch(() => { })
+          break
+        default:
+          break
+      }
+    },
+    /**
+     * 标记为已读
+     */
+    handleAlreadyRead(ids) {
+      markRead({ innerMessageIds: ids }).then(response => {
+        ActionUtils.success('标记已读成功')
+        this.search()
+      }).catch(() => { })
+    },
+    /**
+     * 处理回复
+     */
+    handleReply(id = '') {
+      this.editId = id
+      this.repliFormVisible = true
+    },
+    /**
+     * 处理明细
+     */
+    handleEdit(id = '', readonly) {
+      this.editId = id
+      this.readonly = readonly
+      this.dialogFormVisible = true
+    },
+    /**
+     * 处理删除
+     */
+    handleRemove(ids) {
+      remove({ innerMessageIds: ids }).then(response => {
+        ActionUtils.removeSuccessMessage()
+        this.search()
+      }).catch(() => { })
+    },
+    closeDetail(visible) {
+      this.dialogFormVisible = visible
+      this.search()
     }
+  }
+}
 </script>