Browse Source

[新增]安信配置文件参数

beijing
邵佳豪 2 years ago
parent
commit
f7cd002c5c
  1. 1
      src/app/system-management/host-config/host-config.component.ts
  2. 2
      src/app/system-management/iframe/iframe.component.html
  3. 0
      src/app/system-management/iframe/iframe.component.scss
  4. 25
      src/app/system-management/iframe/iframe.component.spec.ts
  5. 27
      src/app/system-management/iframe/iframe.component.ts
  6. 5
      src/app/system-management/image-label-anxin/image-label-anxin.component.ts
  7. 4
      src/app/system-management/system-management-routing.module.ts
  8. 2
      src/app/system-management/system-management.module.ts
  9. BIN
      src/assets/images/noImg.png
  10. 10
      src/index.html

1
src/app/system-management/host-config/host-config.component.ts

@ -1594,6 +1594,7 @@ rule_threshold:
smog_continue_s: 3,
fire_sleep_m: 5,
fire_continue_s: 3,
lossScore: 40, //没检测到物体的惩罚分数
},
};
console.log(this.hostData);

2
src/app/system-management/iframe/iframe.component.html

@ -0,0 +1,2 @@
<button (click)="xxx()">向子页面发送信息</button>
<iframe id="iframe" src="http://192.168.1.86:25647/login" frameborder="0" width="100%" height="100%"></iframe>

0
src/app/system-management/iframe/iframe.component.scss

25
src/app/system-management/iframe/iframe.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { IframeComponent } from './iframe.component';
describe('IframeComponent', () => {
let component: IframeComponent;
let fixture: ComponentFixture<IframeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ IframeComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(IframeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

27
src/app/system-management/iframe/iframe.component.ts

@ -0,0 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { Renderer2} from '@angular/core';
@Component({
selector: 'app-iframe',
templateUrl: './iframe.component.html',
styleUrls: ['./iframe.component.scss']
})
export class IframeComponent implements OnInit {
constructor( private render2: Renderer2) { }
ngOnInit(): void {
}
xxx(){
this.handleToIframe()
}
handleToIframe() {
const child = this.render2.selectRootElement("#iframe");
console.log(child);
let data = {
from: 'parent page',
code: 200,
data: '来自父页面的数据!!!'
};
child.contentWindow.postMessage(data, '*');
}
}

5
src/app/system-management/image-label-anxin/image-label-anxin.component.ts

@ -84,6 +84,9 @@ export class ImageLabelAnxinComponent implements OnInit {
})
.catch((err) => {
this.message.create('error', '获取图片失败!');
window.setTimeout(() => {
this.initBackgroundImg();
}, 0);
});
}
@ -106,7 +109,7 @@ export class ImageLabelAnxinComponent implements OnInit {
}
// 图片加载完后,将其显示在canvas中
var img = new Image();
img.src = this.imgItem ? this.imgItem : '../../../assets/images/bgImg.png';
img.src = this.imgItem ? this.imgItem : '../../../assets/images/noImg.png';
console.log('img', img);

4
src/app/system-management/system-management-routing.module.ts

@ -11,6 +11,7 @@ import { ConditionMonitoringComponent } from './condition-monitoring/condition-m
import { KafkaComponent } from './kafka/kafka.component';
import { StatusMonitoringComponent } from './status-monitoring/status-monitoring.component';
import { VideoStreamingComponent } from './video-streaming/video-streaming.component';
import { IframeComponent } from './iframe/iframe.component';
const routes: Routes = [
@ -24,7 +25,8 @@ const routes: Routes = [
{ path: 'conditionMonitoring', component: ConditionMonitoringComponent },
{ path: 'statusMonitoring', component: StatusMonitoringComponent },
{ path: 'kafka', component: KafkaComponent },
{ path: 'videoStreaming', component: VideoStreamingComponent }
{ path: 'videoStreaming', component: VideoStreamingComponent },
{ path: 'iframe', component: IframeComponent }
];
@NgModule({

2
src/app/system-management/system-management.module.ts

@ -50,6 +50,7 @@ import { HuangHaiConfigComponent } from './host-config/huang-hai-config/huang-ha
import { ImageLabelAnxinComponent } from './image-label-anxin/image-label-anxin.component';
import { AnxinConfigComponent } from './host-config/anxin-config/anxin-config.component';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { IframeComponent } from './iframe/iframe.component';
@NgModule({
declarations: [
OrganizationComponent,
@ -80,6 +81,7 @@ import { DragDropModule } from '@angular/cdk/drag-drop';
HuangHaiConfigComponent,
ImageLabelAnxinComponent,
AnxinConfigComponent,
IframeComponent,
],
imports: [
CommonModule,

BIN
src/assets/images/noImg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

10
src/index.html

@ -1,5 +1,6 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>边缘主机管理系统</title>
@ -7,7 +8,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
<script>
function test(a) {
console.log(a)
}
</script>
</html>
Loading…
Cancel
Save