|
|
@ -1,44 +1,100 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<q-card class="csc-pbx-seat-add-form shadow-1">
|
|
|
|
<div class="csc-form csc-pbx-seat-add-form">
|
|
|
|
<q-card-title>
|
|
|
|
<q-field :error-label="seatNameErrorMessage">
|
|
|
|
<q-icon name="add" color="primary" size="22px"/>
|
|
|
|
<q-input
|
|
|
|
<span>{{ $t('pbxConfig.addSeat') }}</span>
|
|
|
|
@input="$v.data.name.$touch"
|
|
|
|
</q-card-title>
|
|
|
|
:error="$v.data.name.$error"
|
|
|
|
<q-card-main>
|
|
|
|
:disabled="loading"
|
|
|
|
<q-field>
|
|
|
|
:readonly="loading"
|
|
|
|
<q-input :disabled="loading" :readonly="loading" v-model="data.name" autofocus
|
|
|
|
v-model="data.name"
|
|
|
|
:float-label="$t('pbxConfig.seatName')" clearable />
|
|
|
|
autofocus
|
|
|
|
</q-field>
|
|
|
|
:float-label="$t('pbxConfig.seatName')"
|
|
|
|
<q-field>
|
|
|
|
clearable
|
|
|
|
<q-input :disabled="loading" :readonly="loading" type="number" v-model="data.extension"
|
|
|
|
/>
|
|
|
|
clearable :min="1" :max="1000000" :float-label="$t('pbxConfig.extension')" />
|
|
|
|
</q-field>
|
|
|
|
</q-field>
|
|
|
|
<q-field :error-label="extensionErrorMessage">
|
|
|
|
<q-field>
|
|
|
|
<q-input
|
|
|
|
<q-select :disabled="loading" :readonly="loading" v-model="data.aliasNumbers" multiple chips clearable
|
|
|
|
@input="$v.data.extension.$touch"
|
|
|
|
:float-label="$t('pbxConfig.aliasNumbers')" :options="aliasNumberOptions" />
|
|
|
|
:error="$v.data.extension.$error"
|
|
|
|
</q-field>
|
|
|
|
:disabled="loading"
|
|
|
|
<q-field>
|
|
|
|
:readonly="loading"
|
|
|
|
<q-select :disabled="loading" :readonly="loading" v-model="data.groups" multiple chips clearable
|
|
|
|
v-model="data.extension"
|
|
|
|
:float-label="$t('pbxConfig.groups')" :options="groupOptions" />
|
|
|
|
:float-label="$t('pbxConfig.extension')"
|
|
|
|
</q-field>
|
|
|
|
clearable
|
|
|
|
</q-card-main>
|
|
|
|
/>
|
|
|
|
<q-card-separator/>
|
|
|
|
</q-field>
|
|
|
|
<q-card-actions align="center">
|
|
|
|
<q-field>
|
|
|
|
<q-btn v-if="!loading" flat color="secondary" icon="clear"
|
|
|
|
<q-select
|
|
|
|
@click="cancel()">{{ $t('buttons.cancel') }}</q-btn>
|
|
|
|
:disabled="loading"
|
|
|
|
<q-btn v-if="!loading" flat color="primary" icon="done"
|
|
|
|
:readonly="loading"
|
|
|
|
@click="save()">{{ $t('buttons.save') }}</q-btn>
|
|
|
|
v-model="data.aliasNumbers"
|
|
|
|
</q-card-actions>
|
|
|
|
multiple
|
|
|
|
|
|
|
|
chips
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
:float-label="$t('pbxConfig.aliasNumbers')"
|
|
|
|
|
|
|
|
:options="aliasNumberOptions"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</q-field>
|
|
|
|
|
|
|
|
<q-field>
|
|
|
|
|
|
|
|
<q-select
|
|
|
|
|
|
|
|
:disabled="loading"
|
|
|
|
|
|
|
|
:readonly="loading"
|
|
|
|
|
|
|
|
v-model="data.groups"
|
|
|
|
|
|
|
|
multiple
|
|
|
|
|
|
|
|
chips
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
:float-label="$t('pbxConfig.groups')"
|
|
|
|
|
|
|
|
:options="groupOptions"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</q-field>
|
|
|
|
|
|
|
|
<div class="csc-form-actions row justify-center">
|
|
|
|
|
|
|
|
<q-btn
|
|
|
|
|
|
|
|
v-if="!loading"
|
|
|
|
|
|
|
|
flat
|
|
|
|
|
|
|
|
color="secondary"
|
|
|
|
|
|
|
|
icon="clear"
|
|
|
|
|
|
|
|
@click="cancel()"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ $t('buttons.cancel') }}
|
|
|
|
|
|
|
|
</q-btn>
|
|
|
|
|
|
|
|
<q-btn
|
|
|
|
|
|
|
|
v-if="!loading"
|
|
|
|
|
|
|
|
:disabled="$v.data.$invalid"
|
|
|
|
|
|
|
|
flat
|
|
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
|
|
icon="person"
|
|
|
|
|
|
|
|
@click="save()"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ $t('pbxConfig.createSeat') }}
|
|
|
|
|
|
|
|
</q-btn>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<q-inner-loading :visible="loading">
|
|
|
|
<q-inner-loading :visible="loading">
|
|
|
|
<q-spinner-mat size="60px" color="primary"></q-spinner-mat>
|
|
|
|
<q-spinner-mat size="60px" color="primary" />
|
|
|
|
</q-inner-loading>
|
|
|
|
</q-inner-loading>
|
|
|
|
</q-card>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
import { QCard, QCardTitle, QCardMain, QCardActions, QCardSeparator, QBtn,
|
|
|
|
import {
|
|
|
|
QInnerLoading, QSpinnerMat, QField, QInput, QSelect, QIcon } from 'quasar-framework'
|
|
|
|
required,
|
|
|
|
|
|
|
|
maxLength,
|
|
|
|
|
|
|
|
numeric
|
|
|
|
|
|
|
|
} from 'vuelidate/lib/validators'
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
|
|
QCard,
|
|
|
|
|
|
|
|
QCardTitle,
|
|
|
|
|
|
|
|
QCardMain,
|
|
|
|
|
|
|
|
QCardActions,
|
|
|
|
|
|
|
|
QCardSeparator,
|
|
|
|
|
|
|
|
QBtn,
|
|
|
|
|
|
|
|
QInnerLoading,
|
|
|
|
|
|
|
|
QSpinnerMat,
|
|
|
|
|
|
|
|
QField,
|
|
|
|
|
|
|
|
QInput,
|
|
|
|
|
|
|
|
QSelect,
|
|
|
|
|
|
|
|
QIcon
|
|
|
|
|
|
|
|
} from 'quasar-framework'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'csc-pbx-seat-add-form',
|
|
|
|
name: 'csc-pbx-seat-add-form',
|
|
|
@ -48,14 +104,62 @@
|
|
|
|
'loading'
|
|
|
|
'loading'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
QCard, QCardTitle, QCardMain, QCardActions, QCardSeparator, QBtn,
|
|
|
|
QCard,
|
|
|
|
QInnerLoading, QSpinnerMat, QField, QInput, QSelect, QIcon
|
|
|
|
QCardTitle,
|
|
|
|
|
|
|
|
QCardMain,
|
|
|
|
|
|
|
|
QCardActions,
|
|
|
|
|
|
|
|
QCardSeparator,
|
|
|
|
|
|
|
|
QBtn,
|
|
|
|
|
|
|
|
QInnerLoading,
|
|
|
|
|
|
|
|
QSpinnerMat,
|
|
|
|
|
|
|
|
QField,
|
|
|
|
|
|
|
|
QInput,
|
|
|
|
|
|
|
|
QSelect,
|
|
|
|
|
|
|
|
QIcon
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
validations: {
|
|
|
|
|
|
|
|
data: {
|
|
|
|
|
|
|
|
name: {
|
|
|
|
|
|
|
|
required,
|
|
|
|
|
|
|
|
maxLength: maxLength(64)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
extension: {
|
|
|
|
|
|
|
|
required,
|
|
|
|
|
|
|
|
numeric,
|
|
|
|
|
|
|
|
maxLength: maxLength(64)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
data: this.getDefaults()
|
|
|
|
data: this.getDefaults()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
seatNameErrorMessage() {
|
|
|
|
|
|
|
|
if (!this.$v.data.name.required) {
|
|
|
|
|
|
|
|
return this.$t('pbxConfig.requiredSeatName');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!this.$v.data.name.maxLength) {
|
|
|
|
|
|
|
|
return this.$t('pbxConfig.seatNameMaxLength', {
|
|
|
|
|
|
|
|
maxLength: this.$v.data.name.$params.maxLength.max
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
extensionErrorMessage() {
|
|
|
|
|
|
|
|
if (!this.$v.data.extension.required) {
|
|
|
|
|
|
|
|
return this.$t('pbxConfig.requiredExtension');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!this.$v.data.name.maxLength) {
|
|
|
|
|
|
|
|
return this.$t('pbxConfig.extensionMaxLength', {
|
|
|
|
|
|
|
|
maxLength: this.$v.data.extension.$params.maxLength.max
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!this.$v.data.name.numeric) {
|
|
|
|
|
|
|
|
return this.$t('pbxConfig.extensionAlphaNum');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
getDefaults() {
|
|
|
|
getDefaults() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -73,16 +177,12 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
reset() {
|
|
|
|
reset() {
|
|
|
|
this.data = this.getDefaults();
|
|
|
|
this.data = this.getDefaults();
|
|
|
|
|
|
|
|
this.$v.$reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="stylus" rel="stylesheet/stylus">
|
|
|
|
<style lang="stylus" rel="stylesheet/stylus">
|
|
|
|
@import '../../../themes/quasar.variables.styl';
|
|
|
|
@import '../../../themes/app.common.styl';
|
|
|
|
.csc-pbx-seat-add-form
|
|
|
|
|
|
|
|
position: relative
|
|
|
|
|
|
|
|
.csc-pbx-seat-add-form
|
|
|
|
|
|
|
|
.q-field:last-child
|
|
|
|
|
|
|
|
margin-bottom: 36px
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|