|
|
@@ -478,6 +478,7 @@
|
|
|
:headers="{ 'tenant-id': 1, 'device-id': 'undefined' }"
|
|
|
name="files"
|
|
|
class="w-50%"
|
|
|
+ @preview="handlePreview"
|
|
|
>
|
|
|
<el-button type="primary">上传工程设计</el-button>
|
|
|
<template #tip>
|
|
|
@@ -493,6 +494,7 @@
|
|
|
:headers="{ 'tenant-id': 1, 'device-id': 'undefined' }"
|
|
|
name="files"
|
|
|
class="w-50%"
|
|
|
+ @preview="handlePreview"
|
|
|
>
|
|
|
<el-button type="primary">上传地质设计</el-button>
|
|
|
<template #tip>
|
|
|
@@ -508,6 +510,7 @@
|
|
|
:headers="{ 'tenant-id': 1, 'device-id': 'undefined' }"
|
|
|
name="files"
|
|
|
class="w-50%"
|
|
|
+ @preview="handlePreview"
|
|
|
>
|
|
|
<el-button :disabled="tableData[0].status !== 'wg'" type="primary">上传完井报告</el-button>
|
|
|
<template #tip>
|
|
|
@@ -817,6 +820,7 @@ import * as UserApi from '@/api/system/user'
|
|
|
import { IotProjectTaskAttrsApi } from '@/api/pms/iotprojecttaskattrs'
|
|
|
import { DICT_TYPE, getStrDictOptions, getDictLabel } from '@/utils/dict'
|
|
|
import { IotOpeationFillApi } from '@/api/pms/iotopeationfill'
|
|
|
+import { Base64 } from 'js-base64'
|
|
|
// 在导入部分添加Plus图标
|
|
|
// import { Plus } from '@element-plus/icons-vue'
|
|
|
|
|
|
@@ -839,6 +843,23 @@ if (params.projectId) {
|
|
|
: (query.projectId as string)
|
|
|
}
|
|
|
|
|
|
+function handlePreview(file: any) {
|
|
|
+ if (!file.response) {
|
|
|
+ message.error('附件路径不存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ const filePath = file.response.data.filePath ?? file.response.data.files[0].filePath
|
|
|
+ const encodedPath = encodeURIComponent(Base64.encode(filePath))
|
|
|
+
|
|
|
+ window.open(`http://doc.deepoil.cc:8012/onlinePreview?url=${encodedPath}`)
|
|
|
+ } catch (error) {
|
|
|
+ console.error('预览附件失败:', error)
|
|
|
+ message.error('预览附件失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 施工队伍 选择树 响应式变量
|
|
|
const defaultExpandedKeys = ref<number[]>([]) // 默认展开的部门节点keys
|
|
|
const treeSelectRef = ref() // 树选择组件的引用
|