From 23dc256ce0bdaee3d97fba325206c822f227a65b Mon Sep 17 00:00:00 2001 From: zhanglipeng Date: Mon, 2 Aug 2021 15:20:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=BC=E5=84=BF=E5=9B=AD=E5=92=8C=E5=B9=BC?= =?UTF-8?q?=E5=84=BF=E5=9B=AD=E7=8F=AD=E7=BA=A7=E5=9B=AD=E5=8E=86=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BC=98=E5=8C=96=EF=BC=8C=E5=BC=B9=E5=87=BA=E5=B1=82?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/benyi/calendarshow/index.vue | 128 +++++++++++++++++- .../controller/ByCalendarController.java | 2 + .../BySchoolcalendarClassController.java | 2 +- .../BySchoolcalendarController.java | 2 +- .../project/benyi/domain/ByCalendarShow.java | 9 ++ 5 files changed, 139 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/views/benyi/calendarshow/index.vue b/ruoyi-ui/src/views/benyi/calendarshow/index.vue index 8244ff589..6506bc729 100644 --- a/ruoyi-ui/src/views/benyi/calendarshow/index.vue +++ b/ruoyi-ui/src/views/benyi/calendarshow/index.vue @@ -33,6 +33,61 @@ + + + + + + + + + + + + + + + + + + + + + @@ -43,6 +98,8 @@ import timeGridPlugin from "@fullcalendar/timegrid"; import interactionPlugin from "@fullcalendar/interaction"; import listPlugin from "@fullcalendar/list"; import { getAllSchoolCalendars } from "@/api/benyi/calendar"; +import { getSchoolcalendarclass } from "@/api/benyi/schoolcalendarclass"; +import { getSchoolcalendar } from "@/api/benyi/schoolcalendar"; export default { name: "fullcalendar_page", components: { @@ -117,6 +174,14 @@ export default { ], calendarApi: null, calendarData: [], + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, + // 活动类型字典 + typeOptions: [], + // 表单参数 + form: {}, queryParams: {}, }; }, @@ -124,10 +189,59 @@ export default { getAllSchoolCalendars(this.queryParams).then((response) => { this.calendarEvents = response.calendarData; }); + this.getDicts("sys_schoolcalendartype").then((response) => { + this.typeOptions = response.data; + }); }, methods: { handleEventClick(info) { - this.msgSuccess("事件: " + info.event.title); + //console.log(info); + var group = info.event.groupId; + //group==1 代表幼儿园班级园历信息 + //group==2 代表幼儿园园历信息 + if (group == "1") { + var id = info.event.id; + this.title = "园历详细信息"; + this.open = true; + var myArray = new Array(2); + getSchoolcalendarclass(id).then((response) => { + this.form = response.data; + myArray[0] = response.data.activitytime; + myArray[1] = response.data.activityendtime; + //console.log(myArray); + this.form.activitytime = myArray; + }); + } else if (group == "2") { + var id = info.event.id; + this.title = "园历详细信息"; + this.open = true; + var myArray = new Array(2); + getSchoolcalendar(id).then((response) => { + this.form = response.data; + myArray[0] = response.data.activitytime; + myArray[1] = response.data.activityendtime; + //console.log(myArray); + this.form.activitytime = myArray; + }); + } else { + this.msgSuccess("事件: " + info.event.title); + } + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + id: undefined, + name: undefined, + type: undefined, + activitytime: undefined, + remark: undefined, + }; + this.resetForm("form"); }, }, mounted() { @@ -205,4 +319,14 @@ export default { } } } - + +.el-select { + width: 100%; +} +.my-date-picker { + width: 100% !important; +} +.no-margin ::v-deep.el-form-item__content { + margin: 0 !important; +} + \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCalendarController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCalendarController.java index 88b283c36..767cd83a2 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCalendarController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCalendarController.java @@ -237,6 +237,7 @@ public class ByCalendarController extends BaseController { by.setStart(formatter.format(bsc.getActivitytime())); by.setEnd(formatter.format(bsc.getActivityendtime())); by.setColor(hashMap.get(bsc.getType())); + by.setGroupId("2");//代表学校园历信息 listvi.add(by); } } @@ -324,6 +325,7 @@ public class ByCalendarController extends BaseController { by.setStart(formatter.format(bscc.getActivitytime())); by.setEnd(formatter.format(bscc.getActivityendtime())); by.setColor(hashMap.get(bscc.getType())); + by.setGroupId("1");//代表班级园历信息 listvi.add(by); } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarClassController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarClassController.java index 6a6d63ea1..92916269d 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarClassController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarClassController.java @@ -87,7 +87,7 @@ public class BySchoolcalendarClassController extends BaseController { /** * 获取园历管理(班级)详细信息 */ - @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:query')") + @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:query')"+ "||@ss.hasPermi('benyi:schoolcalendar:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(bySchoolcalendarClassService.selectBySchoolcalendarClassById(id)); diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java index dda70cbae..70d97e9c7 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java @@ -145,7 +145,7 @@ public class BySchoolcalendarController extends BaseController { /** * 获取园历管理详细信息 */ - @PreAuthorize("@ss.hasPermi('benyi:schoolcalendar:query')") + @PreAuthorize("@ss.hasPermi('benyi:schoolcalendar:query')" + "||@ss.hasPermi('benyi:schoolcalendarclass:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { AjaxResult ajax = AjaxResult.success(); diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCalendarShow.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCalendarShow.java index 6f72cf7ae..7b1836d4a 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCalendarShow.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCalendarShow.java @@ -11,6 +11,7 @@ public class ByCalendarShow { private String start; private String end; private String color; + private String groupId; public Long getId() { return id; @@ -51,4 +52,12 @@ public class ByCalendarShow { public void setColor(String color) { this.color = color; } + + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } }