From 52b59dcee93c9d8aec073c957ccf6cd461fb394e Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 14 Dec 2020 19:53:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=B7=BB=E5=8A=A0=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E9=A2=84=E6=A1=88=E5=8D=95=E9=80=89=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test-score/addPlanTwo.html | 88 ++- .../create-test-score.component.html | 10 +- .../create-test-score.component.ts | 508 ++++++++---------- .../create-test-score/finishDialog.html | 10 +- src/app/examiner/examiner.module.ts | 3 +- src/app/pipes/size.pipe.ts | 18 + 6 files changed, 311 insertions(+), 326 deletions(-) diff --git a/src/app/examiner/create-test-score/addPlanTwo.html b/src/app/examiner/create-test-score/addPlanTwo.html index d0b35ce..a9476d1 100644 --- a/src/app/examiner/create-test-score/addPlanTwo.html +++ b/src/app/examiner/create-test-score/addPlanTwo.html @@ -5,51 +5,49 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - 选择 - - - - 预案名称 {{element.name}} 添加人 {{element.people}} 添加时间 {{element.time}} 编制级别 {{element.level}}
+ 选择 + + + 预案名称 {{element.name}} 添加人 {{element.creatorName}} 添加时间 {{element.creationTime | date:'yyyy-MM-dd'}} 编制级别 {{element.planLevel | planlevel}}
diff --git a/src/app/examiner/create-test-score/create-test-score.component.html b/src/app/examiner/create-test-score/create-test-score.component.html index 88b394f..03965ee 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.html +++ b/src/app/examiner/create-test-score/create-test-score.component.html @@ -42,7 +42,7 @@

{{unit.name}}

- + @@ -86,7 +86,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -212,7 +212,7 @@ - + diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index ce95834..819556a 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.ts +++ b/src/app/examiner/create-test-score/create-test-score.component.ts @@ -23,6 +23,11 @@ export class CreateTestScoreComponent implements OnInit { this.selectedTab = index } ngOnInit(): void { + // this.getUnitData() + // .then(()=>{ + // this.getAround() + // }) + this.getUnitData() this.getAround() this.getKeySite() @@ -34,56 +39,6 @@ export class CreateTestScoreComponent implements OnInit { clickUnitName(key){ this.selectedUnitIndex = key } - //模拟单位数据 - unitDatas:any = [ - {name:'富丽华大酒店1',score:0,basicInfoScore:0,basicInfoItemScore:0,basicInfoNodes : [ - { - name: '单位信息', - key: '0-0', - type:'基本信息', - expanded: true, - children: [ - {name: '统一社会信用代码',key: '1',isLeaf:true}, - {name: '单位类型',key: '2',isLeaf:true}, - {name: '联系人',key: '3',isLeaf:true}, - {name: '联系电话',key: '4',isLeaf:true}, - {name: '辖区中队',key: '5',isLeaf:true}, - {name: '单位地址',key: '6',isLeaf:true} - ] - }, - { - name: '建筑信息', - key: '0-1', - type:'基本信息', - expanded: true, - children: [ - { name: '面积', key: '0-1-0-0',isLeaf:true}, - { name: '高度', key: '0-1-0-1',isLeaf:true}, - { name: '层数', key: '0-1-0-2',isLeaf:true} - ] - }, - ],aroundScore:0,aroundItemScore:0,aroundNodes :[ - { - name: '单位四周毗邻', - key: '11', - expanded: true, - type:'四周毗邻', - children: [ - {name: '东方向',key: '55',isLeaf:true}, - ] - }, - { - name: '建筑四周毗邻', - key: '22', - expanded: true, - type:'四周毗邻', - children: [ - {name: '东方向',key: '55',isLeaf:true}, - ] - }, - ]}, - // {name:'富丽华大酒店2',score:0,basicInfoScore:0} - ] //上个页面传过来的单位数据 // unitId:any = [{name:'最最最最最',id:'5fb76c42919f2b44e464016f'}, @@ -91,216 +46,219 @@ export class CreateTestScoreComponent implements OnInit { // {name:'贵港油库',id:'5fa35d68f8eb762cb03c662e'} // ] unitId:any = JSON.parse(localStorage.getItem('checkedWork')) - //获取单位基本信息 - getUnitData(){ - this.unitId.forEach((element,index) => { - element.score = 0 - element.basicInfoScore = 0 - element.basicInfoItemScore = 0 - this.http.get(`/api/Companies/${element.id}`).subscribe((data:any)=>{ - // console.log('单位信息',index,data) - let unitData = { - name: '单位信息', - type:'基本信息', - expanded: false, - key:(Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), - children:[] - } - data.usci ? unitData.children.push({ - name: '统一社会信用代码',key: element.id+'统一社会信用代码',isLeaf:true,value:data.usci - }) : null - data.buildingTypes[0].name ? unitData.children.push({ - name: '单位类型',key: element.id+'单位类型',isLeaf:true,value:data.buildingTypes[0].name - }) : null - data.contacts ? unitData.children.push({ - name: '联系人',key: element.id+'联系人',isLeaf:true,value:data.contacts - }) : null - data.phone ? unitData.children.push({ - name: '联系电话',key: element.id+'联系电话',isLeaf:true,value:data.phone - }) : null - data.organizationName ? unitData.children.push({ - name: '辖区中队',key: element.id+'辖区中队',isLeaf:true,value:data.organizationName - }) : null - data.address ? unitData.children.push({ - name: '单位地址',key: element.id+'单位地址',isLeaf:true,value:data.address - }) : null + //获取单位基本信息 + getUnitData(){ - element.basicInfoNodes = [] - element.basicInfoNodes.push(unitData) - - var buildingsData:any - this.http.get("/api/Buildings",{ - params:{ - companyId:element.id + this.unitId.forEach((element,index) => { + element.score = 0 + element.basicInfoScore = 0 + element.basicInfoItemScore = 0 + + this.http.get(`/api/Companies/${element.id}`).subscribe((data:any)=>{ + let unitData = { + name: '单位信息', + type:'基本信息', + expanded: false, + key:(Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), + children:[] } - }).subscribe(async (data:any)=>{ - buildingsData = data - for (let i = 0, length = data.length; i < length; i++){ - const result = await new Promise((resolve) =>{ - this.http.get("/api/BuildingBasicInfos",{ // 循环请求当前单位建筑每一个建筑的信息保存到数组中 - params:{ - companyId :element.id, - buildingId:data[i].id, - buildingType:data[i].buildingTypes[0].id - } - }).subscribe((buildingsData:any)=>{ - // console.log(1234,buildingsData) - buildingsData.name = data[i].name - buildingsData.buildingType = data[i].buildingTypes[0].name - - buildingsData[0].buildingBasicGroups.forEach((y,m) => { - let propertyInfosArr = [] - let tabledata - if(y.type == 1){//如果是表格类 - var map = {}, - dest:any = []; - for(var i = 0; i < y.propertyInfos.length; i++){ - var ai = y.propertyInfos[i]; - if(!map[ai.propertyName]){ - dest.push({ - propertyName: ai.propertyName, - data: [ai] - }); - map[ai.propertyName] = ai; - }else{ - for(var j = 0; j < dest.length; j++){ - var dj = dest[j]; - if(dj.propertyName == ai.propertyName){ - dj.data.push(ai); - break; - } - } + data.usci ? unitData.children.push({ + name: '统一社会信用代码',key: element.id+'统一社会信用代码',isLeaf:true,value:data.usci + }) : null + data.buildingTypes[0].name ? unitData.children.push({ + name: '单位类型',key: element.id+'单位类型',isLeaf:true,value:data.buildingTypes[0].name + }) : null + data.contacts ? unitData.children.push({ + name: '联系人',key: element.id+'联系人',isLeaf:true,value:data.contacts + }) : null + data.phone ? unitData.children.push({ + name: '联系电话',key: element.id+'联系电话',isLeaf:true,value:data.phone + }) : null + data.organizationName ? unitData.children.push({ + name: '辖区中队',key: element.id+'辖区中队',isLeaf:true,value:data.organizationName + }) : null + data.address ? unitData.children.push({ + name: '单位地址',key: element.id+'单位地址',isLeaf:true,value:data.address + }) : null + + element.basicInfoNodes = [] + element.basicInfoNodes.push(unitData) + + var buildingsData:any + this.http.get("/api/Buildings",{ + params:{ + companyId:element.id + } + }).subscribe(async (data:any)=>{ + buildingsData = data + for (let i = 0, length = data.length; i < length; i++){ + const result = await new Promise((resolve) =>{ + this.http.get("/api/BuildingBasicInfos",{ // 循环请求当前单位建筑每一个建筑的信息保存到数组中 + params:{ + companyId :element.id, + buildingId:data[i].id, + buildingType:data[i].buildingTypes[0].id + } + }).subscribe((buildingsData:any)=>{ + buildingsData.name = data[i].name + buildingsData.buildingType = data[i].buildingTypes[0].name + buildingsData[0].buildingBasicGroups.forEach((y,m) => { + let propertyInfosArr = [] + let tabledata + if(y.type == 1){//如果是表格类 + var map = {}, + dest:any = []; + for(var i = 0; i < y.propertyInfos.length; i++){ + var ai = y.propertyInfos[i]; + if(!map[ai.propertyName]){ + dest.push({ + propertyName: ai.propertyName, + data: [ai] + }); + map[ai.propertyName] = ai; + }else{ + for(var j = 0; j < dest.length; j++){ + var dj = dest[j]; + if(dj.propertyName == ai.propertyName){ + dj.data.push(ai); + break; + } + } + } + } + //根据行数确定在循环数组中的index + dest.forEach(item => { + item.data.sort(function(a,b){ + return Number(a.tag) - Number(b.tag) + }) + }) + y.tabledata = dest + tabledata = dest + y.tabledata[0].data.forEach((x,key) => { + if(x.propertyValue){ + x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) + x.isLeaf = true + x.name = x.propertyValue + propertyInfosArr.push(x) + } + }) + }else{ + y.propertyInfos.forEach((x,key) => { + if(x.propertyValue){ + x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) + x.isLeaf = true + x.name = x.propertyName + propertyInfosArr.push(x) } + }) } - //根据行数确定在循环数组中的index - dest.forEach(item => { - item.data.sort(function(a,b){ - return Number(a.tag) - Number(b.tag) + if(propertyInfosArr.length != 0){ + element.basicInfoNodes.push({ + name:y.name != '基本信息' ? buildingsData.name + '-' + y.name : buildingsData.name , + type:'基本信息', + expanded: false, + key:(Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), + children:propertyInfosArr, + tabledata:tabledata ? tabledata : null }) - }) - y.tabledata = dest - tabledata = dest - y.tabledata[0].data.forEach((x,key) => { - if(x.propertyValue){ - x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) - x.isLeaf = true - x.name = x.propertyValue - propertyInfosArr.push(x) - } - }) - }else{ - y.propertyInfos.forEach((x,key) => { - if(x.propertyValue){ - x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) - x.isLeaf = true - x.name = x.propertyName - propertyInfosArr.push(x) - } - }) - } - if(propertyInfosArr.length != 0){ - element.basicInfoNodes.push({ - name:y.name != '基本信息' ? buildingsData.name + '-' + y.name : buildingsData.name , - type:'基本信息', - expanded: false, - key:(Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), - children:propertyInfosArr, - tabledata:tabledata ? tabledata : null - }) - element.basicInfoNodes = [...element.basicInfoNodes] - } - + element.basicInfoNodes = [...element.basicInfoNodes] + } + + }) + + resolve(i) }) - - resolve(i) }) - }) - } - // console.log(987,this.unitId) - }) + } + }) + + }) + + }) + - }) - - }) + } //获取四周毗邻数据 getAround(){ - this.unitId.forEach((element,index) => { - element.aroundScore = 0 - element.aroundItemScore = 0 - element.aroundNodes = [] - //获得当前单位的单位毗邻 - let id = {companyId:element.id} - this.http.get('/api/CompanyAdjoins',{params:id}).subscribe((data:any)=>{ - // console.log(index+'四周毗邻',data) - data.forEach(item => { - item.direction == 0 ? item.title = '东方向' : null - item.direction == 1 ? item.title = '西方向' : null - item.direction == 2 ? item.title = '南方向' : null - item.direction == 3 ? item.title = '北方向' : null - item.direction == 4 ? item.title = '东南方向' : null - item.direction == 5 ? item.title = '西南方向' : null - item.direction == 6 ? item.title = '东北方向' : null - item.direction == 7 ? item.title = '西北方向' : null - item.isLeaf = true, - item.key = item.id - }) - //如果存在单位毗邻 - if(data.length != 0){ - this.unitId[index].aroundNodes.push({ - name: '单位毗邻', - key: (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), - expanded: false, - type:'四周毗邻', - children: data + + this.unitId.forEach((element,index) => { + element.aroundScore = 0 + element.aroundItemScore = 0 + element.aroundNodes = [] + //获得当前单位的单位毗邻 + let id = {companyId:element.id} + this.http.get('/api/CompanyAdjoins',{params:id}).subscribe((data:any)=>{ + // console.log(index+'四周毗邻',data) + data.forEach(item => { + item.direction == 0 ? item.title = '东方向' : null + item.direction == 1 ? item.title = '西方向' : null + item.direction == 2 ? item.title = '南方向' : null + item.direction == 3 ? item.title = '北方向' : null + item.direction == 4 ? item.title = '东南方向' : null + item.direction == 5 ? item.title = '西南方向' : null + item.direction == 6 ? item.title = '东北方向' : null + item.direction == 7 ? item.title = '西北方向' : null + item.isLeaf = true, + item.key = item.id }) - element.aroundNodes = [...element.aroundNodes] - } - - }) + //如果存在单位毗邻 + if(data.length != 0){ + this.unitId[index].aroundNodes.push({ + name: '单位毗邻', + key: (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), + expanded: false, + type:'四周毗邻', + children: data + }) + element.aroundNodes = [...element.aroundNodes] + } + + }) + + //获得当前单位的建筑毗邻 + this.http.get('/api/Buildings',{params:id}).subscribe((data:any)=>{ + if (data.length) { + getAllArchitecture(data) + } + }) + let that = this + async function getAllArchitecture(buildingsdata){ + for (let i = 0, length = buildingsdata.length; i < length; i++){ + let id = {buildingId:buildingsdata[i].id} + let result = await new Promise((resolve, reject) => { + that.http.get('/api/BuildingAdjoins',{params:id}).subscribe((data:any)=>{ + data.forEach(item => { + item.direction == 0 ? item.title = '东方向' : null + item.direction == 1 ? item.title = '西方向' : null + item.direction == 2 ? item.title = '南方向' : null + item.direction == 3 ? item.title = '北方向' : null + item.direction == 4 ? item.title = '东南方向' : null + item.direction == 5 ? item.title = '西南方向' : null + item.direction == 6 ? item.title = '东北方向' : null + item.direction == 7 ? item.title = '西北方向' : null + item.isLeaf = true + item.key = item.id + }) + if(data.length != 0){ + that.unitId[index].aroundNodes.push({ + name: buildingsdata[i].name, + key: (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), + expanded: false, + type:'四周毗邻', + children: data + }) + element.aroundNodes = [...element.aroundNodes] + } + resolve('1') + }) + }) + } - //获得当前单位的建筑毗邻 - this.http.get('/api/Buildings',{params:id}).subscribe((data:any)=>{ - if (data.length) { - getAllArchitecture(data) } }) - let that = this - async function getAllArchitecture(buildingsdata){ - for (let i = 0, length = buildingsdata.length; i < length; i++){ - let id = {buildingId:buildingsdata[i].id} - let result = await new Promise((resolve, reject) => { - that.http.get('/api/BuildingAdjoins',{params:id}).subscribe((data:any)=>{ - data.forEach(item => { - item.direction == 0 ? item.title = '东方向' : null - item.direction == 1 ? item.title = '西方向' : null - item.direction == 2 ? item.title = '南方向' : null - item.direction == 3 ? item.title = '北方向' : null - item.direction == 4 ? item.title = '东南方向' : null - item.direction == 5 ? item.title = '西南方向' : null - item.direction == 6 ? item.title = '东北方向' : null - item.direction == 7 ? item.title = '西北方向' : null - item.isLeaf = true - item.key = item.id - }) - if(data.length != 0){ - that.unitId[index].aroundNodes.push({ - name: buildingsdata[i].name, - key: (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), - expanded: false, - type:'四周毗邻', - children: data - }) - element.aroundNodes = [...element.aroundNodes] - } - resolve('1') - }) - }) - } - } - }) } //获取重点部位 getKeySite(){ @@ -719,10 +677,13 @@ export class CreateTestScoreComponent implements OnInit { //添加预案 addPlan(){ + let companyId = { + companyId : this.unitId[this.selectedUnitIndex].id + } const dialogRef = this.dialog.open(AddPlanDialog, { width: '380px', height: '136px', - data: {} + data: companyId }); dialogRef.afterClosed().subscribe(result => { @@ -1028,14 +989,13 @@ export class CreateTestScoreComponent implements OnInit { console.log(paperDataInfo) const dialogRef = this.dialog.open(FinishDialog, { - width: '700px', - height: '300px', + width: '650px', data: paperDataInfo }); dialogRef.afterClosed().subscribe(result => { console.log('The dialog was closed'); - this.router.navigate(['/home/createexam-index']) //跳转试卷列表页面 + }); } //上一步 @@ -1064,9 +1024,13 @@ export class AddPlanDialog { //选择想要添加的预案类型 (已存在或者自定义) selectType(type){ + let obj = { + type:type, + companyId:this.data.companyId + } const dialogRef = this.dialog.open(AddPlanTwoDialog, { id:'addPlanTwo', - data: {type} + data: obj }); dialogRef.afterClosed().subscribe(result => { @@ -1075,12 +1039,6 @@ export class AddPlanDialog { } } -const ELEMENT_DATA: any = [ - {id: 1, name: '五楼电梯故障', people:'上海总队',time:'2020-06-15',level:'总队'}, - {id: 2, name: '故障搜救', people:'超级管理员',time:'2020-06-15',level:'总队'}, - {id: 3, name: '故障搜救', people:'超级管理员',time:'2020-06-15',level:'总队'}, - {id: 4, name: '五楼电梯故障', people:'上海总队',time:'2020-06-15',level:'总队'}, -]; //添加预案2 @Component({ @@ -1090,25 +1048,32 @@ const ELEMENT_DATA: any = [ }) export class AddPlanTwoDialog { - constructor(public dialog: MatDialog,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} + constructor(private http: HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} planType:any = this.data.type == 1 ? true : false//显示的预案类型 displayedColumns: string[] = ['select', 'name', 'people', 'time', 'level']; - dataSource = new MatTableDataSource(ELEMENT_DATA); - selection = new SelectionModel(true, []); - isAllSelected() { - const numSelected = this.selection.selected.length; - const numRows = this.dataSource.data.length; - return numSelected === numRows; - } - - masterToggle() { - this.isAllSelected() ? - this.selection.clear() : - this.dataSource.data.forEach(row => this.selection.select(row)); + dataSource : any //列表数据 + selectedradio + radioChange(e){ + console.log(e) } ngOnInit(): void { + // console.log(this.data.companyId) + this.get2DPlan() + } + //获取当前公司的二维预案 + get2DPlan(){ + let planArr = [] + this.http.get('/api/PlanComponents',{params:{ + companyId:this.data.companyId + }}).subscribe((data:any) => { + console.log(123,data) + data.items.forEach(item => { + item.planType == 1 ? planArr.push(item) : null + }) + this.dataSource = planArr + }) } onNoClick(): void { @@ -1117,7 +1082,7 @@ export class AddPlanTwoDialog { //确定 confirm(){ if(this.planType == 1){ - console.log(this.selection) + }else{ } @@ -1137,9 +1102,8 @@ export class AddPlanTwoDialog { }) export class FinishDialog{ - constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} + constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} ngOnInit(): void { - // console.log( new Date()) this.getProfiles() } //获取登录账号的个人资料 @@ -1198,6 +1162,7 @@ export class FinishDialog{ this.http.post('/api/Papers',params).subscribe(data => { this.snackBar.open('创建成功','确定',config); this.dialogRef.close(); + this.router.navigate(['/home/createexam-index']) //跳转试卷列表页面 },err => { this.snackBar.open(err,'确定',config); }) @@ -1235,6 +1200,9 @@ export class FinishDialog{ getWeek(result: Date[]): void { console.log('week: ', result.map(getISOWeek)); } + close(){ + this.dialogRef.close(); + } } //查看答案 diff --git a/src/app/examiner/create-test-score/finishDialog.html b/src/app/examiner/create-test-score/finishDialog.html index 9e0f99b..af4096d 100644 --- a/src/app/examiner/create-test-score/finishDialog.html +++ b/src/app/examiner/create-test-score/finishDialog.html @@ -8,18 +8,18 @@ -->
-
+
-
+
-
+
@@ -27,6 +27,6 @@
- -
+ +
\ No newline at end of file diff --git a/src/app/examiner/examiner.module.ts b/src/app/examiner/examiner.module.ts index 9710199..d430b9c 100644 --- a/src/app/examiner/examiner.module.ts +++ b/src/app/examiner/examiner.module.ts @@ -52,9 +52,10 @@ import { NzTreeModule } from 'ng-zorro-antd/tree'; import { ExaminerIndexComponent } from './examiner-index/examiner-index.component'; import { ExaminerNewOneComponent } from './examiner-new-one/examiner-new-one.component'; import { NzDatePickerModule } from 'ng-zorro-antd/date-picker'; +import { PlanLevel } from '../pipes/size.pipe'; @NgModule({ - declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog], + declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog,PlanLevel], imports: [ CommonModule, examinerRoutingModule, diff --git a/src/app/pipes/size.pipe.ts b/src/app/pipes/size.pipe.ts index c658f29..5a58dcc 100644 --- a/src/app/pipes/size.pipe.ts +++ b/src/app/pipes/size.pipe.ts @@ -55,4 +55,22 @@ export class testState implements PipeTransform { return "已结束" } } +} + +export enum PlanLevelEnum { + "编制级别0", + "总队", + "支队", + "编制级别3", + "大队", + "编制级别5", + "编制级别6", + "编制级别7", + "中队" +} +@Pipe({name: 'planlevel'}) +export class PlanLevel implements PipeTransform { + transform(value: number): string { + return PlanLevelEnum[value] + } } \ No newline at end of file