Browse Source

[新增]新增档案类证照管理

dev
邵佳豪 3 years ago
parent
commit
31daff2ea5
  1. 4
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html
  2. 11
      src/app/system-management/file-of-license/add-file-of-license/add-file-of-license.component.html
  3. 0
      src/app/system-management/file-of-license/add-file-of-license/add-file-of-license.component.scss
  4. 24
      src/app/system-management/file-of-license/add-file-of-license/add-file-of-license.component.ts
  5. 11
      src/app/system-management/file-of-license/edit-file-of-license/edit-file-of-license.component.html
  6. 0
      src/app/system-management/file-of-license/edit-file-of-license/edit-file-of-license.component.scss
  7. 24
      src/app/system-management/file-of-license/edit-file-of-license/edit-file-of-license.component.ts
  8. 30
      src/app/system-management/file-of-license/file-of-license.component.html
  9. 57
      src/app/system-management/file-of-license/file-of-license.component.scss
  10. 132
      src/app/system-management/file-of-license/file-of-license.component.ts
  11. 2
      src/app/system-management/navigation/navigation.component.html
  12. 2
      src/app/system-management/role/role.component.html
  13. 6
      src/app/system-management/system-management-routing.module.ts
  14. 12
      src/app/system-management/system-management.module.ts
  15. 1
      src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.html
  16. 0
      src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.scss
  17. 15
      src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.ts
  18. 1
      src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.html
  19. 0
      src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.scss
  20. 15
      src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.ts
  21. 1
      src/app/system-management/update-of-license/update-of-license.component.html
  22. 0
      src/app/system-management/update-of-license/update-of-license.component.scss
  23. 15
      src/app/system-management/update-of-license/update-of-license.component.ts
  24. BIN
      src/assets/images/icon/license.png
  25. 3
      src/theme.less

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

@ -48,7 +48,7 @@
</div>
</div>
<div class="tablebox">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]='false' [nzPageSize]='16'>
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]='false' [nzPageSize]='999'>
<thead>
<tr>
<th>ip</th>
@ -77,7 +77,7 @@
</div>
</div>
<div class="tablebox">
<nz-table #basicTable2 [nzData]="listOfDataCamera" [nzShowPagination]='false' [nzPageSize]='16'>
<nz-table #basicTable2 [nzData]="listOfDataCamera" [nzShowPagination]='false' [nzPageSize]='999'>
<thead>
<tr>
<th>名称</th>

11
src/app/system-management/file-of-license/add-file-of-license/add-file-of-license.component.html

@ -0,0 +1,11 @@
<div class="box">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-control nzErrorTip="请输入证照名称">
<nz-input-group>
<input nz-input type="text" formControlName="name" placeholder="请输入证照名称" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</form>
</div>

0
src/app/system-management/file-of-license/add-file-of-license/add-file-of-license.component.scss

24
src/app/system-management/file-of-license/add-file-of-license/add-file-of-license.component.ts

@ -0,0 +1,24 @@
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-add-file-of-license',
templateUrl: './add-file-of-license.component.html',
styleUrls: ['./add-file-of-license.component.scss']
})
export class AddFileOfLicenseComponent implements OnInit {
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]]
});
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
}

11
src/app/system-management/file-of-license/edit-file-of-license/edit-file-of-license.component.html

@ -0,0 +1,11 @@
<div class="box">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-control nzErrorTip="请输入证照名称">
<nz-input-group>
<input nz-input type="text" formControlName="name" placeholder="请输入证照名称" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</form>
</div>

0
src/app/system-management/file-of-license/edit-file-of-license/edit-file-of-license.component.scss

24
src/app/system-management/file-of-license/edit-file-of-license/edit-file-of-license.component.ts

@ -0,0 +1,24 @@
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-edit-file-of-license',
templateUrl: './edit-file-of-license.component.html',
styleUrls: ['./edit-file-of-license.component.scss']
})
export class EditFileOfLicenseComponent implements OnInit {
@Input() data?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [this.data.licenseName, [Validators.required]]
});
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
}

30
src/app/system-management/file-of-license/file-of-license.component.html

@ -0,0 +1,30 @@
<div class="licenseBox" id="licenseBox">
<div class="topbox">
<div class="lefttop">
<span>档案类证件列表</span>
</div>
<div class="righttop">
<button nz-button nzType="primary" (click)="addRole()"><i nz-icon nzType="plus-circle"
nzTheme="outline"></i>新增</button>
</div>
</div>
<div class="tablebox">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]='false' [nzPageSize]='999'>
<thead>
<tr>
<th style="padding-left: 40px;">档案类证件</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.licenseName}}</td>
<td class="operation">
<a (click)="edit(data)">编辑</a>
<a (click)="delete(data)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
</div>
</div>

57
src/app/system-management/file-of-license/file-of-license.component.scss

@ -0,0 +1,57 @@
.licenseBox {
width: 100%;
height: 100%;
background: #FFFFFF;
box-sizing: border-box;
padding: 20px;
overflow: hidden;
display: flex;
flex-direction: column;
tbody {
tr {
td {
span {
margin-right: 18px;
}
}
td:nth-child(1) {
padding-left: 40px;
}
}
.operation {
a {
color: #2399FF;
margin-right: 8px;
}
a:last-child {
color: rgba(0, 13, 33, 0.48);
}
}
}
}
.topbox {
width: 100%;
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
.lefttop {
span {
color: #000D21;
}
}
}
.tablebox {
flex: 1;
overflow-y: auto;
}

132
src/app/system-management/file-of-license/file-of-license.component.ts

@ -0,0 +1,132 @@
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient } from '@angular/common/http';
import { AddFileOfLicenseComponent } from './add-file-of-license/add-file-of-license.component';
import { EditFileOfLicenseComponent } from './edit-file-of-license/edit-file-of-license.component';
@Component({
selector: 'app-file-of-license',
templateUrl: './file-of-license.component.html',
styleUrls: ['./file-of-license.component.scss']
})
export class FileOfLicenseComponent implements OnInit {
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { }
ngOnInit(): void {
this.getLicense()
}
listOfData: any[] = [];
//获取证照列表
getLicense() {
let params = {
SkipCount: '0',
MaxResultCount: '999'
}
this.http.get('/api/services/app/FileLicenseType/GetAll', {
params: params
}).subscribe((data: any) => {
console.log('证照列表', data.result.items)
this.listOfData = data.result.items
})
}
addRole(): void {
const modal = this.modal.create({
nzTitle: '新增证照',
nzContent: AddFileOfLicenseComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
let body = {
licenseName: instance.validateForm.value.name,
}
this.http.post('/api/services/app/FileLicenseType/Create', body).subscribe(data => {
resolve(data)
this.message.create('success', '创建成功!');
this.getLicense()
return true
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
// Return a result when closed
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
edit(item) {
const modal = this.modal.create({
nzTitle: '编辑证照',
nzContent: EditFileOfLicenseComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 325,
nzComponentParams: {
data: item
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
let body = {
id: item.id,
licenseName: instance.validateForm.value.name
}
this.http.put('/api/services/app/FileLicenseType/Update', body).subscribe(data => {
resolve(data)
this.message.create('success', '修改成功!');
this.getLicense()
return true
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
// Return a result when closed
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
delete(item) {
console.log(item)
this.modal.confirm({
nzTitle: `确定要删除${item.licenseName}这个证照吗?`,
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
this.http.delete('/api/services/app/FileLicenseType/Delete', {
params: {
Id: item.id
}
}).subscribe(data => {
this.message.create('success', '删除成功!');
this.getLicense()
})
},
nzCancelText: '取消',
nzOnCancel: () => {
}
});
}
}

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

@ -18,6 +18,8 @@
<li [routerLink]="['/system/role']" routerLinkActive="router-link-active"><img src="../../../assets/images/icon/role.png" alt="">角色管理</li>
<li [routerLink]="['/system/host']" routerLinkActive="router-link-active"><img src="../../../assets/images/icon/host.png" alt="">分析主机管理</li>
<li [routerLink]="['/system/push']" routerLinkActive="router-link-active"><img src="../../../assets/images/icon/push.png" alt="">推送管理</li>
<li [routerLink]="['/system/updateOfLicense']" routerLinkActive="router-link-active"><img src="../../../assets/images/icon/license.png" alt="">更新类证照管理</li>
<li [routerLink]="['/system/fileOfLicense']" routerLinkActive="router-link-active"><img src="../../../assets/images/icon/license.png" alt="">档案类证照管理</li>
</ul>
</div>
</nz-sider>

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

@ -9,7 +9,7 @@
</div>
</div>
<div class="tablebox">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]='false' [nzPageSize]='16'>
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]='false' [nzPageSize]='999'>
<thead>
<tr>
<th style="padding-left: 40px;">角色</th>

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

@ -7,13 +7,17 @@ import { OrganizationComponent } from './organization/organization.component';
import { UserComponent } from './user/user.component';
import { AnalysisOfTheHostComponent } from './analysis-of-the-host/analysis-of-the-host.component';
import { PushComponent } from './push/push.component';
import { UpdateOfLicenseComponent } from './update-of-license/update-of-license.component';
import { FileOfLicenseComponent } from './file-of-license/file-of-license.component';
const routes: Routes = [
{ path: 'organization', component: OrganizationComponent },
{ path: 'user', component: UserComponent },
{ path: 'role', component: RoleComponent },
{ path: 'host', component: AnalysisOfTheHostComponent },
{ path: 'push', component: PushComponent }
{ path: 'push', component: PushComponent },
{ path: 'fileOfLicense', component: FileOfLicenseComponent },
{ path: 'updateOfLicense', component: UpdateOfLicenseComponent }
];
@NgModule({

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

@ -34,8 +34,14 @@ import { AddcameraComponent } from './analysis-of-the-host/addcamera/addcamera.c
import { EditcameraComponent } from './analysis-of-the-host/editcamera/editcamera.component';
import { PushComponent } from './push/push.component';
import { EditPushItemComponent } from './push/edit-push-item/edit-push-item.component';
import { FileOfLicenseComponent } from './file-of-license/file-of-license.component';
import { UpdateOfLicenseComponent } from './update-of-license/update-of-license.component';
import { AddFileOfLicenseComponent } from './file-of-license/add-file-of-license/add-file-of-license.component';
import { EditFileOfLicenseComponent } from './file-of-license/edit-file-of-license/edit-file-of-license.component';
import { AddUpdateOfLicenseComponent } from './update-of-license/add-update-of-license/add-update-of-license.component';
import { EditUpdateOfLicenseComponent } from './update-of-license/edit-update-of-license/edit-update-of-license.component';
@NgModule({
declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, PushComponent, EditPushItemComponent],
declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, PushComponent, EditPushItemComponent, FileOfLicenseComponent, UpdateOfLicenseComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent],
imports: [
CommonModule,
SystemRoutingModule,
@ -57,7 +63,7 @@ import { EditPushItemComponent } from './push/edit-push-item/edit-push-item.comp
NzTreeSelectModule,
NzCheckboxModule
],
entryComponents :[AdduserComponent,EdituserComponent,AddroleComponent,EditroleComponent,AddorComponent,EditorComponent,AddhostComponent,EdithostComponent,AddcameraComponent,EditcameraComponent,EditPushItemComponent]
entryComponents: [AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, EditPushItemComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent]
})
export class SystemManagementModule { }

1
src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.html

@ -0,0 +1 @@
<p>add-update-of-license works!</p>

0
src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.scss

15
src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-add-update-of-license',
templateUrl: './add-update-of-license.component.html',
styleUrls: ['./add-update-of-license.component.scss']
})
export class AddUpdateOfLicenseComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

1
src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.html

@ -0,0 +1 @@
<p>edit-update-of-license works!</p>

0
src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.scss

15
src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-edit-update-of-license',
templateUrl: './edit-update-of-license.component.html',
styleUrls: ['./edit-update-of-license.component.scss']
})
export class EditUpdateOfLicenseComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

1
src/app/system-management/update-of-license/update-of-license.component.html

@ -0,0 +1 @@
<p>update-of-license works!</p>

0
src/app/system-management/update-of-license/update-of-license.component.scss

15
src/app/system-management/update-of-license/update-of-license.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-update-of-license',
templateUrl: './update-of-license.component.html',
styleUrls: ['./update-of-license.component.scss']
})
export class UpdateOfLicenseComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

BIN
src/assets/images/icon/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

3
src/theme.less

@ -504,7 +504,8 @@
//管理员界面 ---- 表格
#userBox,
#roleBox,
#hostbox {
#hostbox,
#licenseBox {
.ant-table-thead>tr>th {
background: rgba(145, 204, 255, 0.15);
}

Loading…
Cancel
Save