forked from geolba/tethys.frontend
- add search components: vs-result.vue, vs-input.vue, facet-category.vue
- add search models - add opensans font - add bulma css framework - add axios, rxjs, vue-property-decorator - npm updates
This commit is contained in:
parent
8e0bc7c18d
commit
156bf0ae26
30 changed files with 4937 additions and 2044 deletions
32
src/models/dataset.ts
Normal file
32
src/models/dataset.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
export interface Dataset {
|
||||
abstract_additional: Array<string>;
|
||||
abstract_output: string;
|
||||
author: Array<string>;
|
||||
author_sort: Array<string>;
|
||||
belongs_to_bibliography: boolean;
|
||||
creating_corporation: string;
|
||||
doctype: string;
|
||||
geo_location: string;
|
||||
id: number;
|
||||
identifier: Array<string>;
|
||||
language: string;
|
||||
licence: string;
|
||||
publisher_name: string;
|
||||
server_date_published: Array<number>;
|
||||
subject: Array<string>;
|
||||
title_output: string;
|
||||
year: number;
|
||||
year_inverted: number;
|
||||
}
|
||||
|
||||
export class Suggestion {
|
||||
constructor(public value: string, public type: SearchType) {}
|
||||
// value!: string;
|
||||
// type!: SearchType;
|
||||
}
|
||||
|
||||
export enum SearchType {
|
||||
Title = "title",
|
||||
Author = "author",
|
||||
Subject = "subject",
|
||||
}
|
75
src/models/headers.ts
Normal file
75
src/models/headers.ts
Normal file
|
@ -0,0 +1,75 @@
|
|||
import { Dataset } from "./dataset";
|
||||
|
||||
export interface SolrResponse {
|
||||
responseHeader: ResponseHeader;
|
||||
response: ResponseContent;
|
||||
facets: FacetFields;
|
||||
// facet_counts: FacetCount;
|
||||
}
|
||||
|
||||
export interface ResponseHeader {
|
||||
status: boolean;
|
||||
QTime: number;
|
||||
params: ResponseHeaderParams;
|
||||
}
|
||||
|
||||
export interface ResponseHeaderParams {
|
||||
defType: string;
|
||||
rows?: number;
|
||||
start?: number;
|
||||
wt?: string;
|
||||
|
||||
// 0:'fl=id,licence,server_date_published,abstract_output,identifier,title_output,title_additional,author,subject,doctype'
|
||||
|
||||
// df:'title'
|
||||
// facet:'on'
|
||||
// indent:'on'
|
||||
// json.facet.language:'{ type: "terms", field: "language" }'
|
||||
// json.facet.subject:'{ type: "terms", field: "subject" }'
|
||||
// q:'title:Geodaten - Blatt 49 Wels (1:50.000)'
|
||||
// q.op:'and'
|
||||
// rows:'10'
|
||||
// start:'0'
|
||||
// wt:'json'
|
||||
}
|
||||
|
||||
export interface ResponseContent {
|
||||
numFound: number;
|
||||
start: number;
|
||||
docs: Array<Dataset>;
|
||||
}
|
||||
|
||||
// export interface FacetCount {
|
||||
// facet_fields: FacetCategory<any>;
|
||||
// }
|
||||
|
||||
// export class FacetCategory<T> {
|
||||
|
||||
// [key: string]: {
|
||||
// values: T[];
|
||||
// };
|
||||
// }
|
||||
|
||||
export class FacetResults {
|
||||
language!: Array<FacetItem>;
|
||||
subject!: Array<FacetItem>;
|
||||
}
|
||||
|
||||
export class FacetFields {
|
||||
// count: number;
|
||||
language!: FacetInstance;
|
||||
subject!: FacetInstance;
|
||||
// [key: string]: FacetInstance;
|
||||
}
|
||||
|
||||
export interface FacetInstance {
|
||||
[key: string]: Array<FacetItem>;
|
||||
// buckets: Array<FacetItem>;
|
||||
}
|
||||
|
||||
export interface FacetItem {
|
||||
val: string;
|
||||
count: number;
|
||||
category: string;
|
||||
active: boolean;
|
||||
}
|
50
src/models/solr.ts
Normal file
50
src/models/solr.ts
Normal file
|
@ -0,0 +1,50 @@
|
|||
export interface SolrSettings {
|
||||
core: string;
|
||||
host: string;
|
||||
}
|
||||
|
||||
export class ActiveFilterCategories {
|
||||
// count: number;
|
||||
language!: Array<string>;
|
||||
subject!: Array<string>;
|
||||
[key: string]: Array<string>;
|
||||
}
|
||||
|
||||
// export class ActiveFilterCategory {
|
||||
// key!: string;
|
||||
// values!: Array<string>;
|
||||
|
||||
// // [key: string]: Array<string>;
|
||||
// }
|
||||
|
||||
export class FilterItem {
|
||||
private category: string;
|
||||
val: string;
|
||||
count: number;
|
||||
private active: boolean;
|
||||
|
||||
constructor(value: string, count: number) {
|
||||
this.val = value;
|
||||
this.count = count;
|
||||
this.active = false;
|
||||
this.category = "";
|
||||
}
|
||||
|
||||
//#region properties
|
||||
|
||||
get Category(): string {
|
||||
return this.category;
|
||||
}
|
||||
set Category(theCategory: string) {
|
||||
this.category = theCategory;
|
||||
}
|
||||
|
||||
get Active(): boolean {
|
||||
return this.active;
|
||||
}
|
||||
set Active(isActive: boolean) {
|
||||
this.active = isActive;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue