15 changed files with 630 additions and 166 deletions
@ -0,0 +1,65 @@ |
|||||
|
|
||||
|
export function initSchema() { |
||||
|
return { |
||||
|
schema: { |
||||
|
type: "object", |
||||
|
properties: {}, |
||||
|
required: [] |
||||
|
}, |
||||
|
form: [], |
||||
|
groupInfoes: [] |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export function addGroupInfo(schema, title: string) { |
||||
|
schema.groupInfoes.push({ |
||||
|
"formIndex": schema.groupInfoes?.length || 0, |
||||
|
"GroupTitle": title |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function addToSchema(schema, newSchema) { |
||||
|
Object.assign(schema.schema.properties, newSchema.schema.properties); |
||||
|
schema.schema.required = schema.schema.required.concat(newSchema.schema.required); |
||||
|
schema.form.push(newSchema.form); |
||||
|
} |
||||
|
|
||||
|
export function mergeSchemes(schemes: any[]) { |
||||
|
return schemes.reduce((finalSchema, schema) => { |
||||
|
return { |
||||
|
schema: { |
||||
|
properties: { |
||||
|
...finalSchema.schema.properties, |
||||
|
...schema.schema.properties |
||||
|
}, |
||||
|
required: [ |
||||
|
...finalSchema.schema.required, |
||||
|
...schema.schema.required |
||||
|
] |
||||
|
}, |
||||
|
form: [ |
||||
|
...finalSchema.form, |
||||
|
...schema.form |
||||
|
] |
||||
|
} |
||||
|
}, initSchema()); |
||||
|
} |
||||
|
|
||||
|
export function addCondition(schema, condition: String) { |
||||
|
schema.form = schema.form.map(element => { |
||||
|
if (typeof element === 'string') { |
||||
|
return { |
||||
|
key: element, |
||||
|
condition: condition |
||||
|
} |
||||
|
} |
||||
|
if (typeof element == 'object') { |
||||
|
if (element.condition) { |
||||
|
element.condition += ' && ' + condition |
||||
|
} |
||||
|
else element.condition = condition; |
||||
|
} |
||||
|
return element; |
||||
|
}); |
||||
|
return schema; |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
|
||||
|
.arrow{ |
||||
|
background:#222; |
||||
|
text-align:center; |
||||
|
font-size:180%; |
||||
|
margin:2em; |
||||
|
font-family: Calibri, arial, sans-serif; |
||||
|
color:white; |
||||
|
padding-top:1.8em; |
||||
|
display:inline-block;/* or block */ |
||||
|
position:relative; |
||||
|
border-color:white; |
||||
|
text-decoration:none; |
||||
|
transition:all .3s ease-out; |
||||
|
} |
||||
|
.arrow:before{ |
||||
|
content:'▲'; |
||||
|
font-size:.9em; |
||||
|
position:absolute; |
||||
|
top:0; |
||||
|
left:50%; |
||||
|
margin-left:-.7em; |
||||
|
border:solid .13em white; |
||||
|
border-radius:10em; |
||||
|
width:1.4em; |
||||
|
height:1.4em; |
||||
|
line-height:1.3em; |
||||
|
border-color:inherit; |
||||
|
transition:transform .5s ease-in; |
||||
|
} |
||||
|
.arrow:hover{ |
||||
|
color:pink; |
||||
|
border-color:pink; |
||||
|
} |
||||
@ -1,4 +1,3 @@ |
|||||
<div class="map" #map ></div> |
<div class="map" #map ></div> |
||||
<div>{{historicalData?.lenth}}</div> |
<tb-history-selector *ngIf="historicalData" [settings]="settings" [intervals]="intervals" |
||||
<tb-history-selector *ngIf="historicalData" [settings]="ctx.settings" [intervals]="intervals" |
|
||||
(onTimeUpdated)="timeUpdated($event)"></tb-history-selector> |
(onTimeUpdated)="timeUpdated($event)"></tb-history-selector> |
||||
|
|||||
Loading…
Reference in new issue