Browse Source

[修改]菜单分级

dev
chenjingyu 4 years ago
parent
commit
2510b7ecdc
  1. 2
      src/app/plan-management/entry-plan/entry-plan.component.html
  2. 134
      src/app/plan-management/meet-plan/meet-plan.component.html
  3. 118
      src/app/plan-management/meet-plan/meet-plan.component.scss
  4. 25
      src/app/plan-management/meet-plan/meet-plan.component.spec.ts
  5. 128
      src/app/plan-management/meet-plan/meet-plan.component.ts
  6. 42
      src/app/plan-management/meet-plan/newunit.html
  7. 35
      src/app/plan-management/meet-plan/newunit.scss
  8. 10
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html
  9. 12
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
  10. 11
      src/app/plan-management/plan-management-routing.module.ts
  11. 8
      src/app/plan-management/plan-management.module.ts
  12. 27
      src/app/plan-management/type-plan/newunit.html
  13. 35
      src/app/plan-management/type-plan/newunit.scss
  14. 117
      src/app/plan-management/type-plan/type-plan.component.html
  15. 118
      src/app/plan-management/type-plan/type-plan.component.scss
  16. 25
      src/app/plan-management/type-plan/type-plan.component.spec.ts
  17. 118
      src/app/plan-management/type-plan/type-plan.component.ts

2
src/app/plan-management/entry-plan/entry-plan.component.html

@ -254,7 +254,7 @@
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)="routerTo(element)" style="color: blue;">查看预案</span>
<span style="color: blue;">查看预案</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

134
src/app/plan-management/meet-plan/meet-plan.component.html

@ -0,0 +1,134 @@
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form >
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level">
<mat-option value="1">Ⅰ级</mat-option>
<mat-option value="2">Ⅱ级</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加人:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入添加人" name="companyName" autocomplete="off" [(ngModel)]="addname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加时间:</label>
<mat-form-field class="example-full-width">
<input type="date" matInput name="companyName" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput autocomplete="off" >
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入预案类型" name="companyName" autocomplete="off" [(ngModel)]="unittype">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field>
<mat-select name="toExamine" placeholder='请选择审核状态' [(ngModel)]="unitstate">
<mat-option value="8">未提交审核</mat-option>
<mat-option value="1">审核中</mat-option>
<mat-option value="2">审核通过</mat-option>
<mat-option value="4">审核退回</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">编制级别:</label>
<mat-form-field>
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="projectlevel">
<!-- <mat-option value="1">总队</mat-option>
<mat-option value="2">支队</mat-option>
<mat-option value="4">大队</mat-option>
<mat-option value="8">中队</mat-option> -->
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox>
</div>
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="newadd">
<button mat-raised-button color="primary" (click)='addunit()'><img style="margin-bottom: 3px;" src="../../../assets/images/newadd.png"> 新增</button>
</div>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.unitname}}</td>
</ng-container>
<ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef>预案级别</th>
<td mat-cell *matCellDef="let element">{{url=='2'?'Ⅱ级':'Ⅰ级'}}</td>
</ng-container>
<ng-container matColumnDef="addname">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.addname}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">{{element.addtime}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.plantype}}</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.passstate}}</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.isopen}}</td>
</ng-container>
<ng-container matColumnDef="projectlevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">{{element.projectlevel}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span style="color: blue;">查看预案</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator pageEvent [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions">
</mat-paginator>
</div>
</div>
</div>

118
src/app/plan-management/meet-plan/meet-plan.component.scss

@ -0,0 +1,118 @@
.header {
width: 100%;
padding: 12px 10px;
// margin-bottom: 10px;
box-sizing: border-box;
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
.queryField {
margin: 3px 40px;
input {
width: 180px;
height: 22px;
line-height: 22px;
border-radius: 3px;}
}
} //queryBox
.ordiv{
position: relative;
.organizationbox{
width:450px;
height: 200px;
background: white;
position: absolute;
top: 48px;
left: 77px;
z-index: 999;
border: 1px solid grey;
overflow-y: auto;
background-color: #fafafa;
li{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #fafafa;
}
mat-tree-node{
cursor: pointer;
white-space:pre;
background-color: #fafafa;
}
mat-tree-node:hover{
background: rgba(225, 225, 225, 0.8);
li{
background: rgba(225, 225, 225, 0.8);
}
}
.closediv{
z-index: 100;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
cursor: pointer;
line-height: 30px;
text-align: center;
}
.closediv:hover{
background:rgba(225, 225, 225, 0.8);
}
}
}
}
.newadd{
margin-top: 10px;
margin-left: 70px;
button{
font-size: 16px;
width: 100px;
height: 36px;
}
}
.body{
.buttonbox{
padding-left: 50px;
button{
margin:0 10px
}
}
.tablebox{
table{
width: 100%;
margin-left: 0%;
margin-top:15px;
th,td{
text-align: center;
font-size: 15px;
color: #000000;
}
}
mat-paginator{
width: 100%;
margin-left: 0%;
}
.mat-column-unitname{
width: 15%;
}
.mat-column-integrity{
width: 13%;
}
.mat-column-operation{
width: 5%;
}
.mat-column-jurisdictionsquadron{
width: 10%;
}
}
}

25
src/app/plan-management/meet-plan/meet-plan.component.spec.ts

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

128
src/app/plan-management/meet-plan/meet-plan.component.ts

@ -0,0 +1,128 @@
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
@Component({
selector: 'app-meet-plan',
templateUrl: './meet-plan.component.html',
styleUrls: ['./meet-plan.component.scss']
})
export class MeetPlanComponent implements OnInit {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队
this.preparelevels = [
{name:"总队",value:"1"},
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "1"){//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "2"){//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "3"){//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
]
}
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length)
}
url
preparelevels:any
plcheck:boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation'];
tabledataSource
unitname//预案名称
level//预案级别
addname//添加人
addtime//添加时间
unittype//预案类型
unitstate//审核状态
projectlevel//编制级别
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
//获得所有预案信息
getAllPlanInfo(){
let paramsdata:any = {
HasChildrenPlanLevel: this.plcheck || '',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
}
this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{
this.length = data.totalCount
//this.allPlanInfo = data
//this.tabledataSource = new MatTableDataSource(data.items)
console.log(this.tabledataSource)
})
}
//重置
reset(){
this.unitname=''
this.level=''
this.addname=''
this.addtime=''
this.unittype=''
this.unitstate=''
this.projectlevel=''
}
//新增预案弹窗
addunit(){
const dialogRef = this.dialog.open(newunitMeet, {
width: '340px',
height:'430px'
//data: paperDataInfo
});
}
}
@Component({
selector: 'new-unit',
templateUrl: './newunit.html',
styleUrls: ['./newunit.scss']
})
export class newunitMeet{
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitMeet>,@Inject(MAT_DIALOG_DATA) public data: any) {}
unitname//预案名称
level//预案级别
addname//添加人
addtime//添加时间
unittype//预案类型
unitstate//审核状态
projectlevel//编制级别
close(){
this.dialogRef.close();
}
}

42
src/app/plan-management/meet-plan/newunit.html

@ -0,0 +1,42 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-24 16:26:16
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 09:34:26
-->
<div class="box">
<div class="top">
<span style="font-size: 20px;">新增预案</span>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入预案类型" name="companyName" autocomplete="off" [(ngModel)]="unittype">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level">
<mat-option value="1">国家级</mat-option>
<mat-option value="2">市级</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">上传本地文件:</label>
<button mat-raised-button color="primary" ><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
</div>
<div class="bottom">
<button mat-raised-button color="primary">确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)="close()">取消</button>
</div>
</div>

35
src/app/plan-management/meet-plan/newunit.scss

@ -0,0 +1,35 @@
.box{
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
}
.queryField {
margin: 3px 5px;
input {
width: 50px;
height: 18px;
line-height: 18px;
border-radius: 3px;}
button{
width: 140px;
font-size: 16px;
}
}
.top{
width: 100%;
margin-bottom: 20px;
span{
color: #2196F3;
margin-left: 100px;
font-size: 18px;
}
}
.bottom{
margin: 30px 30px;
button{
width: 80px;
height: 36px;
font-size: 16px;
}
}

10
src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-28 11:10:30
* @LastEditTime: 2021-01-06 10:37:08
-->
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
@ -39,6 +39,10 @@
<mat-form-field class="example-full-width">
<input type="date" matInput name="companyName" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput autocomplete="off" >
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
@ -91,7 +95,7 @@
</ng-container>
<ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef>预案级别</th>
<td mat-cell *matCellDef="let element">{{element.level}}</td>
<td mat-cell *matCellDef="let element">{{url=='2'?'Ⅱ级':'Ⅰ级'}}</td>
</ng-container>
<ng-container matColumnDef="addname">
<th mat-header-cell *matHeaderCellDef>添加人</th>
@ -121,7 +125,7 @@
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span style="color: blue;">查看预案</span>
<span (click)='routerTo(element)' style="color: blue;">查看预案</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

12
src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-28 11:14:53
* @LastEditTime: 2021-01-06 10:39:07
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -31,7 +31,7 @@ export interface PeriodicElement {
}
const ELEMENT_DATA=[
{unitname:"抗洪抢险救援应急救援预案",level:"Ⅰ级",addname:"张三",addtime:"2020-12-16",plantype:"洪涝",passstate:"审核通过",isopen:"未公开",projectlevel:"总队"},
{unitname:"泥石流应急救援预案",level:"级",addname:"韩信",addtime:"2020-12-16",plantype:"泥石流",passstate:"审核中",isopen:"未公开",projectlevel:"支队"}
{unitname:"泥石流应急救援预案",level:"级",addname:"韩信",addtime:"2020-12-16",plantype:"泥石流",passstate:"审核中",isopen:"未公开",projectlevel:"支队"}
]
@Component({
@ -71,8 +71,10 @@ export class OnetwoEntryPlanComponent implements OnInit {
{name:"中队",value:"8"}
]
}
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length)
}
url
preparelevels:any
plcheck:boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation'];
@ -129,6 +131,12 @@ export class OnetwoEntryPlanComponent implements OnInit {
//data: paperDataInfo
});
}
//查看预案按钮跳转
routerTo(element){
console.log(element)
sessionStorage.setItem("companyName",element.unitname)
window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`);
}
}

11
src/app/plan-management/plan-management-routing.module.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-29 09:29:35
* @LastEditTime: 2021-01-06 09:57:07
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
@ -13,7 +13,9 @@ import { OpenPlanComponent } from './open-plan/open-plan.component';
import { PassPlanComponent } from './pass-plan/pass-plan.component';
import { EntryPlanLookComponent } from './entry-plan-look/entry-plan-look.component';
import { WebLookComponent } from './web-look/web-look.component';
import {OnetwoEntryPlanComponent} from './onetwo-entry-plan/onetwo-entry-plan.component'
import {OnetwoEntryPlanComponent} from './onetwo-entry-plan/onetwo-entry-plan.component';
import { MeetPlanComponent } from './meet-plan/meet-plan.component';
import { TypePlanComponent } from './type-plan/type-plan.component'
const routes: Routes = [
{ path: 'entryPlan', component: EntryPlanComponent},
@ -22,7 +24,10 @@ const routes: Routes = [
{ path: 'passPlan', component: PassPlanComponent},
{ path: 'entryPlandetail', component: EntryPlanLookComponent},
{ path: 'webLook', component: WebLookComponent},
{ path: 'OnetwoEntryPlan', component: OnetwoEntryPlanComponent}//一二级预案录入
{ path: 'OnetwoEntryPlan', component: OnetwoEntryPlanComponent},//一级预案录入
{ path: 'OnetwoEntryPlan2', component: OnetwoEntryPlanComponent},//二级预案录入
{ path: 'MeetPlan',component:MeetPlanComponent},//应急预案
{ path: 'typePlan',component:TypePlanComponent},//类型预案
];
@NgModule({

8
src/app/plan-management/plan-management.module.ts

@ -51,12 +51,16 @@ import { EntryPlanLookComponent, AddPlanone, DownloadFile, AuditResult, ChangeNa
import { PlanType, AuditSatus, PlanLevel } from '../pipes/boolean.pipe';
import { WebLookComponent } from './web-look/web-look.component';
import { OnetwoEntryPlanComponent } from './onetwo-entry-plan/onetwo-entry-plan.component';
import { newunitComponent} from './onetwo-entry-plan/onetwo-entry-plan.component'
import { newunitComponent} from './onetwo-entry-plan/onetwo-entry-plan.component';
import { MeetPlanComponent } from './meet-plan/meet-plan.component';
import { newunitMeet }from './meet-plan/meet-plan.component';
import { TypePlanComponent } from './type-plan/type-plan.component';
import { newunitType }from './type-plan/type-plan.component'
@NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent,AddPlanone,PlanType,AuditSatus,PlanLevel,DownloadFile,AuditResult,ChangeName, WebLookComponent, OnetwoEntryPlanComponent,newunitComponent],
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent,AddPlanone,PlanType,AuditSatus,PlanLevel,DownloadFile,AuditResult,ChangeName, WebLookComponent, OnetwoEntryPlanComponent,newunitComponent, MeetPlanComponent,newunitMeet, TypePlanComponent,newunitType],
imports: [
CommonModule,
PlanManagementRoutingModule,

27
src/app/plan-management/type-plan/newunit.html

@ -0,0 +1,27 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-24 16:26:16
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 10:15:18
-->
<div class="box">
<div class="top">
<span style="font-size: 20px;">新增预案</span>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">上传本地文件:</label>
<button mat-raised-button color="primary" ><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
</div>
<div class="bottom">
<button mat-raised-button color="primary">确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)="close()">取消</button>
</div>
</div>

35
src/app/plan-management/type-plan/newunit.scss

@ -0,0 +1,35 @@
.box{
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
}
.queryField {
margin: 3px 5px;
input {
width: 50px;
height: 18px;
line-height: 18px;
border-radius: 3px;}
button{
width: 140px;
font-size: 16px;
}
}
.top{
width: 100%;
margin-bottom: 20px;
span{
color: #2196F3;
margin-left: 100px;
font-size: 18px;
}
}
.bottom{
margin: 30px 30px;
button{
width: 80px;
height: 36px;
font-size: 16px;
}
}

117
src/app/plan-management/type-plan/type-plan.component.html

@ -0,0 +1,117 @@
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form >
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加人:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入添加人" name="companyName" autocomplete="off" [(ngModel)]="addname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加时间:</label>
<mat-form-field class="example-full-width">
<input type="date" matInput name="companyName" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput autocomplete="off" >
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field>
<mat-select name="toExamine" placeholder='请选择审核状态' [(ngModel)]="unitstate">
<mat-option value="8">未提交审核</mat-option>
<mat-option value="1">审核中</mat-option>
<mat-option value="2">审核通过</mat-option>
<mat-option value="4">审核退回</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">编制级别:</label>
<mat-form-field>
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="projectlevel">
<!-- <mat-option value="1">总队</mat-option>
<mat-option value="2">支队</mat-option>
<mat-option value="4">大队</mat-option>
<mat-option value="8">中队</mat-option> -->
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox>
</div>
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="newadd">
<button mat-raised-button color="primary" (click)='addunit()'><img style="margin-bottom: 3px;" src="../../../assets/images/newadd.png"> 新增</button>
</div>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.unitname}}</td>
</ng-container>
<ng-container matColumnDef="addname">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.addname}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">{{element.addtime}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">类型预案</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.passstate}}</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.isopen}}</td>
</ng-container>
<ng-container matColumnDef="projectlevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">{{element.projectlevel}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span style="color: blue;">查看预案</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator pageEvent [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions">
</mat-paginator>
</div>
</div>
</div>
<p>type-plan works!</p>

118
src/app/plan-management/type-plan/type-plan.component.scss

@ -0,0 +1,118 @@
.header {
width: 100%;
padding: 12px 10px;
// margin-bottom: 10px;
box-sizing: border-box;
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
.queryField {
margin: 3px 40px;
input {
width: 180px;
height: 22px;
line-height: 22px;
border-radius: 3px;}
}
} //queryBox
.ordiv{
position: relative;
.organizationbox{
width:450px;
height: 200px;
background: white;
position: absolute;
top: 48px;
left: 77px;
z-index: 999;
border: 1px solid grey;
overflow-y: auto;
background-color: #fafafa;
li{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #fafafa;
}
mat-tree-node{
cursor: pointer;
white-space:pre;
background-color: #fafafa;
}
mat-tree-node:hover{
background: rgba(225, 225, 225, 0.8);
li{
background: rgba(225, 225, 225, 0.8);
}
}
.closediv{
z-index: 100;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
cursor: pointer;
line-height: 30px;
text-align: center;
}
.closediv:hover{
background:rgba(225, 225, 225, 0.8);
}
}
}
}
.newadd{
margin-top: 10px;
margin-left: 70px;
button{
font-size: 16px;
width: 100px;
height: 36px;
}
}
.body{
.buttonbox{
padding-left: 50px;
button{
margin:0 10px
}
}
.tablebox{
table{
width: 100%;
margin-left: 0%;
margin-top:15px;
th,td{
text-align: center;
font-size: 15px;
color: #000000;
}
}
mat-paginator{
width: 100%;
margin-left: 0%;
}
.mat-column-unitname{
width: 15%;
}
.mat-column-integrity{
width: 13%;
}
.mat-column-operation{
width: 5%;
}
.mat-column-jurisdictionsquadron{
width: 10%;
}
}
}

25
src/app/plan-management/type-plan/type-plan.component.spec.ts

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

118
src/app/plan-management/type-plan/type-plan.component.ts

@ -0,0 +1,118 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-01-06 09:47:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 10:27:09
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
@Component({
selector: 'app-type-plan',
templateUrl: './type-plan.component.html',
styleUrls: ['./type-plan.component.scss']
})
export class TypePlanComponent implements OnInit {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队
this.preparelevels = [
{name:"总队",value:"1"},
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "1"){//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "2"){//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "3"){//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
]
}
}
preparelevels:any
plcheck:boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation'];
tabledataSource
unitname//预案名称
level//预案级别
addname//添加人
addtime//添加时间
unittype//预案类型
unitstate//审核状态
projectlevel//编制级别
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
//重置
reset(){
this.unitname=''
this.level=''
this.addname=''
this.addtime=''
this.unittype=''
this.unitstate=''
this.projectlevel=''
}
//新增预案弹窗
addunit(){
const dialogRef = this.dialog.open(newunitType, {
width: '340px',
height:'300px'
//data: paperDataInfo
});
}
}
@Component({
selector: 'new-unit',
templateUrl: './newunit.html',
styleUrls: ['./newunit.scss']
})
export class newunitType{
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitType>,@Inject(MAT_DIALOG_DATA) public data: any) {}
unitname//预案名称
level//预案级别
addname//添加人
addtime//添加时间
unittype//预案类型
unitstate//审核状态
projectlevel//编制级别
close(){
this.dialogRef.close();
}
}
Loading…
Cancel
Save