fix WhereInput
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
template(v-slot:activator='{ on }')
|
||||
v-text-field(
|
||||
:label="$t('event.from')"
|
||||
prepend-icon='mdi-clock'
|
||||
:rules="[$validators.required('event.from')]"
|
||||
:value='value.start'
|
||||
v-on='on'
|
||||
@@ -40,6 +41,7 @@
|
||||
min-width="290px")
|
||||
template(v-slot:activator='{ on }')
|
||||
v-text-field(
|
||||
prepend-icon='mdi-clock'
|
||||
:label="$t('event.due')"
|
||||
:value='value.end'
|
||||
v-on='on'
|
||||
@@ -61,7 +63,6 @@ export default {
|
||||
value: { type: Object, default: () => { } }
|
||||
},
|
||||
data () {
|
||||
// console.error('sono dentro data ', this.value)
|
||||
return {
|
||||
// time: { start: this.value.start, end: this.value.end },
|
||||
time: {},
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
v-btn(@click='importGeneric' :loading='loading' :disabled='loading'
|
||||
color='primary') {{$t('common.import')}}
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import ical from 'ical.js'
|
||||
@@ -51,18 +50,18 @@ export default {
|
||||
this.importURL()
|
||||
}
|
||||
},
|
||||
async importICS() {
|
||||
importICS () {
|
||||
const reader = new FileReader()
|
||||
reader.readAsText(this.file)
|
||||
reader.onload = () => {
|
||||
const data = reader.result
|
||||
const event = ical.parse(data)
|
||||
this.event = {
|
||||
title: event.name
|
||||
title: event.name
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async importURL() {
|
||||
async importURL () {
|
||||
if (!this.URL) {
|
||||
this.errorMessage = this.$validators.required('common.URL')('')
|
||||
this.error = true
|
||||
@@ -73,7 +72,7 @@ export default {
|
||||
this.loading = true
|
||||
|
||||
try {
|
||||
const ret = await this.$axios.$get('/event/import', { params: { URL: this.URL }})
|
||||
const ret = await this.$axios.$get('/event/import', { params: { URL: this.URL } })
|
||||
this.event = ret
|
||||
// check if contain an h-event
|
||||
this.$emit('imported', ret)
|
||||
@@ -87,4 +86,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -6,16 +6,18 @@
|
||||
:hint="$t('event.where_description')"
|
||||
:hide-no-data="!place._name"
|
||||
:search-input.sync="place._name"
|
||||
prepend-icon='mdi-map-marker'
|
||||
persistent-hint
|
||||
:value="value.name"
|
||||
:items="places"
|
||||
item-text='name'
|
||||
@change='selectPlace')
|
||||
template(v-slot:no-data)
|
||||
v-list-item
|
||||
p Create {{place._name}}
|
||||
v-list-item(@click='createPlace')
|
||||
v-list-item-content Create {{place._name}}
|
||||
|
||||
v-text-field.col-md-6(ref='address'
|
||||
prepend-icon='mdi-map'
|
||||
:disabled='disableAddress'
|
||||
:rules="[$validators.required('common.address')]"
|
||||
:label="$t('common.address')"
|
||||
@@ -42,21 +44,26 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
selectPlace (p) {
|
||||
const place = p && this.places.find(place => place.id === p.id)
|
||||
if (place && place.address) {
|
||||
if (typeof p === 'object') {
|
||||
if (p === null) { return }
|
||||
this.place.name = p.name
|
||||
this.place.address = place.address
|
||||
this.place.address = p.address
|
||||
this.disableAddress = true
|
||||
} else {
|
||||
} else { // this is a new place
|
||||
this.place.name = p
|
||||
this.disableAddress = false
|
||||
this.$refs.place.blur()
|
||||
this.$refs.address.focus()
|
||||
}
|
||||
this.$emit('input', this.place)
|
||||
this.$emit('input', { ...this.place })
|
||||
},
|
||||
changeAddress (v) {
|
||||
this.place.address = v
|
||||
this.$emit('input', this.place)
|
||||
this.$emit('input', { ...this.place })
|
||||
},
|
||||
createPlace (v) {
|
||||
this.$refs.place.blur()
|
||||
this.$refs.address.focus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
:value = 'event.title'
|
||||
:rules="[$validators.required('common.title')]"
|
||||
:hint="$t('event.what_description')"
|
||||
prepend-icon='mdi-format-title'
|
||||
:label="$t('common.title')"
|
||||
autofocus
|
||||
ref='title')
|
||||
@@ -53,6 +54,7 @@
|
||||
|
||||
//- tags
|
||||
v-combobox.col-6.mt-3(v-model='event.tags'
|
||||
prepend-icon="mdi-tag-multiple"
|
||||
chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
|
||||
:delimiters="[',', ' ']"
|
||||
:items="tags.map(t => t.tag)"
|
||||
@@ -169,7 +171,6 @@ export default {
|
||||
this.loading = true
|
||||
let start_datetime, end_datetime
|
||||
const [start_hour, start_minute] = this.time.start.split(':')
|
||||
console.error('TIME: hour', start_hour, this.time)
|
||||
if (!this.time.end) {
|
||||
this.time.end = (Number(start_hour) + 2) + ':' + start_minute
|
||||
}
|
||||
@@ -183,7 +184,6 @@ export default {
|
||||
end_datetime = dayjs(this.date.date[1])
|
||||
.set('hour', end_hour).set('minute', end_minute)
|
||||
} else if (this.date.type === 'normal') {
|
||||
console.error('dentro type normal', this.date.type)
|
||||
start_datetime = dayjs(this.date.date).set('hour', start_hour).set('minute', start_minute)
|
||||
end_datetime = dayjs(this.date.date).set('hour', end_hour).set('minute', end_minute)
|
||||
if (end_hour < start_hour) {
|
||||
|
||||
Reference in New Issue
Block a user