|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <view class="header"></view>
|
|
|
- <view class="position">
|
|
|
+
|
|
|
+ <!-- <view class="position">
|
|
|
<picker mode="multiSelector" @columnchange="bindMultiPickerColumnChange"
|
|
|
@change="(val)=>confirmHandle(val,'position')" :range="positionList" style="width:100%;height: 100%;"
|
|
|
range-key="orgName">
|
|
@@ -9,7 +9,14 @@
|
|
|
<view class="uni-input inline positionName">{{name}}</view>
|
|
|
<u-icon name="arrow-rightward" class="inline" color="#fff"></u-icon>
|
|
|
</picker>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
+
|
|
|
+ <u-cell-group>
|
|
|
+ <u-cell :title="mytitle" value="修改" :isLink="true" @click="floorchange">
|
|
|
+ <u-icon slot="icon" size="40" name="map"></u-icon>
|
|
|
+ </u-cell>
|
|
|
+ </u-cell-group>
|
|
|
+
|
|
|
<view class="form">
|
|
|
<view class="drawdownMenu">
|
|
|
<picker @change="(val)=>confirmHandle(val,'deviceType')" :value="deviceTypeIndex"
|
|
@@ -69,11 +76,11 @@
|
|
|
</template>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <u-picker :show="showfloor" ref="uPicker" @confirm="confirmfloor" @cancel='cancelfloor'
|
|
|
+ :columns="columns" keyName="orgName" @change="changeHandler"></u-picker>
|
|
|
</view>
|
|
|
- </view>
|
|
|
-
|
|
|
-
|
|
|
- </view>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -86,10 +93,13 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ showfloor:false,
|
|
|
+ showtype: false,
|
|
|
modeTypeList: [],
|
|
|
modeTypeIndex: 0,
|
|
|
temperatureList: [],
|
|
|
tempIndex: 0,
|
|
|
+ columns: [],
|
|
|
speedTypeList: [],
|
|
|
speedTypeIndex: 0,
|
|
|
dataForm: {
|
|
@@ -100,6 +110,7 @@
|
|
|
status: "",
|
|
|
controlCategory: "CommonLighting",
|
|
|
},
|
|
|
+ mytitle:'',
|
|
|
total: 0,
|
|
|
refreshing: false,
|
|
|
finished: false,
|
|
@@ -113,6 +124,7 @@
|
|
|
[],
|
|
|
[]
|
|
|
],
|
|
|
+ columnData:[],
|
|
|
deviceType: "AirConditioner",
|
|
|
deviceStatus: '',
|
|
|
deviceTypeList: [],
|
|
@@ -154,7 +166,7 @@
|
|
|
|
|
|
if (getDictDataList[i].dictType == 'DeviceCategory') {
|
|
|
this.deviceTypeList = getDictDataList[i].dataList;
|
|
|
- console.log('7777',this.deviceTypeList)
|
|
|
+ // console.log('7777',this.deviceTypeList)
|
|
|
|
|
|
this.deviceTypeList.forEach((item) => {
|
|
|
item.text = item.dictLabel;
|
|
@@ -210,34 +222,74 @@
|
|
|
return list[0].dictLabel
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ floorchange() {
|
|
|
+ this.showfloor = true;
|
|
|
+ },
|
|
|
+ confirmfloor(e) {
|
|
|
+ console.log('222222', e.value)
|
|
|
+ this.mytitle = e.value[0].orgName + e.value[1].orgName;
|
|
|
+ this.dataForm.buildingId = e.value[0].orgId;
|
|
|
+ this.dataForm.storeyId = e.value[1].orgId;
|
|
|
+
|
|
|
+ this.showfloor = false;
|
|
|
+ this.dataList = []; // 清空数组
|
|
|
+ this.dataForm.page = 1;
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ cancelfloor() {
|
|
|
+ this.showfloor = false;
|
|
|
+ },
|
|
|
+ changeHandler(e) {
|
|
|
+ const {
|
|
|
+ columnIndex,
|
|
|
+ index,
|
|
|
+ // 微信小程序无法将picker实例传出来,只能通过ref操作
|
|
|
+ picker = this.$refs.uPicker
|
|
|
+ } = e
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ this.loading = true
|
|
|
+ picker.setColumnValues(1, this.columnData[index])
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ // this.dataList = []; // 清空数组
|
|
|
+ // this.dataForm.page = 1;
|
|
|
+ // this.getDataList()
|
|
|
+ },
|
|
|
//获取楼栋
|
|
|
getBuildList() {
|
|
|
- Api.getBuildInfo().then((res) => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- this.name = this.projectName = res.data.data[0].orgName;
|
|
|
- this.positionList[0] = [];
|
|
|
- let positionList = res.data.data[0].childrenList;
|
|
|
- if (positionList) {
|
|
|
- let json = {
|
|
|
- category: "s",
|
|
|
- childrenList: null,
|
|
|
- orgId: "",
|
|
|
- orgName: "全部",
|
|
|
- };
|
|
|
- for (let i = 0; i < positionList.length; i++) {
|
|
|
- positionList[i].childrenList.unshift(json);
|
|
|
- this.positionList[0].push(positionList[i]);
|
|
|
+ this.$api.get('/control/getOrgStructureTree/', {})
|
|
|
+ .then(res => {
|
|
|
+
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.dataForm.projectId = res.data.data[0].orgId;
|
|
|
+
|
|
|
+ this.mytitle = res.data.data[0].orgName;
|
|
|
+ this.alldata = res.data.data[0].childrenList;
|
|
|
+ //console.log('111111111111111111', res.data.data[0].childrenList)
|
|
|
+ this.columns = [
|
|
|
+ res.data.data[0].childrenList,
|
|
|
+ res.data.data[0].childrenList[0].childrenList
|
|
|
+ ]
|
|
|
+ let allfloor = [];
|
|
|
+ for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
|
|
|
+ allfloor.push(res.data.data[0].childrenList[i].childrenList)
|
|
|
}
|
|
|
- this.positionList[0].unshift(json);
|
|
|
- this.positionList[1] = this.positionList[0][0].childrenList;
|
|
|
+ // console.log('111111111111111111',allfloor)
|
|
|
+ this.columnData = allfloor;
|
|
|
+ this.dataList = []; // 清空数组
|
|
|
+ this.dataForm.page = 1;
|
|
|
+ this.getDataList()
|
|
|
+ } else {
|
|
|
+ this.showdct = true
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- bindMultiPickerColumnChange(e) {
|
|
|
- this.positionList[1] = this.positionList[1] = this.positionList[0][e.detail.value].childrenList;
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
setTemperatureList() {
|
|
|
this.temperatureList = [];
|
|
|
for (let i = 16; i < 33; i++) {
|
|
@@ -247,13 +299,13 @@
|
|
|
confirmHandle(e, type, deviceId) {
|
|
|
this.dataForm.page = 1;
|
|
|
if (type == 'position') {
|
|
|
- this.p1 = e.detail.value[0];
|
|
|
- this.p2 = e.detail.value[1];
|
|
|
- this.dataForm.buildingId = this.p1 == 0 ? '' : this.positionList[0][this.p1].orgId;
|
|
|
- this.dataForm.storeyId = this.p2 == 0 ? "" : this.positionList[1][this.p2].orgId;
|
|
|
- let buildName = this.p1 == 0 ? "" : '-' + this.positionList[0][this.p1].orgName;
|
|
|
- let storeyName = this.p2 == 0 ? "" : '-' + this.positionList[1][this.p2].orgName;
|
|
|
- this.name = this.projectName + buildName + storeyName;
|
|
|
+ // this.p1 = e.detail.value[0];
|
|
|
+ // this.p2 = e.detail.value[1];
|
|
|
+ // this.dataForm.buildingId = this.p1 == 0 ? '' : this.positionList[0][this.p1].orgId;
|
|
|
+ // this.dataForm.storeyId = this.p2 == 0 ? "" : this.positionList[1][this.p2].orgId;
|
|
|
+ // let buildName = this.p1 == 0 ? "" : '-' + this.positionList[0][this.p1].orgName;
|
|
|
+ // let storeyName = this.p2 == 0 ? "" : '-' + this.positionList[1][this.p2].orgName;
|
|
|
+ // this.name = this.projectName + buildName + storeyName;
|
|
|
} else {
|
|
|
let index = type + "Index";
|
|
|
this[index] = e.detail.value;
|