|
@@ -475,7 +475,6 @@ export default {
|
|
|
deviceCode: null,
|
|
|
deviceSubCategory: '',
|
|
|
deviceCategory: 'E',
|
|
|
- locationType: null,
|
|
|
locationRef: null,
|
|
|
refFacs: null,
|
|
|
customAttrs: null
|
|
@@ -540,7 +539,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
- this.getAreaTree('Building')
|
|
|
+ this.getAreaTree(false,'0')
|
|
|
this.getFacsOptions()
|
|
|
this.getSubsystem()
|
|
|
this.getSubCategorygetByCode()
|
|
@@ -552,9 +551,7 @@ export default {
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
listDevRecursionByArea(this.queryParams).then(response => {
|
|
|
- console.log('参数', JSON.stringify(this.queryParams))
|
|
|
this.deviceList = response.rows
|
|
|
- console.log('deviceList', this.deviceList)
|
|
|
this.total = response.total
|
|
|
this.loading = false
|
|
|
})
|
|
@@ -565,7 +562,6 @@ export default {
|
|
|
this.componentOpen = true
|
|
|
this.title = '添加设备器件属性'
|
|
|
this.componentForm.deviceCode = this.ComponentRow.deviceCode // 设置默认设备代码
|
|
|
-
|
|
|
},
|
|
|
handleComponentUpdate(row) {
|
|
|
this.componentReset()
|
|
@@ -582,7 +578,6 @@ export default {
|
|
|
this.$modal.confirm('是否确认删除能源对象属性编号为"' + ids + '"的数据项?').then(function() {
|
|
|
return delComponent(ids)
|
|
|
}).then(() => {
|
|
|
- console.log('删除row', row.deviceCode)
|
|
|
this.getComponentList(row.deviceCode)
|
|
|
this.$modal.msgSuccess('删除成功')
|
|
|
}).catch(() => {
|
|
@@ -615,14 +610,13 @@ export default {
|
|
|
getComponentList(deviceCode) {
|
|
|
listByDevice(deviceCode).then(response => {
|
|
|
this.ComponentList = response.data
|
|
|
- console.log('查询部件列表', this.ComponentList)
|
|
|
})
|
|
|
},
|
|
|
/** 查询区域树结构 */
|
|
|
- getAreaTree(tier) {
|
|
|
- areaTreeSelect(tier).then(response => {
|
|
|
+ getAreaTree(recursion, areaCode) {
|
|
|
+ areaTreeSelect(recursion, areaCode).then(response => {
|
|
|
this.treeAreaOptions = [{
|
|
|
- id: '-1',
|
|
|
+ id: null,
|
|
|
label: '全部',
|
|
|
children: response.data
|
|
|
}]
|
|
@@ -635,7 +629,6 @@ export default {
|
|
|
},
|
|
|
// 节点单击事件
|
|
|
handleNodeClick(data) {
|
|
|
- this.queryParams.locationType = data.tier
|
|
|
this.queryParams.locationRef = data.id
|
|
|
this.handleQuery()
|
|
|
},
|
|
@@ -659,7 +652,6 @@ export default {
|
|
|
psCode: null,
|
|
|
createTime: null,
|
|
|
updateTime: null
|
|
|
-
|
|
|
}
|
|
|
this.resetForm('form')
|
|
|
},
|
|
@@ -676,19 +668,16 @@ export default {
|
|
|
compoSpec: null,
|
|
|
ancestors: null,
|
|
|
parentCompo: null
|
|
|
-
|
|
|
}
|
|
|
this.resetForm('componentForm')
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1
|
|
|
- console.log('搜索按钮this.queryParams', JSON.stringify(this.queryParams))
|
|
|
this.getList()
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.queryParams.locationType = null
|
|
|
this.queryParams.locationRef = null
|
|
|
this.resetForm('queryForm')
|
|
|
this.handleQuery()
|
|
@@ -709,11 +698,9 @@ export default {
|
|
|
handleDevProcess(row) {
|
|
|
this.showDevProcessDrawer = true
|
|
|
this.ComponentRow = row
|
|
|
- console.log('row', row)
|
|
|
listByDevice(this.ComponentRow.deviceCode).then(response => {
|
|
|
this.ComponentList = response.data
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
shouldShowDevProcessButton(row) {
|
|
|
const categoryIsW = this.queryParams.deviceCategory === 'W'
|
|
@@ -726,17 +713,14 @@ export default {
|
|
|
handleDetail(row) {
|
|
|
this.showDrawer = true
|
|
|
this.curRow = row
|
|
|
- console.log('data', this.curRow)
|
|
|
this.subKey = this.$options.data().subKey
|
|
|
getModelByCode(this.curRow.facsModel).then(response => {
|
|
|
const code = response.data
|
|
|
- console.log('code', code)
|
|
|
this.eventData = response.data.eventList
|
|
|
this.abilityData = response.data.abilityList
|
|
|
|
|
|
})
|
|
|
getObjAttr(2, this.curRow.deviceCode).then(response => {
|
|
|
- console.log('response值', response.data)
|
|
|
const attrs = response.data.attrs
|
|
|
const attrValues = response.data.attrValues
|
|
|
|
|
@@ -761,8 +745,9 @@ export default {
|
|
|
this.open = true
|
|
|
this.title = '修改能源设备'
|
|
|
})
|
|
|
- const tier = 'Zoning'
|
|
|
- areaTreeSelect(tier).then(response => {
|
|
|
+ const recursion = true
|
|
|
+ const areaCode = '0'
|
|
|
+ areaTreeSelect(recursion, areaCode).then(response => {
|
|
|
this.totalAreaOptions = response.data
|
|
|
})
|
|
|
},
|
|
@@ -792,7 +777,6 @@ export default {
|
|
|
attrKey: attrKey,
|
|
|
attrValue: attrValue,
|
|
|
attrName: attrName
|
|
|
-
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -909,7 +893,6 @@ export default {
|
|
|
getAllDevProcess(subcategoryCode) {
|
|
|
getDevProcess(subcategoryCode).then(response => {
|
|
|
this.devOptions = response.data
|
|
|
- console.log('设备工艺', this.devOptions)
|
|
|
})
|
|
|
},
|
|
|
deviceCategoryChange() {
|
|
@@ -917,9 +900,9 @@ export default {
|
|
|
//this.queryParams.psCode = null; // 重置设备工艺选择
|
|
|
if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
|
|
|
|| this.queryParams.deviceCategory === 'T' || this.queryParams.deviceCategory === 'C') {
|
|
|
- this.getAreaTree('Building')
|
|
|
+ this.getAreaTree(false,'0')
|
|
|
} else if (this.queryParams.deviceCategory === 'Z') {
|
|
|
- this.getAreaTree('Zoning')
|
|
|
+ this.getAreaTree(true,'0')
|
|
|
}
|
|
|
this.getSubCategorygetByCode()
|
|
|
this.getFacsOptions()
|
|
@@ -955,16 +938,11 @@ export default {
|
|
|
getFacsModel() {
|
|
|
listAllModel(2).then(response => {
|
|
|
this.modelList = response.data
|
|
|
- console.log('this.modelList', this.modelList)
|
|
|
- this.modelList.forEach(model => {
|
|
|
- console.log(model.modelCode)
|
|
|
- })
|
|
|
})
|
|
|
},
|
|
|
handleModelChange(modelCode) {
|
|
|
if (modelCode) {
|
|
|
this.getModelByCode(modelCode)
|
|
|
- console.log('设备代码', this.form.deviceCode)
|
|
|
this.getObjAttr(2, this.form.deviceCode)
|
|
|
}
|
|
|
},
|
|
@@ -980,9 +958,7 @@ export default {
|
|
|
getObjAttr(objType, deviceCode).then(response => {
|
|
|
// const attrs = response.data.attrs;
|
|
|
const attrs = response.data.attrs.filter(attr => attr.attrType === 0)
|
|
|
- console.log('attrs', attrs)
|
|
|
const attrValues = response.data.attrValues || [] // 确保是一个数组
|
|
|
- console.log('attrValues', attrValues)
|
|
|
|
|
|
// 创建一个映射对象,用于存储 attrKey 与对应的 attrValue
|
|
|
const attrValuesMap = {}
|
|
@@ -1002,9 +978,6 @@ export default {
|
|
|
|
|
|
// 更新 attrValuesMap 到组件的数据中
|
|
|
this.attrValuesMap = attrValuesMap
|
|
|
- // 打印更新后的 attrValuesMap,用于调试
|
|
|
- console.log('Updated attrValuesMap', this.attrValuesMap)
|
|
|
-
|
|
|
})
|
|
|
}
|
|
|
}
|