预告警单

This commit is contained in:
sjl
2025-12-31 08:36:14 +08:00
parent 38028b5cb0
commit 72b1f39814
5 changed files with 17 additions and 11 deletions

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

@@ -240,11 +240,12 @@ const tableStore = new TableStore({
// return true; // return true;
}, },
click: row => { click: row => {
if (row.problemType == 2) { if (row.problemType == 2) {
// 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) window.open(window.location.origin + '/#/previewFile?/' + 'row.absFilePath')
} else { } else {
if (row.problemPath == null) { if (row.problemPath == null) {
ElMessage({ ElMessage({
@@ -282,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

@@ -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) {