|
@@ -144,7 +144,7 @@
|
|
|
<zm-table
|
|
<zm-table
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
|
:data="list"
|
|
:data="list"
|
|
|
- height="calc(62.5vh - 220px)"
|
|
|
|
|
|
|
+ height="calc(61vh - 220px)"
|
|
|
:show-overflow-tooltip="true"
|
|
:show-overflow-tooltip="true"
|
|
|
:row-style="tableRowStyle"
|
|
:row-style="tableRowStyle"
|
|
|
:row-class-name="tableRowClassName">
|
|
:row-class-name="tableRowClassName">
|
|
@@ -209,7 +209,7 @@
|
|
|
link
|
|
link
|
|
|
type="success"
|
|
type="success"
|
|
|
v-if="scope.row.certPic"
|
|
v-if="scope.row.certPic"
|
|
|
- @click="handleViewImage(scope.row.certPic)">
|
|
|
|
|
|
|
+ @click="viewFile(scope.row.certPic)">
|
|
|
查看证书
|
|
查看证书
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -356,8 +356,13 @@
|
|
|
style="width: 100%" />
|
|
style="width: 100%" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <el-form-item label="证书图片" prop="certPic">
|
|
|
|
|
- <UploadImage v-model="formData.certPic" />
|
|
|
|
|
|
|
+ <el-form-item label="证书附件" prop="certPic">
|
|
|
|
|
+ <!-- <UploadImage v-model="formData.certPic" /> -->
|
|
|
|
|
+ <UploadFile
|
|
|
|
|
+ v-model="formData.certPic"
|
|
|
|
|
+ :file-type="['pdf', 'jpg', 'png', 'jpeg']"
|
|
|
|
|
+ :file-size="100"
|
|
|
|
|
+ class="min-w-80px" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
@@ -367,18 +372,27 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
- <!-- 查看证书图片对话框 -->
|
|
|
|
|
- <el-dialog :title="imageDialogTitle" v-model="imageDialogVisible" width="800px" center>
|
|
|
|
|
- <!-- <img :src="imagePreviewUrl" alt="证书图片" style="max-width: 100%; max-height: 80vh" /> -->
|
|
|
|
|
|
|
+ <el-dialog v-model="dialogFileView" title="证书附件">
|
|
|
<div
|
|
<div
|
|
|
- style="display: flex; justify-content: center; align-items: center; flex-direction: column">
|
|
|
|
|
- <img
|
|
|
|
|
- v-for="url in imagePreviewUrl"
|
|
|
|
|
- :src="url"
|
|
|
|
|
- :key="url"
|
|
|
|
|
- alt="证书图片"
|
|
|
|
|
- style="max-width: 100%" />
|
|
|
|
|
|
|
+ v-for="(file, index) in fileList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ class="flex items-center justify-between mt-5">
|
|
|
|
|
+ <span class="file-name-text text-ellipsis!">{{ extractFileName(file) }}</span>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button link type="primary" @click="viewFileInfo(file)">
|
|
|
|
|
+ <Icon icon="ep:view" class="mr-2px" />查看</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button link type="primary" @click="handleDownload(file)">
|
|
|
|
|
+ <Icon icon="ep:download" class="mr-2px" />下载</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer mt-10">
|
|
|
|
|
+ <el-button type="primary" @click="dialogFileView = false"> 确认 </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -391,7 +405,6 @@ import { ElMessageBox, ElMessage } from 'element-plus'
|
|
|
const deptList = ref<Tree[]>([]) // 树形结构
|
|
const deptList = ref<Tree[]>([]) // 树形结构
|
|
|
const deptList2 = ref<Tree[]>([]) // 树形结构
|
|
const deptList2 = ref<Tree[]>([]) // 树形结构
|
|
|
import { formatDate } from '@/utils/formatTime'
|
|
import { formatDate } from '@/utils/formatTime'
|
|
|
-import UploadImage from '@/components/UploadFile/src/QHSEUploadImgs.vue'
|
|
|
|
|
import { DICT_TYPE, getStrDictOptions, getBoolDictOptions } from '@/utils/dict'
|
|
import { DICT_TYPE, getStrDictOptions, getBoolDictOptions } from '@/utils/dict'
|
|
|
import { defaultProps } from '@/utils/tree'
|
|
import { defaultProps } from '@/utils/tree'
|
|
|
import { selectedDeptsEmployee } from '@/api/system/user'
|
|
import { selectedDeptsEmployee } from '@/api/system/user'
|
|
@@ -426,8 +439,7 @@ const dialogTitle = ref('')
|
|
|
const isEdit = ref(false)
|
|
const isEdit = ref(false)
|
|
|
|
|
|
|
|
// 图片查看对话框
|
|
// 图片查看对话框
|
|
|
-const imageDialogVisible = ref(false)
|
|
|
|
|
-const imageDialogTitle = ref('证书图片')
|
|
|
|
|
|
|
+const dialogFileView = ref(false)
|
|
|
const imagePreviewUrl = ref('')
|
|
const imagePreviewUrl = ref('')
|
|
|
|
|
|
|
|
// 表单相关
|
|
// 表单相关
|
|
@@ -570,11 +582,31 @@ const handleEdit = (row) => {
|
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 查看证书图片
|
|
|
|
|
-const handleViewImage = (imageUrl: any) => {
|
|
|
|
|
- imagePreviewUrl.value = imageUrl.split(',')
|
|
|
|
|
- imageDialogTitle.value = '证书图片'
|
|
|
|
|
- imageDialogVisible.value = true
|
|
|
|
|
|
|
+let fileList = ref([])
|
|
|
|
|
+const viewFile = (file) => {
|
|
|
|
|
+ fileList.value = file.split(',')
|
|
|
|
|
+ dialogFileView.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const viewFileInfo = (file) => {
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ 'http://doc.deepoil.cc:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(file))
|
|
|
|
|
+ )
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const extractFileName = (url: string): string => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 移除查询参数和哈希
|
|
|
|
|
+ const cleanUrl = url.split('?')[0].split('#')[0]
|
|
|
|
|
+ // 获取最后一个斜杠后的内容
|
|
|
|
|
+ const parts = cleanUrl.split('/')
|
|
|
|
|
+ const fileName = parts[parts.length - 1]
|
|
|
|
|
+ // URL 解码
|
|
|
|
|
+ return decodeURIComponent(fileName) || url
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ // 如果解析失败,返回原始 URL
|
|
|
|
|
+ return url
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 确保时间戳是毫秒级的
|
|
// 确保时间戳是毫秒级的
|
|
@@ -716,6 +748,23 @@ const downloadFile = (response: any) => {
|
|
|
window.URL.revokeObjectURL(url)
|
|
window.URL.revokeObjectURL(url)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const handleDownload = async (url) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const response = await fetch(url)
|
|
|
|
|
+ const blob = await response.blob()
|
|
|
|
|
+ const downloadUrl = window.URL.createObjectURL(blob)
|
|
|
|
|
+
|
|
|
|
|
+ const link = document.createElement('a')
|
|
|
|
|
+ link.href = downloadUrl
|
|
|
|
|
+ link.download = url.split('/').pop() // 自动获取文件名:ml-citation{ref="3" data="citationList"}
|
|
|
|
|
+ link.click()
|
|
|
|
|
+
|
|
|
|
|
+ URL.revokeObjectURL(downloadUrl)
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('下载失败:', error)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
let userList = ref([])
|
|
let userList = ref([])
|
|
|
const handleDeptChange = async (value) => {
|
|
const handleDeptChange = async (value) => {
|
|
|
const res = await selectedDeptsEmployee({
|
|
const res = await selectedDeptsEmployee({
|
|
@@ -757,10 +806,10 @@ onMounted(async () => {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
-:deep(.el-tree--highlight-current) {
|
|
|
|
|
|
|
+::deep(.el-tree--highlight-current) {
|
|
|
height: 200px !important;
|
|
height: 200px !important;
|
|
|
}
|
|
}
|
|
|
-:deep(.el-transfer-panel__body) {
|
|
|
|
|
|
|
+::deep(.el-transfer-panel__body) {
|
|
|
height: 700px !important;
|
|
height: 700px !important;
|
|
|
}
|
|
}
|
|
|
|
|
|