展示优化
This commit is contained in:
parent
32aecd8b1d
commit
892a6c5543
|
|
@ -38,7 +38,7 @@
|
|||
@app-ready="handleAppReady" @error="handleError" @initialized="handleInitialized" :force-save="true"
|
||||
:save-timeout="15000" />
|
||||
</el-dialog> -->
|
||||
<ViewFile v-if="dialogVisible" :file="fileData" @closeDialog="handleCloseDialog" />
|
||||
<ViewFile v-if="dialogVisible" :file="fileData" @closeDialog="handleCloseDialog" :without-modal="withoutModal" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -106,6 +106,10 @@ export default {
|
|||
imageHeight: {
|
||||
type: [Number, String],
|
||||
default: 400
|
||||
},
|
||||
withoutModal: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -138,7 +142,7 @@ export default {
|
|||
// 文件点击事件
|
||||
handleFileClick() {
|
||||
console.log(this.file);
|
||||
|
||||
|
||||
this.fileData = this.file
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
|
@ -279,4 +283,4 @@ export default {
|
|||
}
|
||||
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="dialogVisible" width="50%" class="preview-dialog" title="文件预览" @close="handleClose">
|
||||
<el-dialog :visible.sync="dialogVisible" width="50%" class="preview-dialog" title="文件预览" @close="handleClose" :modal="!withoutModal">
|
||||
<OnlyOfficeViewer :document-url="documentUrl" :document-title="documentTitle" :document-key="documentKey"
|
||||
:mode="mode" :type="type" @document-ready="handleDocumentReady" @app-ready="handleAppReady"
|
||||
@error="handleError" @initialized="handleInitialized" :force-save="true" :save-timeout="15000" />
|
||||
|
|
@ -13,7 +13,11 @@ export default {
|
|||
file: {
|
||||
type: Object,
|
||||
default: () => null
|
||||
}
|
||||
},
|
||||
withoutModal: {
|
||||
type: Boolean,
|
||||
default: false // 默认显示遮罩层
|
||||
}
|
||||
},
|
||||
components: {
|
||||
OnlyOfficeViewer
|
||||
|
|
@ -21,7 +25,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
dialogVisible: true,
|
||||
documentUrl: this.file.filePath,
|
||||
documentUrl: this.file.filePath,
|
||||
documentTitle: this.file.fileName,
|
||||
documentKey: (this.file?.sourceId || this.file?.id || '') + '',
|
||||
mode: 'view',
|
||||
|
|
@ -65,4 +69,4 @@ export default {
|
|||
.preview-dialog ::v-deep .onlyoffice-container {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
:label="''"
|
||||
:file="form.fileList[0]"
|
||||
:image-url="form.url"
|
||||
without-modal="true"
|
||||
/>
|
||||
<span v-if="form.fileList.length === 0" class="no-file-tip">无附件</span>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue