23 changed files with 1583 additions and 724 deletions
@ -0,0 +1,184 @@ |
|||||
|
<template> |
||||
|
<div class="main flex-1"> |
||||
|
<a-spin :spinning="spinning"> |
||||
|
<div style="width:100%" v-if="lists && lists.length > 0"> |
||||
|
<a-table |
||||
|
:columns="columns" |
||||
|
:data-source="lists" |
||||
|
:loading="loading" |
||||
|
:pagination="pagination" |
||||
|
:row-key="record => record.id" |
||||
|
:scroll="{ y: height }" |
||||
|
@change="handleTableChange" |
||||
|
bordered |
||||
|
class="white" |
||||
|
> |
||||
|
<template slot="id" slot-scope="text, record, index"> |
||||
|
<span>{{ index + 1 }}</span> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 用户头像 --> |
||||
|
<template slot="avatarUrl" slot-scope="text, record"> |
||||
|
<img :src="record.avatarUrl" class="img" /> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 审核状态 --> |
||||
|
<template slot="comStatus" slot-scope="text, record"> |
||||
|
<a-tag |
||||
|
:color="record.comStatus === 0 ? 'green' : 'red'" |
||||
|
>{{ record.comStatus === 0 ? '正常' : '禁用' }}</a-tag> |
||||
|
</template> |
||||
|
|
||||
|
<template slot="examine" slot-scope="text, record"> |
||||
|
<a-button |
||||
|
@click="handleUpTopping({id:record.id,comStatus:0})" |
||||
|
size="small" |
||||
|
type="primary" |
||||
|
v-if="record.comStatus != 0" |
||||
|
>正常</a-button> |
||||
|
<a-button |
||||
|
@click="handleUpTopping({id:record.id,comStatus:1})" |
||||
|
size="small" |
||||
|
type="danger" |
||||
|
v-else |
||||
|
>禁用</a-button> |
||||
|
</template> |
||||
|
|
||||
|
<div |
||||
|
class="d-flex flex-column" |
||||
|
slot="expandedRowRender" |
||||
|
slot-scope="record" |
||||
|
style="margin: 0" |
||||
|
> |
||||
|
<div> |
||||
|
<span class="font-bold-14">帖子内容:</span> |
||||
|
<span v-dompurify-html="record.content" v-if="record.content"></span> |
||||
|
<span v-else>暂无内容</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</a-table> |
||||
|
</div> |
||||
|
<a-empty v-else /> |
||||
|
</a-spin> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { upTopping } from 'config/api'; |
||||
|
|
||||
|
const columns = [ |
||||
|
{ |
||||
|
title: '序号', |
||||
|
align: 'center', |
||||
|
dataIndex: 'id', |
||||
|
key: 'id', |
||||
|
width: '7%', |
||||
|
scopedSlots: { customRender: 'id' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '跟帖人', |
||||
|
align: 'center', |
||||
|
dataIndex: 'userName', |
||||
|
key: 'userName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '用户头像', |
||||
|
align: 'center', |
||||
|
dataIndex: 'avatarUrl', |
||||
|
key: 'avatarUrl', |
||||
|
scopedSlots: { customRender: 'avatarUrl' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '跟帖时间', |
||||
|
align: 'center', |
||||
|
dataIndex: 'creatTime', |
||||
|
key: 'creatTime', |
||||
|
}, |
||||
|
{ |
||||
|
title: '跟帖状态', |
||||
|
align: 'center', |
||||
|
dataIndex: 'comStatus', |
||||
|
key: 'comStatus', |
||||
|
scopedSlots: { customRender: 'comStatus' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '审核', |
||||
|
align: 'center', |
||||
|
dataIndex: 'examine', |
||||
|
key: 'examine', |
||||
|
scopedSlots: { customRender: 'examine' }, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
export default { |
||||
|
name: 'CommunityDate', |
||||
|
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, |
||||
|
data() { |
||||
|
return { |
||||
|
columns, |
||||
|
loading: false, |
||||
|
height: '', |
||||
|
spinning: false, |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
let th = 250; |
||||
|
let wh = window.innerHeight; |
||||
|
this.height = wh - th; |
||||
|
window.onresize = () => { |
||||
|
return (() => { |
||||
|
wh = window.innerHeight; |
||||
|
this.height = wh - th; |
||||
|
})(); |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 换页 |
||||
|
handleTableChange(pagination) { |
||||
|
const { current, pageSize } = pagination; |
||||
|
const condition = { current, pageSize }; |
||||
|
this.$emit('getSelectTeam', condition); |
||||
|
}, |
||||
|
|
||||
|
// 置顶/审核 |
||||
|
async handleUpTopping(options) { |
||||
|
try { |
||||
|
this.spinning = true; |
||||
|
const params = { param: { id: options.id } }; |
||||
|
if (options) { |
||||
|
if (options.comStatus !== null) { |
||||
|
params.param.comStatus = options.comStatus; |
||||
|
} |
||||
|
if (options.topping !== null) { |
||||
|
params.param.topping = options.topping; |
||||
|
} |
||||
|
} |
||||
|
const res = await upTopping(params); |
||||
|
const { data, msg, code } = res.data; |
||||
|
this.spinning = false; |
||||
|
if (code === 200) { |
||||
|
this.$message.success('修改成功'); |
||||
|
this.$emit('getSelectTeam'); |
||||
|
} else { |
||||
|
throw msg; |
||||
|
} |
||||
|
} catch (error) { |
||||
|
this.spinning = false; |
||||
|
this.$message.error(error || '修改失败'); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="stylus" scoped> |
||||
|
.main .img { |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.main .big_img { |
||||
|
width: 200px; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,53 @@ |
|||||
|
<template> |
||||
|
<div class="d-flex flex-wrap pb-3"> |
||||
|
<div> |
||||
|
<!-- 帖子状态 --> |
||||
|
<a-select |
||||
|
@change="handleChangeSelect('comStatus',$event)" |
||||
|
class="ml-3" |
||||
|
placeholder="跟帖状态" |
||||
|
style="width: 150px" |
||||
|
> |
||||
|
<a-select-option |
||||
|
:key="index" |
||||
|
:value="state.id" |
||||
|
v-for="(state, index) in items" |
||||
|
>{{ state.value }}</a-select-option> |
||||
|
</a-select> |
||||
|
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'ForumSearch', |
||||
|
data() { |
||||
|
return { |
||||
|
items: [ |
||||
|
{ id: 0, value: '正常' }, |
||||
|
{ id: 1, value: '禁用' }, |
||||
|
], |
||||
|
category: '', |
||||
|
}; |
||||
|
}, |
||||
|
methods: { |
||||
|
handleChangeSelect(type, value) { |
||||
|
this[type] = value; |
||||
|
}, |
||||
|
|
||||
|
// 搜索 |
||||
|
async handleTableChange() { |
||||
|
const { comStatus } = this; |
||||
|
// 传参 |
||||
|
const condition = { |
||||
|
comStatus, |
||||
|
}; |
||||
|
await this.$emit('getSelectTeam', condition); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<!-- Add "scoped" attribute to limit CSS to this component only --> |
||||
|
<style scoped lang="stylus"></style> |
@ -0,0 +1,255 @@ |
|||||
|
<template> |
||||
|
<div class="main flex-1"> |
||||
|
<a-spin :spinning="spinning"> |
||||
|
<div style="width:100%" v-if="lists && lists.length > 0"> |
||||
|
<a-table |
||||
|
:columns="columns" |
||||
|
:data-source="lists" |
||||
|
:loading="loading" |
||||
|
:pagination="pagination" |
||||
|
:row-key="record => record.id" |
||||
|
:scroll="{ y: height }" |
||||
|
@change="handleTableChange" |
||||
|
bordered |
||||
|
class="white" |
||||
|
> |
||||
|
<template slot="id" slot-scope="text, record, index"> |
||||
|
<span>{{ index + 1 }}</span> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 标题图片 --> |
||||
|
<template slot="visitLocation" slot-scope="text, record"> |
||||
|
<img :src="record.visitLocation" class="img" /> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 用户头像 --> |
||||
|
<template slot="avatarUrl" slot-scope="text, record"> |
||||
|
<img :src="record.avatarUrl" class="img" /> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 审核状态 --> |
||||
|
<template slot="comStatus" slot-scope="text, record"> |
||||
|
<a-tag |
||||
|
:color="record.comStatus === 0 ? 'green' : 'red'" |
||||
|
>{{ record.comStatus === 0 ? '正常' : '禁用' }}</a-tag> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 置顶 --> |
||||
|
<template slot="topping" slot-scope="text, record"> |
||||
|
<a-switch |
||||
|
:checked="text === 1" |
||||
|
@change="onChange($event,record.id)" |
||||
|
checked-children="是" |
||||
|
class="ml-4" |
||||
|
un-checked-children="否" |
||||
|
/> |
||||
|
</template> |
||||
|
|
||||
|
<template slot="examine" slot-scope="text, record"> |
||||
|
<a-button |
||||
|
@click="handleUpTopping({id:record.id,comStatus:0})" |
||||
|
size="small" |
||||
|
type="primary" |
||||
|
v-if="record.comStatus != 0" |
||||
|
>正常</a-button> |
||||
|
<a-button |
||||
|
@click="handleUpTopping({id:record.id,comStatus:1})" |
||||
|
size="small" |
||||
|
type="danger" |
||||
|
v-else |
||||
|
>禁用</a-button> |
||||
|
</template> |
||||
|
|
||||
|
<template slot="edit" slot-scope="text, record"> |
||||
|
<a-button @click="openComment(record.id)" size="small" type="primary">查看跟帖</a-button> |
||||
|
</template> |
||||
|
|
||||
|
<div |
||||
|
class="d-flex flex-column" |
||||
|
slot="expandedRowRender" |
||||
|
slot-scope="record" |
||||
|
style="margin: 0" |
||||
|
> |
||||
|
<div> |
||||
|
<span class="font-bold-14">帖子内容:</span> |
||||
|
<span v-dompurify-html="record.content" v-if="record.content"></span> |
||||
|
<span v-else>暂无内容</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</a-table> |
||||
|
</div> |
||||
|
<a-empty v-else /> |
||||
|
</a-spin> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { upTopping } from 'config/api'; |
||||
|
|
||||
|
const columns = [ |
||||
|
{ |
||||
|
title: '序号', |
||||
|
align: 'center', |
||||
|
dataIndex: 'id', |
||||
|
key: 'id', |
||||
|
width: '7%', |
||||
|
scopedSlots: { customRender: 'id' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '标题', |
||||
|
align: 'center', |
||||
|
dataIndex: 'title', |
||||
|
key: 'title', |
||||
|
}, |
||||
|
{ |
||||
|
title: '标题图片', |
||||
|
align: 'center', |
||||
|
dataIndex: 'visitLocation', |
||||
|
key: 'visitLocation', |
||||
|
scopedSlots: { customRender: 'visitLocation' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '发帖人', |
||||
|
align: 'center', |
||||
|
dataIndex: 'userName', |
||||
|
key: 'userName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '用户头像', |
||||
|
align: 'center', |
||||
|
dataIndex: 'avatarUrl', |
||||
|
key: 'avatarUrl', |
||||
|
scopedSlots: { customRender: 'avatarUrl' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '发布时间', |
||||
|
align: 'center', |
||||
|
dataIndex: 'createdTime', |
||||
|
key: 'createdTime', |
||||
|
}, |
||||
|
{ |
||||
|
title: '评论数', |
||||
|
align: 'center', |
||||
|
dataIndex: 'commentNum', |
||||
|
key: 'commentNum', |
||||
|
}, |
||||
|
{ |
||||
|
title: '置顶', |
||||
|
align: 'center', |
||||
|
dataIndex: 'topping', |
||||
|
key: 'topping', |
||||
|
scopedSlots: { customRender: 'topping' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '审核状态', |
||||
|
align: 'center', |
||||
|
dataIndex: 'comStatus', |
||||
|
key: 'comStatus', |
||||
|
scopedSlots: { customRender: 'comStatus' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '审核', |
||||
|
align: 'center', |
||||
|
dataIndex: 'examine', |
||||
|
key: 'examine', |
||||
|
scopedSlots: { customRender: 'examine' }, |
||||
|
}, |
||||
|
{ |
||||
|
title: '跟帖', |
||||
|
align: 'center', |
||||
|
dataIndex: 'edit', |
||||
|
key: 'edit', |
||||
|
scopedSlots: { customRender: 'edit' }, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
export default { |
||||
|
name: 'CommunityDate', |
||||
|
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, |
||||
|
data() { |
||||
|
return { |
||||
|
columns, |
||||
|
loading: false, |
||||
|
height: '', |
||||
|
imgVisible: false, |
||||
|
spinning: false, |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
let th = 250; |
||||
|
let wh = window.innerHeight; |
||||
|
this.height = wh - th; |
||||
|
window.onresize = () => { |
||||
|
return (() => { |
||||
|
wh = window.innerHeight; |
||||
|
this.height = wh - th; |
||||
|
})(); |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
onChange(checked, id) { |
||||
|
const index = this.lists.findIndex(item => item.id === id); |
||||
|
if (this.lists[index].topping === 1) { |
||||
|
const options = { id, topping: 0 }; |
||||
|
this.handleUpTopping(options); |
||||
|
} else { |
||||
|
const options = { id, topping: 1 }; |
||||
|
this.handleUpTopping(options); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 换页 |
||||
|
handleTableChange(pagination) { |
||||
|
const { current, pageSize } = pagination; |
||||
|
const condition = { current, pageSize }; |
||||
|
this.$emit('getSelectTeam', condition); |
||||
|
}, |
||||
|
|
||||
|
// 置顶/审核 |
||||
|
async handleUpTopping(options) { |
||||
|
try { |
||||
|
this.spinning = true; |
||||
|
const params = { param: { id: options.id } }; |
||||
|
if (options) { |
||||
|
if (options.comStatus !== null) { |
||||
|
params.param.comStatus = options.comStatus; |
||||
|
} |
||||
|
if (options.topping !== null) { |
||||
|
params.param.topping = options.topping; |
||||
|
} |
||||
|
} |
||||
|
const res = await upTopping(params); |
||||
|
const { data, msg, code } = res.data; |
||||
|
this.spinning = false; |
||||
|
if (code === 200) { |
||||
|
this.$message.success('修改成功'); |
||||
|
this.$emit('getSelectTeam'); |
||||
|
} else { |
||||
|
throw msg; |
||||
|
} |
||||
|
} catch (error) { |
||||
|
this.spinning = false; |
||||
|
this.$message.error(error || '修改失败'); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 跟帖 |
||||
|
openComment(id) { |
||||
|
const { query } = this.$route; |
||||
|
this.$router.push({ path: `/comment?id=${id}`, query }); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="stylus" scoped> |
||||
|
.main .img { |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.main .big_img { |
||||
|
width: 200px; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,74 @@ |
|||||
|
<template> |
||||
|
<div class="d-flex flex-wrap pb-3"> |
||||
|
<div> |
||||
|
<!-- 标题 --> |
||||
|
<a-input class="ml-3" placeholder="标题" style="width: 150px" v-model="title" /> |
||||
|
<!-- 发帖类别 --> |
||||
|
<a-select |
||||
|
@change="handleChangeSelect('category',$event)" |
||||
|
class="ml-3" |
||||
|
placeholder="发帖类别" |
||||
|
style="width: 150px" |
||||
|
> |
||||
|
<a-select-option :key="state.id" :value="state.id" v-for="state in status">{{ state.value }}</a-select-option> |
||||
|
</a-select> |
||||
|
<!-- 帖子状态 --> |
||||
|
<a-select |
||||
|
@change="handleChangeSelect('comStatus',$event)" |
||||
|
class="ml-3" |
||||
|
placeholder="帖子状态" |
||||
|
style="width: 150px" |
||||
|
> |
||||
|
<a-select-option |
||||
|
:key="index" |
||||
|
:value="state.id" |
||||
|
v-for="(state, index) in items" |
||||
|
>{{ state.value }}</a-select-option> |
||||
|
</a-select> |
||||
|
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'ForumSearch', |
||||
|
data() { |
||||
|
return { |
||||
|
title: '', |
||||
|
items: [ |
||||
|
{ id: 0, value: '正常' }, |
||||
|
{ id: 1, value: '禁用' }, |
||||
|
], |
||||
|
comStatus: '', |
||||
|
status: [ |
||||
|
{ id: 0, value: '主题论坛' }, |
||||
|
{ id: 1, value: '创新社区' }, |
||||
|
{ id: 2, value: '孵化社区' }, |
||||
|
{ id: 3, value: '产业社区' }, |
||||
|
], |
||||
|
category: '', |
||||
|
}; |
||||
|
}, |
||||
|
methods: { |
||||
|
handleChangeSelect(type, value) { |
||||
|
this[type] = value; |
||||
|
}, |
||||
|
|
||||
|
// 搜索 |
||||
|
async handleTableChange() { |
||||
|
const { title, comStatus, category } = this; |
||||
|
// 传参 |
||||
|
const condition = { |
||||
|
title, |
||||
|
comStatus, |
||||
|
category, |
||||
|
}; |
||||
|
await this.$emit('getSelectTeam', condition); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<!-- Add "scoped" attribute to limit CSS to this component only --> |
||||
|
<style scoped lang="stylus"></style> |
@ -1,172 +0,0 @@ |
|||||
<template> |
|
||||
<div class="main flex-1"> |
|
||||
<div style="width:100%" v-if="lists && lists.length > 0"> |
|
||||
<a-table |
|
||||
:columns="columns" |
|
||||
:data-source="lists" |
|
||||
:loading="loading" |
|
||||
:row-key="record => record.id" |
|
||||
bordered |
|
||||
class="white" |
|
||||
> |
|
||||
<template slot="id" slot-scope="text, record, index"> |
|
||||
<span>{{ index + 1 }}</span> |
|
||||
</template> |
|
||||
|
|
||||
<!-- 置顶 --> |
|
||||
<template slot="topping" slot-scope="text, record"> |
|
||||
<a-switch checked-children="是" class="ml-4" default-checked un-checked-children="否" /> |
|
||||
</template> |
|
||||
|
|
||||
<!-- 审核状态 --> |
|
||||
<template slot="auditStatus" slot-scope="text, record"> |
|
||||
<a-tag :color="record.auditStatus === '通过' ? 'green' : 'red'">{{ record.auditStatus }}</a-tag> |
|
||||
</template> |
|
||||
|
|
||||
<template slot="examine" slot-scope="text, record"> |
|
||||
<a-button size="small" type="primary" v-if="record.auditStatus != '通过'">通过</a-button> |
|
||||
<a-button size="small" type="danger" v-else>不通过</a-button> |
|
||||
</template> |
|
||||
</a-table> |
|
||||
</div> |
|
||||
<a-empty v-else /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
const columns = [ |
|
||||
{ |
|
||||
title: '序号', |
|
||||
align: 'center', |
|
||||
dataIndex: 'id', |
|
||||
key: 'id', |
|
||||
width: '7%', |
|
||||
scopedSlots: { customRender: 'id' }, |
|
||||
}, |
|
||||
{ |
|
||||
title: '标题', |
|
||||
align: 'center', |
|
||||
dataIndex: 'title', |
|
||||
key: 'title', |
|
||||
}, |
|
||||
{ |
|
||||
title: '发帖人', |
|
||||
align: 'center', |
|
||||
dataIndex: 'postedBy', |
|
||||
key: 'postedBy', |
|
||||
}, |
|
||||
{ |
|
||||
title: '板块', |
|
||||
align: 'center', |
|
||||
dataIndex: 'plate', |
|
||||
key: 'plate', |
|
||||
}, |
|
||||
{ |
|
||||
title: '置顶', |
|
||||
align: 'center', |
|
||||
dataIndex: 'topping', |
|
||||
key: 'topping', |
|
||||
scopedSlots: { customRender: 'topping' }, |
|
||||
}, |
|
||||
{ |
|
||||
title: '审核状态', |
|
||||
align: 'center', |
|
||||
dataIndex: 'auditStatus', |
|
||||
key: 'auditStatus', |
|
||||
scopedSlots: { customRender: 'auditStatus' }, |
|
||||
}, |
|
||||
{ |
|
||||
title: '发布时间', |
|
||||
align: 'center', |
|
||||
dataIndex: 'releaseTime', |
|
||||
key: 'releaseTime', |
|
||||
scopedSlots: { customRender: 'releaseTime' }, |
|
||||
}, |
|
||||
{ |
|
||||
title: '审核', |
|
||||
align: 'center', |
|
||||
dataIndex: 'examine', |
|
||||
key: 'examine', |
|
||||
scopedSlots: { customRender: 'examine' }, |
|
||||
}, |
|
||||
]; |
|
||||
|
|
||||
const lists = [ |
|
||||
{ |
|
||||
id:'001', |
|
||||
title:'传控科技', |
|
||||
postedBy: '张三', |
|
||||
plate:'一', |
|
||||
topping: 5, |
|
||||
auditStatus: '通过', |
|
||||
releaseTime: '2020/11/18 18:00', |
|
||||
}, |
|
||||
{ |
|
||||
id:'002', |
|
||||
title:'中绿环保', |
|
||||
postedBy: '张三', |
|
||||
plate:'二', |
|
||||
topping: 6, |
|
||||
auditStatus: '未通过', |
|
||||
releaseTime: '2020/11/18 18:00', |
|
||||
} |
|
||||
]; |
|
||||
|
|
||||
export default { |
|
||||
name: "ForumDate", |
|
||||
data() { |
|
||||
this.cacheData = lists.map(item => ({ ...item })); |
|
||||
return { |
|
||||
columns, |
|
||||
lists, |
|
||||
loading: false, |
|
||||
height: '', |
|
||||
editVisible: false, |
|
||||
imgVisible: false, |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
mounted() { |
|
||||
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150; |
|
||||
}, |
|
||||
|
|
||||
methods: { |
|
||||
showEditModal(){ |
|
||||
this.editVisible = true; |
|
||||
}, |
|
||||
|
|
||||
closeModal(){ |
|
||||
this.editVisible = false; |
|
||||
}, |
|
||||
|
|
||||
// 删除 |
|
||||
async onDelete(teamId) { |
|
||||
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; |
|
||||
// } |
|
||||
} catch (error) { |
|
||||
this.$message.error(error || '删除失败'); |
|
||||
} |
|
||||
}, |
|
||||
}, |
|
||||
}; |
|
||||
</script> |
|
||||
|
|
||||
<style lang="stylus" scoped> |
|
||||
.main .img { |
|
||||
width: 100%; |
|
||||
} |
|
||||
|
|
||||
.main .big_img { |
|
||||
width: 200px; |
|
||||
} |
|
||||
</style> |
|
@ -1,96 +0,0 @@ |
|||||
<template> |
|
||||
<div class="d-flex flex-wrap pb-3"> |
|
||||
<div> |
|
||||
<!-- 板块 --> |
|
||||
<a-input |
|
||||
@change="handleChange('plate',$event)" |
|
||||
placeholder="板块" |
|
||||
style="width: 150px" |
|
||||
v-model="plate" |
|
||||
/> |
|
||||
<!-- 标题 --> |
|
||||
<a-input |
|
||||
@change="handleChange('title',$event)" |
|
||||
class="ml-3" |
|
||||
placeholder="标题" |
|
||||
style="width: 150px" |
|
||||
v-model="title" |
|
||||
/> |
|
||||
<!-- 置顶 --> |
|
||||
<a-select |
|
||||
@change="handleChangeSelect('topping',$event)" |
|
||||
class="ml-3" |
|
||||
default-value="置顶" |
|
||||
style="width: 150px" |
|
||||
> |
|
||||
<a-select-option |
|
||||
:key="index" |
|
||||
:value="topping" |
|
||||
v-for="(topping, index) in items" |
|
||||
>{{ topping }}</a-select-option> |
|
||||
</a-select> |
|
||||
<!-- 审核 --> |
|
||||
<a-select |
|
||||
@change="handleChangeSelect('state',$event)" |
|
||||
class="ml-3" |
|
||||
default-value="审核通过" |
|
||||
style="width: 150px" |
|
||||
> |
|
||||
<a-select-option |
|
||||
:key="state.id" |
|
||||
:value="state.value" |
|
||||
v-for="state in status" |
|
||||
>{{ state.value }}</a-select-option> |
|
||||
</a-select> |
|
||||
<!-- 发布时间 --> |
|
||||
<a-range-picker @change="onChange" class="ml-3" format="YYYY/MM/DD HH:mm:ss" show-time /> |
|
||||
<a-button @click="handleSearch" class="ml-3" type="primary">搜索</a-button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
export default { |
|
||||
name: "ForumSearch", |
|
||||
data() { |
|
||||
return { |
|
||||
plate: '', |
|
||||
title: '', |
|
||||
items: ['置顶','不置顶'], |
|
||||
topping: '', |
|
||||
status: [ |
|
||||
{ id:1, value:'审核通过' }, |
|
||||
{ id:2, value:'审核未通过' } |
|
||||
], |
|
||||
state: '', |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
handleChange(type, e) { |
|
||||
this[type] = e.target.value; |
|
||||
}, |
|
||||
|
|
||||
handleChangeSelect(type, value) { |
|
||||
this[type] = value; |
|
||||
}, |
|
||||
|
|
||||
// 发布时间 |
|
||||
onChange(dates, dateStrings) { |
|
||||
console.log('From: ', dates[0], ', to: ', dates[1]); |
|
||||
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); |
|
||||
}, |
|
||||
|
|
||||
// 搜索 |
|
||||
handleSearch(){ |
|
||||
console.log('搜索'); |
|
||||
console.log('plate',this.plate); |
|
||||
console.log('title',this.title); |
|
||||
console.log('topping',this.topping); |
|
||||
console.log('state',this.state); |
|
||||
} |
|
||||
}, |
|
||||
}; |
|
||||
</script> |
|
||||
|
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only --> |
|
||||
<style scoped lang="stylus"></style> |
|
@ -0,0 +1,71 @@ |
|||||
|
<template> |
||||
|
<div class="pa-3 white fill-height d-flex flex-column"> |
||||
|
<comment-search @getSelectTeam="getSelectTeam" /> |
||||
|
<comment-date :lists="lists" :pagination="pagination" @getSelectTeam="getSelectTeam" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import CommentSearch from 'components/Community/CommentSearch.vue'; |
||||
|
import CommentDate from 'components/Community/CommentDate.vue'; |
||||
|
import { selCommunityH } from 'config/api'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'CommunicationCommunity', |
||||
|
components: { |
||||
|
CommentSearch, |
||||
|
CommentDate, |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
lists: [], |
||||
|
pagination: { current: 1, pageSize: 10 }, |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
created() { |
||||
|
this.getSelectTeam(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
/** |
||||
|
* 发帖查询 |
||||
|
* @param { String } category 发帖类别 |
||||
|
* @param { String } comStatus 帖子状态 |
||||
|
* @param { String } title 发帖标题 |
||||
|
*/ |
||||
|
async getSelectTeam(condition) { |
||||
|
try { |
||||
|
const { query } = this.$route; |
||||
|
const params = { |
||||
|
param: { |
||||
|
commentId: query.id, |
||||
|
pageNum: (condition && condition.current) || 1, |
||||
|
pageSize: (condition && condition.pageSize) || 10, |
||||
|
}, |
||||
|
}; |
||||
|
if (condition) { |
||||
|
if (condition.comStatus !== '') { |
||||
|
params.param.comStatus = condition.comStatus; |
||||
|
} |
||||
|
} |
||||
|
const res = await selCommunityH(params); |
||||
|
const { code, msg, data } = res.data; |
||||
|
if (code === 200) { |
||||
|
this.lists = data.list; |
||||
|
const paper = { ...this.pagination }; |
||||
|
paper.current = data.pageNum; |
||||
|
paper.total = +data.total; |
||||
|
paper.pageSize = data.pageSize; |
||||
|
this.pagination = paper; |
||||
|
} else { |
||||
|
throw msg || '获取失败'; |
||||
|
} |
||||
|
} catch (error) { |
||||
|
this.$message.error(error); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
@ -1,19 +1,75 @@ |
|||||
<template> |
<template> |
||||
<div class="pa-3 white fill-height d-flex flex-column"> |
<div class="pa-3 white fill-height d-flex flex-column"> |
||||
<forum-search /> |
<community-search @getSelectTeam="getSelectTeam" /> |
||||
<forum-date /> |
<community-date :lists="lists" :pagination="pagination" @getSelectTeam="getSelectTeam" /> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import ForumSearch from 'components/Forum/ForumSearch.vue'; |
import CommunitySearch from 'components/Community/CommunitySearch.vue'; |
||||
import ForumDate from 'components/Forum/ForumDate.vue'; |
import CommunityDate from 'components/Community/CommunityDate.vue'; |
||||
|
import { selCommentH } from 'config/api'; |
||||
|
|
||||
export default { |
export default { |
||||
name: 'ForumManage', |
name: 'CommunicationCommunity', |
||||
components: { |
components: { |
||||
ForumSearch, |
CommunitySearch, |
||||
ForumDate, |
CommunityDate, |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
lists: [], |
||||
|
pagination: { current: 1, pageSize: 10 }, |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
created() { |
||||
|
this.getSelectTeam(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
/** |
||||
|
* 发帖查询 |
||||
|
* @param { String } category 发帖类别 |
||||
|
* @param { String } comStatus 帖子状态 |
||||
|
* @param { String } title 发帖标题 |
||||
|
*/ |
||||
|
async getSelectTeam(condition) { |
||||
|
try { |
||||
|
const params = { |
||||
|
param: { |
||||
|
pageNum: (condition && condition.current) || 1, |
||||
|
pageSize: (condition && condition.pageSize) || 10, |
||||
|
}, |
||||
|
}; |
||||
|
if (condition) { |
||||
|
if (condition.title) { |
||||
|
params.param.title = condition.title; |
||||
|
} |
||||
|
if (condition.comStatus !== '') { |
||||
|
params.param.comStatus = condition.comStatus; |
||||
|
} |
||||
|
if (condition.category !== '') { |
||||
|
params.param.category = condition.category; |
||||
|
} |
||||
|
} |
||||
|
const res = await selCommentH(params); |
||||
|
const { code, msg, data } = res.data; |
||||
|
if (code === 200) { |
||||
|
this.lists = data.list; |
||||
|
const paper = { ...this.pagination }; |
||||
|
paper.current = data.pageNum; |
||||
|
paper.total = +data.total; |
||||
|
paper.pageSize = data.pageSize; |
||||
|
this.pagination = paper; |
||||
|
} else { |
||||
|
throw msg || '获取失败'; |
||||
|
} |
||||
|
} catch (error) { |
||||
|
this.$message.error(error); |
||||
|
} |
||||
|
}, |
||||
}, |
}, |
||||
}; |
}; |
||||
</script> |
</script> |
||||
|
@ -0,0 +1,79 @@ |
|||||
|
<template> |
||||
|
<div class="pa-3 white fill-height d-flex flex-column"> |
||||
|
<activity-search @getBackendSearch="getBackendSearch" /> |
||||
|
<activity-date :lists="lists" :pagination="pagination" @getBackendSearch="getBackendSearch" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import ActivitySearch from 'components/IndustryInfo/ActivitySearch.vue'; |
||||
|
import ActivityDate from 'components/IndustryInfo/ActivityDate.vue'; |
||||
|
import { getBackendSearch } from 'config/api'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'ActivityBulletin', |
||||
|
components: { |
||||
|
ActivitySearch, |
||||
|
ActivityDate, |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
lists: [], |
||||
|
pagination: { current: 1, pageSize: 10 }, |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
created() { |
||||
|
this.getBackendSearch(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
/** |
||||
|
* 根据团队id查看研发团队相关信息 |
||||
|
* @param { String } competeTimeId 第几届信息的id |
||||
|
*/ |
||||
|
async getBackendSearch(condition) { |
||||
|
try { |
||||
|
const params = { |
||||
|
param: { |
||||
|
pageNum: (condition && condition.current) || 1, |
||||
|
pageSize: (condition && condition.pageSize) || 10, |
||||
|
}, |
||||
|
}; |
||||
|
if (condition) { |
||||
|
if (condition.title) { |
||||
|
params.param.title = condition.title; |
||||
|
} |
||||
|
if (condition.spreadDepartment) { |
||||
|
params.param.spreadDepartment = condition.spreadDepartment; |
||||
|
} |
||||
|
if (condition.startTime) { |
||||
|
params.param.startTime = condition.startTime; |
||||
|
} |
||||
|
if (condition.endTime) { |
||||
|
params.param.endTime = condition.endTime; |
||||
|
} |
||||
|
if (condition.site) { |
||||
|
params.param.site = condition.site; |
||||
|
} |
||||
|
} |
||||
|
const res = await getBackendSearch(params); |
||||
|
const { code, msg, data } = res.data; |
||||
|
if (code === 200) { |
||||
|
this.lists = data.list; |
||||
|
const paper = { ...this.pagination }; |
||||
|
paper.current = data.pageNum; |
||||
|
paper.total = +data.total; |
||||
|
paper.pageSize = data.pageSize; |
||||
|
this.pagination = paper; |
||||
|
} else { |
||||
|
throw msg || '获取失败'; |
||||
|
} |
||||
|
} catch (error) { |
||||
|
this.$message.error(error); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
Loading…
Reference in new issue