Commit c0d448fa authored by 高宇's avatar 高宇

完成日程管理;

parent 00f2d362
......@@ -43,13 +43,13 @@
message: '保存成功!',
type: 'success'
})
this.close(true)
this.close(true, from.Calendars)
this.errorData = {}
this.$refs.operationCalendar.resetForm()
}, error => {
error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error)
})
}).finally(() => {
this.close(true, from.Calendars)
})
},
close (getList) {
......
......@@ -68,13 +68,13 @@
message: '保存成功!',
type: 'success'
})
this.close(true)
this.close(true, from.Calendars)
this.errorData = {}
this.$refs.operationCalendar.resetForm()
}, error => {
error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error)
})
}).finally(() => {
this.close(true, from.Calendars)
})
},
close (getList) {
......
......@@ -161,12 +161,14 @@
},
initAdd (info, type) {
// this.Calendars.start_at = ''
if (type === 'dayGridMonth') {
this.Calendars.start_at = info.startStr + ' 00:00:00'
this.Calendars.end_at = dateFormatter(new Date(info.endStr).getTime() - 1000 * 60 * 60 * 24) + ' 23:59:59'
} else {
this.Calendars.start_at = info.startStr
this.Calendars.end_at = info.endStr
if (info) {
if (type === 'dayGridMonth') {
this.Calendars.start_at = info.startStr + ' 00:00:00'
this.Calendars.end_at = dateFormatter(new Date(info.endStr).getTime() - 1000 * 60 * 60 * 24) + ' 23:59:59'
} else {
this.Calendars.start_at = info.startStr
this.Calendars.end_at = info.endStr
}
}
requestAPI(api.getCalendarNewOptions).then(res => {
Object.keys(this.options).forEach(item => {
......@@ -190,6 +192,11 @@
this.options[item] = res.options[item]
})
})
},
resetForm () {
Object.keys(this.Calendars).forEach(item => {
this.Calendars[item] = ''
})
}
},
props: ['errorData']
......
......@@ -176,7 +176,7 @@
}
</script>
<style scoped lang="sass">
<style lang="sass">
@import '~@fullcalendar/core/main.css';
@import '~@fullcalendar/daygrid/main.css';
@import '~@fullcalendar/timegrid/main.css';
......
......@@ -177,7 +177,7 @@
</script>
<style scoped lang="sass">
<style lang="sass">
@import '~@fullcalendar/core/main.css';
@import '~@fullcalendar/daygrid/main.css';
@import '~@fullcalendar/timegrid/main.css';
......
......@@ -53,11 +53,11 @@
</template>
<template v-else>
<component :is="calendarPage" :ref="calendarRef"
:user-id="form['CalendarSearch[created_by]']"
:department-id="form['CalendarSearch[department_id]']"
:resources="resources"
@update:add="(info, type) => {addItem(info, type)}"
@update:edit="(info, type) => {editItem(info, type)}"></component>
:user-id="form['CalendarSearch[created_by]']"
:department-id="form['CalendarSearch[department_id]']"
:resources="resources"
@update:add="(info, type) => {addItem(info, type)}"
@update:edit="(info, type) => {editItem(info, type)}"></component>
</template>
</div>
</div>
......@@ -82,6 +82,7 @@
requestAPI,
api
} from '@/lib/commonMixin'
import $ from 'jquery'
export default {
name: '',
......@@ -244,8 +245,30 @@
}).finally(_ => {
this.loading = false
})
},
handleBodyClick (e) {
if (e.target.contains(document.getElementsByClassName('portal-content')[0])) {
// console.log('包含')
this.popupClose()
} else {
if ($(e.target).parents('.portal-content').length === 0) {
if ($(e.target).parents('.fc-view-container').length > 0) {
return
}
this.popupClose()
}
// console.log('不包含')
}
}
},
mounted () {
this.$nextTick(() => {
document.querySelector('body').addEventListener('click', this.handleBodyClick)
})
},
beforeDestroy () {
document.querySelector('body').removeEventListener('click', this.handleBodyClick)
},
created () {
this.getFilter()
},
......
......@@ -120,7 +120,13 @@ export default {
deep: true
},
'timeItem' (val) {
this.$emit('update:item', val)
let times = ''
if (val.indexOf('T')) {
times = val.split('+')[0].split('T').join(' ')
} else {
times = val
}
this.$emit('update:item', times)
},
'inputSelectItem' (val) {
this.$emit('update:inputSelect', val)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment