game-village-politics-frontend/app/pages/village/[id]/workforce.vue

21 lines
1005 B
Vue
Raw Normal View History

<script setup lang="ts">
const route = useRoute()
const v = useVillageContext()
const village = computed(() => v.village.value!)
const farm = computed(() => [...village.value.buildings].filter((b) => b.type === 'farm').sort((a, b) => b.level - a.level)[0] ?? null)
const showInVillage = (id: number) => navigateTo({ path: `/village/${route.params.id}`, query: { b: id } })
</script>
<!-- Who works where: staffing and priorities per building, and the population behind it. -->
<template>
<div class="space-y-3 p-2.5">
<VillageScreenHeader type="farm" :level="farm?.level ?? null" :title="$t('village.screens.workforce')" :description="$t('village.about.workforce')" />
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_18rem]">
<VillageBuildingTable :buildings="village.buildings" :busy="v.busy.value" @select="showInVillage" @priority="v.setPriority" />
<VillagePopulationPanel :population="village.population" :militia="village.levy.militia" />
</div>
</div>
</template>