Browse Source

[新增]摄像头编码

master
邵佳豪 3 hours ago
parent
commit
790cf9b075
  1. 9
      src/app/system-management/host-config/addcamera/addcamera.component.html
  2. 1
      src/app/system-management/host-config/addcamera/addcamera.component.ts
  3. 9
      src/app/system-management/host-config/editcamera/editcamera.component.html
  4. 21
      src/app/system-management/host-config/editcamera/editcamera.component.ts
  5. 3
      src/app/system-management/host-config/host-config.component.ts

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

@ -16,6 +16,15 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="decoderType">编码类型</nz-form-label>
<nz-form-control>
<nz-select formControlName="decoderType" nzPlaceHolder="请选择编码类型">
<nz-option [nzValue]="264" nzLabel="264"></nz-option>
<nz-option [nzValue]="265" nzLabel="265"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="password">密码</nz-form-label>
<nz-form-control>

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

@ -18,6 +18,7 @@ export class AddcameraComponent implements OnInit {
this.validateForm = this.fb.group({
name: [null, [Validators.required, namevalidate]],
user: [null, [Validators.required]],
decoderType: [null, [Validators.required]],
password: [null, [Validators.required]],
uri: [null, [Validators.required]],
type: [null, [Validators.required]],

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

@ -16,6 +16,15 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="decoderType">编码类型</nz-form-label>
<nz-form-control>
<nz-select formControlName="decoderType" nzPlaceHolder="请选择编码类型">
<nz-option [nzValue]="264" nzLabel="264"></nz-option>
<nz-option [nzValue]="265" nzLabel="265"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="password">密码</nz-form-label>
<nz-form-control>

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

@ -7,26 +7,29 @@ import { MyValidators } from '../addcamera/addcamera.component';
@Component({
selector: 'app-editcamera',
templateUrl: './editcamera.component.html',
styleUrls: ['./editcamera.component.scss']
styleUrls: ['./editcamera.component.scss'],
})
export class EditcameraComponent implements OnInit {
@Input() data: any
@Input() data: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
constructor(
private modal: NzModalRef,
private fb: FormBuilder,
private http: HttpClient
) {}
ngOnInit(): void {
const { namevalidate } = MyValidators;
let datacopy = JSON.parse(JSON.stringify(this.data))
console.log('编辑数据', datacopy)
let datacopy = JSON.parse(JSON.stringify(this.data));
console.log('编辑数据', datacopy);
this.validateForm = this.fb.group({
name: [datacopy.name, [Validators.required,namevalidate]],
name: [datacopy.name, [Validators.required, namevalidate]],
user: [datacopy.user, [Validators.required]],
decoderType: [datacopy.decoderType, [Validators.required]],
password: [datacopy.password, [Validators.required]],
uri: [datacopy.uri, [Validators.required]],
type: [datacopy.type, [Validators.required]],
order: [datacopy.order, [Validators.required]]
order: [datacopy.order, [Validators.required]],
});
}
}

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

@ -135,6 +135,7 @@ export class HostConfigComponent implements OnInit {
let body = {
name: instance.validateForm.value.name,
user: instance.validateForm.value.user,
decoderType: instance.validateForm.value.decoderType,
password: instance.validateForm.value.password,
uri: instance.validateForm.value.uri,
type: instance.validateForm.value.type,
@ -182,6 +183,7 @@ export class HostConfigComponent implements OnInit {
let body = {
name: instance.validateForm.value.name,
user: instance.validateForm.value.user,
decoderType: instance.validateForm.value.decoderType,
password: instance.validateForm.value.password,
uri: instance.validateForm.value.uri,
type: instance.validateForm.value.type,
@ -1671,6 +1673,7 @@ rule_threshold:
id: item.id,
type: type,
url: item.uri,
decoder: item.decoderType,
name: item.name,
user: item.user,
password: item.password,

Loading…
Cancel
Save