b34c02590a3253955c3f44a1cbbbf8ba2a786893..4a68a94d5e429eca8b01a24bdbf601c0331ff73d
5 天以前 zhangwencui
保养预览
4a68a9 对比 | 目录
5 天以前 zhangwencui
图片地址修正
b39e03 对比 | 目录
5 天以前 zhangwencui
加fileUrl路径
6b0dac 对比 | 目录
5 天以前 spring
fix: web端隐患上报已整改操作完,APP端隐患上报还可以继续整改
9c377c 对比 | 目录
已修改5个文件
72 ■■■■ 文件已修改
src/config.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/equipmentManagement/upkeep/detail.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/equipmentManagement/upkeep/maintain.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inspectionUpload/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/safeProduction/dangerInvestigation/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/config.js
@@ -1,6 +1,7 @@
// 应用全局配置
const config = {
  baseUrl: "http://1.15.17.182:9011",
  fileUrl: "http://1.15.17.182:9010",
  // 应用信息
  appInfo: {
    // 应用名称
src/pages/equipmentManagement/upkeep/detail.vue
@@ -196,12 +196,12 @@
    if (url.startsWith("http://") || url.startsWith("https://")) {
      return url;
    }
    const uploadsIndex = url.indexOf("uploads");
    if (uploadsIndex !== -1) {
      const relativePath = url.substring(uploadsIndex);
      return `${config.baseUrl}/${relativePath}`;
    }
    return `${config.baseUrl}/${url}`;
    // const uploadsIndex = url.indexOf("uploads");
    // if (uploadsIndex !== -1) {
    //   const relativePath = url.substring(uploadsIndex);
    //   return `${config.fileUrl}/${relativePath}`;
    // }
    return `${config.fileUrl}/${url}`;
  };
  // 判断是否为图片文件
@@ -217,18 +217,18 @@
  // 预览文件
  const previewFile = file => {
    if (file.type.includes("image")) {
      uni.previewImage({
        urls: [file.url],
        current: file.url,
      });
    } else {
      // 视频预览
      const videoUrl = formatFileUrl(file.url || file.downloadUrl);
      uni.navigateTo({
        url: `/pages/common/videoPreview?url=${encodeURIComponent(videoUrl)}`,
      });
    }
    // if (file.type.includes("image")) {
    uni.previewImage({
      urls: [formatFileUrl(file.url)],
      current: formatFileUrl(file.url),
    });
    // } else {
    //   // 视频预览
    //   const videoUrl = formatFileUrl(file.url || file.downloadUrl);
    //   uni.navigateTo({
    //     url: `/pages/common/videoPreview?url=${encodeURIComponent(videoUrl)}`,
    //   });
    // }
  };
  // 获取详情数据
@@ -260,6 +260,7 @@
    // 处理附件数据 - 支持多种数据结构
    console.log(data.imagesFile);
    fileList.value = data.imagesFile;
    console.log(formatFileUrl(fileList.value[0].url));
  };
  // 返回上一页
src/pages/equipmentManagement/upkeep/maintain.vue
@@ -926,12 +926,12 @@
    if (url.startsWith("http://") || url.startsWith("https://")) {
      return url;
    }
    const uploadsIndex = url.indexOf("uploads");
    if (uploadsIndex !== -1) {
      const relativePath = url.substring(uploadsIndex);
      return `${config.baseUrl}/${relativePath}`;
    }
    return `${config.baseUrl}/${url}`;
    // const uploadsIndex = url.indexOf("uploads");
    // if (uploadsIndex !== -1) {
    //   const relativePath = url.substring(uploadsIndex);
    //   return `${config.fileUrl}/${relativePath}`;
    // }
    return `${config.fileUrl}/${url}`;
  };
  // 上传成功处理
src/pages/inspectionUpload/index.vue
@@ -281,7 +281,7 @@
                      class="attachment-item"
                      @click="previewAttachment(file)">
                  <view class="attachment-preview-container">
                    {{formatFileUrl(file.url || file.downloadUrl)}}
                    <!-- {{formatFileUrl(file.url || file.downloadUrl)}} -->
                    <image v-if="file.type === 'image' || isImageFile(file)"
                           :src="formatFileUrl(file.url || file.downloadUrl)"
                           class="attachment-preview"
@@ -1054,7 +1054,7 @@
  };
  // 文件访问基础域(后端要求前缀)
  const filePreviewBase = config.baseUrl;
  const filePreviewBase = config.fileUrl;
  // 将后端返回的文件地址规范成可访问URL
  // 兼容场景:
@@ -1596,12 +1596,12 @@
    if (url.startsWith("http://") || url.startsWith("https://")) {
      return url;
    }
    const uploadsIndex = url.indexOf("uploads");
    if (uploadsIndex !== -1) {
      const relativePath = url.substring(uploadsIndex);
      return `${config.baseUrl}/${relativePath}`;
    }
    return `${config.baseUrl}/${url}`;
    // const uploadsIndex = url.indexOf("uploads");
    // if (uploadsIndex !== -1) {
    //   const relativePath = url.substring(uploadsIndex);
    //   return `${config.fileUrl}/${relativePath}`;
    // }
    return `${config.fileUrl}/${url}`;
  };
  // 格式化文件大小
  const formatFileSize = size => {
src/pages/safeProduction/dangerInvestigation/index.vue
@@ -121,14 +121,14 @@
            <u-button type="warning"
                      size="small"
                      class="action-btn"
                      :disabled="item.isRectify"
                      :disabled="item.isRectify || item.rectifyActualTime"
                      @click="rectifyVisit(item)">
              整改
            </u-button>
            <u-button type="success"
                      size="small"
                      class="action-btn"
                      :disabled="!item.rectifyActualTime"
                      :disabled="!item.rectifyActualTime || item.verifyTime"
                      @click="acceptanceVisit(item)">
              验收
            </u-button>
@@ -137,6 +137,7 @@
            <u-button type="primary"
                      size="small"
                      class="action-btn"
                      :disabled="item.rectifyActualTime || item.verifyTime"
                      @click="editVisit(item)">
              编辑
            </u-button>
@@ -149,6 +150,7 @@
            <u-button type="error"
                      size="small"
                      class="action-btn"
                      :disabled="item.rectifyActualTime || item.verifyTime"
                      @click="deleteVisit(item)">
              删除
            </u-button>