Skip to content

Commit

Permalink
adding order by dropdown, UI: Renewing Study page #1802
Browse files Browse the repository at this point in the history
  • Loading branch information
shral committed Mar 13, 2019
1 parent 6ede26a commit 1d70c74
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dcm4chee-arc-ui2/src/app/constants/globalvar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class Globalvar {
}
]
}
public static get ORDERBY(): Array<any>{
public static get ORDERBY(): Array<{value:string,label:any,mode:('patient'|'study'|'mwl'|'diff'),title:string}>{
return [
{
value: 'PatientName',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class DicomStudiesTableComponent implements OnInit {
this._config.offset = this._config.offset || 0;
}


get tableSchema(): DicomTableSchema {
return this._tableSchema;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<input type="{{line[index].firstField.type}}" min="{{line[index].firstField.min}}" [(ngModel)]="model[line[index].firstField.filterKey]" placeholder="{{line[index].firstField.placeholder}}"/>
<mat-select [(ngModel)]="model[line[index].secondField.filterKey]">
<mat-option *ngIf="line[index].secondField.showStar" value="">*</mat-option>
<mat-option *ngFor="let option of line[index].secondField.options" value="{{option.value}}" title="{{option.description || option.title}}">{{option.text}}</mat-option>
<mat-option *ngFor="let option of line[index].secondField.options" value="{{option.value}}" title="{{option.description || option.title}}" [innerHtml]="option.label || option.text"></mat-option>
</mat-select>
</div>
<label *ngSwitchCase="'label'">{{line[index].text}}:</label>
Expand All @@ -45,7 +45,7 @@
<p-multiSelect [disabled]="line[index].disabled" (ngModelChange)="model[line[index].filterKey] = $event;filterChange($event)" [styleClass]="'multi_select'" [maxSelectedLabels]="line[index].maxSelectedLabels || 1" *ngSwitchCase="'multi-select'" [options]="line[index].options" [(ngModel)]="model[line[index].filterKey]" [defaultLabel]="line[index]?.placeholder"></p-multiSelect>
<mat-select [disabled]="line[index].disabled" [ngStyle]="line[index].style" (ngModelChange)="model[line[index].filterKey] = $event;filterChange($event)" [(ngModel)]="model[line[index].filterKey]" *ngSwitchCase="'select'" placeholder="{{line[index]?.placeholder}}" title="{{line[index]?.description}}">
<mat-option *ngIf="line[index].showStar" value="">*</mat-option>
<mat-option *ngFor="let option of line[index].options" [value]="option.value" title="{{option.description || option.title}}">{{option.text}}</mat-option>
<mat-option *ngFor="let option of line[index].options" [value]="option.value" title="{{option.description || option.title}}" [innerHtml]="option.label || option.text"></mat-option>
</mat-select>
<mat-radio-group [disabled]="line[index].disabled" [ngStyle]="line[index].style" (ngModelChange)="model[line[index].filterKey] = $event;filterChange($event)" [(ngModel)]="model[line[index].filterKey]" *ngSwitchCase="'radio'">
<mat-radio-button *ngFor="let option of line[index].options" [value]="option.value" title="{{option.description}}">{{option.text}}</mat-radio-button>
Expand Down
10 changes: 5 additions & 5 deletions dcm4chee-arc-ui2/src/app/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export type RangeUnit = "hour" | "day" | "week" | "month" | "year";
export class SelectDropdown {
private _value:string;
private _text:string;
private _label:string;
private _label:any;
private _title?:string;
constructor(value:any,text:string, title?:string){
constructor(value:any,text:string, title?:string, label?:any){
this._value = value;
this._text = text;
this._label = text;
this._label = label || text;
this._title = title;
}

Expand All @@ -49,11 +49,11 @@ export class SelectDropdown {
this._text = value;
}

get label(): string {
get label(): any {
return this._label;
}

set label(value:string) {
set label(value:any) {
this._label = value;
}

Expand Down
1 change: 0 additions & 1 deletion dcm4chee-arc-ui2/src/app/study/study/study.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div class="main_content white_design" >

<study-tab></study-tab>
<div class="tab-content" [ngClass]="{'tab_content_with_fixed_header':fixedHeader}">
<div [ngClass]="{'fixed_header':fixedHeader}">
Expand Down
1 change: 1 addition & 0 deletions dcm4chee-arc-ui2/src/app/study/study/study.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export class StudyComponent implements OnInit {
fixedHeader = false;
patients:PatientDicom[] = [];
moreStudies:boolean = false;
testlable = '<label>Patient</label><span class=\"glyphicon glyphicon-sort-by-alphabet\"></span>';

@HostListener("window:scroll", [])
onWindowScroll(e) {
Expand Down
19 changes: 15 additions & 4 deletions dcm4chee-arc-ui2/src/app/study/study/study.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import {AccessLocation, DicomMode, DicomResponseType, FilterSchema} from "../../interfaces";
import {AccessLocation, DicomMode, DicomResponseType, FilterSchema, SelectDropdown} from "../../interfaces";
import {Globalvar} from "../../constants/globalvar";
import {Aet} from "../../models/aet";
import {AeListService} from "../../configuration/ae-list/ae-list.service";
Expand Down Expand Up @@ -27,17 +27,28 @@ export class StudyService {
lineLength = hidden ? 1:2;
break;
case "mwl":
schema = Globalvar.STUDY_FILTER_SCHEMA(aets,hidden);
lineLength = hidden ? 2:3;
break;
case "diff":
schema = [

];
schema = Globalvar.STUDY_FILTER_SCHEMA(aets,hidden);
lineLength = hidden ? 2:3;
break;
default:
schema = Globalvar.STUDY_FILTER_SCHEMA(aets,hidden);
lineLength = hidden ? 2:3;
}
if(!hidden){
schema.push({
tag:"select",
options:Globalvar.ORDERBY
.filter(order=>order.mode === tab)
.map(order=>{
return new SelectDropdown(order.value, order.label,order.title,order.label);
}),
filterKey:'orderby',
text:"Order By"
});
schema.push({
tag: "button",
id: "count",
Expand Down

0 comments on commit 1d70c74

Please sign in to comment.