| 1 |
<template> |
| 2 |
<div class="interrogating"> |
| 3 |
<img :src="updatedApi.static_url + '/light.svg'" alt="Interrogation Room Light" class="light"> |
| 4 |
|
| 5 |
<div> |
| 6 |
<counter-box |
| 7 |
v-if="activeCase.suspects_under_interrogation.length" |
| 8 |
:title="translations.interrogation.interrogatingTitle" |
| 9 |
:loading="loading" |
| 10 |
:loadingmsg="translations.interrogation.checking" |
| 11 |
:count="interrogatingCount" |
| 12 |
:avatars="activeCase.suspects_under_interrogation" |
| 13 |
display="centered" |
| 14 |
></counter-box> |
| 15 |
<counter-box |
| 16 |
v-else |
| 17 |
:title="translations.interrogation.interrogatingTitle" |
| 18 |
:loading="loading" |
| 19 |
:loadingmsg="translations.interrogation.checking" |
| 20 |
:count="remainingCount" |
| 21 |
:avatars="holdingCell" |
| 22 |
display="centered" |
| 23 |
></counter-box> |
| 24 |
<div class="continue"> |
| 25 |
<router-link to="/test" tag="md-button" class="md-raised md-accent"> |
| 26 |
{{translations.interrogation.startButton}} |
| 27 |
<md-icon>play_arrow</md-icon> |
| 28 |
</router-link> |
| 29 |
</div> |
| 30 |
</div> |
| 31 |
|
| 32 |
<div class="more-suspects" v-if="activeCase.suspects_under_interrogation.length"> |
| 33 |
<counter-box |
| 34 |
:title="translations.interrogation.holdingTitle" |
| 35 |
:loading="loading" |
| 36 |
:count="remainingCount" |
| 37 |
:avatars="holdingCell" |
| 38 |
></counter-box> |
| 39 |
<counter-box |
| 40 |
:title="translations.interrogation.clearedTitle" |
| 41 |
:loading="loading" |
| 42 |
:count="clearedCount" |
| 43 |
:avatars="activeCase.cleared_suspects" |
| 44 |
></counter-box> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
</template> |
| 48 |
|
| 49 |
<script> |
| 50 |
import store from '@/store' |
| 51 |
import { mapState, mapActions, mapGetters } from 'vuex' |
| 52 |
import Loading from './Loading' |
| 53 |
import PluginAvatar from './PluginAvatar' |
| 54 |
import CounterBox from './CounterBox' |
| 55 |
|
| 56 |
export default { |
| 57 |
name: 'interrogating', |
| 58 |
store, |
| 59 |
components: { Loading, PluginAvatar, CounterBox }, |
| 60 |
data () { |
| 61 |
return { |
| 62 |
loading: true |
| 63 |
} |
| 64 |
}, |
| 65 |
beforeMount () { |
| 66 |
this.interrogation() |
| 67 |
.then(() => { |
| 68 |
this.loading = false |
| 69 |
}) |
| 70 |
}, |
| 71 |
computed: { |
| 72 |
...mapState([ |
| 73 |
'api', |
| 74 |
'activeCase', |
| 75 |
'translations' |
| 76 |
]), |
| 77 |
...mapGetters([ |
| 78 |
'interrogatingCount', |
| 79 |
'clearedCount', |
| 80 |
'remainingCount', |
| 81 |
'notHolding', |
| 82 |
'holdingCell', |
| 83 |
'updatedApi' |
| 84 |
]) |
| 85 |
}, |
| 86 |
methods: { |
| 87 |
...mapActions([ |
| 88 |
'interrogation' |
| 89 |
]) |
| 90 |
} |
| 91 |
} |
| 92 |
</script> |