This commit is contained in:
2026-02-02 16:21:24 +08:00
parent eb59cc8e2e
commit 3684116b2d
2 changed files with 50 additions and 3 deletions

View File

@@ -642,7 +642,7 @@
</template>
<script setup lang="ts" name="PurchasingRequisitionAdd">
import { reactive, ref, onMounted, computed, watch } from 'vue'
import { reactive, ref, onMounted, computed, watch, nextTick } from 'vue'
import { useRouter } from 'vue-router'
import { addObj, tempStore } from '/@/api/finance/purchasingrequisition';
import { getTree } from '/@/api/finance/purchasingcategory';
@@ -1333,6 +1333,20 @@ watch(() => categoryTreeData.value, () => {
// 初始化
onMounted(async () => {
// 检测是否在 iframe 中,如果是,则修改 #app 的 overflow 样式以支持滚动
if (window.parent !== window) {
nextTick(() => {
const app = document.getElementById('app');
if (app) {
app.style.overflow = 'auto';
app.style.height = 'auto';
app.style.minHeight = '100%';
// 添加一个类名标记,方便样式控制
app.classList.add('iframe-mode');
}
});
}
await Promise.all([
getCategoryTreeData(),
getFundSourceDict(),
@@ -1382,3 +1396,12 @@ onMounted(async () => {
}
</style>
<style>
/* 当页面在 iframe 中时,允许 #app 滚动 */
#app.iframe-mode {
overflow: auto !important;
height: auto !important;
min-height: 100% !important;
}
</style>

View File

@@ -221,6 +221,7 @@
:close-on-click-modal="false"
:close-on-press-escape="true"
destroy-on-close
class="iframe-dialog"
@close="closeAddIframe">
<div class="iframe-dialog-content">
<iframe
@@ -362,17 +363,40 @@ onUnmounted(() => {
width: 100%;
height: 70vh;
min-height: 500px;
max-height: calc(100vh - 200px);
position: relative;
overflow: hidden;
.add-iframe {
width: 100%;
height: 100%;
min-height: 500px;
border: none;
display: block;
}
}
:deep(.el-dialog__body) {
:deep(.iframe-dialog) {
.el-dialog {
display: flex;
flex-direction: column;
max-height: 90vh;
margin-top: 5vh !important;
}
.el-dialog__header {
flex-shrink: 0;
padding: 20px 20px 10px;
}
.el-dialog__body {
padding: 20px;
overflow-y: auto;
overflow-x: hidden;
flex: 1;
min-height: 0;
max-height: calc(100vh - 200px);
}
}
</style>