|
@@ -39,9 +39,9 @@
|
|
|
<div class="content-media">
|
|
|
<el-scrollbar style="height:100%;">
|
|
|
<div>
|
|
|
- <exhibitionImage :exhibitionImage="exhibitionImage"/>
|
|
|
- <exhibitionVideo :exhibitionVideo="exhibitionVideo"/>
|
|
|
- <exhibitionFile :exhibitionFile="exhibitionFile"/>
|
|
|
+ <exhibitionImage :exhibitionImage="exhibitionImage" v-show="isShowImage"/>
|
|
|
+ <exhibitionVideo :exhibitionVideo="exhibitionVideo" v-show="isShowVideo"/>
|
|
|
+ <exhibitionFile :exhibitionFile="exhibitionFile" v-show="isShowFile"/>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
@@ -131,6 +131,7 @@
|
|
|
},
|
|
|
exhibitionEnergy: {
|
|
|
title: '能耗信息',
|
|
|
+ firstName:'',
|
|
|
dynamic: [],
|
|
|
},
|
|
|
exhibitionMaintain: {
|
|
@@ -151,9 +152,12 @@
|
|
|
},
|
|
|
exhibitionVideo: {
|
|
|
title: '视频',
|
|
|
- list: {}
|
|
|
+ list: []
|
|
|
},
|
|
|
instance: {},//实例信息处理
|
|
|
+ isShowImage: true,
|
|
|
+ isShowVideo: true,
|
|
|
+ isShowFile: true,
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -194,6 +198,7 @@
|
|
|
obj = tools.flattenKeys(obj);
|
|
|
this.instance = obj;
|
|
|
this.handleRadios(1)
|
|
|
+ this.handleEnclosure() //处理图片视频文件信息
|
|
|
this.pointData.forEach(item => {
|
|
|
if (item.InputMode == "L" || item.InputMode == "L1" || item.InputMode == "L2" || item.InputMode == "M") {
|
|
|
let cur = tools.dataForKey(this.exampleData, item.Path);
|
|
@@ -216,10 +221,13 @@
|
|
|
}
|
|
|
if (this.criterias.length) {
|
|
|
BeatchQueryParam(params, res => {
|
|
|
- res.Content.map(child => {
|
|
|
+ res.Content && res.Content.map(child => {
|
|
|
this.pointData.forEach(head => {
|
|
|
if (head.InfoPointCode == child.code) {
|
|
|
+ console.log(head.FirstName,child,'==')
|
|
|
+ this.exhibitionEnergy.firstName = head.FirstName
|
|
|
this.exhibitionEnergy.dynamic.push({
|
|
|
+ FirstName:head.FirstName,
|
|
|
InfoPointCode: head.InfoPointCode,
|
|
|
InfoPointName: head.InfoPointName,
|
|
|
Path: head.Path,
|
|
@@ -237,6 +245,22 @@
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+ handleEnclosure() {
|
|
|
+ //图片文件处理,脱离radio控制
|
|
|
+ let isList = this.pointData
|
|
|
+ let isArr = []
|
|
|
+ isList.map(j => {
|
|
|
+ if (this.instance.hasOwnProperty(j.Path)) {
|
|
|
+ return {
|
|
|
+ ...j,
|
|
|
+ value: this.instance[j.Path]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ isArr = isList.filter(k => k.value)
|
|
|
+ this.handlePicList(isArr)
|
|
|
+ this.handleFileList(isArr)
|
|
|
+ },
|
|
|
handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
|
|
|
let arr = []
|
|
|
//关键信息点
|
|
@@ -249,13 +273,13 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
if (val == 1) { //需采集信息
|
|
|
arr = this.pointData.filter(i => i.Visible)
|
|
|
-
|
|
|
- // 图片和的处理
|
|
|
- this.handlePicList(arr)
|
|
|
- // 文件处理
|
|
|
- this.handleFileList(arr)
|
|
|
+ // // 图片和的处理
|
|
|
+ // this.handlePicList(arr)
|
|
|
+ // // 文件处理
|
|
|
+ // this.handleFileList(arr)
|
|
|
|
|
|
} else if (val == 2) { //有值信息点
|
|
|
let list = this.pointData
|
|
@@ -266,14 +290,15 @@
|
|
|
value: this.instance[j.Path]
|
|
|
}
|
|
|
}
|
|
|
- arr = list.filter(k => k.value)
|
|
|
- this.handlePicList(arr)
|
|
|
- this.handleFileList(arr)
|
|
|
})
|
|
|
+ arr = list.filter(k => k.value)
|
|
|
+ // this.handlePicList(arr, 2)
|
|
|
+ // this.handleFileList(arr, 2)
|
|
|
+
|
|
|
} else { //全部信息点
|
|
|
arr = this.pointData
|
|
|
- this.handlePicList(arr)
|
|
|
- this.handleFileList(arr)
|
|
|
+ // this.handlePicList(arr)
|
|
|
+ // this.handleFileList(arr)
|
|
|
}
|
|
|
this.displayData(arr)
|
|
|
},
|
|
@@ -281,31 +306,49 @@
|
|
|
let picObject = {}
|
|
|
//处理数据格式
|
|
|
arr.map(i => {
|
|
|
- if(i.InputMode == 'F2') {
|
|
|
- switch (i.Path) {
|
|
|
- case 'LedgerParam.PhotoDoc.Drawing':
|
|
|
- case 'LedgerParam.Siteinstall.InstallPic':
|
|
|
- case 'LedgerParam.Siteinstall.InstallDrawing':
|
|
|
- case 'LedgerParam.PhotoDoc.Nameplate':
|
|
|
- if (this.instance.hasOwnProperty(i.Path)) {
|
|
|
- i.PicList = this.instance[i.Path]
|
|
|
- }
|
|
|
- if (picObject[i.InfoPointName]) {
|
|
|
+ if (i.InputMode == 'F2') {
|
|
|
+ switch (i.Path) {
|
|
|
+ case 'LedgerParam.PhotoDoc.Drawing':
|
|
|
+ case 'LedgerParam.Siteinstall.InstallPic':
|
|
|
+ case 'LedgerParam.Siteinstall.InstallDrawing':
|
|
|
+ case 'LedgerParam.PhotoDoc.Nameplate':
|
|
|
+ if (this.instance.hasOwnProperty(i.Path)) {
|
|
|
+ i.PicList = this.instance[i.Path]
|
|
|
+ }
|
|
|
+ if (picObject[i.InfoPointName]) {
|
|
|
|
|
|
- } else {
|
|
|
- picObject[i.InfoPointName] = []
|
|
|
- }
|
|
|
- picObject[i.InfoPointName].push({
|
|
|
- ...i,
|
|
|
- })
|
|
|
- break;
|
|
|
+ } else {
|
|
|
+ picObject[i.InfoPointName] = []
|
|
|
+ }
|
|
|
+ picObject[i.InfoPointName].push({
|
|
|
+ ...i,
|
|
|
+ })
|
|
|
+ break;
|
|
|
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
})
|
|
|
//展示图片
|
|
|
this.exhibitionImage.list = picObject
|
|
|
+ let isArray = [] //获取图片数组
|
|
|
+ for (let i in picObject) {
|
|
|
+ if (Array.isArray(picObject[i])) {
|
|
|
+ let list = picObject[i]
|
|
|
+ list.forEach(i => {
|
|
|
+ if (i.PicList) {
|
|
|
+ isArray.push(...i.PicList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let video = isArray.filter(i => i.Type != 'image' &&i.type != 'image' )
|
|
|
+ this.exhibitionVideo.list = video
|
|
|
+ //判断是否显示图片组件
|
|
|
+ this.isShowImage = isArray.length ? true : false
|
|
|
+ //判断是否显示video组件
|
|
|
+ this.isShowVideo = video.length ? true : false
|
|
|
+
|
|
|
},
|
|
|
handleFileList(arr) {
|
|
|
let picObject = {}
|
|
@@ -333,13 +376,35 @@
|
|
|
})
|
|
|
//展示文件
|
|
|
this.exhibitionFile.list = picObject
|
|
|
+ let isArray = [] //获取文件数组
|
|
|
+ for (let i in picObject) {
|
|
|
+ if (Array.isArray(picObject[i])) {
|
|
|
+ let list = picObject[i]
|
|
|
+ list.forEach(i => {
|
|
|
+ if (i.fileList) {
|
|
|
+ isArray.push(...i.fileList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断是否显示文件组件
|
|
|
+ this.isShowFile = isArray.length ? true : false
|
|
|
+
|
|
|
},
|
|
|
changeRadio(val) { //1,需采集,2,有值,3,全部
|
|
|
this.handleRadios(val)
|
|
|
this.currentRadio = val
|
|
|
},
|
|
|
formatDate(str) {
|
|
|
- return str ? str.substr(0,4)+"-"+str.substr(4,2)+"-"+str.substr(6,2)+" "+str.substr(8,2) + ":" +str.substr(10,2) + ":"+str.substr(12,2) :'--'
|
|
|
+ if(str) {
|
|
|
+ if(str.includes('-')) {
|
|
|
+ return str
|
|
|
+ }else {
|
|
|
+ return str.substr(0,4)+"-"+str.substr(4,2)+"-"+str.substr(6,2)+" "+str.substr(8,2) + ":" +str.substr(10,2) + ":"+str.substr(12,2)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return '--'
|
|
|
+ }
|
|
|
},
|
|
|
displayData(arr) {//对数据进行处理传给组件展示
|
|
|
const result = {}
|
|
@@ -428,6 +493,7 @@
|
|
|
handleChangeExample() {
|
|
|
this.selectRadio.initRadio = '1'
|
|
|
this.getData();
|
|
|
+ this.exhibitionEnergy.dynamic = []
|
|
|
},
|
|
|
},
|
|
|
watch: {
|