+
diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss
index c7c80a4..8df231d 100644
--- a/src/app/ui/collection-tools/collection-tools.component.scss
+++ b/src/app/ui/collection-tools/collection-tools.component.scss
@@ -285,7 +285,7 @@
.smallinput{
display: block;
width: 19%;
- margin-left: 8px;
+ margin-left: 12px;
}
.textarea{
display: block;
@@ -390,7 +390,7 @@ div:focus {
width: 18px;
height: 18px;
vertical-align: middle;
- margin-left: 9px;
+ margin-left: 12px;
margin-right: 3px;
}
@@ -496,4 +496,33 @@ div:focus {
border-radius: 0px;
}
}
+}
+
+//人或车所属单位输入框
+.orInput{
+ position: relative;
+ .changeOr{
+ position: absolute;
+ right: 14px;
+ font-size: 12px;
+ bottom: 2px;
+ border-radius: 3px;
+ background: #279FFF;
+ color: white;
+ padding: 1px 4px;
+ cursor: pointer;
+ }
+}
+.orBox{
+ width: 500px;
+ height: 600px;
+ .treebox{
+ width: 100%;
+ height: 552px;
+ overflow-y: auto;
+ }
+ .selectedNode{
+ background-color: #6BC2FF;
+ color: #fff;
+ }
}
\ No newline at end of file
diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts
index 4c19b08..d5a1ca8 100644
--- a/src/app/ui/collection-tools/collection-tools.component.ts
+++ b/src/app/ui/collection-tools/collection-tools.component.ts
@@ -2,11 +2,11 @@ import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContaine
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 {leftFunctionalDomainComponent,editPlaneFigureComponent,editDisposalNodeComponent,addDisposalNodeComponent, addBGCDisposalNodeComponent} from './leftFunctionalDomain'
+import {leftFunctionalDomainComponent,editPlaneFigureComponent,editDisposalNodeComponent,addDisposalNodeComponent, addBGCDisposalNodeComponent} from './leftFunctionalDomain';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {FlatTreeControl} from '@angular/cdk/tree';
-import {WorkingAreaComponent} from '../../working-area/working-area.component'
-import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service' //引入服务
+import {WorkingAreaComponent} from '../../working-area/working-area.component';
+import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service'; //引入服务
import Viewer from 'viewerjs';
import Swiper from 'swiper';
import { saveOneDialog } from './save';
@@ -17,6 +17,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { MaskLayerService } from 'src/app/mask-layer.service';
import * as ObjectID from 'bson-objectid';
import { AxMessageSystem } from 'src/app/working-area/model/axMessageSystem';
+import { TreeService } from 'src/app/http-interceptors/tree.service';
@Component({
selector: 'app-collection-tools',
templateUrl: './collection-tools.component.html',
@@ -119,6 +120,12 @@ export class CollectionToolsComponent implements OnInit {
if(item.PropertyType == 4){//图片数值上线
this.imagesArrNum = item.PropertyValue
}
+ if(item.PropertyName == '所属单位'){
+ if(!item.PropertyValue){
+ item.PropertyValue = this.organizationName
+ item.Tag = this.organizationId
+ }
+ }
})
//如果存在图片则加载轮播图
@@ -147,9 +154,24 @@ export class CollectionToolsComponent implements OnInit {
this.isImgNumCss = false
}
}
- pattern:boolean = false//默认为基本信息编辑
-
+ //人或车选择所属单位
+ changeOr(){
+ let dialogRef = this.dialog.open(Organization);
+ dialogRef.afterClosed().subscribe(data=>{
+ if(data && data.name){
+ this.PropertyInfos.forEach(item => {
+ if(item.PropertyName == '所属单位'){
+ item.PropertyValue = data.name
+ item.Tag = data.id
+ }
+ })
+ }
+ });
+ }
+
+
+ pattern:boolean = false//默认为基本信息编辑
//基本信息编辑模式
baseInfo(){
if (!this.pattern) {
@@ -476,14 +498,6 @@ export class CollectionToolsComponent implements OnInit {
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
- //查看图片详情
- lookImg(){
- const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
- data: {imagesArr:this.imagesArr,index:this.clickedIndex}
- });
- dialogRef.afterClosed().subscribe(data=>{ });
- }
-
//上传素材图片
selectFile(e){
let imgFile = e.target.files[0] || null //上传的文件
@@ -639,11 +653,11 @@ export class CollectionToolsComponent implements OnInit {
}//多个素材共同属性
multipleAssetData:any//当前多选的素材
firstMultipleAssetData:any//当前多选的第一个素材
+ organizationName:any = this.route.snapshot.queryParams.orName//当前预案单位所属机构名称
+ organizationId:any = this.route.snapshot.queryParams.orId//当前预案单位所属机构名称
ngOnInit(): void {
-
this.canvasData.isInheritSky = { weather:'', airTemperature:'', windDirection:'', windScale:'', }; //缓存 节点 天气
AxMessageSystem.addListener('selectionChanged', ()=>{
-
if(this.canvas.selection.size() == 1){//如果是单选
this.isMultipleAsset = false
// console.log('单选',this.canvas.selection.first().assetData)
@@ -2635,50 +2649,47 @@ export class EditBuilding {
}
}
-//查看图片大图
+//选择所属单位
@Component({
- selector: 'viewdetails',
- templateUrl: './viewdetails.html',
+ selector: 'app-organization',
+ templateUrl: './changeOr.html',
styleUrls: ['./collection-tools.component.scss']
})
-export class ViewDetails {
- // myControl = new FormControl();
- //注入MatDialogRef,可以用来关闭对话框
- //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
- constructor(private http: HttpClient,public dialogRef: MatDialogRef
,@Inject(MAT_DIALOG_DATA) public data,private element: ElementRef) {}
- imagesArr = this.data.imagesArr
- onNoClick(): void {
- this.dialogRef.close();
+export class Organization {
+
+ constructor(private tree:TreeService,private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { }
+
+ private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
+ return {
+ expandable: !!node.children && node.children.length > 0,
+ name: node.name,
+ level: level,
+ id: node.id,
+ };
}
+ 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 {
- setTimeout(() => {
- var mySwiper = new Swiper('.swiper-container',{
- loop: false,
- initialSlide :this.data.index,//默认索引
- // 如果需要前进后退按钮
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- }
- //其他设置
- });
- }, 0);
- }
- closeDialog(){
- this.dialogRef.close();
+ this.getAllOrganization()
+ }
+ selectedNodeId:any
+ selectedNodeName:any
+ selectedNode(node){
+ this.selectedNodeId = node.id
+ this.selectedNodeName = node.name
+ }
+ getAllOrganization(){
+ this.http.get('/api/Organizations').subscribe(data => {
+ this.dataSource.data = this.tree.toTree(data);
+ this.treeControl.expand(this.treeControl.dataNodes[0]);
+ })
}
- count = 10
- zoomimg(e) {
- if(this.count != 1 || e.wheelDelta >= 120){
- if(e.wheelDelta >= 120){
- this.count++
- }else{
- this.count--
- }
- }
- e.srcElement.style.zoom = this.count + '0%'
- e.srcElement.style.maxWidth = null
- e.srcElement.style.maxHeight = null
+ ok(){
+ this.dialogRef.close({
+ id:this.selectedNodeId,
+ name:this.selectedNodeName
+ })
}
-
-}
+}
\ No newline at end of file
diff --git a/src/app/ui/collection-tools/viewdetails.html b/src/app/ui/collection-tools/viewdetails.html
deleted file mode 100644
index 76638c2..0000000
--- a/src/app/ui/collection-tools/viewdetails.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- clear
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts
index c3c5fcd..81d6c1c 100644
--- a/src/app/ui/ui.module.ts
+++ b/src/app/ui/ui.module.ts
@@ -76,7 +76,7 @@ import { EditGroup } from './unit-information/editgroup.component';
import { EnterpriseuserComponent,seeenterpriseuser,editenterpriseuser } from './enterpriseuser/enterpriseuser.component';
import { AddEnterpriserUser } from './enterpriseuser/addenterpriseuser.component';
import { FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent } from './fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component';
-import { CollectionToolsComponent, CreateBuilding, EditBuilding, ViewDetails } from './collection-tools/collection-tools.component';
+import { CollectionToolsComponent, CreateBuilding, EditBuilding, Organization } from './collection-tools/collection-tools.component';
import { WorkingAreaComponent } from '../working-area/working-area.component';
import {leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,addBGCDisposalNodeComponent} from './collection-tools/leftFunctionalDomain'
import { saveOneDialog, saveTwoDialog } from './collection-tools/save';
@@ -85,7 +85,7 @@ import { editPlaneFigureComponentPlan, leftFunctionalDomainComponentPlan } from
import {CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding} from './collection-tools-building/collection-tools.component'
import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent} from './collection-tools-building/leftFunctionalDomain'
@NgModule({
- declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent],
+ declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,Organization],
imports: [
CommonModule,
diff --git a/src/styles.scss b/src/styles.scss
index 1c8dd97..91fa3f2 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -206,4 +206,9 @@ table td.mat-footer-cell:last-of-type{
.clusterImgCollection{
width:30px;
height:30px;
+}
+#unitBasicInfo{
+ .mat-expansion-indicator::after{
+ color: black;
+ }
}
\ No newline at end of file