| | |
| | | style="position: absolute" |
| | | :data-url="v.path" |
| | | v-if="getRoutePath === v.path" |
| | | @load="iframeLoad" |
| | | ref="iframeRef" |
| | | /> |
| | | </transition-group> |
| | | </div> |
| | | </div> |
| | | <AmisPageOptDlg v-model="amisPageShow" :item="amisPageMapRow" @insert="amisPageInsert" @update="amisPageUpdate" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts" name="layoutIframeView"> |
| | | import { computed, watch, ref, nextTick } from 'vue'; |
| | | import { useRoute } from 'vue-router'; |
| | | import AmisPageOptDlg from '/@/views/project/yw/lowCode/sqlAmis/optDlg/OptDlg.vue'; |
| | | import emitter from '/@/utils/mitt'; |
| | | |
| | | // 定义父组件传过来的值 |
| | | const props = defineProps({ |
| | |
| | | deep: true, |
| | | } |
| | | ); |
| | | |
| | | const iframeLoad = () => { |
| | | setTimeout(() => { |
| | | window.frames[0].openOptAmisPageDlg = () => { |
| | | amisPageShow.value = true; |
| | | }; |
| | | window.frames[0].updatePublished = (id, published) => { |
| | | emitter.emit('supervisor.publish', { |
| | | id, |
| | | published, |
| | | }); |
| | | }; |
| | | }, 0); |
| | | }; |
| | | |
| | | //#region ====================== iframe 交互 ====================== |
| | | const amisPageShow = ref(false); |
| | | const amisPageMapRow = ref(null); |
| | | |
| | | const amisPageInsert = (...params) => { |
| | | window.frames?.[0]?.amisPageInsert?.(...params); |
| | | }; |
| | | |
| | | const amisPageUpdate = (...params) => { |
| | | window.frames?.[0]?.amisPageUpdate?.(...params); |
| | | }; |
| | | |
| | | //#endregion |
| | | </script> |