|
@ -35,6 +35,16 @@ |
|
|
ref="myQuillEditor" |
|
|
ref="myQuillEditor" |
|
|
v-model="needContent" |
|
|
v-model="needContent" |
|
|
></quill-editor> |
|
|
></quill-editor> |
|
|
|
|
|
<a-upload |
|
|
|
|
|
accept="image/png, image/jpeg" |
|
|
|
|
|
name="files" |
|
|
|
|
|
:multiple="false" |
|
|
|
|
|
style="display: none" |
|
|
|
|
|
:action="action" |
|
|
|
|
|
@change="fileChange" |
|
|
|
|
|
> |
|
|
|
|
|
<a-button id="upload-img"> <a-icon type="upload" /></a-button> |
|
|
|
|
|
</a-upload> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
<!-- 现有基础 --> |
|
|
<!-- 现有基础 --> |
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="现有基础"> |
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="现有基础"> |
|
@ -53,6 +63,7 @@ import { quillEditor } from 'vue-quill-editor'; //调用编辑器 |
|
|
import 'quill/dist/quill.core.css'; |
|
|
import 'quill/dist/quill.core.css'; |
|
|
import 'quill/dist/quill.snow.css'; |
|
|
import 'quill/dist/quill.snow.css'; |
|
|
import 'quill/dist/quill.bubble.css'; |
|
|
import 'quill/dist/quill.bubble.css'; |
|
|
|
|
|
import { upload, addTelease } from 'config/api'; |
|
|
|
|
|
|
|
|
const formItemLayout = { |
|
|
const formItemLayout = { |
|
|
labelCol: { span: 5 }, |
|
|
labelCol: { span: 5 }, |
|
@ -87,6 +98,7 @@ export default { |
|
|
form: this.$form.createForm(this, { name: 'submit' }), |
|
|
form: this.$form.createForm(this, { name: 'submit' }), |
|
|
visible: false, |
|
|
visible: false, |
|
|
title: '发榜', |
|
|
title: '发榜', |
|
|
|
|
|
action: upload, |
|
|
formItemLayout, |
|
|
formItemLayout, |
|
|
formTailLayout, |
|
|
formTailLayout, |
|
|
confirmLoading: false, |
|
|
confirmLoading: false, |
|
@ -99,7 +111,8 @@ export default { |
|
|
handlers: { |
|
|
handlers: { |
|
|
image: function(value) { |
|
|
image: function(value) { |
|
|
if (value) { |
|
|
if (value) { |
|
|
alert('自定义图片'); |
|
|
// alert('自定义图片'); |
|
|
|
|
|
document.getElementById('upload-img').click(); |
|
|
} else { |
|
|
} else { |
|
|
this.quill.format('image', false); |
|
|
this.quill.format('image', false); |
|
|
} |
|
|
} |
|
@ -122,6 +135,7 @@ export default { |
|
|
type: [], |
|
|
type: [], |
|
|
buildTime: '', |
|
|
buildTime: '', |
|
|
}, |
|
|
}, |
|
|
|
|
|
hideMessage: null, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -147,12 +161,19 @@ export default { |
|
|
// 上传图片事件 |
|
|
// 上传图片事件 |
|
|
fileChange(info) { |
|
|
fileChange(info) { |
|
|
console.log(info); |
|
|
console.log(info); |
|
|
|
|
|
if (info.file.status === 'uploading') { |
|
|
|
|
|
if (!this.hideMessage) { |
|
|
|
|
|
this.hideMessage = this.$message.loading('上传中...'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// this.fileList = info.fileList; |
|
|
// this.fileList = info.fileList; |
|
|
// if (info.file.status === 'done') { |
|
|
if (info.file.status === 'done') { |
|
|
// this.files = []; |
|
|
this.files = []; |
|
|
// this.files = info.fileList[0].response.data[0].id; |
|
|
const img = `<img src=${info.file.response.data[0].visitUrl} >`; |
|
|
// console.log(this.files); |
|
|
this.needContent += img; |
|
|
// } |
|
|
setTimeout(this.hideMessage, 0); |
|
|
|
|
|
this.$message.success('上传成功'); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 显示表单输入框 |
|
|
// 显示表单输入框 |
|
@ -166,28 +187,35 @@ export default { |
|
|
|
|
|
|
|
|
// 点击确定 |
|
|
// 点击确定 |
|
|
handleOk() { |
|
|
handleOk() { |
|
|
console.log(this.needContent); |
|
|
this.subMitAdd(); |
|
|
// this.subMitAdd(); |
|
|
|
|
|
}, |
|
|
}, |
|
|
// 加入接口 |
|
|
// 加入接口 |
|
|
async subMitAdd() { |
|
|
async subMitAdd() { |
|
|
this.confirmLoading = true; |
|
|
this.confirmLoading = true; |
|
|
try { |
|
|
try { |
|
|
// const params = { param: {} }; |
|
|
const params = { |
|
|
// const res = await apply(params); |
|
|
param: { |
|
|
// const { code, msg, data } = res.data; |
|
|
title: this.platform.needName, |
|
|
// if (code === 200) { |
|
|
content: this.needContent, |
|
|
// this.$message.success('申请成功'); |
|
|
servics: this.platform.technicalField, |
|
|
// this.visible = false; |
|
|
deadline: this.platform.buildTime, |
|
|
// this.confirmLoading = false; |
|
|
existingBasis: this.platform.basics, |
|
|
// for (let key in this.platform) { |
|
|
models: this.platform.type, |
|
|
// this.platform[key] = ''; |
|
|
}, |
|
|
// } |
|
|
}; |
|
|
// this.platform.isTel = false; |
|
|
const res = await addTelease(params); |
|
|
// } else { |
|
|
const { code, msg, data } = res.data; |
|
|
// throw msg; |
|
|
if (code === 200) { |
|
|
// this.confirmLoading = false; |
|
|
this.$message.success('发榜成功'); |
|
|
// } |
|
|
this.visible = false; |
|
|
|
|
|
this.confirmLoading = false; |
|
|
|
|
|
for (let key in this.platform) { |
|
|
|
|
|
this.platform[key] = ''; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
throw msg; |
|
|
|
|
|
this.confirmLoading = false; |
|
|
|
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
this.$message.error(error); |
|
|
this.$message.error(error); |
|
|
this.confirmLoading = false; |
|
|
this.confirmLoading = false; |
|
|