fix(router): 禁用特定路由的keepAlive以修复组件缓存问题
禁用资产管理和交易模块中三个页面的keepAlive配置,防止组件状态在路由切换时错误保留。同时优化文件上传组件,通过导入本地图标资源替换硬编码路径,提升应用部署后的资源加载可靠性。
| | |
| | | menuType: 'dir', |
| | | componentPath: null, |
| | | id: 501, |
| | | keepAlive: true, |
| | | keepAlive: false, |
| | | pid: 5, |
| | | }, |
| | | { |
| | |
| | | menuType: 'page', |
| | | componentPath: '/assetManagement/vehicleManagement/operatingVehicle/index.vue', |
| | | id: 5013, |
| | | keepAlive: true, |
| | | keepAlive: false, |
| | | pid: 501, |
| | | }, |
| | | { |
| | |
| | | menuType: 'page', |
| | | componentPath: '/transaction/order/orderManagement/index.vue', |
| | | id: 6011, |
| | | keepAlive: true, |
| | | keepAlive: false, |
| | | pid: 601, |
| | | }, |
| | | { |
| | |
| | | import { addVehicle } from '@/service/api/vehicle' |
| | | import { fetchElectronicFenceAreaList } from '@/service/api/point' |
| | | import { beforeUploadCheck, customUploadRequest } from '@/utils/upload' |
| | | import excelIcon from '@/assets/element-img/excel.png' |
| | | import wordIcon from '@/assets/element-img/word.png' |
| | | import pdfIcon from '@/assets/element-img/pdf.png' |
| | | import uploadIcon from '@/assets/element-img/upload.png' |
| | | import noticeIcon from '@/assets/element-img/notice.png' |
| | | import noDataIcon from '@/assets/element-img/no-data.png' |
| | | |
| | | const router = useRouter() |
| | | |
| | |
| | | const completeInfoFormRef = ref<FormInst | null>(null) |
| | | |
| | | type UploadField = 'vehiclePhotos' | 'inspectionFiles' | 'insuranceFiles' | 'onlineCarLicenseFiles' |
| | | |
| | | const fileIconMap: Record<string, string> = { |
| | | xls: excelIcon, |
| | | xlsx: excelIcon, |
| | | doc: wordIcon, |
| | | docx: wordIcon, |
| | | pdf: pdfIcon, |
| | | } |
| | | |
| | | // 表单数据 |
| | | const formModel = ref({ |
| | |
| | | // 获取文件图标 |
| | | function getFileIcon(fileName: string) { |
| | | const ext = fileName.split('.').pop()?.toLowerCase() |
| | | if (ext === 'xls' || ext === 'xlsx') { |
| | | return '/src/assets/element-img/excel.png' // Excel 绿色 |
| | | } |
| | | if (ext === 'doc' || ext === 'docx') { |
| | | return '/src/assets/element-img/word.png' // Word 蓝色 |
| | | } |
| | | if (ext === 'pdf') { |
| | | return '/src/assets/element-img/pdf.png' // PDF 红色 |
| | | } |
| | | return '/src/assets/element-img/pdf.png' // 默认文件 |
| | | return (ext && fileIconMap[ext]) || pdfIcon |
| | | } |
| | | |
| | | // 保存中状态 |
| | |
| | | </div> |
| | | </div> --> |
| | | <img |
| | | src="/src/assets/element-img/upload.png" |
| | | :src="uploadIcon" |
| | | style="width: 56px; height: 56px" |
| | | alt="upload" |
| | | > |
| | | </n-upload> |
| | | </div> |
| | |
| | | </n-form-item> |
| | | <div class="flex"> |
| | | <img |
| | | src="/src/assets/element-img/notice.png" |
| | | :src="noticeIcon" |
| | | style=" |
| | | width: 12px; |
| | | height: 12px; |
| | |
| | | <template #empty> |
| | | <div class="flex-center"> |
| | | <img |
| | | src="/src/assets/element-img/no-data.png" |
| | | :src="noDataIcon" |
| | | style="width: 50%" |
| | | alt="no-data" |
| | | > |