guhongwei il y a 3 ans
Parent
commit
8485f2d8bc
2 fichiers modifiés avec 13 ajouts et 21 suppressions
  1. 3 0
      src/store/index.js
  2. 10 21
      src/views/scientific/otherachieve/index.vue

+ 3 - 0
src/store/index.js

@@ -26,6 +26,8 @@ import assistant from '@common/src/store/assistant';
 import committee from '@common/src/store/committee';
 // 平台活动时间段
 import times from '@common/src/store/times';
+// 其他成果
+import other from '@common/src/store/other';
 
 Vue.use(Vuex);
 
@@ -48,5 +50,6 @@ export default new Vuex.Store({
     assistant,
     committee,
     times,
+    other,
   },
 });

+ 10 - 21
src/views/scientific/otherachieve/index.vue

@@ -18,6 +18,8 @@ import info1 from '@/layout/scientific/otherachieve/info-1.vue';
 import search1 from '@/layout/scientific/otherachieve/search-1.vue';
 import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('other');
+
 export default {
   name: 'index',
   props: {},
@@ -29,24 +31,7 @@ export default {
   },
   data: function () {
     return {
-      list: [
-        {
-          content: '啊吧啊吧',
-          createBy: '1',
-          createTime: '2021-09-16 10:45:35',
-          delFlag: '0',
-          direction: '173d667ff2c04aa68390fefef2519f95',
-          directionName: null,
-          id: '80624b94ad0d4827b7f15699febe5a2c',
-          name: '成果名称',
-          params: {},
-          remark: null,
-          searchValue: null,
-          type: '1',
-          updateBy: null,
-          updateTime: '2021-09-22 20:07:11',
-        },
-      ],
+      list: [],
       total: 0,
       limit: 5,
       // 查询
@@ -61,9 +46,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, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.rows);
+        this.$set(this, `total`, res.total);
+      }
     },
     // 查看信息
     async toView(data) {