|
|
@ -5,7 +5,10 @@ |
|
|
|
:columns="columns" |
|
|
|
:data-source="lists" |
|
|
|
:loading="loading" |
|
|
|
:pagination="pagination" |
|
|
|
@change="handleTableChange" |
|
|
|
:row-key="record => record.id" |
|
|
|
:scroll="{ y: height }" |
|
|
|
bordered |
|
|
|
class="white" |
|
|
|
> |
|
|
@ -13,17 +16,8 @@ |
|
|
|
<span>{{ index + 1 }}</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="type" slot-scope="text, record"> |
|
|
|
<a-tag color="blue">{{ record.type }}</a-tag> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="time" slot-scope="text, record"> |
|
|
|
<div v-if="record.realTime">{{ record.realTime }}</div> |
|
|
|
<div v-else>{{ record.planTime }}</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="state" slot-scope="text, record"> |
|
|
|
<a-tag color="green">{{ record.state }}</a-tag> |
|
|
|
<span v-if="record.releaseTime">{{ record.releaseTime}}</span><span v-if="record.releaseTime">-{{record.releaseTime}}</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="edit" slot-scope="text, record"> |
|
|
@ -31,16 +25,11 @@ |
|
|
|
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length"> |
|
|
|
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" /> |
|
|
|
</a-popconfirm> |
|
|
|
<a-button @click="openSignUp" class="ml-4" size="small" type="primary">报名</a-button> |
|
|
|
</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> |
|
|
|
<div>活动内容:{{ record.content }}</div> |
|
|
|
<div>详情: |
|
|
|
<span v-dompurify-html="record.content"></span></div> |
|
|
|
</div> |
|
|
|
</a-table> |
|
|
|
</div> |
|
|
@ -53,7 +42,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import ActivityEdit from "components/Activity/ActivityEdit.vue"; |
|
|
|
// import { delTeam } from 'config/api'; |
|
|
|
import { deleteIndustryInfo } from 'config/api'; |
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
@ -63,45 +52,30 @@ const columns = [ |
|
|
|
key: 'id', |
|
|
|
scopedSlots: { customRender: 'id' }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '发布平台', |
|
|
|
{ |
|
|
|
title: '标题', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'plat', |
|
|
|
key: 'plat', |
|
|
|
dataIndex: 'title', |
|
|
|
key: 'title', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '类型', |
|
|
|
title: '地点', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'type', |
|
|
|
key: 'type', |
|
|
|
scopedSlots: { customRender: 'type' }, |
|
|
|
dataIndex: 'address', |
|
|
|
key: 'address', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '举办时间', |
|
|
|
title: '活动时间', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'time', |
|
|
|
key: 'time', |
|
|
|
scopedSlots: { customRender: 'time' }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '地点', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'place', |
|
|
|
key: 'place', |
|
|
|
scopedSlots: { customRender: 'place' }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '主讲人', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'speaker', |
|
|
|
key: 'speaker', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '发布状态', |
|
|
|
title: '公告简介', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'state', |
|
|
|
key: 'state', |
|
|
|
scopedSlots: { customRender: 'state' }, |
|
|
|
dataIndex: 'intro', |
|
|
|
key: 'intro', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '编辑', |
|
|
@ -113,45 +87,18 @@ const columns = [ |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
const lists = [ |
|
|
|
{ |
|
|
|
id:'001', |
|
|
|
plat:'传控科技', |
|
|
|
type: '路演', |
|
|
|
planTime: '2020/11/17 08:00 - 2020/11/18 19:00', |
|
|
|
realTime:'2020/11/17 08:00 - 2020/11/18 19:00', |
|
|
|
place:'太原', |
|
|
|
organizer: '张三', |
|
|
|
speaker: '李四', |
|
|
|
state: '发布', |
|
|
|
content:'团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:'002', |
|
|
|
plat:'中绿环保', |
|
|
|
type: '路演', |
|
|
|
planTime: '2020/11/17 08:00 - 2020/11/18 19:00', |
|
|
|
realTime:'2020/11/17 08:00 - 2020/11/18 19:00', |
|
|
|
place:'太原', |
|
|
|
organizer: '张三', |
|
|
|
speaker: '李四', |
|
|
|
state: '不发布', |
|
|
|
content:'团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介' |
|
|
|
} |
|
|
|
]; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "ActivityDate", |
|
|
|
components: { |
|
|
|
ActivityEdit, |
|
|
|
}, |
|
|
|
|
|
|
|
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, |
|
|
|
|
|
|
|
data() { |
|
|
|
this.cacheData = lists.map(item => ({ ...item })); |
|
|
|
return { |
|
|
|
columns, |
|
|
|
lists, |
|
|
|
loading: false, |
|
|
|
editingKey: '', |
|
|
|
height: '', |
|
|
|
editVisible: false, |
|
|
|
editItem: null, // 修改的那条 |
|
|
@ -159,7 +106,15 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150; |
|
|
|
let th = 250; |
|
|
|
let wh = window.innerHeight; |
|
|
|
this.height = wh - th; |
|
|
|
window.onresize = () => { |
|
|
|
return (() => { |
|
|
|
wh = window.innerHeight; |
|
|
|
this.height = wh - th; |
|
|
|
})(); |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
@ -169,24 +124,29 @@ export default { |
|
|
|
this.editVisible = true; |
|
|
|
}, |
|
|
|
|
|
|
|
closeModal(){ |
|
|
|
async closeModal(){ |
|
|
|
this.editVisible = false; |
|
|
|
await this.$emit('getBackendSearch'); |
|
|
|
}, |
|
|
|
|
|
|
|
handleTableChange(pagination) { |
|
|
|
const { current, pageSize } = pagination; |
|
|
|
const condition = { current, pageSize }; |
|
|
|
this.$emit('getBackendSearch', condition); |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除 |
|
|
|
async onDelete(teamId) { |
|
|
|
async onDelete(id) { |
|
|
|
try { |
|
|
|
// const params = { param: { teamId } }; |
|
|
|
// const res = await delTeam(params); |
|
|
|
// const { data, msg, code } = res.data; |
|
|
|
// if (code === 200) { |
|
|
|
// this.$message.success('删除成功'); |
|
|
|
// const arr = [...this.lists]; |
|
|
|
// this.lists = arr.filter(item => item.id !== teamId); |
|
|
|
// // TODO: 填到列表中 |
|
|
|
// } else { |
|
|
|
// throw msg; |
|
|
|
// } |
|
|
|
const params = {param : {id}}; |
|
|
|
const res = await deleteIndustryInfo(params); |
|
|
|
const {data,msg,code} = res.data; |
|
|
|
if(code === 200){ |
|
|
|
this.$message.success('删除成功'); |
|
|
|
this.$emit('getBackendSearch'); |
|
|
|
}else{ |
|
|
|
throw msg; |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
this.$message.error(error || '删除失败'); |
|
|
|
} |
|
|
|