|
@@ -1,21 +1,14 @@
|
|
|
<template>
|
|
|
- <hc-new-card>
|
|
|
- <template #extra>
|
|
|
- <el-button type="primary" @click="goBack">
|
|
|
- <HcIcon name="close" />
|
|
|
- 关闭
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
+ <div class="hc-pdf-page-box">
|
|
|
<hc-pdf :src="pdfUrl" :download="isDownload" :print="isPrint" />
|
|
|
- </hc-new-card>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { isNullES } from 'js-fast-way'
|
|
|
-import { onActivated, ref } from 'vue'
|
|
|
+import { onMounted, ref } from 'vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import { btnAuth, decode } from '~uti/btn-auth'
|
|
|
-import router from '~src/router/index'
|
|
|
|
|
|
//初始变量
|
|
|
const useRoutes = useRoute()
|
|
@@ -28,7 +21,7 @@ defineOptions({
|
|
|
|
|
|
//渲染完成
|
|
|
const pdfUrl = ref('')
|
|
|
-onActivated(() => {
|
|
|
+onMounted(() => {
|
|
|
const { url, code } = useRoutes.query
|
|
|
//如果url和code都为空,不做处理
|
|
|
if (isNullES(url) && isNullES(code)) {
|
|
@@ -47,7 +40,13 @@ onActivated(() => {
|
|
|
//两个都有的情况下,以code为准
|
|
|
pdfUrl.value = decode(code ?? '')
|
|
|
})
|
|
|
-const goBack = ()=>{
|
|
|
- router.back()
|
|
|
-}
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.hc-pdf-page-box {
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+</style>
|