16 changed files with 1043 additions and 96 deletions
@ -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> |
@ -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> |
@ -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> |
@ -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> |
@ -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> |
@ -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> |
@ -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> |
@ -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> |
Loading…
Reference in new issue