Browse Source

服务相关

master
aBin 5 years ago
parent
commit
310f30d47b
  1. 16285
      package-lock.json
  2. 5
      package.json
  3. 2
      src/components/Activity/ActivityDate.vue
  4. 72
      src/components/Banner/BannerAdd.vue
  5. 5
      src/components/BtnCom/BtnCon.vue
  6. 2
      src/components/CVideo/VideoDate.vue
  7. 223
      src/components/Challenge/ChallengeAdd.vue
  8. 192
      src/components/Challenge/ChallengeDate.vue
  9. 197
      src/components/Challenge/ChallengeEdit.vue
  10. 43
      src/components/Challenge/ChallengeSearch.vue
  11. 181
      src/components/Community/CommentDate.vue
  12. 52
      src/components/Community/CommentSearch.vue
  13. 255
      src/components/Community/CommunityDate.vue
  14. 74
      src/components/Community/CommunitySearch.vue
  15. 235
      src/components/Course/CourseAdd.vue
  16. 196
      src/components/Course/CourseDate.vue
  17. 209
      src/components/Course/CourseEdit.vue
  18. 43
      src/components/Course/CourseSearch.vue
  19. 166
      src/components/Demand/DemandDate.vue
  20. 37
      src/components/Demand/DemandSearch.vue
  21. 94
      src/components/Development/DevelopmentDate.vue
  22. 2
      src/components/Development/DevelopmentSearch.vue
  23. 140
      src/components/EntityApply/Detail.vue
  24. 284
      src/components/EntityApply/EntityApplyAdd.vue
  25. 190
      src/components/EntityApply/EntityApplyDate.vue
  26. 89
      src/components/EntityApply/EntityApplySearch.vue
  27. 172
      src/components/Forum/ForumDate.vue
  28. 96
      src/components/Forum/ForumSearch.vue
  29. 31
      src/components/Institute/InstituteDate.vue
  30. 63
      src/components/Institute/InstituteSearch.vue
  31. 66
      src/components/Manage/ManageAdd.vue
  32. 50
      src/components/Manage/ManageDate.vue
  33. 73
      src/components/Manage/ManageEdit.vue
  34. 39
      src/components/Manage/ManageSearch.vue
  35. 30
      src/components/Mentor/MentorDate.vue
  36. 193
      src/components/Partner/PartnerAdd.vue
  37. 204
      src/components/Partner/PartnerDate.vue
  38. 197
      src/components/Partner/PartnerEdit.vue
  39. 78
      src/components/Partner/PartnerSearch.vue
  40. 159
      src/components/Policy/PolicyAdd.vue
  41. 3
      src/components/Policy/PolicyDate.vue
  42. 163
      src/components/Policy/PolicyEdit.vue
  43. 5
      src/components/Policy/PolicySearch.vue
  44. 2
      src/components/SpinOff/SpinOffDate.vue
  45. 139
      src/components/Transfer/TransferDate.vue
  46. 2
      src/components/Transfer/TransferSearch.vue
  47. 4
      src/components/innovativeService/innovativeServiceAdd.vue
  48. 48
      src/components/innovativeService/innovativeServiceDate.vue
  49. 201
      src/components/innovativeService/innovativeServiceEdit.vue
  50. 27
      src/components/innovativeService/innovativeServiceSearch.vue
  51. 69
      src/config/api.js
  52. 2
      src/plugins/ant-design-vue.js
  53. 34
      src/router/index.js
  54. 20
      src/store/actions.js
  55. 25
      src/store/mutations.js
  56. 5
      src/store/state.js
  57. 64
      src/views/CategoryManage/CategoryManage.vue
  58. 71
      src/views/CommunicationCommunity/Comment.vue
  59. 70
      src/views/CommunicationCommunity/CommunicationCommunity.vue
  60. 82
      src/views/CooperativePartner/AboutUsDerivativeEnterprise.vue
  61. 82
      src/views/CooperativePartner/CooperativePartner.vue
  62. 82
      src/views/CooperativePartner/HatchCooperativePartner.vue
  63. 82
      src/views/CooperativePartner/IndustryDerivativeEnterprise.vue
  64. 20
      src/views/DerivativeEnterprise/DerivativeEnterprise.vue
  65. 84
      src/views/EntityApplication/EntityApplication.vue
  66. 86
      src/views/EntityApplication/VirtualApplication.vue
  67. 57
      src/views/IncubationServices/IncubationServices.vue
  68. 57
      src/views/IndustrialServices/IndustrialServices.vue
  69. 54
      src/views/InnovativeAchievements/InnovativeAchievements.vue
  70. 54
      src/views/InnovativeEquipment/InnovativeEquipment.vue
  71. 66
      src/views/InnovativeLab/InnovativeLab.vue
  72. 19
      src/views/InnovativeService/InnovativeService.vue

16285
package-lock.json

File diff suppressed because it is too large

5
package.json

@ -18,6 +18,7 @@
"vue-dompurify-html": "^2.3.0",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.2.0",
"vuetify": "^2.4.6",
"vuex": "^3.4.0"
},
"devDependencies": {
@ -32,13 +33,15 @@
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.11.0",
"css-loader": "^5.0.1",
"deepmerge": "^4.2.2",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2",
"less": "^2.7.3",
"less-loader": "^4.1.0",
"material-design-icons-iconfont": "^6.1.0",
"prettier": "^1.19.1",
"sass": "^1.26.5",
"sass": "^1.32.8",
"sass-loader": "^8.0.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",

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>

72
src/components/Banner/BannerAdd.vue

@ -4,31 +4,79 @@
<a-modal :closable="false" footer title="添加轮播图" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 跳转类型 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="跳转类型">
<a-select @change="getUse($event, 'jumpType')" class="ml-3" default-value="正常" style="width: 150px">
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="跳转类型"
>
<a-select
@change="getUse($event, 'jumpType')"
class="ml-3"
default-value="正常"
style="width: 150px"
>
<a-select-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<!-- 跳转路径 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片跳转路径">
<a-input placeholder="图片跳转路径" class="ml-3" />
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="图片跳转路径"
>
<a-input class="ml-3" placeholder="图片跳转路径" />
</a-form-item>
<!-- 状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" default-value="启用" style="width: 150px">
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="状态"
>
<a-select
@change="getUse($event, 'recStatus')"
class="ml-3"
default-value="启用"
style="width: 150px"
>
<a-select-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<!-- 页面显示位置 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="页面显示位置">
<a-select @change="getUse($event, 'showPage')" class="ml-3" default-value="首页" style="width: 100%">
<a-select-option :key="item.page" :value="item.page" v-for="item in enable2">{{ item.name }}</a-select-option>
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="页面显示位置"
>
<a-select
@change="getUse($event, 'showPage')"
class="ml-3"
default-value="首页"
style="width: 100%"
>
<a-select-option
:key="item.page"
:value="item.page"
v-for="item in enable2"
>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="图片"
>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@change="handleChange"
class="ml-3"
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">

5
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('/about-us-derivative-enterprise')" class="btn">衍生企业</div>
<div class="font-bold-24">创新部</div>
<div @click="jump('/cooperation-intention')" class="btn">合作意向</div>
@ -24,10 +26,11 @@
<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('/hatch-cooperative-partner')" class="btn">合作伙伴</div>
<div class="font-bold-24">产业部</div>
<div @click="jump('/industrial-services')" class="btn">服务</div>
<div @click="jump('/derivative-enterprise')" class="btn">衍生企业</div>
<div @click="jump('/industry-derivative-enterprise')" class="btn">衍生企业</div>
<div @click="jump('/industry-demand-report')" class="btn">需求填报</div>
</div>
</template>

2
src/components/CVideo/VideoDate.vue

@ -190,7 +190,7 @@ export default {
<style lang="stylus" scoped>
.main .img {
width: 100%;
height: 65px;
}
.main .big_img {

223
src/components/Challenge/ChallengeAdd.vue

@ -1,86 +1,78 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="添加创新挑战" v-model="visible" width="700px">
<a-modal :closable="false" footer title="添加研发团队" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 来源 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="来源"
>
<a-radio-group @change="getSource" v-model="source">
<a-radio :value="1">平台</a-radio>
<a-radio :value="2">用户</a-radio>
</a-radio-group>
</a-form-item>
<!-- 标题 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="标题"
>
<!-- 服务名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务名称">
<a-input
placeholder="标题"
class="ml-3"
placeholder="服务名称"
@change="changeIpt($event, 'serviceName')"
v-decorator="[
'superiorType',
{
rules: [
{ required: true, message: '标题不能为空' },
{ whitespace: true, message: '标题不能为空' },
{ max: 140, massage: '标题最多140个字符' },
],
},
]"
'serviceName',
{
rules: [
{ required: true, message: '服务名称不能为空' },
{ whitespace: true, message: '服务名称不能为空' },
{ max: 140, massage: '服务名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 内容 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="内容"
>
<!-- 服务简介 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务简介">
<a-textarea
placeholder="内容"
class="ml-3"
placeholder="服务简介"
@change="changeIpt($event, 'intro')"
v-decorator="[
'content',
]"
/>
</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%"
'intro',
{
rules: [
{ required: true, message: '服务简介不能为空' },
{ whitespace: true, message: '服务简介不能为空' },
{ max: 140, massage: '服务简介最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 发布人姓名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="发布人姓名"
>
<a-input
placeholder="发布人姓名"
<!-- 服务内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务内容">
<a-textarea
class="ml-3"
placeholder="服务内容"
@change="changeIpt($event, 'content')"
v-decorator="[
'publisher',
{
rules: [
{ required: true, message: '发布人姓名不能为空' },
{ whitespace: true, message: '发布人姓名不能为空' },
{ max: 140, massage: '发布人姓名最多140个字符' },
],
},
]"
'content',
{
rules: [
{ required: true, message: '服务内容不能为空' },
{ whitespace: true, message: '服务内容不能为空' },
{ max: 140, massage: '服务内容最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 服务排序 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务排序">
<a-input-number class="ml-3" v-model="orders" />
</a-form-item>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
</a-upload>
</a-form-item>
<!-- 服务状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" default-value="正常" style="width: 100%">
<a-select-option :key="index" :value="index" v-for="(item, index) in recStatusList">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
@ -91,6 +83,8 @@
</template>
<script>
import { upload, saveService } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
@ -99,50 +93,85 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "ChallengeAdd",
name: 'ChallengeAdd',
props: { visible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'challenge-add' }),
source: 1,
releaseTime: '', //
}
form: this.$form.createForm(this, { name: 'r-d-member-add' }),
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
recStatusList: ['正常', '禁用'],
serviceTypeList: ['创新平台', '孵化平台', '产业平台'],
serviceName: '',
content: '',
intro: '',
orders: '',
picId: '',
recStatus: 0,
serviceType: 0,
};
},
methods: {
//
getSource(value){
this.source = value
//
handleChange(info) {
// this.fileList = fileList;
console.log(info);
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
//
onChange(dates, dateStrings) {
console.log('From: ', dates[0], ', to: ', dates[1]);
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
changeIpt(e, str) {
this[str] = e.target.value;
},
getUse(e, str) {
this[str] = e;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error || '添加研发团队失败');
if (this.fileList.length > 0) {
try {
this.picId = this.fileList[0];
const params = {
param: {
name: this.serviceName,
content: this.content,
intro: this.intro,
orders: this.orders,
picId: this.picId,
recStatus: this.recStatus,
serviceType: 2,
},
};
const res = await saveService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('handleTableChange');
this.$emit('closeModal');
this.$message.success('添加成功');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '添加失败');
}
} else {
this.$message.error('请上传图片');
}
}
});

192
src/components/Challenge/ChallengeDate.vue

@ -1,11 +1,14 @@
<template>
<div class="main flex-1">
<div style="width:100%" v-if="lists && lists.length > 0">
<div style="width: 100%" v-if="lists.list && lists.list.length > 0">
<a-table
:columns="columns"
:data-source="lists"
:data-source="lists.list"
:loading="loading"
:row-key="record => record.id"
:pagination="pagination"
:scroll="{ y: height }"
@change="handleTableChange"
bordered
class="white"
>
@ -13,38 +16,37 @@
<span>{{ index + 1 }}</span>
</template>
<template slot="auditStatus" slot-scope="text, record">
<a-tag :color="record.auditStatus === '通过' ? 'green' : 'red'">{{ record.auditStatus }}</a-tag>
<template slot="picUrl" slot-scope="text, record">
<img :src="record.picUrl" width="50" height="50" />
</template>
<template slot="serviceType" slot-scope="text, record">
<span v-if="record.serviceType === 1">创新平台</span>
<span v-if="record.serviceType === 2">孵化平台</span>
<span v-if="record.serviceType === 3">产业平台</span>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.list.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</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>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div class="mb-2">内容{{ record.content }}</div>
<div>发布时间{{ record.content }}</div>
<div class="d-flex flex-nowrap justify-space-between" slot="expandedRowRender" slot-scope="record" style="margin: 0">
{{ getselContent(record.id) }}
</div>
</a-table>
</div>
<a-empty v-else />
<!-- 编辑 -->
<challenge-edit :editVisible="editVisible" @closeModal="closeModal" />
<challenge-edit :edit-visible="editVisible" :edit-data="editData" @getData="getData" :contents="contents" @closeModal="closeModal" />
</div>
</template>
<script>
import ChallengeEdit from "components/Challenge/ChallengeEdit.vue";
import ChallengeEdit from 'components/Challenge/ChallengeEdit.vue';
import { deleteService, selContent } from 'config/api';
const columns = [
{
title: '序号',
@ -55,42 +57,37 @@ const columns = [
scopedSlots: { customRender: 'id' },
},
{
title: '来源',
title: '服务名称',
align: 'center',
dataIndex: 'source',
key: 'source',
dataIndex: 'name',
key: 'name',
},
{
title: '标题',
title: '服务简介',
align: 'center',
dataIndex: 'title',
key: 'title',
dataIndex: 'intro',
key: 'intro',
},
// {
// title: '',
// align: 'center',
// dataIndex: 'releaseTime',
// key: 'releaseTime',
// scopedSlots: { customRender: 'releaseTime' },
// },
{
title: '发布人姓名',
title: '服务图片',
align: 'center',
dataIndex: 'publisher',
key: 'publisher',
dataIndex: 'picUrl',
key: 'picUrl',
scopedSlots: { customRender: 'picUrl' },
},
{
title: '审核状态',
title: '服务类型',
align: 'center',
dataIndex: 'auditStatus',
key: 'auditStatus',
scopedSlots: { customRender: 'auditStatus' },
dataIndex: 'serviceType',
key: 'serviceType',
scopedSlots: { customRender: 'serviceType' },
},
{
title: '审核人',
title: '服务排序',
align: 'center',
dataIndex: 'checker',
key: 'checker',
dataIndex: 'orders',
key: 'orders',
scopedSlots: { customRender: 'orders' },
},
{
title: '编辑',
@ -99,86 +96,95 @@ const columns = [
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
{
title: '审核',
align: 'center',
dataIndex: 'examine',
key: 'examine',
scopedSlots: { customRender: 'examine' },
},
];
const lists = [
{
id:'001',
source:'平台',
title: '博士',
content: '内容内容内容内容内容',
releaseTime: '2020/11/18 15:00',
publisher: '张三',
auditStatus: '通过',
checker: '李四',
},
{
id:'002',
source:'用户',
title: '博士',
content: '内容内容内容内容内容',
releaseTime: '2020/11/18 15:00',
publisher: '张三',
auditStatus: '未通过',
checker: '李四',
}
];
export default {
name: "ChallengeDate",
name: 'ChallengeDate',
components: {
ChallengeEdit,
},
// props: { lists: { type: Array, default: () => {} } },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = lists.map(item => ({ ...item }));
return {
columns,
lists,
loading: false,
editingKey: '',
height: '',
editVisible: false
}
editVisible: false,
editData: null,
contents: '',
};
},
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: {
showEditModal(){
showEditModal(data) {
this.editData = data;
this.contents = this.getselContent(data.id);
this.editVisible = true;
},
closeModal(){
closeModal() {
this.editVisible = false;
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getInnovativeServiceSearch', condition);
},
getData() {
this.$emit('getInnovativeServiceSearch');
},
//
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 deleteService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getInnovativeServiceSearch');
this.$message.success('删除成功');
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
//
getselContent(id) {
try {
const parmas = {
param: {
id: +id,
serviceType: 2,
},
};
const res = selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
// console.log(data);
return data.content;
} else {
return '暂无内容';
}
} catch (error) {
return '暂无内容';
}
},
},
};
</script>

197
src/components/Challenge/ChallengeEdit.vue

@ -1,86 +1,36 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal :closable="false" footer title="修改创新挑战" v-model="editVisible" width="700px">
<a-modal :closable="false" footer title="修改研发团队" v-model="editVisible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 来源 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="来源"
>
<a-radio-group @change="getSource" v-model="source">
<a-radio :value="1">平台</a-radio>
<a-radio :value="2">用户</a-radio>
</a-radio-group>
<!-- 服务名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务名称">
<a-input class="ml-3" placeholder="服务名称" v-model="serviceName" />
</a-form-item>
<!-- 标题 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="标题"
>
<a-input
placeholder="标题"
v-decorator="[
'superiorType',
{
rules: [
{ required: true, message: '标题不能为空' },
{ whitespace: true, message: '标题不能为空' },
{ max: 140, massage: '标题最多140个字符' },
],
},
]"
/>
<!-- 服务简介 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务简介">
<a-textarea class="ml-3" placeholder="服务简介" v-model="intro" />
</a-form-item>
<!-- 内容 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="内容"
>
<a-textarea
placeholder="内容"
v-decorator="[
'content',
]"
/>
<!-- 服务内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务内容">
<a-textarea class="ml-3" placeholder="服务内容" v-model="content" />
</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-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务排序">
<a-input-number class="ml-3" v-model="orders" />
</a-form-item>
<!-- 发布人姓名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="发布人姓名"
>
<a-input
placeholder="发布人姓名"
v-decorator="[
'publisher',
{
rules: [
{ required: true, message: '发布人姓名不能为空' },
{ whitespace: true, message: '发布人姓名不能为空' },
{ max: 140, massage: '发布人姓名最多140个字符' },
],
},
]"
/>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
</a-upload>
</a-form-item>
<!-- 服务状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" default-value="正常" style="width: 100%">
<a-select-option :key="index" :value="index" v-for="(item, index) in recStatusList">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
@ -91,6 +41,8 @@
</template>
<script>
import { upload, updateService } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
@ -99,50 +51,89 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "ChallengeEdit",
props: { editVisible: { type: Boolean, default: false } },
name: 'ChallengeEdit',
props: {
editVisible: { type: Boolean, default: false },
editData: { type: Object, default: () => {} },
contents: { type: String, default: '' },
},
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'challeng-edit' }),
source: 1,
releaseTime: '', //
}
form: this.$form.createForm(this, { name: 'r-d-member-add' }),
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
recStatusList: ['正常', '禁用'],
serviceTypeList: ['创新平台', '孵化平台', '产业平台'],
serviceName: '',
content: '',
intro: '',
orders: '',
picId: '',
recStatus: 0,
serviceType: 0,
};
},
watch: {
editData(val) {
console.log(val);
},
},
methods: {
//
getSource(value){
this.source = value
//
handleChange(info) {
// this.fileList = fileList;
console.log(info);
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
//
onChange(dates, dateStrings) {
console.log('From: ', dates[0], ', to: ', dates[1]);
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
changeIpt(e, str) {
this[str] = e.target.value;
},
getUse(e, str) {
this[str] = e;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
const params = {
param: {
id: this.editData.id,
name: this.serviceName ? this.serviceName : this.editData.name,
content: this.content ? this.content : this.contents === '暂无内容' ? '' : this.contents,
intro: this.intro ? this.intro : this.editData.intro,
orders: this.orders ? this.orders : this.editData.orders,
picId: this.picId ? this.picId : this.editData.picId,
recStatus: this.recStatus,
serviceType: 2,
},
};
const res = await updateService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getData');
this.$emit('closeModal');
this.$message.success('修改成功');
} else {
this.$message.error('修改失败');
}
} catch (error) {
this.$message.error(error || '添加研发团队失败');
this.$message.error(error);
}
}
});

43
src/components/Challenge/ChallengeSearch.vue

@ -1,18 +1,22 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 团队名称 -->
<div>
<!-- 来源 -->
<a-input @change="handleChangeSource" placeholder="来源" style="width: 150px" v-model="source" />
<a-input placeholder="服务名称" style="width: 150px" v-model="name" allow-clear />
<span class="ml-3"> 服务状态:</span>
<a-select @change="handleChangeSelect" class="ml-3" style="width: 150px" placeholder="状态" allow-clear>
<a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ item }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button @click="openUnveilingList" class="editable-add-btn">揭榜</a-button>
<a-button @click="showModal" class="ml-3 editable-add-btn" type="primary">增加</a-button>
<a-button type="primary" @click="showModal" class="editable-add-btn">增加</a-button>
<!-- 添加 -->
<challenge-add :visible="visible" @closeModal="closeModal" />
<challenge-add :visible="visible" @closeModal="closeModal" @handleTableChange="handleTableChange" />
</div>
</template>
@ -27,7 +31,14 @@ export default {
data() {
return {
visible: false,
source: '',
name: '',
serviceTypes: [
{ id: 1, value: '创新平台' },
{ id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' },
],
statusList: ['正常', '禁用'],
status111: '',
};
},
methods: {
@ -39,19 +50,21 @@ export default {
this.visible = false;
},
handleChangeSource(value) {
console.log('value: ', value);
this.source = value;
handleChangeSelect(e) {
// this[type] = value;
this.status111 = e;
},
//
openUnveilingList() {
const { query } = this.$route;
this.$router.push({ path: '/unveiling-list', query });
handleChangeName(value) {
console.log('value: ', value);
this.name = value;
},
handleTableChange() {
console.log('搜索');
async handleTableChange() {
const { name, status111 } = this;
//
const condition = { name, status111 };
await this.$emit('getInnovativeServiceSearch', condition);
},
},
};

181
src/components/Community/CommentDate.vue

@ -0,0 +1,181 @@
<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">
<a-avatar :size="50" :src="record.avatarUrl" v-if="record.avatarUrl" />
</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 { upComment } 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;
}
}
const res = await upComment(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 {
height: 65px;
}
.main .big_img {
width: 200px;
}
</style>

52
src/components/Community/CommentSearch.vue

@ -0,0 +1,52 @@
<template>
<div class="d-flex flex-wrap pb-3">
<div>
<!-- 帖子状态 -->
<a-select
@change="handleChangeSelect('comStatus',$event)"
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">
<a-avatar :size="50" :src="record.avatarUrl" v-if="record.avatarUrl" />
</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 {
height: 65px;
}
.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>

235
src/components/Course/CourseAdd.vue

@ -1,64 +1,78 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="添加课程" v-model="visible" width="700px">
<a-modal :closable="false" footer title="添加研发团队" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 课程名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="课程名称"
>
<!-- 服务名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务名称">
<a-input
placeholder="课程名称"
class="ml-3"
placeholder="服务名称"
@change="changeIpt($event, 'serviceName')"
v-decorator="[
'courseName',
{
rules: [
{ required: true, message: '课程名称不能为空' },
{ whitespace: true, message: '课程名称不能为空' },
{ max: 140, massage: '课程名称最多140个字符' },
],
},
]"
'serviceName',
{
rules: [
{ required: true, message: '服务名称不能为空' },
{ whitespace: true, message: '服务名称不能为空' },
{ max: 140, massage: '服务名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 课程简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="课程简介"
>
<!-- 服务简介 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务简介">
<a-textarea
placeholder="课程简介"
class="ml-3"
placeholder="服务简介"
@change="changeIpt($event, 'intro')"
v-decorator="[
'courseProfile',
]"
'intro',
{
rules: [
{ required: true, message: '服务简介不能为空' },
{ whitespace: true, message: '服务简介不能为空' },
{ max: 140, massage: '服务简介最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 介绍图片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="介绍图片"
>
<a-upload
:before-upload="beforeUpload"
:show-upload-list="false"
@change="handleChange"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
class="avatar-uploader"
list-type="picture-card"
name="avatar"
>
<img :src="imageUrl" alt="avatar" v-if="imageUrl" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">Upload</div>
</div>
<!-- 服务内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务内容">
<a-textarea
class="ml-3"
placeholder="服务内容"
@change="changeIpt($event, 'content')"
v-decorator="[
'content',
{
rules: [
{ required: true, message: '服务内容不能为空' },
{ whitespace: true, message: '服务内容不能为空' },
{ max: 140, massage: '服务内容最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 服务排序 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务排序">
<a-input-number class="ml-3" v-model="orders" />
</a-form-item>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
</a-upload>
</a-form-item>
<!-- 服务状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" default-value="正常" style="width: 100%">
<a-select-option :key="index" :value="index" v-for="(item, index) in recStatusList">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
@ -69,77 +83,95 @@
</template>
<script>
import { upload, saveService } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default {
name: "CourseAdd",
name: 'CourseAdd',
props: { visible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'course-add' }),
loading: false,
imageUrl: '',
}
form: this.$form.createForm(this, { name: 'r-d-member-add' }),
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
recStatusList: ['正常', '禁用'],
serviceTypeList: ['创新平台', '孵化平台', '产业平台'],
serviceName: '',
content: '',
intro: '',
orders: '',
picId: '',
recStatus: 0,
serviceType: 0,
};
},
methods: {
//
//
handleChange(info) {
if (info.file.status === 'uploading') {
this.loading = true;
return;
}
// this.fileList = fileList;
console.log(info);
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => {
this.imageUrl = imageUrl;
this.loading = false;
});
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
changeIpt(e, str) {
this[str] = e.target.value;
},
getUse(e, str) {
this[str] = e;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error || '添加研发团队失败');
if (this.fileList.length > 0) {
try {
this.picId = this.fileList[0];
const params = {
param: {
name: this.serviceName,
content: this.content,
intro: this.intro,
orders: this.orders,
picId: this.picId,
recStatus: this.recStatus,
serviceType: 3,
},
};
const res = await saveService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('handleTableChange');
this.$emit('closeModal');
this.$message.success('添加成功');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '添加失败');
}
} else {
this.$message.error('请上传图片');
}
}
});
@ -148,19 +180,4 @@ export default {
};
</script>
<style scoped lang="stylus">
.avatar-uploader > .ant-upload {
width: 128px;
height: 128px;
}
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
</style>
<style scoped lang="stylus"></style>

196
src/components/Course/CourseDate.vue

@ -1,11 +1,14 @@
<template>
<div class="main flex-1">
<div style="width:100%" v-if="lists && lists.length > 0">
<div style="width: 100%" v-if="lists.list && lists.list.length > 0">
<a-table
:columns="columns"
:data-source="lists"
:data-source="lists.list"
:loading="loading"
:row-key="record => record.id"
:pagination="pagination"
@change="handleTableChange"
:scroll="{ y: height }"
bordered
class="white"
>
@ -13,50 +16,37 @@
<span>{{ index + 1 }}</span>
</template>
<!-- 头像 -->
<template slot="introductionPicture" slot-scope="text, record">
<img :src="record.introductionPicture" class="img" />
<a-modal :imgVisible="imgVisible" @cancel="imgVisible = false" footer title="身份证明">
<img :src="record.idCardPromise" @click="imgVisible = true" style="width: 100%;" />
</a-modal>
<template slot="picUrl" slot-scope="text, record">
<img :src="record.picUrl" width="50" height="50" />
</template>
<template slot="auditStatus" slot-scope="text, record">
<a-tag :color="record.auditStatus === '通过' ? 'green' : 'red'">{{ record.auditStatus }}</a-tag>
<template slot="serviceType" slot-scope="text, record">
<span v-if="record.serviceType === 1">创新平台</span>
<span v-if="record.serviceType === 2">孵化平台</span>
<span v-if="record.serviceType === 3">产业平台</span>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.list.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</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>
<div
class="d-flex flex-nowrap justify-space-between"
slot="expandedRowRender"
slot-scope="record"
style="margin: 0"
>
<div>课程简介{{ record.courseProfile }}</div>
<div class="d-flex flex-nowrap justify-space-between" slot="expandedRowRender" slot-scope="record" style="margin: 0">
{{ getselContent(record.id) }}
</div>
</a-table>
</div>
<a-empty v-else />
<!-- 编辑 -->
<course-edit :editVisible="editVisible" @closeModal="closeModal" />
<course-edit :edit-visible="editVisible" :edit-data="editData" @getData="getData" :contents="contents" @closeModal="closeModal" />
</div>
</template>
<script>
import CourseEdit from "components/Course/CourseEdit.vue";
import CourseEdit from 'components/Course/CourseEdit.vue';
import { deleteService, selContent } from 'config/api';
const columns = [
{
title: '序号',
@ -67,116 +57,136 @@ const columns = [
scopedSlots: { customRender: 'id' },
},
{
title: '课程名称',
title: '服务名称',
align: 'center',
dataIndex: 'courseName',
key: 'courseName',
dataIndex: 'name',
key: 'name',
},
{
title: '介绍图片',
title: '服务简介',
align: 'center',
dataIndex: 'introductionPicture',
key: 'introductionPicture',
scopedSlots: { customRender: 'introductionPicture' },
dataIndex: 'intro',
key: 'intro',
},
{
title: '审核状态',
title: '服务图片',
align: 'center',
dataIndex: 'auditStatus',
key: 'auditStatus',
scopedSlots: { customRender: 'auditStatus' },
dataIndex: 'picUrl',
key: 'picUrl',
scopedSlots: { customRender: 'picUrl' },
},
{
title: '编辑',
title: '服务类型',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
dataIndex: 'serviceType',
key: 'serviceType',
scopedSlots: { customRender: 'serviceType' },
},
{
title: '审核',
title: '服务排序',
align: 'center',
dataIndex: 'examine',
key: 'examine',
scopedSlots: { customRender: 'examine' },
dataIndex: 'orders',
key: 'orders',
scopedSlots: { customRender: 'orders' },
},
];
const lists = [
{
id:'001',
courseName:'传控科技',
courseProfile:'传控科技简介',
introductionPicture:'assets/logo.png',
auditStatus: '通过',
title: '编辑',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
{
id:'002',
courseName:'中绿环保',
courseProfile:'中绿环保简介',
introductionPicture:'assets/logo.png',
auditStatus: '未通过',
}
];
export default {
name: "CourseDate",
name: 'CourseDate',
components: {
CourseEdit,
},
// props: { lists: { type: Array, default: () => {} } },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = lists.map(item => ({ ...item }));
return {
columns,
lists,
loading: false,
editingKey: '',
height: '',
editVisible: false,
imgVisible: false,
}
editData: null,
contents: '',
};
},
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: {
showEditModal(){
showEditModal(data) {
this.editData = data;
this.contents = this.getselContent(data.id);
this.editVisible = true;
},
closeModal(){
closeModal() {
this.editVisible = false;
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getInnovativeServiceSearch', condition);
},
getData() {
this.$emit('getInnovativeServiceSearch');
},
//
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 deleteService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getInnovativeServiceSearch');
this.$message.success('删除成功');
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
//
getselContent(id) {
try {
const parmas = {
param: {
id: +id,
serviceType: 3,
},
};
const res = selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
// console.log(data);
return data.content;
} else {
return '暂无内容';
}
} catch (error) {
return '暂无内容';
}
},
},
};
</script>
<style lang="stylus" scoped>
.main .img {
width: 100%;
}
.main .big_img {
width: 200px;
}
</style>
<style scoped lang="stylus"></style>

209
src/components/Course/CourseEdit.vue

@ -1,64 +1,36 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal :closable="false" footer title="修改课程" v-model="editVisible" width="700px">
<a-modal :closable="false" footer title="修改研发团队" v-model="editVisible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 课程名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="课程名称"
>
<a-input
placeholder="课程名称"
v-decorator="[
'courseName',
{
rules: [
{ required: true, message: '课程名称不能为空' },
{ whitespace: true, message: '课程名称不能为空' },
{ max: 140, massage: '课程名称最多140个字符' },
],
},
]"
/>
<!-- 服务名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务名称">
<a-input class="ml-3" placeholder="服务名称" v-model="serviceName" />
</a-form-item>
<!-- 课程简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="课程简介"
>
<a-textarea
placeholder="课程简介"
v-decorator="[
'courseProfile',
]"
/>
<!-- 服务简介 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务简介">
<a-textarea class="ml-3" placeholder="服务简介" v-model="intro" />
</a-form-item>
<!-- 介绍图片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="介绍图片"
>
<a-upload
:before-upload="beforeUpload"
:show-upload-list="false"
@change="handleChange"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
class="avatar-uploader"
list-type="picture-card"
name="avatar"
>
<img :src="imageUrl" alt="avatar" v-if="imageUrl" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">Upload</div>
</div>
<!-- 服务内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务内容">
<a-textarea class="ml-3" placeholder="服务内容" v-model="content" />
</a-form-item>
<!-- 服务排序 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务排序">
<a-input-number class="ml-3" v-model="orders" />
</a-form-item>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
</a-upload>
</a-form-item>
<!-- 服务状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" default-value="正常" style="width: 100%">
<a-select-option :key="index" :value="index" v-for="(item, index) in recStatusList">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
@ -69,77 +41,99 @@
</template>
<script>
import { upload, updateService } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default {
name: "CourseEdit",
props: { editVisible: { type: Boolean, default: false } },
name: 'CourseEdit',
props: {
editVisible: { type: Boolean, default: false },
editData: { type: Object, default: () => {} },
contents: { type: String, default: '' },
},
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'course-edit' }),
loading: false,
imageUrl: '',
}
form: this.$form.createForm(this, { name: 'r-d-member-add' }),
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
recStatusList: ['正常', '禁用'],
serviceTypeList: ['创新平台', '孵化平台', '产业平台'],
serviceName: '',
content: '',
intro: '',
orders: '',
picId: '',
recStatus: 0,
serviceType: 0,
};
},
watch: {
editData(val) {
console.log(val);
},
},
methods: {
//
//
handleChange(info) {
if (info.file.status === 'uploading') {
this.loading = true;
return;
}
// this.fileList = fileList;
console.log(info);
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => {
this.imageUrl = imageUrl;
this.loading = false;
});
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
changeIpt(e, str) {
this[str] = e.target.value;
},
getUse(e, str) {
this[str] = e;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
const params = {
param: {
id: this.editData.id,
name: this.serviceName ? this.serviceName : this.editData.name,
content: this.content ? this.content : this.contents === '暂无内容' ? '' : this.contents,
intro: this.intro ? this.intro : this.editData.intro,
orders: this.orders ? this.orders : this.editData.orders,
picId: this.picId ? this.picId : this.editData.picId,
recStatus: this.recStatus,
serviceType: 3,
},
};
const res = await updateService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getData');
this.$emit('closeModal');
this.$message.success('修改成功');
} else {
this.$message.error('修改失败');
}
} catch (error) {
this.$message.error(error || '添加研发团队失败');
this.$message.error(error);
}
}
});
@ -148,19 +142,4 @@ export default {
};
</script>
<style scoped lang="stylus">
.avatar-uploader > .ant-upload {
width: 128px;
height: 128px;
}
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
</style>
<style scoped lang="stylus"></style>

43
src/components/Course/CourseSearch.vue

@ -1,22 +1,22 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 课程名称 -->
<!-- 团队名称 -->
<div>
<a-input
@change="handleChangeName"
placeholder="课程名称"
style="width: 150px"
v-model="courseName"
/>
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
<a-input placeholder="服务名称" style="width: 150px" v-model="name" allow-clear />
<span class="ml-3"> 服务状态:</span>
<a-select @change="handleChangeSelect" class="ml-3" style="width: 150px" placeholder="状态" allow-clear>
<a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ item }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button @click="showModal" class="editable-add-btn" type="primary">增加</a-button>
<a-button type="primary" @click="showModal" class="editable-add-btn">增加</a-button>
<!-- 添加 -->
<course-add :visible="visible" @closeModal="closeModal" />
<course-add :visible="visible" @closeModal="closeModal" @handleTableChange="handleTableChange" />
</div>
</template>
@ -31,7 +31,14 @@ export default {
data() {
return {
visible: false,
courseName: '',
name: '',
serviceTypes: [
{ id: 1, value: '创新平台' },
{ id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' },
],
statusList: ['正常', '禁用'],
status111: '',
};
},
methods: {
@ -43,13 +50,21 @@ export default {
this.visible = false;
},
handleChangeSelect(e) {
// this[type] = value;
this.status111 = e;
},
handleChangeName(value) {
console.log('value: ', value);
this.courseName = value;
this.name = value;
},
handleTableChange() {
console.log('搜索');
async handleTableChange() {
const { name, status111 } = this;
//
const condition = { name, status111 };
await this.$emit('getInnovativeServiceSearch', condition);
},
},
};

166
src/components/Demand/DemandDate.vue

@ -1,166 +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="demandType" slot-scope="text, record">
<a-tag color="green">{{ record.demandType }}</a-tag>
</template>
<!-- 提交时间 -->
<template slot="submissionTime" slot-scope="text, record">{{ record.submissionTime }}</template>
<!-- 处理状态 -->
<template slot="processingStatus" slot-scope="text, record, index">
<div class="editable-cell d-flex flex-nowrap">
<a-badge status="success" />
<editable-cell-select
:arr="status"
:text="record.processingStatus"
@change="onCellChange(index, 'processingStatus', $event)"
/>
</div>
</template>
<!-- 挑战 -->
<template slot="edit">
<a-button class="ml-3" size="small" type="primary">一键挑战</a-button>
</template>
</a-table>
</div>
<a-empty v-else />
</div>
</template>
<script>
import EditableCellSelect from "components/EditableCellSelect/EditableCellSelect.vue";
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '企业名称',
align: 'center',
dataIndex: 'name',
key: 'name',
},
{
title: '联系人',
align: 'center',
dataIndex: 'contacts',
key: 'contacts',
},
{
title: '联系方式',
align: 'center',
dataIndex: 'phone',
key: 'phone',
},
{
title: '需求类型',
align: 'center',
dataIndex: 'demandType',
key: 'demandType',
scopedSlots: { customRender: 'demandType' },
},
{
title: '需求描述',
align: 'center',
dataIndex: 'requirementDescription',
key: 'requirementDescription',
},
{
title: '提交时间',
align: 'center',
dataIndex: 'submissionTime',
key: 'submissionTime',
scopedSlots: { customRender: 'submissionTime' },
},
{
title: '处理状态',
align: 'center',
dataIndex: 'processingStatus',
key: 'processingStatus',
scopedSlots: { customRender: 'processingStatus' },
},
{
title: '挑战',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: "DemandDate",
components: {
EditableCellSelect,
},
data() {
return {
columns,
loading: false,
height: '',
lists:[
{
id:'001',
name:'传控科技',
contacts: 'zhou',
phone:'15212352621',
demandType:'技术',
requirementDescription:'张三',
submissionTime: '2020-11-17 18:00',
processingStatus:'处理中'
},
{
id:'002',
name:'中绿环保',
contacts: 'lili',
phone:'15254256202',
demandType:'技术',
requirementDescription:'李四',
submissionTime: '2020-11-17 8:00',
processingStatus:'处理中'
}
],
status:[{id:1,name:'待处理'},{id:2,name:'处理中'},{id:3,name:'已处理'}],
editable: false,
}
},
mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150;
},
methods: {
onCellChange(key, dataIndex, value) {
console.log('key, dataIndex, value: ', key, dataIndex, value);
const dataSource = [...this.dataSource];
const target = dataSource.find(item => item.key === key);
if (target) {
target[dataIndex] = value;
this.dataSource = dataSource;
}
},
},
};
</script>
<style scoped lang="stylus"></style>

37
src/components/Demand/DemandSearch.vue

@ -1,37 +0,0 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 企业名称 -->
<a-input
@change="handleChangeName"
placeholder="企业名称"
style="width: 150px"
v-model="companyName"
/>
<a-button @click="handleTableChange" class="mx-2" icon="search" type="primary">搜索</a-button>
</div>
</template>
<script>
export default {
name: "DemandSearch",
data() {
return {
companyName: ''
}
},
methods: {
handleChangeName(value) {
console.log('value: ', value);
this.companyName = value;
},
handleTableChange() {
console.log('搜索');
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus"></style>

94
src/components/Development/DevelopmentDate.vue

@ -6,6 +6,7 @@
:data-source="lists"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
bordered
class="white"
>
@ -13,6 +14,11 @@
<span>{{ index + 1 }}</span>
</template>
<!-- 图片 -->
<template slot="visitLocation" slot-scope="text, record">
<img :src="record.visitLocation" height="50" width="50" />
</template>
<!-- 说明图片 -->
<template slot="introductionPicture" slot-scope="text, record">
<img :src="record.introductionPicture" class="img" />
@ -37,7 +43,8 @@
</template>
<script>
import DevelopmentEdit from "components/Development/DevelopmentEdit.vue";
import DevelopmentEdit from 'components/Development/DevelopmentEdit.vue';
import { selResDelete } from 'config/api';
const columns = [
{
@ -49,17 +56,23 @@ const columns = [
scopedSlots: { customRender: 'id' },
},
{
title: '名录',
title: '编号',
align: 'center',
dataIndex: 'directory',
key: 'directory',
dataIndex: 'identifier',
key: 'identifier',
},
{
title: '介绍图片',
title: '成果名称',
align: 'center',
dataIndex: 'introductionPicture',
key: 'introductionPicture',
scopedSlots: { customRender: 'introductionPicture' },
dataIndex: 'name',
key: 'name',
},
{
title: '图片',
align: 'center',
dataIndex: 'visitLocation',
key: 'visitLocation',
scopedSlots: { customRender: 'visitLocation' },
},
{
title: '编辑',
@ -70,63 +83,58 @@ const columns = [
},
];
const lists = [
{
id:'001',
directory:'传控科技',
introductionPicture:'assets/logo.png',
},
{
id:'002',
directory:'中绿环保',
introductionPicture:'assets/logo.png',
}
];
export default {
name: "DevelopmentDate",
name: 'DevelopmentDate',
components: {
DevelopmentEdit,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
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;
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
showEditModal(){
showEditModal() {
this.editVisible = true;
},
closeModal(){
this.editVisible = false;
},
async closeModal() {},
//
async onDelete(teamId) {
async onDelete(id) {
console.log(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 selResDelete(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selResSearch');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
@ -137,7 +145,7 @@ export default {
<style lang="stylus" scoped>
.main .img {
width: 100%;
height: 65px;
}
.main .big_img {

2
src/components/Development/DevelopmentSearch.vue

@ -4,7 +4,7 @@
<div>
<a-input
@change="handleChangeDirectory"
placeholder="名录"
placeholder="内容"
style="width: 150px"
v-model="directory"
/>

140
src/components/EntityApply/Detail.vue

@ -0,0 +1,140 @@
<template>
<div style="width:100%" v-if="record">
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">成立时间</span>
{{ record.buildTime }}
</div>
<div class="flex-1">
<span class="font-bold-14">营业收入</span>
{{ record.businessIncome }}
</div>
<div class="flex-1">
<span class="font-bold-14">集成电路布图设计</span>
{{ record.electricDesign }}
</div>
</div>
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">电子邮箱</span>
{{ record.email }}
</div>
<div class="flex-1">
<span class="font-bold-14">合作单位</span>
{{ record.friendCompany }}
</div>
<div class="flex-1">
<span class="font-bold-14">性别</span>
{{ record.gender }}
</div>
<!--性别0-1--->
</div>
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">身份证号</span>
{{ record.idCard }}
</div>
<div class="flex-1">
<span class="font-bold-14">大专以上人员</span>
{{ record.juniorCollege }}
</div>
<div class="flex-1">
<span class="font-bold-14">法人代码</span>
{{ record.legalPerson }}
</div>
</div>
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">主营业务</span>
{{ record.mainBusiness }}
</div>
<div class="flex-1">
<span class="font-bold-14">申请专利数</span>
{{ record.patentApply }}
</div>
<div class="flex-1">
<span class="font-bold-14">专利授权数</span>
{{ record.patentGrented }}
</div>
</div>
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">发明专利数</span>
{{ record.patentInvent }}
</div>
<div class="flex-1">
<span class="font-bold-14">申请入驻场地类型</span>
{{ record.placeType }}
</div>
<!--申请入驻场地类型 0-虚拟1-实体-->
<div class="flex-1">
<span class="font-bold-14">动植物新品种</span>
{{ record.plantKind }}
</div>
</div>
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">职务</span>
{{ record.position }}
</div>
<div class="flex-1">
<span class="font-bold-14">产品阶段</span>
{{ record.productTech }}
</div>
<!--产品阶段 0-创意阶段 1-研发阶段 2-转化阶段 3-原型样品 4-产业化开发-->
<div class="flex-1">
<span class="font-bold-14">注册资金</span>
{{ record.registerMoney }}
</div>
</div>
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">现注册地址</span>
{{ record.registerSite }}
</div>
<div class="flex-1">
<span class="font-bold-14">研发人员</span>
{{ record.resarchStaff }}
</div>
<div class="flex-1">
<span class="font-bold-14">软件著作权</span>
{{ record.softwareRegister }}
</div>
</div>
<div class="d-flex flex-nowrap mb-3">
<div class="flex-1">
<span class="font-bold-14">员工人数</span>
{{ record.staffCount }}
</div>
<div class="flex-2">
<span class="font-bold-14">文件</span>
<span v-if="record.list && record.list.length>0">{{ record.list }}</span>
<span v-else>暂无</span>
</div>
</div>
<div>
<span class="font-bold-14">公司介绍</span>
<span v-dompurify-html="record.introduce"></span>
</div>
</div>
</template>
<script>
export default {
name: 'Detail',
props: { record: { type: Object, default: () => {} } },
data() {
return {};
},
methods: {},
};
</script>
<style scoped lang="stylus"></style>

284
src/components/EntityApply/EntityApplyAdd.vue

@ -0,0 +1,284 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="入驻申请添加" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 标题 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="标题"
>
<a-input
placeholder="标题"
v-decorator="[
'title',
{
rules: [
{ required: true, message: '标题不能为空' },
{ whitespace: true, message: '标题不能为空' },
{ max: 140, massage: '地点最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 地点 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="地点"
>
<a-input
placeholder="地点"
v-decorator="[
'address',
{
rules: [
{ required: true, message: '地点不能为空' },
{ whitespace: true, message: '地点不能为空' },
{ max: 140, massage: '地点最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 时间 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="时间"
required
>
<a-range-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-select @change="changeType" placeholder="活动类型" style="width:100%">
<a-select-option
:key="index"
:value="category.id"
v-for="(category, index) in types"
>{{ category.name }}</a-select-option>
</a-select>
</a-form-item>
<!-- 主讲人 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="主讲人"
>
<a-input
placeholder="主讲人"
v-decorator="[
'name',
{
rules: [
{ required: true, message: '主讲人不能为空' },
{ whitespace: true, message: '主讲人不能为空' },
{ max: 140, massage: '主讲人最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 组织单位 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="组织单位"
>
<a-input
placeholder="组织单位"
v-decorator="[
'organization'
]"
/>
</a-form-item>
<!-- 其他事宜 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="其他事宜"
>
<a-input
placeholder="其他事宜"
v-decorator="[
'other'
]"
/>
</a-form-item>
<!-- 会议主题 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="会议主题"
>
<a-input
placeholder="会议主题"
v-decorator="[
'theme'
]"
/>
</a-form-item>
<!-- 培训对象 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="培训对象"
>
<a-input
placeholder="培训对象"
v-decorator="[
'trainees'
]"
/>
</a-form-item>
<!-- 报名方式 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="报名方式"
>
<a-input
placeholder="报名方式"
v-decorator="[
'way'
]"
/>
</a-form-item>
<!-- 活动结束内容 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="活动结束内容"
>
<a-textarea
placeholder="活动结束内容"
v-decorator="[
'endContent',
]"
/>
</a-form-item>
<!-- 详情 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="详情"
required
>
<quill-editor :max-size="maxSize" :placeholder="placeholder" @changeInput="changeInput" />
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { handleApplyBackend } 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: 'EntityApplyAdd',
props: { visible: { type: Boolean, default: false } },
components: { QuillEditor },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'activity-add' }),
types: [
{ id: 0, name: '路演' },
{ id: 1, name: '沙龙' },
{ id: 2, name: '论坛' },
],
activityType: '',
maxSize: 2048,
content: '',
placeholder: '请输入...',
releaseTime: '', //
closeTime: '', //
};
},
methods: {
//
changeType(value) {
console.log('value: ', value);
this.activityType = value;
},
//
onChange(dates, dateStrings) {
console.log('From: ', dates[0], ', to: ', dates[1]);
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
this.releaseTime = dateStrings[0];
this.closeTime = dateStrings[1];
},
//
changeInput(value) {
this.content = value;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
const { releaseTime, closeTime, content, activityType } = this;
const params = { param: values };
params.param.releaseTime = releaseTime;
params.param.closeTime = closeTime;
params.param.content = content;
params.param.activityType = activityType;
console.log('params: ', params);
const res = await handleApplyBackend(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 || '添加失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

190
src/components/EntityApply/EntityApplyDate.vue

@ -0,0 +1,190 @@
<template>
<div class="main flex-1 flex-column">
<div style="width:100%" v-if="lists && lists.length > 0">
<a-table
:columns="columns"
:data-source="lists"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<!-- 需求类型 -->
<template slot="demandType" slot-scope="text, record">
<a-tag color="green">{{ record.demandType }}</a-tag>
</template>
<!-- 提交时间 -->
<template slot="submissionTime" slot-scope="text, record">{{ record.submissionTime }}</template>
<!-- 处理状态 -->
<template slot="processingStatus" slot-scope="text, record, index">
<div class="editable-cell d-flex flex-nowrap">
<a-badge status="success" />
<editable-cell-select
:arr="status"
:text="record.processingStatus"
@change="onCellChange(index, 'processingStatus', $event)"
/>
</div>
</template>
<template slot="dealStatus" slot-scope="text, record">
<a-tag
:color="record.dealStatus === 2 ? 'green' : record.dealStatus === 1 ? 'red' : 'blue'"
>{{ record.dealStatus === 2 ? '已通过' : record.dealStatus === 1 ? '未通过' : '审核中' }}</a-tag>
</template>
<!-- 审批 -->
<template slot="edit" slot-scope="text, record">
<a-button
@click="handleApply(record.id, 2)"
class="ml-3"
size="small"
type="primary"
v-if="record.dealStatus === 1"
>通过</a-button>
<a-button
@click="handleApply(record.id, 1)"
class="ml-3"
size="small"
type="danger"
v-if="record.dealStatus === 2"
>不通过</a-button>
</template>
<div
class="d-flex flex-nowrap justify-space-between"
slot="expandedRowRender"
slot-scope="record"
style="margin: 0"
>
<detail :record="record" />
</div>
</a-table>
</div>
<a-empty v-else />
</div>
</template>
<script>
import EditableCellSelect from 'components/EditableCellSelect/EditableCellSelect.vue';
import Detail from 'components/EntityApply/Detail.vue';
import { changeStatus } from 'config/api';
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '企业名称',
align: 'center',
dataIndex: 'company',
key: 'company',
},
{
title: '主营业务',
align: 'center',
dataIndex: 'mainBusiness',
key: 'mainBusiness',
},
{
title: '联系人',
align: 'center',
dataIndex: 'name',
key: 'name',
},
{
title: '电话',
align: 'center',
dataIndex: 'phone',
key: 'phone',
},
{
title: '处理状态',
align: 'center',
dataIndex: 'dealStatus',
key: 'dealStatus',
scopedSlots: { customRender: 'dealStatus' },
},
{
title: '审批',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'DemandDate',
components: {
EditableCellSelect,
Detail,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
return {
columns,
loading: false,
height: '',
editable: false,
};
},
mounted() {
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
onCellChange(key, dataIndex, value) {
console.log('key, dataIndex, value: ', key, dataIndex, value);
const dataSource = [...this.dataSource];
const target = dataSource.find(item => item.key === key);
if (target) {
target[dataIndex] = value;
this.dataSource = dataSource;
}
},
//
async handleApply(id, dealStatus) {
try {
const params = { param: { id, dealStatus } };
const res = await changeStatus(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('审核成功');
this.$emit('entityApplicationSearch');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '审核失败');
}
},
},
};
</script>
<style scoped lang="stylus"></style>

89
src/components/EntityApply/EntityApplySearch.vue

@ -0,0 +1,89 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 企业名称 -->
<a-input class="mr-3" placeholder="姓名" style="width: 150px" v-model="name" />
<a-input class="mr-3" placeholder="职务" style="width: 150px" v-model="position" />
<a-input class="mr-3" placeholder="联系电话" style="width: 150px" v-model="phone" />
<a-input class="mr-3" placeholder="企业/团队" style="width: 150px" v-model="company" />
<a-select
@change="handleChangeSelect('dealStatus',$event)"
allow-clear
class="ml-3"
placeholder="处理状态"
style="width: 150px"
>
<a-select-option
:key="dealStatus.id"
:value="dealStatus.id"
v-for="dealStatus in dealStatuss"
>{{ dealStatus.value }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" icon="search" type="primary">搜索</a-button>
<div class="flex-1"></div>
<a-button @click="showModal" class="editable-add-btn mb-3" type="primary">增加</a-button>
<!-- 添加 -->
<entity-apply-add :visible="visible" @closeModal="closeModal" />
</div>
</template>
<script>
import EntityApplyAdd from 'components/EntityApply/EntityApplyAdd.vue';
export default {
name: 'EntityApplySearch',
components: {
EntityApplyAdd,
},
data() {
return {
visible: false,
name: '',
position: '',
phone: '',
company: '',
dealStatuss: [
{ id: 1, value: '审核未通过' },
{ id: 2, value: '审核通过' },
],
};
},
methods: {
handleChangeName(value) {
console.log('value: ', value);
this.companyName = value;
},
handleChangeSelect(type, value) {
this[type] = value;
},
showModal() {
this.visible = true;
},
closeModal() {
this.visible = false;
},
async handleTableChange() {
const { name, position, phone, company, dealStatus } = this;
console.log(dealStatus);
//
const condition = {
name,
position,
phone,
company,
dealStatus,
};
await this.$emit('entityApplicationSearch', 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>

31
src/components/Institute/InstituteDate.vue

@ -6,8 +6,8 @@
:data-source="lists"
:loading="loading"
:row-key="record => record.id"
@change="handleTableChange"
:scroll="{ y: height }"
@change="handleTableChange"
bordered
class="white"
>
@ -26,7 +26,7 @@
<!-- 分类管理 -->
<!-- <template slot="categoryManage" slot-scope="text, record">
<a-button @click="openCategoryManage" size="small" type="primary">仪器分类管理</a-button>
</template> -->
</template>-->
<!-- 研究院类型 -->
<template slot="serviceType" slot-scope="text, record">
@ -49,9 +49,7 @@
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div>简介
<span v-dompurify-html="record.description"></span></div>
</div> -->
</div>-->
<div
class="d-flex flex-nowrap justify-space-between"
@ -59,7 +57,10 @@
slot-scope="record"
style="margin: 0"
>
<div class="ml-3">分类<span v-dompurify-html="record.direction"></span></div>
<div class="ml-3">
分类
<span v-dompurify-html="record.direction"></span>
</div>
<div class="ml-3">备注{{ record.description }}</div>
</div>
</a-table>
@ -72,7 +73,7 @@
</template>
<script>
import InstituteEdit from "components/Institute/InstituteEdit.vue";
import InstituteEdit from 'components/Institute/InstituteEdit.vue';
import { deleteInstitute } from 'config/api';
const columns = [
@ -171,7 +172,7 @@ const columns = [
// ];
export default {
name: "InstituteDate",
name: 'InstituteDate',
components: {
InstituteEdit,
},
@ -186,7 +187,7 @@ export default {
height: '',
editVisible: false,
imgVisible: false,
}
};
},
mounted() {
@ -202,23 +203,23 @@ export default {
},
methods: {
showEditModal(){
showEditModal() {
this.editVisible = true;
},
async closeModal(){
async closeModal() {
this.editVisible = false;
await this.$emit('getInstituteSearchBack');
},
//
openTeamMember(){
openTeamMember() {
const { query } = this.$route;
this.$router.push({ path: '/RD-team-member', query });
},
//
openCategoryManage(){
openCategoryManage() {
const { query } = this.$route;
this.$router.push({ path: '/category-manage', query });
},
@ -232,7 +233,7 @@ export default {
//
async onDelete(id) {
try {
const params = { param:{id}};
const params = { param: { id } };
const res = await deleteInstitute(params);
const { data, msg, code } = res.data;
if (code === 200) {
@ -254,7 +255,7 @@ export default {
<style lang="stylus" scoped>
.main .img {
width: 100%;
height: 65px;
}
.main .big_img {

63
src/components/Institute/InstituteSearch.vue

@ -2,26 +2,10 @@
<div class="d-flex flex-wrap pb-3">
<!-- 中文名称 -->
<div>
<a-input
@change="handleChangeChineseName"
placeholder="姓名"
style="width: 150px"
v-model="name"
/>
<!-- <a-input
@change="handleChangeEnglishName"
class="ml-3"
placeholder="英文名称"
style="width: 150px"
v-model="englishName"
/>
<a-select @change="getCategory" class="ml-3" placeholder="分类" style="width: 200px">
<a-select-option
:key="index"
:value="category.name"
v-for="(category, index) in categories"
>{{ category.name }}</a-select-option>
</a-select> -->
<a-input placeholder="姓名" style="width: 150px" v-model="name" />
<a-checkbox-group @change="onChange" class="ml-3">
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists">{{ item.name }}</a-checkbox>
</a-checkbox-group>
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div>
@ -35,18 +19,24 @@
</template>
<script>
import InstituteAdd from "components/Institute/InstituteAdd.vue";
import InstituteAdd from 'components/Institute/InstituteAdd.vue';
export default {
name: "InstituteSearch",
name: 'InstituteSearch',
components: {
InstituteAdd,
},
props: { typeLists: { type: Array, default: () => [] } },
data() {
return {
visible: false,
name: "",
}
name: '',
moldIds: [],
};
},
created() {
console.log(this.typeLists);
},
methods: {
showModal() {
@ -57,33 +47,22 @@ export default {
this.visible = false;
},
handleChangeChineseName(value) {
console.log('value: ', value);
this.chineseName = value;
},
handleChangeEnglishName(value) {
console.log('value: ', value);
this.englishName = value;
},
getCategory(value) {
console.log('value: ', value);
this.category = value;
onChange(checkedValues) {
this.moldIds = checkedValues;
console.log('this.moldIds: ', this.moldIds);
},
async handleTableChange() {
console.log('搜索');
const { name} = this;
const { name, moldIds } = this;
//
const condition = {
name
}
await this.$emit('getInstituteSearchBack',condition)
name,
};
await this.$emit('getInstituteSearchBack', condition);
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus"></style>

66
src/components/Manage/ManageAdd.vue

@ -1,7 +1,7 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="添加研发团队" v-model="visible" width="700px">
<a-modal :closable="false" footer title="添加分类管理" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 类型 -->
<a-form-item
@ -9,35 +9,40 @@
:wrapper-col="formItemLayout.wrapperCol"
label="类型"
>
<a-input
<a-select
placeholder="类型"
style="width:100%"
v-decorator="[
'type',
'model',
{
rules: [
{ required: true, message: '类型不能为空' },
{ whitespace: true, message: '类型不能为空' },
{ max: 140, massage: '类型最多140个字符' },
],
},
]"
/>
>
<a-select-option
:key="index"
:value="item.id"
v-for="(item, index) in types"
>{{ 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="[
'superiorType',
'name',
{
rules: [
{ required: true, message: '上级类型不能为空' },
{ whitespace: true, message: '上级类型不能为空' },
{ max: 140, massage: '上级类型最多140个字符' },
{ required: true, message: '分类名称不能为空' },
{ whitespace: true, message: '分类名称不能为空' },
{ max: 140, massage: '分类名称最多140个字符' },
],
},
]"
@ -54,6 +59,8 @@
</template>
<script>
import { selModelAdd } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
@ -62,14 +69,19 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "ManageAdd",
name: 'ManageAdd',
props: { visible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'manage-add' }),
}
types: [
{ id: 0, name: '成果' },
{ id: 1, name: '仪器' },
{ id: 2, name: '实验室' },
],
};
},
methods: {
@ -79,20 +91,18 @@ export default {
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
const params = { param: values };
const res = await selModelAdd(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('添加成功');
this.$emit('closeModal');
this.$emit('handleTableChange');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '添加研发团队失败');
this.$message.error(error || '添加失败');
}
}
});

50
src/components/Manage/ManageDate.vue

@ -18,10 +18,11 @@
<template slot="model" slot-scope="text, record">
<span v-if=" record.model === 0">成果</span>
<span v-if=" record.model === 1">仪器</span>
<span v-if=" record.model === 2">实验室</span>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<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>
@ -31,12 +32,12 @@
<a-empty v-else />
<!-- 编辑 -->
<manage-edit :editVisible="editVisible" @closeModal="closeModal" />
<manage-edit :editItem="editItem" :editVisible="editVisible" @closeModal="closeModal" />
</div>
</template>
<script>
import ManageEdit from "components/Manage/ManageEdit.vue";
import ManageEdit from 'components/Manage/ManageEdit.vue';
import { selModelDelete } from 'config/api';
const columns = [
@ -70,49 +71,45 @@ const columns = [
},
];
// const lists = [
// {
// id:'001',
// type:'',
// superiorType: '',
// },
// {
// id:'002',
// type:'绿',
// superiorType: '',
// }
// ];
export default {
name: "ManageDate",
name: 'ManageDate',
components: {
ManageEdit,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
props: { lists: { type: Array, default: () => [] } },
data() {
return {
columns,
loading: false,
editingKey: '',
height: '',
editVisible: false
}
editItem: null, //
editVisible: false,
pagination: false,
};
},
mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150;
let th = 150;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
showEditModal(){
showEditModal(record) {
this.editItem = record;
this.editVisible = true;
},
async closeModal(){
async closeModal() {
this.editVisible = false;
await this.$emit('selModelSearch');
},
@ -126,9 +123,6 @@ export default {
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selModelSearch');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== id);
// TODO:
} else {
throw msg;
}

73
src/components/Manage/ManageEdit.vue

@ -1,49 +1,55 @@
<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"
:wrapper-col="formItemLayout.wrapperCol"
label="类型"
>
<a-input
<a-select
placeholder="类型"
style="width:100%"
v-decorator="[
'type',
'model',
{
initialValue: editItem.model,
rules: [
{ required: true, message: '类型不能为空' },
{ whitespace: true, message: '类型不能为空' },
{ max: 140, massage: '类型最多140个字符' },
],
},
]"
/>
>
<a-select-option
:key="index"
:value="item.id"
v-for="(item, index) in types"
>{{ 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="[
'superiorType',
'name',
{
initialValue: editItem.name,
rules: [
{ required: true, message: '上级类型不能为空' },
{ whitespace: true, message: '上级类型不能为空' },
{ max: 140, massage: '上级类型最多140个字符' },
{ required: true, message: '分类名称不能为空' },
{ whitespace: true, message: '分类名称不能为空' },
{ max: 140, massage: '分类名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
@ -54,6 +60,8 @@
</template>
<script>
import { selModelUpdate } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
@ -62,14 +70,19 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "ManageEdit",
props: { editVisible: { type: Boolean, default: false } },
name: 'ManageEdit',
props: { editVisible: { type: Boolean, default: false }, editItem: { type: Object, default: () => {} } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'manage-add' }),
}
types: [
{ id: 0, name: '成果' },
{ id: 1, name: '仪器' },
{ id: 2, name: '实验室' },
],
};
},
methods: {
@ -79,20 +92,18 @@ export default {
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
const params = { param: values };
params.param.id = this.editItem.id;
const res = await selModelUpdate(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.$emit('closeModal');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '添加研发团队失败');
this.$message.error(error || '修改失败');
}
}
});

39
src/components/Manage/ManageSearch.vue

@ -2,28 +2,19 @@
<div class="d-flex flex-wrap pb-3">
<!-- 团队名称 -->
<div>
<a-input
@change="handleChangeName"
placeholder="分类名称"
style="width: 150px"
v-model="name"
/>
<a-input @change="handleChangeName" placeholder="分类名称" style="width: 150px" v-model="name" />
类型:
<a-select
@change="handleChangeSelect('model',$event)"
allow-clear
class="ml-3"
placeholder="类型"
style="width: 150px"
allow-clear
>
<a-select-option
:key="model.id"
:value="model.id"
v-for="model in models"
>{{ model.value }}</a-select-option>
<a-select-option :key="model.id" :value="model.id" v-for="model in models">{{ model.value }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
@ -31,7 +22,7 @@
<a-button @click="showModal" class="editable-add-btn" type="primary">增加</a-button>
<!-- 添加 -->
<manage-add :visible="visible" @closeModal="closeModal" />
<manage-add :visible="visible" @closeModal="closeModal" @handleTableChange="handleTableChange" />
</div>
</template>
@ -48,10 +39,11 @@ export default {
visible: false,
name: '',
models: [
{ id:0, value:'成果' },
{ id:1, value:'仪器' },
{ id: 0, value: '成果' },
{ id: 1, value: '仪器' },
{ id: 2, value: '实验室' },
],
}
};
},
methods: {
showModal() {
@ -73,13 +65,14 @@ export default {
async handleTableChange() {
console.log('搜索');
const { name,model} = this;
const { name, model } = this;
//
const condition = {
name,model
}
console.log(condition)
await this.$emit('selModelSearch',condition)
name,
model,
};
console.log(condition);
await this.$emit('selModelSearch', condition);
},
},
};

30
src/components/Mentor/MentorDate.vue

@ -55,7 +55,7 @@
</template>
<script>
import MentorEdit from "components/Mentor/MentorEdit.vue";
import MentorEdit from 'components/Mentor/MentorEdit.vue';
const columns = [
{
@ -104,23 +104,23 @@ const columns = [
const lists = [
{
id:'001',
tutorName:'传控科技',
tutorProfile:'传控科技简介',
headPortrait:'assets/logo.png',
id: '001',
tutorName: '传控科技',
tutorProfile: '传控科技简介',
headPortrait: 'assets/logo.png',
auditStatus: '通过',
},
{
id:'002',
tutorName:'中绿环保',
tutorProfile:'中绿环保简介',
headPortrait:'assets/logo.png',
id: '002',
tutorName: '中绿环保',
tutorProfile: '中绿环保简介',
headPortrait: 'assets/logo.png',
auditStatus: '未通过',
}
},
];
export default {
name: "MentorDate",
name: 'MentorDate',
components: {
MentorEdit,
},
@ -133,7 +133,7 @@ export default {
height: '',
editVisible: false,
imgVisible: false,
}
};
},
mounted() {
@ -141,11 +141,11 @@ export default {
},
methods: {
showEditModal(){
showEditModal() {
this.editVisible = true;
},
closeModal(){
closeModal() {
this.editVisible = false;
},
@ -173,7 +173,7 @@ export default {
<style lang="stylus" scoped>
.main .img {
width: 100%;
height: 65px;
}
.main .big_img {

193
src/components/Partner/PartnerAdd.vue

@ -0,0 +1,193 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:closable="false"
:title="`添加${partnerOptions.type === 1 ? '合作伙伴' : '衍生企业'} `"
footer
v-model="visible"
width="700px"
>
<a-form :form="form" @submit="handleSubmit">
<!-- 公司名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司名称"
>
<a-input
placeholder="公司名称"
v-decorator="[
'name',
{
rules: [
{ required: true, message: '公司名称不能为空' },
{ whitespace: true, message: '公司名称不能为空' },
{ max: 140, massage: '公司名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- logo -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司logo"
required
>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@change="handleChange"
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
<!-- 公司类型 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司类型"
required
>
<a-select @change="getStatus" placeholder="公司类型" style="width: 100%">
<a-select-option
:key="index"
:value="item.id"
v-for="(item, index) in policyStatus"
>{{ item.value }}</a-select-option>
</a-select>
</a-form-item>
<!-- 公司简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司简介"
>
<quill-editor :max-size="maxSize" :placeholder="placeholder" @changeInput="changeInput" />
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { upload, backendAdd } 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: 'PartnerAdd',
props: { visible: { type: Boolean, default: false } },
components: { QuillEditor },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'activity-add' }),
maxSize: 2048,
description: '',
placeholder: '请输入...',
policyStatus: [
{ id: 0, value: '高校' },
{ id: 1, value: '院所' },
{ id: 2, value: '企业' },
],
typeOfTech: '',
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
};
},
computed: mapState(['partnerOptions']),
methods: {
//
getStatus(value) {
this.typeOfTech = value;
},
//
handleChange(info) {
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
//
changeInput(value) {
this.description = value;
},
//
verification() {
const { typeOfTech, fileList } = this;
if (fileList.length < 1) {
this.$message.error('请选择公司logo');
return false;
}
if (typeOfTech === '') {
this.$message.error('请选择公司类型');
return false;
}
return true;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
if (!this.verification()) return;
const { name } = values;
const { description, typeOfTech, fileList, partnerOptions } = this;
const params = { param: { name, type: partnerOptions.type, typeOfPlatform: partnerOptions.typeOfPlatform } };
params.param.description = description;
params.param.typeOfTech = typeOfTech;
params.param.logo = fileList[0];
const res = await backendAdd(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 || '添加失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

204
src/components/Partner/PartnerDate.vue

@ -0,0 +1,204 @@
<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"
: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>
<!-- logo地址 -->
<template slot="logoUrl" slot-scope="text, record">
<img :src="record.logoUrl" height="50" width="50" />
</template>
<!-- 合作关系 -->
<template slot="type" slot-scope="text">
<span>{{ text === 1 ? '合作伙伴' : text === 2 ? '衍生企业' : '' }}</span>
</template>
<!-- 展示位置 -->
<template slot="typeOfPlatform" slot-scope="text">
<span>{{ text === 1 ? '产业平台' : text === 2 ? '关于我们' : text === 3 ? '孵化平台' : '' }}</span>
</template>
<!-- 公司类型 -->
<template slot="typeOfTech" slot-scope="text">
<span>{{ text === 0 ? '高校' : text === 1 ? '院所' : text === 2 ? '企业' : '' }}</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">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div>
<span class="font-bold-14">简介</span>
<span v-dompurify-html="record.description"></span>
</div>
</div>
</a-table>
</div>
<a-empty v-else />
<!-- 编辑 -->
<partner-edit :editItem="editItem" :editVisible="editVisible" @closeModal="closeModal" />
</div>
</template>
<script>
import PartnerEdit from 'components/Partner/PartnerEdit.vue';
import { backendDelete } from 'config/api';
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
scopedSlots: { customRender: 'id' },
},
{
title: 'logo',
align: 'center',
dataIndex: 'logo',
key: 'logo',
},
{
title: 'logo地址',
align: 'center',
dataIndex: 'logoUrl',
key: 'logoUrl',
scopedSlots: { customRender: 'logoUrl' },
},
{
title: '公司名',
align: 'center',
dataIndex: 'name',
key: 'name',
},
{
title: '合作关系',
align: 'center',
dataIndex: 'type',
key: 'type',
scopedSlots: { customRender: 'type' },
},
{
title: '展示位置',
align: 'center',
dataIndex: 'typeOfPlatform',
key: 'typeOfPlatform',
scopedSlots: { customRender: 'typeOfPlatform' },
},
{
title: '公司类型',
align: 'center',
dataIndex: 'typeOfTech',
key: 'typeOfTech',
scopedSlots: { customRender: 'typeOfTech' },
},
{
title: '编辑',
align: 'center',
dataIndex: 'edit',
key: 'edit',
width: 200,
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'PartnerDate',
components: {
PartnerEdit,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
return {
columns,
loading: false,
height: '',
editVisible: false,
editItem: null, //
};
},
mounted() {
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
showEditModal(record) {
this.editItem = record;
this.editVisible = true;
},
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(id) {
try {
const params = { param: { id } };
const res = await backendDelete(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 || '删除失败');
}
},
//
openSignUp() {
const { query } = this.$route;
this.$router.push({ path: '/sign-up', query });
},
},
};
</script>
<style lang="stylus" scoped>
.main .img {
height: 65px;
}
.main .big_img {
width: 200px;
}
</style>

197
src/components/Partner/PartnerEdit.vue

@ -0,0 +1,197 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal
:closable="false"
:title="`修改${partnerOptions.type === 1 ? '合作伙伴' : '衍生企业'} `"
footer
v-model="editVisible"
width="700px"
>
<a-form :form="form" @submit="handleSubmit" v-if="editItem">
<!-- 公司名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司名称"
>
<a-input
placeholder="公司名称"
v-decorator="[
'name',
{
initialValue: editItem.name,
rules: [
{ required: true, message: '公司名称不能为空' },
{ whitespace: true, message: '公司名称不能为空' },
{ max: 140, massage: '公司名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- logo -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司logo"
required
>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@change="handleChange"
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
<!-- 公司类型 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司类型"
required
>
<a-select
@change="getStatus"
placeholder="公司类型"
style="width: 100%"
v-decorator="[
'typeOfTech',
{
initialValue: editItem.typeOfTech,
},
]"
>
<a-select-option
:key="index"
:value="item.id"
v-for="(item, index) in policyStatus"
>{{ item.value }}</a-select-option>
</a-select>
</a-form-item>
<!-- 公司简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司简介"
>
<quill-editor
:max-size="maxSize"
:value="editItem && (editItem.description ? editItem.description : '')"
@changeInput="changeInput"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { upload, backendUpdate } 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: 'PartnerEdit',
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' }),
maxSize: 2048,
description: '',
placeholder: '请输入...',
policyStatus: [
{ id: 0, value: '高校' },
{ id: 1, value: '院所' },
{ id: 2, value: '企业' },
],
typeOfTech: '',
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
};
},
computed: mapState(['partnerOptions']),
methods: {
//
getStatus(value) {
this.typeOfTech = value;
},
//
handleChange(info) {
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
//
changeInput(value) {
this.description = value;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const { name } = values;
const { description, typeOfTech, fileList, editItem } = this;
const params = { param: { name } };
params.param.id = editItem.id;
params.param.description = description ? description : editItem.description;
params.param.typeOfTech = typeOfTech ? typeOfTech : editItem.typeOfTech;
params.param.logo = fileList && fileList.length > 0 ? fileList[0] : editItem.logo;
const res = await backendUpdate(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.$emit('closeModal');
this.description = '';
this.typeOfTech = '';
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '修改失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

78
src/components/Partner/PartnerSearch.vue

@ -0,0 +1,78 @@
<template>
<div class="d-flex flex-wrap pb-3">
<div>
<!-- 活动标题 -->
<a-input class="ml-3" placeholder="标题" style="width: 150px" v-model="name" />
<!-- 公司类型 -->
<a-select @change="changeState" class="ml-3 mb-3" placeholder="公司类型" style="width: 150px">
<a-select-option
:key="index"
:value="state.id"
v-for="(state, index) in policyStatus"
>{{ state.value }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button @click="showModal" class="editable-add-btn" type="primary">增加</a-button>
<!-- 添加 -->
<partner-add :visible="visible" @closeModal="closeModal" />
</div>
</template>
<script>
import PartnerAdd from 'components/Partner/PartnerAdd.vue';
export default {
name: 'PartnerSearch',
components: {
PartnerAdd,
},
data() {
return {
visible: false,
name: '',
policyStatus: [
{ id: 0, value: '高校' },
{ id: 1, value: '院所' },
{ id: 2, value: '企业' },
],
typeOfTech: '',
};
},
methods: {
//
changeState(value) {
this.typeOfTech = value;
},
showModal() {
this.visible = true;
},
async closeModal() {
this.visible = false;
await this.$emit('getBackendSearch');
},
async handleTableChange() {
const { name, typeOfTech } = this;
//
const condition = {
name,
typeOfTech,
};
await this.$emit('getBackendSearch', condition);
},
},
};
</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');
},
//

2
src/components/SpinOff/SpinOffDate.vue

@ -192,7 +192,7 @@ export default {
<style lang="stylus" scoped>
.main .img {
width: 100%;
height: 65px;
}
.main .big_img {

139
src/components/Transfer/TransferDate.vue

@ -6,6 +6,7 @@
:data-source="lists"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
bordered
class="white"
>
@ -23,6 +24,11 @@
<a-button @click="openCategoryManage" size="small" type="primary">成果分类管理</a-button>
</template>
<!-- 图片 -->
<template slot="visitLocation" slot-scope="text, record">
<img :src="record.visitLocation" height="50" width="50" />
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
@ -30,7 +36,7 @@
</a-popconfirm>
</template>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<!-- <div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div class="d-flex flex-nowrap justify-space-between">
<div>关键词{{ record.keyWord }}</div>
<div class="ml-3">转让形式{{ record.formOfTransfer }}</div>
@ -48,7 +54,7 @@
<div class="ml-3">软件著作权名称{{ record.patentStatus }}</div>
<div class="ml-3">成果关键性能指标简介{{ record.researchForm }}</div>
</div>
</div>
</div>-->
</a-table>
</div>
<a-empty v-else />
@ -59,7 +65,8 @@
</template>
<script>
import TransferEdit from "components/Transfer/TransferEdit.vue";
import TransferEdit from 'components/Transfer/TransferEdit.vue';
import { selInstrumentDelete } from 'config/api';
const columns = [
{
@ -71,37 +78,37 @@ const columns = [
scopedSlots: { customRender: 'id' },
},
{
title: '成果名称',
align: 'center',
dataIndex: 'achievementName',
key: 'achievementName',
},
{
title: '成果所处阶段',
title: '编号',
align: 'center',
dataIndex: 'achievementStage',
key: 'achievementStage',
dataIndex: 'identifier',
key: 'identifier',
},
{
title: '成果水平',
title: '仪器名称',
align: 'center',
dataIndex: 'achievementLevel',
key: 'achievementLevel',
dataIndex: 'name',
key: 'name',
},
{
title: '学科分类',
title: '仪器英文名称',
align: 'center',
dataIndex: 'subjectClassification',
key: 'subjectClassification',
scopedSlots: { customRender: 'subjectClassification' },
dataIndex: 'englishname',
key: 'englishname',
},
{
title: '成果分类管理',
title: '图片路径',
align: 'center',
dataIndex: 'achievementCategoryManage',
key: 'achievementCategoryManage',
scopedSlots: { customRender: 'achievementCategoryManage' },
dataIndex: 'visitLocation',
key: 'visitLocation',
scopedSlots: { customRender: 'visitLocation' },
},
// {
// title: '',
// align: 'center',
// dataIndex: 'achievementCategoryManage',
// key: 'achievementCategoryManage',
// scopedSlots: { customRender: 'achievementCategoryManage' },
// },
{
title: '编辑',
align: 'center',
@ -111,94 +118,74 @@ const columns = [
},
];
const lists = [
{
id:'001',
achievementName:'传控科技',
achievementStage: '初期',
achievementLevel:'中',
subjectClassification: '软硬件',
keyWord:'传控',
formOfTransfer:'转让形式',
scopeOfTransfer:'转让范围',
researchForm:'研究形式',
field:'软硬件',
intellectualProperty:'知识产权形式',
patentStatus: '专利状况',
},
{
id:'002',
achievementName:'中绿环保',
achievementStage: '中期',
achievementLevel:'高',
subjectClassification: '软硬件',
keyWord:'传控',
formOfTransfer:'转让形式',
scopeOfTransfer:'转让范围',
researchForm:'研究形式',
field:'软硬件',
intellectualProperty:'知识产权形式',
patentStatus: '专利状况',
}
];
export default {
name: "TransferDate",
name: 'TransferDate',
components: {
TransferEdit,
},
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,
imgVisible: false,
}
};
},
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: {
showEditModal(){
showEditModal() {
this.editVisible = true;
},
closeModal(){
async closeModal() {
this.editVisible = false;
await this.$emit('selInstrumentSearch');
},
//
openTeamMember(){
openTeamMember() {
const { query } = this.$route;
this.$router.push({ path: '/RD-team-member', query });
},
//
openCategoryManage(){
openCategoryManage() {
const { query } = this.$route;
this.$router.push({ path: '/category-manage', query });
},
//
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 selInstrumentDelete(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selInstrumentSearch');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
@ -209,7 +196,7 @@ export default {
<style lang="stylus" scoped>
.main .img {
width: 100%;
height: 65px;
}
.main .big_img {

2
src/components/Transfer/TransferSearch.vue

@ -4,7 +4,7 @@
<div>
<a-input
@change="handleChangeAchievementName"
placeholder="成果名称"
placeholder="分类"
style="width: 150px"
v-model="achievementName"
/>

4
src/components/innovativeService/innovativeServiceAdd.vue

@ -2,7 +2,7 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="添加研发团队" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit" @cancel="$emit('closeModal')">
<a-form :form="form" @submit="handleSubmit">
<!-- 服务名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务名称">
<a-input
@ -155,7 +155,7 @@ export default {
orders: this.orders,
picId: this.picId,
recStatus: this.recStatus,
serviceType: 0,
serviceType: 1,
},
};
const res = await saveService(params);

48
src/components/innovativeService/innovativeServiceDate.vue

@ -6,8 +6,8 @@
:data-source="lists.list"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
:pagination="pagination"
:scroll="{ y: height }"
@change="handleTableChange"
bordered
class="white"
@ -27,23 +27,26 @@
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.list.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
<div class="d-flex flex-nowrap justify-space-between" slot="expandedRowRender" slot-scope="record" style="margin: 0">
{{ getselContent(record.id) }}
</div>
</a-table>
</div>
<a-empty v-else />
<!-- 编辑 -->
<r-d-member-edit :editVisible="editVisible" @closeModal="closeModal" />
<r-d-member-edit :edit-visible="editVisible" :edit-data="editData" @getData="getData" :contents="contents" @closeModal="closeModal" />
</div>
</template>
<script>
import RDMemberEdit from 'components/innovativeService/innovativeServiceEdit.vue';
import { deleteService } from 'config/api';
import { deleteService, selContent } from 'config/api';
const columns = [
{
title: '序号',
@ -62,8 +65,8 @@ const columns = [
{
title: '服务简介',
align: 'center',
dataIndex: 'orders',
key: 'orders',
dataIndex: 'intro',
key: 'intro',
},
{
title: '服务图片',
@ -101,7 +104,7 @@ export default {
RDMemberEdit,
},
// props: { lists: { type: Array, default: () => {} } },
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },
data() {
return {
@ -110,6 +113,8 @@ export default {
editingKey: '',
height: '',
editVisible: false,
editData: null,
contents: '',
};
},
@ -124,9 +129,10 @@ export default {
})();
};
},
methods: {
showEditModal() {
showEditModal(data) {
this.editData = data;
this.contents = this.getselContent(data.id);
this.editVisible = true;
},
@ -138,6 +144,9 @@ export default {
const condition = { current, pageSize };
this.$emit('getInnovativeServiceSearch', condition);
},
getData() {
this.$emit('getInnovativeServiceSearch');
},
//
async onDelete(id) {
try {
@ -155,6 +164,27 @@ export default {
this.$message.error(error || '删除失败');
}
},
//
getselContent(id) {
try {
const parmas = {
param: {
id: +id,
serviceType: 1,
},
};
const res = selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
// console.log(data);
return data.content;
} else {
return '暂无内容';
}
} catch (error) {
return '暂无内容';
}
},
},
};
</script>

201
src/components/innovativeService/innovativeServiceEdit.vue

@ -3,101 +3,34 @@
<!-- 编辑 -->
<a-modal :closable="false" footer title="修改研发团队" v-model="editVisible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 团队名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队名称"
>
<!-- initialValue: editTask.name, -->
<a-input
placeholder="团队名称"
v-decorator="[
'name',
{
rules: [
{ required: true, message: '团队名称不能为空' },
{ whitespace: true, message: '团队名称不能为空' },
{ max: 140, massage: '团队名称最多140个字符' },
],
},
]"
/>
<!-- 服务名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务名称">
<a-input class="ml-3" placeholder="服务名称" v-model="serviceName" />
</a-form-item>
<!-- 团队带头人 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队带头人"
>
<a-input
placeholder="团队带头人"
v-decorator="[
'contacts',
{
rules: [
{ required: true, message: '团队带头人不能为空' },
{ whitespace: true, message: '团队带头人不能为空' },
{ max: 140, massage: '团队带头人最多140个字符' },
],
},
]"
/>
<!-- 服务简介 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务简介">
<a-textarea class="ml-3" placeholder="服务简介" v-model="intro" />
</a-form-item>
<!-- 依托单位 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="依托单位"
>
<a-input
placeholder="依托单位"
v-decorator="[
'company',
{
rules: [
{ required: true, message: '依托单位不能为空' },
{ whitespace: true, message: '依托单位不能为空' },
{ max: 140, massage: '依托单位最多140个字符' },
],
},
]"
/>
<!-- 服务内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务内容">
<a-textarea class="ml-3" placeholder="服务内容" v-model="content" />
</a-form-item>
<!-- 研究方向 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="研究方向"
>
<a-input
placeholder="研究方向"
v-decorator="[
'researchDirection',
{
rules: [
{ required: true, message: '研究方向不能为空' },
{ whitespace: true, message: '研究方向不能为空' },
{ max: 140, massage: '研究方向最多140个字符' },
],
},
]"
/>
<!-- 服务排序 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务排序">
<a-input-number class="ml-3" v-model="orders" />
</a-form-item>
<!-- 团队简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队简介"
>
<a-textarea
placeholder="团队简介"
v-decorator="[
'teamIntroduce',
]"
/>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
</a-upload>
</a-form-item>
<!-- 服务状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" default-value="正常" style="width: 100%">
<a-select-option :key="index" :value="index" v-for="(item, index) in recStatusList">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
@ -108,6 +41,8 @@
</template>
<script>
import { upload, updateService } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
@ -116,37 +51,89 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "RDMemberEdit",
props: { editVisible: { type: Boolean, default: false } },
name: 'RDMemberEdit',
props: {
editVisible: { type: Boolean, default: false },
editData: { type: Object, default: () => {} },
contents: { type: String, default: '' },
},
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-member-add' }),
}
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
recStatusList: ['正常', '禁用'],
serviceTypeList: ['创新平台', '孵化平台', '产业平台'],
serviceName: '',
content: '',
intro: '',
orders: '',
picId: '',
recStatus: 0,
serviceType: 0,
};
},
watch: {
editData(val) {
console.log(val);
},
},
methods: {
//
handleChange(info) {
// this.fileList = fileList;
console.log(info);
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
changeIpt(e, str) {
this[str] = e.target.value;
},
getUse(e, str) {
this[str] = e;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
const params = {
param: {
id: this.editData.id,
name: this.serviceName ? this.serviceName : this.editData.name,
content: this.content ? this.content : this.contents === '暂无内容' ? '' : this.contents,
intro: this.intro ? this.intro : this.editData.intro,
orders: this.orders ? this.orders : this.editData.orders,
picId: this.picId ? this.picId : this.editData.picId,
recStatus: this.recStatus,
serviceType: 1,
},
};
const res = await updateService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getData');
this.$emit('closeModal');
this.$message.success('修改成功');
} else {
this.$message.error('修改失败');
}
} catch (error) {
this.$message.error(error || '添加研发团队失败');
this.$message.error(error);
}
}
});

27
src/components/innovativeService/innovativeServiceSearch.vue

@ -3,12 +3,10 @@
<!-- 团队名称 -->
<div>
<a-input placeholder="服务名称" style="width: 150px" v-model="name" allow-clear />
<!-- <span class="ml-3"> 服务类型:</span>
<a-select @change="handleChangeSelect('serviceType', $event)" class="ml-3" style="width: 150px" placeholder="三大平台" allow-clear>
<a-select-option :key="serviceType.id" :value="serviceType.id" v-for="serviceType in serviceTypes">{{
serviceType.value
}}</a-select-option>
</a-select> -->
<span class="ml-3"> 服务状态:</span>
<a-select @change="handleChangeSelect" class="ml-3" style="width: 150px" placeholder="状态" allow-clear>
<a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ item }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
@ -39,6 +37,8 @@ export default {
{ id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' },
],
statusList: ['正常', '禁用'],
status111: '',
};
},
methods: {
@ -50,8 +50,9 @@ export default {
this.visible = false;
},
handleChangeSelect(type, value) {
this[type] = value;
handleChangeSelect(e) {
// this[type] = value;
this.status111 = e;
},
handleChangeName(value) {
@ -60,16 +61,10 @@ export default {
},
async handleTableChange() {
console.log('搜索');
const { name, serviceType } = this;
console.log(name, serviceType);
const { name, status111 } = this;
//
const condition = {
name,
serviceType,
};
const condition = { name, status111 };
await this.$emit('getInnovativeServiceSearch', condition);
this.activityType = [];
},
},
};

69
src/config/api.js

@ -11,9 +11,6 @@ const policy = `${proxyUrl}/policy`; // 创新政策接口
const researchTeam = `${greenvalley}/researchTeam`; // 创新平台相关操作
const page = `${greenvalley}/page`; // 页面管理相关操作
const carousel = `${greenvalley}/carousel`; // 轮播图相关接口
// 上传附件
export const upload = `${greenvalley}/file/upload`;
const industryInfo = `${greenvalley}/industryInfo`; // 行业资讯相关操作
const activity = `${greenvalley}/activity`; // 活动公告相关操作
const creatingPlatform = `${greenvalley}/creatingPlatform`; // 合作意向相关操作
@ -21,6 +18,10 @@ const serviceProject = `${greenvalley}/serviceProject`; // 创新部服务相关
const institute = `${greenvalley}/institute`; // 实验室(研究院)相关操作
const achInstr = `${greenvalley}/achInstr`; // 创新部类型相关操作
const service = `${greenvalley}/service`; // 三大平台相关接口
const comment = `${greenvalley}/comment`; // 交流社区相关操作
const place = `${greenvalley}/place`; // 孵化部入驻实体申请相关操作
const business = `${greenvalley}/business`; // 交流社区相关操作
export const upload = `${greenvalley}/file/upload`;
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -82,6 +83,33 @@ 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 upComment = params => axios.post(`${comment}/upComment`, params);
// 后台查询合作伙伴和衍生企业
export const backendSearch = params => axios.post(`${business}/backendSearch`, params);
// 后台增加合作伙伴和衍生企业
export const backendAdd = params => axios.post(`${business}/backendAdd`, params);
// 后台删除合作伙伴和衍生企业
export const backendDelete = params => axios.post(`${business}/backendDelete`, params);
// 后台修改合作伙伴或者衍生企业
export const backendUpdate = params => axios.post(`${business}/backendUpdate`, params);
// 合作意向列表查询
export const getCreatingPlatformSearch = params => axios.post(`${creatingPlatform}/search`, params);
@ -94,6 +122,12 @@ export const getInnovativeServiceSearch = params => axios.post(`${serviceProject
// 创新部服务添加
export const saveService = params => axios.post(`${serviceProject}/saveService`, params);
// 创新部服务修改
export const updateService = params => axios.post(`${serviceProject}/updateService`, params);
// 查询服务内容
export const selContent = params => axios.post(`${serviceProject}/selContent`, params);
// 创新部服务删除
export const deleteService = params => axios.post(`${serviceProject}/deleteService`, params);
@ -106,9 +140,36 @@ export const deleteInstitute = params => axios.post(`${institute}/instituteDelet
// 创新部类型列表查询
export const selModelSearch = params => axios.post(`${achInstr}/selModel`, params);
// 创新部类型列表查询
// 创新部类型删除
export const selModelDelete = params => axios.post(`${achInstr}/deleteModel`, params);
// 创新部类型添加
export const selModelAdd = params => axios.post(`${achInstr}/addModel`, params);
// 创新部类型修改
export const selModelUpdate = params => axios.post(`${achInstr}/updateModel`, params);
// 创新部仪器列表查询
export const selInstrumentSearch = params => axios.post(`${achInstr}/selInstrument`, params);
// 创新部仪器删除
export const selInstrumentDelete = params => axios.post(`${achInstr}/deleteInstrument`, params);
// 创新部成果列表查询
export const selResSearch = params => axios.post(`${achInstr}/selRes`, params);
// 创新部成果删除
export const selResDelete = params => axios.post(`${achInstr}/deleteRes`, params);
// 孵化部入驻实体列表查询
export const entityApplicationSearch = params => axios.post(`${place}/search`, params);
// 入驻企业申请的处理状态
export const changeStatus = params => axios.post(`${place}/status`, params);
// 入驻企业申请(管理员用)
export const handleApplyBackend = params => axios.post(`${place}/applyBackend`, params);
// 查询所有的研发团队相关信息
export const getAllTeam = () => axios.post(`${researchTeam}/selectAllTeam`);

2
src/plugins/ant-design-vue.js

@ -25,6 +25,7 @@ import {
Tooltip,
Popover,
inputNumber,
Avatar,
} from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider);
@ -51,6 +52,7 @@ Vue.use(Spin);
Vue.use(Tooltip);
Vue.use(Popover);
Vue.use(inputNumber);
Vue.use(Avatar);
Vue.prototype.$message = message;
Vue.prototype.$notification = notification;

34
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,19 @@ 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: '/about-us-derivative-enterprise',
name: 'AboutUsDerivativeEnterprise',
component: () =>
import(/* webpackChunkName: "about-us-derivative-enterprise" */ 'views/CooperativePartner/AboutUsDerivativeEnterprise.vue'),
},
// -------创新部
// 合作意向
{
@ -119,7 +138,7 @@ const routes = [
{
path: '/virtual-application',
name: 'VirtualApplication',
component: () => import(/* webpackChunkName: "virtual-application" */ 'views/VirtualApplication/VirtualApplication.vue'),
component: () => import(/* webpackChunkName: "virtual-application" */ 'views/EntityApplication/VirtualApplication.vue'),
},
// 服务
{
@ -133,6 +152,12 @@ const routes = [
name: 'HatchingDemandFilling',
component: () => import(/* webpackChunkName: "hatching-demand-filling" */ 'views/HatchingDemandFilling/HatchingDemandFilling.vue'),
},
// 合作伙伴
{
path: '/hatch-cooperative-partner',
name: 'HatchCooperativePartner',
component: () => import(/* webpackChunkName: "hatch-cooperative-partner" */ 'views/CooperativePartner/HatchCooperativePartner.vue'),
},
// -------产业部
// 服务
{
@ -142,9 +167,10 @@ const routes = [
},
// 衍生企业
{
path: '/derivative-enterprise',
name: 'DerivativeEnterprise',
component: () => import(/* webpackChunkName: "derivative-enterprise" */ 'views/DerivativeEnterprise/DerivativeEnterprise.vue'),
path: '/industry-derivative-enterprise',
name: 'IndustryDerivativeEnterprise',
component: () =>
import(/* webpackChunkName: "industry-derivative-enterprise" */ 'views/CooperativePartner/IndustryDerivativeEnterprise.vue'),
},
// 需求填报
{

20
src/store/actions.js

@ -1,6 +1,7 @@
import axios from 'axios';
import { message } from 'ant-design-vue';
import { getUserId } from 'config/api-user';
import { selModelSearch } from 'config/api';
const actions = {
/**
@ -23,6 +24,25 @@ const actions = {
throw error || '获取个人信息失败';
}
},
/**
* 创新部类型列表查询
* @param {any} commit
* @param {object} params 提交的参数
*/
async getSelModelSearch({ commit }, params) {
try {
const res = await selModelSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
return data;
} else {
throw msg;
}
} catch (error) {
throw error || '类型获取失败';
}
},
};
export default actions;

25
src/store/mutations.js

@ -21,30 +21,21 @@ const mutations = {
},
/**
* 设置研发团队列表信息
* 设置合作伙伴和衍生企业查询条件
* @param {object} state
* @param {object} RDTeamLists {id, account, phone}
* @param {object} partnerOptions
*/
setRDTeamLists(state, RDTeamLists) {
state.RDTeamLists = RDTeamLists;
setPartnerOptions(state, partnerOptions) {
state.partnerOptions = partnerOptions;
},
/**
* 设置页面管理列表信息
* 设置实体虚拟申请查询条件
* @param {object} state
* @param {object} pageLists
* @param {object} placeType
*/
setPageLists(state, pageLists) {
state.pageLists = pageLists;
},
/**
* 添加页面管理列表信息
* @param {object} state
* @param {object} item
*/
setAddPageLists(state, item) {
state.pageLists.push(item);
setPlaceType(state, placeType) {
state.placeType = placeType;
},
};

5
src/store/state.js

@ -1,9 +1,8 @@
const state = {
anyringToken: '',
user: { id: '', phone: '', account: '' },
RDTeamLists: [], // 研发团队列表
pageLists: [], // 页面管理列表
partnerOptions: null, // 合作伙伴和衍生企业查询条件
placeType: '', // 实体虚拟申请
titles: [
{
value: '关于我们',

64
src/views/CategoryManage/CategoryManage.vue

@ -1,18 +1,17 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<manage-search @selModelSearch="selModelSearch" />
<manage-date :pagination="pagination" :lists="lists" @selModelSearch="selModelSearch" />
<manage-date :lists="lists" @selModelSearch="selModelSearch" />
</div>
</template>
<script>
// @ is an alias to /src
import ManageSearch from "components/Manage/ManageSearch.vue";
import ManageDate from "components/Manage/ManageDate.vue";
import {selModelSearch} from 'config/api';
import ManageSearch from 'components/Manage/ManageSearch.vue';
import ManageDate from 'components/Manage/ManageDate.vue';
import { mapActions } from 'vuex';
export default {
name: "CategoryManage",
name: 'CategoryManage',
components: {
ManageSearch,
ManageDate,
@ -21,54 +20,39 @@ export default {
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.selModelSearch()
this.selModelSearch();
},
methods: {
...mapActions(['getSelModelSearch']),
/**
* 根据团队id查看研发团队相关信息
* @param { String } competeTimeId 第几届信息的id
* 获取分类管理列表
* @param { Number } model 类型 0成果 1仪器 2实验室
* @param { String } name 分类名称
*/
async selModelSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if(condition){
if(condition.model !== ''){
params.param.model = condition.model
}
if(condition.name){
params.param.name = condition.name
}
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.model !== '') {
params.param.model = condition.model;
}
console.log('params',params)
const res = await selModelSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data)
this.lists = data;
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
if (condition.name) {
params.param.name = condition.name;
}
} catch (error) {
this.$message.error(error);
}
const data = await this.getSelModelSearch(params);
this.lists = data;
},
},
};
</script>

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>

82
src/views/CooperativePartner/AboutUsDerivativeEnterprise.vue

@ -0,0 +1,82 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<partner-search @getBackendSearch="getBackendSearch" />
<partner-date :lists="lists" :pagination="pagination" @getBackendSearch="getBackendSearch" />
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
import PartnerSearch from 'components/Partner/PartnerSearch.vue';
import PartnerDate from 'components/Partner/PartnerDate.vue';
import { backendSearch } from 'config/api';
export default {
name: 'AboutUsDerivativeEnterprise',
components: {
PartnerSearch,
PartnerDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
computed: mapState(['partnerOptions']),
async created() {
const options = { type: 2, typeOfPlatform: 2 };
this.setPartnerOptions(options);
await this.getBackendSearch();
},
methods: {
...mapMutations(['setPartnerOptions']),
/**
* 后台查询合作伙伴和衍生企业
* @param { String } name 公司名
* @param { Number } type 1-合作伙伴 2-衍生企业
* @param { Number } typeOfPlatform 1-创新平台 2-关于我们 3-孵化平台
* @param { Number } typeOfTech 0-高校 1-院所 2-企业
*/
async getBackendSearch(condition) {
try {
const params = {
param: {
type: this.partnerOptions.type,
typeOfPlatform: this.partnerOptions.typeOfPlatform,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
if (condition.typeOfTech !== '') {
params.param.typeOfTech = condition.typeOfTech;
}
}
const res = await backendSearch(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>

82
src/views/CooperativePartner/CooperativePartner.vue

@ -0,0 +1,82 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<partner-search @getBackendSearch="getBackendSearch" />
<partner-date :lists="lists" :pagination="pagination" @getBackendSearch="getBackendSearch" />
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
import PartnerSearch from 'components/Partner/PartnerSearch.vue';
import PartnerDate from 'components/Partner/PartnerDate.vue';
import { backendSearch } from 'config/api';
export default {
name: 'CooperativePartner',
components: {
PartnerSearch,
PartnerDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
computed: mapState(['partnerOptions']),
async created() {
const options = { type: 1, typeOfPlatform: 2 };
this.setPartnerOptions(options);
await this.getBackendSearch();
},
methods: {
...mapMutations(['setPartnerOptions']),
/**
* 后台查询合作伙伴和衍生企业
* @param { String } name 公司名
* @param { Number } type 1-合作伙伴 2-衍生企业
* @param { Number } typeOfPlatform 1-创新平台 2-关于我们 3-孵化平台
* @param { Number } typeOfTech 0-高校 1-院所 2-企业
*/
async getBackendSearch(condition) {
try {
const params = {
param: {
type: this.partnerOptions.type,
typeOfPlatform: this.partnerOptions.typeOfPlatform,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
if (condition.typeOfTech !== '') {
params.param.typeOfTech = condition.typeOfTech;
}
}
const res = await backendSearch(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>

82
src/views/CooperativePartner/HatchCooperativePartner.vue

@ -0,0 +1,82 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<partner-search @getBackendSearch="getBackendSearch" />
<partner-date :lists="lists" :pagination="pagination" @getBackendSearch="getBackendSearch" />
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
import PartnerSearch from 'components/Partner/PartnerSearch.vue';
import PartnerDate from 'components/Partner/PartnerDate.vue';
import { backendSearch } from 'config/api';
export default {
name: 'HatchCooperativePartner',
components: {
PartnerSearch,
PartnerDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
computed: mapState(['partnerOptions']),
async created() {
const options = { type: 1, typeOfPlatform: 3 };
this.setPartnerOptions(options);
await this.getBackendSearch();
},
methods: {
...mapMutations(['setPartnerOptions']),
/**
* 后台查询合作伙伴和衍生企业
* @param { String } name 公司名
* @param { Number } type 1-合作伙伴 2-衍生企业
* @param { Number } typeOfPlatform 1-创新平台 2-关于我们 3-孵化平台
* @param { Number } typeOfTech 0-高校 1-院所 2-企业
*/
async getBackendSearch(condition) {
try {
const params = {
param: {
type: this.partnerOptions.type,
typeOfPlatform: this.partnerOptions.typeOfPlatform,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
if (condition.typeOfTech !== '') {
params.param.typeOfTech = condition.typeOfTech;
}
}
const res = await backendSearch(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>

82
src/views/CooperativePartner/IndustryDerivativeEnterprise.vue

@ -0,0 +1,82 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<partner-search @getBackendSearch="getBackendSearch" />
<partner-date :lists="lists" :pagination="pagination" @getBackendSearch="getBackendSearch" />
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
import PartnerSearch from 'components/Partner/PartnerSearch.vue';
import PartnerDate from 'components/Partner/PartnerDate.vue';
import { backendSearch } from 'config/api';
export default {
name: 'IndustryDerivativeEnterprise',
components: {
PartnerSearch,
PartnerDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
computed: mapState(['partnerOptions']),
async created() {
const options = { type: 2, typeOfPlatform: 1 };
this.setPartnerOptions(options);
await this.getBackendSearch();
},
methods: {
...mapMutations(['setPartnerOptions']),
/**
* 后台查询合作伙伴和衍生企业
* @param { String } name 公司名
* @param { Number } type 1-合作伙伴 2-衍生企业
* @param { Number } typeOfPlatform 1-创新平台 2-关于我们 3-孵化平台
* @param { Number } typeOfTech 0-高校 1-院所 2-企业
*/
async getBackendSearch(condition) {
try {
const params = {
param: {
type: this.partnerOptions.type,
typeOfPlatform: this.partnerOptions.typeOfPlatform,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
if (condition.typeOfTech !== '') {
params.param.typeOfTech = condition.typeOfTech;
}
}
const res = await backendSearch(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>

20
src/views/DerivativeEnterprise/DerivativeEnterprise.vue

@ -1,20 +0,0 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<sign-up-search />
<sign-up-date />
</div>
</template>
<script>
// @ is an alias to /src
import SignUpSearch from "components/SignUp/SignUpSearch.vue";
import SignUpDate from "components/SignUp/SignUpDate.vue";
export default {
name: "SignUp",
components: {
SignUpSearch,
SignUpDate,
}
};
</script>

84
src/views/EntityApplication/EntityApplication.vue

@ -1,20 +1,86 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<demand-search />
<demand-date />
<entity-apply-search @entityApplicationSearch="entityApplicationSearch" />
<entity-apply-date
:lists="lists"
:pagination="pagination"
@entityApplicationSearch="entityApplicationSearch"
/>
</div>
</template>
<script>
// @ is an alias to /src
import DemandSearch from "components/Demand/DemandSearch.vue";
import DemandDate from "components/Demand/DemandDate.vue";
import EntityApplySearch from 'components/EntityApply/EntityApplySearch.vue';
import EntityApplyDate from 'components/EntityApply/EntityApplyDate.vue';
import { entityApplicationSearch } from 'config/api';
import { mapMutations, mapState } from 'vuex';
export default {
name: "Home",
name: 'Home',
components: {
DemandSearch,
DemandDate
}
EntityApplySearch,
EntityApplyDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
computed: mapState(['placeType']),
async created() {
this.setPlaceType(1);
await this.entityApplicationSearch();
},
methods: {
...mapMutations(['setPlaceType']),
async entityApplicationSearch(condition) {
try {
const params = {
param: {
placeType: this.placeType,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
if (condition.position) {
params.param.position = condition.position;
}
if (condition.phone) {
params.param.phone = condition.phone;
}
if (condition.company) {
params.param.company = condition.company;
}
if (condition.dealStatus) {
params.param.dealStatus = condition.dealStatus;
}
}
const res = await entityApplicationSearch(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('123');
}
},
},
};
</script>

86
src/views/EntityApplication/VirtualApplication.vue

@ -0,0 +1,86 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<entity-apply-search @entityApplicationSearch="entityApplicationSearch" />
<entity-apply-date
:lists="lists"
:pagination="pagination"
@entityApplicationSearch="entityApplicationSearch"
/>
</div>
</template>
<script>
import EntityApplySearch from 'components/EntityApply/EntityApplySearch.vue';
import EntityApplyDate from 'components/EntityApply/EntityApplyDate.vue';
import { entityApplicationSearch } from 'config/api';
import { mapMutations, mapState } from 'vuex';
export default {
name: 'VirtualApplication',
components: {
EntityApplySearch,
EntityApplyDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
computed: mapState(['placeType']),
async created() {
this.setPlaceType(0);
await this.entityApplicationSearch();
},
methods: {
...mapMutations(['setPlaceType']),
async entityApplicationSearch(condition) {
try {
const params = {
param: {
placeType: this.placeType,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
if (condition.position) {
params.param.position = condition.position;
}
if (condition.phone) {
params.param.phone = condition.phone;
}
if (condition.company) {
params.param.company = condition.company;
}
if (condition.dealStatus) {
params.param.dealStatus = condition.dealStatus;
}
}
const res = await entityApplicationSearch(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('123');
}
},
},
};
</script>

57
src/views/IncubationServices/IncubationServices.vue

@ -1,19 +1,64 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<challenge-search />
<challenge-date />
<challenge-search @getInnovativeServiceSearch="getInnovativeServiceSearch" />
<challenge-date :pagination="pagination" :lists="lists" @getInnovativeServiceSearch="getInnovativeServiceSearch" />
</div>
</template>
<script>
import ChallengeSearch from "components/Challenge/ChallengeSearch.vue";
import ChallengeDate from "components/Challenge/ChallengeDate.vue";
import ChallengeSearch from 'components/Challenge/ChallengeSearch.vue';
import ChallengeDate from 'components/Challenge/ChallengeDate.vue';
import { getInnovativeServiceSearch } from 'config/api';
export default {
name: "InnovationChallenge",
name: 'InnovationChallenge',
components: {
ChallengeSearch,
ChallengeDate,
}
},
data() {
return {
lists: {},
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.getInnovativeServiceSearch();
},
methods: {
async getInnovativeServiceSearch(condition) {
try {
const params = {
param: {
name: condition && condition.name ? condition.name : '',
recStatus: condition && condition.status111 !== '' ? condition.status111 : '',
serviceType: 2,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
console.log('params', params);
const res = await getInnovativeServiceSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
console.log(this.lists);
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>

57
src/views/IndustrialServices/IndustrialServices.vue

@ -1,19 +1,64 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<course-search />
<course-date />
<course-search @getInnovativeServiceSearch="getInnovativeServiceSearch" />
<course-date :pagination="pagination" :lists="lists" @getInnovativeServiceSearch="getInnovativeServiceSearch" />
</div>
</template>
<script>
import CourseSearch from "components/Course/CourseSearch.vue";
import CourseDate from "components/Course/CourseDate.vue";
import CourseSearch from 'components/Course/CourseSearch.vue';
import CourseDate from 'components/Course/CourseDate.vue';
import { getInnovativeServiceSearch } from 'config/api';
export default {
name: "Course",
name: 'Course',
components: {
CourseSearch,
CourseDate,
}
},
data() {
return {
lists: {},
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.getInnovativeServiceSearch();
},
methods: {
async getInnovativeServiceSearch(condition) {
try {
const params = {
param: {
name: condition && condition.name ? condition.name : '',
recStatus: condition && condition.status111 !== '' ? condition.status111 : '',
serviceType: 3,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
console.log('params', params);
const res = await getInnovativeServiceSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
console.log(this.lists);
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>

54
src/views/InnovativeAchievements/InnovativeAchievements.vue

@ -1,19 +1,67 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<development-search />
<development-date />
<development-search @selResSearch="selResSearch" />
<development-date :lists="lists" :pagination="pagination" @selResSearch="selResSearch" />
</div>
</template>
<script>
import DevelopmentSearch from "components/Development/DevelopmentSearch.vue";
import DevelopmentDate from "components/Development/DevelopmentDate.vue";
import { selResSearch } from 'config/api';
export default {
name: "ResourceDevelopment",
components: {
DevelopmentSearch,
DevelopmentDate,
}
},
data(){
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.selResSearch();
},
methods: {
async selResSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.content) {
params.param.content = condition.content;
}
if (condition.modelIds) {
params.param.modelIds = condition.modelIds;
}
}
const res = await selResSearch(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>

54
src/views/InnovativeEquipment/InnovativeEquipment.vue

@ -1,19 +1,67 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<transfer-search />
<transfer-date />
<transfer-search @selInstrumentSearch="selInstrumentSearch" />
<transfer-date :lists="lists" :pagination="pagination" @selInstrumentSearch="selInstrumentSearch" />
</div>
</template>
<script>
import TransferSearch from "components/Transfer/TransferSearch.vue";
import TransferDate from "components/Transfer/TransferDate.vue";
import { selInstrumentSearch } from 'config/api';
export default {
name: "TechnologyTransfer",
components: {
TransferSearch,
TransferDate,
}
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.selInstrumentSearch();
},
methods: {
async selInstrumentSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.content) {
params.param.content = condition.content;
}
if (condition.modelIds) {
params.param.modelIds = condition.modelIds;
}
}
const res = await selInstrumentSearch(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>

66
src/views/InnovativeLab/InnovativeLab.vue

@ -1,34 +1,69 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<institute-search @getInstituteSearchBack="getInstituteSearchBack" />
<institute-date :pagination="pagination" :lists="lists" @getInstituteSearchBack="getInstituteSearchBack" />
<institute-search :typeLists="typeLists" @getInstituteSearchBack="getInstituteSearchBack" />
<institute-date
:lists="lists"
:pagination="pagination"
@getInstituteSearchBack="getInstituteSearchBack"
/>
</div>
</template>
<script>
import InstituteSearch from "components/Institute/InstituteSearch.vue";
import InstituteDate from "components/Institute/InstituteDate.vue";
import { getInstituteSearchBack } from "config/api";
import InstituteSearch from 'components/Institute/InstituteSearch.vue';
import InstituteDate from 'components/Institute/InstituteDate.vue';
import { getInstituteSearchBack } from 'config/api';
import { mapActions } from 'vuex';
export default {
name: "ResourceSharing",
name: 'ResourceSharing',
components: {
InstituteSearch,
InstituteDate,
},
data(){
return{
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
typeLists: [],
};
},
created() {
this.getInstituteSearchBack()
async created() {
await this.selModelSearch();
await this.getInstituteSearchBack();
},
methods: {
methods: {
...mapActions(['getSelModelSearch']),
/**
* 获取分类管理列表
* @param { Number } model 类型 0成果 1仪器 2实验室
* @param { String } name 分类名称
*/
async selModelSearch(condition) {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
model: 2,
},
};
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
}
const data = await this.getSelModelSearch(params);
this.typeLists = data;
},
/**
* 获取实验室
* @param { Array } moldIds 类型 0成果 1仪器 2实验室
* @param { String } name 分类名称
*/
async getInstituteSearchBack(condition) {
try {
const params = {
@ -37,16 +72,14 @@ export default {
pageSize: (condition && condition.pageSize) || 10,
},
};
if(condition){
if(condition.name){
params.param.name = condition.name
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
}
console.log('params',params)
const res = await getInstituteSearchBack(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data)
this.lists = data.list;
const paper = { ...this.pagination };
paper.current = data.pageNum;
@ -61,6 +94,5 @@ export default {
}
},
},
};
</script>

19
src/views/InnovativeService/InnovativeService.vue

@ -20,7 +20,7 @@ export default {
data() {
return {
lists: [],
lists: {},
pagination: { current: 1, pageSize: 10 },
};
},
@ -34,24 +34,13 @@ export default {
try {
const params = {
param: {
name: condition && condition.name ? condition.name : '',
recStatus: condition && condition.status111 !== '' ? condition.status111 : '',
serviceType: 1,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.id) {
params.param.id = condition.id;
}
if (condition.name) {
params.param.name = condition.name;
}
if (condition.recStatus) {
params.param.recStatus = condition.recStatus;
}
if (condition.serviceType) {
params.param.serviceType = condition.serviceType;
}
}
console.log('params', params);
const res = await getInnovativeServiceSearch(params);
const { code, msg, data } = res.data;

Loading…
Cancel
Save