Change-Id: I383a67d94d2ca6e31b8afcdbd1a2d6d7e70db2c3mr9.1.1
parent
88b66464c6
commit
3aabf8c3c9
@ -1,133 +0,0 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="enabled"
|
||||
>
|
||||
<div
|
||||
v-if="disableSourcesetMenu"
|
||||
class="csc-cf-dest-type"
|
||||
@click="addFromCondition()"
|
||||
>
|
||||
{{ $t('pages.newCallForward.fromLabel') }}
|
||||
</div>
|
||||
<div
|
||||
v-if="disableTimesetMenu"
|
||||
class="csc-cf-dest-type"
|
||||
@click="addDateIsCondition()"
|
||||
>
|
||||
{{ $t('pages.newCallForward.dateIsLabel') }}
|
||||
</div>
|
||||
<div
|
||||
v-if="disableDateRangeMenu"
|
||||
ref="daterangeItem"
|
||||
class="csc-cf-dest-type"
|
||||
@click="addDateRangeCondition()"
|
||||
>
|
||||
{{ $t('pages.newCallForward.dateRangeLabel') }}
|
||||
</div>
|
||||
<div
|
||||
v-if="disableWeekdaysMenu"
|
||||
class="csc-cf-dest-type"
|
||||
@click="addWeekdayCondition()"
|
||||
>
|
||||
{{ $t('pages.newCallForward.weekdaysLabel') }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CscNewCallForwardConditionTypeSelect',
|
||||
props: {
|
||||
groupId: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
groupName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
disableSourcesetMenu: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disableTimesetMenu: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disableDateRangeMenu: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disableWeekdaysMenu: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
enabled: true,
|
||||
action: null,
|
||||
timesetName: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
allFieldsFilled () {
|
||||
return this.rangeDateModel.from !== null &&
|
||||
this.rangeDateModel.to !== null &&
|
||||
this.rangeTimeModel.from !== null &&
|
||||
this.rangeTimeModel.to !== null
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.timesetName = 'timeset-' + this.groupId
|
||||
},
|
||||
methods: {
|
||||
addFromCondition () {
|
||||
this.action = 'addFromCondition'
|
||||
this.$parent.close()
|
||||
},
|
||||
addDateIsCondition () {
|
||||
this.action = 'addDateIsCondition'
|
||||
this.$parent.close()
|
||||
},
|
||||
addDateRangeCondition () {
|
||||
this.action = 'addDateRangeCondition'
|
||||
this.$parent.close()
|
||||
},
|
||||
addWeekdayCondition () {
|
||||
this.action = 'addWeekdayCondition'
|
||||
this.$parent.close()
|
||||
},
|
||||
cancel () {
|
||||
this.action = null
|
||||
this.enabled = false
|
||||
this.$parent.close()
|
||||
},
|
||||
add () {
|
||||
this.enabled = true
|
||||
},
|
||||
close () {
|
||||
this.action = null
|
||||
this.enabled = false
|
||||
this.$parent.close()
|
||||
},
|
||||
showQDate () {
|
||||
this.$refs.dayWidget.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" rel="stylesheet/stylus">
|
||||
.csc-cf-dest-type
|
||||
min-width 100px
|
||||
padding 10px
|
||||
cursor pointer
|
||||
.csc-cf-dest-type:hover
|
||||
background $main-menu-item-hover-background
|
||||
.csc-cf-calendar-day
|
||||
padding 20px
|
||||
min-width 400px
|
||||
.q-datetime-weekdays
|
||||
color $tertiary
|
||||
</style>
|
@ -1,119 +0,0 @@
|
||||
|
||||
<template>
|
||||
<q-field
|
||||
:error-label="errorMessage"
|
||||
>
|
||||
<q-input
|
||||
ref="inputField"
|
||||
v-model="inputValue"
|
||||
dark
|
||||
clearable
|
||||
type="text"
|
||||
:float-label="label"
|
||||
:error="$v.inputValue.$error"
|
||||
:before="beforeButtons"
|
||||
@keyup.enter="submit"
|
||||
@keypress.space.prevent
|
||||
@keydown.space.prevent
|
||||
@keyup.space.prevent
|
||||
@input="input"
|
||||
@blur="blur"
|
||||
/>
|
||||
</q-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
userInfoAndEmpty
|
||||
} from 'src/helpers/validation'
|
||||
import {
|
||||
maxLength,
|
||||
required
|
||||
} from 'vuelidate/lib/validators'
|
||||
|
||||
export default {
|
||||
name: 'CscNewCallForwardInput',
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
prefilled: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
before: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
inputValue: '',
|
||||
error: ''
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
inputValue: {
|
||||
userInfoAndEmpty,
|
||||
maxLength: maxLength(64),
|
||||
required
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
errorMessage () {
|
||||
if (!this.$v.inputValue.required) {
|
||||
return this.$t('validationErrors.fieldRequired', {
|
||||
field: this.label
|
||||
})
|
||||
} else if (!this.$v.inputValue.maxLength) {
|
||||
return this.$t('validationErrors.maxLength', {
|
||||
field: this.label,
|
||||
maxLength: this.$v.inputValue.$params.maxLength.max
|
||||
})
|
||||
} else if (!this.$v.inputValue.userInfoAndEmpty) {
|
||||
return this.$t('validationErrors.inputValidNumber')
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
beforeButtons () {
|
||||
return this.before ? this.before : []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
error (state) {
|
||||
this.$emit('error', state)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
if (this.prefilled) {
|
||||
this.inputValue = this.prefilled === ' ' ? '' : this.prefilled
|
||||
this.$v.$reset()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit () {
|
||||
this.$emit('submit')
|
||||
},
|
||||
input () {
|
||||
this.$v.inputValue.$touch()
|
||||
this.error = this.$v.inputValue.$error
|
||||
this.$emit('input', this.inputValue)
|
||||
},
|
||||
blur () {
|
||||
this.$v.inputValue.$touch()
|
||||
this.error = this.$v.inputValue.$error
|
||||
},
|
||||
reset () {
|
||||
this.$refs.inputField.clear()
|
||||
this.$v.$reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" rel="stylesheet/stylus">
|
||||
</style>
|
@ -1,113 +0,0 @@
|
||||
|
||||
<template>
|
||||
<q-field
|
||||
:error-label="errorMessage"
|
||||
>
|
||||
<q-input
|
||||
v-model="inputValue"
|
||||
dark
|
||||
clearable
|
||||
type="text"
|
||||
:float-label="label"
|
||||
:error="$v.inputValue.$error"
|
||||
:before="beforeButtons"
|
||||
@keyup.enter="submit"
|
||||
@keypress.space.prevent
|
||||
@keydown.space.prevent
|
||||
@keyup.space.prevent
|
||||
@input="input"
|
||||
@blur="blur"
|
||||
/>
|
||||
</q-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
userInfoAndEmpty
|
||||
} from 'src/helpers/validation'
|
||||
import {
|
||||
maxLength,
|
||||
required
|
||||
} from 'vuelidate/lib/validators'
|
||||
|
||||
export default {
|
||||
name: 'CscNewCallForwardInputText',
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
prefilled: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
before: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
inputValue: '',
|
||||
error: ''
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
inputValue: {
|
||||
userInfoAndEmpty,
|
||||
maxLength: maxLength(64),
|
||||
required
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
errorMessage () {
|
||||
if (!this.$v.inputValue.required) {
|
||||
return this.$t('validationErrors.fieldRequired', {
|
||||
field: this.label
|
||||
})
|
||||
} else if (!this.$v.inputValue.maxLength) {
|
||||
return this.$t('validationErrors.maxLength', {
|
||||
field: this.label,
|
||||
maxLength: this.$v.inputValue.$params.maxLength.max
|
||||
})
|
||||
} else if (!this.$v.inputValue.userInfoAndEmpty) {
|
||||
return this.$t('validationErrors.inputValidNumber')
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
beforeButtons () {
|
||||
return this.before ? this.before : []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
error (state) {
|
||||
this.$emit('error', state)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
if (this.prefilled) {
|
||||
this.inputValue = this.prefilled === ' ' ? '' : this.prefilled
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit () {
|
||||
this.$emit('submit')
|
||||
},
|
||||
input () {
|
||||
this.$v.inputValue.$touch()
|
||||
this.error = this.$v.inputValue.$error
|
||||
this.$emit('input', this.inputValue)
|
||||
},
|
||||
blur () {
|
||||
this.$v.inputValue.$touch()
|
||||
this.error = this.$v.inputValue.$error
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" rel="stylesheet/stylus">
|
||||
</style>
|
Loading…
Reference in new issue