Jelajahi Sumber

平台活动

guhongwei 3 tahun lalu
induk
melakukan
c91d2d514f
2 mengubah file dengan 12 tambahan dan 19 penghapusan
  1. 3 0
      src/store/index.js
  2. 9 19
      src/views/activity/time/index.vue

+ 3 - 0
src/store/index.js

@@ -24,6 +24,8 @@ import report from '@common/src/store/report';
 import assistant from '@common/src/store/assistant';
 // 学术委员会
 import committee from '@common/src/store/committee';
+// 平台活动时间段
+import times from '@common/src/store/times';
 
 Vue.use(Vuex);
 
@@ -45,5 +47,6 @@ export default new Vuex.Store({
     report,
     assistant,
     committee,
+    times,
   },
 });

+ 9 - 19
src/views/activity/time/index.vue

@@ -18,6 +18,7 @@ import info1 from '@/layout/activity/time/info-1.vue';
 import search1 from '@/layout/activity/time/search-1.vue';
 import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('times');
 export default {
   name: 'index',
   props: {},
@@ -29,22 +30,7 @@ export default {
   },
   data: function () {
     return {
-      list: [
-        {
-          createBy: '1',
-          createTime: '2021-11-17 15:20:03',
-          endTime: '2021-12-31',
-          id: '3d927a9ce1b54ba2879b7c6a8aab6370',
-          isOpen: '0',
-          params: {},
-          remark: null,
-          searchValue: null,
-          startTime: '2021-11-01',
-          title: '测试',
-          updateBy: null,
-          updateTime: null,
-        },
-      ],
+      list: [],
       total: 0,
       limit: 5,
       // 查询
@@ -59,9 +45,13 @@ export default {
     await this.search();
   },
   methods: {
-    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
-      if (searchName) info.name = searchName;
-      console.log(this.searhForm);
+    ...mapActions(['query', 'fetch']),
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      const res = await this.query({ skip, limit, isOpen: '0', ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.rows);
+        this.$set(this, `total`, res.total);
+      }
     },
     // 查看信息
     async toView(data) {