From 915aa9658845f54442ccf2eeb0cc60e97323e808 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期三, 26 三月 2025 10:35:39 +0800 Subject: [PATCH] bug修改 --- src/views/templateManage/components/templateDialog.vue | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/views/templateManage/components/templateDialog.vue b/src/views/templateManage/components/templateDialog.vue index a1f70b9..ed46170 100644 --- a/src/views/templateManage/components/templateDialog.vue +++ b/src/views/templateManage/components/templateDialog.vue @@ -43,7 +43,7 @@ v-model:file-list="state.form.fileList" :action="uploadFileUrl" :headers="state.header" - :remove="handleRemove" + :on-remove="handleRemove" :on-success="handleAvatarSuccess" :on-change="handleChange" accept=".pdf,.word" @@ -58,9 +58,16 @@ </el-form-item> </el-col> </el-row> - <el-form-item label="签署效果预览:" style="display: flex;flex-direction: column;align-items: flex-start"> - <div style="width: 500px;height: 100px;margin-left: 50px"> - + <el-form-item label="签署效果预览:" style="display: flex;flex-direction: column;align-items: flex-start;width: 100%"> + <div style="width: 100%;height: auto;margin-left: 50px"> + <iframe + v-if="state.iframeSrc" + :src="state.iframeSrc" + width="100%" + height="750px" + class="custom-iframe" + ></iframe> + <el-empty v-else></el-empty> </div> </el-form-item> </el-form> @@ -103,6 +110,7 @@ header: { Authorization: getToken() }, + iframeSrc: '', deptName: '', typeList: [], limit: 1, @@ -126,6 +134,7 @@ url : import.meta.env.VITE_APP_BASE_API + state.form.filePath } state.form.fileList = [obj] + state.iframeSrc = import.meta.env.VITE_APP_BASE_API + state.form.filePath }else { state.form.fileList = [] } @@ -204,8 +213,10 @@ typeId:null, deptId: null, filePath: '', - fileList: [] + fileList: [], + } + state.iframeSrc = '' } const handleRemove = (file) => { @@ -213,6 +224,7 @@ const newFileList = state.form.fileList.slice() newFileList.splice(index, 1) state.form.fileList = newFileList; + state.iframeSrc = '' } const f = ref() const handleChange = (file,fileList) => { @@ -231,6 +243,7 @@ // message: '文件上传成功' // }) state.form.filePath = res.fileName + state.iframeSrc = import.meta.env.VITE_APP_BASE_API + state.form.filePath }else { state.form.fileList = [] ElMessage({ @@ -250,10 +263,18 @@ :deep(.el-form .el-form-item__label) { font-size: 15px; } + :deep(.el-form-item__content) { + width: 100%; + } .file { display: flex; flex-direction: column; align-items: flex-start; } + .custom-iframe { + border: 1px solid #9b9999; + /* 隐藏原生滚动条 */ + overflow: hidden; + } } </style> -- Gitblit v1.9.2