电能质量异常管理,谐波测试计划管理bug修改
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
<template>
|
||||
<div style="overflow: auto; height: 100vh">
|
||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url" :options="excelOptions" />
|
||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url" /> -->
|
||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<img v-if="url.includes('.png') || url.includes('.jpg') || url.includes('.gif') || url.includes('.bmp')"
|
||||
:src="url" />
|
||||
<div style="overflow: auto; height: 100vh" v-if="flag">
|
||||
<vue-office-docx v-if="urlName.includes('.doc') || urlName.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="urlName.includes('.xls') || urlName.includes('.xlsx')" :src="url" :options="excelOptions" />
|
||||
<!-- <vue-office-pdf v-if="urlName.includes('.pdf')" :src="url" /> -->
|
||||
<iframe v-if="urlName.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<img
|
||||
v-if="urlName.includes('.png') || urlName.includes('.jpg') || urlName.includes('.gif') || urlName.includes('.bmp')"
|
||||
:src="url"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@@ -24,17 +26,50 @@ const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
||||
const url = ref('')
|
||||
const excelOptions = ref({})
|
||||
if(VITE_FLAG){
|
||||
url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||
excelOptions.value = ref({
|
||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||
const urlName = ref('')
|
||||
const flag = ref(false)
|
||||
const init = () => {
|
||||
flag.value = false
|
||||
let urls = currentRoute.value?.href?.split('?')[1]
|
||||
urlName.value = urls
|
||||
downloadFile({ filePath: urls }).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: urls.includes('.pdf')
|
||||
? 'application/pdf'
|
||||
: urls.includes('.zip')
|
||||
? 'application/zip'
|
||||
: urls.includes('.doc')
|
||||
? 'application/msword'
|
||||
: urls.includes('.docx')
|
||||
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
: urls.includes('.xls')
|
||||
? 'application/vnd.ms-excel'
|
||||
: urls.includes('.xlsx')
|
||||
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
: urls.includes('.png')
|
||||
? 'image/png'
|
||||
: urls.includes('.jpeg')
|
||||
? 'image/jpeg'
|
||||
: urls.includes('.jpg')
|
||||
? 'image/jpg'
|
||||
: ''
|
||||
})
|
||||
url.value = window.URL.createObjectURL(blob)
|
||||
flag.value = true
|
||||
})
|
||||
}else{
|
||||
//下载
|
||||
|
||||
}
|
||||
// if(VITE_FLAG){
|
||||
// url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||
// excelOptions.value = ref({
|
||||
// xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||
// })
|
||||
// }else{
|
||||
// //下载
|
||||
|
||||
// }
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
console.log()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -231,6 +231,16 @@ const setDatePicker = (list: any) => {
|
||||
const onResetForm = () => {
|
||||
//时间重置成默认值
|
||||
datePickerRef.value?.setTheDate(3)
|
||||
|
||||
if (props.datePicker && timeAll.value) {
|
||||
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
tableStore.table.params.startTime = datePickerRef.value.timeValue[0]
|
||||
tableStore.table.params.endTime = datePickerRef.value.timeValue[1]
|
||||
tableStore.table.params.timeFlag = datePickerRef.value.timeFlag
|
||||
tableStore.table.params.interval = datePickerRef.value.interval
|
||||
}
|
||||
|
||||
tableStore.onTableAction('reset', {})
|
||||
}
|
||||
const setTheDate = (val: any) => {
|
||||
@@ -238,7 +248,7 @@ const setTheDate = (val: any) => {
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
console.log('导出')
|
||||
|
||||
tableStore.onTableAction('export', { showAllFlag: true })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user