-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
281 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
184 changes: 184 additions & 0 deletions
184
web/src/management/pages/edit/modules/contentModule/PreviewPanel.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
<template> | ||
<div class="preview-panel"> | ||
<div class="preview-btn" @click="dialogTableVisible = true"> | ||
<i-ep-view class="view-icon" :size="20" /> | ||
<span class="btn-txt">预览</span> | ||
</div> | ||
<el-dialog | ||
:z-index="99999" | ||
top="50px" | ||
class="preview-config-wrapper" | ||
:destroy-on-close="true" | ||
:show-close="false" | ||
@open="openDialog" | ||
@closed="closedDialog" | ||
v-model="dialogTableVisible" | ||
:width="`${previewTab == 1 ? '398' : '1290'}`" | ||
> | ||
<div class="ml75"> | ||
<div class="preview-tab"> | ||
<div :class="`preview-tab-item ${previewTab == 1 ? 'active' : ''}`" @click="previewTab = 1"> | ||
<i-ep-iphone /> | ||
</div> | ||
<div :class="`preview-tab-item ${previewTab == 2 ? 'active' : ''}`" @click="previewTab = 2"> | ||
<i-ep-monitor /> | ||
</div> | ||
</div> | ||
<div :class="`preview-panel ${previewTab == 1 ? 'phone' : 'pc'}`"> | ||
<div class="wrapper"> | ||
<div class="tips-wrapper"> | ||
<i-ep-WarningFilled /> <span>用户预览模式,数据不保存!</span> | ||
</div> | ||
<div v-loading="loading" element-loading-text="加载中..." style="height: 100%"> | ||
<iframe | ||
v-loading="loading" | ||
id="iframe-preview" | ||
:src="`/management/preview/${surveyId}`" | ||
frameborder="0" | ||
width="100%" | ||
height="100%" | ||
></iframe> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</el-dialog> | ||
</div> | ||
</template> | ||
<script setup> | ||
import { ref } from 'vue' | ||
import { useRoute } from 'vue-router' | ||
const route = useRoute() | ||
const dialogTableVisible = ref(false) | ||
const previewTab = ref(1) | ||
const surveyId = route.params.id | ||
const loading = ref(true) | ||
const openDialog = () => { | ||
const iframePreview = document.getElementById('iframe-preview') | ||
if (!iframePreview) return | ||
iframePreview.onload = function () { | ||
loading.value = false | ||
} | ||
} | ||
const closedDialog = () => { | ||
loading.value = true | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
.preview-panel { | ||
:deep(.preview-config-wrapper) { | ||
background-color: transparent; | ||
box-shadow: none; | ||
padding: 0; | ||
} | ||
.ml75{ | ||
margin-left: 75px; | ||
} | ||
.preview-btn { | ||
width: 50px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
color: #4a4c5b; | ||
cursor: pointer; | ||
i { | ||
font-size: 20px; | ||
} | ||
.btn-txt { | ||
font-size: 12px; | ||
} | ||
} | ||
.view-icon { | ||
font-size: 18px; | ||
margin-bottom: 4px; | ||
} | ||
.preview-tab { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
.border-right-none { | ||
border-right: none; | ||
} | ||
.active { | ||
border-color: $primary-color; | ||
color: $primary-color; | ||
} | ||
.border-left-none { | ||
border-left: none; | ||
} | ||
&-item { | ||
width: 80px; | ||
height: 30px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background: #ffffff; | ||
border: 1px solid rgba(227, 228, 232, 1); | ||
cursor: pointer; | ||
&:hover { | ||
border-color: $primary-color; | ||
color: $primary-color; | ||
} | ||
} | ||
} | ||
.preview-panel { | ||
margin-top: 16px; | ||
&.pc { | ||
display: flex; | ||
justify-content: center; | ||
background: #ffffff; | ||
box-shadow: 0px 2px 10px -2px rgba(82, 82, 102, 0.2); | ||
height: 726px; | ||
.wrapper { | ||
width: 636px; | ||
height: 704px; | ||
} | ||
} | ||
&.phone { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
.wrapper { | ||
background: url('/imgs/preview-phone.png') no-repeat; | ||
width: 328px; | ||
height: 678px; | ||
background-size: 100% 100%; | ||
padding: 0 14px; | ||
padding-top: 58px; | ||
padding-bottom: 14px; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
iframe { | ||
border-radius: 0px 0px 20px 20px; | ||
} | ||
} | ||
} | ||
.tips-wrapper { | ||
display: flex; | ||
align-items: center; | ||
background: $primary-bg-color; | ||
color: $primary-color; | ||
font-size: 12px; | ||
padding: 2px 0; | ||
padding-left: 9px; | ||
span { | ||
margin-left: 5px; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters