Commit 7e56c3df authored by 黄奎's avatar 黄奎

插件新增字段

parent a180f7e6
......@@ -142,6 +142,17 @@
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="高度">
<el-input type="text" size="small"
v-model="rubData.data.height" >
<template slot="append">px</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
......@@ -518,7 +529,7 @@
return `height: ${this.rubData.data.height}px;background-size: ${per}px ${per}px;`;
} else {
if (index === 0) {
this.rubData.data.height = 'auto';
//this.rubData.data.height = 'auto';
if (this.rubData.data.list && this.rubData.data.list.length > 0) {
return `height: ${this.rubData.data.list[0].pic_url ? 'auto' : '360px'}`;
}
......@@ -654,7 +665,7 @@
height = `calc(${height} - ${space * hMultiple}px)`;
}
if (this.rubData.data.style === 0 && isPreview && this.rubData.data.list[0].pic_url) {
height = 'auto';
//height = 'auto';
}
block.width = width;
......
......@@ -177,61 +177,15 @@ export default {
Vue.prototype.UploadFileToTencent = function (path, fileObj, callback) {
// debugger;
var upInfo = JSON.parse(localStorage.uploadInfo);
let maxSize = 500 * 1024
if ((fileObj.type == "image/png" || fileObj.type == "image/jpeg") && fileObj.size > maxSize) {
let that = this
lrz(fileObj, {
width: 750,
quality: 0.8
})
.then(function (rst) {
//成功时执行
var arr = rst.base64.split(',');
var mime = arr[0].match(/:(.*?);/)[1];
var bstr = atob(arr[1]);
var n = bstr.length;
var u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
var newFile = new File([u8arr], fileObj.name, {
type: mime
});
if (upInfo && upInfo.IsDefault == 1) {
if (upInfo.StoreType == 1) {
that.uploadStart(path, newFile, callback)
}
if (upInfo.StoreType == 2) {
that.uploadToAli(path, newFile, callback)
}
} else {
that.Error('请先配置上传');
}
}).catch(function (error) {
if (upInfo && upInfo.IsDefault == 1) {
if (upInfo.StoreType == 1) {
that.uploadStart(path, fileObj, callback)
}
if (upInfo.StoreType == 2) {
that.uploadToAli(path, fileObj, callback)
}
} else {
that.Error('请先配置上传');
}
}).always(function () {
//不管成功或失败,都会执行
})
} else {
if (upInfo && upInfo.IsDefault == 1) {
if (upInfo.StoreType == 1) {
this.uploadStart(path, fileObj, callback)
}
if (upInfo.StoreType == 2) {
this.uploadToAli(path, fileObj, callback)
}
} else {
this.Error('请先配置上传');
if (upInfo && upInfo.IsDefault == 1) {
if (upInfo.StoreType == 1) {
this.uploadStart(path, fileObj, callback)
}
if (upInfo.StoreType == 2) {
this.uploadToAli(path, fileObj, callback)
}
} else {
this.Error('请先配置上传');
}
},
Vue.prototype.uploadStart = function (path, fileObj, callback) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment