幼儿园和幼儿园班级园历展示优化,弹出层显示

This commit is contained in:
zhanglipeng 2021-08-02 15:20:55 +08:00
parent 13f5bcfe89
commit 23dc256ce0
5 changed files with 139 additions and 4 deletions

View File

@ -33,6 +33,61 @@
</div>
</el-col>
</el-row>
<!-- 添加或修改园历管理(班级)对话框 -->
<el-dialog :title="title" :visible.sync="open" class="v-dialog">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="事件名称" prop="name">
<el-input
disabled="true"
v-model="form.name"
size="small"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="活动类型" prop="type">
<el-select
disabled="true"
v-model="form.type"
size="small"
placeholder="请选择活动类型"
>
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="活动时间" prop="activitytime">
<el-date-picker
disabled="true"
clearable
size="small"
class="my-date-picker"
v-model="form.activitytime"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
disabled="true"
type="textarea"
v-model="form.remark"
size="small"
placeholder=""
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -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 {
}
}
}
</style>
.el-select {
width: 100%;
}
.my-date-picker {
width: 100% !important;
}
.no-margin ::v-deep.el-form-item__content {
margin: 0 !important;
}
</style>

View File

@ -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);
}
}

View File

@ -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));

View File

@ -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();

View File

@ -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;
}
}