3 changed files with 964 additions and 198 deletions
@ -0,0 +1,99 @@ |
|||
<template> |
|||
<div> |
|||
<!-- search --> |
|||
<div style="width: 100%" v-if="lists && lists.list && lists.list.length > 0"> |
|||
<a-table |
|||
:columns="columns" |
|||
:data-source="lists.list" |
|||
:loading="loading" |
|||
:pagination="pagination" |
|||
:row-key="record => record.id" |
|||
@change="setData" |
|||
bordered |
|||
class="white pa-3" |
|||
> |
|||
<template slot="hospitalId" slot-scope="text, record"> |
|||
<span>{{ record.hospitalId }}</span> |
|||
</template> |
|||
<template slot="inputStatus" slot-scope="text, record"> |
|||
<span v-if="record.inputStatus === 0">新建</span> |
|||
<span v-else-if="record.inputStatus === 1">数据搜集中</span> |
|||
<span v-else-if="record.inputStatus === 2">数据搜集完成</span> |
|||
<span v-else-if="record.inputStatus === 3">数据搜集超时</span> |
|||
<span v-else-if="record.inputStatus === 4">废弃</span> |
|||
</template> |
|||
</a-table> |
|||
</div> |
|||
<a-empty v-else /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapMutations, mapState } from 'vuex'; |
|||
const columns = [ |
|||
{ |
|||
title: '住院号', |
|||
align: 'center', |
|||
dataIndex: 'hospitalization', |
|||
key: 'hospitalization', |
|||
}, |
|||
{ |
|||
title: '医院', |
|||
align: 'center', |
|||
dataIndex: 'hosName', |
|||
key: 'hosName', |
|||
scopedSlots: { customRender: 'hosName' }, |
|||
}, |
|||
{ |
|||
title: '对照组', |
|||
align: 'center', |
|||
dataIndex: 'name', |
|||
key: 'name', |
|||
scopedSlots: { customRender: 'name' }, |
|||
}, |
|||
{ |
|||
title: '录入状态', |
|||
align: 'center', |
|||
dataIndex: 'inputStatus', |
|||
key: 'inputStatus', |
|||
scopedSlots: { customRender: 'inputStatus' }, |
|||
}, |
|||
]; |
|||
|
|||
export default { |
|||
name: 'CaseTable', |
|||
|
|||
props: { lists: { type: Object, default: null } }, |
|||
|
|||
data() { |
|||
return { |
|||
columns, |
|||
loading: false, |
|||
}; |
|||
}, |
|||
|
|||
computed: { |
|||
pagination() { |
|||
const { pageNum, pageSize, total } = this.lists; |
|||
return { |
|||
current: pageNum, |
|||
pageSize, |
|||
total: +total, |
|||
}; |
|||
}, |
|||
}, |
|||
|
|||
methods: { |
|||
...mapMutations('home', ['setPatientId']), |
|||
|
|||
// 选择病患 |
|||
chooseItem(id) { |
|||
this.setPatientId(id); |
|||
}, |
|||
setData(pagination) { |
|||
const { current } = pagination; |
|||
this.$emit('setData', current); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
File diff suppressed because it is too large
Loading…
Reference in new issue