预告警单
This commit is contained in:
@@ -43,6 +43,7 @@ if (VITE_FLAG) {
|
||||
})
|
||||
} else {
|
||||
setTimeout(async () => {
|
||||
|
||||
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||
url.value = previewUrl
|
||||
excelOptions.value = ref({
|
||||
|
||||
@@ -55,9 +55,10 @@ function removeLastDotSuffix(str: string) {
|
||||
export const previewFile = async (urls: any) => {
|
||||
//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)) })
|
||||
|
||||
|
||||
|
||||
@@ -240,11 +240,12 @@ const tableStore = new TableStore({
|
||||
// return true;
|
||||
},
|
||||
click: row => {
|
||||
|
||||
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)
|
||||
window.open(window.location.origin + '/#/previewFile?/' + 'row.absFilePath')
|
||||
} else {
|
||||
if (row.problemPath == null) {
|
||||
ElMessage({
|
||||
@@ -282,10 +283,11 @@ const tableStore = new TableStore({
|
||||
type: 'warning'
|
||||
})
|
||||
} 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,7 +93,7 @@ const getInfo = async () => {
|
||||
|
||||
const getFileData = async () => {
|
||||
//如果有问题附件
|
||||
console.log('000',detailData.value)
|
||||
//console.log('000',detailData.value)
|
||||
if (detailData.value.problemPath) {
|
||||
await getFileNameAndFilePath({ filePath: detailData.value.problemPath }).then(res => {
|
||||
console.log(res.data)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user