Commit cd6645c6 authored by zhuangzhuang's avatar zhuangzhuang

牛舍配置页微调

parent 531ae561
This diff is collapsed.
......@@ -41,3 +41,7 @@
text-align: center;
padding-left: 0px
}
.addBtn {
width: 100%;
}
......@@ -11,13 +11,6 @@ import {NgxDatatableModule} from '@swimlane/ngx-datatable';
})
export class EnvCfgPage implements OnInit {
// 工作模式
workModeSetting = {
'workMode': '1',
'DeviceNo': '',
'workModeOld': '1'
};
defaultColumnOptions = [];
fanMode = {
......@@ -54,6 +47,7 @@ export class EnvCfgPage implements OnInit {
shuiCao: any = {};
// 环境参数预警配置
environmentConfig = [];
private $ionicPopup: any;
async openPicker(numColumns = 1, numOptions = 5, columnOptions = this.defaultColumnOptions) {
const picker = await this.pickerController.create({
......@@ -208,26 +202,8 @@ export class EnvCfgPage implements OnInit {
}
workModeEvent(item) {
// if ( this.workModeSetting.workModeOld === this.workModeSetting.workMode ) {
// return;
// }
//
// const opt = {fieldDeviceNo : this.workModeSetting.DeviceNo ,
// op : this.workModeSetting.workMode ,
// startTime: parseInt((new Date().getTime() / 1000).toString(), 10),
// ts: parseInt((new Date().getTime() / 1000).toString(), 10)
// };
//
// opt.startTime = opt.ts;
//
// this.api.control.controlSwitch([opt, (data) => {
// if (data && data.code === 1) {
// this.getData(1);
// this.api.presentMsgToast(data.message);
// } else {
// this.api.presentMsgToast(data.message);
// }
// }]);
console.log('更新牛舍配置信息');
this.updateCowshed();
}
async openCalendarPicker(numColumns = 1, numOptions = 5, columnOptions = this.defaultColumnOptions) {
......@@ -379,4 +355,62 @@ export class EnvCfgPage implements OnInit {
this.environmentConfig.push(temperatureCfg, humidityCfg);
}
}
// 修改牛舍配置
updateCowshed() {
this.api.config.updateCowshedConfig([this.curCowshed, (data) => {
if (data) {
console.log('更新成功');
} else {
this.api.presentMsgToast('获取数据失败');
this.isError = true;
}
this.load.offLoad();
}]);
}
addModel() {
this.popupModelSelect(1, '照明');
// this.popup($scope, $ionicPopup, $timeout);
}
changeModel() {
this.popupModelSelect(0, '喷淋');
}
// 模式组选择 1:添加 0:替换
popupModelSelect(option, model) {
// const popup = this.$ionicPopup.show({
// templateUrl: 'www/templates/popUp/authenticationPop.html',
// title: model + '常用模式选择',
// scope: $scope,
// buttons: [
// { text: '取消',type:'button-small' },
// { text: '确定',
// type: 'button-small',
// onTap: function() {
// console.log("认证值______________",$scope.choice);
// var prompt=$ionicPopup.show({
// template:'<i class="icon ion-ios-checkmark"></i>',
// title:'提示',
// subTitle:'申请认证已提交,正等待审核',
// scope:$scope,
// });
// prompt.then(function(){
//
// });
// $timeout(function(){
// prompt.close();
// },3000);
// }
// },
// ]
// });
// popup.then(function(res) {
// console.log('Tapped!', res);
// });
}
}
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