1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
  <FYImageSelectDialog
    :typeList="typeList"
    :typeImgMap="typeImgMap"
    :maxSelect="1"
  ></FYImageSelectDialog>
</template>
<script setup>
import { ref, watch, computed } from 'vue';
const props = defineProps({
  // 展示模式,problem:问题图片;change:整改图片
  mode: {
    type: String,
    default: 'problem'
  },
  pics: Array
});
 
const typeList = computed(() => {
  if (props.mode == 'problem') {
    return [{ typeId: 1, typeName: '问题' }];
  } else if (props.mode == 'change') {
    return [{ typeId: 1, typeName: '整改' }];
  } else {
    return [{ typeId: 1, typeName: '未指定' }];
  }
});
const typeImgMap = ref(new Map());
 
watch(
  () => props.pics,
  (nV, oV) => {
    typeImgMap.value.set(
      1,
      nV.map((v) => {
        return { url: v };
      })
    );
  },
  { immediate: true }
);
</script>