|
@@ -1,33 +1,38 @@
|
|
|
<template>
|
|
|
- <HcCard>
|
|
|
+ <hc-card>
|
|
|
<template #header>
|
|
|
- <el-button size="large" type="primary">
|
|
|
- <HcIcon name="search-2" />
|
|
|
- <span>搜索</span>
|
|
|
- </el-button>
|
|
|
+ <el-button hc-btn type="primary" @click="test1Click">测试1</el-button>
|
|
|
+ <el-button hc-btn type="warning" @click="test2Click">测试2</el-button>
|
|
|
</template>
|
|
|
- <template #extra>
|
|
|
- extra
|
|
|
- </template>
|
|
|
-
|
|
|
- <iframe v-if="isPdf" :src="source" width="100%" height="100%" />
|
|
|
-
|
|
|
- <template #action>
|
|
|
- action
|
|
|
- </template>
|
|
|
- </HcCard>
|
|
|
+ 测试的
|
|
|
+ </hc-card>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref } from 'vue'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+import { encode } from '~uti/btn-auth'
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
|
|
|
-const isPdf = ref(false)
|
|
|
-const url = 'https://bladex-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240118/bf848a1a64acf788f8dfd4acb0d95582.pdf'
|
|
|
-const source = ref(`/plugins/pdfjs/4.0.379/web/viewer.html?file=${url}#zoom=100`)
|
|
|
+const test1Click = () => {
|
|
|
+ const url = encode('https://bladex-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240118/bf848a1a64acf788f8dfd4acb0d95582.pdf')
|
|
|
+ router.push({
|
|
|
+ name: 'pdf',
|
|
|
+ query: {
|
|
|
+ code: url,
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
- isPdf.value = true
|
|
|
-})
|
|
|
+const test2Click = () => {
|
|
|
+ const url = encode('https://bladex-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20230925/0a604927fb3584a2860c757ee9afd12f.pdf')
|
|
|
+ router.push({
|
|
|
+ name: 'pdf',
|
|
|
+ query: {
|
|
|
+ code: url,
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|