forked from TALL/tall3-pc-keti
4 changed files with 238 additions and 36 deletions
@ -0,0 +1,127 @@ |
|||
<template> |
|||
<div> |
|||
<a-table :columns="columns" :data-source="data"> |
|||
<!-- <template #headerCell="{ column }"></template> --> |
|||
|
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<a-button class="action-btn edit-btn" type="primary" @click="toEdit(record)">编辑</a-button> |
|||
<a-button class="action-btn del-btn" type="primary" @click="toDelete(record)">删除</a-button> |
|||
</template> |
|||
</template> |
|||
</a-table> |
|||
|
|||
<div class="add-btn flex items-center cursor-pointer" @click="addMember"> |
|||
<PlusCircleOutlined style="font-size: 24px; color: #1890ff" /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { PlusCircleOutlined } from '@ant-design/icons-vue'; |
|||
import {} from 'apis'; |
|||
|
|||
const columns = [ |
|||
{ |
|||
title: '序号', |
|||
dataIndex: 'id', |
|||
key: 'id', |
|||
}, |
|||
{ |
|||
title: '成员名', |
|||
dataIndex: 'name', |
|||
key: 'name', |
|||
}, |
|||
{ |
|||
title: '账号', |
|||
dataIndex: 'account', |
|||
key: 'account', |
|||
}, |
|||
{ |
|||
title: '角色', |
|||
key: 'role', |
|||
dataIndex: 'role', |
|||
}, |
|||
{ |
|||
title: '所属单位', |
|||
key: 'unit', |
|||
dataIndex: 'unit', |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
key: 'action', |
|||
dataIndex: 'action', |
|||
}, |
|||
]; |
|||
|
|||
const data = [ |
|||
{ |
|||
key: '1', |
|||
id: '1', |
|||
name: '郁教授', |
|||
account: '12345678910', |
|||
role: '课题主持人', |
|||
unit: '课题主持人', |
|||
}, |
|||
{ |
|||
key: '2', |
|||
id: '2', |
|||
name: '张野', |
|||
account: '10987654321', |
|||
role: '子课题负责人1', |
|||
unit: '子课题负责人1', |
|||
}, |
|||
{ |
|||
key: '3', |
|||
id: '3', |
|||
name: '郁教授', |
|||
account: '12345678910', |
|||
role: '课题主持人', |
|||
unit: '课题主持人', |
|||
}, |
|||
{ |
|||
key: '4', |
|||
id: '4', |
|||
name: '郁教授', |
|||
account: '12345678910', |
|||
role: '课题主持人', |
|||
unit: '课题主持人', |
|||
}, |
|||
]; |
|||
|
|||
function addMember() { |
|||
data.push({ key: '5', id: '5', name: '', account: '', role: '', unit: '' }); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.action-btn { |
|||
width: 50px !important; |
|||
height: 28px !important; |
|||
font-size: 14px !important; |
|||
padding: 0; |
|||
letter-spacing: 0 !important; |
|||
} |
|||
|
|||
:deep(.ant-table-pagination.ant-pagination) { |
|||
height: 0; |
|||
margin: 0; |
|||
} |
|||
|
|||
.add-btn { |
|||
height: 60px; |
|||
background: #fff; |
|||
padding-left: 36px; |
|||
} |
|||
|
|||
.edit-btn { |
|||
background: #0dc26c; |
|||
border: 0; |
|||
} |
|||
|
|||
.del-btn { |
|||
margin-left: 16px; |
|||
background: #ff5353; |
|||
border: 0; |
|||
} |
|||
</style> |
Loading…
Reference in new issue