From 8f2c245f86f27f6fa6516c422171382c3c5a7593 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Sun, 13 Dec 2020 10:18:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E6=96=B0=E5=BB=BA]=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=80=83=E8=AF=95=E7=AC=AC=E4=B8=80=E4=B8=AA=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8F=8A=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examiner-new-one.component.html | 99 +++++++++++-- .../examiner-new-one.component.scss | 133 ++++++++++++++---- .../examiner-new-one.component.ts | 67 ++++++++- 3 files changed, 256 insertions(+), 43 deletions(-) diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.html b/src/app/examiner/examiner-new-one/examiner-new-one.component.html index 75a1628..2b6a73d 100644 --- a/src/app/examiner/examiner-new-one/examiner-new-one.component.html +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.html @@ -4,27 +4,49 @@ * @Author: sueRimn * @Date: 2020-12-11 16:34:26 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-11 17:42:09 + * @LastEditTime: 2020-12-13 09:43:19 -->
-
+
-
+
-
+
-
-
-
- 包含下级 - - +
+
+
+ + 包含下级 +
+
clear
+ + + +
  • {{node.name}}
  • +
    + + +
  • {{node.name}}
  • +
    +
    +
    + +
    @@ -32,8 +54,61 @@
    -
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + 单位名称{{element.name}}辖区中队{{element.organizationName}}单位类型{{element.buildingTypes.length != 0 ? element.buildingTypes[0].name : ''}}统一社会信用代码{{element.usci}}
    + + +
    +
    +
    +
    + 所选单位 +
    +
    + + + + + + + + + + + +
    单位名称操作
    {{item.name}}删除
    +
    +
    +
    -
    diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.scss b/src/app/examiner/examiner-new-one/examiner-new-one.component.scss index ac8deaa..b83683c 100644 --- a/src/app/examiner/examiner-new-one/examiner-new-one.component.scss +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.scss @@ -1,3 +1,4 @@ + table { width: 100%; text-align: center; @@ -18,13 +19,73 @@ table { margin: 20px 20px 10px 50px; background-color: #FFFFFF; border-radius: 16px ; + .contenttable{ + width: 1200px; + //margin-right: 40px; + margin-left: 30px; + //background-color: none; + table{ + width: 100%; + margin-top: 15px; + background-color:transparent; + font-size: 16px; + th{ + background-color: #F5FDFE; + color: #000000; + font-size: 15px; + } + td{font-size: 15px;} + .mat-table{ + background-color:transparent; + } + } + mat-paginator{ + width: 100%; + // margin-top: 30px; + } + } } + .contentRight{ width: 320px; height: 850px; margin: 20px 20px 10px 10px; background-color: #FFFFFF; border-radius: 16px ; + display: flex; + flex-direction: column; + .rightone{ + width: 100%; + margin:30px 20px; + span{ + font-size: 20px; + } + } + .righttwo{ + height: 670px; + width:280px; + margin-left: 20px; + overflow-y: auto; + table{ + th,td{ + height: 48px; + font-size: 15px; + } + thead{ + background-color: #F5FDFE; + } + table tbody{ + height: 570px; + overflow-y:scroll; + tr{ + table-layout:fixed + } + } + } + } + ::-webkit-scrollbar { + width:2px; + } } } .header { @@ -67,36 +128,60 @@ table { border-radius: 8px; outline:0 none !important; } + } + .ordiv{ + position: relative; + .organizationbox{ + button{ + color: #000000; + position: relative; + bottom: 5px; + } + width:450px; + height: 200px; + background: white; + position: absolute; + top: 48px; + left: 27px; + z-index: 999; + border: 1px solid grey; + overflow-y: auto; + li{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + mat-tree-node{ + cursor: pointer; + white-space:pre; + } + mat-tree-node:hover{ + 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); + } + } + + } .headerright{ float: right; } } //queryBox } - .centertable{ - width: 1632px; - margin-right: 40px; - margin-left: 40px; - background-color: #FFFFFF; - table{ - td,th{ - height: 48px; - font-size: 18px; - } - td{ - border-bottom: 1px solid #F2F5F6; - } - thead{ - background-color:#F5FDFE; - } - .green{ - color: #07CDCF; - } - .red{ - color: #FF8678; - } - } - } + .operationSpan{ margin: 0 10px; diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.ts b/src/app/examiner/examiner-new-one/examiner-new-one.component.ts index 6940fe3..665ceb5 100644 --- a/src/app/examiner/examiner-new-one/examiner-new-one.component.ts +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-11 16:34:26 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-12 09:13:04 + * @LastEditTime: 2020-12-13 10:13:54 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -30,9 +30,13 @@ export class ExaminerNewOneComponent implements OnInit { constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } ngOnInit(): void { - //this.getAllKeyUnit(); + this.getunitdata(); + this.getOrganizations(); + this.getUnittype(); + this.getAllKeyUnit(); } + removeClass=document.getElementsByClassName("mat-form-field-underline") private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -62,7 +66,7 @@ export class ExaminerNewOneComponent implements OnInit { pageSizeOptions: number[] = [10] //设置每页条数 PageNumber:any //第几页 - displayedColumns: string[] = ['checked','Follow','unitname','integrity','jurisdictionsquadron', 'unittype','scc', 'time','operation']; + displayedColumns: string[] = ['checked','unitname','jurisdictionsquadron', 'unittype','scc']; tabledataSource:any allorganizations:any oldDataSource:any; //原始表格数据 @@ -213,9 +217,9 @@ export class ExaminerNewOneComponent implements OnInit { Sort: this.integritySort ? 'integrityscore' : '', SortType: this.integritySort || '', } - console.log(paramsdata) + //console.log(paramsdata) this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{ - console.log(data) + //console.log(data) this.length = data.totalCount this.allKeyUnitInfo = data // data.items.sort( (a,b) => { @@ -224,9 +228,21 @@ export class ExaminerNewOneComponent implements OnInit { data.items.forEach( (item,index) => { item.integrity = this.wanzhengduArr[index] }) - console.log(789,data.items) + //console.log(789,data.items) this.tabledataSource = new MatTableDataSource(data.items); + //console.log(this.tabledataSource) + if(this.selectedunitArr.length!=0){ + for(var i=0;i Date: Sun, 13 Dec 2020 15:51:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E7=BC=96=E5=88=B6?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E4=BF=AE=E6=94=B9=E5=9F=BA=E6=9C=AC=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 10 +- .../collection-tools.component.ts | 25 ++++- .../examinationQuestions.html | 33 +++++++ .../collection-tools/examinationQuestions.ts | 93 +++++++++++++++++++ src/app/ui/collection-tools/saveOne.html | 6 +- .../ui/collection-tools/uploadQuestions.html | 45 +++++++++ src/app/ui/ui.module.ts | 3 +- 7 files changed, 204 insertions(+), 11 deletions(-) create mode 100644 src/app/ui/collection-tools/examinationQuestions.html create mode 100644 src/app/ui/collection-tools/examinationQuestions.ts create mode 100644 src/app/ui/collection-tools/uploadQuestions.html diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 59ff229..32493aa 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -1,13 +1,13 @@
    -
    富丽华大酒店
    -
    +
    {{examMsg.conpanyName}}
    +
    - - + + - +
    diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index e2b8397..af86678 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -16,6 +16,7 @@ import { delay } from 'rxjs/operators'; import { windows } from 'src/app/interface'; import { GameMode } from 'src/app/working-area/model/gameMode'; import { ActivatedRoute, Router } from '@angular/router'; +import { examinationQuestions,uploadQuestions } from './examinationQuestions' @@ -627,6 +628,11 @@ export class CollectionToolsComponent implements OnInit { isSixShow = true isSixbtn = true //控制想定作业编辑按钮 isxxx = true //控制查看编辑模式的编辑模式按钮 + examMsg = { //单位,考试信息 + conpanyName: '富丽华大酒店', //单位名称 + keynote: '', //考试要点 + grade: '', //分数 + } ngOnInit(): void { sessionStorage.setItem('companyId','5fa2512ef8eb762cb03c65fb') @@ -658,7 +664,8 @@ export class CollectionToolsComponent implements OnInit { ngAfterViewInit(): void { - this.getSitePlan() + this.getSitePlan() //获取总平面图/楼层 + // 监听canvas组件选中素材事件 this.canvas.on("select",obj=>{ //选中素材属性注入函数 @@ -1306,6 +1313,20 @@ export class CollectionToolsComponent implements OnInit { // }; } + //打开消防设施考题设定 + openFireExamination () { + let treeData = JSON.parse( JSON.stringify(this.dataSource.data) ) + let data = { treeData: treeData } + let dialogRef = this.dialog.open(examinationQuestions,{data}); + } + + //上传考题 + openUploadQuestions () { + let treeData = JSON.parse( JSON.stringify(this.dataSource.data) ) + let data = { treeData: treeData, question: JSON.parse( JSON.stringify(this.examMsg) ) } + let dialogRef = this.dialog.open(uploadQuestions,{data}); + } + //封装 刷新 tree 数据 async renovateTreeData (isRefresh:boolean = true) { this.allFireElements[this.allFireElements.length-1].children = [] @@ -1348,7 +1369,7 @@ export class CollectionToolsComponent implements OnInit { toggleExpandPanel:boolean = false; //左侧可展开面板展开或关闭 toggleExpandPanelRight:boolean = false; //右侧可展开面板展开或关闭 togglePlane:boolean = true; //可展开面板平面图 显隐 - toggleMaterialBank:boolean = false; //可展开面板素材库 显隐 + toggleMaterialBank:boolean = true; //可展开面板素材库 显隐 toggleHandlePlans:boolean = true; //可展开面板处置预案 显隐 //可展开面板展开或关闭 toggle () { diff --git a/src/app/ui/collection-tools/examinationQuestions.html b/src/app/ui/collection-tools/examinationQuestions.html new file mode 100644 index 0000000..aa5e6f3 --- /dev/null +++ b/src/app/ui/collection-tools/examinationQuestions.html @@ -0,0 +1,33 @@ +
    +
    消防设施考题设定
    +
    + + + + + + + {{node.name}} + + ({{node.children.length}}) + + + + + + + {{node.name}} + + ({{node.children.length}}) + + + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/ui/collection-tools/examinationQuestions.ts b/src/app/ui/collection-tools/examinationQuestions.ts new file mode 100644 index 0000000..d441b0b --- /dev/null +++ b/src/app/ui/collection-tools/examinationQuestions.ts @@ -0,0 +1,93 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import {CanvasShareDataService,DisposalNodeData} from '../../canvas-share-data.service' //引入服务 +import { FlatTreeControl } from '@angular/cdk/tree'; +import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; + +@Component({ + selector: 'dialog-examination-questions', + templateUrl: './examinationQuestions.html', + styleUrls: ['./collection-tools.component.scss',] +}) +export class examinationQuestions { + + constructor(private http:HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) {} + // tree配置 + private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数 + return { + expandable: !!node.children && node.children.length > 0, + name: node.name || node.Name, + level: level, + id: node.id || node.Id, + children:node.children, + isTemplate:node.isTemplate, + isNewElement:node.isNewElement, + isLook:node.isLook, + isLookPattern:node.isLookPattern || null + }; + } + treeControl = new FlatTreeControl(node => node.level, node => node.expandable); + treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); + dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); + hasChild = (_: number, node: any) => node.expandable; + + ngOnInit(): void { + this.dataSource.data = this.data.treeData + this.treeControl.expandAll() + } + +} + +@Component({ + selector: 'dialog-upload-questions', + templateUrl: './uploadQuestions.html', + styleUrls: ['./collection-tools.component.scss',] +}) +export class uploadQuestions { + + constructor(private http:HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) {} + // tree配置 + private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数 + return { + expandable: !!node.children && node.children.length > 0, + name: node.name || node.Name, + level: level, + id: node.id || node.Id, + children:node.children, + isTemplate:node.isTemplate, + isNewElement:node.isNewElement, + isLook:node.isLook, + isLookPattern:node.isLookPattern || null + }; + } + treeControl = new FlatTreeControl(node => node.level, node => node.expandable); + treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); + dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); + hasChild = (_: number, node: any) => node.expandable; + + ngOnInit(): void { + this.dataSource.data = this.data.treeData + this.treeControl.expandAll() + } + + //上传 + submit () { + if (this.data.question.grade && this.data.question.keynote) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('上传成功','确定',config); + this.dialogRef.close() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请填写必填项','确定',config); + } + } + +} \ No newline at end of file diff --git a/src/app/ui/collection-tools/saveOne.html b/src/app/ui/collection-tools/saveOne.html index a6b0b32..9017f65 100644 --- a/src/app/ui/collection-tools/saveOne.html +++ b/src/app/ui/collection-tools/saveOne.html @@ -1,5 +1,5 @@ -
    处置节点保存
    +
    处置节点保存
    - - + +
    \ No newline at end of file diff --git a/src/app/ui/collection-tools/uploadQuestions.html b/src/app/ui/collection-tools/uploadQuestions.html new file mode 100644 index 0000000..6e0988b --- /dev/null +++ b/src/app/ui/collection-tools/uploadQuestions.html @@ -0,0 +1,45 @@ +
    +
    上传
    +
    设置分数
    +
    + +
    +
    考试要点
    +
    + +
    +
    考核消防设施
    +
    + + + + + + + {{node.name}} + + ({{node.children.length}}) + + + + + + + {{node.name}} + + ({{node.children.length}}) + + + + + +
    +
    + + +
    +
    \ No newline at end of file diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index e0a90db..c2d4739 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -70,8 +70,9 @@ import {leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeCo import {saveOneDialog,saveTwoDialog} from './collection-tools/save' import {WorkingAreaComponent} from '../working-area/working-area.component' import { NzTreeModule } from 'ng-zorro-antd/tree'; +import { examinationQuestions,uploadQuestions } from './collection-tools/examinationQuestions' @NgModule({ - declarations: [FolderDialog,ViewDetails,ChangepasswordComponent,SizePipe,NamePipe,NamePipe2,NamePipe3,ConfirmpswDirective, AllFileComponent, ChangeuserdataComponent, UploadFilesComponent,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,TeacherManagementComponent,editTeacher,AddTeacher,seeTeacher, LearningRecordDetailsComponent, EhartsStatisticsComponent, CreateExamComponent, LookOverTestComponent, StatisticAnalysisComponent, JoinExamComponent, TestRecordsComponent,testState,CreateDialog,CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,saveOneDialog,saveTwoDialog,WorkingAreaComponent], + declarations: [FolderDialog,ViewDetails,ChangepasswordComponent,SizePipe,NamePipe,NamePipe2,NamePipe3,ConfirmpswDirective, AllFileComponent, ChangeuserdataComponent, UploadFilesComponent,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,TeacherManagementComponent,editTeacher,AddTeacher,seeTeacher, LearningRecordDetailsComponent, EhartsStatisticsComponent, CreateExamComponent, LookOverTestComponent, StatisticAnalysisComponent, JoinExamComponent, TestRecordsComponent,testState,CreateDialog,CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,saveOneDialog,saveTwoDialog,WorkingAreaComponent,examinationQuestions,uploadQuestions], imports: [ NzDatePickerModule,