|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="h100 steps4">
|
|
|
<div class="btns-view">
|
|
|
- <el-button type="primary">根据关键内容批量标准化设备标识</el-button>
|
|
|
- <el-button type="primary">根据关键内容批量对应数据字典</el-button>
|
|
|
+ <el-button type="primary" @click="checkedAll">获取展开点位数据</el-button>
|
|
|
+ <el-button type="primary">获取全部点位数据</el-button>
|
|
|
</div>
|
|
|
<div class="center point-border">
|
|
|
<el-radio-group v-model="activeIndex" @change="clickTabs">
|
|
@@ -17,16 +17,16 @@
|
|
|
<js-mind-component ref="jsmind1"></js-mind-component>
|
|
|
</div>
|
|
|
<!-- <el-tabs type="border-card" @tab-click="clickTabs" class="tabs-h" tab-position="bottom">
|
|
|
- <el-tab-pane>
|
|
|
- <span slot="label">
|
|
|
- 从物理世界角度检查
|
|
|
- </span>
|
|
|
-
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane class="h100" label="从原始点位表角度检查">
|
|
|
- <js-mind-component ref="jsmind1" @openNode="openNode"></js-mind-component>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs> -->
|
|
|
+ <el-tab-pane>
|
|
|
+ <span slot="label">
|
|
|
+ 从物理世界角度检查
|
|
|
+ </span>
|
|
|
+
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane class="h100" label="从原始点位表角度检查">
|
|
|
+ <js-mind-component ref="jsmind1" @openNode="openNode"></js-mind-component>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -70,6 +70,9 @@
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ checkedAll() {
|
|
|
+ this.mindArr[this.activeIndex].expand_all()
|
|
|
+ },
|
|
|
//节点选中事件
|
|
|
// async openNode(node) {
|
|
|
// //次级列表children,自定义id ownId,请求参数,请求函数ajaxFun,显示子集的文案text,子集的data
|
|
@@ -243,7 +246,7 @@
|
|
|
id = this.createRandomId();
|
|
|
return {
|
|
|
id: id,
|
|
|
- topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
|
|
|
+ topic: `${item.SpecialtySystem}(${item.PointCount})`,
|
|
|
expanded: false,
|
|
|
pointType: "system",
|
|
|
name: item.SpecialtySystem,
|
|
@@ -269,48 +272,54 @@
|
|
|
this.jsMind = this.$refs.jsmind1.initData({}, mind)
|
|
|
}
|
|
|
this.mindArr[this.activeIndex] = this.jsMind
|
|
|
+ this.setBgColor([data], this.jsMind)
|
|
|
this.jsMind.options.editable = false
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- delPlatform(arr){
|
|
|
+ delPlatform(arr) {
|
|
|
return arr.map(item => {
|
|
|
- if(item.hasOwnProperty('EquipmentTypeList')){
|
|
|
+ if (item.hasOwnProperty('EquipmentTypeList')) {
|
|
|
let obj = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
|
|
|
- expanded: false
|
|
|
+ topic: `${item.SpecialtySystem}(${item.PointCount})`,
|
|
|
+ expanded: false,
|
|
|
+ DataQuality: item.DataQuality
|
|
|
}
|
|
|
- if(item.hasOwnProperty("EquipmentTypeList")){
|
|
|
+ if (item.hasOwnProperty("EquipmentTypeList")) {
|
|
|
obj.children = []
|
|
|
obj.children = item.EquipmentTypeList.map(child => {
|
|
|
let obj1 = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${child.EquipmentType}</div>`,
|
|
|
+ topic: `${child.EquipmentType}`,
|
|
|
children: [],
|
|
|
- expanded: false
|
|
|
+ expanded: false,
|
|
|
+ DataQuality: child.DataQuality
|
|
|
}
|
|
|
- if(child.hasOwnProperty("EquipmentMarkList")){
|
|
|
+ if (child.hasOwnProperty("EquipmentMarkList")) {
|
|
|
child.EquipmentMarkList.map(node => {
|
|
|
let obj2 = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${node.EquipmentMark}</div>`,
|
|
|
+ topic: `${node.EquipmentMark}`,
|
|
|
expanded: false,
|
|
|
- children: []
|
|
|
+ children: [],
|
|
|
+ DataQuality: node.DataQuality
|
|
|
}
|
|
|
- if(node.hasOwnProperty("InfoList")){
|
|
|
+ if (node.hasOwnProperty("InfoList")) {
|
|
|
node.InfoList.map(node1 => {
|
|
|
let obj3 = {
|
|
|
id: this.createRandomId(),
|
|
|
expanded: false,
|
|
|
- topic: `<div>${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}</div>`,
|
|
|
- children: []
|
|
|
+ topic: `${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}`,
|
|
|
+ children: [],
|
|
|
+ DataQuality: node1.DataQuality
|
|
|
}
|
|
|
- if(node1.hasOwnProperty("PointList")){
|
|
|
+ if (node1.hasOwnProperty("PointList")) {
|
|
|
node1.PointList.map(node2 => {
|
|
|
let obj4 = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${node2.Description}(${node2.Address}):${node2.Data.Time}-${node2.Data.Data}-${node2.Data.Unit}</div>`,
|
|
|
+ DataQuality: node2.DataQuality,
|
|
|
+ topic: `${node2.Description}(${node2.Address}):${node2.Data.Time}-${node2.Data.Data}-${node2.Data.Unit}`,
|
|
|
}
|
|
|
obj3.children.push(obj4)
|
|
|
})
|
|
@@ -326,55 +335,100 @@
|
|
|
}
|
|
|
return obj
|
|
|
}
|
|
|
- if(item.hasOwnProperty("CheckTodos")){
|
|
|
+ if (item.hasOwnProperty("CheckTodos")) {
|
|
|
let obj = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
|
|
|
+ topic: `${item.SpecialtySystem}(${item.PointCount})`,
|
|
|
expanded: false,
|
|
|
+ DataQuality: item.DataQuality,
|
|
|
children: []
|
|
|
}
|
|
|
obj.children = item.CheckTodos.map(node => {
|
|
|
return {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${node.Description}(${node.Address})</div>`,
|
|
|
+ topic: `${node.Description}(${node.Address})`,
|
|
|
+ DataQuality: node.DataQuality
|
|
|
}
|
|
|
})
|
|
|
return obj
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- delPoint(arr){
|
|
|
+ setBgColor(data, jm) {
|
|
|
+ data.map(item => {
|
|
|
+ if (item.DataQuality) {
|
|
|
+ jm.set_node_color(item.id, "#f0ad4e", "#fff")
|
|
|
+ }
|
|
|
+ if (item.children && item.children.length) {
|
|
|
+ this.setBgColor(item.children, jm)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeData(arr) {
|
|
|
+ console.log(arr)
|
|
|
+ if (arr && arr instanceof Array) {
|
|
|
+ return arr.map(item => {
|
|
|
+ if (item.children && item.children.length) {
|
|
|
+ return {
|
|
|
+ id: item.id,
|
|
|
+ topic: item.topic,
|
|
|
+ expanded: item.expanded,
|
|
|
+ children: this.changeData(item.children),
|
|
|
+ theme: item.DataQuality ? "orange" : "greensea"
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ id: item.id,
|
|
|
+ expanded: item.expanded,
|
|
|
+ topic: item.topic,
|
|
|
+ theme: item.DataQuality ? "orange" : "greensea"
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ id: "root",
|
|
|
+ topic: arr.topic,
|
|
|
+ children: this.changeData(arr.children)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ delPoint(arr) {
|
|
|
return arr.map(item => {
|
|
|
- if(item.hasOwnProperty('EquipmentTypeList')){
|
|
|
+ if (item.hasOwnProperty('EquipmentTypeList')) {
|
|
|
let obj = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
|
|
|
- expanded: false
|
|
|
+ topic: `${item.SpecialtySystem}(${item.PointCount})`,
|
|
|
+ expanded: false,
|
|
|
+ DataQuality: item.DataQuality
|
|
|
}
|
|
|
- if(item.hasOwnProperty("EquipmentTypeList")){
|
|
|
+ if (item.hasOwnProperty("EquipmentTypeList")) {
|
|
|
obj.children = []
|
|
|
obj.children = item.EquipmentTypeList.map(child => {
|
|
|
let obj1 = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${child.EquipmentType}</div>`,
|
|
|
+ topic: `${child.EquipmentType}`,
|
|
|
children: [],
|
|
|
- expanded: false
|
|
|
+ expanded: false,
|
|
|
+ DataQuality: item.DataQuality
|
|
|
}
|
|
|
- if(child.hasOwnProperty("OriginalPointList")){
|
|
|
+ if (child.hasOwnProperty("OriginalPointList")) {
|
|
|
child.OriginalPointList.map(node => {
|
|
|
let obj2 = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${node.Description}(${node.Address}):${node.Data.Time}-${node.Data.Data}-${node.Data.Unit}</div>`,
|
|
|
+ topic: `${node.Description}(${node.Address}):${node.Data.Time}-${node.Data.Data}-${node.Data.Unit}`,
|
|
|
expanded: false,
|
|
|
- children: []
|
|
|
+ children: [],
|
|
|
+ DataQuality: item.DataQuality
|
|
|
}
|
|
|
- if(node.hasOwnProperty("InfoList")){
|
|
|
+ if (node.hasOwnProperty("InfoList")) {
|
|
|
node.InfoList.map(node1 => {
|
|
|
let obj3 = {
|
|
|
id: this.createRandomId(),
|
|
|
expanded: false,
|
|
|
- topic: `<div>${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}</div>`,
|
|
|
- children: []
|
|
|
+ topic: `${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}`,
|
|
|
+ children: [],
|
|
|
+ DataQuality: item.DataQuality
|
|
|
}
|
|
|
obj2.children.push(obj3)
|
|
|
})
|
|
@@ -387,17 +441,19 @@
|
|
|
}
|
|
|
return obj
|
|
|
}
|
|
|
- if(item.hasOwnProperty("CheckTodos")){
|
|
|
+ if (item.hasOwnProperty("CheckTodos")) {
|
|
|
let obj = {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
|
|
|
+ topic: `${item.SpecialtySystem}(${item.PointCount})`,
|
|
|
expanded: false,
|
|
|
- children: []
|
|
|
+ children: [],
|
|
|
+ DataQuality: item.DataQuality
|
|
|
}
|
|
|
obj.children = item.CheckTodos.map(node => {
|
|
|
return {
|
|
|
id: this.createRandomId(),
|
|
|
- topic: `<div>${node.Description}(${node.Address})</div>`,
|
|
|
+ topic: `${node.Description}(${node.Address})`,
|
|
|
+ DataQuality: item.DataQuality
|
|
|
}
|
|
|
})
|
|
|
return obj
|
|
@@ -424,8 +480,7 @@
|
|
|
margin-bottom: 10px;
|
|
|
text-align: right;
|
|
|
}
|
|
|
- .point-border {
|
|
|
- }
|
|
|
+ .point-border {}
|
|
|
.jsmind-container {
|
|
|
flex: 1;
|
|
|
}
|