|
@@ -195,8 +195,9 @@
|
|
|
|
|
|
<script>
|
|
|
import { listRbook, getRbook, delRbook, addRbook, updateRbook } from "@/api/device/rbook";
|
|
|
-import {listFacs} from '@/api/basecfg/emsfacs'
|
|
|
-import { listDevRecursionByArea } from '@/api/device/device'
|
|
|
+import {listAllFacs} from '@/api/basecfg/emsfacs'
|
|
|
+import {devTreeByFacs, listDevice, listDevRecursionByArea} from '@/api/device/device'
|
|
|
+import {listBuildingByArea} from "@/api/basecfg/building";
|
|
|
export default {
|
|
|
name: "Rbook",
|
|
|
dicts: ['device_type'],
|
|
@@ -221,11 +222,8 @@ export default {
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
//能源设施全部数据
|
|
|
- AllName:[],
|
|
|
AllCode:[],
|
|
|
- facsLocation:'',
|
|
|
- All:[],
|
|
|
-
|
|
|
+ areaCode: '', // 你需要根据实际情况设置或获取 areaCode
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -313,17 +311,16 @@ export default {
|
|
|
handleSelect(value){
|
|
|
//获取能源设施所有信息
|
|
|
this.loading = true
|
|
|
- listFacs(this.queryParams).then(response => {
|
|
|
- //总条数
|
|
|
- this.total = response.total
|
|
|
+ listAllFacs(this.areaCode).then(response =>{
|
|
|
+ const data = response.data;
|
|
|
//循环输出
|
|
|
- for (let i = 0; i <this.total ; i++) {
|
|
|
- if (value === response.rows[i].facsCode){
|
|
|
- this.form.objName = response.rows[i].facsName
|
|
|
- this.form.insLocation=response.rows[i].refAreaName
|
|
|
+ for (let i = 0; i <data.length ; i++) {
|
|
|
+ if (value === data[i].facsCode){
|
|
|
+ this.form.objName = data[i].facsName
|
|
|
+ this.form.insLocation=data[i].refAreaName
|
|
|
}
|
|
|
}
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
})
|
|
|
|
|
|
///获取能源设备所有信息
|
|
@@ -341,30 +338,23 @@ export default {
|
|
|
})
|
|
|
|
|
|
},
|
|
|
-
|
|
|
changeObjOptions(objType) {
|
|
|
- if(objType == 1){
|
|
|
- //获取能源设施所有信息
|
|
|
+ if (objType == 1){
|
|
|
this.loading = true
|
|
|
- listFacs(this.queryParams).then(response => {
|
|
|
- //总条数
|
|
|
- this.total = response.total
|
|
|
- console.log("设施所有信息的条数!!!",this.total)
|
|
|
+ listAllFacs(this.areaCode).then(response =>{
|
|
|
+ const data = response.data;
|
|
|
this.AllCode = [];
|
|
|
//循环输出
|
|
|
- for (let i = 0; i <this.total ; i++) {
|
|
|
- this.AllCode.push({ value:response.rows[i].facsCode, label: response.rows[i].facsCode}); // 添加到数组
|
|
|
+ for (let i = 0; i <data.length ; i++) {
|
|
|
+ this.AllCode.push({ value:data[i].facsCode, label: data[i].facsCode}); // 添加到数组
|
|
|
}
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
})
|
|
|
}else if(objType == 0){
|
|
|
- ///获取能源设备所有信息
|
|
|
- this.loading = true
|
|
|
+ this.loading=true
|
|
|
listDevRecursionByArea(this.queryParams).then(response => {
|
|
|
- this.total = response.total
|
|
|
- console.log("设备所有信息的条数!!!",this.total)
|
|
|
this.AllCode = [];
|
|
|
- //循环输出
|
|
|
+ //循环输出
|
|
|
for (let i = 0; i <this.total ; i++) {
|
|
|
this.AllCode.push({ value:response.rows[i].deviceCode, label: response.rows[i].deviceCode}); // 添加到数组
|
|
|
}
|
|
@@ -373,6 +363,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|