aaa
This commit is contained in:
@@ -642,7 +642,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="PurchasingRequisitionAdd">
|
<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 { useRouter } from 'vue-router'
|
||||||
import { addObj, tempStore } from '/@/api/finance/purchasingrequisition';
|
import { addObj, tempStore } from '/@/api/finance/purchasingrequisition';
|
||||||
import { getTree } from '/@/api/finance/purchasingcategory';
|
import { getTree } from '/@/api/finance/purchasingcategory';
|
||||||
@@ -1333,6 +1333,20 @@ watch(() => categoryTreeData.value, () => {
|
|||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
onMounted(async () => {
|
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([
|
await Promise.all([
|
||||||
getCategoryTreeData(),
|
getCategoryTreeData(),
|
||||||
getFundSourceDict(),
|
getFundSourceDict(),
|
||||||
@@ -1382,3 +1396,12 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* 当页面在 iframe 中时,允许 #app 滚动 */
|
||||||
|
#app.iframe-mode {
|
||||||
|
overflow: auto !important;
|
||||||
|
height: auto !important;
|
||||||
|
min-height: 100% !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -221,6 +221,7 @@
|
|||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:close-on-press-escape="true"
|
:close-on-press-escape="true"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
|
class="iframe-dialog"
|
||||||
@close="closeAddIframe">
|
@close="closeAddIframe">
|
||||||
<div class="iframe-dialog-content">
|
<div class="iframe-dialog-content">
|
||||||
<iframe
|
<iframe
|
||||||
@@ -362,17 +363,40 @@ onUnmounted(() => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
min-height: 500px;
|
min-height: 500px;
|
||||||
|
max-height: calc(100vh - 200px);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.add-iframe {
|
.add-iframe {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
min-height: 500px;
|
||||||
border: none;
|
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;
|
padding: 20px;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
max-height: calc(100vh - 200px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user