riku
2025-07-29 056ea576d820729878ffd62cd54cd7598e72d07e
src/views/overlay-clue/report/components/QuestionDetail.vue
@@ -90,9 +90,10 @@
          <el-icon><Plus /></el-icon>
          <template #file="{ file }">
            <div>
              <img
              <el-image
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                fit="cover"
                alt=""
              />
              <span class="el-upload-list__item-actions">
@@ -122,7 +123,7 @@
          <template #tip>
            <div class="el-upload__tip">
              {{
                `请选择小于500kb的jpg/png图片,最多${maxImageCount}张`
                `请选择小于5MB的jpg/png图片,最多${maxImageCount}张`
              }}
            </div>
          </template>
@@ -150,9 +151,7 @@
  <MapSearch
    v-model:show="mapDialogShow"
    :defaultCoor="
      formObj.coordinate
        ? formObj.coordinate.split(',')
        : undefined
      formObj.coordinate ? formObj.coordinate.split(',') : undefined
    "
    @on-submit="selectAddress"
  ></MapSearch>
@@ -166,6 +165,9 @@
import clueQuestionApi from '@/api/clue/clueQuestionApi';
import { $clue } from '@/api/index';
import MapSearch from '@/components/map/MapSearch.vue';
// 图片限定大小(单位:B)
const IMG_MAX_SIZE = 4 * 1024 * 1024;
// 决定当前是否是内部线索相关操作
const isInternal = inject('isInternal', false);
@@ -246,7 +248,18 @@
}
function handleFileChange(file, files) {
  fileList.value = files;
  // console.log('fileSelect', file);
  // 判断
  if (file.size > IMG_MAX_SIZE) {
    const index = files.indexOf(file);
    files.splice(index, 1);
    ElMessage({
      message: '图片大小超过限制',
      type: 'error'
    });
  } else {
    fileList.value = files;
  }
  edit.value = true;
}