do not fill doleance step with empty fields #2311

This commit is contained in:
Bachir Soussi Chiadmi 2023-10-02 16:33:10 +02:00
parent 980ae6e5a1
commit 8d7bbe2b68

View File

@ -934,67 +934,73 @@ export default {
// l'enquete // l'enquete
// //
// camenbert // camenbert
let cam = new paper.Path({ if (doleance.lenquete) {
strokeColor: '#fff', let cam = new paper.Path({
strokeWidth: 2, strokeColor: '#fff',
fillColor: "rgba(255, 255, 255, 0.4)", strokeWidth: 2,
item_type: 'doleance_step', fillColor: "rgba(255, 255, 255, 0.4)",
item_id: `lenquete`, item_type: 'doleance_step',
did: doleance.id, item_id: `lenquete`,
field: 'lenquete', did: doleance.id,
field_index: null field: 'lenquete',
}); field_index: null
cam.add({x: this.pos.x , y: this.pos.y + dr}); });
cam.lineTo({x: this.pos.x, y: this.pos.y + r}); cam.add({x: this.pos.x , y: this.pos.y + dr});
cam.arcTo({x: this.pos.x - p, y: this.pos.y + o}, {x: this.pos.x - m, y: this.pos.y + m}); cam.lineTo({x: this.pos.x, y: this.pos.y + r});
cam.lineTo({x: this.pos.x - n, y: this.pos.y + n}); cam.arcTo({x: this.pos.x - p, y: this.pos.y + o}, {x: this.pos.x - m, y: this.pos.y + m});
cam.arcTo({x: this.pos.x - p_d, y: this.pos.y + o_d}, {x: this.pos.x , y: this.pos.y + dr}); cam.lineTo({x: this.pos.x - n, y: this.pos.y + n});
// texte cam.arcTo({x: this.pos.x - p_d, y: this.pos.y + o_d}, {x: this.pos.x , y: this.pos.y + dr});
// enquete.addChild(new paper.PointText({ // texte
// point: { // enquete.addChild(new paper.PointText({
// x:this.pos.x + Math.sin(22.5*(Math.PI/180)) * r*0.75, // point: {
// y:this.pos.y + Math.cos(22.5*(Math.PI/180)) * r*0.75 // x:this.pos.x + Math.sin(22.5*(Math.PI/180)) * r*0.75,
// }, // y:this.pos.y + Math.cos(22.5*(Math.PI/180)) * r*0.75
// content: doleance['lenquete'], // },
// fontSize: fontsize, // content: doleance['lenquete'],
// fillColor: '#fff', // fontSize: fontsize,
// justification: 'center', // fillColor: '#fff',
// locked: true // justification: 'center',
// })); // locked: true
g.addChild(cam); // }));
g.addChild(cam);
}
// //
// probleme_initial_resolu // probleme_initial_resolu
// //
// camenbert // camenbert
let rescam = new paper.Path({ if(doleance.probleme_initial_resolu === 0 || doleance.probleme_initial_resolu === 1){
strokeColor: '#fff', let rescam = new paper.Path({
strokeWidth: 2, strokeColor: '#fff',
fillColor: "rgba(255, 255, 255, 0.4)", strokeWidth: 2,
closed: true, fillColor: "rgba(255, 255, 255, 0.4)",
item_type: 'doleance_step', closed: true,
item_id: `probleme_initial_resolu`, item_type: 'doleance_step',
did: doleance.id, item_id: `probleme_initial_resolu`,
field: 'probleme_initial_resolu', did: doleance.id,
field_index: null field: 'probleme_initial_resolu',
}); field_index: null
rescam.add({x: this.pos.x + n, y: this.pos.y + n}); });
rescam.lineTo({x: this.pos.x + m , y: this.pos.y + m}); rescam.add({x: this.pos.x + n, y: this.pos.y + n});
rescam.arcTo({x: this.pos.x + p, y: this.pos.y + o}, {x: this.pos.x, y: this.pos.y + r}); rescam.lineTo({x: this.pos.x + m , y: this.pos.y + m});
rescam.lineTo({x: this.pos.x, y: this.pos.y + dr}); rescam.arcTo({x: this.pos.x + p, y: this.pos.y + o}, {x: this.pos.x, y: this.pos.y + r});
rescam.arcTo({x: this.pos.x + p_d, y: this.pos.y + o_d}, {x: this.pos.x + n, y: this.pos.y + n}); rescam.lineTo({x: this.pos.x, y: this.pos.y + dr});
// texte rescam.arcTo({x: this.pos.x + p_d, y: this.pos.y + o_d}, {x: this.pos.x + n, y: this.pos.y + n});
// resolution.addChild(new paper.PointText({ // texte
// point: { // resolution.addChild(new paper.PointText({
// x:this.pos.x - Math.sin(22.5*(Math.PI/180)) * r*0.75, // point: {
// y:this.pos.y + Math.cos(22.5*(Math.PI/180)) * r*0.75 // x:this.pos.x - Math.sin(22.5*(Math.PI/180)) * r*0.75,
// }, // y:this.pos.y + Math.cos(22.5*(Math.PI/180)) * r*0.75
// content: doleance['probleme_initial_resolu'] ? doleance['oui_nouvelle_situation'] : doleance['non_adresse_doleance'], // },
// fontSize: fontsize, // content: doleance['probleme_initial_resolu'] ? doleance['oui_nouvelle_situation'] : doleance['non_adresse_doleance'],
// fillColor: '#fff', // fontSize: fontsize,
// justification: 'center' // fillColor: '#fff',
// })); // justification: 'center'
g.addChild(rescam) // }));
g.addChild(rescam)
}
// //
// MULTIPLE FIELDS // MULTIPLE FIELDS
@ -1063,64 +1069,74 @@ export default {
// POINTS CARDINAUX // POINTS CARDINAUX
// leprobleme // leprobleme
g.addChild(new paper.Path.Circle({ if (doleance.leprobleme) {
center: [this.pos.x, this.pos.y + r], g.addChild(new paper.Path.Circle({
radius: 3 * this.scale, center: [this.pos.x, this.pos.y + r],
style: { radius: 3 * this.scale,
strokeColor: '#fff', style: {
strokeWidth: 2, strokeColor: '#fff',
fillColor: "rgba(255, 255, 255, 0.9)", strokeWidth: 2,
}, fillColor: "rgba(255, 255, 255, 0.9)",
item_type: 'doleance_step', },
item_id: `leprobleme`, item_type: 'doleance_step',
did: doleance.id, item_id: `leprobleme`,
field: 'leprobleme' did: doleance.id,
})); field: 'leprobleme'
}));
}
// adresse de la doleance // adresse de la doleance
g.addChild(new paper.Path.Circle({ if (doleance.entite_addresse_doleance || doleance.aqui_addresse_doleance || doleance.comment_ennonce_doleance) {
center: [this.pos.x - r, this.pos.y], g.addChild(new paper.Path.Circle({
radius: 3 * this.scale, center: [this.pos.x - r, this.pos.y],
style: { radius: 3 * this.scale,
strokeColor: '#fff', style: {
strokeWidth: 2, strokeColor: '#fff',
fillColor: "rgba(255, 255, 255, 0.9)", strokeWidth: 2,
}, fillColor: "rgba(255, 255, 255, 0.9)",
item_type: 'doleance_step', },
item_id: `adresse_de_la_doleance`, item_type: 'doleance_step',
did: doleance.id, item_id: `adresse_de_la_doleance`,
field: 'adresse_de_la_doleance' did: doleance.id,
})); field: 'adresse_de_la_doleance'
}));
}
// decision // decision
g.addChild(new paper.Path.Circle({ if (doleance.entites_decisionnaires || doleance.decision_formule) {
center: [this.pos.x, this.pos.y - r], g.addChild(new paper.Path.Circle({
radius: 3 * this.scale, center: [this.pos.x, this.pos.y - r],
style: { radius: 3 * this.scale,
strokeColor: '#fff', style: {
strokeWidth: 2, strokeColor: '#fff',
fillColor: "rgba(255, 255, 255, 0.9)", strokeWidth: 2,
}, fillColor: "rgba(255, 255, 255, 0.9)",
item_type: 'doleance_step', },
item_id: `decision`, item_type: 'doleance_step',
did: doleance.id, item_id: `decision`,
field: 'decision' did: doleance.id,
})); field: 'decision'
}));
}
// adresse_de_la_decision // adresse_de_la_decision
g.addChild(new paper.Path.Circle({ if (doleance.entite_adresse_application || doleance.aqui_adresse_decision || doleance.comment_formule_decision) {
center: [this.pos.x + r, this.pos.y], g.addChild(new paper.Path.Circle({
radius: 3 * this.scale, center: [this.pos.x + r, this.pos.y],
style: { radius: 3 * this.scale,
strokeColor: '#fff', style: {
strokeWidth: 2, strokeColor: '#fff',
fillColor: "rgba(255, 255, 255, 0.9)", strokeWidth: 2,
}, fillColor: "rgba(255, 255, 255, 0.9)",
item_type: 'doleance_step', },
item_id: `adresse_de_la_decision`, item_type: 'doleance_step',
did: doleance.id, item_id: `adresse_de_la_decision`,
field: 'adresse_de_la_decision' did: doleance.id,
})); field: 'adresse_de_la_decision'
}));
}
return g; return g;