Commit c0d448fa authored by 高宇's avatar 高宇

完成日程管理;

parent 00f2d362
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
message: '保存成功!', message: '保存成功!',
type: 'success' type: 'success'
}) })
this.close(true) this.close(true, from.Calendars)
this.errorData = {}
this.$refs.operationCalendar.resetForm()
}, error => { }, error => {
error.msg.forEach(item => { error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error) this.$set(this.errorData, item.name, item.error)
}) })
}).finally(() => {
this.close(true, from.Calendars)
}) })
}, },
close (getList) { close (getList) {
......
...@@ -68,13 +68,13 @@ ...@@ -68,13 +68,13 @@
message: '保存成功!', message: '保存成功!',
type: 'success' type: 'success'
}) })
this.close(true) this.close(true, from.Calendars)
this.errorData = {}
this.$refs.operationCalendar.resetForm()
}, error => { }, error => {
error.msg.forEach(item => { error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error) this.$set(this.errorData, item.name, item.error)
}) })
}).finally(() => {
this.close(true, from.Calendars)
}) })
}, },
close (getList) { close (getList) {
......
...@@ -161,6 +161,7 @@ ...@@ -161,6 +161,7 @@
}, },
initAdd (info, type) { initAdd (info, type) {
// this.Calendars.start_at = '' // this.Calendars.start_at = ''
if (info) {
if (type === 'dayGridMonth') { if (type === 'dayGridMonth') {
this.Calendars.start_at = info.startStr + ' 00:00:00' 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' this.Calendars.end_at = dateFormatter(new Date(info.endStr).getTime() - 1000 * 60 * 60 * 24) + ' 23:59:59'
...@@ -168,6 +169,7 @@ ...@@ -168,6 +169,7 @@
this.Calendars.start_at = info.startStr this.Calendars.start_at = info.startStr
this.Calendars.end_at = info.endStr this.Calendars.end_at = info.endStr
} }
}
requestAPI(api.getCalendarNewOptions).then(res => { requestAPI(api.getCalendarNewOptions).then(res => {
Object.keys(this.options).forEach(item => { Object.keys(this.options).forEach(item => {
this.options[item] = res.options[item] this.options[item] = res.options[item]
...@@ -190,6 +192,11 @@ ...@@ -190,6 +192,11 @@
this.options[item] = res.options[item] this.options[item] = res.options[item]
}) })
}) })
},
resetForm () {
Object.keys(this.Calendars).forEach(item => {
this.Calendars[item] = ''
})
} }
}, },
props: ['errorData'] props: ['errorData']
......
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
} }
</script> </script>
<style scoped lang="sass"> <style lang="sass">
@import '~@fullcalendar/core/main.css'; @import '~@fullcalendar/core/main.css';
@import '~@fullcalendar/daygrid/main.css'; @import '~@fullcalendar/daygrid/main.css';
@import '~@fullcalendar/timegrid/main.css'; @import '~@fullcalendar/timegrid/main.css';
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
</script> </script>
<style scoped lang="sass"> <style lang="sass">
@import '~@fullcalendar/core/main.css'; @import '~@fullcalendar/core/main.css';
@import '~@fullcalendar/daygrid/main.css'; @import '~@fullcalendar/daygrid/main.css';
@import '~@fullcalendar/timegrid/main.css'; @import '~@fullcalendar/timegrid/main.css';
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
requestAPI, requestAPI,
api api
} from '@/lib/commonMixin' } from '@/lib/commonMixin'
import $ from 'jquery'
export default { export default {
name: '', name: '',
...@@ -244,7 +245,29 @@ ...@@ -244,7 +245,29 @@
}).finally(_ => { }).finally(_ => {
this.loading = false 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 () { created () {
this.getFilter() this.getFilter()
......
...@@ -120,7 +120,13 @@ export default { ...@@ -120,7 +120,13 @@ export default {
deep: true deep: true
}, },
'timeItem' (val) { '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) { 'inputSelectItem' (val) {
this.$emit('update:inputSelect', 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