Browse Source

合并代码

develop
陈鹏飞 3 years ago
parent
commit
3c98642b17
  1. 11009
      package-lock.json
  2. 17
      src/app/pipe/cameraTypePipe.ts
  3. 3
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html
  4. 4
      src/app/system-management/host-config/addcamera/addcamera.component.html
  5. 2
      src/app/system-management/host-config/addcamera/addcamera.component.ts
  6. 4
      src/app/system-management/host-config/editcamera/editcamera.component.html
  7. 2
      src/app/system-management/host-config/editcamera/editcamera.component.ts
  8. 4
      src/app/system-management/host-config/host-config.component.html
  9. 77
      src/app/system-management/host-config/host-config.component.ts
  10. 6
      src/app/system-management/system-management.module.ts

11009
package-lock.json generated

File diff suppressed because it is too large Load Diff

17
src/app/pipe/cameraTypePipe.ts

@ -0,0 +1,17 @@
import { Pipe, PipeTransform } from '@angular/core';
/*
* Raise the value exponentially
* Takes an exponent argument that defaults to 1.
* Usage:
* value | exponentialStrength:exponent
* Example:
* {{ 2 | exponentialStrength:10 }}
* formats to: 1024
*/
@Pipe({ name: 'cameraType' })
export class cameraType implements PipeTransform {
transform(value: number): string {
let arr = ['收银区', '进口', '出口', '卸油区', '加油区1', '加油区2', '加油区3', '加油区4']
return arr[value]
}
}

3
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html

@ -28,8 +28,7 @@
</ng-container> </ng-container>
<ng-template #elseTemplate> <ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" <i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" class="ant-tree-switcher-line-icon"></i>
class="ant-tree-switcher-line-icon"></i>
</ng-template> </ng-template>
</ng-template> </ng-template>
</div> </div>

4
src/app/system-management/host-config/addcamera/addcamera.component.html

@ -25,10 +25,10 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="url">地址</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="uri">地址</nz-form-label>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input nz-input type="text" formControlName="url" placeholder="请输入地址" /> <input nz-input type="text" formControlName="uri" placeholder="请输入地址" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

2
src/app/system-management/host-config/addcamera/addcamera.component.ts

@ -17,7 +17,7 @@ export class AddcameraComponent implements OnInit {
name: [null, [Validators.required]], name: [null, [Validators.required]],
user: [null, [Validators.required]], user: [null, [Validators.required]],
password: [null, [Validators.required]], password: [null, [Validators.required]],
url: [null, [Validators.required]], uri: [null, [Validators.required]],
type: [null, [Validators.required]] type: [null, [Validators.required]]
}); });
} }

4
src/app/system-management/host-config/editcamera/editcamera.component.html

@ -25,10 +25,10 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="url">地址</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="uri">地址</nz-form-label>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input nz-input type="text" formControlName="url" placeholder="请输入地址" /> <input nz-input type="text" formControlName="uri" placeholder="请输入地址" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

2
src/app/system-management/host-config/editcamera/editcamera.component.ts

@ -21,7 +21,7 @@ export class EditcameraComponent implements OnInit {
name: [datacopy.name, [Validators.required]], name: [datacopy.name, [Validators.required]],
user: [datacopy.user, [Validators.required]], user: [datacopy.user, [Validators.required]],
password: [datacopy.password, [Validators.required]], password: [datacopy.password, [Validators.required]],
url: [datacopy.url, [Validators.required]], uri: [datacopy.uri, [Validators.required]],
type: [datacopy.type, [Validators.required]] type: [datacopy.type, [Validators.required]]
}); });
} }

4
src/app/system-management/host-config/host-config.component.html

@ -22,8 +22,8 @@
<td>{{ item.name }}</td> <td>{{ item.name }}</td>
<td>{{ item.user }}</td> <td>{{ item.user }}</td>
<td>{{ item.password }}</td> <td>{{ item.password }}</td>
<td>{{ item.url }}</td> <td>{{ item.uri }}</td>
<td>{{ item.type }}</td> <td>{{ item.type | cameraType}}</td>
<td> <td>
<span class="blue" style="margin-right: 12px;" (click)="editCamera(item)">编辑</span> <span class="blue" style="margin-right: 12px;" (click)="editCamera(item)">编辑</span>
<span class="red" (click)="deleteCamera(item)">删除</span> <span class="red" (click)="deleteCamera(item)">删除</span>

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

@ -11,7 +11,7 @@ interface Camera {
name: string; name: string;
user: string; user: string;
password: string; password: string;
url: string; uri: string;
type: number type: number
} }
@ -31,22 +31,18 @@ export class HostConfigComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.hostId = this.route.snapshot.queryParams.hostId this.hostId = this.route.snapshot.queryParams.hostId
this.orId = this.route.snapshot.queryParams.orId this.orId = this.route.snapshot.queryParams.orId
this.getCamera()
} }
listOfData: Camera[] = [ listOfData: Camera[] = [];
{
name: '1',
user: 'John Brown',
password: '32',
url: 'New York No. 1 Lake Park',
type: 0
}
];
goback() { goback() {
history.go(-1) history.go(-1)
} }
//摄像头 //摄像头
getCamera() { getCamera() {
this.http.get('/api/Cameras').subscribe((data: any) => {
this.listOfData = data.items
console.log('摄像头列表', data.items)
})
} }
addCamera() { addCamera() {
const modal = this.modal.create({ const modal = this.modal.create({
@ -59,20 +55,20 @@ export class HostConfigComponent implements OnInit {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {
console.log('表单信息', instance.validateForm) console.log('表单信息', instance.validateForm)
// let body = { let body = {
// organizationUnitId: '111', name: instance.validateForm.value.name,
// ipAdress: instance.validateForm.value.ip, user: instance.validateForm.value.user,
// code: instance.validateForm.value.code, password: instance.validateForm.value.password,
// name: instance.validateForm.value.name, uri: instance.validateForm.value.uri,
// } type: instance.validateForm.value.type,
// this.http.post('/api/services/app/Camera/Create', body).subscribe(data => { organizationId: this.orId
// resolve(data) }
// this.message.create('success', '创建成功!'); this.http.post('/api/Cameras', body).subscribe(data => {
// this.getCamera() resolve(data)
// return true this.message.create('success', '创建成功!');
// }, err => { this.getCamera()
// return false return true
// }) })
}) })
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create('warning', '请填写完整!');
@ -96,17 +92,20 @@ export class HostConfigComponent implements OnInit {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {
console.log('表单信息', instance.validateForm) console.log('表单信息', instance.validateForm)
// data.name = instance.validateForm.value.name let body = {
// data.code = instance.validateForm.value.code name: instance.validateForm.value.name,
// data.ipAdress = instance.validateForm.value.ip user: instance.validateForm.value.user,
// this.http.put('/api/services/app/Camera/Update', data).subscribe(data => { password: instance.validateForm.value.password,
// resolve(data) uri: instance.validateForm.value.uri,
// this.message.create('success', '编辑成功!'); type: instance.validateForm.value.type,
// this.getCamera() organizationId: this.orId
// return true }
// }, err => { this.http.put(`/api/Cameras/${data.id}`, body).subscribe(data => {
// return false resolve(data)
// }) this.message.create('success', '创建成功!');
this.getCamera()
return true
})
}) })
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create('warning', '请填写完整!');
@ -123,11 +122,7 @@ export class HostConfigComponent implements OnInit {
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'default', nzOkType: 'default',
nzOnOk: () => { nzOnOk: () => {
this.http.delete('/api/services/app/Camera/Delete', { this.http.delete(`/api/Cameras/${item.id}`).subscribe(data => {
params: {
Id: item.id
}
}).subscribe(data => {
this.message.create('success', '删除成功!'); this.message.create('success', '删除成功!');
this.getCamera() this.getCamera()
}) })

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

@ -29,8 +29,10 @@ import { EditcameraComponent } from './host-config/editcamera/editcamera.compone
import { HostConfigComponent } from './host-config/host-config.component'; import { HostConfigComponent } from './host-config/host-config.component';
import { NzPageHeaderModule } from 'ng-zorro-antd/page-header'; import { NzPageHeaderModule } from 'ng-zorro-antd/page-header';
import { PlottingImageComponent } from './plotting-image/plotting-image.component'; import { PlottingImageComponent } from './plotting-image/plotting-image.component';
import { cameraType } from '../pipe/cameraTypePipe';
@NgModule({ @NgModule({
declarations: [OrganizationComponent, NavigationComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, HostConfigComponent, PlottingImageComponent], declarations: [OrganizationComponent, NavigationComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, HostConfigComponent, PlottingImageComponent, cameraType],
imports: [ imports: [
CommonModule, CommonModule,
SystemRoutingModule, SystemRoutingModule,
@ -53,7 +55,7 @@ import { PlottingImageComponent } from './plotting-image/plotting-image.componen
NzCheckboxModule, NzCheckboxModule,
NzPageHeaderModule NzPageHeaderModule
], ],
entryComponents :[AddorComponent,EditorComponent,AddhostComponent,EdithostComponent,AddcameraComponent,EditcameraComponent] entryComponents: [AddorComponent, EditorComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent]
}) })
export class SystemManagementModule { } export class SystemManagementModule { }

Loading…
Cancel
Save