feature: routesInfo update

This commit is contained in:
2023-05-18 02:22:37 +02:00
parent 4847524b64
commit c6df4a3f84
6 changed files with 75 additions and 121 deletions
-1
View File
@@ -64,7 +64,6 @@ export default defineComponent({
else changeItem['toRemove'] = true;
this.store.unsavedChanges = Object.keys(this.store.changeList).length != 0;
console.log(this.store.changeList);
},
},
});
+6 -13
View File
@@ -3,22 +3,15 @@ import { SceneryRowItem } from '../types/types';
export default defineComponent({
methods: {
getRouteNames(routes: SceneryRowItem['routes'], showAdditional = false) {
getRouteNames(routes: SceneryRowItem['routesInfo']) {
return routes
.split(';')
.map((route) => {
// !Oc_2EPB
const [_, speed, length] = route.split(':');
const props1 = route.split('_')[0];
const props2 = route.split('_')[1];
const isInternal = props1.startsWith('!');
const name = isInternal ? props1.replace('!', '') : props1;
return `<span ${speed != '0' && length != '0' ? 'class="text--accent"' : ''}>${
isInternal ? '<u>' + name + '</u>' : name
}</span> <span style='color: #aaa'>(${props2[0]}/${props2[1]}/${props2[2]}${props2[3] == 'B' ? '/B' : ''}${
speed && showAdditional ? '/' + speed : ''
}${length && showAdditional ? '/' + length : ''})</span>`;
return `<span ${route.routeSpeed != 0 && route.routeLength != 0 ? 'class="text--accent"' : ''}>${
route.isInternal ? '<u>' + route.routeName + '</u>' : route.routeName
}</span> <span style='color: #aaa'>(${route.routeTracks}/${route.isElectric ? 'E' : 'N'}/${
route.isRouteSBL ? 'S' : 'P'
})`;
})
.join(', ');
},