caiaa1 hace 1 año
padre
commit
5175a418fe

+ 314 - 16
mock/message.js

@@ -5,22 +5,320 @@ module.exports = [
     type: 'get',
     response: config => {
       return {
-        code: 200,
-        msg: 'success',
-        data: {
-          total: 43,
-          records: [
-            { 'id': '0', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '1', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '2', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '3', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '4', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '5', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '6', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '7', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '8', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' },
-            { 'id': '9', 'title': 'test1', 'appName': 'System1', 'type': 'type1', 'status': 'todo', 'createDate': '2023-07-15 01:02:03', 'createUser': 'zhangsan' }
-          ]
+        'code': 200,
+        'msg': null,
+        'data': {
+          'records': [
+            {
+              'id': 19,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title1',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 19,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 18,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title2',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 18,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 17,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title3',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 17,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 16,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title4',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 16,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 13,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title5',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 13,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 12,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title6',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 12,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 11,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title7',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 11,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 6,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title8',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 6,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 5,
+              'messageType': 3,
+              'messageLevel': null,
+              'title': 'title9',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 5,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 4,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title10',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': 'sint inname',
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 4,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 3,
+              'messageType': 2,
+              'messageLevel': null,
+              'title': 'title11',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': null,
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 3,
+              'recordType': null,
+              'clientId': null
+            },
+            {
+              'id': 2,
+              'messageType': 1,
+              'messageLevel': null,
+              'title': 'title12',
+              'content': 'nisi aliquip dolor ut nostrud',
+              'attachmentPath': 'sint in',
+              'attachmentName': null,
+              'createBy': null,
+              'createUser': null,
+              'createOrgName': 'testbg1',
+              'createOrgCode': null,
+              'updateBy': null,
+              'updateUser': null,
+              'createTime': null,
+              'updateTime': null,
+              'delFlag': null,
+              'version': null,
+              'memberId': '120222197001010002',
+              'scopeType': 2,
+              'scopeId': '120000450200',
+              'targetId': 2,
+              'recordType': null,
+              'clientId': null
+            }
+          ],
+          'total': 12,
+          'size': 20,
+          'current': 1,
+          'orders': [],
+          'optimizeCountSql': true,
+          'searchCount': true,
+          'countId': null,
+          'maxLimit': null,
+          'pages': 1
         }
       }
     }

+ 1 - 1
src/views/application/index.vue

@@ -178,7 +178,7 @@ export default {
       this.getTablelist()
     },
     // 重置搜索项
-    resetTable(formName) {
+    resetForm(formName) {
       this.$refs[formName].resetFields()
       this.getTablelist()
     },

+ 1 - 1
src/views/business/index.vue

@@ -121,7 +121,7 @@ export default {
       this.getTablelist()
     },
     // 重置搜索项
-    resetTable(formName) {
+    resetForm(formName) {
       this.$refs[formName].resetFields()
       this.getTablelist()
     },

+ 1 - 1
src/views/home/components/BusinessEdit.vue

@@ -144,7 +144,7 @@ export default {
       this.getAllBizList()
     },
     // 重置搜索项
-    resetTable(formName) {
+    resetForm(formName) {
       this.$refs[formName].resetFields()
       this.getAllBizList()
     },

+ 2 - 2
src/views/home/components/MessageList.vue

@@ -27,7 +27,7 @@
           </el-form-item>
           <el-form-item>
             <el-button type="primary" @click="searchTable">查询</el-button>
-            <!-- <el-button type="danger" @click="resetTable('filterForm')">重置</el-button> -->
+            <!-- <el-button type="danger" @click="resetForm('filterForm')">重置</el-button> -->
           </el-form-item>
         </el-form>
       </div>
@@ -129,7 +129,7 @@ export default {
       this.getTablelist()
     },
     // 重置搜索项
-    resetTable(formName) {
+    resetForm(formName) {
       this.$refs[formName].resetFields()
       this.getTablelist()
     },

+ 1 - 1
src/views/home/components/SystemEdit.vue

@@ -141,7 +141,7 @@ export default {
       this.getAllListData()
     },
     // 重置搜索项
-    resetTable(formName) {
+    resetForm(formName) {
       this.$refs[formName].resetFields()
       this.getAllListData()
     },

+ 91 - 78
src/views/info/index.vue

@@ -1,52 +1,60 @@
 <template>
   <div class="info-container">
     <div class="list-filter">
-      <el-form ref="filterForm" :model="formData" inline label-width="100px">
-        <el-form-item label="信息标题">
-          <el-input v-model="formData.title" class="filter-item" clearable />
-        </el-form-item>
-        <el-form-item label="信息内容">
-          <el-input v-model="formData.content" class="filter-item" clearable />
-        </el-form-item>
-        <el-form-item label="信息类型">
-          <el-select v-model="formData.messageType" clearable placeholder="请选择">
-            <el-option v-for="(item) in typeData" :key="item.id" :label="item.label" :value="item.id" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="发布单位">
-          <el-select v-model="formData.createOrgCode" clearable filterable placeholder="请选择">
-            <el-option v-for="(item) in deptData" :key="item.orgCode" :label="item.shortName" :value="item.orgCode" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="发布日期">
-          <el-col :span="11">
-            <el-date-picker v-model="formData.createTime" type="date" placeholder="开始日期" style="width: 100%;" />
-          </el-col>
-          <el-col class="line" :span="2">-</el-col>
-          <el-col :span="11">
-            <el-date-picker v-model="formData.createTime" type="date" placeholder="截止日期" style="width: 100%;" />
-          </el-col>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="searchTable">查询</el-button>
-          <el-button type="danger" @click="resetTable('filterForm')">重置</el-button>
-        </el-form-item>
+      <el-form :ref="formName" :model="formData" inline label-width="100px">
+        <el-row>
+          <el-form-item prop="title" label="title">
+            <el-input v-model="formData.title" class="filter-item" clearable />
+          </el-form-item>
+          <el-form-item prop="content" label="content">
+            <el-input v-model="formData.content" class="filter-item" clearable />
+          </el-form-item>
+          <el-form-item prop="messageType" label="messageType">
+            <el-select v-model="formData.messageType" clearable placeholder="">
+              <el-option v-for="(item) in typeData" :key="item.id" :label="item.label" :value="item.id" />
+            </el-select>
+          </el-form-item>
+        </el-row>
+        <el-row>
+          <el-form-item prop="deptCode" label="deptCode">
+            <el-select v-model="formData.deptCode" clearable filterable placeholder="">
+              <el-option v-for="(item) in deptData" :key="item.orgCode" :label="item.shortName" :value="item.orgCode" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="publishDate" label="publishDate">
+            <el-date-picker
+              v-model="formData.publishDate"
+              type="daterange"
+              value-format="yyyyMMdd"
+              range-separator="to"
+              start-placeholder="Please select"
+              end-placeholder="Please select"
+              unlink-panels
+              clearable
+            />
+          </el-form-item>
+          <el-form-item>
+            <div class="filter-btn">
+              <el-button type="primary" @click="searchTable">search</el-button>
+              <el-button type="danger" @click="resetForm">reset</el-button>
+            </div>
+          </el-form-item>
+        </el-row>
       </el-form>
     </div>
     <div class="list-table">
-      <el-table v-loading="loading" :data="tableData" fit border stripe height="500" style="width: 100%;">
-        <el-table-column type="index" label="序号" width="50" />
-        <el-table-column prop="messageType" label="消息类型" :formatter="formatDictData" width="100" show-overflow-tooltip />
-        <el-table-column prop="title" label="消息标题" show-overflow-tooltip />
-        <el-table-column prop="createOrgName" label="所属应用系统" width="160" show-overflow-tooltip />
-        <el-table-column prop="readStatus" label="状态" :formatter="formatDictData" width="60" />
-        <el-table-column prop="createTime" label="消息接收时间" width="160" />
-        <el-table-column prop="createUser" label="消息发送人" width="100" show-overflow-tooltip />
-        <el-table-column label="操作" align="center" width="160" class-name="action-column">
+      <el-table v-loading="loading" :data="tableData" fit border stripe style="width: 100%;">
+        <el-table-column type="index" label="" width="50" />
+        <el-table-column prop="messageType" label="messageType" :formatter="formatDictData" width="100" show-overflow-tooltip />
+        <el-table-column prop="title" label="title" show-overflow-tooltip />
+        <el-table-column prop="createOrgName" label="createOrgName" width="160" show-overflow-tooltip />
+        <el-table-column prop="readStatus" label="readStatus" :formatter="formatDictData" width="60" />
+        <el-table-column prop="createTime" label="createTime" width="160" />
+        <el-table-column prop="createUser" label="createUser" width="100" show-overflow-tooltip />
+        <el-table-column label="Action" align="center" width="160" class-name="action-column">
           <template slot-scope="scope">
             <!-- <el-button type="text" @click="viewDetail(scope.row.id)">详情</el-button> -->
-            <el-button type="text" @click="viewDetail(scope.row.content)">详情</el-button>
-            <el-button v-if="scope.row.readStatus === 0" type="text" @click="markRead(scope.row)">不再提醒</el-button>
+            <el-button type="text" @click="viewDetail(scope.row.content)">View</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -66,16 +74,12 @@
 </template>
 
 <script>
-import { fetchDictData } from '@/api/dict'
 import { fetchTableList } from '@/api/info'
 
-import { hasValidRecords, formatDictData, isNull } from '@/utils/convert'
-import { formatBytes, formatCount } from '@/utils'
+import { hasValidRecords, formatDictData } from '@/utils/convert'
 
 export default {
   name: 'Info',
-  components: {
-  },
   data() {
     return {
       // type
@@ -88,18 +92,16 @@ export default {
       pageSizeAll: [10, 20, 50, 100, 200, 500],
       tableData: [],
       // filter
+      formName: 'filterForm',
       formData: {
         title: '',
         content: '',
         messageType: '',
-        createOrgCode: '',
-        createTime: ''
+        deptCode: '',
+        publishDate: ''
       },
       // select
       deptData: [],
-      // dialog
-      visible: false,
-      formName: 'uploadForm',
       // others
       loading: false
     }
@@ -121,8 +123,8 @@ export default {
       this.getTablelist()
     },
     // 重置搜索项
-    resetTable(formName) {
-      this.$refs[formName].resetFields()
+    resetForm() {
+      this.$refs[this.formName].resetFields()
       this.getTablelist()
     },
     // 点击搜索按钮
@@ -140,9 +142,11 @@ export default {
         title: this.formData.title,
         content: this.formData.content,
         messageType: this.formData.messageType,
-        createOrgCode: this.formData.createOrgCode,
-        createTime: this.formData.createTime
+        deptCode: this.formData.deptCode
       }
+      // if (this.formData.publishDate) {
+
+      // }
       fetchTableList(params).then(response => {
         this.loading = false
         if (hasValidRecords(response)) {
@@ -164,23 +168,23 @@ export default {
       })
     },
     getTypeData() {
-      this.topLoading = true
-      fetchDictData(this.dictType).then(response => {
-        if (!isNull(response.data)) {
-          this.typeData = response.data
-        } else {
-          this.typeData = []
-        }
-      }).catch(error => {
-        console.log(error)
-        this.topLoading = false
-        this.$message.error({
-          type: 'error',
-          duration: 0,
-          showClose: true,
-          message: '获取信息类型: ' + error.message
-        })
-      })
+      this.typeData = [{ 'id': 1, 'label': 'notice' }, { 'id': 2, 'label': 'communication' }, { 'id': 3, 'label': 'specification' }]
+      // fetchDictData(this.dictType).then(response => {
+      //   if (!isNull(response.data)) {
+      //     this.typeData = response.data
+      //   } else {
+      //     this.typeData = []
+      //   }
+      // }).catch(error => {
+      //   console.log(error)
+      //   this.topLoading = false
+      //   this.$message.error({
+      //     type: 'error',
+      //     duration: 0,
+      //     showClose: true,
+      //     message: '获取信息类型: ' + error.message
+      //   })
+      // })
     },
     // dialog
     showUpload() {
@@ -220,12 +224,6 @@ export default {
     },
     formatDictData(type) {
       return formatDictData(this.typeData, type)
-    },
-    formatBytes(size) {
-      return formatBytes(size)
-    },
-    formatCount(count) {
-      return formatCount(count)
     }
   }
 }
@@ -233,8 +231,23 @@ export default {
 
 <style lang="scss" scoped>
 .info-container {
+  min-width: 1400px;
   .list-filter, .list-table {
     background-color: #fff;
   }
+
+  .list-filter {
+    margin-bottom: 10px;
+
+    .filter-btn {
+      width: 450px;
+      text-align: right;
+    }
+    ::v-deep {
+      .el-input__inner {
+        width: 350px;
+      }
+    }
+  }
 }
 </style>

+ 237 - 0
src/views/info/index2.vue

@@ -0,0 +1,237 @@
+<template>
+  <div class="info-container">
+    <div class="list-filter">
+      <el-form ref="filterForm" :model="formData" inline label-width="100px">
+        <el-form-item label="信息标题">
+          <el-input v-model="formData.title" class="filter-item" clearable />
+        </el-form-item>
+        <el-form-item label="信息内容">
+          <el-input v-model="formData.content" class="filter-item" clearable />
+        </el-form-item>
+        <el-form-item label="信息类型">
+          <el-select v-model="formData.messageType" clearable placeholder="请选择">
+            <el-option v-for="(item) in typeData" :key="item.id" :label="item.label" :value="item.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="发布单位">
+          <el-select v-model="formData.createOrgCode" clearable filterable placeholder="请选择">
+            <el-option v-for="(item) in deptData" :key="item.orgCode" :label="item.shortName" :value="item.orgCode" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="发布日期">
+          <el-col :span="11">
+            <el-date-picker v-model="formData.createTime" type="date" placeholder="开始日期" style="width: 100%;" />
+          </el-col>
+          <el-col class="line" :span="2">-</el-col>
+          <el-col :span="11">
+            <el-date-picker v-model="formData.createTime" type="date" placeholder="截止日期" style="width: 100%;" />
+          </el-col>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="searchTable">查询</el-button>
+          <el-button type="danger" @click="resetForm('filterForm')">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="list-table">
+      <el-table v-loading="loading" :data="tableData" fit border stripe style="width: 100%;">
+        <el-table-column type="index" label="序号" width="50" />
+        <el-table-column prop="messageType" label="消息类型" :formatter="formatDictData" width="100" show-overflow-tooltip />
+        <el-table-column prop="title" label="消息标题" show-overflow-tooltip />
+        <el-table-column prop="createOrgName" label="所属应用系统" width="160" show-overflow-tooltip />
+        <el-table-column prop="readStatus" label="状态" :formatter="formatDictData" width="60" />
+        <el-table-column prop="createTime" label="消息接收时间" width="160" />
+        <el-table-column prop="createUser" label="消息发送人" width="100" show-overflow-tooltip />
+        <el-table-column label="操作" align="center" width="160" class-name="action-column">
+          <template slot-scope="scope">
+            <!-- <el-button type="text" @click="viewDetail(scope.row.id)">详情</el-button> -->
+            <el-button type="text" @click="viewDetail(scope.row.content)">详情</el-button>
+            <el-button v-if="scope.row.readStatus === 0" type="text" @click="markRead(scope.row)">不再提醒</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div v-if="total > 0" class="page">
+      <el-pagination
+        layout="total, sizes, prev, pager, next, jumper"
+        :current-page="current"
+        :total="total"
+        :page-sizes="pageSizeAll"
+        :page-size="size"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+import { fetchDictData } from '@/api/dict'
+import { fetchTableList } from '@/api/info'
+
+import { hasValidRecords, formatDictData, isNull } from '@/utils/convert'
+import { formatBytes, formatCount } from '@/utils'
+
+export default {
+  name: 'Info',
+  components: {
+  },
+  data() {
+    return {
+      // type
+      dictType: 'message_type',
+      typeData: [],
+      // table
+      current: 1,
+      size: 20,
+      total: 0,
+      pageSizeAll: [10, 20, 50, 100, 200, 500],
+      tableData: [],
+      // filter
+      formData: {
+        title: '',
+        content: '',
+        messageType: '',
+        createOrgCode: '',
+        createTime: ''
+      },
+      // select
+      deptData: [],
+      // dialog
+      visible: false,
+      formName: 'uploadForm',
+      // others
+      loading: false
+    }
+  },
+  created() {
+    this.getTypeData()
+    this.searchTable()
+  },
+  methods: {
+    // 改变每页显示条数
+    handleSizeChange(val) {
+      this.current = 1
+      this.size = val
+      this.getTablelist()
+    },
+    // 切换第几页
+    handleCurrentChange(val) {
+      this.current = val
+      this.getTablelist()
+    },
+    // 重置搜索项
+    resetForm(formName) {
+      this.$refs[formName].resetFields()
+      this.getTablelist()
+    },
+    // 点击搜索按钮
+    searchTable() {
+      this.current = 1
+      this.getTablelist()
+    },
+    // 获取table数据
+    getTablelist() {
+      this.loading = true
+      const params = {
+        current: this.current,
+        size: this.size,
+        delFlag: 0,
+        title: this.formData.title,
+        content: this.formData.content,
+        messageType: this.formData.messageType,
+        createOrgCode: this.formData.createOrgCode,
+        createTime: this.formData.createTime
+      }
+      fetchTableList(params).then(response => {
+        this.loading = false
+        if (hasValidRecords(response)) {
+          this.tableData = response.data.records
+          this.total = response.data.total
+        } else {
+          this.tableData = []
+          this.total = 0
+        }
+      }).catch(error => {
+        console.log(error)
+        this.loading = false
+        this.$message.error({
+          type: 'error',
+          duration: 0,
+          showClose: true,
+          message: '获取信息列表出错: ' + error.message
+        })
+      })
+    },
+    getTypeData() {
+      this.topLoading = true
+      fetchDictData(this.dictType).then(response => {
+        if (!isNull(response.data)) {
+          this.typeData = response.data
+        } else {
+          this.typeData = []
+        }
+      }).catch(error => {
+        console.log(error)
+        this.topLoading = false
+        this.$message.error({
+          type: 'error',
+          duration: 0,
+          showClose: true,
+          message: '获取信息类型: ' + error.message
+        })
+      })
+    },
+    // dialog
+    showUpload() {
+      this.visible = true
+    },
+    close() {
+      this.visible = false
+    },
+    // Upload
+    uploadSuccess() {
+      this.uploadLoading = false
+      this.formData.fileName = ''
+      this.visible = false
+      this.searchTable()
+    },
+    uploadError(error) {
+      this.uploadLoading = false
+      this.$message.error({
+        type: 'error',
+        duration: 0,
+        showClose: true,
+        message: '上传软件出错:' + error.message
+      })
+    },
+    uploadChange(file) {
+      if (file.status === 'ready') {
+        this.formData.fileName = file.name
+      }
+    },
+    saveFile() {
+      this.$refs[this.formName].validate((valid) => {
+        if (valid) {
+          this.uploadLoading = true
+          this.$refs['uploadFile'].submit()
+        }
+      })
+    },
+    formatDictData(type) {
+      return formatDictData(this.typeData, type)
+    },
+    formatBytes(size) {
+      return formatBytes(size)
+    },
+    formatCount(count) {
+      return formatCount(count)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.file-container {
+}
+</style>

+ 1 - 1
src/views/system/index.vue

@@ -118,7 +118,7 @@ export default {
       this.getTablelist()
     },
     // 重置搜索项
-    resetTable(formName) {
+    resetForm(formName) {
       this.$refs[formName].resetFields()
       this.getTablelist()
     },