Commit ba96b544 authored by yating.lin's avatar yating.lin

对应BUG

parent 98b96e79
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.witium.muchang.test" version="2.9.6.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.witium.muchang.test" version="2.9.6.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>牧场云</name>
<description>test</description>
<author email="frank.feng@witium.com" href="http://muchang.witium.com/">Van.chen - frank.feng</author>
......
......@@ -52,19 +52,20 @@ export class EnvAddModelPage implements OnInit {
}
tempHaveTouch(event) {
const selectedId = event.target.value - 10; // 温度: 10~
for (let i = 10; i <= 50; i++) {
this.defaultColumnOptions[0][i - 10] = i.toString();
}
if (this.fanMode.selecting === false) {
this.fanMode.selecting = true;
this.openPicker(1, 41, this.defaultColumnOptions, event);
this.openPicker(1, 41, this.defaultColumnOptions, event, selectedId);
}
}
async openPicker(numColumns = 1, numOptions = 5, columnOptions = this.defaultColumnOptions, event) {
async openPicker(numColumns = 1, numOptions = 5, columnOptions = this.defaultColumnOptions, event, selectedId) {
const picker = await this.pickerController.create({
columns: this.getColumns(numColumns, numOptions, columnOptions),
columns: this.getColumns(numColumns, numOptions, columnOptions, selectedId),
buttons: [
{
text: '取消',
......@@ -86,11 +87,12 @@ export class EnvAddModelPage implements OnInit {
await picker.present();
}
getColumns(numColumns, numOptions, columnOptions) {
getColumns(numColumns, numOptions, columnOptions, selectedId) {
const columns = [];
for (let i = 0; i < numColumns; i++) {
columns.push({
name: `col${i}`,
selectedIndex: selectedId,
options: this.getColumnOptions(i, numOptions, columnOptions)
});
}
......
......@@ -7,7 +7,7 @@
<ion-content color="light">
<ion-item lines="none" style="margin-left: 5px;" class="itemColor">
<ion-label class="font-sub-title">选择牛舍</ion-label>
<ion-select class="font-sub-title" multiple="false" cancelText="取消" okText="确认" [(ngModel)]="curFieldRegionNo" (ionChange)="selectCowshed()">
<ion-select class="font-sub-title" multiple="false" cancelText="取消" okText="确认" [(ngModel)]="curFieldRegionNo" (ionChange)="onSelectCowshed()">
<ion-select-option *ngFor="let cowshed of cowshedList" [value]="cowshed.fieldRegionNo">{{cowshed.fieldRegionName}}</ion-select-option>
</ion-select>
</ion-item>
......@@ -164,7 +164,7 @@
<ion-item-options side="end">
<!--<ion-button color='danger' expand="full" style="width:15%;height:90%" (click)="deleteShowerModel(cfg)">删除</ion-button>-->
<div style="text-content: center; background-color: lightgray;">
<ion-icon name="remove-circle" color='danger' class="deleteIcon" (click)="deleteShowerModel(allCfg.config)" style="margin-top: 120px;"></ion-icon>
<ion-icon name="remove-circle" color='danger' class="deleteIcon" (click)="deleteShowerModel(allCfg.config)" style="margin-top: 80px;"></ion-icon>
</div>
</ion-item-options>
</ion-item-sliding>
......@@ -236,7 +236,7 @@
<ion-item-options side="end">
<!--<ion-button color='danger' expand="full" style="width:15%;height:90%" (click)="deleteLightModel(cfg)">删除</ion-button>-->
<div style="text-content: center; background-color: lightgray;" (click)="deleteLightModel(allCfg.config)">
<ion-icon name="remove-circle" color='danger' class="deleteIcon" style="margin-top: 70px;"></ion-icon>
<ion-icon name="remove-circle" color='danger' class="deleteIcon" style="margin-top: 60px;"></ion-icon>
</div>
</ion-item-options>
</ion-item-sliding>
......
......@@ -112,8 +112,8 @@ export class EnvCfgPage implements OnInit {
ionViewWillLeave() {
clearInterval(this.commTmr);
this.curFieldRegionNo = '';
this.curCowshed.fieldRegionName = null;
// this.curFieldRegionNo = '';
// this.curCowshed.fieldRegionName = null;
}
init() {
......@@ -137,6 +137,7 @@ export class EnvCfgPage implements OnInit {
// });
this.light.controlConfig = cfg;
}
this.ac.queryParams = null;
}
});
}
......@@ -167,6 +168,18 @@ export class EnvCfgPage implements OnInit {
}]);
}
onSelectCowshed() {
this.isOpenProperty = false;
this.isOpenFan = false;
this.isOpenShower = false;
this.isOpenLight = false;
this.isOpenWaterChannel = false;
this.isOpenInHouse = false;
this.isOpenEnvironment = false;
this.isOpenHeatStress = false;
this.selectCowshed();
}
// 获取当前牛舍配置信息
selectCowshed() {
if (this.curFieldRegionNo !== null && this.curFieldRegionNo !== '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment