详情页修改

This commit is contained in:
2026-10-08 11:47:35 +08:00
parent 99ab0a1183
commit f8c25dc9b8
5 changed files with 48 additions and 43 deletions
+9 -3
View File
@@ -41,7 +41,7 @@ const handleFileType = (type:string) => {
</div>
</template>
<!-- Word 预览 -->
<template v-if="handleFileType(previewFile?.file_type) === 'word'">
<template v-else-if="handleFileType(previewFile?.file_type) === 'word'">
<VueOfficeDocx :src="previewFile?.file_url" class="w-full items-center" />
</template>
<!-- Excel 预览 -->
@@ -49,15 +49,21 @@ const handleFileType = (type:string) => {
<VueOfficeExcel :src="previewFile?.file_url" class="w-full items-center" />
</template>
<!-- Ppt 预览 -->
<template v-if="handleFileType(previewFile?.file_type) === 'ppt'">
<template v-else-if="handleFileType(previewFile?.file_type) === 'ppt'">
<VueOfficePptx :src="previewFile?.file_url" class="w-full items-center" />
</template>
<!-- PDF 预览 -->
<template v-if="handleFileType(previewFile?.file_type) === 'pdf'">
<template v-else-if="handleFileType(previewFile?.file_type) === 'pdf'">
<div class="h-[68vh]">
<PDF :src="previewFile?.file_url" class="w-full h-full items-center" />
</div>
</template>
<!-- 其他类型文件预览 -->
<template v-else>
<div class="flex items-center justify-center py-2">
<p>暂不支持预览该文件类型</p>
</div>
</template>
</div>
</template>
+13 -13
View File
@@ -256,21 +256,21 @@ const back = () => {
// 导出
const exportFile = (type: string) => {
window.$message?.info('还差接口')
if(type === 'change'){
window.$message?.success('导出变更申请表成功');
}
if(type === 'risk'){
window.$message?.success('导出风险检查行动项表成功');
}
window.$message?.info('差接口')
// if(type === 'change'){
// window.$message?.success('导出变更申请表成功');
// }
// if(type === 'risk'){
// window.$message?.success('导出风险检查行动项表成功');
// }
};
// 变更附带资料下载/一键下载
const downloadFile = (file:any,type: string) => {
if(type === 'all'){
window.$message?.info('还差接口')
}else{
const downloadFile = (file:any) => {
if(file){
downloadFileFun(file?.file_url, file?.doc_name || file?.file_name);
}else{
window.$message?.info('差接口')
}
};
// 变更附带资料预览
@@ -553,7 +553,7 @@ onMounted(() => {
class="rounded-sm bg-[var(--theme-color)] px-3 py-1 text-xs font-semibold text-white"
:style="{'--theme-color': themeStore.themeColor}"
>变更附带资料</p>
<NButton ghost size="small" class="text-xs" @click="downloadFile(null,'all')"><Icon icon="material-symbols:download" class="size-16px" />一键下载</NButton>
<NButton ghost size="small" class="text-xs" @click="downloadFile(null)"><Icon icon="material-symbols:download" class="size-16px" />一键下载</NButton>
</div>
<NTable size="small">
<thead>
@@ -580,7 +580,7 @@ onMounted(() => {
<td>
<div class="flex items-center justify-center gap-2">
<NButton text type="primary" class="text-xs" @click="openPreview(doc)">预览</NButton>
<NButton text type="primary" class="text-xs" @click="downloadFile(doc,'single')">下载</NButton>
<NButton text type="primary" class="text-xs" @click="downloadFile(doc)">下载</NButton>
</div>
</td>
</tr>
+14 -15
View File
@@ -4,7 +4,7 @@ import { Icon } from '@iconify/vue'
import { useThemeStore } from '@/store/modules/theme';
import { useRouterPush } from '@/hooks/common/router';
import { useRoute } from 'vue-router';
import { getColorWithOpacity, tagTextColor, tagBgColor, tagBorderColor, formatTimestamp } from '@/utils/common';
import { getColorWithOpacity, tagTextColor, tagBgColor, tagBorderColor, formatTimestamp, downloadFileFun } from '@/utils/common';
import { AiError, aiTypeJudge } from "@/service/api/ai";
import { systemConfigApi } from '@/service/api/system';
import { getChangeDetailApi, urgeApi } from '@/service/api/change';
@@ -200,22 +200,21 @@ const back = () => {
// 导出
const exportFile = (type: string) => {
window.$message?.info('还差接口')
if(type === 'change'){
window.$message?.success('导出变更申请表成功');
}
if(type === 'risk'){
window.$message?.success('导出风险检查行动项表成功');
}
window.$message?.info('差接口')
// if(type === 'change'){
// window.$message?.success('导出变更申请表成功');
// }
// if(type === 'risk'){
// window.$message?.success('导出风险检查行动项表成功');
// }
};
// 变更附带资料下载/一键下载
const downloadFile = (type: string) => {
window.$message?.info('还差接口')
if(type === 'all'){
window.$message?.success('打包下载全部附件');
const downloadFile = (file: any) => {
if(file){
downloadFileFun(file?.file_url, file?.doc_name || file?.file_name);
}else{
window.$message?.success('下载当前附件成功');
window.$message?.info('差接口')
}
};
// 变更附带资料预览
@@ -657,7 +656,7 @@ onMounted(async () => {
class="rounded-sm bg-[var(--theme-color)] px-3 py-1 text-xs font-semibold text-white"
:style="{'--theme-color': themeStore.themeColor}"
>变更附带资料</p>
<NButton ghost size="small" class="text-xs" @click="downloadFile('all')"><Icon icon="material-symbols:download" class="size-16px" />一键下载</NButton>
<NButton ghost size="small" class="text-xs" @click="downloadFile(null)"><Icon icon="material-symbols:download" class="size-16px" />一键下载</NButton>
</div>
<NTable size="small">
<thead>
@@ -684,7 +683,7 @@ onMounted(async () => {
<td>
<div class="flex items-center justify-center gap-2">
<NButton text type="primary" class="text-xs" @click="openPreview(doc)">预览</NButton>
<NButton text type="primary" class="text-xs" @click="downloadFile('single')">下载</NButton>
<NButton text type="primary" class="text-xs" @click="downloadFile(doc)">下载</NButton>
</div>
</td>
</tr>
+11 -11
View File
@@ -171,21 +171,21 @@ const back = () => {
// 导出
const exportFile = (type: string) => {
window.$message?.info('还差接口')
if(type === 'change'){
window.$message?.success('导出变更申请表成功');
}
if(type === 'risk'){
window.$message?.success('导出风险检查行动项表成功');
}
window.$message?.info('差接口')
// if(type === 'change'){
// window.$message?.success('导出变更申请表成功');
// }
// if(type === 'risk'){
// window.$message?.success('导出风险检查行动项表成功');
// }
};
// 变更附带资料下载/一键下载
const downloadFile = (file:any,type: string) => {
const downloadFile = (file:any) => {
if(file){
downloadFileFun(file?.file_url, file?.doc_name || file?.file_name);
}else{
window.$message?.info('还差接口')
window.$message?.info('差接口')
}
};
// 变更附带资料预览
@@ -441,7 +441,7 @@ onMounted(() => {
class="rounded-sm bg-[var(--theme-color)] px-3 py-1 text-xs font-semibold text-white"
:style="{'--theme-color': themeStore.themeColor}"
>变更附带资料</p>
<NButton ghost size="small" class="text-xs" @click="downloadFile(null,'all')"><Icon icon="material-symbols:download" class="size-16px" />一键下载</NButton>
<NButton ghost size="small" class="text-xs" @click="downloadFile(null)"><Icon icon="material-symbols:download" class="size-16px" />一键下载</NButton>
</div>
<NTable size="small">
<thead>
@@ -468,7 +468,7 @@ onMounted(() => {
<td>
<div class="flex items-center justify-center gap-2">
<NButton text type="primary" class="text-xs" @click="openPreview(doc)">预览</NButton>
<NButton text type="primary" class="text-xs" @click="downloadFile(doc,'single')">下载</NButton>
<NButton text type="primary" class="text-xs" @click="downloadFile(doc)">下载</NButton>
</div>
</td>
</tr>
@@ -101,7 +101,7 @@ const approvalChain = computed(() => {
// 下载
const download = async () => {
window.$message?.info('差接口');
}
// 重新生成:AI 调用逻辑由各标签页组件实现(按 type 分发),此处仅派发事件
const regenerate = async () => {