20200523-zlp-1

园历样式
This commit is contained in:
paidaxing444
2020-05-23 11:45:10 +08:00
parent 9180d882fd
commit 89d61dd1f7
12 changed files with 245 additions and 189 deletions

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询园历管理(本一)列表 // 查询园历管理(本一)列表
export function listCalendar(query) { export function listCalendar(query) {
return request({ return request({
url: '/system/calendar/list', url: '/benyi/calendar/list',
method: 'get', method: 'get',
params: query params: query
}) })
@ -12,7 +12,7 @@ export function listCalendar(query) {
// 查询园历管理(本一)详细 // 查询园历管理(本一)详细
export function getCalendar(id) { export function getCalendar(id) {
return request({ return request({
url: '/system/calendar/' + id, url: '/benyi/calendar/' + id,
method: 'get' method: 'get'
}) })
} }
@ -20,7 +20,7 @@ export function getCalendar(id) {
// 新增园历管理(本一) // 新增园历管理(本一)
export function addCalendar(data) { export function addCalendar(data) {
return request({ return request({
url: '/system/calendar', url: '/benyi/calendar',
method: 'post', method: 'post',
data: data data: data
}) })
@ -29,7 +29,7 @@ export function addCalendar(data) {
// 修改园历管理(本一) // 修改园历管理(本一)
export function updateCalendar(data) { export function updateCalendar(data) {
return request({ return request({
url: '/system/calendar', url: '/benyi/calendar',
method: 'put', method: 'put',
data: data data: data
}) })
@ -38,7 +38,7 @@ export function updateCalendar(data) {
// 删除园历管理(本一) // 删除园历管理(本一)
export function delCalendar(id) { export function delCalendar(id) {
return request({ return request({
url: '/system/calendar/' + id, url: '/benyi/calendar/' + id,
method: 'delete' method: 'delete'
}) })
} }
@ -46,7 +46,7 @@ export function delCalendar(id) {
// 导出园历管理(本一) // 导出园历管理(本一)
export function exportCalendar(query) { export function exportCalendar(query) {
return request({ return request({
url: '/system/calendar/export', url: '/benyi/calendar/export',
method: 'get', method: 'get',
params: query params: query
}) })

View File

@ -55,6 +55,7 @@ export default {
& .sidebar-logo-link { & .sidebar-logo-link {
height: 100%; height: 100%;
width: 100%; width: 100%;
background: #fff;
& .sidebar-logo { & .sidebar-logo {
width: 32px; width: 32px;
@ -66,7 +67,7 @@ export default {
& .sidebar-title { & .sidebar-title {
display: inline-block; display: inline-block;
margin: 0; margin: 0;
color: #fff; color: #333;
font-weight: 600; font-weight: 600;
line-height: 50px; line-height: 50px;
font-size: 14px; font-size: 14px;

View File

@ -222,9 +222,9 @@ export default {
margin-right: 15px; margin-right: 15px;
} }
&.active { &.active {
background-color: #42b983; background-color: #2C3E50;
color: #fff; color: #fff;
border-color: #42b983; border-color: #2C3E50;
&::before { &::before {
content: ''; content: '';
background: #fff; background: #fff;

View File

@ -3,50 +3,24 @@
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="活动类型" prop="type"> <el-form-item label="活动类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择活动类型" clearable size="small"> <el-select v-model="queryParams.type" placeholder="请选择活动类型" clearable size="small">
<el-option label="请选择字典生成" value="" /> <el-option
v-for="dict in calendartypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="活动时间" prop="activitytime"> <el-form-item label="活动时间" prop="activitytime">
<el-date-picker clearable size="small" style="width: 200px" <el-date-picker
clearable
size="small"
style="width: 200px"
v-model="queryParams.activitytime" v-model="queryParams.activitytime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择活动时间"> placeholder="选择活动时间"
</el-date-picker> ></el-date-picker>
</el-form-item>
<el-form-item label="活动结束时间" prop="activityendtime">
<el-date-picker clearable size="small" style="width: 200px"
v-model="queryParams.activityendtime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择活动结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动样式颜色" prop="stylecolor">
<el-input
v-model="queryParams.stylecolor"
placeholder="请输入活动样式颜色"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建人" prop="createuserid">
<el-input
v-model="queryParams.createuserid"
placeholder="请输入创建人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createtime">
<el-date-picker clearable size="small" style="width: 200px"
v-model="queryParams.createtime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择创建时间">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -61,7 +35,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:calendar:add']" v-hasPermi="['benyi:calendar:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -71,7 +45,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:calendar:edit']" v-hasPermi="['benyi:calendar:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -81,7 +55,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:calendar:remove']" v-hasPermi="['benyi:calendar:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -90,7 +64,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:calendar:export']" v-hasPermi="['benyi:calendar:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -99,19 +73,15 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="标识" align="center" prop="id" /> <el-table-column label="标识" align="center" prop="id" />
<el-table-column label="名称" align="center" prop="name" /> <el-table-column label="名称" align="center" prop="name" />
<el-table-column label="活动类型" align="center" prop="type" /> <el-table-column
<el-table-column label="活动时间" align="center" prop="activitytime" width="180"> label="活动类型"
<template slot-scope="scope"> align="center"
<span>{{ parseTime(scope.row.activitytime) }}</span> :formatter="calendartypeFormat"
</template> prop="type"
</el-table-column> />
<el-table-column label="活动结束时间" align="center" prop="activityendtime" width="180"> <el-table-column label="活动开始时间" align="center" prop="activitytime" width="180"></el-table-column>
<template slot-scope="scope"> <el-table-column label="活动结束时间" align="center" prop="activityendtime" width="180"></el-table-column>
<span>{{ parseTime(scope.row.activityendtime) }}</span>
</template>
</el-table-column>
<el-table-column label="活动样式颜色" align="center" prop="stylecolor" /> <el-table-column label="活动样式颜色" align="center" prop="stylecolor" />
<el-table-column label="创建人" align="center" prop="createuserid" />
<el-table-column label="创建时间" align="center" prop="createtime" width="180"> <el-table-column label="创建时间" align="center" prop="createtime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span> <span>{{ parseTime(scope.row.createtime) }}</span>
@ -124,19 +94,19 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:calendar:edit']" v-hasPermi="['benyi:calendar:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:calendar:remove']" v-hasPermi="['benyi:calendar:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -152,31 +122,36 @@
<el-input v-model="form.name" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.name" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
<el-form-item label="活动类型"> <el-form-item label="活动类型">
<el-select v-model="form.type" placeholder="请选择活动类型"> <el-select v-model="form.type" placeholder="请选择活动类型" clearable size="small">
<el-option label="请选择字典生成" value="" /> <el-option
</el-select> v-for="dict in calendartypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="活动时间" prop="activitytime"> <el-form-item label="起始时间" prop="activitytime">
<el-date-picker clearable size="small" style="width: 200px" <el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.activitytime" v-model="form.activitytime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择活动时间"> placeholder="选择活动起始时间"
</el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="活动结束时间" prop="activityendtime"> <el-form-item label="结束时间" prop="activityendtime">
<el-date-picker clearable size="small" style="width: 200px" <el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.activityendtime" v-model="form.activityendtime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择活动结束时间"> placeholder="选择活动结束时间"
</el-date-picker> ></el-date-picker>
</el-form-item>
<el-form-item label="活动样式颜色" prop="stylecolor">
<el-input v-model="form.stylecolor" placeholder="请输入活动样式颜色" />
</el-form-item>
<el-form-item label="创建人" prop="createuserid">
<el-input v-model="form.createuserid" placeholder="请输入创建人" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -188,7 +163,14 @@
</template> </template>
<script> <script>
import { listCalendar, getCalendar, delCalendar, addCalendar, updateCalendar, exportCalendar } from "@/api/benyi/calendar"; import {
listCalendar,
getCalendar,
delCalendar,
addCalendar,
updateCalendar,
exportCalendar
} from "@/api/benyi/calendar";
export default { export default {
name: "Calendar", name: "Calendar",
@ -206,6 +188,8 @@ export default {
total: 0, total: 0,
// 园历管理(本一)表格数据 // 园历管理(本一)表格数据
calendarList: [], calendarList: [],
//活动类型
calendartypeOptions: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
@ -225,14 +209,20 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {}
}
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_schoolcalendartype").then(response => {
this.calendartypeOptions = response.data;
});
}, },
methods: { methods: {
// 学校园历类型--字典状态字典翻译
calendartypeFormat(row, column) {
return this.selectDictLabel(this.calendartypeOptions, row.type);
},
/** 查询园历管理(本一)列表 */ /** 查询园历管理(本一)列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -273,9 +263,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id);
this.single = selection.length!=1 this.single = selection.length != 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -286,7 +276,7 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getCalendar(id).then(response => { getCalendar(id).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
@ -324,29 +314,39 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm('是否确认删除园历管理(本一)编号为"' + ids + '"的数据项?', "警告", { this.$confirm(
'是否确认删除园历管理(本一)编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }
)
.then(function() {
return delCalendar(ids); return delCalendar(ids);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(function() {}); })
.catch(function() {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有园历管理(本一)数据项?', "警告", { this.$confirm("是否确认导出所有园历管理(本一)数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { })
.then(function() {
return exportCalendar(queryParams); return exportCalendar(queryParams);
}).then(response => { })
.then(response => {
this.download(response.msg); this.download(response.msg);
}).catch(function() {}); })
.catch(function() {});
} }
} }
}; };

View File

@ -2,14 +2,15 @@
<div class="app-container"> <div class="app-container">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="4" :xs="24"> <el-col :span="4" :xs="24">
<el-button type="primary">日常活动</el-button> <el-row class="xs-btns-style" :gutter="10">
<el-button type="success">教学活动</el-button> <el-col v-for="item in btns" :key="item.title">
<el-button type="info">大型活动</el-button> <el-button
<el-button type="warning">家长参与</el-button> type="primary"
<el-button type="danger">节假日</el-button> class="btn no-border-btn"
<!-- <Tag type="dot" :color="NORMAL_COLOR">未预约</Tag> :style="{background: `${item.color}`}"
<Tag type="dot" :color="USED_COLOR">已预约</Tag> >{{item.title}}</el-button>
<Tag type="dot" :color="DISABLED_COLOR">已停用</Tag> --> </el-col>
</el-row>
</el-col> </el-col>
<el-col :span="20" :xs="24"> <el-col :span="20" :xs="24">
<div> <div>
@ -26,9 +27,8 @@
:eventLimit="true" :eventLimit="true"
:displayEventEnd="true" :displayEventEnd="true"
eventLimitText="更多" eventLimitText="更多"
@dateClick="handleDateClick"
@eventClick="handleEventClick" @eventClick="handleEventClick"
/> />
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -36,47 +36,64 @@
</template> </template>
<script> <script>
import FullCalendar from '@fullcalendar/vue' import FullCalendar from "@fullcalendar/vue";
import dayGridPlugin from '@fullcalendar/daygrid' import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from '@fullcalendar/timegrid' import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from '@fullcalendar/interaction' import interactionPlugin from "@fullcalendar/interaction";
import listPlugin from '@fullcalendar/list'; import listPlugin from "@fullcalendar/list";
import { getAllSchoolCalendars } from "@/api/benyi/calendar" import { getAllSchoolCalendars } from "@/api/benyi/calendar";
export default { export default {
name: 'fullcalendar_page', name: "fullcalendar_page",
components: { components: {
FullCalendar FullCalendar
}, },
data () { data() {
return { return {
// DISABLED_COLOR: '#c5c8ce', btns: [
// USED_COLOR: '#19be6b', {
// NORMAL_COLOR: '#2db7f5', color: "#52c41a",
title: "家长参与"
},
{
color: "#135200",
title: "大型活动"
},
{
color: "#1890ff",
title: "教学活动"
},
{
color: "#eb2f96",
title: "节假日"
}
],
views: { views: {
list: { list: {
noEventsMessage: '暂无日程' noEventsMessage: "暂无日程"
} }
}, },
header: { header: {
left: 'prev,next today', left: "prev,next today",
center: 'title', center: "title",
right: 'dayGridMonth,timeGridWeek,timeGridDay listWeek' right: "dayGridMonth,timeGridWeek,timeGridDay listWeek"
}, },
buttonText: { buttonText: {
today: '今天', today: "今天",
month: '月', month: "月",
week: '周', week: "周",
day: '日', day: "日",
list: '周列表' list: "周列表"
}, },
calendarPlugins: [ // plugins must be defined in the JS calendarPlugins: [
// plugins must be defined in the JS
dayGridPlugin, dayGridPlugin,
timeGridPlugin, timeGridPlugin,
interactionPlugin,// needed for dateClick interactionPlugin, // needed for dateClick
listPlugin listPlugin
], ],
calendarWeekends: true, calendarWeekends: true,
calendarEvents: [ // initial event data calendarEvents: [
// initial event data
// { // {
// title: 'Event Now', // title: 'Event Now',
// start: new Date(), // start: new Date(),
@ -86,15 +103,15 @@ export default {
calendarApi: null, calendarApi: null,
calendarData: [], calendarData: [],
queryParams: {} queryParams: {}
} };
}, },
created() { created() {
getAllSchoolCalendars(this.queryParams).then(response => { getAllSchoolCalendars(this.queryParams).then(response => {
this.calendarEvents = response.calendarData; this.calendarEvents = response.calendarData;
}); });
}, },
methods: { methods: {
getCalendarEvents (info, successCallback, failureCallback) { getCalendarEvents(info, successCallback, failureCallback) {
// const events = this.getSchoolCalendarList(); // const events = this.getSchoolCalendarList();
console.log("ceshi11111111"); console.log("ceshi11111111");
getAllSchoolCalendars(this.queryParams).then(response => { getAllSchoolCalendars(this.queryParams).then(response => {
@ -119,46 +136,64 @@ export default {
// color:'green' // color:'green'
// } // }
// ] // ]
successCallback(events) successCallback(events);
}, },
toggleWeekends () { toggleWeekends() {
this.calendarWeekends = !this.calendarWeekends // update a property this.calendarWeekends = !this.calendarWeekends; // update a property
}, },
gotoPast () { gotoPast() {
this.calendarApi.gotoDate('2019-08-01') // call a method on the Calendar object this.calendarApi.gotoDate("2019-08-01"); // call a method on the Calendar object
}, },
handleDateClick (arg) { handleDateClick(arg) {
if (confirm('Would you like to add an event to ' + arg.dateStr + ' ?')) { if (confirm("Would you like to add an event to " + arg.dateStr + " ?")) {
this.calendarEvents.push({ // add new event data this.calendarEvents.push({
title: 'New Event', // add new event data
title: "New Event",
start: arg.date, start: arg.date,
allDay: arg.allDay allDay: arg.allDay
}) });
} }
this.calendarApi.refetchEvents() this.calendarApi.refetchEvents();
}, },
handleEventClick (info) { handleEventClick(info) {
alert('Event: ' + info.event.title) alert("活动: " + info.event.title);
} }
}, },
mounted () { mounted() {
this.calendarApi = this.$refs.fullCalendar.getApi() this.calendarApi = this.$refs.fullCalendar.getApi();
} }
} };
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>
// you must include each plugins' css // you must include each plugins' css
// paths prefixed with ~ signify node_modules // paths prefixed with ~ signify node_modules
@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";
@import '~@fullcalendar/list/main.css'; @import "~@fullcalendar/list/main.css";
.panel { .calendar {
padding-top: 64px; width: 820px;
color: deeppink; }
.xs-btns-style {
@media screen and (max-width: 768px) {
display: flex;
flex-wrap: wrap;
.el-col {
width: auto;
}
} }
.calendar { @media screen and (min-width: 769px) {
width: 820px;
} }
.el-col {
margin-bottom: 10px;
text-align: center;
}
}
.btn {
width: 96px;
}
.no-border-btn {
border: none;
}
</style> </style>

View File

@ -106,7 +106,8 @@
/> />
<el-table-column label="适用范围" align="center" :formatter="scopeFormat" prop="scope" /> <el-table-column label="适用范围" align="center" :formatter="scopeFormat" prop="scope" />
<el-table-column label="学年学期" align="center" :formatter="xnxqFormat" prop="xnxq" /> <el-table-column label="学年学期" align="center" :formatter="xnxqFormat" prop="xnxq" />
<el-table-column label="活动时间" align="center" prop="activitytime" width="180" /> <el-table-column label="活动开始时间" align="center" prop="activitytime" width="180" />
<el-table-column label="活动截止时间" align="center" prop="activityendtime" width="180" />
<el-table-column label="创建时间" align="center" prop="createtime" width="180"> <el-table-column label="创建时间" align="center" prop="createtime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span> <span>{{ parseTime(scope.row.createtime) }}</span>
@ -172,13 +173,16 @@
<el-date-picker <el-date-picker
clearable clearable
size="small" size="small"
style="width: 200px" style="width: 240px"
v-model="form.activitytime" v-model="form.activitytime"
type="date" type="daterange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="pickerOptions0" :picker-options="pickerOptions0"
placeholder="选择活动时间" range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker> ></el-date-picker>
<el-input v-model="form.activityendtime" v-if="false" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -364,8 +368,13 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
var myArray=new Array(2);
getSchoolcalendar(id).then(response => { getSchoolcalendar(id).then(response => {
this.form = response.data; this.form = response.data;
myArray[0]=response.data.activitytime;
myArray[1]=response.data.activityendtime;
//console.log(myArray);
this.form.activitytime = myArray;
this.scopeOptions = response.scopes; this.scopeOptions = response.scopes;
this.form.scope = response.scopeIds; this.form.scope = response.scopeIds;
this.open = true; this.open = true;
@ -378,6 +387,12 @@ export default {
if (valid) { if (valid) {
var arrscope = this.form.scope; var arrscope = this.form.scope;
this.form.scope = arrscope.join(";"); this.form.scope = arrscope.join(";");
var v1 = this.form.activitytime[0];
var v2 = this.form.activitytime[1];
this.form.activitytime = v1;
this.form.activityendtime = v2;
if (this.form.id != undefined) { if (this.form.id != undefined) {
updateSchoolcalendar(this.form).then(response => { updateSchoolcalendar(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
@ -389,6 +404,7 @@ export default {
} }
}); });
} else { } else {
//console.log(this.form.activitytime[1]);
addSchoolcalendar(this.form).then(response => { addSchoolcalendar(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");

View File

@ -7,9 +7,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.security.service.TokenService;
import com.ruoyi.project.benyi.domain.*; import com.ruoyi.project.benyi.domain.*;
import com.ruoyi.project.benyi.service.IBySchoolcalendarClassService; import com.ruoyi.project.benyi.service.IBySchoolcalendarClassService;
import com.ruoyi.project.benyi.service.IBySchoolcalendarService; import com.ruoyi.project.benyi.service.IBySchoolcalendarService;
@ -63,7 +60,7 @@ public class ByCalendarController extends BaseController
/** /**
* 查询园历管理(本一)列表 * 查询园历管理(本一)列表
*/ */
@PreAuthorize("@ss.hasPermi('system:calendar:list')") @PreAuthorize("@ss.hasPermi('benyi:calendar:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(ByCalendar byCalendar) public TableDataInfo list(ByCalendar byCalendar)
{ {
@ -75,7 +72,7 @@ public class ByCalendarController extends BaseController
/** /**
* 导出园历管理(本一)列表 * 导出园历管理(本一)列表
*/ */
@PreAuthorize("@ss.hasPermi('system:calendar:export')") @PreAuthorize("@ss.hasPermi('benyi:calendar:export')")
@Log(title = "园历管理(本一)", businessType = BusinessType.EXPORT) @Log(title = "园历管理(本一)", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(ByCalendar byCalendar) public AjaxResult export(ByCalendar byCalendar)
@ -88,7 +85,7 @@ public class ByCalendarController extends BaseController
/** /**
* 获取园历管理(本一)详细信息 * 获取园历管理(本一)详细信息
*/ */
@PreAuthorize("@ss.hasPermi('system:calendar:query')") @PreAuthorize("@ss.hasPermi('benyi:calendar:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
@ -98,18 +95,21 @@ public class ByCalendarController extends BaseController
/** /**
* 新增园历管理(本一) * 新增园历管理(本一)
*/ */
@PreAuthorize("@ss.hasPermi('system:calendar:add')") @PreAuthorize("@ss.hasPermi('benyi:calendar:add')")
@Log(title = "园历管理(本一)", businessType = BusinessType.INSERT) @Log(title = "园历管理(本一)", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ByCalendar byCalendar) public AjaxResult add(@RequestBody ByCalendar byCalendar)
{ {
byCalendar.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byCalendar.setStylecolor("red");
byCalendar.setCreatetime(new Date());
return toAjax(byCalendarService.insertByCalendar(byCalendar)); return toAjax(byCalendarService.insertByCalendar(byCalendar));
} }
/** /**
* 修改园历管理(本一) * 修改园历管理(本一)
*/ */
@PreAuthorize("@ss.hasPermi('system:calendar:edit')") @PreAuthorize("@ss.hasPermi('benyi:calendar:edit')")
@Log(title = "园历管理(本一)", businessType = BusinessType.UPDATE) @Log(title = "园历管理(本一)", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody ByCalendar byCalendar) public AjaxResult edit(@RequestBody ByCalendar byCalendar)
@ -120,7 +120,7 @@ public class ByCalendarController extends BaseController
/** /**
* 删除园历管理(本一) * 删除园历管理(本一)
*/ */
@PreAuthorize("@ss.hasPermi('system:calendar:remove')") @PreAuthorize("@ss.hasPermi('benyi:calendar:remove')")
@Log(title = "园历管理(本一)", businessType = BusinessType.DELETE) @Log(title = "园历管理(本一)", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
@ -131,7 +131,7 @@ public class ByCalendarController extends BaseController
/** /**
* 园历展示(本一) * 园历展示(本一)
*/ */
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendar:list')") //@PreAuthorize("@ss.hasPermi('benyi:schoolcalendar:list')")
@GetMapping("/getAllSchoolCalendars") @GetMapping("/getAllSchoolCalendars")
public AjaxResult getAllSchoolCalendars(ByCalendar byCalendar) { public AjaxResult getAllSchoolCalendars(ByCalendar byCalendar) {
//将类型颜色样式加载到字典 //将类型颜色样式加载到字典
@ -151,6 +151,7 @@ public class ByCalendarController extends BaseController
ByCalendarShow by = new ByCalendarShow(); ByCalendarShow by = new ByCalendarShow();
by.setId(calendar.getId()); by.setId(calendar.getId());
by.setTitle(calendar.getName()); by.setTitle(calendar.getName());
System.out.println("title:"+calendar.getName());
by.setStart(formatter.format(calendar.getActivitytime())); by.setStart(formatter.format(calendar.getActivitytime()));
by.setEnd(formatter.format(calendar.getActivityendtime())); by.setEnd(formatter.format(calendar.getActivityendtime()));
by.setColor(hashMap.get(calendar.getType())); by.setColor(hashMap.get(calendar.getType()));
@ -242,7 +243,7 @@ public class ByCalendarController extends BaseController
by.setStart(timefor); by.setStart(timefor);
by.setEnd(timefor); by.setEnd(timefor);
//教师生日颜色 //教师生日颜色
by.setColor("aqua"); by.setColor("#13c2c2");
listvi.add(by); listvi.add(by);
System.out.println("当前年工作日期timefor===" + timefor+"====="+listTeacherBirth.get(i).getUser().getNickName()+"-合同满年期限"); System.out.println("当前年工作日期timefor===" + timefor+"====="+listTeacherBirth.get(i).getUser().getNickName()+"-合同满年期限");
} }
@ -257,7 +258,7 @@ public class ByCalendarController extends BaseController
by.setStart(timefor); by.setStart(timefor);
by.setEnd(timefor); by.setEnd(timefor);
//教师生日颜色 //教师生日颜色
by.setColor("aqua"); by.setColor("#722ed1");
listvi.add(by); listvi.add(by);
System.out.println("当前年生日timefor===" + timefor+"====="+listTeacherBirth.get(i).getUser().getNickName()+"-生日"); System.out.println("当前年生日timefor===" + timefor+"====="+listTeacherBirth.get(i).getUser().getNickName()+"-生日");
} }

View File

@ -1,5 +1,6 @@
package com.ruoyi.project.benyi.controller; package com.ruoyi.project.benyi.controller;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -53,10 +54,11 @@ public class BySchoolcalendarClassController extends BaseController
startPage(); startPage();
bySchoolcalendarClass.setClassid(strClassId); bySchoolcalendarClass.setClassid(strClassId);
List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
System.out.println("---------------------分页"+list); //System.out.println("---------------------分页"+list);
return getDataTable(list); return getDataTable(list);
}else{ }else{
return null; List<BySchoolcalendarClass> list =new ArrayList<>();
return getDataTable(list);
} }
} }
@ -69,7 +71,7 @@ public class BySchoolcalendarClassController extends BaseController
public TableDataInfo listAll(BySchoolcalendarClass bySchoolcalendarClass) public TableDataInfo listAll(BySchoolcalendarClass bySchoolcalendarClass)
{ {
List<BySchoolcalendarClass> listAll = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); List<BySchoolcalendarClass> listAll = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
System.out.println("---------------------没有分页"+listAll); //System.out.println("---------------------没有分页"+listAll);
return getDataTable(listAll); return getDataTable(listAll);
} }

View File

@ -168,6 +168,7 @@ public class BySchoolcalendarController extends BaseController {
//首先判断 当前用户是否为学校 //首先判断 当前用户是否为学校
if (schoolCommon.isSchool()) { if (schoolCommon.isSchool()) {
bySchoolcalendar.setCreatetime(new Date()); bySchoolcalendar.setCreatetime(new Date());
//System.out.println("activitytime="+bySchoolcalendar.getActivitytime());
String strXnxq = schoolCommon.getCurrentXnXq(bySchoolcalendar.getActivitytime()); String strXnxq = schoolCommon.getCurrentXnXq(bySchoolcalendar.getActivitytime());
bySchoolcalendar.setXnxq(strXnxq); bySchoolcalendar.setXnxq(strXnxq);
bySchoolcalendar.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId()); bySchoolcalendar.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());

View File

@ -29,11 +29,11 @@ public class ByCalendar extends BaseEntity
private String type; private String type;
/** 活动时间 */ /** 活动时间 */
@Excel(name = "活动时间", width = 30, dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date activitytime; private Date activitytime;
/** 活动结束时间 */ /** 活动结束时间 */
@Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date activityendtime; private Date activityendtime;
/** 活动样式颜色 */ /** 活动样式颜色 */

View File

@ -61,7 +61,7 @@ public class BySchoolcalendar extends BaseEntity {
/** /**
* 活动结束时间 * 活动结束时间
*/ */
@Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date activityendtime; private Date activityendtime;
/** /**

View File

@ -48,7 +48,7 @@ public class BySchoolcalendarClass extends BaseEntity
/** /**
* 活动结束时间 * 活动结束时间
*/ */
@Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date activityendtime; private Date activityendtime;
/** /**