Browse Source

创新挑战

master
aBin 4 years ago
parent
commit
9427eee5c9
  1. 6
      src/views/Business/components/SearchBox.vue
  2. 2
      src/views/Challenge/Children/Release.vue
  3. 74
      src/views/Challenge/Children/components/Publish.vue

6
src/views/Business/components/SearchBox.vue

@ -1,6 +1,6 @@
<template>
<div class="search-list">
<span style="font-size: 20px; font-weight: blod; color: rgba(0, 0, 0, 0.85)">栏目</span>
<span style="height: 28px; line-height: 28px; font-size: 20px; font-weight: bold; color: rgba(0, 0, 0, 0.85)">栏目</span>
<!-- <a-select allow-clear style="width: 120px" @change="handleChange">
<a-select-option v-for="(item, index) in bannerList" :key="index" :value="index + 1"> {{ item }} </a-select-option>
</a-select> -->
@ -14,7 +14,7 @@
{{ item }}
</span>
<br />
<span style="font-size: 20px; font-weight: blod; color: rgba(0, 0, 0, 0.85)">类型</span>
<span style="font-size: 20px; font-weight: bold; color: rgba(0, 0, 0, 0.85)">类型</span>
<span
class="ban-style"
:class="typeNum === index + 1 ? 'ban-act' : ''"
@ -25,7 +25,7 @@
{{ item }}
</span>
<br />
<span style="font-size: 20px; font-weight: blod; color: rgba(0, 0, 0, 0.85)">时间</span>
<span style="font-size: 20px; font-weight: bold; color: rgba(0, 0, 0, 0.85)">时间</span>
<span
class="ban-style"
:class="timeNum === index + 1 ? 'ban-act' : ''"

2
src/views/Challenge/Children/Release.vue

@ -4,7 +4,7 @@
<div class="d-flex flex-wrap" v-if="lists.length > 0">
<div :class="(index + 1) % 4 === 0 ? 'margin-0' : ''" :key="index" class="pro-box" v-for="(item, index) in lists">
<p class="pro-title">{{ item.title }}</p>
<p class="pro-content">{{ item.content }}</p>
<div class="pro-content" v-dompurify-html="item.content"></div>
<p class="pro-time">时间{{ item.deadline }}</p>
<unveiling :pro-id="item.id" class="pro-btn" type="primary" />
</div>

74
src/views/Challenge/Children/components/Publish.vue

@ -35,6 +35,16 @@
ref="myQuillEditor"
v-model="needContent"
></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 :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.snow.css';
import 'quill/dist/quill.bubble.css';
import { upload, addTelease } from 'config/api';
const formItemLayout = {
labelCol: { span: 5 },
@ -87,6 +98,7 @@ export default {
form: this.$form.createForm(this, { name: 'submit' }),
visible: false,
title: '发榜',
action: upload,
formItemLayout,
formTailLayout,
confirmLoading: false,
@ -99,7 +111,8 @@ export default {
handlers: {
image: function(value) {
if (value) {
alert('自定义图片');
// alert('');
document.getElementById('upload-img').click();
} else {
this.quill.format('image', false);
}
@ -122,6 +135,7 @@ export default {
type: [],
buildTime: '',
},
hideMessage: null,
};
},
@ -147,12 +161,19 @@ export default {
//
fileChange(info) {
console.log(info);
if (info.file.status === 'uploading') {
if (!this.hideMessage) {
this.hideMessage = this.$message.loading('上传中...');
}
}
// this.fileList = info.fileList;
// if (info.file.status === 'done') {
// this.files = [];
// this.files = info.fileList[0].response.data[0].id;
// console.log(this.files);
// }
if (info.file.status === 'done') {
this.files = [];
const img = `<img src=${info.file.response.data[0].visitUrl} >`;
this.needContent += img;
setTimeout(this.hideMessage, 0);
this.$message.success('上传成功');
}
},
//
@ -166,28 +187,35 @@ export default {
//
handleOk() {
console.log(this.needContent);
// this.subMitAdd();
this.subMitAdd();
},
//
async subMitAdd() {
this.confirmLoading = true;
try {
// const params = { param: {} };
// const res = await apply(params);
// const { code, msg, data } = res.data;
// if (code === 200) {
// this.$message.success('');
// this.visible = false;
// this.confirmLoading = false;
// for (let key in this.platform) {
// this.platform[key] = '';
// }
// this.platform.isTel = false;
// } else {
// throw msg;
// this.confirmLoading = false;
// }
const params = {
param: {
title: this.platform.needName,
content: this.needContent,
servics: this.platform.technicalField,
deadline: this.platform.buildTime,
existingBasis: this.platform.basics,
models: this.platform.type,
},
};
const res = await addTelease(params);
const { code, msg, data } = res.data;
if (code === 200) {
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) {
this.$message.error(error);
this.confirmLoading = false;

Loading…
Cancel
Save