8e063a311452a677a4938db9dfba9760472b272e..d44688c138c93d093e9a8abd7addeddc4a22f2cd
2025-12-31 gaoluyang
陕西昭德型煤: 1.部署修改
dev
d44688 对比 | 目录
2025-12-31 gaoluyang
陕西昭德型煤: 1.现场巡检上传附件查看附件修改联调
68efd6 对比 | 目录
已修改2个文件
34 ■■■■ 文件已修改
src/views/inspectionManagement/components/viewQrCodeFiles.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/components/viewQrCodeFiles.vue
@@ -95,15 +95,39 @@
const cancel = () => {
  dialogVisitable.value = false;
};
// 基础预览URL
const BASE_PREVIEW_URL = 'https://nj477vg8876.vicp.fun';
// 处理每一类数据:分离图片和视频
function processItems(items) {
  const images = [];
  const videos = [];
  if (!items || !Array.isArray(items)) {
    return { images, videos };
  }
  items.forEach(item => {
    // 使用 fileUrl 字段,如果不存在则使用 url 字段作为兼容
    const fileUrl = item.fileUrl || item.url;
    if (!fileUrl) return;
    // 构建完整的预览URL
    let fullUrl = fileUrl;
    // 如果 fileUrl 不是完整URL,则拼接基础URL
    if (!fileUrl.startsWith('http://') && !fileUrl.startsWith('https://')) {
      // 确保路径以 / 开头
      const path = fileUrl.startsWith('/') ? fileUrl : `/${fileUrl}`;
      fullUrl = `${BASE_PREVIEW_URL}${path}`;
    }
    // 输出最终路径,方便调试
    console.log('原始 fileUrl:', fileUrl);
    console.log('最终预览路径:', fullUrl);
    console.log('文件类型:', item.contentType);
    if (item.contentType?.startsWith('image/')) {
      images.push(item.url);
      images.push(fullUrl);
    } else if (item.contentType?.startsWith('video/')) {
      videos.push(item.url);
      videos.push(fullUrl);
    }
  });
  return { images, videos };
vite.config.js
@@ -2,11 +2,7 @@
import path from 'path'
import createVitePlugins from './vite/plugins'
const baseUrl = 'http://114.132.189.42:7016' // 后端接口
// const baseUrl = 'http://114.132.189.42:7016'
// const baseUrl = 'http://10.42.128.207:7016' // 后端接口
// const baseUrl = 'http://192.168.1.144:7016' // 后端接口
// const baseUrl = 'http://10.36.17.159:7016' // 后端接口
const baseUrl = 'http://nj477vg8876.vicp.fun' // 后端接口
// https://vitejs.dev/config/
export default defineConfig(({ mode, command }) => {