瀏覽代碼

Merge branch 'master' of http://git.cc-lotus.info/free-lab/lab-mobile

lrf 3 年之前
父節點
當前提交
744e5eddc8

+ 49 - 0
src/layout/innovate/popularization/info-1.vue

@@ -0,0 +1,49 @@
+<template>
+  <div id="info-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="one">
+          <van-form label-width="4em">
+            <van-field v-model="info.name" name="name" label="活动主题" readonly />
+            <van-field v-model="info.timestr" name="timestr" label="活动时间" readonly />
+            <van-field v-model="info.numbers" name="numbers" label="参加对象及人数" readonly />
+            <van-field v-model="info.propaganda" name="propaganda" label="宣传报导" type="textarea" autosize rows="1" readonly />
+            <van-field v-model="info.usersnumber" name="usersnumber" label="本室人员参与人数" readonly />
+            <van-field v-model="info.content" name="content" label="备注" type="textarea" autosize rows="1" readonly />
+          </van-form>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'info-1',
+  props: {
+    info: { type: Object },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 91 - 0
src/layout/innovate/popularization/list-1.vue

@@ -0,0 +1,91 @@
+<template>
+  <div id="list-1">
+    <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.timestr || '暂无' }}</span>
+            </van-col>
+            <van-col span="24" class="otherInfo">
+              参加对象及人数:<span>{{ item.numbers || '暂无' }}</span>
+            </van-col>
+          </van-col>
+          <van-col span="24" class="btn">
+            <van-button type="info" size="small" @click="toView(item)">详细信息</van-button>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list-1',
+  props: {
+    list: { type: Array },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    // 查看详情
+    toView(data) {
+      this.$emit('toView', data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .list {
+    background-color: #fff;
+    margin: 0 0 8px 0;
+    padding: 8px;
+    border-radius: 5px;
+    .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>

+ 2 - 1
src/views/innovate/achieve/index.vue

@@ -29,7 +29,8 @@ export default {
   },
   methods: {
     ...mapActions(['query', 'fetch']),
-    async search({ skip = 0, limit = this.limit, ...condition } = {}) {
+    async search({ skip = 0, limit = this.limit, searchName, ...condition } = {}) {
+      if (searchName) condition.name = searchName;
       const res = await this.query({ table: 'Outcome', skip, limit, ...condition });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);

+ 2 - 1
src/views/innovate/learning/index.vue

@@ -29,7 +29,8 @@ export default {
   },
   methods: {
     ...mapActions(['query', 'fetch']),
-    async search({ skip = 0, limit = this.limit, ...condition } = {}) {
+    async search({ skip = 0, limit = this.limit, searchName, ...condition } = {}) {
+      if (searchName) condition.name = searchName;
       const res = await this.query({ table: 'Loso', skip, limit, ...condition });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);

+ 54 - 8
src/views/innovate/popularization/index.vue

@@ -1,26 +1,72 @@
 <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" @toView="toView"></list-1>
+      </template>
+    </admin-frame>
+    <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 list1 from '@/layout/innovate/popularization/list-1.vue';
+import info1 from '@/layout/innovate/popularization/info-1.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,
+    info1,
+  },
   data: function () {
-    return {};
+    return {
+      list: [],
+      total: 0,
+      limit: 4,
+      dialog: { show: false, title: '详细信息' },
+      info: {},
+    };
+  },
+  created() {
+    this.search();
   },
-  created() {},
-  methods: {},
+  methods: {
+    ...mapActions(['query', 'fetch']),
+    async search({ skip = 0, limit = this.limit, searchName, ...condition } = {}) {
+      if (searchName) condition.name = searchName;
+      const res = await this.query({ table: 'Losc', skip, limit, ...condition });
+      if (res.errcode == '0') {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+    },
+    async toView(data) {
+      const res = await this.fetch({ table: 'Losc', id: data.id });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'info', res.data);
+        this.dialog = { show: true, title: '详细信息' };
+      }
+    },
+  },
+
   metaInfo() {
     return { title: this.$route.meta.title };
   },
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.dialog {
+  /deep/.van-dialog__content {
+    max-height: 350px;
+    overflow-y: auto;
+  }
+}
+</style>

+ 2 - 1
src/views/scientific/laboratory/index.vue

@@ -32,7 +32,8 @@ export default {
   },
   methods: {
     ...mapActions(['query', 'fetch']),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
+      if (searchName) info.name = searchName;
       const res = await this.query({ table: 'BasicInformation', skip, limit, ...info });
       if (res.errcode == '0') {
         this.$set(this, 'list', res.data);