1
This commit is contained in:
32
pages/lims/documentList/preview.vue
Normal file
32
pages/lims/documentList/preview.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<up-icon size="20" class="close-icon" @click="handleClose" name="close-circle"></up-icon>
|
||||
<web-view :src="previewUrl"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import CryptoJS from 'crypto-js'
|
||||
import { getImgBaseUrl } from '@/defaultBaseUrl'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
let previewUrl = ref('')
|
||||
onLoad(option => {
|
||||
let url = encodeURIComponent(
|
||||
CryptoJS.enc.Utf8.parse(getImgBaseUrl() + option.documentUrl).toString(CryptoJS.enc.Base64)
|
||||
)
|
||||
previewUrl.value = getImgBaseUrl() + '/preview/onlinePreview?url=' + url
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
.close-icon {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
z-index: 999999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user