Compare commits
No commits in common. "3f6604eebf661173bce0b5254861887ceda2f06c" and "c34906dc2621f11bfdfda78008297b2795966f45" have entirely different histories.
3f6604eebf
...
c34906dc26
|
@ -200,12 +200,12 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 预览文件 -->
|
<!-- 预览文件 -->
|
||||||
<viewer ref="picture_perview_customizeReportPage" style="margin: 0 10px"
|
<el-dialog v-if="previewVisible" :visible.sync="previewVisible" :title="$t('common:button:preview')"
|
||||||
v-if="currentType && ['png', 'jpg', 'jpeg'].includes(currentType.toLowerCase())"
|
:fullscreen="true" append-to-body custom-class="base-dialog-wrapper">
|
||||||
:images="[`${OSSclientConfig.basePath}${currentPath}`]" :options="viewerOptions">
|
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
|
||||||
|
<PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
|
||||||
<img v-show="false" :src="`${OSSclientConfig.basePath}${currentPath}`" alt="Image" />
|
</div>
|
||||||
</viewer>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -214,10 +214,12 @@ import { setSkipReadingCache } from '@/api/reading'
|
||||||
import { getAutoCutNextTask } from '@/api/user'
|
import { getAutoCutNextTask } from '@/api/user'
|
||||||
import const_ from '@/const/sign-code'
|
import const_ from '@/const/sign-code'
|
||||||
import SignForm from '@/views/trials/components/newSignForm'
|
import SignForm from '@/views/trials/components/newSignForm'
|
||||||
|
import PreviewFile from '@/components/PreviewFile/index'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
|
import store from '@/store'
|
||||||
export default {
|
export default {
|
||||||
name: 'CustomizeReportPage',
|
name: 'CustomizeReportPage',
|
||||||
components: { SignForm },
|
components: { SignForm, PreviewFile },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
trialId: '',
|
trialId: '',
|
||||||
|
@ -242,23 +244,9 @@ export default {
|
||||||
questionForm: {},
|
questionForm: {},
|
||||||
questionId: null,
|
questionId: null,
|
||||||
taskInfo: null,
|
taskInfo: null,
|
||||||
|
previewVisible: false,
|
||||||
currentPath: '',
|
currentPath: '',
|
||||||
currentType: '',
|
currentType: ''
|
||||||
|
|
||||||
|
|
||||||
viewerOptions: {
|
|
||||||
toolbar: {
|
|
||||||
zoomIn: true,
|
|
||||||
zoomOut: true,
|
|
||||||
reset: true,
|
|
||||||
prev: false,
|
|
||||||
next: false,
|
|
||||||
rotateLeft: true,
|
|
||||||
rotateRight: true,
|
|
||||||
flipHorizontal: true,
|
|
||||||
flipVertical: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -738,33 +726,7 @@ export default {
|
||||||
this.currentPath = path
|
this.currentPath = path
|
||||||
const arr = path.split('.')
|
const arr = path.split('.')
|
||||||
this.currentType = arr[arr.length - 1]
|
this.currentType = arr[arr.length - 1]
|
||||||
// this.previewVisible = true
|
this.previewVisible = true
|
||||||
if (['.ppt',
|
|
||||||
'.pptx',
|
|
||||||
'.doc',
|
|
||||||
'.docx',
|
|
||||||
'.xls',
|
|
||||||
'.xlsx'].includes(`.${this.currentType.toLowerCase()}`)) {
|
|
||||||
this.$onlyOffice({
|
|
||||||
path: path,
|
|
||||||
type: this.currentType,
|
|
||||||
title: this.$t('trials:readingReport:title:preview')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (['.jpg',
|
|
||||||
'.jpeg',
|
|
||||||
'.png'].includes(`.${this.currentType.toLowerCase()}`)) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['picture_perview_customizeReportPage'].$viewer.show()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (['.pdf'].includes(`.${this.currentType.toLowerCase()}`)) {
|
|
||||||
this.$preview({
|
|
||||||
path: path,
|
|
||||||
type: 'pdf',
|
|
||||||
title: this.$t('trials:readingReport:title:preview')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue