5 Commits

Author SHA1 Message Date
guanj
fd09e24cf0 Merge branch 'master' of http://192.168.1.22:3000/Web/admin-sjzx 2026-01-04 09:01:56 +08:00
guanj
2a11891988 正则替换[] 2026-01-04 09:01:32 +08:00
sjl
e7d90c3a73 微调 2026-01-04 08:39:17 +08:00
sjl
72b1f39814 预告警单 2025-12-31 08:36:14 +08:00
sjl
38028b5cb0 预告警查看报告 2025-12-30 10:16:56 +08:00
8 changed files with 51 additions and 29 deletions

View File

@@ -7,8 +7,20 @@ const SYSTEM_PREFIX = '/system-boot'
* @param file * @param file
*/ */
export const uploadFile = (file: any, path: string) => { 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() let form = new FormData()
form.append('file', file) form.append('file', newFile)
form.append('path', path) form.append('path', path)
return createAxios({ return createAxios({
url: SYSTEM_PREFIX + '/file/upload', url: SYSTEM_PREFIX + '/file/upload',

View File

@@ -43,6 +43,7 @@ if (VITE_FLAG) {
}) })
} else { } else {
setTimeout(async () => { setTimeout(async () => {
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1]) const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
url.value = previewUrl url.value = previewUrl
excelOptions.value = ref({ excelOptions.value = ref({

View File

@@ -55,9 +55,10 @@ function removeLastDotSuffix(str: string) {
export const previewFile = async (urls: any) => { export const previewFile = async (urls: any) => {
//console.log('预览', urls) //console.log('预览', urls)
let url = '' let url = ''
//console.log('urls', decodeURI(urls))
await downloadFile({ filePath: decodeURI(urls) }) await downloadFile({ filePath: decodeURI(urls) })
.then((res: any) => { .then((res: any) => {
// 1. 确定文件MIME类型优化用更简洁的方式 // 1. 确定文件MIME类型优化用更简洁的方式
const getFileType = (url: string) => { const getFileType = (url: string) => {
const ext = url.split('.').pop()?.toLowerCase() || '' const ext = url.split('.').pop()?.toLowerCase() || ''

View File

@@ -231,14 +231,14 @@ const init = () => {
}, },
backgroundColor: 'rgba(0,0,0,0.55)', backgroundColor: 'rgba(0,0,0,0.55)',
formatter: function (params: any) { formatter: function (params: any) {
//console.log(params) console.log(params)
let msg = '' let msg = ''
msg += params[0].name + '<br/>' msg += params[0].name
for (let i in params) { for (let i in params) {
if (params[i].data == 3.14159) { if (params[i].data == 3.14159) {
msg +=params[i].marker + ': 暂无数据<br/>' msg += '' + params[i].seriesName + '' + '<br/>' + params[i].marker + ': 暂无数据<br/>'
} else { } else {
msg += params[i].marker + ': ' + params[i].data + '<br/>' msg += '' + params[i].seriesName + '' + '<br/>' + params[i].marker + ': ' + params[i].data + '<br/>'
} }
} }
return msg return msg

View File

@@ -234,16 +234,18 @@ const tableStore = new TableStore({
icon: 'el-icon-EditPen', icon: 'el-icon-EditPen',
render: 'basicButton', render: 'basicButton',
disabled: row => { disabled: row => {
if (VITE_FLAG) { // if (VITE_FLAG) {
return !(row.problemType == 2 || row.problemType == 4) return !(row.problemType == 2 || row.problemType == 4)
} // }
return true; // return true;
}, },
click: row => { click: row => {
if (row.problemType == 2) {
const match = row.filePath.match(/excelreport(\/[^?#]*)/)
window.open(window.location.origin + '/#/previewFile?' + match[1]) if (row.problemType == 2) {
// const match = row.filePath.match(/excelreport(\/[^?#]*)/)
// window.open(window.location.origin + '/#/previewFile?' + match[1])
window.open(window.location.origin + '/#/previewFile?/' + row.absFilePath)
} else { } else {
if (row.problemPath == null) { if (row.problemPath == null) {
ElMessage({ ElMessage({
@@ -251,7 +253,8 @@ const tableStore = new TableStore({
type: 'warning' type: 'warning'
}) })
} else { } 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 => { // getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
// // window.open(res.data.url) // // window.open(res.data.url)
// }) // })
@@ -280,10 +283,11 @@ const tableStore = new TableStore({
type: 'warning' type: 'warning'
}) })
} else { } else {
getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => { // getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
window.open(res.data.url) // window.open(res.data.url)
}) // })
download('/' + row.absFilePath)
} }
} }
} }

View File

@@ -151,16 +151,17 @@ const tableStore = new TableStore({
icon: 'el-icon-EditPen', icon: 'el-icon-EditPen',
render: 'basicButton', render: 'basicButton',
disabled: row => { disabled: row => {
if (VITE_FLAG) { // if (VITE_FLAG) {
return row.problemType != 2; return row.problemType != 2;
} // }
return true; // return true;
}, },
click: row => { click: row => {
const match = row.filePath.match(/excelreport(\/[^?#]*)/) // const match = row.filePath.match(/excelreport(\/[^?#]*)/)
window.open(window.location.origin + '/#/previewFile?' + match[1]) // window.open(window.location.origin + '/#/previewFile?' + match[1])
window.open(window.location.origin + '/#/previewFile?/' + row.absFilePath)
} }
}, },
{ {
@@ -177,10 +178,11 @@ const tableStore = new TableStore({
//window.open(row.filePath) //window.open(row.filePath)
// const match = row.filePath.match(/excelreport(\/[^?#]*)/) // const match = row.filePath.match(/excelreport(\/[^?#]*)/)
// const decodedPath = decodeURI(match[1]) // 解码URL中的中文字符 // const decodedPath = decodeURI(match[1]) // 解码URL中的中文字符
//download('/' + row.absFilePath) download('/' + row.absFilePath)
//download('/supervision/微服务系统测试页面功能-20251224合并版本.docx') //download('/supervision/微服务系统测试页面功能-20251224合并版本.docx')
download('/onlineReport/电能[预]2025年18号-张家口地市 电能质量技术监督预警单.docx')
//download('/onlineReport/电能[预]2025年18号-张家口地市 电能质量技术监督预警单.docx')
} }
}, },

View File

@@ -30,7 +30,7 @@
<el-descriptions-item :span="2" label="采取措施"> <el-descriptions-item :span="2" label="采取措施">
{{ detailData.takeStep }} {{ detailData.takeStep }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2" label="处理成效报告"> <el-descriptions-item :span="2" label="反馈报告">
<el-icon class="elView" v-if="detailData?.reportName "> <el-icon class="elView" v-if="detailData?.reportName ">
<View @click="openFile(detailData?.reportName)" /> <View @click="openFile(detailData?.reportName)" />
</el-icon> </el-icon>
@@ -51,6 +51,7 @@ import { Link, View } from '@element-plus/icons-vue'
defineOptions({ name: 'technology/detail' }) defineOptions({ name: 'technology/detail' })
const openFile = (name: any) => { const openFile = (name: any) => {
window.open(window.location.origin + '/#/previewFile?/supervision/' + name) window.open(window.location.origin + '/#/previewFile?/supervision/' + name)
} }
const { query } = useRoute() // 查询参数 const { query } = useRoute() // 查询参数
@@ -92,7 +93,7 @@ const getInfo = async () => {
const getFileData = async () => { const getFileData = async () => {
//如果有问题附件 //如果有问题附件
console.log('000',detailData.value) //console.log('000',detailData.value)
if (detailData.value.problemPath) { if (detailData.value.problemPath) {
await getFileNameAndFilePath({ filePath: detailData.value.problemPath }).then(res => { await getFileNameAndFilePath({ filePath: detailData.value.problemPath }).then(res => {
console.log(res.data) console.log(res.data)

View File

@@ -11,7 +11,8 @@
:autosize="{ minRows: 2, maxRows: 6 }" readonly /> :autosize="{ minRows: 2, maxRows: 6 }" readonly />
</el-form-item> </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 "> <el-icon class="elView" v-if="supervisionReportDetail?.supervisionReportName ">
<View @click="openFile(supervisionReportDetail?.supervisionReportName)" /> <View @click="openFile(supervisionReportDetail?.supervisionReportName)" />
</el-icon> </el-icon>
@@ -104,7 +105,7 @@ const reportFilePath: any = ref('')
//form表单校验规则 //form表单校验规则
const rules = { const rules = {
takeStep: [{ required: true, message: '请输入采取的措施', trigger: 'blur' }], takeStep: [{ required: true, message: '请输入采取的措施', trigger: 'blur' }],
reportPath: [{ required: true, message: '请上传处理成效报告', trigger: 'blur' }] reportPath: [{ required: true, message: '请上传反馈报告', trigger: 'blur' }]
} }
const resetForm = () => { const resetForm = () => {
if (formRef.value) { if (formRef.value) {