<template>
|
<div class="file-page">
|
<SectionTitle title="影像资料信息"></SectionTitle>
|
<!-- <p class="file-top-buttons"> -->
|
<!-- <el-button size="small" class="top-button">手机扫码上传</el-button> -->
|
<!-- <el-button size="small" class="top-button" @click="getList">刷新</el-button> -->
|
<!-- </p> -->
|
<ul class="file-ul">
|
<li v-for="item in menu" :key="item.imageListCode">
|
<div class="file-section">
|
<p class="section-title">
|
{{item.imageListName}}
|
<span
|
v-if="Array.isArray(item.list) && item.list.length > 0"
|
>({{item.list.length}}张)</span>
|
</p>
|
<div class="file-content">
|
<PhotoList
|
:list="item.list"
|
@action="init"
|
:isEdit="isEdit"
|
:info="item"
|
@getList="getList"
|
></PhotoList>
|
</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</template>
|
<script>
|
// 影像资料信息
|
import SectionTitle from '@/components/SectionTitle'
|
import qryImageMenuList from '@/controller/qryImageMenuList'
|
import queryEcmPageList from '@/controller/queryEcmPageList'
|
import infoDataAuthority from '@/controller/infoDataAuthority' // 初始化
|
import PhotoList from '@/components/PhotoList'
|
|
export default {
|
components: {
|
SectionTitle,
|
PhotoList
|
},
|
props: {
|
conf: {
|
type: Object,
|
default: () => ({})
|
}
|
},
|
data() {
|
return {
|
menu: [],
|
isEdit: true,
|
objectNo:'',
|
objectType:'',
|
}
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
init() {
|
const { $route, conf } = this
|
const { query } = $route
|
|
const { edit } = conf
|
|
this.query = query
|
this.isEdit = edit === 'Y'
|
this.model = queryEcmPageList()
|
// this.initImg = infoDataAuthority()
|
this.getMenu()
|
},
|
async getMenu() {
|
const { query } = this
|
const { transLogSerialno = '', transCode = '', imgTransCode = '', pageId, phaseNo, transCodeOne } = query
|
const menuModel = qryImageMenuList()
|
const reqData = {
|
phaseNo,
|
transCode: '5006'
|
}
|
const { list } = await menuModel.request(reqData)
|
this.menu = list
|
this.getList()
|
},
|
|
async getList(item) {
|
const { menu } = this
|
menu.forEach(item => {
|
this.getItem(item)
|
})
|
},
|
|
async getItem(item) {
|
const { query, model } = this
|
const { transLogSerialno, objectType, objectNo } = query
|
const { imageListCode } = item
|
const { list } = await model.request({
|
objectNo,
|
objectType,
|
typeNo: imageListCode
|
})
|
const { menu } = this
|
this.menu = menu.map(menuItem => {
|
if (menuItem.imageListCode === imageListCode) {
|
return {
|
...item,
|
list
|
}
|
} else {
|
return menuItem
|
}
|
})
|
},
|
},
|
watch: {
|
$route() {
|
const { transSerialNo } = this.$route.query
|
if (transSerialNo) {
|
this.init()
|
}
|
}
|
}
|
}
|
</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;
|
/* &::before {
|
content: '';
|
display: inline-block;
|
width: 4px;
|
height: 4px;
|
margin-right: 8px;
|
background: rgba(255, 67, 0, 1);
|
} */
|
& span {
|
font-weight: 400;
|
color: rgba(197, 197, 197, 1);
|
}
|
}
|
& .file-ul {
|
margin: 0;
|
padding: 0;
|
list-style: none;
|
display: flex;
|
flex-wrap: wrap;
|
& li {
|
width: 460px;
|
&:nth-child(odd) {
|
margin-right: 165px;
|
}
|
}
|
& .file-content {
|
background: rgba(249, 249, 249, 1);
|
border-radius: 4px;
|
padding: 11px 11px 0 11px;
|
}
|
}
|
}
|
</style>
|