修改部分预览,数据完整性,暂态列表等bug调整
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<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-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.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')"
|
||||
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<img v-if="urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')"
|
||||
:src="url" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -19,22 +19,28 @@ import VueOfficeExcel from '@vue-office/excel'
|
||||
//引入VueOfficePdf组件
|
||||
import VueOfficePdf from '@vue-office/pdf'
|
||||
import { downloadFile } from '@/api/system-boot/file'
|
||||
import{previewFile} from '@/utils/fileDownLoad'
|
||||
|
||||
const { push, options, currentRoute } = useRouter()
|
||||
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({})
|
||||
const urlKey = currentRoute.value?.href?.split('?')[1]
|
||||
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{
|
||||
//下载
|
||||
|
||||
|
||||
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||
url.value = previewUrl
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 从路由参数获取文件路径
|
||||
|
||||
console.log()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { downloadFile } from '@/api/system-boot/file'
|
||||
// 下载文件
|
||||
export const download = (urls: any) => {
|
||||
|
||||
console.log('下载',urls)
|
||||
downloadFile({ filePath: urls }).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: urls.includes('.pdf')
|
||||
@@ -40,3 +40,36 @@ function removeLastDotSuffix(str: string) {
|
||||
// 如果存在 .,截取到 . 之前的部分;否则返回原字符串
|
||||
return lastDotIndex !== -1 ? str.slice(0, lastDotIndex) : str
|
||||
}
|
||||
|
||||
|
||||
// 预览文件
|
||||
export const previewFile = async (urls: any) => {
|
||||
console.log('预览',urls)
|
||||
let url = ''
|
||||
await 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 = window.URL.createObjectURL(blob)
|
||||
})
|
||||
console.log('url',url)
|
||||
return url
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty"
|
||||
:style="`height: calc(${height.height} - 60px);`" />
|
||||
<div :style="`height: calc(${height.height} - 60px);overflow: auto;`" v-else>
|
||||
<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"
|
||||
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.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>
|
||||
<iframe v-if="urlKey.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')
|
||||
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
|
||||
" :src="url" />
|
||||
</div>
|
||||
</pane>
|
||||
@@ -56,6 +56,7 @@ import VueOfficeExcel from '@vue-office/excel'
|
||||
import VueOfficePdf from '@vue-office/pdf'
|
||||
import { deleteyLibstandard } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import {previewFile } from '@/utils/fileDownLoad'
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/standard'
|
||||
@@ -77,7 +78,7 @@ onMounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const urlKey=ref('')
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||
@@ -86,13 +87,14 @@ const handleNodeClick = (data: any, node: any) => {
|
||||
flag.value = false
|
||||
if (data?.url != null && data?.url != '') {
|
||||
flag.value = true
|
||||
|
||||
setTimeout(() => {
|
||||
urlKey.value = data.url
|
||||
setTimeout(async () => {
|
||||
if(VITE_FLAG){
|
||||
url.value = `/api-docx/excelreport` + data.url
|
||||
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
||||
}else{
|
||||
|
||||
const previewUrl = await previewFile(data.url);
|
||||
url.value = previewUrl;
|
||||
}
|
||||
|
||||
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
|
||||
|
||||
@@ -36,7 +36,7 @@ defineOptions({
|
||||
})
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
const popupEditRef = ref()
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
@@ -59,6 +59,9 @@ const tableStore = new TableStore({
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !VITE_FLAG
|
||||
},
|
||||
click: row => {
|
||||
window.open(window.location.origin + '/#/previewFile?' + row.url)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ const tableStore = new TableStore({
|
||||
chartsData.value.map((item: any) => {
|
||||
xData.push(item.type)
|
||||
if (item.single == 0 || item.single == 3.14159) {
|
||||
yData.push(1)
|
||||
yData.push(0)
|
||||
} else {
|
||||
yData.push(item.single)
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'devCapacity',
|
||||
title: '供电终端容量(MVA )',
|
||||
title: '供电设备容量(MVA )',
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
@@ -167,7 +167,7 @@ tableStore.table.params.runFlag = []
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
const runFlagList = [
|
||||
{ id: 0, name: '运行' },
|
||||
{ id: 0, name: '投运' },
|
||||
{ id: 1, name: '检修' },
|
||||
{ id: 2, name: '停运' },
|
||||
{ id: 3, name: '调试' },
|
||||
|
||||
@@ -62,7 +62,13 @@ const tableStore = new TableStore({
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
onMounted(() => {
|
||||
TableHeaderRef.value.setDatePicker([
|
||||
{ label: '月份', value: 3 },
|
||||
{ label: '周', value: 4 },
|
||||
{ label: '自定义', value: 5 }
|
||||
])
|
||||
tableStore.index()
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -51,15 +51,15 @@
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="暂降原因:">
|
||||
<el-select v-model="tableStore.table.params.eventReason" placeholder="请选择暂降原因" clearable
|
||||
<el-form-item label="暂态原因:">
|
||||
<el-select v-model="tableStore.table.params.eventReason" placeholder="请选择暂态原因" clearable
|
||||
multiple collapse-tags style="width: 100%">
|
||||
<el-option v-for="item in reasonoptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="暂降核实原因:">
|
||||
<el-select v-model="tableStore.table.params.verifyReason" placeholder="请选择暂降核实原因" clearable
|
||||
<el-form-item label="暂态核实原因:">
|
||||
<el-select v-model="tableStore.table.params.verifyReason" placeholder="请选择暂态核实原因" clearable
|
||||
multiple collapse-tags collapse-tags-tooltip>
|
||||
<el-option v-for="item in verifyReasonList" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
@@ -68,7 +68,7 @@
|
||||
<el-form-item label="变电站(监测点):">
|
||||
<el-cascader v-model="tableStore.table.params.lineIds" :options="options" :props="defaultProps"
|
||||
collapse-tags-tooltip style="width: 257px;" filterable clearable collapse-tags
|
||||
placeholder="请选择变电站(监测点)" :show-all-levels="false" />
|
||||
placeholder="请选择变电站(监测点)" :show-all-levels="true" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
@@ -151,11 +151,11 @@ const tableStore = new TableStore({
|
||||
{ field: 'ip', title: '网络参数' ,width:'120px' },
|
||||
{ field: 'lineName', title: '监测点', minWidth: '100' },
|
||||
{ field: 'scale', title: '电压等级(kV)', minWidth: '120', },
|
||||
// {
|
||||
// field: 'verifyReason', title: '暂降核实原因', minWidth: '120', formatter: function (row) {
|
||||
// return verifyReasonList.filter(item => item.id == row.cellValue)[0]?.name || '/' //row.cellValue ? row.cellValue : '/'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'verifyReason', title: '暂态核实原因', minWidth: '120', formatter: function (row) {
|
||||
return verifyReasonList.filter(item => item.id == row.cellValue)[0]?.name || '/' //row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'verifyReasonDetail', title: '暂降核实原因详情', minWidth: '200', formatter: function (row) {
|
||||
// return row.cellValue ? row.cellValue : '/'
|
||||
@@ -177,7 +177,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
// { field: 'advanceType', title: '暂降类型', minWidth: '100', },
|
||||
{ field: 'advanceReason', title: '暂降原因', minWidth: '100' },
|
||||
{ field: 'advanceReason', title: '暂态原因', minWidth: '100' },
|
||||
{
|
||||
field: 'depth',
|
||||
title: '暂降深度(%)',
|
||||
@@ -301,7 +301,7 @@ onMounted(() => {
|
||||
list.forEach((item: any) => {
|
||||
options.value.push(...item)
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
const backbxlb = () => {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 波形分析 -->
|
||||
<el-dialog draggable v-model="dialogAnalysis" title="波形分析" width="70%">
|
||||
<el-dialog draggable v-model="dialogAnalysis" title="事件查看" width="70%">
|
||||
<div class="mb10" style="display: flex; justify-content: space-between">
|
||||
<span>事件关联编号为:{{ AssociationNumber }}</span>
|
||||
<div>
|
||||
@@ -175,6 +175,8 @@ const bxcontrast = () => {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 波形分析
|
||||
const source = () => {
|
||||
queryEventDetailByAssId(form.value).then(res => {
|
||||
@@ -230,25 +232,35 @@ const exportEvent = () => {
|
||||
pageSize: tableStore.table.total
|
||||
}).then(res => {
|
||||
tableRef.value.getRef().exportData({
|
||||
filename: '影响范围分析', // 文件名字
|
||||
filename: '事件波形分析', // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
data: res.data.records, // 数据源 // 过滤那个字段导出
|
||||
columnFilterMethod: function (column, $columnIndex) {
|
||||
return !(column.$columnIndex === 0)
|
||||
return !(column.$columnIndex === 0 || column.$columnIndex === 4)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
// 导出波形分析
|
||||
const positioningexport = () => {
|
||||
const selectedRecords = positioningtableRef.value.getCheckboxRecords();
|
||||
|
||||
if (selectedRecords.length === 0) {
|
||||
ElMessage({
|
||||
message: '请先选择要导出的数据!',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
positioningtableRef.value.exportData({
|
||||
filename: '事件波形分析', // 文件名字
|
||||
filename: '事件分析', // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
data: dialogAnalysis.value, // 数据源 // 过滤那个字段导出
|
||||
data: selectedRecords, // 数据源 // 过滤那个字段导出
|
||||
columnFilterMethod: function (column, $columnIndex) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div v-show="view">
|
||||
<TableHeader datePicker ref="TableHeaderRef" showExport>
|
||||
<TableHeader datePicker ref="TableHeaderRef" >
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入事件关联分析描述"
|
||||
|
||||
Reference in New Issue
Block a user