董国庆
2026-07-09 482d9939c11104fc4c6d85d650f359fb663443b0
优化:车辆素材库-文件上传限制比例15:7而不限制大小
1个文件已修改
8 ■■■■■ 已修改文件
src/views/assetManagement/vehicleManagement/vehicleMaterial/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/assetManagement/vehicleManagement/vehicleMaterial/index.vue
@@ -102,10 +102,10 @@
  }
  try {
    // 上传前校验图片实际宽高,只允许 450 * 210 的素材图。
    // 上传前只校验图片比例是否为 15:7,不再限制固定尺寸。
    const { width, height } = await getImageSize(file)
    if (width !== 450 || height !== 210) {
      message.error('请上传尺寸为 450*210,比例为 15:7 的图片')
    if (!width || !height || width * 7 !== height * 15) {
      message.error('请上传比例为 15:7 的图片')
      return false
    }
  }
@@ -260,7 +260,7 @@
                      点击上传图片
                    </div>
                    <div class="mt-4px text-12px text-center" style="color: rgba(23, 31, 38, 0.4); line-height: 1.5;">
                      建议尺寸 450*210<br>大小不超过 2MB
                      建议比例为 15:7 <br>大小不超过 2MB
                    </div>
                  </div>
                </NUploadDragger>