Skip to content

Commit b7151a4

Browse files
committed
1 parent 8c37258 commit b7151a4

File tree

2 files changed

+47
-25
lines changed

2 files changed

+47
-25
lines changed

projects/budgetkey/src/app/item/items/item-soproc/item-social-service-gov-unit/charts.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ export const chartTemplates: any[] = [
388388
kind: 'org',
389389
data: (items: any[], info: any, xValues: any[]) => {
390390
const kinds = items.map((x) => x.supplier_kinds).filter((item, i, ar) => ar.indexOf(item) === i).sort();
391-
return ['מגזר שלישי', 'עסקי', 'משולב', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
391+
return ['משולב', 'מגזר שלישי', 'עסקי', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
392392
return {
393393
type: 'bar',
394394
name: kind,
@@ -432,7 +432,7 @@ export const chartTemplates: any[] = [
432432
kind: 'org',
433433
data: (items: any[], info: any, xValues: any[]) => {
434434
const kinds = items.map((x) => x.supplier_kinds).filter((item, i, ar) => ar.indexOf(item) === i).sort();
435-
return ['מגזר שלישי', 'עסקי', 'משולב', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
435+
return ['משולב', 'מגזר שלישי', 'עסקי', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
436436
return {
437437
type: 'bar',
438438
hovertemplate: '₪%{text}',
@@ -682,7 +682,7 @@ export const chartTemplates: any[] = [
682682
from s
683683
where t->>'active' = 'yes'
684684
group by 1,2
685-
ORDER BY 1`,
685+
ORDER BY 3 desc`,
686686
title: 'מספר הליכי רכש לפי סוג הליך',
687687
titleTooltip: 'מספר מספר הליכי רכש לפי סוג ההליך - מרכזי, משרדי, התקשרות בפטור וכו׳',
688688
x_field: 'office',
@@ -704,7 +704,7 @@ export const chartTemplates: any[] = [
704704
},
705705
kind: 'org',
706706
data: (items: any[], info: any, xValues: any[]) => {
707-
const kinds = items.map((x) => x.tender_type_he).filter((item, i, ar) => ar.indexOf(item) === i).sort();
707+
const kinds = items.map((x) => x.tender_type_he).filter((item, i, ar) => ar.indexOf(item) === i);//.sort();
708708
return kinds.filter(k => kinds.indexOf(k) > -1).map((kind) => {
709709
return {
710710
type: 'bar',
@@ -728,7 +728,7 @@ export const chartTemplates: any[] = [
728728
where t->>'tender_type' = 'exemptions'
729729
and t->>'active' = 'yes'
730730
group by 1,2
731-
ORDER BY 1`,
731+
ORDER BY 3 desc`,
732732
title: 'מספר פטורים לפי סוג פטור',
733733
titleTooltip: 'מספר מספר הליכי פטור ממכרז לפי סוג תקנת הפטור',
734734
x_field: 'office',
@@ -750,9 +750,9 @@ export const chartTemplates: any[] = [
750750
},
751751
kind: 'org',
752752
data: (items: any[], info: any, xValues: any[]) => {
753-
const kinds = items.map((x) => x.sub_kind_he).filter((item, i, ar) => ar.indexOf(item) === i).sort();
754-
const ordered = ['אחר', 'מכרז סגור', 'התקשרות עם רשות מקומית', 'מיזם משותף', 'התקשרות המשך', 'ספק יחיד', 'מימוש אופציה']
755-
return ordered.filter(k => kinds.indexOf(k) > -1).map((kind) => {
753+
const kinds = items.map((x) => x.sub_kind_he).filter((item, i, ar) => ar.indexOf(item) === i);//.sort();
754+
// const ordered = ['אחר', 'מכרז סגור', 'התקשרות עם רשות מקומית', 'מיזם משותף', 'התקשרות המשך', 'ספק יחיד', 'מימוש אופציה']
755+
return kinds.filter(k => kinds.indexOf(k) > -1).map((kind) => {
756756
return {
757757
type: 'bar',
758758
name: kind,

projects/budgetkey/src/app/item/items/item-soproc/item-social-service-gov-unit/item-social-service-gov-unit.component.ts

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,20 @@ export class ItemSocialServiceGovUnitComponent implements OnInit, AfterViewInit
3838
{title: 'מודל תמחור', id: 'pricing_model', tooltip: 'האם נקבע מראש תעריף לאספקת השירות או שעל המציעים להגיש הצעת מחיר או מודל משולב'},
3939
];
4040
COLORS = [
41-
'#9FD4AE',
42-
'#38B264',
43-
'#187388',
44-
'#8FD6E8',
45-
'#CC81AF',
46-
'#9D7EAF',
47-
'#643C6A',
48-
'#7285B7',
49-
'#B6AE86',
50-
'#CC8A57',
51-
'#444444'
41+
'#038CA4', // 0
42+
'#A1767A', // 1
43+
'#84353D', // 2
44+
'#DB6B58', // 3
45+
'#DB8258', // 4
46+
'#9ED4C4', // 5
47+
'#81A351', // 6
48+
'#1A4F40', // 7
49+
'#CA7898', // 8
50+
'#BE4C9C', // 9
51+
'#763483', // 10
52+
'#E4CF43', // 11
5253
];
54+
OTHER_COLOR_IDX = this.COLORS.length - 1;
5355

5456
public parameters: any = {
5557
pricing_model: [
@@ -200,17 +202,37 @@ export class ItemSocialServiceGovUnitComponent implements OnInit, AfterViewInit
200202
}
201203
}
202204
}
203-
const orgSizes = ['1', '2-5', '6+']
205+
const orgSizes = ['1', '2-5', '6+'];
206+
const orgSizesIdx = [8, 9, 10];
207+
for (const i in orgSizes) {
208+
scheme[orgSizes[i]] = orgSizesIdx[i];
209+
}
204210
const orgKinds = ['עסקי', 'מגזר שלישי', 'רשויות מקומיות', 'משולב'];
211+
const orgKindsIdx = [5, 0, 6, 7];
212+
for (const i in orgKinds) {
213+
scheme[orgKinds[i]] = orgKindsIdx[i];
214+
}
215+
const offices = ['משרד החינוך', 'משרד הרווחה', 'משרד הבריאות'];
216+
const officeIdx = [9, 6, 4];
217+
for (const i in offices) {
218+
scheme[offices[i]] = officeIdx[i];
219+
}
205220
const exemptionKinds = ['מימוש אופציה', 'ספק יחיד', 'התקשרות המשך', 'מיזם משותף', 'התקשרות עם רשות מקומית', 'מכרז סגור'];
221+
const exemptionKindsIdx = [5, 10, 1, 7, 9, 11];
222+
for (const i in exemptionKinds) {
223+
scheme[exemptionKinds[i]] = exemptionKindsIdx[i];
224+
}
206225
const tenderTypes = ['מכרז פומבי', 'התקשרות בפטור במכרז או בהליך תחרותי אחר', 'פרסום כוונה להתקשרות', 'פרסום מיזם ללא כוונת רווח', 'פניה לקבלת מידע RFI', 'קול קורא להקמת/עדכון רשימת מציעים (מאגר'];
226+
const tenderTypesIdx = [2, 3, 5, 8, 1, 11];
227+
for (const i in tenderTypes) {
228+
scheme[tenderTypes[i]] = tenderTypesIdx[i];
229+
}
207230
const model = ['מחיר קבוע (תעריף)', 'הצעת מחיר'];
208-
for (const l of [orgSizes, orgKinds, exemptionKinds, tenderTypes, model]) {
209-
for (const i in l) {
210-
scheme[l[i]] = parseInt(i) + 4;
211-
}
231+
const modelIdx = [2, 5];
232+
for (const i in model) {
233+
scheme[model[i]] = modelIdx[i];
212234
}
213-
scheme['אחר'] = 10;
235+
scheme['אחר'] = this.OTHER_COLOR_IDX;
214236
this.colorscheme.next(scheme);
215237
this.colorscheme.complete();
216238
});

0 commit comments

Comments
 (0)