..
This commit is contained in:
@@ -21,7 +21,7 @@ module.exports = {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog title="流程图预览" :visible.sync="designVisible" width="80%" top="50px" append-to-body>
|
||||
<el-dialog title="流程图预览" :visible.sync="designVisible" fullscreen width="80%" top="50px" append-to-body>
|
||||
<div class="diagram-viewer">
|
||||
<iframe v-if="designVisible" :src="designUrl" frameborder="0"></iframe>
|
||||
</div>
|
||||
@@ -30,7 +30,8 @@ module.exports = {
|
||||
|
||||
<style scoped>
|
||||
.diagram-viewer {
|
||||
height: 65vh;
|
||||
/*height: 65vh;*/
|
||||
height: calc(100vh - 60px - 55px);
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<el-button :size="upload_button_size" type="primary">
|
||||
{{ upload_text }}
|
||||
</el-button>
|
||||
<div class="el-upload__tip" v-html="upload_tips"></div>
|
||||
</el-upload>
|
||||
|
||||
<!-- 图片上传模式 -->
|
||||
@@ -123,6 +124,12 @@ module.exports = {
|
||||
default: 1,
|
||||
required: false
|
||||
},
|
||||
// 上传文件大小限制
|
||||
upload_size: {
|
||||
type: Number,
|
||||
default: 1024 * 1024 * 10,
|
||||
required: false
|
||||
},
|
||||
// 上传按钮文字
|
||||
upload_text: {
|
||||
type: String,
|
||||
@@ -190,6 +197,8 @@ module.exports = {
|
||||
upload_tips() {
|
||||
const uploadNumber = this.upload_number
|
||||
const fileAccept = this.fileAccept
|
||||
const fileSize = this.upload_size
|
||||
|
||||
let tips = null
|
||||
if (uploadNumber) {
|
||||
tips = `只能上传<span style="color: red">${uploadNumber}</span>个文件;`
|
||||
@@ -197,6 +206,9 @@ module.exports = {
|
||||
if (fileAccept) {
|
||||
tips = tips + `只能上传<span style="color: red">${fileAccept}</span>文件;`
|
||||
}
|
||||
if (fileSize) {
|
||||
tips = tips + `单个文件大小不能超过<span style="color: red">${fileSize / 1024 / 1024}</span>M;`
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
@@ -290,6 +302,13 @@ module.exports = {
|
||||
|
||||
// 这是兜底逻辑,保准只让这个image类型上传图片
|
||||
beforeUpload(file) {
|
||||
|
||||
if (file.size > this.upload_size) {
|
||||
this.$message.error("文件过大,请上传小于" + (this.upload_size / 1024 / 1024).toFixed(0) + "M的文件!")
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
return true
|
||||
|
||||
// if (!this.fileAccept || typeof this.fileAccept !== "string") {
|
||||
@@ -562,6 +581,7 @@ module.exports = {
|
||||
|
||||
.upload_file .el-upload {
|
||||
/*width: 100%;*/
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.upload_file .el-upload .el-upload-dragger {
|
||||
@@ -583,17 +603,17 @@ module.exports = {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.el-upload--picture-card{
|
||||
width: var(--upload-width, 148px)!important;
|
||||
height: var(--upload-height, 148px)!important;
|
||||
.el-upload--picture-card {
|
||||
width: var(--upload-width, 148px) !important;
|
||||
height: var(--upload-height, 148px) !important;
|
||||
/*line-height: calc(var(--upload-height, 148px) - 2px) !important;*/
|
||||
line-height: unset!important;
|
||||
line-height: unset !important;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-upload-list--picture-card .el-upload-list__item{
|
||||
.el-upload-list--picture-card .el-upload-list__item {
|
||||
width: var(--upload-width, 148px);
|
||||
height: var(--upload-height, 148px);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user