|
|
@ -9,6 +9,7 @@ |
|
|
|
:row-key="record => record.id" |
|
|
|
:scroll="{ y: height }" |
|
|
|
@change="handleTableChange" |
|
|
|
@expand="getDetail" |
|
|
|
bordered |
|
|
|
class="white" |
|
|
|
> |
|
|
@ -16,10 +17,6 @@ |
|
|
|
<span>{{ index + 1 }}</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="content" slot-scope="text, record, index"> |
|
|
|
<span v-dompurify-html="text"></span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="edit" slot-scope="text, record"> |
|
|
|
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" /> |
|
|
|
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length"> |
|
|
@ -27,14 +24,17 @@ |
|
|
|
</a-popconfirm> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- <div slot="expandedRowRender" slot-scope="record" style="margin: 0"> |
|
|
|
<div class="d-flex flex-nowrap justify-space-between mb-2"> |
|
|
|
<div>计划时间:{{ record.planTime }}</div> |
|
|
|
<div class="ml-8">实际时间:{{ record.realTime }}</div> |
|
|
|
<div class="ml-8">组织人:{{ record.organizer }}</div> |
|
|
|
<div |
|
|
|
class="d-flex flex-nowrap justify-space-between" |
|
|
|
slot="expandedRowRender" |
|
|
|
slot-scope="record" |
|
|
|
style="margin: 0" |
|
|
|
> |
|
|
|
<div> |
|
|
|
内容: |
|
|
|
<span v-dompurify-html="record.content"></span> |
|
|
|
</div> |
|
|
|
<div>活动内容:{{ record.content }}</div> |
|
|
|
</div>--> |
|
|
|
</div> |
|
|
|
</a-table> |
|
|
|
</div> |
|
|
|
<a-empty v-else /> |
|
|
@ -46,7 +46,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import PageEdit from 'components/Page/PageEdit.vue'; |
|
|
|
import { deletePage } from 'config/api'; |
|
|
|
import { deletePage, getPage } from 'config/api'; |
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
@ -63,13 +63,6 @@ const columns = [ |
|
|
|
dataIndex: 'titleCode', |
|
|
|
key: 'titleCode', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '内容', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'content', |
|
|
|
key: 'content', |
|
|
|
scopedSlots: { customRender: 'content' }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '编辑', |
|
|
|
align: 'center', |
|
|
@ -87,7 +80,6 @@ export default { |
|
|
|
}, |
|
|
|
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, |
|
|
|
data() { |
|
|
|
this.cacheData = this.lists.map(item => ({ ...item })); |
|
|
|
return { |
|
|
|
columns, |
|
|
|
loading: false, |
|
|
@ -143,6 +135,24 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 详情查询 |
|
|
|
async getDetail(expanded, record) { |
|
|
|
if (!expanded) return; |
|
|
|
try { |
|
|
|
const params = { param: { id: record.id } }; |
|
|
|
const res = await getPage(params); |
|
|
|
const { data, msg, code } = res.data; |
|
|
|
if (code === 200) { |
|
|
|
const item = this.lists.find(item => item.id === record.id); |
|
|
|
item.content = data.content; |
|
|
|
} else { |
|
|
|
throw msg; |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
this.$message.error(error || '查询失败'); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 打开报名 |
|
|
|
openSignUp() { |
|
|
|
const { query } = this.$route; |
|
|
|