|
@@ -12,7 +12,7 @@
|
|
import list1 from '@/layout/scientific/laboratory/list-1.vue';
|
|
import list1 from '@/layout/scientific/laboratory/list-1.vue';
|
|
import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
|
|
import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
-const { mapActions } = createNamespacedHelpers('laboratory');
|
|
|
|
|
|
+const { mapActions } = createNamespacedHelpers('usual');
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
@@ -24,40 +24,26 @@ export default {
|
|
return {
|
|
return {
|
|
list: [],
|
|
list: [],
|
|
total: 0,
|
|
total: 0,
|
|
- limit: 4,
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- async created() {
|
|
|
|
- await this.search();
|
|
|
|
|
|
+ created() {
|
|
|
|
+ console.log('in function:');
|
|
|
|
+ this.init();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions(['query']),
|
|
|
|
- async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
|
|
|
|
- if (searchName) info.name = searchName;
|
|
|
|
- const res = await this.query({ skip, limit, ...info });
|
|
|
|
|
|
+ ...mapActions(['query', 'fetch']),
|
|
|
|
+ async init() {
|
|
|
|
+ const res = await this.query({ table: 'BasicInformation', skip: 0, limit: 10 });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
- this.$set(this, `list`, res.rows);
|
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
|
|
|
+ this.$set(this, 'list', res.data);
|
|
|
|
+ this.$set(this, 'total', res.total);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 查看信息
|
|
|
|
- async toView(data) {
|
|
|
|
- this.$router.push({ path: '/scientific/laboratory/info', query: { id: data.id } });
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- ...mapState(['user']),
|
|
|
|
},
|
|
},
|
|
|
|
+
|
|
metaInfo() {
|
|
metaInfo() {
|
|
return { title: this.$route.meta.title };
|
|
return { title: this.$route.meta.title };
|
|
},
|
|
},
|
|
- watch: {
|
|
|
|
- test: {
|
|
|
|
- deep: true,
|
|
|
|
- immediate: true,
|
|
|
|
- handler(val) {},
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|