公告管理
This commit is contained in:
1 parent
374ce74e2d
commit
c0621ff48b
15 files changed
+4641
No files matched your search
@@ -0,0 +1,48 @@
|
||||
|
||||
<template id="pdf-viewer">
|
||||
<div style="width: 100%; padding: 65% 0;position: relative;">
|
||||
<iframe :src="'/<$ ctx.app.config.appId $>/public/pdf/web/viewer.html?file=' + src" frameborder="0" style="position: absolute;width: 100%; height: 100%; top: 0;left: 0"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
Vue.component("pdf-viewer", {
|
||||
template: "#pdf-viewer",
|
||||
name: "pdf-viewer",
|
||||
props: {
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
appId: '<$ ctx.app.config.appId $>',
|
||||
prefix: '<$ ctx.app.config.downloadBasePath $>',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
src() {
|
||||
if (this.params.src) {
|
||||
// 替换appId
|
||||
const src = this.params.src.replace('__appId__', this.appId);
|
||||
if (src.includes('/upload/')) {
|
||||
return encodeURIComponent(this.prefix + '/' + src.split('upload')[1]);
|
||||
} else {
|
||||
return encodeURIComponent(this.prefix + src);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in new issue
Block a user