|
@@ -10,17 +10,16 @@
|
|
|
<exhibitionCrux :exhibitionCrux="exhibitionCrux"/>
|
|
|
</div>
|
|
|
<div class="content-showType">
|
|
|
- <selectRadio :selectRadio="selectRadio"/>
|
|
|
+ <selectRadio
|
|
|
+ :selectRadio="selectRadio"
|
|
|
+ @changeRadio="changeRadio"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="content-point">
|
|
|
<div class="content-point-left">
|
|
|
<el-scrollbar style="height:100%;">
|
|
|
<div style="height:1000px">
|
|
|
- <exhibitionBaseInformation
|
|
|
- :exhibitionBaseInformation="exhibitionBaseInformation"
|
|
|
- :information="information"
|
|
|
- :exampleData="exampleData"
|
|
|
- />
|
|
|
+ <exhibitionBaseInformation :exhibitionBaseInformation="exhibitionBaseInformation"/>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
@@ -56,7 +55,7 @@
|
|
|
import exhibitionCrux from "@/components/ledger/details/detail/exhibitionCrux";
|
|
|
import exhibitionMaintain from "@/components/ledger/details/detail/exhibitionMaintain";
|
|
|
import selectRadio from "@/components/ledger/details/detail/selectRadio";
|
|
|
-
|
|
|
+ import tools from "../../../../utils/buildfloor/tools";
|
|
|
import {getDataDictionary, queryEquip} from "@/api/scan/request";
|
|
|
import {mapGetters} from "vuex";
|
|
|
|
|
@@ -91,7 +90,7 @@
|
|
|
list: [], //设备列表
|
|
|
pointData: [], //信息点数据
|
|
|
exampleData: {}, //实例数据
|
|
|
- information:{},//传给组件
|
|
|
+ currentRadio: '',//当前选中的select
|
|
|
selectRadio: {
|
|
|
information: '设备信息点',
|
|
|
radioList: [
|
|
@@ -100,43 +99,25 @@
|
|
|
label: '1'
|
|
|
},
|
|
|
{
|
|
|
- value: '显示需采集信息点',
|
|
|
+ value: '显示有值信息点',
|
|
|
label: '2'
|
|
|
},
|
|
|
{
|
|
|
- value: '显示需采集信息点',
|
|
|
+ value: '显示全部信息点',
|
|
|
label: '3'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
exhibitionBaseInformation: {
|
|
|
- //产品说所有信息的key和value是动态生成的
|
|
|
- base: {
|
|
|
- baseInformation: '基本信息',
|
|
|
- list: [
|
|
|
- {
|
|
|
- text: '设备本地编码:',
|
|
|
- val: '123--22:'
|
|
|
- },
|
|
|
- {
|
|
|
- text: '设备二维码图片:',
|
|
|
- val: '2:'
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- manufacture: {
|
|
|
- manufacturerParameter: '台账参数 / 设备厂家',
|
|
|
- },
|
|
|
- supplier: {
|
|
|
- supplierParameters: '台账参数 / 供应购买'
|
|
|
- }
|
|
|
+ information: {}
|
|
|
},
|
|
|
- exhibitionMaintain:{
|
|
|
- title:'维修/维保记录'
|
|
|
+ exhibitionMaintain: {
|
|
|
+ title: '维修/维保记录'
|
|
|
},
|
|
|
exhibitionFile: {},
|
|
|
exhibitionCrux: {
|
|
|
- title: '关键信息点:'
|
|
|
+ title: '关键信息点:',
|
|
|
+ cruxArray: [],
|
|
|
},
|
|
|
exhibitionImage: {
|
|
|
title: '图片'
|
|
@@ -169,39 +150,103 @@
|
|
|
Promise.all([promise1, promise2]).then(values => {
|
|
|
this.pointData = values[0].Content;
|
|
|
this.exampleData = values[1].Content[0];
|
|
|
- let objectList = {}
|
|
|
- //
|
|
|
- const result = {}
|
|
|
|
|
|
- values[0].Content.forEach(i => {
|
|
|
- if( this.exampleData.hasOwnProperty(i.Path)) {
|
|
|
- i.value = this.exampleData[i.Path]
|
|
|
- console.log(i.InfoPointName,i.value,'======')
|
|
|
+ this.handleRadios(1)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
|
|
|
+ let arr = []
|
|
|
+ if (val == 1) { //需采集信息
|
|
|
+ arr = this.pointData.filter(i => i.Visible)
|
|
|
+ //关键信息点
|
|
|
+ this.exhibitionCrux.cruxArray = arr.filter(i => i.KeyWord) //todo 融合
|
|
|
+ // 图片和文件的处理
|
|
|
+ this.handlePicList(arr)
|
|
|
+
|
|
|
+ } else if (val == 2) { //有值
|
|
|
+ let list = this.pointData
|
|
|
+ list.map(j => {
|
|
|
+ if (this.exampleData.hasOwnProperty(j.Path)) {
|
|
|
+ return {
|
|
|
+ ...j,
|
|
|
+ value: this.exampleData[j.Path]
|
|
|
+ }
|
|
|
}
|
|
|
- if (result[`${i.FirstName}${i.SecondName? '/'+i.SecondName:''}`]) {
|
|
|
- result[`${i.FirstName}${i.SecondName? '/'+i.SecondName:''}`].paths.push({
|
|
|
- Path:i.Path,
|
|
|
+ arr = list.filter(k => k.value)
|
|
|
+ })
|
|
|
+ } else { //全部
|
|
|
+ arr = this.pointData
|
|
|
+ }
|
|
|
+ this.displayData(arr)
|
|
|
+ },
|
|
|
+ handlePicList(arr) {
|
|
|
+ let picObject = {}
|
|
|
+ //处理数据格式
|
|
|
+ let obj = tools.formatData(this.exampleData)
|
|
|
+ console.log(obj, '==obj==')
|
|
|
+ arr.map(i => {
|
|
|
+ if (obj.hasOwnProperty('LedgerParam.PhotoDoc.Drawing')) {
|
|
|
+
|
|
|
+ console.log(obj['LedgerParam.PhotoDoc.Drawing'], '===i.Path==')
|
|
|
+ // i.picList = obj[i.Path]
|
|
|
+ }
|
|
|
+ // console.log(i.picList,'picList')
|
|
|
+ switch (i.Path) {
|
|
|
+ case 'LedgerParam.PhotoDoc.Drawing':
|
|
|
+ case 'LedgerParam.Siteinstall.InstallPic':
|
|
|
+ case 'LedgerParam.Siteinstall.InstallDrawing':
|
|
|
+ case 'LedgerParam.PhotoDoc.Nameplate':
|
|
|
+ break
|
|
|
+ }
|
|
|
+ // if (picObject[i.InfoPointName]) {
|
|
|
+ // picObject[i.InfoPointName].push({
|
|
|
+ // Path: i.Path,
|
|
|
+ // InfoPointName: i.InfoPointName,
|
|
|
+ // InfoPointCode: i.InfoPointCode,
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // picObject[i.InfoPointName] = []
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ console.log(picObject, 'picObject')
|
|
|
+ },
|
|
|
+ displayData(arr) {//对数据进行处理传给组件展示
|
|
|
+ const result = {}
|
|
|
+ arr.forEach(i => {
|
|
|
+ if (this.exampleData.hasOwnProperty(i.Path) && this.currentRadio != 2) {
|
|
|
+ i.value = this.exampleData[i.Path]
|
|
|
+ console.log(i.value, '======')
|
|
|
+ }
|
|
|
+ if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
|
|
|
+ result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`].paths.push({
|
|
|
+ Path: i.Path,
|
|
|
+ InfoPointName: i.InfoPointName,
|
|
|
+ InfoPointCode: i.InfoPointCode,
|
|
|
+ Value: i.value
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`] = {
|
|
|
+ paths: [{
|
|
|
+ Path: i.Path,
|
|
|
InfoPointName: i.InfoPointName,
|
|
|
InfoPointCode: i.InfoPointCode,
|
|
|
- Value:i.value
|
|
|
- })
|
|
|
- } else {
|
|
|
- result[`${i.FirstName}${i.SecondName? '/'+i.SecondName:''}`] = {
|
|
|
- paths: [{
|
|
|
- Path:i.Path,
|
|
|
- InfoPointName: i.InfoPointName,
|
|
|
- InfoPointCode: i.InfoPointCode,
|
|
|
- Value:i.value
|
|
|
- }]
|
|
|
- }
|
|
|
+ Value: i.value
|
|
|
+ }]
|
|
|
}
|
|
|
- })
|
|
|
- this.information = result
|
|
|
+ }
|
|
|
})
|
|
|
+ this.exhibitionBaseInformation.information = result
|
|
|
},
|
|
|
- goBack () {
|
|
|
+ goBack() {
|
|
|
this.$router.push({path: "/ledger/facility"})
|
|
|
},
|
|
|
+ changeRadio(val) { //1,需采集,2,有值,3,全部
|
|
|
+ this.handleRadios(val)
|
|
|
+ this.currentRadio = val
|
|
|
+ console.log(val, '=======val======')
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
projectId() {
|