Browse Source

[修改]预案在线编制自定义多行文本行数列数必填项

tangshan
陈敬瑜 3 years ago
parent
commit
6098a03825
  1. 4
      src/app/plan-management/create-plan-online-five/Disaster.html
  2. 12
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  3. 52
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  4. 6
      src/app/plan-management/create-plan-online-five/updatal.html
  5. 6
      src/app/ui/plan-template/updatal.html

4
src/app/plan-management/create-plan-online-five/Disaster.html

@ -30,13 +30,13 @@
<div class="queryField" *ngIf="level==2">
<label style="margin-right: 10px;">列数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="lieNumber" autocomplete="off" required min="1">
<input matInput type="number" [(ngModel)]="lieNumber" autocomplete="off" required min="1" placeholder="请输入列数" >
</mat-form-field>
</div>
<div class="queryField" *ngIf="level==2">
<label style="margin-right: 10px;">行数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="hNumber" autocomplete="off" required min="1">
<input matInput type="number" [(ngModel)]="hNumber" autocomplete="off" required min="1" placeholder="请输入行数" >
</mat-form-field>
</div>
<div class="bottom">

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

@ -822,16 +822,16 @@
</div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of element.attinf;let infoi=index">
<td style="border: 1px solid #999;
<th style="border: 1px solid #999;
height: 40px;
width: 40%;
width: 30%;
font-size: 16px;
text-align: center;" *ngIf="info.completed"><span>{{info.propertyName}}</span></td>
text-align: center;" *ngIf="info.completed"><span>{{info.propertyName}}</span></th>
<td style="border: 1px solid #999;
height: 40px;
width: 60%;
width: 70%;
font-size: 16px;
text-align: center;" *ngIf="info.completed"><span>{{info.propertyValue}}</span> </td>
text-align: center;"*ngIf="info.completed"><span>{{info.propertyValue}}</span> </td>
</tr>
</table>
</div>
@ -1156,7 +1156,7 @@
</div>
<div class="toolDiv" *ngIf="pattern == 'look'">
<button title="下载文档" mat-mini-fab color="primary" (click)="generatingDoc()">
<button *ngIf="xiazai==undefined" title="下载文档" mat-mini-fab color="primary" (click)="generatingDoc()">
<mat-icon>vertical_align_bottom</mat-icon>
</button>
<button title="返回顶部" mat-mini-fab color="primary" (click)="goBack()">

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

@ -61,9 +61,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
zaixianDr=false
haveNew=false
planMode//预案类型
xiazai//是否点击下载按钮进来的
//index
ngOnInit() {
//this.index = this.getArrayIndex(this.planTemplateData,'单位概况')
this.xiazai=this.route.snapshot.queryParams.xiazai
this.haveNew=this.route.snapshot.queryParams.haveNew
this.planMode=this.route.snapshot.queryParams.planMode
console.log(this.route.snapshot.queryParams.wordChange)
@ -82,7 +84,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
if(this.route.snapshot.queryParams.xiazai=='true'){
window.setTimeout(()=>{
this.generatingDoc()
},2500)
},3500)
}
}
@ -559,7 +561,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.http.get('/api/RealityImages', { params: data }).subscribe((data: any) => {
element.realityImages = data.items
element.realityImages.forEach(item => { //每张图片设置选中状态为false
item.newImageUrl = `/api/Objects/PlanPlatform/${item.imageUrl}?x-oss-process=image/resize,m_fill,h_100,w_100` //处理图片URL地址
item.newImageUrl = `/api/Objects/PlanPlatform/${item.imageUrl}` //处理图片URL地址?x-oss-process=image/resize,m_fill,h_100,w_100
item.nameStart = item.name.substring(0, item.name.lastIndexOf(".")); //图片名称前缀
item.nameEnd = item.name.substring(item.name.lastIndexOf("."), item.name.length); //图片名称后缀
resolve(data)
@ -1616,6 +1618,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
preview() {
this.pattern = 'look'
this.clickTitleItem('单位概况')
}
quitPreview() {
this.pattern = 'edit'
@ -1674,14 +1677,15 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData.forEach(element => {
if(element.groupName=='交通水源'||element.groupName=='重点图示'){
console.log(element.attribute[0].imgArr.length)
for(let i=0;i<element.attribute[0].imgArr.length;i++){
String(element.attribute[0].imgArr[i]) +'?x-image-process=image/format,png'
console.log(element.attribute[0].imgArr[i])
element.attribute[0].imgArr[i]= String(element.attribute[0].imgArr[i]) +'?x-image-process=image/format,jpg'
}
}
});
console.log(this.planTemplateData)
$(".mainbox").wordExport('word文档');
}
//原数据点击
@ -1822,7 +1826,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
if(value.groupName=='交通水源'||value.groupName=='重点图示'){
value.attribute.forEach(element => {
if(element.imgArr!=undefined&&element.imgArr.length>0){
element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length)+'?x-image-process=image/format,png'
element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length) //+'?x-image-process=image/format,png'
}
});
@ -2145,6 +2149,7 @@ export class disaster{
close(){
this.dialogRef.close();
}
//确定按钮
newdisaster(){
const config = new MatSnackBarConfig();
@ -2155,9 +2160,9 @@ export class disaster{
}else if(this.headName==undefined||this.headName==''){
this.snackBar.open('请输入表头名称!','确定',config);
}else if(this.level==2&& (this.lieNumber==undefined||this.lieNumber=='')){
this.snackBar.open('请输入列数!','确定',config);
this.snackBar.open('请输入列数,并且列数大于0!','确定',config);
}else if(this.level==2&& (this.hNumber==undefined||this.hNumber=='')){
this.snackBar.open('请输入行数!','确定',config);
this.snackBar.open('请输入行数,并且行数大于0!!','确定',config);
}
else{
let tree={
@ -2193,21 +2198,46 @@ export class updataHl{
}
level//类型
headName=this.data.headName//表头名称
lieNumber=this.data.zdy!=undefined?0:this.data.lieNumber//最小列数
hNumber=this.data.zdy!=undefined?0:this.data.hNumber//行数
lieNumber=this.data.tableth[0].length//最小列数
hNumber=this.data.tableth.length//行数
//取消按钮
close(){
this.dialogRef.close();
}
inputChange(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.level==2&& (this.lieNumber==undefined||this.lieNumber=='')){
this.snackBar.open('请输入列数,并且列数大于0!','确定',config);
}else if(this.level==2&& (this.hNumber==undefined||this.hNumber=='')){
this.snackBar.open('请输入行数,并且行数大于0!!','确定',config);
}
}
//确定按钮
newdisaster(){
console.log(this.data)
let result={
lieNumber:this.level==2? this.data.tableth[0].length:this.data.tableth.length,
hNumber:this.data.tableth.length
lieNumber:this.level==2? this.lieNumber:this.data.tableth.length,
hNumber:this.hNumber
}
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.level==undefined||this.level==''){
this.snackBar.open('请选择类型!','确定',config);
}else if(this.headName==undefined||this.headName==''){
this.snackBar.open('请输入表头名称!','确定',config);
}else if(this.level==2&& (this.lieNumber==undefined||this.lieNumber=='')){
this.snackBar.open('请输入列数,并且列数大于一!','确定',config);
}else if(this.level==2&& (this.hNumber==undefined||this.hNumber=='')){
this.snackBar.open('请输入行数,并且行数大于一!!','确定',config);
}else{
this.dialogRef.close(result);
}
}
}
//建筑跟消防设施添加模板数据
@Component({

6
src/app/plan-management/create-plan-online-five/updatal.html

@ -12,19 +12,19 @@
<div class="queryField" *ngIf="level==1">
<label style="margin-right: 10px;">列数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="data.tableth.length" autocomplete="off" required [min]="lieNumber">
<input matInput type="number" [(ngModel)]="data.tableth.length" autocomplete="off" required [min]="lieNumber" placeholder="请输入列数" >
</mat-form-field>
</div>
<div class="queryField" *ngIf="level==2">
<label style="margin-right: 10px;">列数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="data.tableth[0].length" autocomplete="off" required [min]="lieNumber">
<input matInput type="number" [(ngModel)]="lieNumber" autocomplete="off" required [min]="1" placeholder="请输入列数">
</mat-form-field>
</div>
<div class="queryField" *ngIf="level==2">
<label style="margin-right: 10px;">行数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="data.tableth.length" autocomplete="off" required [min]="hNumber">
<input matInput type="number" [(ngModel)]="hNumber" autocomplete="off" required [min]="1" placeholder="请输入行数">
</mat-form-field>
</div>
<div class="bottom">

6
src/app/ui/plan-template/updatal.html

@ -12,19 +12,19 @@
<div class="queryField" *ngIf="level==1||level==undefined">
<label style="margin-right: 10px;">列数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="data.tableth.length" autocomplete="off" required min="0" required>
<input matInput type="number" [(ngModel)]="data.tableth.length" autocomplete="off" required min="0" required placeholder="请输入列数" >
</mat-form-field>
</div>
<div class="queryField" *ngIf="level==2">
<label style="margin-right: 10px;">列数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="data.tableth[0].length" autocomplete="off" required min="1" required>
<input matInput type="number" [(ngModel)]="data.tableth[0].length" autocomplete="off" required min="1" required placeholder="请输入列数" >
</mat-form-field>
</div>
<div class="queryField" *ngIf="level==2">
<label style="margin-right: 10px;">行数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="data.tableth.length" autocomplete="off" required min="1" required>
<input matInput type="number" [(ngModel)]="data.tableth.length" autocomplete="off" required min="1" required placeholder="请输入行数" >
</mat-form-field>
</div>
<div class="bottom">

Loading…
Cancel
Save