zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<template>
  <div class="file-page">
    <SectionTitle title="影像资料信息"></SectionTitle>
    <ul class="file-ul">
      <li v-for="item in menu" :key="item.typeNo">
        <div class="file-section">
          <p class="section-title">
            <span v-if="isEdit && isRequiredUpload" class="require-dot">*</span>
            <span>{{item.typeName}}</span>
            <span
              v-if="Array.isArray(item.list) && item.list.length > 0"
              class="img-num"
            >({{item.list.length}}张)</span>
          </p>
          <div class="file-content">
            <PhotoList
              :list="item.list"
              @action="init"
              :isEdit="isEdit"
              :info="item"
              @getList="getList"
              :imageEditStatus="$route.query.imageEditStatus"
            ></PhotoList>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
// 影像资料信息
import {
  qryImageMenuContractList,
  qryImageByType
} from '@comprehensive/serve/public'
import SectionTitle from '../SectionTitle'
import PhotoList from '../PhotoList'
export default {
  components: {
    SectionTitle,
    PhotoList
  },
  props: {
    // 申请编号
    info: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      menu: [],
      query: {},
      textList: [],
      imgList: [],
      newWindow: null,
      isAddEvent: false,
      isRequiredUpload: false
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      const { $route } = this
      const { query } = $route
      const { isRequiredUpload } = query
 
      this.isRequiredUpload = parseInt(isRequiredUpload) === 1
      this.query = this.$route.query
      this.getMenu()
    },
 
    // 影像资料信息1==文本列表
    async getMenu() {
      this.loading = true
      const { dirNo } = this.query
      const res = await qryImageMenuContractList({
        dirNo
      })
      this.loading = false
      const { result } = res
      this.menu = result
      this.getList()
    },
    getList(item) {
      const { menu } = this
      menu.forEach(item => {
        this.getItem(item)
      })
    },
    async getItem(item) {
      const { query, menu } = this
      const { objectType, objectNo } = query
      const { typeNo } = item
 
      const { result } = await qryImageByType({
        objectNo,
        objectType,
        typeNo
      })
 
      const menuIndex = menu.findIndex(menuItem => menuItem.typeNo === typeNo)
      this.$set(menu, menuIndex, { ...menu[menuIndex], list: result })
    }
  },
  computed: {
    isEdit() {
      const { info } = this
      return info.edit === 'Y'
    }
  }
}
</script>
 
<style lang="postcss" scoped>
.file-page {
  & .file-top-buttons {
    padding: 0 0 20px 0;
    & .top-button {
      line-height: 23px;
      border-radius: 2px;
      padding: 0 8px;
      border: 1px solid rgba(238, 238, 238, 1);
      font-size: 12px;
      font-weight: 400;
      color: rgba(119, 119, 119, 1);
      margin: 0 28px 0 0;
    }
  }
  & .section-title {
    font-size: 14px;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    line-height: 20px;
    & .require-dot {
      color: #f56c6c;
      margin-right: 4px;
    }
    & .img-num {
      font-weight: 400;
      color: rgba(197, 197, 197, 1);
    }
  }
  & .file-ul {
    margin: 0;
    padding: 0 40px 0 0;
    list-style: none;
    display: grid;
    grid-column-gap: 165px;
    grid-template-columns: 1fr 1fr;
    & li {
      margin-bottom: 10px;
    }
    & .file-content {
      background: rgba(249, 249, 249, 1);
      border-radius: 4px;
      padding: 11px 11px 0 11px;
    }
  }
}
</style>