Browse Source

涉访涉诉--附件路径修改

master
buaixuexideshitongxue 4 weeks ago
parent
commit
26ae9060ab
  1. 28
      src/components/file/list.vue

28
src/components/file/list.vue

@ -13,7 +13,7 @@
<div
class="img-box"
:style="{
backgroundImage: `url(${BASE_PATH}/file/stream/${item.filePath})`,
backgroundImage: `url(${getFilepath(item.filePath)})`,
}"
@click="filePreview(item, index)"
></div>
@ -69,7 +69,7 @@
@wheel="wheel"
>
<img
:src="`${BASE_PATH}/file/stream/${activeFile.filePath}`"
:src="getFilepath(activeFile.filePath)"
ref="imgRef"
@click.stop
:style="{
@ -101,7 +101,7 @@
v-else-if="getFileType(activeFile.fileName) === FileType.PDF"
>
<iframe
:src="`${BASE_PATH}/file/stream/${activeFile.filePath}`"
:src="getFilepath(activeFile.filePath)"
style="height: 100vh; width: 900px"
></iframe>
</template>
@ -110,7 +110,7 @@
>
<audio controls style="width: 50vw">
<source
:src="`${BASE_PATH}/file/stream/${activeFile.filePath}`"
:src="getFilepath(activeFile.filePath)"
type="audio/mp3"
/>
</audio>
@ -120,7 +120,7 @@
>
<video controls @click.stop style="max-height: 100vh">
<source
:src="`${BASE_PATH}/file/stream/${activeFile.filePath}`"
:src="getFilepath(activeFile.filePath)"
type="video/mp4"
/>
</video>
@ -129,7 +129,7 @@
v-else-if="getFileType(activeFile.fileName) === FileType.WORD"
>
<vue-office-docx
:src="`${BASE_PATH}/file/stream/${activeFile.filePath}`"
:src="getFilepath(activeFile.filePath)"
style="height: 100vh; width: 900px"
@error="fileRrror = true"
v-if="!fileRrror"
@ -270,7 +270,8 @@ function remove(index) {
}
function download() {
window.open(`${BASE_PATH}/file/stream/${activeFile.value.filePath}`);
// window.open(`${BASE_PATH}/file/stream/${activeFile.value.filePath}`);
window.open(getFilepath(activeFile.value.filePath));
}
function prev() {
@ -347,6 +348,19 @@ function rotateRight() {
rotate.value -= 90;
}
}
const filePath = computed(() => {
// `${BASE_PATH}/file/stream/${activeFile.filePath}`
return getFilepath(activeFile.value.filePath)
})
function getFilepath(path) {
if (path.startsWith('http://')) {
return path;
} else {
return `${BASE_PATH}/file/stream/${path}`;
}
}
</script>
<style lang="scss" scoped>
.file-container {

Loading…
Cancel
Save