Quellcode durchsuchen

新增消息中心

gongwencan vor 5 Monaten
Ursprung
Commit
0c86bc9aa3
5 geänderte Dateien mit 139 neuen und 0 gelöschten Zeilen
  1. 9 0
      src/api/MessageCenterApi.js
  2. 19 0
      src/entries/MessageCenter.js
  3. 34 0
      src/mock/index.js
  4. 8 0
      src/router/index.js
  5. 69 0
      src/views/MessageCenter.vue

+ 9 - 0
src/api/MessageCenterApi.js

@@ -0,0 +1,9 @@
+import BaseCurdApi from './BaseCurdApi'
+
+class MessageCenterApi extends BaseCurdApi {
+  constructor () {
+    super('/messagecenter')
+  }
+}
+
+export default new MessageCenterApi()

+ 19 - 0
src/entries/MessageCenter.js

@@ -0,0 +1,19 @@
+import messageCenterApi from '@@/api/MessageCenterApi'
+import BaseCurdEntry from './BaseCurdEntry'
+
+export default class TagApply extends BaseCurdEntry {
+  dataTime
+  get formatDataTime () {
+    return new Date(this.dataTime).format('YYYY-MM-DD HH:mm:ss')
+  }
+
+  content
+
+  static get $$api () {
+    return messageCenterApi
+  }
+
+  static $$getQuery = () => ({
+    order: [['dataTime', 'DESC']]
+  })
+}

+ 34 - 0
src/mock/index.js

@@ -164,4 +164,38 @@ Mock.mock(/\/tag\/code\/qr/, 'get', {
   }
 })
 
+Mock.mock(/\/tag\/code\/page/, 'post', {
+  type: 'success',
+  data: {
+    'count|10-40': 1,
+    'list|1-20': [{
+      'id|1-20': 1,
+      dataTime: '2024/01/01 00:00:00',
+      orderNo: '123456',
+      expectedReceiptDate: '2024/01/02 00:00:00',
+      serialNumberRange: ['0000001', '000800'],
+      'providerName|1': ['人民电器集团有限公司', '上海东生供用电器材厂', '上海辉电电力设备工程有限公司'],
+      'tagTypeName|1': ['高性能不干胶标签', '柔性抗金属标签', '扎带标签'],
+      number: 123,
+      'amount|1-100.1-2': 30,
+      'tagApplyStateName|1': ['待支付', '待发货', '已发货'],
+      operatorName: '操作员',
+      applicantName: '申领人',
+      'unitPrice|1-100.1-2': 10,
+      createTime: '2024/01/01 00:00:00'
+    }]
+  }
+})
+
+Mock.mock(/\/messagecenter\/page/, 'post', {
+  type: 'success',
+  data: {
+    'count|10-40': 1,
+    'list|1-20': [{
+      'dataTime|1': ['2024/01/01 16:00:00', '2024/02/01 16:00:00', '2024/03/01 16:00:00'],
+      'content|1': ['测试消息', '测试消息1']
+    }]
+  }
+})
+
 export default Mock

+ 8 - 0
src/router/index.js

@@ -51,6 +51,14 @@ export default new Router({
           permission: 'isAuthenticated'
         },
         component: () => import('@@/views/TagInventory.vue')
+      }, {
+        path: '/page-in-src/message-center',
+        name: 'MessageCenter',
+        meta: {
+          title: '消息中心',
+          permission: 'isAuthenticated'
+        },
+        component: () => import('@@/views/MessageCenter.vue')
       }]
     }
   ]

+ 69 - 0
src/views/MessageCenter.vue

@@ -0,0 +1,69 @@
+<template>
+    <div class="wrapper flex column layout-gap">
+
+      <el-card
+        shadow="hover"
+        class="z-card flex column flex-1 fit-size"
+      >
+        <div class="wrapper flex column layout-gap">
+
+          <!-- <div class="flex column flex-1 fit-size"></div> -->
+          <div class="flex-1 fit-size">
+            <el-table
+              ref="table"
+              :data="list"
+              stripe
+              border
+              highlight-current-row
+              height="100%"
+              size="small"
+              class="custom-el-table-style"
+            >
+              <el-table-column
+                type="index"
+                label="序号"
+                width="60"
+                align="center"
+                fixed
+              ></el-table-column>
+              <el-table-column
+                label="时间"
+                prop="formatDataTime"
+                align="center"
+                width="200"
+                header-align="center"
+                fixed
+              ></el-table-column>
+              <el-table-column
+                label="消息内容"
+                prop="content"
+                min-width="200"
+                header-align="center"
+                align="left"
+              ></el-table-column>
+            </el-table>
+          </div>
+
+          <my-pagination
+            :total="total"
+            :pagination="pagination"
+            @current-change="currentPageNoChange"
+          />
+        </div>
+      </el-card>
+    </div>
+    </template>
+
+<script>
+import BaseCurdList from '@@/utils/BaseCurdList'
+import MessageCenter from '@@/entries/MessageCenter'
+
+export default {
+  name: 'MessageCenter',
+  extends: BaseCurdList(MessageCenter),
+  data: () => ({
+  })
+}
+</script>
+
+<style lang="scss" scoped></style>