You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
2.5 KiB
98 lines
2.5 KiB
<template>
|
|
<div class="pa-3 white fill-height d-flex flex-column">
|
|
<institute-search :typeLists="typeLists" @getInstituteSearchBack="getInstituteSearchBack" />
|
|
<institute-date
|
|
:lists="lists"
|
|
:pagination="pagination"
|
|
@getInstituteSearchBack="getInstituteSearchBack"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import InstituteSearch from 'components/Institute/InstituteSearch.vue';
|
|
import InstituteDate from 'components/Institute/InstituteDate.vue';
|
|
import { getInstituteSearchBack } from 'config/api';
|
|
import { mapActions } from 'vuex';
|
|
|
|
export default {
|
|
name: 'ResourceSharing',
|
|
components: {
|
|
InstituteSearch,
|
|
InstituteDate,
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
lists: [],
|
|
pagination: { current: 1, pageSize: 10 },
|
|
typeLists: [],
|
|
};
|
|
},
|
|
|
|
async created() {
|
|
await this.selModelSearch();
|
|
await this.getInstituteSearchBack();
|
|
},
|
|
|
|
methods: {
|
|
...mapActions(['getSelModelSearch']),
|
|
/**
|
|
* 获取分类管理列表
|
|
* @param { Number } model 类型 0成果 1仪器 2实验室
|
|
* @param { String } name 分类名称
|
|
*/
|
|
async selModelSearch(condition) {
|
|
const params = {
|
|
param: {
|
|
pageNum: (condition && condition.current) || 1,
|
|
pageSize: (condition && condition.pageSize) || 10,
|
|
model: 2,
|
|
},
|
|
};
|
|
if (condition) {
|
|
if (condition.name) {
|
|
params.param.name = condition.name;
|
|
}
|
|
}
|
|
const data = await this.getSelModelSearch(params);
|
|
this.typeLists = data;
|
|
},
|
|
|
|
/**
|
|
* 获取实验室
|
|
* @param { Array } moldIds 类型 0成果 1仪器 2实验室
|
|
* @param { String } name 分类名称
|
|
*/
|
|
async getInstituteSearchBack(condition) {
|
|
try {
|
|
const params = {
|
|
param: {
|
|
pageNum: (condition && condition.current) || 1,
|
|
pageSize: (condition && condition.pageSize) || 10,
|
|
},
|
|
};
|
|
if (condition) {
|
|
if (condition.name) {
|
|
params.param.name = condition.name;
|
|
}
|
|
}
|
|
const res = await getInstituteSearchBack(params);
|
|
const { code, msg, data } = res.data;
|
|
if (code === 200) {
|
|
this.lists = data.list;
|
|
const paper = { ...this.pagination };
|
|
paper.current = data.pageNum;
|
|
paper.total = +data.total;
|
|
paper.pageSize = data.pageSize;
|
|
this.pagination = paper;
|
|
} else {
|
|
throw msg || '获取失败';
|
|
}
|
|
} catch (error) {
|
|
this.$message.error(error);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|