Add extended view for village state
This commit is contained in:
parent
b33d84bd35
commit
54327ddbe0
@ -21,7 +21,11 @@
|
|||||||
:title="villageHint(villageState)"
|
:title="villageHint(villageState)"
|
||||||
>
|
>
|
||||||
{{ villageState.village.name }}
|
{{ villageState.village.name }}
|
||||||
[<a href="#" v-on:click.prevent="openEditor(villageState.id)">ред</a>]:
|
[<a href="#" v-on:click.prevent="openEditor(villageState.id)">ред</a>] [<a
|
||||||
|
href="#"
|
||||||
|
v-on:click.prevent="toggleExtendedView(villageState.id)"
|
||||||
|
>👁️</a
|
||||||
|
>]:
|
||||||
</td>
|
</td>
|
||||||
<td class="right">
|
<td class="right">
|
||||||
<filling
|
<filling
|
||||||
@ -73,7 +77,7 @@
|
|||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="required-line">
|
<tr class="required-line" v-if="villageState.required.active">
|
||||||
<td class="right">След. задача:</td>
|
<td class="right">След. задача:</td>
|
||||||
<td class="right">
|
<td class="right">
|
||||||
<resource
|
<resource
|
||||||
@ -112,7 +116,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<resource-line
|
<resource-line
|
||||||
v-if="villageState.required.active"
|
v-if="villageState.required.active && isExtended(villageState.id)"
|
||||||
:title="'Баланс след.:'"
|
:title="'Баланс след.:'"
|
||||||
:hint="'Баланс следующей задачи'"
|
:hint="'Баланс следующей задачи'"
|
||||||
:resources="villageState.required.balance"
|
:resources="villageState.required.balance"
|
||||||
@ -122,7 +126,7 @@
|
|||||||
<resource-line
|
<resource-line
|
||||||
v-for="queueState of villageState.queues"
|
v-for="queueState of villageState.queues"
|
||||||
v-bind:key="villageState.id + queueState.queue"
|
v-bind:key="villageState.id + queueState.queue"
|
||||||
v-if="queueState.isActive"
|
v-if="queueState.isActive && isExtended(villageState.id)"
|
||||||
:title="queueTitle(queueState.queue) + ' (' + queueState.taskCount + '):'"
|
:title="queueTitle(queueState.queue) + ' (' + queueState.taskCount + '):'"
|
||||||
:hint="'Задач в очереди: ' + queueState.taskCount"
|
:hint="'Задач в очереди: ' + queueState.taskCount"
|
||||||
:resources="queueState.firstTask.balance"
|
:resources="queueState.firstTask.balance"
|
||||||
@ -131,6 +135,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<resource-line
|
<resource-line
|
||||||
|
v-if="isExtended(villageState.id)"
|
||||||
:title="'Баланс фронтира:'"
|
:title="'Баланс фронтира:'"
|
||||||
:hint="'Баланс первых задач во всех производственных очередях'"
|
:hint="'Баланс первых задач во всех производственных очередях'"
|
||||||
:resources="villageState.frontierRequired.balance"
|
:resources="villageState.frontierRequired.balance"
|
||||||
@ -138,6 +143,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<resource-line
|
<resource-line
|
||||||
|
v-if="isExtended(villageState.id)"
|
||||||
:title="'Баланс очереди:'"
|
:title="'Баланс очереди:'"
|
||||||
:hint="'Баланс всех задач деревни в очереди'"
|
:hint="'Баланс всех задач деревни в очереди'"
|
||||||
:resources="villageState.totalRequired.balance"
|
:resources="villageState.totalRequired.balance"
|
||||||
@ -148,7 +154,7 @@
|
|||||||
:title="'Торговцы:'"
|
:title="'Торговцы:'"
|
||||||
:resources="villageState.incomingResources"
|
:resources="villageState.incomingResources"
|
||||||
:hide-zero="true"
|
:hide-zero="true"
|
||||||
v-if="!villageState.incomingResources.empty()"
|
v-if="!villageState.incomingResources.empty() && isExtended(villageState.id)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<tr class="normal-line">
|
<tr class="normal-line">
|
||||||
@ -210,6 +216,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
shared: this.$root.$data,
|
shared: this.$root.$data,
|
||||||
|
extendedView: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -266,6 +273,12 @@ export default {
|
|||||||
openEditor(villageId) {
|
openEditor(villageId) {
|
||||||
this.$store.dispatch(Actions.OpenVillageEditor, { villageId });
|
this.$store.dispatch(Actions.OpenVillageEditor, { villageId });
|
||||||
},
|
},
|
||||||
|
isExtended(villageId) {
|
||||||
|
return !!this.extendedView[villageId];
|
||||||
|
},
|
||||||
|
toggleExtendedView(villageId) {
|
||||||
|
this.extendedView[villageId] = !this.extendedView[villageId];
|
||||||
|
},
|
||||||
queueTitle(queue) {
|
queueTitle(queue) {
|
||||||
return translateProductionQueue(queue);
|
return translateProductionQueue(queue);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user