|
|
|
|
@ -8,8 +8,11 @@
|
|
|
|
|
<slot name="searchtype"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="dialogConcent" :style="{height:wheight+'px'}">
|
|
|
|
|
<iframe id="iframeWin" :src="baseUrl+url" frameborder="0" scrolling="auto" align="center" class="iframeWeb">
|
|
|
|
|
<div class="dialogConcent" :style="{height:wheight+'px'}">
|
|
|
|
|
<vue-office-docx v-if="urlType==='docx'" :src="url" @rendered="renderingCompleted"></vue-office-docx>
|
|
|
|
|
<vue-office-pdf v-if="urlType==='pdf'" :src="url" @rendered="renderingCompleted"></vue-office-pdf>
|
|
|
|
|
<vue-office-excel v-if="urlType==='excel'" :src="url" @rendered="renderingCompleted"></vue-office-excel>
|
|
|
|
|
<iframe v-else id="iframeWin" :src="baseUrl+url" frameborder="0" scrolling="auto" align="center" class="iframeWeb">
|
|
|
|
|
</iframe>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@ -24,8 +27,17 @@
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
<script>
|
|
|
|
|
import vueOfficeDocx from "@vue-office/docx"
|
|
|
|
|
import vueOfficeExcel from "@vue-office/excel"
|
|
|
|
|
import vueOfficePdf from "@vue-office/pdf"
|
|
|
|
|
import '@vue-office/docx/lib/index.css'
|
|
|
|
|
export default {
|
|
|
|
|
components:{
|
|
|
|
|
vueOfficeDocx,
|
|
|
|
|
vueOfficeExcel,
|
|
|
|
|
vueOfficePdf
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
title: {
|
|
|
|
|
type: String,
|
|
|
|
|
@ -44,32 +56,51 @@
|
|
|
|
|
type: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: "showinfo"
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
url:{
|
|
|
|
|
type: String,
|
|
|
|
|
default: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
diaShow: this.isShow,
|
|
|
|
|
isfullscreen:false,
|
|
|
|
|
url:'',
|
|
|
|
|
isfullscreen:false,
|
|
|
|
|
baseUrl: "http://192.168.60.24:8012/onlinePreview?url=",
|
|
|
|
|
wheight: "",
|
|
|
|
|
wheight: "400",
|
|
|
|
|
form:{
|
|
|
|
|
show:''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
urlType:'others'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
isShow(val) {
|
|
|
|
|
this.diaShow = this.isShow;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
url(val){
|
|
|
|
|
console.log("url",val)
|
|
|
|
|
if(val){
|
|
|
|
|
if(val.includes('docx')||val.includes('DOCX')){
|
|
|
|
|
this.urlType = 'docx'
|
|
|
|
|
}else if(val.includes('pdf')||val.includes('PDF')){
|
|
|
|
|
this.urlType = 'pdf'
|
|
|
|
|
}else if(val.includes('xls')||val.includes('xlsx')||val.includes('XLS')||val.includes('XLSX')){
|
|
|
|
|
this.urlType = 'excel'
|
|
|
|
|
}else{
|
|
|
|
|
this.urlType = 'others'
|
|
|
|
|
}
|
|
|
|
|
console.log('urltype',this.urlType)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
renderingCompleted(){
|
|
|
|
|
console.log("渲染完成")
|
|
|
|
|
},
|
|
|
|
|
coloseDia() {
|
|
|
|
|
// this.url = ""
|
|
|
|
|
this.diaShow = false
|
|
|
|
|
this.url = ''
|
|
|
|
|
this.$emit('update:isShow', false)
|
|
|
|
|
this.$emit('resetform')
|
|
|
|
|
}
|
|
|
|
|
|