Browse Source

[完善]格式代码

tangshan
邵佳豪 4 years ago
parent
commit
d833b7c98d
  1. 70
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 106
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  3. 80
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  4. 6
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  5. 2
      src/app/plan-management/plan-management.module.ts

70
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -88,14 +88,14 @@
<div class="content"> <div class="content">
<div class="realPictureItem" *ngFor="let item of allRealPicture"> <div class="realPictureItem" *ngFor="let item of allRealPicture">
<div class="realPictureTitle">{{item.name}}</div> <div class="realPictureTitle">{{item.name}}</div>
<div class="contentitem" <div class="contentitem" *ngFor="let i of item.realityImages">
*ngFor="let i of item.realityImages">
<div class="realPictureImgItem"> <div class="realPictureImgItem">
<img [src]="i.newImageUrl" alt=""> <img [src]="i.newImageUrl" alt="">
<div class="realPictureImgItemBtn realPictureImgItemBtn1"> <div class="realPictureImgItemBtn realPictureImgItemBtn1">
查看图片 查看图片
</div> </div>
<div class="realPictureImgItemBtn realPictureImgItemBtn2" (click)="addkeyImgItemLeft(i)"> <div class="realPictureImgItemBtn realPictureImgItemBtn2"
(click)="addkeyImgItemLeft(i)">
增加分组 增加分组
</div> </div>
</div> </div>
@ -223,47 +223,55 @@
<div class="boxBody" *ngFor="let element of item.attribute;let i=index"> <div class="boxBody" *ngFor="let element of item.attribute;let i=index">
<div class="boxBodyHead"> <div class="boxBodyHead">
<span>{{element.headName}}</span> <span>{{element.headName}}</span>
<img src="../../../assets/images/deleteblue.png" *ngIf="element.level==1" (click)='delTd(key,i)'> <img src="../../../assets/images/deleteblue.png" *ngIf="element.level==1"
<img src="../../../assets/images/add.png" *ngIf="element.level==1" (click)='addTd(key,i)'> (click)='delTd(key,i)'>
<img src="../../../assets/images/add.png" *ngIf="element.level==1"
(click)='addTd(key,i)'>
</div> </div>
<div class="body"> <div class="body">
<!--表格类型--> <!--表格类型-->
<table *ngIf="element.level==1"> <table *ngIf="element.level==1">
<thead> <thead>
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"><input type="text" <th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
placeholder="请输入内容" [(ngModel)]="element.tableth[tablethi]"></th> <input type="text" placeholder="请输入内容"
</thead> [(ngModel)]="element.tableth[tablethi]"></th>
<tbody> </thead>
<!-- <tr> <tbody>
<!-- <tr>
<td><input type="text"placeholder="请输入内容" ></td> <td><input type="text"placeholder="请输入内容" ></td>
<td><input type="text"placeholder="请输入内容" ></td> <td><input type="text"placeholder="请输入内容" ></td>
<td><input type="text"placeholder="请输入内容" ></td> <td><input type="text"placeholder="请输入内容" ></td>
</tr> --> </tr> -->
<tr *ngFor="let itemtr of element.tabletr"> <tr *ngFor="let itemtr of element.tabletr">
<td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn"> <td
<input type="text" placeholder="请输入" [(ngModel)]="itemtr.tabletd[tabletdi]"> *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn">
</td> <input type="text" placeholder="请输入"
</tr> [(ngModel)]="itemtr.tabletd[tabletdi]">
</tbody> </td>
</tr>
</tbody>
</table> </table>
<!--文本区域--> <!--文本区域-->
<textarea style="width: 99%;height: 100px;" *ngIf="element.level==3" [(ngModel)]="element.tableth"></textarea> <textarea style="width: 99%;height: 100px;" *ngIf="element.level==3"
[(ngModel)]="element.tableth"></textarea>
<!--输入框--> <!--输入框-->
<div class="inputtext" *ngIf="element.level==2"> <div class="inputtext" *ngIf="element.level==2">
<div class="inputj" style="height: 100%;width: 100%;" <div class="inputj" style="height: 100%;width: 100%;"
*ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"> *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<div style="height: 100%;width: 100%;" <div style="height: 100%;width: 100%;"
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn"> *ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容" style="background-color: #E8E9E9;width: 40%;" <input type="text" placeholder="请输入内容"
[(ngModel)]="itemthj.head"> style="background-color: #E8E9E9;width: 40%;"
<input type="text" placeholder="请输入内容" style="width: 60%;" [(ngModel)]="itemthj.body"> [(ngModel)]="itemthj.head">
<input type="text" placeholder="请输入内容" style="width: 60%;"
[(ngModel)]="itemthj.body">
</div>
</div>
</div>
<!--树形图-->
<div style="height: 300px;width: 100%;" *ngIf="element.level==4">
<tree-diagram [data]="element.tableth" [(ngModel)]="element.tableth"></tree-diagram>
</div> </div>
</div>
</div>
<!--树形图-->
<div style="height: 300px;width: 100%;" *ngIf="element.level==4">
<tree-diagram [data]="element.tableth" [(ngModel)]="element.tableth"></tree-diagram>
</div>
</div> </div>
</div> </div>
</div> </div>

106
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -1,5 +1,4 @@
* {
*{
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-user-select: none; -webkit-user-select: none;
-khtml-user-select: none; -khtml-user-select: none;
@ -7,7 +6,7 @@
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
scrollbar-width: none; /* Firefox */ scrollbar-width: none; /* Firefox */
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; /* Chrome Safari */ display: none; /* Chrome Safari */
} }
@ -81,34 +80,34 @@
top: 66px; top: 66px;
min-width: 268px; min-width: 268px;
overflow-y: auto; overflow-y: auto;
.leftKeyImg{ .leftKeyImg {
.keyImgTitle{ .keyImgTitle {
width: 100%; width: 100%;
height: 33px; height: 33px;
line-height: 33px; line-height: 33px;
text-align: center; text-align: center;
font-size: 15px; font-size: 15px;
color: #2196F3; color: #2196f3;
background: #e8f4fe; background: #e8f4fe;
} }
.planlist{ .planlist {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }
.content{ .content {
box-sizing: border-box; box-sizing: border-box;
padding: 15px; padding: 15px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
.realPictureItem{ .realPictureItem {
width: 100%; width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
} }
.realPictureTitle{ .realPictureTitle {
width: 100%; width: 100%;
font-size: 14px; font-size: 14px;
height: 33px; height: 33px;
@ -116,33 +115,33 @@
text-align: center; text-align: center;
margin-bottom: 5px; margin-bottom: 5px;
} }
.contentitem{ .contentitem {
margin-right: 15px; margin-right: 15px;
div{ div {
width: 100px; width: 100px;
height: 100px; height: 100px;
border-radius: 10px; border-radius: 10px;
border: 1px solid #2196F3; border: 1px solid #2196f3;
overflow: hidden; overflow: hidden;
img{ img {
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
} }
} }
p{ p {
text-align: center; text-align: center;
font-size: 13px; font-size: 13px;
margin: 5px 0; margin: 5px 0;
width: 100px; width: 100px;
} }
} }
.realPictureImgItem{ .realPictureImgItem {
position: relative; position: relative;
img{ img {
cursor: default!important; cursor: default !important;
} }
.realPictureImgItemBtn{ .realPictureImgItemBtn {
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
@ -157,22 +156,21 @@
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 12px;
} }
.realPictureImgItemBtn1{ .realPictureImgItemBtn1 {
top: 15px; top: 15px;
} }
.realPictureImgItemBtn2{ .realPictureImgItemBtn2 {
top: 55px; top: 55px;
} }
} }
.realPictureImgItem:hover{ .realPictureImgItem:hover {
// background: rgba(0,0,0,0.2); // background: rgba(0,0,0,0.2);
.realPictureImgItemBtn{ .realPictureImgItemBtn {
display: block; display: block;
} }
} }
} }
} }
} }
.mainbox { .mainbox {
background-color: white; background-color: white;
@ -231,38 +229,38 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: auto; overflow-y: auto;
.boxHead{ .boxHead {
height: 40px; height: 40px;
width: 100%; width: 100%;
background-color: #e8f4fe; background-color: #e8f4fe;
//opacity: 0.1; //opacity: 0.1;
span{ span {
margin-left: 20px; margin-left: 20px;
font-size: 16px; font-size: 16px;
color: #2196F3 ; color: #2196f3;
opacity:1; opacity: 1;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
} }
.boxBody{ .boxBody {
height: 100%; height: 100%;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.boxBodyHead{ .boxBodyHead {
width: 100%; width: 100%;
height: 40px; height: 40px;
background-color: #FFD91D; background-color: #ffd91d;
text-align: center; text-align: center;
span{ span {
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #B99A00; color: #b99a00;
} }
img{ img {
cursor: pointer; cursor: pointer;
width: 20px; width: 20px;
height: 20px; height: 20px;
@ -271,16 +269,16 @@
margin-right: 10px; margin-right: 10px;
} }
} }
.body{ .body {
width: 100%; width: 100%;
height: 100%; height: 100%;
thead{ thead {
width: 100%; width: 100%;
background-color: #E8E9E9; background-color: #e8e9e9;
} }
table { table {
width: 100%; width: 100%;
border-collapse:collapse; border-collapse: collapse;
//background-color: #E8E9E9; //background-color: #E8E9E9;
} }
th { th {
@ -290,7 +288,7 @@
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
input { input {
background-color: #E8E9E9; background-color: #e8e9e9;
text-align: center; text-align: center;
height: 100%; height: 100%;
width: 100%; width: 100%;
@ -299,13 +297,13 @@
outline: none; outline: none;
} }
} }
td{ td {
border: 1px solid #999; border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
input { input {
background-color: #FFFFFF; background-color: #ffffff;
text-align: center; text-align: center;
height: 100%; height: 100%;
width: 100%; width: 100%;
@ -343,7 +341,7 @@
border: 1px solid #e8e9e9; border: 1px solid #e8e9e9;
.keyImgTitle { .keyImgTitle {
height: 30px; height: 30px;
border-left: 1px solid #2196F3; border-left: 1px solid #2196f3;
position: relative; position: relative;
input { input {
width: 100%; width: 100%;
@ -354,28 +352,28 @@
box-sizing: border-box; box-sizing: border-box;
padding: 0 5px; padding: 0 5px;
} }
.deleteItem{ .deleteItem {
position: absolute; position: absolute;
right: 5px; right: 5px;
top: 3px; top: 3px;
cursor: pointer; cursor: pointer;
color: #292c2c; color: #292c2c;
} }
.deleteItem:hover{ .deleteItem:hover {
color: red; color: red;
} }
} }
.keyImgImg { .keyImgImg {
.imgbox{ .imgbox {
margin-top: 10px; margin-top: 10px;
text-align: center; text-align: center;
position: relative; position: relative;
img{ img {
max-width: 100%; max-width: 100%;
width: auto; width: auto;
height: auto; height: auto;
} }
.deleteImg{ .deleteImg {
display: none; display: none;
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
@ -383,30 +381,30 @@
top: 0px; top: 0px;
} }
} }
.imgbox:hover{ .imgbox:hover {
.deleteImg{ .deleteImg {
display: block; display: block;
} }
} }
.uploadBtn{ .uploadBtn {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 50px 0; margin: 50px 0;
position: relative; position: relative;
input{ input {
width: 112px; width: 112px;
height: 36px; height: 36px;
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
opacity: 0; opacity: 0;
cursor: pointer; cursor: pointer;
} }
} }
} }
} }
.addkeyImgItem{ .addkeyImgItem {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 10px 0; margin: 10px 0;

80
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -31,27 +31,27 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.getTemplateData() this.getTemplateData()
this.getUnitData() this.getUnitData()
this.tree = { this.tree = {
json:this.treedate, json: this.treedate,
config: this.treeConfig config: this.treeConfig
}; };
}
//树形结构数据
treedate=[
{
"guid": "bc4c7a02-5379-4046-92be-12c67af4295a",
"displayName": "Elentrix",
"children": [
/* "85d412c2-ebc1-4d56-96c9-7da433ac9bb2",
"28aac445-83b1-464d-9695-a4157dab6eac" */
]
} }
//树形结构数据
] treedate = [
tree {
treeConfig = { "guid": "bc4c7a02-5379-4046-92be-12c67af4295a",
nodeWidth: 90, "displayName": "Elentrix",
nodeHeight: 60 "children": [
}; /* "85d412c2-ebc1-4d56-96c9-7da433ac9bb2",
"28aac445-83b1-464d-9695-a4157dab6eac" */
]
}
]
tree
treeConfig = {
nodeWidth: 90,
nodeHeight: 60
};
//获得单位信息 //获得单位信息
unitData: any unitData: any
@ -71,7 +71,7 @@ treeConfig = {
selectedItem: string = '封面' selectedItem: string = '封面'
clickTitleItem(item) { clickTitleItem(item) {
this.addNumber=-1 this.addNumber = -1
item == '封面' ? this.selectedItem = '封面' : this.selectedItem = item.groupName item == '封面' ? this.selectedItem = '封面' : this.selectedItem = item.groupName
if (this.selectedItem == '重点图示') { if (this.selectedItem == '重点图示') {
this.getAllBuildings() this.getAllBuildings()
@ -90,7 +90,7 @@ treeConfig = {
} }
}).subscribe((data: any) => { }).subscribe((data: any) => {
this.allRealPicture = data this.allRealPicture = data
this.getAllRealPicture().then(()=>{ this.getAllRealPicture().then(() => {
console.log('实景图', this.allRealPicture) console.log('实景图', this.allRealPicture)
}) })
}) })
@ -143,7 +143,7 @@ treeConfig = {
item.attribute.push({ name: '', imgArr: [] }) item.attribute.push({ name: '', imgArr: [] })
} }
//通过左侧实景图增加分组 //通过左侧实景图增加分组
addkeyImgItemLeft(i){ addkeyImgItemLeft(i) {
console.log(i) console.log(i)
} }
//重点图示删除指定分组 //重点图示删除指定分组
@ -234,43 +234,43 @@ treeConfig = {
}) })
} }
//input key值,一个字符焦点消失问题 //input key值,一个字符焦点消失问题
trackByFn(index){ trackByFn(index) {
return index return index
} }
//表格增加一行 //表格增加一行
addNumber=-1 addNumber = -1
addTd(key,i){ addTd(key, i) {
this.addNumber++ this.addNumber++
//this.planTemplateData[key].attribute[i].push({tabletr:[]}) //this.planTemplateData[key].attribute[i].push({tabletr:[]})
if(this.planTemplateData[key].attribute[i].tabletr==undefined){ if (this.planTemplateData[key].attribute[i].tabletr == undefined) {
this.planTemplateData[key].attribute[i].tabletr=[] this.planTemplateData[key].attribute[i].tabletr = []
} }
this.planTemplateData[key].attribute[i].tabletr.push({tabletd:[]}) this.planTemplateData[key].attribute[i].tabletr.push({ tabletd: [] })
for(var j=0;j<this.planTemplateData[key].attribute[i].tableth.length;j++){ for (var j = 0; j < this.planTemplateData[key].attribute[i].tableth.length; j++) {
if(this.planTemplateData[key].attribute[i].tabletr!=undefined){ if (this.planTemplateData[key].attribute[i].tabletr != undefined) {
this.planTemplateData[key].attribute[i].tabletr[this.planTemplateData[key].attribute[i].tabletr.length-1].tabletd.push('') this.planTemplateData[key].attribute[i].tabletr[this.planTemplateData[key].attribute[i].tabletr.length - 1].tabletd.push('')
} }
else{ else {
this.planTemplateData[key].attribute[i].tabletr[this.addNumber].tabletd.push('') this.planTemplateData[key].attribute[i].tabletr[this.addNumber].tabletd.push('')
} }
} }
console.log(this.planTemplateData) console.log(this.planTemplateData)
} }
//表格删除一行 //表格删除一行
delTd(key,i){ delTd(key, i) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
if(this.planTemplateData[key].attribute[i].tabletr!=undefined){ if (this.planTemplateData[key].attribute[i].tabletr != undefined) {
this.planTemplateData[key].attribute[i].tabletr.splice(this.planTemplateData[key].attribute[i].tabletr.length-1,1) this.planTemplateData[key].attribute[i].tabletr.splice(this.planTemplateData[key].attribute[i].tabletr.length - 1, 1)
this.addNumber-- this.addNumber--
if(this.planTemplateData[key].attribute[i].tabletr.length==0){ if (this.planTemplateData[key].attribute[i].tabletr.length == 0) {
this.addNumber=-1 this.addNumber = -1
} }
}else{ } else {
this.snackBar.open('请先增加一行!','确定',config); this.snackBar.open('请先增加一行!', '确定', config);
} }
} }
//分段上传 //分段上传

6
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -209,7 +209,7 @@ export class EntryPlanLookComponent implements OnInit {
if (e.attachmentUrls == null) { if (e.attachmentUrls == null) {
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}`) window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}`)
} }
else{ else {
let body = {}; let body = {};
let resetAudit = true let resetAudit = true
let headers = new HttpHeaders({ let headers = new HttpHeaders({
@ -1210,9 +1210,9 @@ export class ChangeName {
headers headers
}; };
let body = { let body = {
name:value.name name: value.name
} }
let body2d=JSON.stringify(value.name) let body2d = JSON.stringify(value.name)
if (this.data.element.planType == 1) {//如果是二维预案 if (this.data.element.planType == 1) {//如果是二维预案
this.http.put(`/api/PlanComponents2D/${this.data.element.id}`, body2d, options).subscribe(data => { this.http.put(`/api/PlanComponents2D/${this.data.element.id}`, body2d, options).subscribe(data => {
this.dialogRef.close("success"); this.dialogRef.close("success");

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

@ -72,7 +72,7 @@ import { TreeDiagramModule } from '../ui/ng-tree-diagram/src/ng-tree-diagram';
@NgModule({ @NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName, declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult, WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult,
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent,OpenPlanToolDialog], typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, OpenPlanToolDialog],
imports: [ imports: [
CommonModule, CommonModule,
PlanManagementRoutingModule, PlanManagementRoutingModule,

Loading…
Cancel
Save