|
|
@ -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,6 +16,10 @@ |
|
|
|
<span>{{ index + 1 }}</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="time" slot-scope="text, record"> |
|
|
|
<span v-if="record.releaseTime">{{ record.releaseTime}}</span><span v-if="record.releaseTime">-{{record.releaseTime}}</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"> |
|
|
@ -21,7 +28,8 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<div slot="expandedRowRender" slot-scope="record" style="margin: 0"> |
|
|
|
<div>详情:{{ record.content }}</div> |
|
|
|
<div>详情: |
|
|
|
<span v-dompurify-html="record.content"></span></div> |
|
|
|
</div> |
|
|
|
</a-table> |
|
|
|
</div> |
|
|
@ -34,7 +42,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import ActivityEdit from "components/Activity/ActivityEdit.vue"; |
|
|
|
// import { delTeam } from 'config/api'; |
|
|
|
import { deleteIndustryInfo } from 'config/api'; |
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
@ -44,35 +52,30 @@ const columns = [ |
|
|
|
key: 'id', |
|
|
|
scopedSlots: { customRender: 'id' }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '标题', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'title', |
|
|
|
key: 'title', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '简介', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'description', |
|
|
|
key: 'description', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '地点', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'site', |
|
|
|
key: 'site', |
|
|
|
dataIndex: 'address', |
|
|
|
key: 'address', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '发布部门', |
|
|
|
title: '活动时间', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'spreadDepartment', |
|
|
|
key: 'spreadDepartment', |
|
|
|
dataIndex: 'time', |
|
|
|
key: 'time', |
|
|
|
scopedSlots: { customRender: 'time' }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '时间', |
|
|
|
title: '公告简介', |
|
|
|
align: 'center', |
|
|
|
dataIndex: 'time', |
|
|
|
key: 'time', |
|
|
|
dataIndex: 'intro', |
|
|
|
key: 'intro', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '编辑', |
|
|
@ -90,10 +93,9 @@ export default { |
|
|
|
ActivityEdit, |
|
|
|
}, |
|
|
|
|
|
|
|
props: { lists: { type: Array, default: () => [] } }, |
|
|
|
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, |
|
|
|
|
|
|
|
data() { |
|
|
|
this.cacheData = this.lists.map(item => ({ ...item })); |
|
|
|
return { |
|
|
|
columns, |
|
|
|
loading: false, |
|
|
@ -104,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: { |
|
|
@ -114,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 || '删除失败'); |
|
|
|
} |
|
|
|