Change-Id: Id633b92a4bdbfc51596e20c94f18b41fd1616a01mr10.5.5
parent
c1fd033b99
commit
fce6f21e4b
@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<q-toolbar>
|
||||
<q-space/>
|
||||
<div
|
||||
class="col-xs-12 col-md-4"
|
||||
>
|
||||
<q-select
|
||||
v-model="filterTypeModel"
|
||||
dense
|
||||
:options="filterTypeOptions"
|
||||
:label="$t('Filter by')"
|
||||
:disable="loading"
|
||||
/>
|
||||
</div>
|
||||
<q-space />
|
||||
</q-toolbar>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CscConversationsCallsFilter',
|
||||
props: {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
filterTypeModel: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterTypeModel () {
|
||||
this.filter()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filterType () {
|
||||
return this.filterTypeModel && this.filterTypeModel.value
|
||||
},
|
||||
filterTypeOptions () {
|
||||
return [
|
||||
{
|
||||
label: this.$t('Show all calls'),
|
||||
value: 'AllCalls'
|
||||
},
|
||||
{
|
||||
label: this.$t('Show outgoing calls only'),
|
||||
value: 'outgoingCallsOnly'
|
||||
},
|
||||
{
|
||||
label: this.$t('Show incoming calls only'),
|
||||
value: 'incomingCallsOnly'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filter () {
|
||||
const params = {}
|
||||
if (this.filterType === "incomingCallsOnly") params["direction"] = "in"
|
||||
else if (this.filterType === "outgoingCallsOnly") params["direction"] = "out"
|
||||
this.$emit('filter', params)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
Loading…
Reference in new issue