Commit 91a2ce13 authored by yating.lin's avatar yating.lin

牛舍配置: 追加【参考常用模式】【替换模式】【添加模式】

parent cd6645c6
......@@ -6,6 +6,7 @@ import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { EnvCfgPage } from './env-cfg.page';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
const routes: Routes = [
{
......@@ -19,7 +20,8 @@ const routes: Routes = [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
RouterModule.forChild(routes),
NgxDatatableModule
],
declarations: [EnvCfgPage]
})
......
......@@ -68,7 +68,11 @@
</ion-row>
</ion-grid>
</ion-item>
<ion-item class="fanItem" lines="none" style="padding-left: 10px">
<a (click)="referenceModel()" >参考常用模式</a>
</ion-item>
</div>
<div *ngIf="penLin">
<ion-item-divider>
<ion-label>喷淋模式配置</ion-label>
......@@ -310,7 +314,7 @@
<ngx-datatable class='material' [rows]="environmentConfig" [columnMode]="'force'" style="white-space: nowrap; text-align: center">
<ngx-datatable-column name="" prop="tittle" width="50px;">
</ngx-datatable-column>
<ngx-datatable-column name="上限" prop="top" width="20px;">
<ngx-datatable-column name="上限" prop="top" width="20px;" >
</ngx-datatable-column>
<ngx-datatable-column name="下限" prop="lower" width="20px;">
</ngx-datatable-column>
......
import {Component, OnInit} from '@angular/core';
import {PickerController} from '@ionic/angular';
import {PickerController, AlertController} from '@ionic/angular';
import {Api} from '../../service/api';
import {Load} from '../../service/load';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
......@@ -21,7 +21,7 @@ export class EnvCfgPage implements OnInit {
'selecting': false,
};
constructor(private pickerController: PickerController, private api: Api, private load: Load) {
constructor(public alerCtrl: AlertController, private pickerController: PickerController, private api: Api, private load: Load) {
}
isError = false;
......@@ -370,47 +370,54 @@ export class EnvCfgPage implements OnInit {
}]);
}
referenceModel() {
this.selectModel('风机', 0);
}
addModel() {
this.popupModelSelect(1, '照明');
// this.popup($scope, $ionicPopup, $timeout);
this.selectModel('照明', 1);
}
changeModel() {
this.popupModelSelect(0, '喷淋');
this.selectModel('喷淋', 1);
}
// 模式组选择 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);
// });
// 参考:0 添加/替换:1
async selectModel(deviceName, ref) {
const alert = await this.alerCtrl.create({
header: deviceName + '常用模式选择',
inputs: [
{
type: 'radio',
label: '春季',
value: 'Spring',
checked: false},
{
type: 'radio',
label: '夏季',
value: 'Summer',
checked: false},
{
type: 'radio',
label: '秋季',
value: 'Autumn',
checked: false},
{
type: 'radio',
label: '冬季',
value: 'Winter',
checked: false}],
buttons: [{text: '取消', cssClass: 'width: 40%'},
{text: '确定', cssClass: 'width: 40%'}]
});
if (1 === ref) {
alert.inputs.push({
type: 'radio',
label: '自定义',
value: 'other',
checked: false});
}
await alert.present();
}
}
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