Browse Source

[修改]三维预案放开删除限制

tangshan
陈敬瑜 3 years ago
parent
commit
b46c963ac4
  1. 25
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  2. 9
      src/app/plan-management/entry-plan-look/AddPlanone.html
  3. 2
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  4. 51
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  5. 275
      src/app/ui/plan-template/plan-template.component.ts

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

@ -550,10 +550,31 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planTemplateData: any
//获得模板信息
danweInfo={
//若选择自定义,默认三条信息
attribute:[
{
attinf:[
{completed: true,olddata: "",propertyName: "联系人",propertyType: 0,propertyValue: "",value: ""},
{completed: true,olddata: "",propertyName: "联系电话",propertyType: 0,propertyValue: "",value: ""},
{completed: true,olddata: "",propertyName: "单位地址",propertyType: 0,propertyValue: "",value: ""}
],
completed: true,
surveyName: "单位基本信息"
}
],
completed: true,
groupName: "单位概况"
}
getTemplateData() {
//console.log(this.planTemplateData)
console.log(this.planTemplateData)
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
console.log('预案内容', data)
/* if(this.route.snapshot.queryParams.haveNew==true){
this.planTemplateData=[]
this.planTemplateData.push(this.danweInfo)
} */
/* this.planTemplateData = JSON.parse(data.webTextData).filter(item =>
item.completed == true
) */
@ -619,7 +640,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.clickTitleItem(this.planTemplateData[1])
}
});
if(this.planLevel=='4'){
if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){
this.planTemplateData.push({completed: true,groupName: '新建'})
}
this.planTemplateData.forEach(element => {

9
src/app/plan-management/entry-plan-look/AddPlanone.html

@ -62,9 +62,13 @@
<span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span>
</div>
<div *ngIf="inputword">
<mat-radio-button value="2" style="margin-right: 10px;">在线编制</mat-radio-button>
<button mat-raised-button *ngIf="isinput" (click)='createWord()'>在线编制预案</button>
<mat-radio-button value="2" style="margin-right: 10px;">模板在线编制</mat-radio-button>
<!-- <button mat-raised-button *ngIf="isinput" (click)='createWord()'>在线编制预案</button> -->
</div>
<div *ngIf="inputNew">
<mat-radio-button value="4" style="margin-right: 10px;">自定义在线编制</mat-radio-button>
</div>
<!-- <div *ngIf="inputword">
<mat-radio-button value="1" style="margin-right: 10px;">导入word文档</mat-radio-button>
<input type="file" name="" id="" *ngIf="isinput" (change)="fileInput($event)">
@ -84,6 +88,7 @@
</div>
</mat-radio-group>
</div>
<!-- -->
<div class="progressBox" *ngIf="uploadisLoading">

2
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -90,7 +90,7 @@
<span (click)="lookPlan(element)" *ngIf="element.planType == 2 || element.planType == 16">查看</span>
<span (click)="readFile(element)"
[ngClass]="{'grey': element.planMode == '2' || element.planMode == '3'}">下载</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8||element.planType==2">删除</span>
<span (click)="auditResult(element)">审批结果</span>
<span (click)="submitAudit(element)"
*ngIf="element.auditStatus==8">提交审核</span>

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

@ -917,6 +917,7 @@ export class AddPlanone {
inputword: boolean = false //导入文档
onlineedit: boolean = false //在线编辑
website: boolean = false //网页地址
inputNew :boolean=false //自定义编辑
next(formdata) {
//console.log(formdata.value.firstCtrlthree)
//console.log(this.file)
@ -935,16 +936,26 @@ export class AddPlanone {
this.inputword = true
this.onlineedit = false
this.website = false
this.inputNew=false
}
if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {//&& formdata.value.firstCtrlthree != '4'
this.localup = true
this.inputword = true
this.inputNew=true
this.onlineedit = false
this.website = false
}
if (formdata.value.firstCtrltwo == '1') { //如果是2D预案
this.localup = true
this.inputword = false
this.onlineedit = true
this.website = true
this.inputNew=false
}
if (formdata.value.firstCtrltwo == '2' || formdata.value.firstCtrltwo == '4') {
this.localup = true
this.inputword = false
this.inputNew=false
this.onlineedit = false
this.website = true
this.pswShow = true
@ -972,7 +983,7 @@ export class AddPlanone {
//文本预案在线编制跳转
newleftTabledata
planData
createWord() {
createWord(haveNew) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -1008,12 +1019,12 @@ export class AddPlanone {
let open = this.newleftTabledata.filter((value, index, array) => {
return value.unitname == this.data.unitType && value.planCategory == this.selectedPLanLevel
})
if (open.length > 0) {
if(haveNew==true){
this.http.post('/api/PlanComponents', {
id: "",
name: this.selectedPLanName,
planType: Number(this.selectedPLanType),
planMode: Number(this.defaultisshow),
planMode: 2,
planLevel: PlanLevel,
planCategory: Number(this.selectedPLanLevel),
url: "",
@ -1026,11 +1037,34 @@ export class AddPlanone {
this.planData = plandata
this.dialogRef.close(plandata);
//console.log(plandata)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}`)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}`)
})
} else {
this.snackBar.open('请先创建模板!', '确定', config);
}else{
if (open.length > 0) {
this.http.post('/api/PlanComponents', {
id: "",
name: this.selectedPLanName,
planType: Number(this.selectedPLanType),
planMode: Number(this.defaultisshow),
planLevel: PlanLevel,
planCategory: Number(this.selectedPLanLevel),
url: "",
//attachmentUrls: [`${this.objectName}`]
}, {
params: {
companyId: this.data.companyId
}
}).subscribe(plandata => {
this.planData = plandata
this.dialogRef.close(plandata);
//console.log(plandata)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}`)
})
} else {
this.snackBar.open('请先创建模板!', '确定', config);
}
}
})
@ -1087,7 +1121,10 @@ export class AddPlanone {
config.verticalPosition = 'top';
config.duration = 3000
//this.snackBar.open('暂不支持导入','确定',config);
this.createWord()
this.createWord(false)
}
if(this.defaultisshow == '4'){
this.createWord(true)
}
if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址
const config = new MatSnackBarConfig();

275
src/app/ui/plan-template/plan-template.component.ts

@ -29,10 +29,6 @@ export class PlanTemplateComponent implements OnInit {
ngOnInit(): void {
this.getLeftdata()
this.tree = {
json:this.treedate,
config: this.treeConfig
};
}
groupPanle=true//分组展开
attPanle=true
@ -41,23 +37,7 @@ export class PlanTemplateComponent implements OnInit {
/* {planCategory:3,basicCategoryId:"5e7c49e861550e2754d461ce",buildingTypeId: "5e7c8ffba3050b1a840ed4b6",unitname:'',data:[]},
{planCategory:5,basicCategoryId:"60127efe2757e904e5721d83",buildingTypeId: "5e7c9018a3050b1a840ed4b7",unitname:'地下建筑',data:[]} */
]
//树形结构数据
treedate=[
{
"guid": "bc4c7a02-5379-4046-92be-12c67af4295a",
"displayName": "Elentrix",
"children": [
/* "85d412c2-ebc1-4d56-96c9-7da433ac9bb2",
"28aac445-83b1-464d-9695-a4157dab6eac" */
]
}
]
tree
treeConfig = {
nodeWidth: 90,
nodeHeight: 60
};
group=[]
getLeftdata(){
this.http.get("/api/PlanTemplate").subscribe((data:any)=>{
@ -435,6 +415,7 @@ export class PlanTemplateComponent implements OnInit {
addAttInfo(surveyName,suri){
if(surveyName!='单位基本信息'&&surveyName!='建筑信息'&&surveyName!='四周毗邻'&&surveyName!='消防设施'&&surveyName!='重点部位'&&surveyName!='功能分区'){
if(surveyName=='进攻通道'){
//进攻通道只有表格
if(this.group[0].attribute[suri].attinf==undefined){
this.group[0].attribute[suri].attinf=[]
this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true})
@ -651,242 +632,6 @@ export class PlanTemplateComponent implements OnInit {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
let linshi=[
{
"attribute": [
{
"attinf": [
{
"value": "",
"olddata": "",
"completed": false,
"propertyName": "统一社会信用代码",
"propertyType": 0
},
{
"value": "",
"olddata": "",
"completed": false,
"propertyName": "单位类型",
"propertyType": 0
},
{
"value": "",
"olddata": "",
"completed": true,
"propertyName": "单位地址",
"propertyType": 0,
"analysisWord": {
"valueAxis": [ 1, 1 ],
"tableIndex": 0,
"valueField": "propertyValue"
}
},
{
"value": "",
"olddata": "",
"completed": true,
"propertyName": "联系人",
"propertyType": 0,
"analysisWord": {
"valueAxis": [ 1, 5 ],
"tableIndex": 0,
"valueField": "propertyValue"
}
},
{
"value": "",
"olddata": "",
"completed": false,
"propertyName": "辖区中队",
"propertyType": 0
},
{
"value": "",
"olddata": "",
"completed": true,
"propertyName": "联系电话",
"propertyType": 0,
"analysisWord": {
"valueAxis": [ 1, 5 ],
"tableIndex": 0,
"valueField": "propertyValue"
}
}
],
"completed": true,
"surveyName": "单位基本信息"
},
{
"completed": false,
"surveyName": "建筑信息"
},
{
"attinf": [
{
"name": "东",
"value": "",
"analysisWord": {
"valueAxis": [ 2, 2 ],
"tableIndex": 0,
"valueField": "value"
}
},
{
"name": "西",
"value": "",
"analysisWord": {
"valueAxis": [ 2, 4 ],
"tableIndex": 0,
"valueField": "value"
}
},
{
"name": "南",
"value": "",
"analysisWord": {
"valueAxis": [ 3, 2 ],
"tableIndex": 0,
"valueField": "value"
}
},
{
"name": "北",
"value": "",
"analysisWord": {
"valueAxis": [ 3, 4 ],
"tableIndex": 0,
"valueField": "value"
}
}
],
"completed": true,
"surveyName": "四周毗邻"
},
{
"completed": false,
"surveyName": "消防设施"
},
{
"completed": false,
"surveyName": "进攻通道"
},
{
"attinf": [
{
"body": [
{
"name": "重点部位名称",
"value": ""
},
{
"name": "重点部位所在位置",
"value": ""
},
{
"name": "建筑结构",
"value": ""
},
{
"name": "使用性质",
"value": ""
},
{
"name": "主要危险性",
"value": ""
}
],
"heafName": ""
}
],
"completed": false,
"surveyName": "重点部位"
},
{
"attinf": [
{
"name": "",
"value": ""
}
],
"completed": false,
"surveyName": "功能分区"
},
{
"zdy": true,
"attinf": [
{
"level": "3",
"tableth": "",
"headName": "备注详情",
"analysisWord": {
"valueAxis": [ 4, 1 ],
"tableIndex": 0,
"valueField": "tableth"
}
}
],
"completed": true,
"surveyName": "备注"
}
],
"completed": true,
"groupName": "单位概况"
},
{
"completed": false,
"groupName": "灾情设定"
},
{
"completed": false,
"groupName": "力量调集"
},
{
"completed": false,
"groupName": "组织指挥"
},
{
"completed": false,
"groupName": "作战行动"
},
{
"completed": false,
"groupName": "社会联动"
},
{
"completed": false,
"groupName": "勤务保障"
},
{
"completed": false,
"groupName": "特别警示"
},
{
"completed": false,
"groupName": "辅助决策"
},
{
"completed": true,
"groupName": "交通水源",
"manualWord": {
"valueAxis": [ 1, 6 ],
"KeyAxis": [ 0, 6 ],
"tableIndex": 0
}
},
{
"completed": true,
"groupName": "重点图示"
},
{
"completed": false,
"groupName": "处置要点"
},
{
"completed": false,
"groupName": "预案附件"
}
]
let body={
id:this.Id,
@ -1107,7 +852,7 @@ export class PlanTemplateComponent implements OnInit {
}
}
////修改多行文本,表格行列数量
//修改多行文本,表格行列数量
updataHl(...num:number[]){
const dialogRef = this.dialog.open(updataHl, {//调用open方法打开对话框并且携带参数过去
width: '340px',
@ -1257,6 +1002,7 @@ export class addPlanname{
close(){
this.dialogRef.close();
}
//确定按钮
newplan(){
this.unitname=document.getElementById('unit').innerText
const config = new MatSnackBarConfig();
@ -1403,17 +1149,7 @@ export class addGroup{
//复选框点击事件
clicki
checkClick(){
//this.clicki=i
//console.log(e,item)
/* if (e.checked) {
this.groupName.push(item)
}else {
this.groupName.forEach((value,index,array)=>{
if(value==item){
this.groupName.splice(index,1)
}
})
} */
console.log(this.data)
}
//确定提交
@ -1575,6 +1311,7 @@ export class zdyaddattinf{
if(item.surveyName==this.groupName){
this.newGroups=false
this.snackBar.open('您输入的内容跟编辑里面的内容重复,请点击编辑寻找!','确定',config);
//跳出foreach循环
throw Error();
}else{
this.newGroups=true

Loading…
Cancel
Save