TT#100551 CSC: As Customer, I want to search PBXDevices by Username using a selection with autocompletion
AC: Can input PBXSeats, PBXGroups or PBXPilots name in the search input Can see a list of possible PBXSeat, PBXGroup or PBXPilot according to the search input Can select PBXSeat, PBXGroup or PBXPilot from the list to apply the search Change-Id: Id97cf90b0a5fb62bc2049f73daf98d811fb4583epull/4/head
parent
7c0c1f412a
commit
63347a0b7d
@ -0,0 +1,64 @@
|
|||||||
|
<template>
|
||||||
|
<q-select
|
||||||
|
:label="selectedKeyLabel"
|
||||||
|
v-bind="$attrs"
|
||||||
|
v-on="$listeners"
|
||||||
|
>
|
||||||
|
<template
|
||||||
|
v-if="showSelectedItemIcon"
|
||||||
|
v-slot:prepend
|
||||||
|
>
|
||||||
|
<q-icon
|
||||||
|
:name="selectedKeyIcon"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-slot:option="scope">
|
||||||
|
<q-item
|
||||||
|
v-bind="scope.itemProps"
|
||||||
|
v-on="scope.itemEvents"
|
||||||
|
>
|
||||||
|
<q-item-section
|
||||||
|
side
|
||||||
|
>
|
||||||
|
<q-icon
|
||||||
|
:name="scope.opt.icon"
|
||||||
|
/>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label>
|
||||||
|
{{ scope.opt.label }}
|
||||||
|
</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'CscPbxAttendantSelection',
|
||||||
|
props: {
|
||||||
|
showSelectedItemIcon: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
selectedKeyLabel () {
|
||||||
|
const selectedValue = this.$attrs.value || { type: null }
|
||||||
|
let label = this.$t('pbxConfig.keyBothLabel')
|
||||||
|
if (selectedValue.type !== null) {
|
||||||
|
label = ({
|
||||||
|
pilot: this.$t('pbxConfig.keyPilotLabel'),
|
||||||
|
seat: this.$t('pbxConfig.keySeatLabel'),
|
||||||
|
group: this.$t('pbxConfig.keyGroupLabel')
|
||||||
|
})[selectedValue.type]
|
||||||
|
}
|
||||||
|
return label
|
||||||
|
},
|
||||||
|
selectedKeyIcon () {
|
||||||
|
return this.$attrs.value?.icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Reference in new issue