Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Dec 19, 2024
1 parent 8c37258 commit b7151a4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export const chartTemplates: any[] = [
kind: 'org',
data: (items: any[], info: any, xValues: any[]) => {
const kinds = items.map((x) => x.supplier_kinds).filter((item, i, ar) => ar.indexOf(item) === i).sort();
return ['מגזר שלישי', 'עסקי', 'משולב', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
return ['משולב', 'מגזר שלישי', 'עסקי', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
return {
type: 'bar',
name: kind,
Expand Down Expand Up @@ -432,7 +432,7 @@ export const chartTemplates: any[] = [
kind: 'org',
data: (items: any[], info: any, xValues: any[]) => {
const kinds = items.map((x) => x.supplier_kinds).filter((item, i, ar) => ar.indexOf(item) === i).sort();
return ['מגזר שלישי', 'עסקי', 'משולב', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
return ['משולב', 'מגזר שלישי', 'עסקי', 'אחר'].filter(k => kinds.indexOf(k) > -1).map((kind) => {
return {
type: 'bar',
hovertemplate: '₪%{text}',
Expand Down Expand Up @@ -682,7 +682,7 @@ export const chartTemplates: any[] = [
from s
where t->>'active' = 'yes'
group by 1,2
ORDER BY 1`,
ORDER BY 3 desc`,
title: 'מספר הליכי רכש לפי סוג הליך',
titleTooltip: 'מספר מספר הליכי רכש לפי סוג ההליך - מרכזי, משרדי, התקשרות בפטור וכו׳',
x_field: 'office',
Expand All @@ -704,7 +704,7 @@ export const chartTemplates: any[] = [
},
kind: 'org',
data: (items: any[], info: any, xValues: any[]) => {
const kinds = items.map((x) => x.tender_type_he).filter((item, i, ar) => ar.indexOf(item) === i).sort();
const kinds = items.map((x) => x.tender_type_he).filter((item, i, ar) => ar.indexOf(item) === i);//.sort();
return kinds.filter(k => kinds.indexOf(k) > -1).map((kind) => {
return {
type: 'bar',
Expand All @@ -728,7 +728,7 @@ export const chartTemplates: any[] = [
where t->>'tender_type' = 'exemptions'
and t->>'active' = 'yes'
group by 1,2
ORDER BY 1`,
ORDER BY 3 desc`,
title: 'מספר פטורים לפי סוג פטור',
titleTooltip: 'מספר מספר הליכי פטור ממכרז לפי סוג תקנת הפטור',
x_field: 'office',
Expand All @@ -750,9 +750,9 @@ export const chartTemplates: any[] = [
},
kind: 'org',
data: (items: any[], info: any, xValues: any[]) => {
const kinds = items.map((x) => x.sub_kind_he).filter((item, i, ar) => ar.indexOf(item) === i).sort();
const ordered = ['אחר', 'מכרז סגור', 'התקשרות עם רשות מקומית', 'מיזם משותף', 'התקשרות המשך', 'ספק יחיד', 'מימוש אופציה']
return ordered.filter(k => kinds.indexOf(k) > -1).map((kind) => {
const kinds = items.map((x) => x.sub_kind_he).filter((item, i, ar) => ar.indexOf(item) === i);//.sort();
// const ordered = ['אחר', 'מכרז סגור', 'התקשרות עם רשות מקומית', 'מיזם משותף', 'התקשרות המשך', 'ספק יחיד', 'מימוש אופציה']
return kinds.filter(k => kinds.indexOf(k) > -1).map((kind) => {
return {
type: 'bar',
name: kind,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ export class ItemSocialServiceGovUnitComponent implements OnInit, AfterViewInit
{title: 'מודל תמחור', id: 'pricing_model', tooltip: 'האם נקבע מראש תעריף לאספקת השירות או שעל המציעים להגיש הצעת מחיר או מודל משולב'},
];
COLORS = [
'#9FD4AE',
'#38B264',
'#187388',
'#8FD6E8',
'#CC81AF',
'#9D7EAF',
'#643C6A',
'#7285B7',
'#B6AE86',
'#CC8A57',
'#444444'
'#038CA4', // 0
'#A1767A', // 1
'#84353D', // 2
'#DB6B58', // 3
'#DB8258', // 4
'#9ED4C4', // 5
'#81A351', // 6
'#1A4F40', // 7
'#CA7898', // 8
'#BE4C9C', // 9
'#763483', // 10
'#E4CF43', // 11
];
OTHER_COLOR_IDX = this.COLORS.length - 1;

public parameters: any = {
pricing_model: [
Expand Down Expand Up @@ -200,17 +202,37 @@ export class ItemSocialServiceGovUnitComponent implements OnInit, AfterViewInit
}
}
}
const orgSizes = ['1', '2-5', '6+']
const orgSizes = ['1', '2-5', '6+'];
const orgSizesIdx = [8, 9, 10];
for (const i in orgSizes) {
scheme[orgSizes[i]] = orgSizesIdx[i];
}
const orgKinds = ['עסקי', 'מגזר שלישי', 'רשויות מקומיות', 'משולב'];
const orgKindsIdx = [5, 0, 6, 7];
for (const i in orgKinds) {
scheme[orgKinds[i]] = orgKindsIdx[i];
}
const offices = ['משרד החינוך', 'משרד הרווחה', 'משרד הבריאות'];
const officeIdx = [9, 6, 4];
for (const i in offices) {
scheme[offices[i]] = officeIdx[i];
}
const exemptionKinds = ['מימוש אופציה', 'ספק יחיד', 'התקשרות המשך', 'מיזם משותף', 'התקשרות עם רשות מקומית', 'מכרז סגור'];
const exemptionKindsIdx = [5, 10, 1, 7, 9, 11];
for (const i in exemptionKinds) {
scheme[exemptionKinds[i]] = exemptionKindsIdx[i];
}
const tenderTypes = ['מכרז פומבי', 'התקשרות בפטור במכרז או בהליך תחרותי אחר', 'פרסום כוונה להתקשרות', 'פרסום מיזם ללא כוונת רווח', 'פניה לקבלת מידע RFI', 'קול קורא להקמת/עדכון רשימת מציעים (מאגר'];
const tenderTypesIdx = [2, 3, 5, 8, 1, 11];
for (const i in tenderTypes) {
scheme[tenderTypes[i]] = tenderTypesIdx[i];
}
const model = ['מחיר קבוע (תעריף)', 'הצעת מחיר'];
for (const l of [orgSizes, orgKinds, exemptionKinds, tenderTypes, model]) {
for (const i in l) {
scheme[l[i]] = parseInt(i) + 4;
}
const modelIdx = [2, 5];
for (const i in model) {
scheme[model[i]] = modelIdx[i];
}
scheme['אחר'] = 10;
scheme['אחר'] = this.OTHER_COLOR_IDX;
this.colorscheme.next(scheme);
this.colorscheme.complete();
});
Expand Down

0 comments on commit b7151a4

Please sign in to comment.