Browse Source

创新政策,交流社区接口对接

master
lucky 4 years ago
parent
commit
2a260917f8
  1. 2
      src/components/Activity/ActivityDate.vue
  2. 3
      src/components/BtnCom/BtnCon.vue
  3. 184
      src/components/Community/CommentDate.vue
  4. 53
      src/components/Community/CommentSearch.vue
  5. 255
      src/components/Community/CommunityDate.vue
  6. 74
      src/components/Community/CommunitySearch.vue
  7. 172
      src/components/Forum/ForumDate.vue
  8. 96
      src/components/Forum/ForumSearch.vue
  9. 159
      src/components/Policy/PolicyAdd.vue
  10. 3
      src/components/Policy/PolicyDate.vue
  11. 163
      src/components/Policy/PolicyEdit.vue
  12. 5
      src/components/Policy/PolicySearch.vue
  13. 13
      src/config/api.js
  14. 18
      src/router/index.js
  15. 71
      src/views/CommunicationCommunity/Comment.vue
  16. 70
      src/views/CommunicationCommunity/CommunicationCommunity.vue
  17. 79
      src/views/CooperativePartner/CooperativePartner.vue

2
src/components/Activity/ActivityDate.vue

@ -110,7 +110,7 @@
<span v-if="record.intro">{{ record.intro }}</span>
<span v-else>暂无内容</span>
</div>
<div v-if="record.info && record.intro">
<div>
<span class="font-bold-14">详情</span>
<span v-dompurify-html="record.info.content" v-if="record.info.content"></span>
<span v-else>暂无内容</span>

3
src/components/BtnCom/BtnCon.vue

@ -9,6 +9,8 @@
<div @click="jump('/event-announcement')" class="btn">活动公告</div>
<div @click="jump('/innovation-policy')" class="btn">创新政策</div>
<div @click="jump('/talent-recruitment')" class="btn">人才招聘</div>
<div @click="jump('/cooperative-partner')" class="btn">合作伙伴</div>
<div @click="jump('/derivative-enterprise')" class="btn">衍生企业</div>
<div class="font-bold-24">创新部</div>
<div @click="jump('/cooperation-intention')" class="btn">合作意向</div>
@ -24,6 +26,7 @@
<div @click="jump('/virtual-application')" class="btn">入驻虚拟申请</div>
<div @click="jump('/incubation-services')" class="btn">服务</div>
<div @click="jump('/entrepreneurial-mentor')" class="btn">需求填报</div>
<div @click="jump('/cooperative-partner')" class="btn">合作伙伴</div>
<div class="font-bold-24">产业部</div>
<div @click="jump('/industrial-services')" class="btn">服务</div>

184
src/components/Community/CommentDate.vue

@ -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>

53
src/components/Community/CommentSearch.vue

@ -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>

255
src/components/Community/CommunityDate.vue

@ -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>

74
src/components/Community/CommunitySearch.vue

@ -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>

172
src/components/Forum/ForumDate.vue

@ -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>

96
src/components/Forum/ForumSearch.vue

@ -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>

159
src/components/Policy/PolicyAdd.vue

@ -32,7 +32,7 @@
<a-input
placeholder="发布部门"
v-decorator="[
'department',
'pushDep',
{
rules: [
{ required: true, message: '发布部门不能为空' },
@ -48,80 +48,46 @@
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="发布时间"
required
>
<a-date-picker
@change="onChange"
format="YYYY/MM/DD HH:mm:ss"
show-time
style="width:100%"
/>
</a-form-item>
<!-- 截止时间 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="截止时间"
>
<a-date-picker
@change="onChange"
format="YYYY/MM/DD HH:mm:ss"
show-time
style="width:100%"
/>
<a-date-picker @change="onChange" format="YYYY-MM-DD" show-time style="width:100%" />
</a-form-item>
<!-- 政策类型 -->
<!-- 审核状态 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="政策类型"
label="审核状态"
required
>
<a-select @change="getType" placeholder="政策类型" style="width: 200px">
<a-select @change="getStatus" placeholder="审核状态" style="width: 200px">
<a-select-option
:key="index"
:value="policyType"
v-for="(policyType, index) in types"
>{{ policyType }}</a-select-option>
:value="item.id"
v-for="(item, index) in applyStatus"
>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<!-- 标签 -->
<!-- 原文链接 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="标签"
label="原文链接"
>
<a-input
placeholder="标签"
placeholder="原文链接"
v-decorator="[
'tag',
{
rules: [
{ required: true, message: '标签不能为空' },
{ whitespace: true, message: '标签不能为空' },
{ max: 6, massage: '标签最多6个字符' },
],
},
'url',
]"
/>
</a-form-item>
<!-- 原文链接 -->
<!-- 政策内容 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="原文链接"
label="政策内容"
required
>
<a-input
placeholder="原文链接"
v-decorator="[
'link',
{
rules: [
{ required: true, message: '原文链接不能为空' },
{ whitespace: true, message: '原文链接不能为空' },
{ max: 140, massage: '原文链接最多140个字符' },
],
},
]"
/>
<quill-editor :max-size="maxSize" :placeholder="placeholder" @changeInput="changeInput" />
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
@ -134,38 +100,69 @@
</template>
<script>
// import { addTeam } from 'config/api'
import { addPolicy } from 'config/api';
import QuillEditor from 'components/QuillEditor/QuillEditor.vue';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "PolicyAdd",
name: 'PolicyAdd',
props: { visible: { type: Boolean, default: false } },
components: { QuillEditor },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
releaseTime: '',
deadline: '',
types: ['单选框','多选框','富文本框'],
policyType: '',
value: 1
}
form: this.$form.createForm(this, { name: 'policy-edit' }),
applyStatus: [
{ id: 0, name: '审核中' },
{ id: 1, name: '未通过' },
{ id: 2, name: '已通过' },
],
status: null,
maxSize: 2048,
content: '',
placeholder: '请输入...',
pushTime: '', //
};
},
methods: {
//
getType(value){
this.policyType = value;
//
getStatus(value) {
console.log('value: ', value);
this.status = value;
},
//
changeInput(value) {
this.content = value;
},
//
onChange(date, dateString) {
console.log(date, dateString);
this.pushTime = dateString;
},
//
onChange(dates, dateStrings) {
console.log('From: ', dates[0], ', to: ', dates[1]);
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
//
verification() {
if (!this.pushTime) {
this.$message.error('发布时间不能为空');
return false;
}
if (this.status === null) {
this.$message.error('审核状态不能为空');
return false;
}
if (!this.content) {
this.$message.error('政策内容不能为空');
return false;
}
return true;
},
//
@ -174,16 +171,22 @@ export default {
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
// const params = { param: values };
// const res = await addTeam(params);
// const { data, msg, code } = res.data;
// this.$emit('closeModal');
// if (code === 200) {
// this.$message.success('')
// // TODO:
// } else {
// throw msg;
// }
if (!this.verification()) return;
const { pushTime, status, content } = this;
const params = { param: values };
params.param.pushTime = pushTime;
params.param.status = status;
params.param.content = content;
console.log('params: ', params);
const res = await addPolicy(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('添加成功');
this.$emit('closeModal');
} else {
this.$emit('closeModal');
throw msg;
}
} catch (error) {
this.$message.error(error || '添加失败');
}

3
src/components/Policy/PolicyDate.vue

@ -213,8 +213,9 @@ export default {
this.editVisible = true;
},
closeModal() {
async closeModal() {
this.editVisible = false;
await this.$emit('getSelectTeam');
},
//

163
src/components/Policy/PolicyEdit.vue

@ -1,8 +1,8 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal :closable="false" footer title="修改创新挑战" v-model="editVisible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<a-modal :closable="false" footer title="修改创新政策" v-model="editVisible" width="700px">
<a-form :form="form" @submit="handleSubmit" v-if="editVisible && editItem">
<!-- 标题 -->
<a-form-item
:label-col="formItemLayout.labelCol"
@ -14,6 +14,7 @@
v-decorator="[
'title',
{
initialValue: editItem.title,
rules: [
{ required: true, message: '标题不能为空' },
{ whitespace: true, message: '标题不能为空' },
@ -32,8 +33,9 @@
<a-input
placeholder="发布部门"
v-decorator="[
'department',
'pushDep',
{
initialValue: editItem.publishDepartName,
rules: [
{ required: true, message: '发布部门不能为空' },
{ whitespace: true, message: '发布部门不能为空' },
@ -48,60 +50,50 @@
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="发布时间"
required
>
<a-date-picker
@change="onChange"
format="YYYY/MM/DD HH:mm:ss"
show-time
style="width:100%"
/>
</a-form-item>
<!-- 截止时间 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="截止时间"
>
<a-date-picker
@change="onChange"
format="YYYY/MM/DD HH:mm:ss"
format="YYYY-MM-DD"
show-time
style="width:100%"
v-decorator="[
'pushTime',
{
initialValue: editItem.publishTime,
rules: [
{ required: true, message: '发布时间不能为空' },
],
},
]"
/>
</a-form-item>
<!-- 政策类型 -->
<!-- 审核状态 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="政策类型"
label="审核状态"
>
<a-select @change="getType" placeholder="政策类型" style="width: 200px">
<a-select-option
:key="index"
:value="policyType"
v-for="(policyType, index) in types"
>{{ policyType }}</a-select-option>
</a-select>
</a-form-item>
<!-- 标签 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="标签"
>
<a-input
placeholder="标签"
<a-select
@change="getStatus"
placeholder="审核状态"
style="width: 200px"
v-decorator="[
'tag',
'status',
{
initialValue: editItem.status,
rules: [
{ required: true, message: '标签不能为空' },
{ whitespace: true, message: '标签不能为空' },
{ max: 6, massage: '标签最多6个字符' },
{ required: true, message: '审核状态不能为空' },
],
},
]"
/>
>
<a-select-option
:key="index"
:value="item.id"
v-for="(item, index) in applyStatus"
>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<!-- 原文链接 -->
<a-form-item
@ -112,17 +104,27 @@
<a-input
placeholder="原文链接"
v-decorator="[
'link',
'url',
{
rules: [
{ required: true, message: '原文链接不能为空' },
{ whitespace: true, message: '原文链接不能为空' },
{ max: 140, massage: '原文链接最多140个字符' },
],
initialValue: editItem.titleUrl,
},
]"
/>
</a-form-item>
<!-- 政策内容 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="政策内容"
required
>
<quill-editor
:max-size="maxSize"
:placeholder="placeholder"
:value="(editItem && editItem.content) ? editItem.content : content"
@changeInput="changeInput"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
@ -134,7 +136,8 @@
</template>
<script>
// import { upTeam } from 'config/api';
import { addPolicy } from 'config/api';
import QuillEditor from 'components/QuillEditor/QuillEditor.vue';
const formItemLayout = {
labelCol: { span: 6 },
@ -144,31 +147,42 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "PolicyEdit",
props: { editVisible: { type: Boolean, default: false },editItem: { type: Object, default: () => {} } },
name: 'PolicyEdit',
props: { editVisible: { type: Boolean, default: false }, editItem: { type: Object, default: () => {} } },
components: { QuillEditor },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
releaseTime: '',
deadline: '',
types: ['单选框','多选框','富文本框'],
policyType: '',
value: 1
}
form: this.$form.createForm(this, { name: 'policy-edit' }),
applyStatus: [
{ id: 0, name: '审核中' },
{ id: 1, name: '未通过' },
{ id: 2, name: '已通过' },
],
status: null,
maxSize: 2048,
content: '',
placeholder: '请输入...',
pushTime: '', //
};
},
methods: {
//
getType(value){
this.policyType = value;
getStatus(value) {
this.status = value;
},
//
changeInput(value) {
this.content = value;
},
//
onChange(dates, dateStrings) {
console.log('From: ', dates[0], ', to: ', dates[1]);
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
//
onChange(date, dateString) {
console.log(date, dateString);
this.pushTime = dateString;
},
//
@ -177,16 +191,21 @@ export default {
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
// const params = { param: values };
// const res = await upTeam(params);
// const { data, msg, code } = res.data;
// this.$emit('closeModal');
// if (code === 200) {
// this.$message.success('')
// // TODO:
// } else {
// throw msg;
// }
const { pushTime, status, content, editItem } = this;
const params = { param: values };
params.param.id = editItem.id;
params.param.pushTime = pushTime || editItem.publishTime;
params.param.status = status || editItem.status;
params.param.content = content || editItem.content;
const res = await addPolicy(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.$emit('closeModal');
} else {
this.$emit('closeModal');
throw msg;
}
} catch (error) {
this.$message.error(error || '修改失败');
}

5
src/components/Policy/PolicySearch.vue

@ -17,7 +17,7 @@
<a-range-picker
@change="onChangeTime"
class="ml-3 mb-3 flex-1"
format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD"
show-time
/>
</div>
@ -87,8 +87,9 @@ export default {
this.visible = true;
},
closeModal() {
async closeModal() {
this.visible = false;
await this.$emit('getSelectTeam');
},
//

13
src/config/api.js

@ -16,6 +16,7 @@ const creatingPlatform = `${greenvalley}/creatingPlatform`; // 合作意向相
const serviceProject = `${greenvalley}/serviceProject`; // 创新部服务相关操作
const institute = `${greenvalley}/institute`; // 实验室(研究院)相关操作
const achInstr = `${greenvalley}/achInstr`; // 创新部类型相关操作
const comment = `${greenvalley}/comment`; // 交流社区相关操作
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -77,6 +78,18 @@ export const selLikePolicyBack = params => axios.post(`${policy}/policy/selLikeP
// 政策审批
export const upPolicy = params => axios.post(`${policy}/policy/upPolicy`, params);
// 增加/修改一条政策
export const addPolicy = params => axios.post(`${policy}/policy/addPolicy`, params);
// 发帖查询
export const selCommentH = params => axios.post(`${comment}/selCommentH`, params);
// 置顶和取消置顶帖子。修改发帖内容,修改发帖标题,
export const upTopping = params => axios.post(`${comment}/upTopping`, params);
// 跟帖查询
export const selCommunityH = params => axios.post(`${comment}/selCommunityH`, params);
// 合作意向列表查询
export const getCreatingPlatformSearch = params => axios.post(`${creatingPlatform}/search`, params);

18
src/router/index.js

@ -41,6 +41,12 @@ const routes = [
name: 'CommunicationCommunity',
component: () => import(/* webpackChunkName: "communication-community" */ 'views/CommunicationCommunity/CommunicationCommunity.vue'),
},
// 跟帖
{
path: '/comment',
name: 'Comment',
component: () => import(/* webpackChunkName: "comment" */ 'views/CommunicationCommunity/Comment.vue'),
},
// 活动公告--活动通知
{
path: '/event-announcement',
@ -65,6 +71,18 @@ const routes = [
name: 'TalentRecruitment',
component: () => import(/* webpackChunkName: "talent-recruitment" */ 'views/TalentRecruitment/TalentRecruitment.vue'),
},
// 合作伙伴
{
path: '/cooperative-partner',
name: 'CooperativePartner',
component: () => import(/* webpackChunkName: "cooperative-partner" */ 'views/CooperativePartner/CooperativePartner.vue'),
},
// 衍生企业
{
path: '/derivative-enterprise',
name: 'DerivativeEnterprise',
component: () => import(/* webpackChunkName: "derivative-enterprise" */ 'views/DerivativeEnterprise/DerivativeEnterprise.vue'),
},
// -------创新部
// 合作意向
{

71
src/views/CommunicationCommunity/Comment.vue

@ -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>

70
src/views/CommunicationCommunity/CommunicationCommunity.vue

@ -1,19 +1,75 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<forum-search />
<forum-date />
<community-search @getSelectTeam="getSelectTeam" />
<community-date :lists="lists" :pagination="pagination" @getSelectTeam="getSelectTeam" />
</div>
</template>
<script>
import ForumSearch from 'components/Forum/ForumSearch.vue';
import ForumDate from 'components/Forum/ForumDate.vue';
import CommunitySearch from 'components/Community/CommunitySearch.vue';
import CommunityDate from 'components/Community/CommunityDate.vue';
import { selCommentH } from 'config/api';
export default {
name: 'ForumManage',
name: 'CommunicationCommunity',
components: {
ForumSearch,
ForumDate,
CommunitySearch,
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>

79
src/views/CooperativePartner/CooperativePartner.vue

@ -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…
Cancel
Save