Commit 5d338897 authored by aymen.du's avatar aymen.du

111

parent eb463d5e
......@@ -329,3 +329,49 @@
<button nz-button nzType="primary" class="searchBtn" [nzLoading]="isLoading" (click)="save('req4')"><span>{{'confirm' | translate}}</span></button>
</ng-template>
</nz-modal>
<nz-modal [(nzVisible)]="isToSee" [nzContent]="con4" nzWidth="500" [nzTitle]="'isToSeeModel' | translate"
[nzFooter]="foot4" (nzOnCancel)="cancel()" nzMaskClosable="false">
<ng-template #con4>
<!--<app-search-item inModal="true" isMust="true" [label]="'moduleName' | translate" [(value)]="req4.newTopicModelName"></app-search-item>-->
<!--<app-search-select isMust="true" inModal="true" [(value)]="req2.companyNo" [label]="'selectCompany' | translate" optL="companyName"-->
<!--[data]="companys" optV="companyNo"></app-search-select>-->
<div style="width: calc(100% - 80px);display: inline-block;vertical-align: top;padding-left: 15px;">
<app-search-select inModal="true" [label]="'selectTime' | translate" [(value)]="selectTime3"
optL="a" optV="b" [data]="[{a: '1小时', b: 1}, {a: '24小时', b: 24}, {a: '7天', b: 144}, {a: '自定义', b: 0}]"></app-search-select>
<app-search-date *ngIf="selectTime3 === 0" inModal="true" [label]="'startTime' | translate" [(value)]="req3.startTime"
showTime="true"></app-search-date>
<app-search-date *ngIf="selectTime3 === 0" inModal="true" [label]="'endTime' | translate" [(value)]="req3.endTime"
showTime="true"></app-search-date>
</div>
<button nz-button class="searchBtn" [nzType]="'primary'" [nzLoading]="isLoading" (click)="onSearchToSee()">
<span>{{'search' | translate}}</span></button>
<nz-tabset style="border-top: 1px solid #cccccc">
<nz-tab nzTitle="表格">
<nz-table #nzTable6
[nzData]="toSeeData"
[nzSize]="'middle'"
nzShowSizeChanger
[nzShowPagination]="true"
[nzLoading]="isLoading">
<thead nz-thead>
<tr>
<th nz-th><span>{{'Time' | translate}}</span></th>
<th nz-th><span>{{'Numerical' | translate}}</span></th>
</tr>
</thead>
<tbody nz-tbody>
<tr *ngFor="let one of nzTable6.data, let i = index">
<td nz-td>{{one.time | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nz-td>{{(one.type === 'DI' || one.type === 'DO') ? (one.value ? 1 : 0) : one.value}}</td>
</tr>
</nz-table>
</nz-tab>
<nz-tab nzTitle="图表"><div class="chartCon" echarts [options]="option1"></div></nz-tab>
</nz-tabset>
</ng-template>
<ng-template #foot4>
<button nz-button class="searchBtn" nzType="default" [nzLoading]="isLoading" (click)="cancel()"><span>{{'cancel' | translate}}</span></button>
</ng-template>
</nz-modal>
......@@ -20,18 +20,22 @@ export class SensorDetailComponent implements OnInit {
name = '';
req: any = {};
req2: any = {};
req3 = {};
req3: any = {};
req4 = {};
req5: any = {};
isUC = false;
isUC2 = false;
isMC = false;
isToSee = false;
ToSeeList: any;
isUpdate = false;
probsModels = [];
topicModels = [];
actualData = [];
toSeeData = [];
wayData = [];
selectTime3 = 24;
option1: any = {};
isClose = false;
isSaveOther = false;
companyNo = '';
......@@ -192,6 +196,7 @@ export class SensorDetailComponent implements OnInit {
this.isUC = false;
this.isMC = false;
this.isUC2 = false;
this.isToSee = false;
this.isSaveOther = false;
}
......@@ -262,7 +267,49 @@ export class SensorDetailComponent implements OnInit {
this.api.probes.delAProbes([{deviceNo: one.deviceNo, topicName: one.topicName, name: one.name}, this.next]);
}
toSee() {
toSee(value) {
this.isToSee = true;
this.ToSeeList = value;
}
onSearchToSee() {
const req = {
alias: this.ToSeeList.alias,
deviceList: [
{
sn: this.ToSeeList.SN,
type: this.ToSeeList.type
}
],
endTime: this.selectTime3 ? new Date().getTime() : this.req3.startTime,
offset: 0 - new Date().getTimezoneOffset() / 60,
startTime: this.selectTime3 ? new Date().getTime() - this.selectTime3 * 60 * 60 * 1000 : this.req3.startTime,
// topicName: 'string'
};
this.option1 = {
grid: {
top: '5%'
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
smooth: true
}]
};
this.api.data.getHisData([req, (data) => {
if (data && data.constructor === Array) {
this.toSeeData = data;
} else {
this.message.error(data && data.message ? data.message : '获取数据失败');
}
}]);
}
saveOther() {
......
......@@ -152,6 +152,8 @@
"topic": "主题",
"updateWay": "编辑通道",
"updateTime": "更新时间",
"Time": "时间",
"Numerical": "数值",
"updateData": "最新数据",
"see": "查看",
"pleaseFillAll": "请填完所有必填项",
......
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