|
|
|
@ -42,9 +42,11 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="素材内容" style="width: 100%">
|
|
|
|
|
<uploadFile @change="handlerUpload" :config="{ limit: 10, accept: '.jpg, .jpeg, .png, .gif, .mp4'}">
|
|
|
|
|
<el-button v-if="form.fileUrl == ''">上传文件</el-button>
|
|
|
|
|
<el-link v-else :href="$ImgUrl(form.fileUrl)" target="_blank">{{form.fileUrl}}</el-link>
|
|
|
|
|
<el-button>上传文件</el-button>
|
|
|
|
|
</uploadFile>
|
|
|
|
|
<el-link v-for="(item,index) in form.fileUrlList" :key="index" :href="$ImgUrl(item)" target="_blank">
|
|
|
|
|
{{item}}
|
|
|
|
|
</el-link>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="confirm">提交</el-button>
|
|
|
|
@ -69,7 +71,7 @@ export default defineComponent({
|
|
|
|
|
tagList: [],
|
|
|
|
|
brandList: [],
|
|
|
|
|
coverUrl: '',
|
|
|
|
|
fileUrl: '',
|
|
|
|
|
fileUrlList: [],
|
|
|
|
|
});
|
|
|
|
|
const tagData = ref([]);
|
|
|
|
|
const brandData = ref([]);
|
|
|
|
@ -102,7 +104,7 @@ export default defineComponent({
|
|
|
|
|
this.form.title = res.data.title;
|
|
|
|
|
res.data.brandList.forEach(ele => {this.form.brandList.push(ele.id)});
|
|
|
|
|
res.data.tagList.forEach(ele => {this.form.tagList.push(ele.id)});
|
|
|
|
|
this.form.fileUrl = res.data.fileUrl;
|
|
|
|
|
this.form.fileUrlList = res.data.fileUrlList;
|
|
|
|
|
this.form.coverUrl = res.data.coverUrl;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}
|
|
|
|
@ -123,7 +125,9 @@ export default defineComponent({
|
|
|
|
|
},
|
|
|
|
|
//素材上传
|
|
|
|
|
handlerUpload(data) {
|
|
|
|
|
this.form.fileUrl = data.fileUrl
|
|
|
|
|
if(data.fileUrl != null) {
|
|
|
|
|
this.form.fileUrlList.push(data.fileUrl)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
coverUpload(data) {
|
|
|
|
|
this.form.coverUrl = data.fileUrl
|
|
|
|
@ -136,4 +140,12 @@ export default defineComponent({
|
|
|
|
|
.form-area {
|
|
|
|
|
width: 600px
|
|
|
|
|
}
|
|
|
|
|
.img-upload {
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
color: #8c939d;
|
|
|
|
|
width: 135px;
|
|
|
|
|
height: 135px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border: 1px solid;
|
|
|
|
|
}
|
|
|
|
|
</style>
|