Compare commits
7 Commits
06764c073a
...
2025-12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd09e24cf0 | ||
|
|
2a11891988 | ||
|
|
e7d90c3a73 | ||
|
|
72b1f39814 | ||
|
|
38028b5cb0 | ||
|
|
409999b37b | ||
|
|
0fc7b528d4 |
@@ -7,8 +7,20 @@ const SYSTEM_PREFIX = '/system-boot'
|
||||
* @param file
|
||||
*/
|
||||
export const uploadFile = (file: any, path: string) => {
|
||||
const regex = /\[|\]/g
|
||||
// 替换规则:[ 换成 (,] 换成 )
|
||||
|
||||
const newFile = new File(
|
||||
[file], // 原文件的二进制内容
|
||||
file.name.replace(regex, match => (match === '[' ? '(' : ')')), // 新的文件名
|
||||
{
|
||||
type: file.type, // 复用原文件的MIME类型
|
||||
lastModified: file.lastModified // 复用最后修改时间
|
||||
}
|
||||
)
|
||||
|
||||
let form = new FormData()
|
||||
form.append('file', file)
|
||||
form.append('file', newFile)
|
||||
form.append('path', path)
|
||||
return createAxios({
|
||||
url: SYSTEM_PREFIX + '/file/upload',
|
||||
|
||||
@@ -35,20 +35,22 @@ const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
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 {
|
||||
|
||||
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 {
|
||||
setTimeout(async () => {
|
||||
|
||||
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||
url.value = previewUrl
|
||||
excelOptions.value = ref({
|
||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||
})
|
||||
}, 0)
|
||||
// }
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 从路由参数获取文件路径
|
||||
|
||||
@@ -232,6 +232,16 @@ const onResetForm = () => {
|
||||
//时间重置成默认值
|
||||
datePickerRef.value?.setTheDate(3)
|
||||
|
||||
if(props.showTimeAll){
|
||||
timeAll.value = false
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.startTime
|
||||
delete tableStore.table.params.endTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
delete tableStore.table.params.interval
|
||||
}
|
||||
|
||||
if (props.datePicker && timeAll.value) {
|
||||
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="layout-logo">
|
||||
<img v-if="!config.layout.menuCollapse" class="logo-img" :src="getTheme.logoUrl" />
|
||||
<img v-if="!config.layout.menuCollapse && getTheme && getTheme.logoUrl" class="logo-img" :src="getTheme.logoUrl" />
|
||||
<!-- <div-->
|
||||
<!-- v-if="!config.layout.menuCollapse"-->
|
||||
<!-- :style="{ color: config.getColorVal('menuActiveColor') }"-->
|
||||
@@ -28,7 +28,9 @@ import { Session } from '@/utils/storage'
|
||||
import { setNavTabsWidth } from '@/utils/layout'
|
||||
|
||||
const config = useConfig()
|
||||
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||
const getTheme = window.localStorage.getItem('getTheme')
|
||||
? JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||
: null
|
||||
const onMenuCollapse = function () {
|
||||
if (config.layout.shrink && !config.layout.menuCollapse) {
|
||||
closeShade()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/>
|
||||
</div>
|
||||
<span class="nav-bar-title">
|
||||
{{ getTheme.name }}
|
||||
{{ getTheme?.name || '' }}
|
||||
<span style="font-size: 14px">({{ Version || 'v1.0.0' }})</span>
|
||||
<!-- <span style="font-size: 14px;" v-if="Version?.versionName">
|
||||
({{ Version?.versionName }})
|
||||
@@ -28,7 +28,9 @@ import { getLastData } from '@/api/systerm'
|
||||
|
||||
const Version: any = ref(null)
|
||||
const config = useConfig()
|
||||
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||
const getTheme = window.localStorage.getItem('getTheme')
|
||||
? JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||
: { name: '' }
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'hainan'
|
||||
const onMenuCollapse = () => {
|
||||
showShade('ba-aside-menu-shade', () => {
|
||||
@@ -43,7 +45,7 @@ onMounted(() => {
|
||||
})
|
||||
}
|
||||
|
||||
document.title = getTheme.name
|
||||
document.title = getTheme?.name || ''
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { downloadFile } from '@/api/system-boot/file'
|
||||
// 下载文件
|
||||
export const download = (urls: string) => {
|
||||
console.log('下载', urls)
|
||||
//console.log('下载', urls)
|
||||
|
||||
downloadFile({ filePath: urls })
|
||||
.then((res: any) => {
|
||||
@@ -21,9 +21,9 @@ export const download = (urls: string) => {
|
||||
}
|
||||
return mimeMap[ext] || ''
|
||||
}
|
||||
|
||||
|
||||
const blob = new Blob([res], { type: getFileType(urls) })
|
||||
|
||||
|
||||
// 2. 提取文件名并保留原生后缀(核心修复点)
|
||||
const fileName = urls.split('/').at(-1) || '下载文件' // 先提取URL最后一段(文件名)
|
||||
|
||||
@@ -53,11 +53,12 @@ function removeLastDotSuffix(str: string) {
|
||||
|
||||
// 预览文件
|
||||
export const previewFile = async (urls: any) => {
|
||||
console.log('预览', urls)
|
||||
//console.log('预览', urls)
|
||||
let url = ''
|
||||
|
||||
//console.log('urls', decodeURI(urls))
|
||||
await downloadFile({ filePath: decodeURI(urls) })
|
||||
.then((res: any) => {
|
||||
|
||||
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||
const getFileType = (url: string) => {
|
||||
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||
@@ -74,7 +75,7 @@ export const previewFile = async (urls: any) => {
|
||||
}
|
||||
return mimeMap[ext] || ''
|
||||
}
|
||||
|
||||
|
||||
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
||||
|
||||
|
||||
@@ -85,6 +86,6 @@ export const previewFile = async (urls: any) => {
|
||||
console.error('下载失败:', err)
|
||||
// 可添加错误提示(如Toast)
|
||||
})
|
||||
console.log('url', url)
|
||||
//console.log('url', url)
|
||||
return url
|
||||
}
|
||||
|
||||
@@ -231,14 +231,14 @@ const init = () => {
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
formatter: function (params: any) {
|
||||
//console.log(params)
|
||||
console.log(params)
|
||||
let msg = ''
|
||||
msg += params[0].name + '<br/>'
|
||||
msg += params[0].name
|
||||
for (let i in params) {
|
||||
if (params[i].data == 3.14159) {
|
||||
msg +=params[i].marker + ': 暂无数据<br/>'
|
||||
msg += '(' + params[i].seriesName + ')' + '<br/>' + params[i].marker + ': 暂无数据<br/>'
|
||||
} else {
|
||||
msg += params[i].marker + ': ' + params[i].data + '<br/>'
|
||||
msg += '(' + params[i].seriesName + ')' + '<br/>' + params[i].marker + ': ' + params[i].data + '<br/>'
|
||||
}
|
||||
}
|
||||
return msg
|
||||
|
||||
@@ -133,6 +133,7 @@ const list: any = ref({
|
||||
alarmThreshold: ''
|
||||
})
|
||||
const level: any = ref(dictData.state.area[0]?.level)
|
||||
console.log('level', level)
|
||||
const flag: any = ref('')
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/onlineMonitor/list',
|
||||
@@ -364,7 +365,7 @@ tableStore.table.params.dataType = '1'
|
||||
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
TableHeaderRef.value.setDatePicker([{ label: '月', value: 3 }])
|
||||
TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }])
|
||||
|
||||
tableStore.index()
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<el-tab-pane :label="VITE_FLAG ? '现场测试' : '计划实施问题'" name="3" v-if="tabList.includes('3')">
|
||||
<testQuestions v-if="activeName == '3'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="试运行评估" name="4" v-if="tabList.includes('4')">
|
||||
<el-tab-pane label="试运行评估问题" name="4" v-if="tabList.includes('4')">
|
||||
<testRun v-if="activeName == '4'" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tabs v-model="activeName" type="border-card">
|
||||
|
||||
@@ -46,6 +46,7 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import { deleteWarningLeaflet } from '@/api/supervision-boot/delete/index'
|
||||
import detail from '@/views/pqs/supervise/harmonicSurvey/test/detail.vue'
|
||||
import {download} from '@/utils/fileDownLoad'
|
||||
const dictData = useDictData()
|
||||
|
||||
const statusSelect = [
|
||||
@@ -233,18 +234,18 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
if (VITE_FLAG) {
|
||||
return !(row.problemType == 2 || row.problemType == 4)
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
// if (VITE_FLAG) {
|
||||
return !(row.problemType == 2 || row.problemType == 4)
|
||||
// }
|
||||
// return true;
|
||||
},
|
||||
click: row => {
|
||||
|
||||
if (row.problemType == 2) {
|
||||
const match = row.filePath.match(/excelreport(\/[^?#]*)/)
|
||||
|
||||
window.open(window.location.origin + '/#/previewFile?' + match[1])
|
||||
// const match = row.filePath.match(/excelreport(\/[^?#]*)/)
|
||||
|
||||
// window.open(window.location.origin + '/#/previewFile?' + match[1])
|
||||
window.open(window.location.origin + '/#/previewFile?/' + row.absFilePath)
|
||||
} else {
|
||||
if (row.problemPath == null) {
|
||||
ElMessage({
|
||||
@@ -252,7 +253,8 @@ const tableStore = new TableStore({
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
window.open(window.location.origin + '/#/previewFile?/' + row.problemPath)
|
||||
//window.open(window.location.origin + '/#/previewFile?/' + row.problemPath)
|
||||
window.open(window.location.origin + '/#/previewFile?/' + row.absFilePath)
|
||||
// getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
|
||||
// // window.open(res.data.url)
|
||||
// })
|
||||
@@ -271,7 +273,9 @@ const tableStore = new TableStore({
|
||||
},
|
||||
click: row => {
|
||||
if (row.problemType == 2) {
|
||||
window.open(row.filePath)
|
||||
|
||||
//window.open(row.filePath)
|
||||
download('/' + row.absFilePath)
|
||||
} else {
|
||||
if (row.problemPath == null) {
|
||||
ElMessage({
|
||||
@@ -279,9 +283,11 @@ const tableStore = new TableStore({
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
|
||||
window.open(res.data.url)
|
||||
})
|
||||
// getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
|
||||
|
||||
// window.open(res.data.url)
|
||||
// })
|
||||
download('/' + row.absFilePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,10 @@ import { cancelFeedback, getById } from '@/api/supervision-boot/leaflet'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { deleteWarningLeaflet } from '@/api/supervision-boot/delete/index'
|
||||
import {download} from '@/utils/fileDownLoad'
|
||||
|
||||
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||
|
||||
const dictData = useDictData()
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
@@ -147,16 +151,17 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
if (VITE_FLAG) {
|
||||
// if (VITE_FLAG) {
|
||||
return row.problemType != 2;
|
||||
}
|
||||
return true;
|
||||
// }
|
||||
// return true;
|
||||
},
|
||||
|
||||
click: row => {
|
||||
const match = row.filePath.match(/excelreport(\/[^?#]*)/)
|
||||
|
||||
window.open(window.location.origin + '/#/previewFile?' + match[1])
|
||||
// const match = row.filePath.match(/excelreport(\/[^?#]*)/)
|
||||
|
||||
// window.open(window.location.origin + '/#/previewFile?' + match[1])
|
||||
window.open(window.location.origin + '/#/previewFile?/' + row.absFilePath)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -169,7 +174,16 @@ const tableStore = new TableStore({
|
||||
return row.problemType != 2
|
||||
},
|
||||
click: row => {
|
||||
window.open(row.filePath)
|
||||
|
||||
//window.open(row.filePath)
|
||||
// const match = row.filePath.match(/excelreport(\/[^?#]*)/)
|
||||
// const decodedPath = decodeURI(match[1]) // 解码URL中的中文字符
|
||||
download('/' + row.absFilePath)
|
||||
|
||||
//download('/supervision/微服务系统测试页面功能-20251224合并版本.docx')
|
||||
|
||||
//download('/onlineReport/电能[预]2025年18号-张家口地市 电能质量技术监督预警单.docx')
|
||||
|
||||
}
|
||||
},
|
||||
// {
|
||||
@@ -315,6 +329,11 @@ const tableStore = new TableStore({
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tableStore.table.params.status = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<el-descriptions-item :span="2" label="采取措施">
|
||||
{{ detailData.takeStep }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="处理成效报告">
|
||||
<el-descriptions-item :span="2" label="反馈报告">
|
||||
<el-icon class="elView" v-if="detailData?.reportName ">
|
||||
<View @click="openFile(detailData?.reportName)" />
|
||||
</el-icon>
|
||||
@@ -51,6 +51,7 @@ import { Link, View } from '@element-plus/icons-vue'
|
||||
|
||||
defineOptions({ name: 'technology/detail' })
|
||||
const openFile = (name: any) => {
|
||||
|
||||
window.open(window.location.origin + '/#/previewFile?/supervision/' + name)
|
||||
}
|
||||
const { query } = useRoute() // 查询参数
|
||||
@@ -92,8 +93,10 @@ const getInfo = async () => {
|
||||
|
||||
const getFileData = async () => {
|
||||
//如果有问题附件
|
||||
//console.log('000',detailData.value)
|
||||
if (detailData.value.problemPath) {
|
||||
await getFileNameAndFilePath({ filePath: detailData.value.problemPath }).then(res => {
|
||||
console.log(res.data)
|
||||
detailData.value.keyName = res.data.name
|
||||
detailData.value.problemPath = res.data.url
|
||||
detailData.value.problemName = res.data.fileName
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
:autosize="{ minRows: 2, maxRows: 6 }" readonly />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="技术监督报告:" v-if="showFile1">
|
||||
<!-- <el-form-item label="技术监督报告:" v-if="showFile1"> -->
|
||||
<el-form-item label="技术监督报告:" v-if="false">
|
||||
<el-icon class="elView" v-if="supervisionReportDetail?.supervisionReportName ">
|
||||
<View @click="openFile(supervisionReportDetail?.supervisionReportName)" />
|
||||
</el-icon>
|
||||
@@ -104,7 +105,7 @@ const reportFilePath: any = ref('')
|
||||
//form表单校验规则
|
||||
const rules = {
|
||||
takeStep: [{ required: true, message: '请输入采取的措施', trigger: 'blur' }],
|
||||
reportPath: [{ required: true, message: '请上传处理成效报告', trigger: 'blur' }]
|
||||
reportPath: [{ required: true, message: '请上传反馈报告', trigger: 'blur' }]
|
||||
}
|
||||
const resetForm = () => {
|
||||
if (formRef.value) {
|
||||
|
||||
@@ -89,105 +89,140 @@ const handleExceed: UploadProps['onExceed'] = files => {
|
||||
/**
|
||||
* 提交用户表单数据
|
||||
*/
|
||||
// const submit = async () => {
|
||||
// if (form.file) {
|
||||
// formRef.value.validate(async (valid: any) => {
|
||||
// if (valid) {
|
||||
// let data = new FormData()
|
||||
// data.append('file', form.file)
|
||||
// console.log(title.value)
|
||||
// if (title.value === '导入干扰源用户') {
|
||||
// await importSensitiveReportData(data)
|
||||
// .then(res => handleImportResponse(title.value, res))
|
||||
// .finally(() => {
|
||||
// tableStore.index()
|
||||
// eventDataUploadVisible.value = false
|
||||
// })
|
||||
// } else {
|
||||
// await importSensitiveUserData(data)
|
||||
// .then(res => handleImportResponse(title.value, res))
|
||||
// .finally(() => {
|
||||
// tableStore.index()
|
||||
// eventDataUploadVisible.value = false
|
||||
// })
|
||||
// }
|
||||
// // if (title.value == '导入干扰源用户') {
|
||||
// // await importSensitiveReportData(data)
|
||||
// // .then((res: any) => {
|
||||
// // if (res.type === 'application/json') {
|
||||
// // // 说明是普通对象数据,读取信息
|
||||
// // const fileReader = new FileReader()
|
||||
// // fileReader.onloadend = () => {
|
||||
// // try {
|
||||
// // const jsonData = JSON.parse(fileReader.result)
|
||||
// // // 后台信息
|
||||
// // if (jsonData.code === 'A0000') {
|
||||
// // ElMessage.success('导入成功')
|
||||
// // } else {
|
||||
// // ElMessage.error('导入失败,请查看下载附件!')
|
||||
// // }
|
||||
// // } catch (err) {
|
||||
// // console.log(err)
|
||||
// // }
|
||||
// // }
|
||||
// // fileReader.readAsText(res)
|
||||
// // } else {
|
||||
// // ElMessage.error('导入失败,请查看下载附件!')
|
||||
// // let blob = new Blob([res], {
|
||||
// // type: 'application/vnd.ms-excel'
|
||||
// // })
|
||||
// // const url = window.URL.createObjectURL(blob)
|
||||
// // const link = document.createElement('a')
|
||||
// // link.href = url
|
||||
// // link.download = '干扰源用户失败列表'
|
||||
// // document.body.appendChild(link)
|
||||
// // link.click()
|
||||
// // link.remove()
|
||||
// // }
|
||||
// // })
|
||||
// // .finally(() => {
|
||||
// // tableStore.index()
|
||||
// // eventDataUploadVisible.value = false
|
||||
// // })
|
||||
// // } else {
|
||||
// // await importSensitiveUserData(data)
|
||||
// // .then((res: any) => {
|
||||
// // if (res.type === 'application/json') {
|
||||
// // // 说明是普通对象数据,读取信息
|
||||
// // const fileReader = new FileReader()
|
||||
// // fileReader.onloadend = () => {
|
||||
// // try {
|
||||
// // const jsonData = JSON.parse(fileReader.result)
|
||||
// // // 后台信息
|
||||
// // if (jsonData.code === 'A0000') {
|
||||
// // ElMessage.success('导入成功')
|
||||
// // } else {
|
||||
// // ElMessage.error('导入失败,请查看下载附件!')
|
||||
// // }
|
||||
// // } catch (err) {
|
||||
// // console.log(err)
|
||||
// // }
|
||||
// // }
|
||||
// // fileReader.readAsText(res)
|
||||
// // } else {
|
||||
// // ElMessage.error('导入失败,请查看下载附件!')
|
||||
// // let blob = new Blob([res], {
|
||||
// // type: 'application/vnd.ms-excel'
|
||||
// // })
|
||||
// // const url = window.URL.createObjectURL(blob)
|
||||
// // const link = document.createElement('a')
|
||||
// // link.href = url
|
||||
// // link.download = '敏感及重要用户失败列表'
|
||||
// // document.body.appendChild(link)
|
||||
// // link.click()
|
||||
// // link.remove()
|
||||
// // }
|
||||
// // })
|
||||
// // .finally(() => {
|
||||
// // tableStore.index()
|
||||
// // eventDataUploadVisible.value = false
|
||||
// // })
|
||||
// // }
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// ElMessage.error('请选择数据文件')
|
||||
// }
|
||||
// }
|
||||
const submit = async () => {
|
||||
if (form.file) {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
let data = new FormData()
|
||||
data.append('file', form.file)
|
||||
if (title.value === '导入干扰源用户') {
|
||||
await importSensitiveReportData(data)
|
||||
.then(res => handleImportResponse(title.value, res))
|
||||
.finally(() => {
|
||||
tableStore.index()
|
||||
eventDataUploadVisible.value = false
|
||||
})
|
||||
} else {
|
||||
await importSensitiveUserData(data)
|
||||
.then(res => handleImportResponse(title.value, res))
|
||||
.finally(() => {
|
||||
tableStore.index()
|
||||
eventDataUploadVisible.value = false
|
||||
})
|
||||
|
||||
try {
|
||||
if (title.value === '导入干扰源用户') {
|
||||
await importSensitiveReportData(data)
|
||||
.then(res => handleImportResponse(title.value, res))
|
||||
.catch(() => {
|
||||
// 处理请求失败的情况
|
||||
ElMessage.error('导入失败,请查看下载附件!')
|
||||
})
|
||||
} else {
|
||||
await importSensitiveUserData(data)
|
||||
.then(res => handleImportResponse(title.value, res))
|
||||
.catch(() => {
|
||||
// 处理请求失败的情况
|
||||
ElMessage.error('导入失败,请查看下载附件!')
|
||||
})
|
||||
}
|
||||
} finally {
|
||||
// 无论成功失败都重新启用按钮并关闭窗口
|
||||
tableStore.index()
|
||||
eventDataUploadVisible.value = false
|
||||
}
|
||||
// if (title.value == '导入干扰源用户') {
|
||||
// await importSensitiveReportData(data)
|
||||
// .then((res: any) => {
|
||||
// if (res.type === 'application/json') {
|
||||
// // 说明是普通对象数据,读取信息
|
||||
// const fileReader = new FileReader()
|
||||
// fileReader.onloadend = () => {
|
||||
// try {
|
||||
// const jsonData = JSON.parse(fileReader.result)
|
||||
// // 后台信息
|
||||
// if (jsonData.code === 'A0000') {
|
||||
// ElMessage.success('导入成功')
|
||||
// } else {
|
||||
// ElMessage.error('导入失败,请查看下载附件!')
|
||||
// }
|
||||
// } catch (err) {
|
||||
// console.log(err)
|
||||
// }
|
||||
// }
|
||||
// fileReader.readAsText(res)
|
||||
// } else {
|
||||
// ElMessage.error('导入失败,请查看下载附件!')
|
||||
// let blob = new Blob([res], {
|
||||
// type: 'application/vnd.ms-excel'
|
||||
// })
|
||||
// const url = window.URL.createObjectURL(blob)
|
||||
// const link = document.createElement('a')
|
||||
// link.href = url
|
||||
// link.download = '干扰源用户失败列表'
|
||||
// document.body.appendChild(link)
|
||||
// link.click()
|
||||
// link.remove()
|
||||
// }
|
||||
// })
|
||||
// .finally(() => {
|
||||
// tableStore.index()
|
||||
// eventDataUploadVisible.value = false
|
||||
// })
|
||||
// } else {
|
||||
// await importSensitiveUserData(data)
|
||||
// .then((res: any) => {
|
||||
// if (res.type === 'application/json') {
|
||||
// // 说明是普通对象数据,读取信息
|
||||
// const fileReader = new FileReader()
|
||||
// fileReader.onloadend = () => {
|
||||
// try {
|
||||
// const jsonData = JSON.parse(fileReader.result)
|
||||
// // 后台信息
|
||||
// if (jsonData.code === 'A0000') {
|
||||
// ElMessage.success('导入成功')
|
||||
// } else {
|
||||
// ElMessage.error('导入失败,请查看下载附件!')
|
||||
// }
|
||||
// } catch (err) {
|
||||
// console.log(err)
|
||||
// }
|
||||
// }
|
||||
// fileReader.readAsText(res)
|
||||
// } else {
|
||||
// ElMessage.error('导入失败,请查看下载附件!')
|
||||
// let blob = new Blob([res], {
|
||||
// type: 'application/vnd.ms-excel'
|
||||
// })
|
||||
// const url = window.URL.createObjectURL(blob)
|
||||
// const link = document.createElement('a')
|
||||
// link.href = url
|
||||
// link.download = '敏感及重要用户失败列表'
|
||||
// document.body.appendChild(link)
|
||||
// link.click()
|
||||
// link.remove()
|
||||
// }
|
||||
// })
|
||||
// .finally(() => {
|
||||
// tableStore.index()
|
||||
// eventDataUploadVisible.value = false
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ElMessage.error('请选择数据文件')
|
||||
|
||||
@@ -367,11 +367,11 @@ const terminalModelList = [
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
name: '虚拟终端'
|
||||
name: '实际终端'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '虚拟终端'
|
||||
name: '离线'
|
||||
}
|
||||
]
|
||||
//定义通讯状态下拉框数据
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
></vxe-table-column>
|
||||
<vxe-table-column field="lineName" title="监测点" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="voltageId" title="电压等级(kV)" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="featureAmplitude" title="暂降幅值(%)" align="center" width="140">
|
||||
<vxe-table-column field="featureAmplitude" title="暂降(骤升)幅值(%)" align="center" width="140">
|
||||
<template #default="{ row }">
|
||||
<span>{{ (row.featureAmplitude * 100).toFixed(2) }}</span>
|
||||
</template>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<vxe-table-column field="subName" :show-overflow="true" title="变电站" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="lineName" title="监测点" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="voltageId" title="电压等级(kV)" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="featureAmplitude" title="暂降幅值(%)" align="center" width="140">
|
||||
<vxe-table-column field="featureAmplitude" title="暂降(骤升)幅值(%)" align="center" width="140">
|
||||
<template #default="{ row }">
|
||||
<span>{{ (row.featureAmplitude * 100).toFixed(2) }}</span>
|
||||
</template>
|
||||
@@ -236,7 +236,7 @@ const exportEvent = () => {
|
||||
pageSize: tableStore.table.total
|
||||
}).then(res => {
|
||||
tableRef.value.getRef().exportData({
|
||||
filename: '暂降聚合展示', // 文件名字
|
||||
filename: '暂态聚合展示', // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
|
||||
Reference in New Issue
Block a user