-
diff --git a/src/app/ui/plan-template/plan-template.component.scss b/src/app/ui/plan-template/plan-template.component.scss
index f310b98..e5ab3c3 100644
--- a/src/app/ui/plan-template/plan-template.component.scss
+++ b/src/app/ui/plan-template/plan-template.component.scss
@@ -253,25 +253,46 @@
display: flex;
flex-direction: row;
.attackLeft {
- width: 70%;
+ width: 100%;
display: flex;
flex-direction: column;
.attackleftHead {
width: 100%;
- height: 40px;
+ height: 50px;
//background-color: #ffd91d;
background-color: #FFFBE8;
- opacity: 0.7;
- input {
- background-color: #FFFBE8;
- color: #B99A00;
- text-align: center;
+ display: flex;
+ .headName{
+ width: 80%;
height: 100%;
- width: 100%;
- font-size: 16px;
- border: none;
- outline: none;
+ input {
+ background-color: #FFFBE8;
+ color: #B99A00;
+ text-align: center;
+ height: 100%;
+ width: 100%;
+ font-size: 16px;
+ border: none;
+ outline: none;
+ }
+ }
+ .rightButton{
+ height: 100%;
+ width: 20%;
+ float: right;
+ cursor: pointer;
+ img{
+ line-height: 50px;
+ }
+ button{
+ font-size: 16px;
+ margin-top: 8px;
+ }
+ /* margin-top: 20px;
+ margin-right: 8%; */
+ //margin-left: 40%;
}
+
}
.attackleftTable {
width: 100%;
@@ -316,6 +337,7 @@
}
}
}
+
}
.attackRight {
width: 30%;
diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts
index b64a32d..9d2c261 100644
--- a/src/app/ui/plan-template/plan-template.component.ts
+++ b/src/app/ui/plan-template/plan-template.component.ts
@@ -227,6 +227,7 @@ export class PlanTemplateComponent implements OnInit {
}
//右侧新增分组点击事件
addGroupClick(){
+ var temp
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@@ -246,6 +247,19 @@ export class PlanTemplateComponent implements OnInit {
});
dialogRef.afterClosed().subscribe(result => {
console.log(result,this.newleftTabledata)
+ /* if(result.length>this.newleftTabledata[this.leftclicki].data.length){
+ this.newleftTabledata[this.leftclicki].data.forEach((item,i,value)=>{
+ result.forEach((element,ri,rval) => {
+ if(value[i].groupName==rval[ri].groupName){
+ console.log('000')
+ }
+ });
+ })
+
+ this.newleftTabledata[this.leftclicki].data.push(result)
+ } */
+ //this.newleftTabledata[this.leftclicki].data.push({groupName: '预案附件', completed: false})
+ console.log(result)
this.newleftTabledata.forEach((value,index,array)=>{
if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){
if(result!=undefined){
@@ -253,7 +267,8 @@ export class PlanTemplateComponent implements OnInit {
//添加分组名称
if(array[index].data==null||array[index].data.length==0){
array[index].data=result
- }else{
+ }
+ else{
array[index].data[i].completed=rarr[i].completed
}
@@ -265,8 +280,31 @@ export class PlanTemplateComponent implements OnInit {
})
});
}
- console.log(this.newleftTabledata)
+ }
+ //自定义新增分组
+ zdyaddGroup(){
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ if(this.unitName==undefined){
+ this.snackBar.open('请选择预案模板!','确定',config);
+ }else{
+ const dialogRef = this.dialog.open(zdyaddGroup, {//调用open方法打开对话框并且携带参数过去
+ width: '340px',
+ height:'200px',
+ disableClose:true,
+ data:this.newleftTabledata[this.leftclicki].data==null?null:this.newleftTabledata[this.leftclicki].data==0?null:this.newleftTabledata[this.leftclicki].data
+ });
+ dialogRef.afterClosed().subscribe(result => {
+ console.log(result)
+ if(result!=undefined){
+ this.newleftTabledata[this.leftclicki].data.push({groupName:result,completed: true,attribute:[],zdy:true})
+ }
+
+ });
+ }
+
}
//删除分组
deleteGroup(groupName){
@@ -275,7 +313,8 @@ export class PlanTemplateComponent implements OnInit {
if(isTrue){
this.group.forEach((element,index,array)=>{
if(array[index].groupName==groupName){
- this.group.splice(index,1)
+ //this.group.splice(index,1)
+ array[index].completed=false
}
})
}
@@ -283,7 +322,9 @@ export class PlanTemplateComponent implements OnInit {
}
//新增属性
groupName
- addAttribute(groupName){
+ ziint=0
+ addAttribute(zi,groupName){
+ this.ziint=zi
this.groupPanle=true
this.groupName=groupName
if(groupName=='单位概况'){
@@ -348,6 +389,26 @@ export class PlanTemplateComponent implements OnInit {
this.groupPanle=true
this.accordion.closeAll()
}
+ //自定义新增属性
+ zdyaddAttribute(){
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ const dialogRef = this.dialog.open(zdyaddattinf, {//调用open方法打开对话框并且携带参数过去
+ width: '340px',
+ height:'200px',
+ disableClose:true,
+ data:this.newleftTabledata[this.leftclicki].data==null?null:this.newleftTabledata[this.leftclicki].data==0?null:this.newleftTabledata[this.leftclicki].data
+ });
+ dialogRef.afterClosed().subscribe(result => {
+ console.log(result)
+ if(result!=undefined){
+ this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result,zdy:true,attinf:[]})
+ }
+ console.log(this.group)
+ });
+ this.accordion.closeAll()
+ }
//删除具体属性
delAttribute(groupName,surveyName){
let isTrue = confirm('您确定要删除吗')
@@ -356,7 +417,12 @@ export class PlanTemplateComponent implements OnInit {
if (array[index].groupName==groupName) {
array[index].attribute.forEach((element,i) => {
if(element.surveyName==surveyName){
- array[index].attribute[i].completed=false
+ if(array[index].attribute[i].zdy!=undefined){
+ array[index].attribute.splice(i,1)
+ }else{
+ array[index].attribute[i].completed=false
+ }
+
}
});
}
@@ -367,25 +433,61 @@ export class PlanTemplateComponent implements OnInit {
}
//新增属性信息
danweiInfTable=[]
- addAttInfo(surveyName){
- if(surveyName=='进攻通道'){
- if(this.group[0].attribute[4].attinf==undefined){
- this.group[0].attribute[4].attinf=[]
- this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true})
- }else{
- this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true})
+ 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})
+ }else{
+ this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true})
+ }
+ }
+ else{
+ const dialogRef = this.dialog.open(zdydisaster, {//调用open方法打开对话框并且携带参数过去
+ width: '340px',
+ height:'450px',
+ disableClose:true,
+ data:this.group
+ });
+ dialogRef.afterClosed().subscribe(result => {
+ console.log(result)
+ if(result!=undefined){
+ this.group[0].attribute.forEach((value,index,array)=>{
+ if(array[index].surveyName==surveyName){
+ if(array[index].attinf==undefined){
+ array[index].attinf=[]
+ array[index].attinf.push(result)
+ }else{
+ array[index].attinf.push(result)
+ }
+ if(result.level==2){
+ for(var i=0;i
{
- console.log(result)
+ //console.log(result)
if(result!=undefined){
this.newleftTabledata[this,this.leftclicki].data.forEach((value,index,array)=>{
if(value.groupName=='单位概况'){
@@ -456,14 +558,34 @@ export class PlanTemplateComponent implements OnInit {
}
//消防设施表格具体属性删除
- fileDel(i,f){
+ fileDel(suri,i,f){
let isTrue = confirm('您确定要删除该条信息吗')
if(isTrue){
- this.group[0].attribute[3].attinf[i].facilityItems[f].completed=false
+ this.group[0].attribute[suri].attinf[i].facilityItems[f].completed=false
+ }
+
+ }
+ //单位概况自定义新增表格数据
+ zdyattackAdd(suri,i,level){
+ /* this.group[0].attribute.forEach((value,index,array)=>{
+ if (array[index].groupName==name) {
+ if(level==1){
+ this.group[index].attribute[i].tableth.push('')
+ }else if(level==2){
+ this.group[index].attribute[i].tableth.push({head:'',body:''})
+ }
+ }
+ }) */
+ this.group[0].attribute[suri].attinf[i].tableth.push('')
+ }
+ //单位概况自定义删除一条数据
+ zdyDelDisaster(suri,attributei){
+ let isTrue = confirm('您确定要删除该条信息吗')
+ if(isTrue){
+ this.group[0].attribute[suri].attinf.splice(attributei,1)
}
}
- //进攻通道
//进攻通道,灾情设定及其他增加表格数据
attackAdd(name,i,level){
@@ -530,6 +652,243 @@ 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,
basicCategoryId:this.newleftTabledata[this.leftclicki].basicCategoryId,
@@ -537,7 +896,7 @@ export class PlanTemplateComponent implements OnInit {
planCategory:Number(this.newleftTabledata[this.leftclicki].planCategory),
data:JSON.stringify(this.newleftTabledata[this.leftclicki].data)
}
- console.log(`ary`, this.newleftTabledata, `key:`, this.leftclicki)
+ console.log(`ary`, this.newleftTabledata, `key:`, body)
if(this.newleftTabledata[this.leftclicki].id==undefined){
/* this.http.post("/api/PlanTemplate",this.newleftTabledata[this.leftclicki]).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
@@ -624,15 +983,14 @@ export class PlanTemplateComponent implements OnInit {
}
//第二层向上排序
zaiTop(zi,attributei){
+ console.log(zi,attributei)
var temp
if(attributei!=0){
for (let index = attributei-1; index >=0; index--) {
- if(this.group[zi].attribute[index].completed){
- temp=this.group[zi].attribute[index]
+ temp=this.group[zi].attribute[index]
this.group[zi].attribute[index]=this.group[zi].attribute[attributei]
this.group[zi].attribute[attributei]=temp
- return
- }
+ return
}
@@ -644,12 +1002,10 @@ export class PlanTemplateComponent implements OnInit {
var temp
if (attributei!=this.group[zi].attribute.length-1) {
for (let index = attributei+1; index < this.group[zi].attribute.length; index++) {
- if(this.group[zi].attribute[index].completed){
- temp=this.group[zi].attribute[index]
- this.group[zi].attribute[index]=this.group[zi].attribute[attributei]
- this.group[zi].attribute[attributei]=temp
- return
- }
+ temp=this.group[zi].attribute[index]
+ this.group[zi].attribute[index]=this.group[zi].attribute[attributei]
+ this.group[zi].attribute[attributei]=temp
+ return
}
@@ -720,6 +1076,158 @@ export class PlanTemplateComponent implements OnInit {
}
}
+ //单位概况自定义内容向上排序
+ adyTop(suri,attributei){
+ var temp
+ if(attributei!=0){
+ for (let index = attributei-1; index >=0; index--) {
+ if(this.group[0].attribute[suri].completed){
+ temp=this.group[0].attribute[suri].attinf[index]
+ this.group[0].attribute[suri].attinf[index]=this.group[0].attribute[suri].attinf[attributei]
+ this.group[0].attribute[suri].attinf[attributei]=temp
+ return
+ }
+
+ }
+
+ }
+ }
+ //自定义单位概况内容乡下排序
+ adyDown(suri,attributei){
+ var temp
+ if (attributei!=this.group[0].attribute[suri].attinf.length-1) {
+ for (let index = attributei+1; index < this.group[0].attribute[suri].attinf.length; index++) {
+ if(this.group[0].attribute[suri].completed){
+ temp=this.group[0].attribute[suri].attinf[index]
+ this.group[0].attribute[suri].attinf[index]=this.group[0].attribute[suri].attinf[attributei]
+ this.group[0].attribute[suri].attinf[attributei]=temp
+ return
+ }
+
+ }
+
+ }
+ }
+ ////修改多行文本,表格行列数量
+ updataHl(...num:number[]){
+ const dialogRef = this.dialog.open(updataHl, {//调用open方法打开对话框并且携带参数过去
+ width: '340px',
+ height:'350px',
+ disableClose:true,
+ data:JSON.parse(JSON.stringify(num.length<=2? this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]]:this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]]))
+ });
+ dialogRef.afterClosed().subscribe(result => {
+ if(result!=undefined){
+ if(num.length<=2){
+ //外层四种类型编辑行跟列
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].level==1){
+ //表格类型编辑列数
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr==undefined){
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr = []
+ }
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.length {
+ element.tabletd.push('')
+ });
+ }
+
+ }
+ }else{
+ //表格类型减少列数
+ for(let i=this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.length;i>result.lieNumber;i--){
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.splice(i-1,1)
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr!=undefined){
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr.forEach((element) => {
+ element.tabletd.splice(element.tabletd.length-1,1)
+ });
+ }
+ }
+ }
+ }else if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].level==2){
+ //多行文本编辑行列
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.lengthresult.hNumber;i--){
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.splice(i-1,1)
+ }
+ }
+
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.forEach((element,index,value) => {
+ if(value[index].lengthresult.lieNumber;a--){
+ value[index].splice(index-1,1)
+ }
+ }
+
+ });
+
+ }
+ }else if(num.length<=3){
+ //进攻通道跟单位概况自定义
+ //表格类型编辑列数
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].level==1||this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].level==undefined){
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.length {
+ element.tabletd.push('')
+ });
+ } */
+
+ }
+ }else{
+ //表格类型减少列数
+ for(let i=this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.length;i>result.lieNumber;i--){
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.splice(i-1,1)
+
+ }
+ }
+ }
+ else if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].level==2){
+ //多行文本编辑行列
+ if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.lengthresult.hNumber;i--){
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.splice(i-1,1)
+ }
+ }
+
+ this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.forEach((element,index,value) => {
+ if(value[index].lengthresult.lieNumber;a--){
+ value[index].splice(index-1,1)
+ }
+ }
+
+ });
+
+ }
+ }
+ console.log(this.newleftTabledata)
+ }
+
+ });
+ }
}
//新建预案
@Component({
@@ -930,6 +1438,35 @@ export class addGroup{
}
}
+//自定义新增分组
+@Component({
+ selector: 'zdyaddGroup',
+ templateUrl: './zdyaddgroup.html',
+ styleUrls: ['./addgroup.scss']
+})
+export class zdyaddGroup{
+ constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
+ ngOnInit(): void{
+ //console.log(this.data)
+ }
+ groupName
+ //取消按钮
+ close(){
+ this.dialogRef.close();
+ }
+ //确定提交
+ newGroup(){
+ console.log(this.groupName)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ if(this.groupName==''||this.groupName==undefined){
+ this.snackBar.open('请输入分组名称!','确定',config);
+ }else{
+ this.dialogRef.close(this.groupName);
+ }
+ }
+}
//单位概况新增弹窗
@Component({
selector: 'adddwsurvey',
@@ -947,10 +1484,11 @@ export class adddwsurvey{
]
ngOnInit(): void{
console.log(this.data)
+ this.data=JSON.parse(JSON.stringify(this.data))
this.data.forEach(element => {
if(element.groupName=='单位概况'&&element.attribute!=undefined){
- //this.addwsurvey=element.attribute
- element.attribute.forEach((datavalue,index,dataarr) => {
+ this.addwsurvey=element.attribute
+ /* element.attribute.forEach((datavalue,index,dataarr) => {
this.addwsurvey.forEach((value,i,arr)=>{
if(dataarr[index].surveyName==arr[i].surveyName){
if(dataarr[index].completed==true&&arr[i].completed==false){
@@ -958,9 +1496,10 @@ ngOnInit(): void{
}
}
})
- });
+ }); */
}
});
+ console.log(this.addwsurvey)
}
//取消按钮
close(){
@@ -971,6 +1510,35 @@ defineClick(){
this.dialogRef.close(this.addwsurvey)
}
}
+//单位概况自定义新增弹窗
+@Component({
+ selector: 'zdyaddattinf',
+ templateUrl: './zdyaddgroup.html',
+ styleUrls: ['./addgroup.scss']
+})
+export class zdyaddattinf{
+ constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
+ ngOnInit(): void{
+ //console.log(this.data)
+ }
+ groupName
+ //取消按钮
+ close(){
+ this.dialogRef.close();
+ }
+ //确定提交
+ newGroup(){
+ console.log(this.groupName)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ if(this.groupName==''||this.groupName==undefined){
+ this.snackBar.open('请输入属性名称!','确定',config);
+ }else{
+ this.dialogRef.close(this.groupName);
+ }
+ }
+}
//编辑单位概况单位基本信息属性信息弹窗
@Component({
selector: 'addattinf',
@@ -988,19 +1556,24 @@ export class addattinf{
{propertyName:'单位地址',completed:false,propertyType:0,value:'',olddata:''},
/* {propertyName:'单位照片',completed:false,propertyType:0,value:''} *///,default:'-',must:'是',danwei:'-'
]
-addAttinfBuild
+addAttinfBuild=[]
+buildnewDate=[]
addAttinfFile
+filenewDate=[]
facilityItems
ngOnInit(): void{
console.log(this.data)
this.getattinf()
}
//获取弹窗信息
-getattinf(){
+async getattinf(){
+ //this.data.newleftTabledata=JSON.parse(JSON.stringify(this.data.newleftTabledata))
+
if(this.data.facilityItems==undefined){
+ this.data.newleftTabledata=JSON.parse(JSON.stringify(this.data.newleftTabledata))
this.data.newleftTabledata[this.data.leftclicki].data.forEach(element => {
if(element.groupName=='单位概况'&&element.attribute!=undefined){
- element.attribute.forEach(value => {
+ element.attribute.forEach(async value => {
if(value.surveyName=='单位基本信息'&&value.attinf!=undefined){
//this.addAttinf=value.attinf
value.attinf.forEach((datavalue,index,dataarr) => {
@@ -1019,36 +1592,69 @@ getattinf(){
})
} */
else if(value.surveyName=='建筑信息'&&value.attinf==undefined){
+ this.addAttinfBuild=[]
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId
}
this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{
- this.addAttinfBuild=data[0].propertyInfos
+ data.forEach(buildDate => {
+ this.addAttinfBuild.push(...buildDate.propertyInfos)
+
+ });
this.addAttinfBuild.forEach(element => {
element.completed=false
element.olddata=element.propertyValue
});
- console.log(this.addAttinfBuild)
+ //console.log(this.addAttinfBuild)
})
}else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){
+ this.buildnewDate=[]
this.addAttinfBuild=value.attinf
+ this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild))
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId
}
- this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{
- this.addAttinfBuild=data[0].propertyInfos
- this.addAttinfBuild.forEach((element,ei,earr) => {
- value.attinf.forEach((elattinf,fi,farr) => {
- if(earr[ei].propertyName==farr[fi].propertyName){
- earr[ei].completed=farr[fi].completed
- }
-
+ let restlt=await new Promise((resolve) => {
+ this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{
+ data.forEach((buildDate,buildi,buildarr) => {
+ this.buildnewDate.push(...buildarr[buildi].propertyInfos)
+ resolve(data)
});
-
- element.olddata=element.propertyValue
- });
+ this.buildnewDate.forEach(element => {
+ element.completed=false
+ element.olddata=element.propertyValue
+ });
+ })
+ })
+ this.buildnewDate=JSON.parse(JSON.stringify(this.buildnewDate))
+ let temp=0
+ this.buildnewDate.forEach((buildval,buindi,buildarr)=>{
+ temp=0
+ this.addAttinfBuild.forEach((addval,addi,addarr)=>{
+ if(buildval.propertyName==addval.propertyName){
+ temp++
+ }
+ })
+ if(temp==0){
+ console.log(buildval)
+ this.addAttinfBuild.push(buildval)
+ }
+ })
+ this.addAttinfBuild.forEach((addval,addi,addarr)=>{
+ temp=0
+ this.buildnewDate.forEach((buildval,buindi,buildarr)=>{
+ if(buildarr[buindi].propertyName==addarr[addi].propertyName){
+ temp++
+ }
+ })
+ if(temp==0){
+ console.log(addarr[addi])
+ this.addAttinfBuild.splice(addi,1)
+ }
+ })
+ console.log(this.buildnewDate)
console.log(this.addAttinfBuild)
- })
+
}else if(value.surveyName=='消防设施'&&value.attinf==undefined){
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId
@@ -1063,13 +1669,56 @@ getattinf(){
console.log(this.addAttinfFile)
})
}else if(value.surveyName=='消防设施'&&value.attinf!=undefined){
+ this.filenewDate=[]
this.addAttinfFile=value.attinf
+ this.addAttinfFile=JSON.parse(JSON.stringify(this.addAttinfFile))
+ let paramsdata:any ={
+ categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId
+ }
+ let restlt=await new Promise((resolve) => {
+ this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{
+ data.forEach((buildDate,buildi,buildarr) => {
+ this.filenewDate.push(buildDate)
+ resolve(data)
+ });
+ this.filenewDate.forEach(element => {
+ element.completed=false
+ element.olddata=element.propertyValue
+ });
+ })
+ })
+ this.filenewDate=JSON.parse(JSON.stringify(this.filenewDate))
+ let temp=0
+ this.filenewDate.forEach((buildval,buindi,buildarr)=>{
+ temp=0
+ this.filenewDate.forEach((addval,addi,addarr)=>{
+ if(buildval.propertyName==addval.propertyName){
+ temp++
+ }
+ })
+ if(temp==0){
+ console.log(buildval)
+ this.filenewDate.push(buildval)
+ }
+ })
+ this.filenewDate.forEach((addval,addi,addarr)=>{
+ temp=0
+ this.filenewDate.forEach((buildval,buindi,buildarr)=>{
+ if(buildarr[buindi].propertyName==addarr[addi].propertyName){
+ temp++
+ }
+ })
+ if(temp==0){
+ console.log(addarr[addi])
+ this.filenewDate.splice(addi,1)
+ }
+ })
}
});
}
});
}else{
- this.facilityItems=this.data.facilityItems
+ this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems))
console.log(this.facilityItems)
/* this.facilityItems.forEach(element => {
element.completed=false
@@ -1087,7 +1736,56 @@ defineClick(){
this.addAttinfBuild:this.data.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems)
}
}
-
+//单位概况自定义新增四个分类
+@Component({
+ selector: 'zdydisaster',
+ templateUrl: './Disaster.html',
+ styleUrls: ['./addKeyname.scss']
+})
+export class zdydisaster{
+ constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
+ ngOnInit(): void{
+ console.log(this.data)
+ }
+ level//类型
+ headName//表头名称
+ lieNumber//列数
+ hNumber//行数
+ //取消按钮
+ close(){
+ this.dialogRef.close();
+ }
+ //确定按钮
+ newdisaster(){
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ if(this.level==undefined||this.level==''){
+ this.snackBar.open('请选择类型!','确定',config);
+ }else if((this.level!=2&&this.level!=1)&&(this.headName==undefined||this.headName=='')){
+ this.snackBar.open('请输入表头名称!','确定',config);
+ }else if(this.level==2&&(this.lieNumber==0||this.lieNumber==undefined) ){
+ this.snackBar.open('请输入列数!','确定',config);
+ }else if(this.level==2&&(this.lieNumber==0||this.lieNumber==undefined)){
+ this.snackBar.open('请输入行数!','确定',config);
+ }
+ else{
+ let tree={
+ json:[],
+ name: ''
+ }
+ let attrubute={
+ headName:this.headName,
+ level:this.level,
+ tableth:this.level==1||this.level==2?[]:this.level==3?'':tree,
+ lieNumber:this.lieNumber,
+ hNumber:this.hNumber
+ }
+ this.dialogRef.close(attrubute);
+ }
+
+ }
+}
//灾情设定弹窗
@Component({
selector: 'disaster',
@@ -1133,3 +1831,34 @@ export class disaster{
}
}
+//修改表格跟多行文本
+@Component({
+ selector: 'updataHl',
+ templateUrl: './updatal.html',
+ styleUrls: ['./addKeyname.scss']
+})
+export class updataHl{
+ constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
+ ngOnInit(): void{
+ JSON.parse(JSON.stringify(this.data))
+ this.level=this.data.level
+ console.log(this.data,this.level)
+ }
+ level//类型
+ headName=this.data.headName||this.data.head//表头名称
+ lieNumber=this.data.zdy!=undefined?0:this.data.lieNumber//最小列数
+ hNumber=this.data.zdy!=undefined?0:this.data.hNumber//行数
+ //取消按钮
+ close(){
+ this.dialogRef.close();
+ }
+ //确定按钮
+ 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
+ }
+ this.dialogRef.close(result);
+ }
+}
\ No newline at end of file
diff --git a/src/app/ui/plan-template/updatal.html b/src/app/ui/plan-template/updatal.html
new file mode 100644
index 0000000..5def8db
--- /dev/null
+++ b/src/app/ui/plan-template/updatal.html
@@ -0,0 +1,34 @@
+
+
+ 修改内容
+
+
+ 名称:
+
+ {{headName}}
+
+
+ 列数:
+
+
+
+
+
+ 列数:
+
+
+
+
+
+ 行数:
+
+
+
+
+
+ 确定
+ 取消
+
+
\ No newline at end of file
diff --git a/src/app/ui/plan-template/zdyaddgroup.html b/src/app/ui/plan-template/zdyaddgroup.html
new file mode 100644
index 0000000..bf7bcd5
--- /dev/null
+++ b/src/app/ui/plan-template/zdyaddgroup.html
@@ -0,0 +1,17 @@
+
+
+ 自定义新增
+
+
+
+ 确定
+ 取消
+
+
\ No newline at end of file
diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts
index 089dffd..b55b2a3 100644
--- a/src/app/ui/ui.module.ts
+++ b/src/app/ui/ui.module.ts
@@ -93,6 +93,10 @@ import { addattinf } from './plan-template/plan-template.component'
import { disaster } from './plan-template/plan-template.component'
import { BrowserModule } from '@angular/platform-browser';
import { TreeDiagramModule } from './ng-tree-diagram/src/ng-tree-diagram';
+import { zdyaddGroup } from './plan-template/plan-template.component'
+import { zdyaddattinf } from './plan-template/plan-template.component'
+import { zdydisaster } from './plan-template/plan-template.component'
+import { updataHl} from './plan-template/plan-template.component'
@NgModule({
declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,
@@ -104,7 +108,7 @@ import { TreeDiagramModule } from './ng-tree-diagram/src/ng-tree-diagram';
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, PlanTemplateComponent, addPlanname, upPlanname, addGroup, adddwsurvey, addattinf,disaster],
+ EditBuildingBuilding, leftFunctionalDomainBuildingComponent, editPlaneFigureBuildingComponent, Organization, PlanTemplateComponent, addPlanname, upPlanname, addGroup, adddwsurvey, addattinf,disaster,zdyaddGroup,zdyaddattinf,zdydisaster,updataHl],
imports: [
CommonModule,
diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts
index fd47146..51efe69 100644
--- a/src/app/working-area/model/axLegend.ts
+++ b/src/app/working-area/model/axLegend.ts
@@ -24,10 +24,10 @@ export class AxLegend extends AxShape {
super(assetData, workingArea);
this.angle = -this.workingArea.backgroundImage.angle;
this.name = this.assetData.Id;
- this.pivot.set(this.assetData.PivotX, this.assetData.PivotY);
+ this.pivot.set(this.assetData.PivotX == undefined ? 0 : this.assetData.PivotX, this.assetData.PivotY == undefined ? 0 : this.assetData.PivotY);
this.x = this.assetData.Point.x;
this.y = this.assetData.Point.y;
- this.scale.set(this.assetData.Scale);
+ this.scale.set(this.assetData.Scale == undefined ? 1 : this.assetData.Scale);
this.shapeMap = shapeMap;
this.createPoint();
this.refresh();
diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts
index de50e34..6f723ea 100644
--- a/src/app/working-area/working-area.component.ts
+++ b/src/app/working-area/working-area.component.ts
@@ -1239,7 +1239,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
RuleValue: '',
PhysicalUnit: '',
PropertyName: '列',
- PropertyType: '2',
+ PropertyType: 2,
PropertyValue: '2',
},
],
@@ -1274,6 +1274,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.emit('createIcon', axLegend);
} else {
const axLegend = new AxLegend(data, this, shapeMap);
+ axLegend.assetData.PropertyInfos[0].PropertyType = Number(axLegend.assetData.PropertyInfos[0].PropertyType);
axLegend.assetData.PropertyInfos[0].PropertyValue = String(axLegend.assetData.PropertyInfos[0].PropertyValue);
}
}
diff --git a/src/assets/images/addyello.png b/src/assets/images/addyello.png
new file mode 100644
index 0000000..dc78a14
Binary files /dev/null and b/src/assets/images/addyello.png differ
diff --git a/src/assets/images/delyello.png b/src/assets/images/delyello.png
new file mode 100644
index 0000000..2294fb1
Binary files /dev/null and b/src/assets/images/delyello.png differ
diff --git a/src/assets/images/downyello.png b/src/assets/images/downyello.png
new file mode 100644
index 0000000..01b0950
Binary files /dev/null and b/src/assets/images/downyello.png differ
diff --git a/src/assets/images/uoyello.png b/src/assets/images/uoyello.png
new file mode 100644
index 0000000..2d8ddfe
Binary files /dev/null and b/src/assets/images/uoyello.png differ
diff --git a/src/assets/images/updatabai.png b/src/assets/images/updatabai.png
new file mode 100644
index 0000000..f009270
Binary files /dev/null and b/src/assets/images/updatabai.png differ
diff --git a/src/assets/images/updateyello.png b/src/assets/images/updateyello.png
new file mode 100644
index 0000000..fc373e3
Binary files /dev/null and b/src/assets/images/updateyello.png differ