zhangxin 2 năm trước cách đây
mục cha
commit
8aa5f83619
1 tập tin đã thay đổi với 24 bổ sung13 xóa
  1. 24 13
      src/views/message/messageList.vue

+ 24 - 13
src/views/message/messageList.vue

@@ -5,9 +5,7 @@
         <div class="up-title">🔍筛选搜索</div>
         <div class="up-input-title">
           消息标题:<el-input v-model="input" class="up-input" placeholder="请输入内容"></el-input>
-        
         </div>
-
         <div class="up-input-title-right">
           <span class="demonstration">发布时间:</span>
           <el-date-picker v-model="value2" type="datetimerange" class="up-input-right" :picker-options="pickerOptions"
@@ -22,8 +20,6 @@
         </div>
       </div>
     </div>
-
-
       <div class="down">
         <div class="down-add">
           <el-row :gutter="24">
@@ -70,17 +66,10 @@
         <div class="bottom-page"><el-pagination background layout="prev, pager, next" :total="1"></el-pagination></div>
         <span class="bottom-number">共{{ 0 }}条 </span>
       </div>
-     
     </div>
-
-
-
 </template>
 
 <script>
-
-
-// import {getMessageList} from '../../mock/message-box.ts'
 export default {
   
   props: {
@@ -91,16 +80,38 @@ export default {
       tableData: [],
       input:"",
       value2:"",
+      mock:"",
+      mockMessageList:[],
     }
   },
+  //产生mock数据
+  
   mounted() {
-    
+    this.getMockMessageList();
+    this.getTableList();
   },
   beforeDestroy() {
     
   },
   methods: {
-  
+    getMockMessageList() {
+      var Mock = require('mockjs')
+      var data = Mock.mock({
+          'list|1-10': [{
+            'id|+1': 1,
+            'messageTitle': '@EMAIL',
+            'phoneNumber':'15888888888',
+            'publishTime':'2022-05-03',
+            // 'regexp3': /\d{5,10}/
+        }]
+      })
+      // console.log(data);
+      this.mockMessageList = data ; 
+      // console.log( this.mockMessageList.arr);
+    },
+    getTableList() {
+      this.tableData = this.mockMessageList.list
+    }
   }
 }