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
43
44
45
46
47
48
49
50
51
52
53
| <template>
| <FYImageSelectDialog
| :typeList="typeList"
| :typeImgMap="typeImgMap"
| :maxSelect="1"
| ></FYImageSelectDialog>
| </template>
| <script setup>
| import { ref, watch, computed } from 'vue';
|
| const props = defineProps({
| // 展示模式
| mode: {
| type: Number,
| default: 0
| },
| pics: Array
| });
| // typeList: [
| // { id: 0, label: '监控设备' },
| // { id: 1, label: '治理设备' },
| // { id: 2, label: '生产设备' }
| // ],
| const typeList = computed(() => {
| if (props.mode == 0) {
| return [{ typeId: 0, typeName: '监控设备' }];
| } else if (props.mode == 1) {
| return [{ typeId: 1, typeName: '整改' }];
| } else {
| return [{ typeId: 1, typeName: '未指定' }];
| }
| });
| const typeImgMap = ref(new Map());
|
| watch(
| () => props.pics,
| (nV, oV) => {
| nV.forEach(e => {
| if (!typeImgMap.value.has(e.topTypeId)) {
| typeImgMap.value.set(e.topTypeId, [])
| }
| typeImgMap.value.get(r.topTypeId).push({})
| });
| typeImgMap.value.set(
| 1,
| nV.map((v) => {
| return { url: v };
| })
| );
| },
| { immediate: true }
| );
| </script>
|
|