广告增加建议尺寸
This commit is contained in:
parent
fdb9cad723
commit
852e1733f8
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div
|
||||
class="component-upload-image"
|
||||
<div
|
||||
class="component-upload-image"
|
||||
@mouseenter="handleMouseEnter"
|
||||
@mouseleave="handleMouseLeave"
|
||||
>
|
||||
|
@ -26,7 +26,7 @@
|
|||
drag
|
||||
>
|
||||
<!-- 粘贴区域(隐藏) -->
|
||||
<textarea
|
||||
<textarea
|
||||
ref="pasteArea"
|
||||
class="paste-area"
|
||||
@paste="handlePaste"
|
||||
|
@ -66,6 +66,9 @@
|
|||
|
||||
<!-- 上传提示 -->
|
||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||
<div style="color: #909399; margin-bottom: 8px;">
|
||||
建议尺寸:700×286
|
||||
</div>
|
||||
请上传
|
||||
<template v-if="fileSize">大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
||||
<template v-if="fileType">格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
|
||||
|
@ -175,7 +178,7 @@ export default {
|
|||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map(item => {
|
||||
if (typeof item === "string") {
|
||||
return {
|
||||
return {
|
||||
name: item, // 保持原始名称,用于判断文件类型
|
||||
url: this.getRealUrl(item)
|
||||
};
|
||||
|
@ -246,7 +249,7 @@ export default {
|
|||
return {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
};
|
||||
}
|
||||
}
|
||||
return {};
|
||||
},
|
||||
},
|
||||
|
@ -290,9 +293,9 @@ export default {
|
|||
handlePaste(event) {
|
||||
// 阻止默认行为
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
const items = event.clipboardData?.items;
|
||||
|
||||
|
||||
if (!items) {
|
||||
this.$modal.msgError('当前浏览器不支持粘贴上传');
|
||||
return;
|
||||
|
@ -343,7 +346,7 @@ export default {
|
|||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.handleUploadSuccess(response.data, file);
|
||||
} catch (error) {
|
||||
this.handleUploadError();
|
||||
|
@ -396,14 +399,14 @@ export default {
|
|||
handleUploadSuccess(res, file) {
|
||||
if (this.host === 'qiniu') {
|
||||
// 七牛云返回的是文件信息
|
||||
this.uploadList.push({
|
||||
this.uploadList.push({
|
||||
name: res.key,
|
||||
url: process.env.VUE_APP_QINIU_DOMAIN + '/' + res.key // 需要配置七牛云域名
|
||||
});
|
||||
this.uploadedSuccessfully();
|
||||
} else {
|
||||
if (res.code === 200) {
|
||||
this.uploadList.push({
|
||||
this.uploadList.push({
|
||||
name: file.name, // 保持原始文件名
|
||||
url: res.fileName // 保持原始返回的URL
|
||||
});
|
||||
|
@ -518,7 +521,7 @@ export default {
|
|||
object-fit: cover;
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
|
||||
&.is-file {
|
||||
.el-upload-list__item-thumbnail {
|
||||
padding: 20px;
|
||||
|
@ -549,7 +552,7 @@ export default {
|
|||
cursor: default;
|
||||
text-align: center;
|
||||
transition: opacity .3s;
|
||||
|
||||
|
||||
.el-upload-list__item-delete {
|
||||
position: static;
|
||||
font-size: inherit;
|
||||
|
|
|
@ -118,7 +118,9 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="广告图片" prop="picture">
|
||||
<div class="upload-wrapper">
|
||||
<image-upload v-model="form.picture" :limit="1"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转类型" prop="urlType">
|
||||
<el-select v-model="form.urlType" placeholder="请选择跳转类型">
|
||||
|
|
Loading…
Reference in New Issue
Block a user