mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 13:58:12 +00:00
Filtrowanie kategoriami RJ (w.i.p.)
This commit is contained in:
@@ -82,7 +82,7 @@
|
|||||||
import ActionButton from "@/components/Global/ActionButton.vue";
|
import ActionButton from "@/components/Global/ActionButton.vue";
|
||||||
|
|
||||||
import Train from "@/scripts/interfaces/Train";
|
import Train from "@/scripts/interfaces/Train";
|
||||||
import { computed, defineComponent } from "@vue/runtime-core";
|
import { computed, defineComponent, inject } from "@vue/runtime-core";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { ActionButton },
|
components: { ActionButton },
|
||||||
@@ -220,12 +220,16 @@ export default defineComponent({
|
|||||||
return [twrList.length, skrList.length];
|
return [twrList.length, skrList.length];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Inject list from TrainsView for category filter */
|
||||||
|
const chosenTrainCategories = inject("chosenTrainCategories") as string[];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
speedStats,
|
speedStats,
|
||||||
timetableStats,
|
timetableStats,
|
||||||
categoryList,
|
categoryList,
|
||||||
locoList,
|
locoList,
|
||||||
specialTrainCount,
|
specialTrainCount,
|
||||||
|
chosenTrainCategories
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -289,6 +293,10 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* .category {
|
||||||
|
cursor: pointer;
|
||||||
|
} */
|
||||||
|
|
||||||
.category,
|
.category,
|
||||||
.special {
|
.special {
|
||||||
&-list {
|
&-list {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, ComputedRef, defineComponent, ref } from "vue";
|
import { computed, ComputedRef, defineComponent, provide, reactive, ref } from "vue";
|
||||||
|
|
||||||
import { DataStatus } from "@/scripts/enums/DataStatus";
|
import { DataStatus } from "@/scripts/enums/DataStatus";
|
||||||
import Train from "@/scripts/interfaces/Train";
|
import Train from "@/scripts/interfaces/Train";
|
||||||
@@ -125,12 +125,17 @@ export default defineComponent({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Provide list for TrainStats category filter */
|
||||||
|
const chosenTrainCategories = reactive([] as string[]);
|
||||||
|
provide('chosenTrainCategories', chosenTrainCategories);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
trainList,
|
trainList,
|
||||||
computedTrains,
|
computedTrains,
|
||||||
searchedTrain,
|
searchedTrain,
|
||||||
searchedDriver,
|
searchedDriver,
|
||||||
sorterActive,
|
sorterActive,
|
||||||
|
chosenTrainCategories
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user