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

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

parent cd6645c6
...@@ -6,6 +6,7 @@ import { Routes, RouterModule } from '@angular/router'; ...@@ -6,6 +6,7 @@ import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular'; import { IonicModule } from '@ionic/angular';
import { EnvCfgPage } from './env-cfg.page'; import { EnvCfgPage } from './env-cfg.page';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
const routes: Routes = [ const routes: Routes = [
{ {
...@@ -19,7 +20,8 @@ const routes: Routes = [ ...@@ -19,7 +20,8 @@ const routes: Routes = [
CommonModule, CommonModule,
FormsModule, FormsModule,
IonicModule, IonicModule,
RouterModule.forChild(routes) RouterModule.forChild(routes),
NgxDatatableModule
], ],
declarations: [EnvCfgPage] declarations: [EnvCfgPage]
}) })
......
...@@ -68,7 +68,11 @@ ...@@ -68,7 +68,11 @@
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</ion-item> </ion-item>
<ion-item class="fanItem" lines="none" style="padding-left: 10px">
<a (click)="referenceModel()" >参考常用模式</a>
</ion-item>
</div> </div>
<div *ngIf="penLin"> <div *ngIf="penLin">
<ion-item-divider> <ion-item-divider>
<ion-label>喷淋模式配置</ion-label> <ion-label>喷淋模式配置</ion-label>
...@@ -310,7 +314,7 @@ ...@@ -310,7 +314,7 @@
<ngx-datatable class='material' [rows]="environmentConfig" [columnMode]="'force'" style="white-space: nowrap; text-align: center"> <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 name="" prop="tittle" width="50px;">
</ngx-datatable-column> </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>
<ngx-datatable-column name="下限" prop="lower" width="20px;"> <ngx-datatable-column name="下限" prop="lower" width="20px;">
</ngx-datatable-column> </ngx-datatable-column>
......
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {PickerController} from '@ionic/angular'; import {PickerController, AlertController} from '@ionic/angular';
import {Api} from '../../service/api'; import {Api} from '../../service/api';
import {Load} from '../../service/load'; import {Load} from '../../service/load';
import {NgxDatatableModule} from '@swimlane/ngx-datatable'; import {NgxDatatableModule} from '@swimlane/ngx-datatable';
...@@ -21,7 +21,7 @@ export class EnvCfgPage implements OnInit { ...@@ -21,7 +21,7 @@ export class EnvCfgPage implements OnInit {
'selecting': false, '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; isError = false;
...@@ -370,47 +370,54 @@ export class EnvCfgPage implements OnInit { ...@@ -370,47 +370,54 @@ export class EnvCfgPage implements OnInit {
}]); }]);
} }
referenceModel() {
this.selectModel('风机', 0);
}
addModel() { addModel() {
this.popupModelSelect(1, '照明'); this.selectModel('照明', 1);
// this.popup($scope, $ionicPopup, $timeout);
} }
changeModel() { changeModel() {
this.popupModelSelect(0, '喷淋'); this.selectModel('喷淋', 1);
} }
// 模式组选择 1:添加 0:替换 // 参考:0 添加/替换:1
popupModelSelect(option, model) { async selectModel(deviceName, ref) {
const alert = await this.alerCtrl.create({
// const popup = this.$ionicPopup.show({ header: deviceName + '常用模式选择',
// templateUrl: 'www/templates/popUp/authenticationPop.html', inputs: [
// title: model + '常用模式选择', {
// scope: $scope, type: 'radio',
// buttons: [ label: '春季',
// { text: '取消',type:'button-small' }, value: 'Spring',
// { text: '确定', checked: false},
// type: 'button-small', {
// onTap: function() { type: 'radio',
// console.log("认证值______________",$scope.choice); label: '夏季',
// var prompt=$ionicPopup.show({ value: 'Summer',
// template:'<i class="icon ion-ios-checkmark"></i>', checked: false},
// title:'提示', {
// subTitle:'申请认证已提交,正等待审核', type: 'radio',
// scope:$scope, label: '秋季',
// }); value: 'Autumn',
// prompt.then(function(){ checked: false},
// {
// }); type: 'radio',
// $timeout(function(){ label: '冬季',
// prompt.close(); value: 'Winter',
// },3000); checked: false}],
// } buttons: [{text: '取消', cssClass: 'width: 40%'},
// }, {text: '确定', cssClass: 'width: 40%'}]
// ] });
// }); if (1 === ref) {
// popup.then(function(res) { alert.inputs.push({
// console.log('Tapped!', res); 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