18 changed files with 496 additions and 1173 deletions
@ -1,155 +0,0 @@ |
|||
<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="[ |
|||
'enterpriseName', |
|||
{ |
|||
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="[ |
|||
'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="[ |
|||
'supportUnit', |
|||
{ |
|||
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="[ |
|||
'researchDirection', |
|||
{ |
|||
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-textarea |
|||
placeholder="团队简介" |
|||
v-decorator="[ |
|||
'shortDesc', |
|||
]" |
|||
/> |
|||
</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 { addTeam } from 'config/api' |
|||
|
|||
const formItemLayout = { |
|||
labelCol: { span: 6 }, |
|||
wrapperCol: { span: 16 }, |
|||
}; |
|||
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } }; |
|||
export default { |
|||
name: "RDAdd", |
|||
props: { visible: { type: Boolean, default: false } }, |
|||
data() { |
|||
return { |
|||
formItemLayout, |
|||
tailItemLayout, |
|||
form: this.$form.createForm(this, { name: 'r-d-add' }), |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
// 提交表单 |
|||
handleSubmit(e) { |
|||
e.preventDefault(); |
|||
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; |
|||
} |
|||
} catch (error) { |
|||
this.$message.error(error || '添加失败'); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="stylus"></style> |
@ -1,163 +0,0 @@ |
|||
<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-form-item |
|||
:label-col="formItemLayout.labelCol" |
|||
:wrapper-col="formItemLayout.wrapperCol" |
|||
label="团队名称" |
|||
> |
|||
<!-- initialValue: editTask.name, --> |
|||
<a-input |
|||
placeholder="团队名称" |
|||
v-decorator="[ |
|||
'enterpriseName', |
|||
{ |
|||
initialValue: editItem ? editItem.enterpriseName : '', |
|||
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="[ |
|||
'name', |
|||
{ |
|||
initialValue: editItem ? editItem.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="[ |
|||
'supportUnit', |
|||
{ |
|||
initialValue: editItem ? editItem.supportUnit : '', |
|||
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="[ |
|||
'researchDirection', |
|||
{ |
|||
initialValue: editItem ? editItem.researchDirection : '', |
|||
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-textarea |
|||
placeholder="团队简介" |
|||
v-decorator="[ |
|||
'shortDesc', |
|||
{initialValue: editItem ? editItem.shortDesc : '',} |
|||
]" |
|||
/> |
|||
</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 { upTeam } from 'config/api'; |
|||
|
|||
const formItemLayout = { |
|||
labelCol: { span: 6 }, |
|||
wrapperCol: { span: 16 }, |
|||
}; |
|||
|
|||
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } }; |
|||
|
|||
export default { |
|||
name: "RDEdit", |
|||
props: { editVisible: { type: Boolean, default: false },editItem: { type: Object, default: null } }, |
|||
data() { |
|||
return { |
|||
formItemLayout, |
|||
tailItemLayout, |
|||
form: this.$form.createForm(this, { name: 'r-d-add' }), |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
// 提交表单 |
|||
handleSubmit(e) { |
|||
e.preventDefault(); |
|||
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; |
|||
// } |
|||
} catch (error) { |
|||
this.$message.error(error || '修改失败'); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="stylus"></style> |
@ -1,182 +0,0 @@ |
|||
<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"> |
|||
<!-- logo --> |
|||
<a-form-item |
|||
:label-col="formItemLayout.labelCol" |
|||
:wrapper-col="formItemLayout.wrapperCol" |
|||
label="logo" |
|||
> |
|||
<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" |
|||
v-decorator="[ |
|||
'avatar', |
|||
{ |
|||
rules: [ |
|||
{ required: true, message: 'logo不能为空' }, |
|||
{ whitespace: true, message: 'logo不能为空' }, |
|||
], |
|||
}, |
|||
]" |
|||
> |
|||
<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-upload> |
|||
</a-form-item> |
|||
<!-- 企业名 --> |
|||
<a-form-item |
|||
:label-col="formItemLayout.labelCol" |
|||
:wrapper-col="formItemLayout.wrapperCol" |
|||
label="企业名" |
|||
> |
|||
<a-input |
|||
placeholder="企业名" |
|||
v-decorator="[ |
|||
'companyName', |
|||
{ |
|||
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="[ |
|||
'englishName', |
|||
{ |
|||
rules: [ |
|||
{ 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> |
|||
</a-form-item> |
|||
</a-form> |
|||
</a-modal> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
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: "SpinOffAdd", |
|||
props: { visible: { type: Boolean, default: false } }, |
|||
data() { |
|||
return { |
|||
formItemLayout, |
|||
tailItemLayout, |
|||
form: this.$form.createForm(this, { name: 'r-d-add' }), |
|||
loading: false, |
|||
imageUrl: '', |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
// 上传图片 |
|||
handleChange(info) { |
|||
if (info.file.status === 'uploading') { |
|||
this.loading = true; |
|||
return; |
|||
} |
|||
if (info.file.status === 'done') { |
|||
// Get this url from response in real world. |
|||
getBase64(info.file.originFileObj, imageUrl => { |
|||
this.imageUrl = imageUrl; |
|||
this.loading = false; |
|||
}); |
|||
} |
|||
}, |
|||
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; |
|||
}, |
|||
|
|||
// 提交表单 |
|||
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 || '添加研发团队失败'); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</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> |
@ -1,182 +0,0 @@ |
|||
<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"> |
|||
<!-- logo --> |
|||
<a-form-item |
|||
:label-col="formItemLayout.labelCol" |
|||
:wrapper-col="formItemLayout.wrapperCol" |
|||
label="logo" |
|||
> |
|||
<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" |
|||
v-decorator="[ |
|||
'avatar', |
|||
{ |
|||
rules: [ |
|||
{ required: true, message: 'logo不能为空' }, |
|||
{ whitespace: true, message: 'logo不能为空' }, |
|||
], |
|||
}, |
|||
]" |
|||
> |
|||
<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-upload> |
|||
</a-form-item> |
|||
<!-- 企业名 --> |
|||
<a-form-item |
|||
:label-col="formItemLayout.labelCol" |
|||
:wrapper-col="formItemLayout.wrapperCol" |
|||
label="企业名" |
|||
> |
|||
<a-input |
|||
placeholder="企业名" |
|||
v-decorator="[ |
|||
'companyName', |
|||
{ |
|||
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="[ |
|||
'englishName', |
|||
{ |
|||
rules: [ |
|||
{ 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> |
|||
</a-form-item> |
|||
</a-form> |
|||
</a-modal> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
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: "SpinOffEdit", |
|||
props: { editVisible: { type: Boolean, default: false } }, |
|||
data() { |
|||
return { |
|||
formItemLayout, |
|||
tailItemLayout, |
|||
form: this.$form.createForm(this, { name: 'r-d-add' }), |
|||
loading: false, |
|||
imageUrl: '', |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
// 上传图片 |
|||
handleChange(info) { |
|||
if (info.file.status === 'uploading') { |
|||
this.loading = true; |
|||
return; |
|||
} |
|||
if (info.file.status === 'done') { |
|||
// Get this url from response in real world. |
|||
getBase64(info.file.originFileObj, imageUrl => { |
|||
this.imageUrl = imageUrl; |
|||
this.loading = false; |
|||
}); |
|||
} |
|||
}, |
|||
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; |
|||
}, |
|||
|
|||
// 提交表单 |
|||
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 || '添加研发团队失败'); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</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> |
Loading…
Reference in new issue