5 changed files with 159 additions and 29 deletions
@ -1,19 +1,70 @@ |
|||
<template> |
|||
<div class="pa-3 white fill-height d-flex flex-column"> |
|||
<spin-off-search /> |
|||
<spin-off-date /> |
|||
<spin-off-search @getCreatingPlatformSearch="getCreatingPlatformSearch" /> |
|||
<spin-off-date :pagination="pagination" :lists="lists" @getCreatingPlatformSearch="getCreatingPlatformSearch"/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import SpinOffSearch from "components/SpinOff/SpinOffSearch.vue"; |
|||
import SpinOffDate from "components/SpinOff/SpinOffDate.vue"; |
|||
import { getCreatingPlatformSearch } from 'config/api'; |
|||
|
|||
export default { |
|||
name: "DerivativeSpinOffs", |
|||
components: { |
|||
SpinOffSearch, |
|||
SpinOffDate, |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
lists: [], |
|||
pagination: { current: 1, pageSize: 10 }, |
|||
}; |
|||
}, |
|||
|
|||
created() { |
|||
this.getCreatingPlatformSearch() |
|||
}, |
|||
|
|||
methods: { |
|||
async getCreatingPlatformSearch(condition){ |
|||
try { |
|||
const params = { |
|||
param: { |
|||
pageNum: (condition && condition.current) || 1, |
|||
pageSize: (condition && condition.pageSize) || 10, |
|||
}, |
|||
}; |
|||
|
|||
if(condition){ |
|||
if(condition.companyName){ |
|||
params.param.companyName = condition.companyName |
|||
} |
|||
if(condition.companyType){ |
|||
params.param.companyType = condition.companyType |
|||
} |
|||
} |
|||
|
|||
const res = await getCreatingPlatformSearch(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
console.log(data) |
|||
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> |
|||
|
Loading…
Reference in new issue