Commit d17bf35c by Mac Stephens

update complaint list colors and headers, add new markers for dispatch categories, database update

parent f67b3596
...@@ -305,14 +305,27 @@ begin ...@@ -305,14 +305,27 @@ begin
while not Eof do while not Eof do
begin begin
var status: string; var status: string;
if not FieldByName('DATECLEARED').IsNull then var statusColor: string;
status := 'Cleared' var statusTextColor: string;
else if not FieldByName('DATEARRIVED').IsNull then
status := 'AtScene' if not FieldByName('DATEARRIVED').IsNull then
begin
status := 'On Scene';
statusColor := '#22C55E';
statusTextColor := '#000000';
end
else if not FieldByName('DATEDISPATCHED').IsNull then else if not FieldByName('DATEDISPATCHED').IsNull then
status := 'Dispatched' begin
status := 'Attached';
statusColor := '#FFFF00';
statusTextColor := '#000000';
end
else else
status := 'Pending'; begin
status := 'Not Attached';
statusColor := '#FF8080';
statusTextColor := '#000000';
end;
var item := TJSONObject.Create; var item := TJSONObject.Create;
...@@ -324,16 +337,11 @@ begin ...@@ -324,16 +337,11 @@ begin
item.AddPair('DistrictHeader', curAgency); item.AddPair('DistrictHeader', curAgency);
lastDistrict := curAgency; lastDistrict := curAgency;
item.AddPair('DistrictSector', 'Agency: ' + curAgency); item.AddPair('AgencyLine', 'Agency: ' + curAgency);
var colorVal := ApiDB.uqComplaintListPRIORITY_COLOR.AsInteger; var colorVal := ApiDB.uqComplaintListPRIORITY_COLOR.AsInteger;
item.AddPair('PriorityColor', '#' + IntToHex(colorVal and $FFFFFF, 6)); item.AddPair('PriorityColor', '#' + IntToHex(colorVal and $FFFFFF, 6));
if (colorVal and $FFFFFF) = $0000FF then
item.AddPair('PriorityTextColor', '#FFFFFF')
else
item.AddPair('PriorityTextColor', '#000000'); item.AddPair('PriorityTextColor', '#000000');
item.AddPair('ComplaintId', ApiDB.uqComplaintListCOMPLAINTID.AsString); item.AddPair('ComplaintId', ApiDB.uqComplaintListCOMPLAINTID.AsString);
item.AddPair('Complaint', ApiDB.uqComplaintListcomplaintNumber.AsString); item.AddPair('Complaint', ApiDB.uqComplaintListcomplaintNumber.AsString);
item.AddPair('Agency', ApiDB.uqComplaintListAGENCY.AsString); item.AddPair('Agency', ApiDB.uqComplaintListAGENCY.AsString);
...@@ -343,6 +351,8 @@ begin ...@@ -343,6 +351,8 @@ begin
item.AddPair('Business', ApiDB.uqComplaintListBUSINESS.AsString); item.AddPair('Business', ApiDB.uqComplaintListBUSINESS.AsString);
item.AddPair('CFSId', ApiDB.uqComplaintListCFSID.AsString); item.AddPair('CFSId', ApiDB.uqComplaintListCFSID.AsString);
item.AddPair('Status', status); item.AddPair('Status', status);
item.AddPair('StatusColor', statusColor);
item.AddPair('StatusTextColor', statusTextColor);
item.AddPair('DispatchDistrict', ApiDB.uqComplaintListDISPATCHDISTRICT.AsString); item.AddPair('DispatchDistrict', ApiDB.uqComplaintListDISPATCHDISTRICT.AsString);
item.AddPair('DateReported', ApiDB.uqComplaintListDATEREPORTED.AsString); item.AddPair('DateReported', ApiDB.uqComplaintListDATEREPORTED.AsString);
......
[Settings] [Settings]
LogFileNum=719 LogFileNum=722
webClientVersion=0.1.0 webClientVersion=0.1.0
[Database] [Database]
......
...@@ -44,20 +44,20 @@ object FViewComplaints: TFViewComplaints ...@@ -44,20 +44,20 @@ object FViewComplaints: TFViewComplaints
ItemTemplate = ItemTemplate =
'<div class="list-section-header small fw-semibold bg-secondary t' + '<div class="list-section-header small fw-semibold bg-secondary t' +
'ext-white rounded-1 px-2 mb-1">(%DistrictHeader%)</div><div clas' + 'ext-white rounded-1 px-2 mb-1">(%DistrictHeader%)</div><div clas' +
's="card border shadow-sm" style="--bs-card-bg:(%PriorityColor%);' + 's="card border shadow-sm" style="--bs-card-bg:(%StatusColor%);--' +
'--bs-card-color:(%PriorityTextColor%);"><div class="card-body py' + 'bs-card-color:(%StatusTextColor%);"><div class="card-body py-2 p' +
'-2 px-3 d-flex gap-2"><div class="flex-grow-1"><div class="fw-bo' + 'x-3 d-flex gap-2"><div class="flex-grow-1"><div class="fw-bold t' +
'ld text-uppercase small">(%Priority%): (%DispatchCodeDesc%)</div' + 'ext-uppercase small">(%Priority%): (%DispatchCodeDesc%)</div><di' +
'><div class="small">(%Address%)</div><div class="small d-none co' + 'v class="small">(%Address%)</div><div class="small d-none compla' +
'mplaint-business" data-business="(%Business%)">(%Business%)</div' + 'int-business" data-business="(%Business%)">(%Business%)</div><di' +
'><div class="small text-opacity-75">(%Complaint%): (%Status%)&nb' + 'v class="small text-opacity-75">(%Complaint%): (%Status%)&nbsp;&' +
'sp;&nbsp;(%DistrictSector%)</div><div class="small text-opacity-' + 'nbsp;(%AgencyLine%)</div><div class="small text-opacity-75">(%Da' +
'75">(%DateReported%)</div></div><div class="d-flex flex-column j' + 'teReported%)</div></div><div class="d-flex flex-column justify-c' +
'ustify-content-center gap-1"><button type="button" class="btn bt' + 'ontent-center gap-1"><button type="button" class="btn btn-primar' +
'n-primary btn-sm complaint-details-btn" data-id="(%ComplaintId%)' + 'y btn-sm complaint-details-btn" data-id="(%ComplaintId%)">Detail' +
'">Details</button><button type="button" class="btn btn-primary b' + 's</button><button type="button" class="btn btn-primary btn-sm bt' +
'tn-sm btn-complaint-map" data-id="(%ComplaintId%)">Map</button><' + 'n-complaint-map" data-id="(%ComplaintId%)">Map</button></div></d' +
'/div></div></div>' 'iv></div>'
ListSource = wdsComplaints ListSource = wdsComplaints
end end
object xdwcComplaints: TXDataWebClient object xdwcComplaints: TXDataWebClient
...@@ -111,8 +111,13 @@ object FViewComplaints: TFViewComplaints ...@@ -111,8 +111,13 @@ object FViewComplaints: TFViewComplaints
object xdwdsComplaintsPriorityTextColor: TStringField object xdwdsComplaintsPriorityTextColor: TStringField
FieldName = 'PriorityTextColor' FieldName = 'PriorityTextColor'
end end
object xdwdsComplaintsDistrictSector: TStringField object xdwdsComplaintsStatusTextColor: TStringField
FieldName = 'DistrictSector' FieldName = 'StatusTextColor'
Size = 80
end
object xdwdsComplaintsAgencyLine: TStringField
FieldName = 'AgencyLine'
Size = 80
end end
end end
object wdsComplaints: TWebDataSource object wdsComplaints: TWebDataSource
......
...@@ -30,8 +30,9 @@ type ...@@ -30,8 +30,9 @@ type
xdwdsComplaintsStatusColor: TStringField; xdwdsComplaintsStatusColor: TStringField;
xdwdsComplaintsPriorityColor: TStringField; xdwdsComplaintsPriorityColor: TStringField;
xdwdsComplaintsPriorityTextColor: TStringField; xdwdsComplaintsPriorityTextColor: TStringField;
xdwdsComplaintsDistrictSector: TStringField;
xdwdsComplaintsBusiness: TStringField; xdwdsComplaintsBusiness: TStringField;
xdwdsComplaintsStatusTextColor: TStringField;
xdwdsComplaintsAgencyLine: TStringField;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure WebFormDestroy(Sender: TObject); procedure WebFormDestroy(Sender: TObject);
private private
......
webEMIMobile/assets/markers/car_ems.png

1.49 KB | W: | H:

webEMIMobile/assets/markers/car_ems.png

763 Bytes | W: | H:

webEMIMobile/assets/markers/car_ems.png
webEMIMobile/assets/markers/car_ems.png
webEMIMobile/assets/markers/car_ems.png
webEMIMobile/assets/markers/car_ems.png
  • 2-up
  • Swipe
  • Onion skin
webEMIMobile/assets/markers/car_police.png

832 Bytes | W: | H:

webEMIMobile/assets/markers/car_police.png

837 Bytes | W: | H:

webEMIMobile/assets/markers/car_police.png
webEMIMobile/assets/markers/car_police.png
webEMIMobile/assets/markers/car_police.png
webEMIMobile/assets/markers/car_police.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -52,18 +52,18 @@ begin ...@@ -52,18 +52,18 @@ begin
function getUnitBadgeColor(iconUrl) { function getUnitBadgeColor(iconUrl) {
if (iconUrl && iconUrl.indexOf("car_fire") >= 0) { if (iconUrl && iconUrl.indexOf("car_fire") >= 0) {
return "#DC2626"; return "#B05454";
} }
if (iconUrl && iconUrl.indexOf("car_ems") >= 0) { if (iconUrl && iconUrl.indexOf("car_ems") >= 0) {
return "#16A34A"; return "#5D9270";
} }
if (iconUrl && iconUrl.indexOf("car_police") >= 0) { if (iconUrl && iconUrl.indexOf("car_police") >= 0) {
return "#2563EB"; return "#637AAE";
} }
return "#2563EB"; return "#637AAE";
} }
function getComplaintBadgeColors(complaintStatus) { function getComplaintBadgeColors(complaintStatus) {
...@@ -135,7 +135,7 @@ begin ...@@ -135,7 +135,7 @@ begin
var html = var html =
'<div class="' + wrapClass + '">' + '<div class="' + wrapClass + '">' +
'<img src="' + iconUrl + '" class="emi-marker-img">'; '<img src="' + iconUrl + '" class="emi-marker-img" onerror="this.onerror=null;this.src=\'' + getFallbackIconUrl(meta) + '\';">';
if (isUnit && meta.unitBadgeText) { if (isUnit && meta.unitBadgeText) {
html += html +=
...@@ -290,6 +290,26 @@ begin ...@@ -290,6 +290,26 @@ begin
return html; return html;
} }
function getFallbackIconUrl(meta) {
if (meta.markerType === 'complaint') {
if (meta.complaintStatus === 'attached') {
return 'assets/markers/default_attached.png';
}
if (meta.complaintStatus === 'onscene') {
return 'assets/markers/default_onscene.png';
}
return 'assets/markers/default_notattached.png';
}
if (meta.markerType === 'unit') {
return 'assets/markers/car_default.png';
}
return 'assets/markers/default_notattached.png';
}
function openMarkerPicker(map, marker, nearby) { function openMarkerPicker(map, marker, nearby) {
window.emiNearbyMarkerPick = nearby; window.emiNearbyMarkerPick = nearby;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment