|
@@ -109,7 +109,7 @@
|
|
|
tipPlace='top'
|
|
|
width='200'
|
|
|
style=' margin-right:48px;'
|
|
|
- :returnParentNode='true'
|
|
|
+ :returnParentNode='false'
|
|
|
:isShowAllChoice='true'
|
|
|
:choseArea='true'
|
|
|
:data='deviceList'
|
|
@@ -439,27 +439,33 @@ export default {
|
|
|
|
|
|
//位置/设备
|
|
|
treeConfirmDevice(id, info) {
|
|
|
- console.log(id)
|
|
|
- // this.$set(this.ruleForm, 'InfoLocal', data)
|
|
|
- let InfoSystem = []
|
|
|
- let InfoLocal = []
|
|
|
- if (info && info.length > 0) {
|
|
|
- for (let i = 0; i < info.length; i++) {
|
|
|
- let type = info[i]
|
|
|
- if (type.name.includes('/')) {
|
|
|
- InfoLocal.push(type)
|
|
|
- //位置/设备
|
|
|
- this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
|
|
|
- } else {
|
|
|
- InfoSystem.push(type)
|
|
|
- //专业
|
|
|
- this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
|
|
|
+ let InfoSystem = [],
|
|
|
+ InfoSystems = [],
|
|
|
+ InfoLocal = []
|
|
|
+ this.deviceList.forEach(i => {
|
|
|
+ i.children.length > 0 &&
|
|
|
+ i.children.forEach(j => {
|
|
|
+ if (id.includes(j.id)) {
|
|
|
+ InfoSystems.push(i)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ InfoSystem = JSON.parse(JSON.stringify(InfoSystems))
|
|
|
+ .reduce((prev, element) => {
|
|
|
+ if (!prev.find(el => el.id == element.id)) {
|
|
|
+ prev.push(element)
|
|
|
}
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$set(this.ruleForm, 'InfoLocal', [])
|
|
|
- this.$set(this.ruleForm, 'InfoSystem', [])
|
|
|
- }
|
|
|
+ return prev
|
|
|
+ }, [])
|
|
|
+ .map(i => {
|
|
|
+ if (i.children.length) {
|
|
|
+ delete i.children
|
|
|
+ }
|
|
|
+ return i
|
|
|
+ })
|
|
|
+ InfoLocal = info
|
|
|
+ this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
|
|
|
+ this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
|
|
|
},
|
|
|
focusChange(status) {
|
|
|
// //console.log('focusChange', status)
|