lrf 3 роки тому
батько
коміт
62c34e4a65

+ 68 - 0
src/layout/innovate/achieve/list.vue

@@ -0,0 +1,68 @@
+<template>
+  <van-row>
+    <van-col span="24" class="main">
+      <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
+        <van-col span="24" class="title textOver">
+          {{ item.name }}
+        </van-col>
+        <van-col span="24" class="other">
+          <van-col span="24" class="otherInfo">
+            <span>{{ item.content || '暂无' }}</span>
+          </van-col>
+          <!-- <van-col span="24" class="otherInfo">
+            职务:<span>{{ item.job || '暂无' }}</span>
+          </van-col> -->
+        </van-col>
+      </van-col>
+    </van-col>
+  </van-row>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list',
+  props: { list: { type: Array, default: () => [] } },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 0 10px;
+  .list {
+    background-color: #fff;
+    margin: 0 0 8px 0;
+    padding: 8px;
+    border-radius: 5px;
+    border: 1px solid #f1f1f1;
+    .title {
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 0 5px 0;
+    }
+    .other {
+      margin: 0 0 5px 0;
+      .otherInfo {
+        font-size: 14px;
+        color: #666;
+        margin: 0 0 5px 0;
+        span {
+          color: #000;
+        }
+      }
+    }
+    .btn {
+      text-align: center;
+      .van-button {
+        margin: 0 5px;
+      }
+    }
+  }
+}
+</style>

+ 53 - 0
src/layout/innovate/learning/info.vue

@@ -0,0 +1,53 @@
+<template>
+  <div id="info">
+    <van-form>
+      <template v-for="(i, index) in fields">
+        <van-field v-model="info[i.model]" :key="`f${index}`" :label="i.label" :readonly="true" />
+      </template>
+    </van-form>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('usual');
+export default {
+  name: 'info',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      info: {},
+      fields: [
+        { label: '活动名称', model: 'name' },
+        { label: '组织者', model: 'usernames' },
+        { label: '充当角色', model: 'role' },
+        { label: '人数', model: 'numbers' },
+        { label: '宣传报导', model: 'propaganda' },
+      ],
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['fetch']),
+    async search() {
+      const res = await this.fetch({ table: 'Loso', id: this.id });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'info', res.data);
+      }
+    },
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 96 - 0
src/layout/innovate/learning/list.vue

@@ -0,0 +1,96 @@
+<template>
+  <div>
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
+          <van-col span="24" class="title textOver">
+            {{ item.name }}
+          </van-col>
+          <van-col span="24" class="other">
+            <van-col span="24" class="otherInfo">
+              组织者:<span>{{ item.usernames || '暂无' }}</span>
+            </van-col>
+            <van-col span="24" class="otherInfo">
+              人数:<span>{{ item.numbers || '暂无' }}</span>
+            </van-col>
+          </van-col>
+          <van-col span="24" style="text-align: center">
+            <van-button type="info" @click="toView(item)" size="small">详细信息</van-button>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-row>
+    <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button cancel-button-text="返回">
+      <info-1 :info="info"></info-1>
+    </van-dialog>
+  </div>
+</template>
+
+<script>
+import info1 from './info.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('usual');
+export default {
+  name: 'list',
+  props: { list: { type: Array, default: () => [] } },
+  components: { info1 },
+  data: function () {
+    return {
+      dialog: { show: false, title: '详细信息' },
+      info: {},
+    };
+  },
+  created() {},
+  methods: {
+    ...mapActions(['fetch']),
+    async toView(data) {
+      const res = await this.fetch({ table: 'Loso', id: data.id });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'info', res.data);
+        this.dialog.show = true;
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 0 10px;
+  .list {
+    background-color: #fff;
+    margin: 0 0 8px 0;
+    padding: 8px;
+    border-radius: 5px;
+    border: 1px solid #f1f1f1;
+    .title {
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 0 5px 0;
+    }
+    .other {
+      margin: 0 0 5px 0;
+      .otherInfo {
+        font-size: 14px;
+        color: #666;
+        margin: 0 0 5px 0;
+        span {
+          color: #000;
+        }
+      }
+    }
+    .btn {
+      text-align: center;
+      .van-button {
+        margin: 0 5px;
+      }
+    }
+  }
+}
+.dialog {
+  /deep/.van-dialog__content {
+    max-height: 350px;
+    overflow-y: auto;
+  }
+}
+</style>

+ 26 - 16
src/views/innovate/achieve/index.vue

@@ -1,35 +1,45 @@
 <template>
   <div id="index">
-    <van-row>
-      <van-col span="24" class="main"> test </van-col>
-    </van-row>
+    <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
+      <template v-slot:info>
+        <list-1 :list="list"></list-1>
+      </template>
+    </admin-frame>
   </div>
 </template>
 
 <script>
+import list1 from '@/layout/innovate/achieve/list.vue';
+import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('usual');
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: { adminFrame, list1 },
   data: function () {
-    return {};
+    return {
+      list: [],
+      total: 0,
+      limit: 4,
+    };
   },
-  created() {},
-  methods: {},
-  computed: {
-    ...mapState(['user']),
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'fetch']),
+    async search({ skip = 0, limit = this.limit, ...condition } = {}) {
+      const res = await this.query({ table: 'Outcome', skip, limit, ...condition });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };
   },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
 };
 </script>
 

+ 26 - 16
src/views/innovate/learning/index.vue

@@ -1,35 +1,45 @@
 <template>
   <div id="index">
-    <van-row>
-      <van-col span="24" class="main"> test </van-col>
-    </van-row>
+    <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
+      <template v-slot:info>
+        <list-1 :list="list"></list-1>
+      </template>
+    </admin-frame>
   </div>
 </template>
 
 <script>
+import list1 from '@/layout/innovate/learning/list.vue';
+import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('usual');
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: { adminFrame, list1 },
   data: function () {
-    return {};
+    return {
+      list: [],
+      total: 0,
+      limit: 4,
+    };
   },
-  created() {},
-  methods: {},
-  computed: {
-    ...mapState(['user']),
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'fetch']),
+    async search({ skip = 0, limit = this.limit, ...condition } = {}) {
+      const res = await this.query({ table: 'Loso', skip, limit, ...condition });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };
   },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
 };
 </script>
 

+ 0 - 10
src/views/innovate/popularization/index.vue

@@ -17,19 +17,9 @@ export default {
   },
   created() {},
   methods: {},
-  computed: {
-    ...mapState(['user']),
-  },
   metaInfo() {
     return { title: this.$route.meta.title };
   },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
 };
 </script>
 

+ 3 - 3
src/views/scientific/laboratory/index.vue

@@ -27,18 +27,18 @@ export default {
     };
   },
   created() {
-    console.log('in function:');
-    this.init();
+    this.search();
   },
   methods: {
     ...mapActions(['query', 'fetch']),
-    async init() {
+    async search() {
       const res = await this.query({ table: 'BasicInformation', skip: 0, limit: 10 });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
+    toView() {},
   },
 
   metaInfo() {