From 9afbfc2071183fdefd109a6dd457649edaf3988f Mon Sep 17 00:00:00 2001 From: sk1551 <15175617877@163.com> Date: Fri, 8 May 2020 17:54:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8F=AD=E7=BA=A7=E5=9B=AD?= =?UTF-8?q?=E5=8E=86=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/benyi/schoolcalendarclass.js | 9 ++++++ .../src/views/benyi/schoolcalendar/index.vue | 7 +++++ .../views/benyi/schoolcalendarclass/index.vue | 29 +++++++++++++++++-- ruoyi-ui/src/views/index.vue | 1 + .../BySchoolcalendarClassController.java | 15 +++++++--- .../benyi/BySchoolcalendarClassMapper.xml | 5 ++-- 6 files changed, 56 insertions(+), 10 deletions(-) diff --git a/ruoyi-ui/src/api/benyi/schoolcalendarclass.js b/ruoyi-ui/src/api/benyi/schoolcalendarclass.js index dccf4001a..7545be3e8 100644 --- a/ruoyi-ui/src/api/benyi/schoolcalendarclass.js +++ b/ruoyi-ui/src/api/benyi/schoolcalendarclass.js @@ -18,6 +18,15 @@ export function listSchoolcalendarclassAll(query) { }) } +// 用于显示到首页的园历信息查询 暂时不写备用状态 +// export function getSchoolCalendarsClass(query) { +// return request({ +// url: '/benyi/schoolcalendarclass/getSchoolCalendarsClass', +// method: 'get', +// params: query +// }) +// } + // 查询园历管理(班级)详细 export function getSchoolcalendarclass(id) { return request({ diff --git a/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue b/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue index 8942bfa81..7fcb7cf0e 100644 --- a/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue +++ b/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue @@ -176,6 +176,7 @@ v-model="form.activitytime" type="date" value-format="yyyy-MM-dd" + :picker-options="pickerOptions0" placeholder="选择活动时间" > @@ -228,6 +229,12 @@ export default { xnxqOptions: [], //声明方法 selectable: Function, + //禁止添加今天以前的日期 + pickerOptions0: { + disabledDate(time) { + return time.getTime() < Date.now() - 8.64e7; + } + }, // 查询参数 queryParams: { pageNum: 1, diff --git a/ruoyi-ui/src/views/benyi/schoolcalendarclass/index.vue b/ruoyi-ui/src/views/benyi/schoolcalendarclass/index.vue index 38fb03e33..1ad4970fa 100644 --- a/ruoyi-ui/src/views/benyi/schoolcalendarclass/index.vue +++ b/ruoyi-ui/src/views/benyi/schoolcalendarclass/index.vue @@ -11,7 +11,7 @@ /> - + - + @@ -107,6 +107,7 @@ icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['benyi:schoolcalendarclass:edit']" + :disabled="!checkSelectable(scope.row)" >修改 删除 @@ -148,6 +150,7 @@ v-model="form.activitytime" type="date" value-format="yyyy-MM-dd" + :picker-options="pickerOptions0" placeholder="选择活动时间"> @@ -196,6 +199,14 @@ export default { typeOptions: [], //学年学期 xnxqOptions: [], + //声明方法 + selectable: Function, + //禁止添加今天以前的日期 + pickerOptions0: { + disabledDate(time) { + return time.getTime() < Date.now() - 8.64e7; + } + }, // 查询参数 queryParams: { pageNum: 1, @@ -250,6 +261,18 @@ export default { xnxqFormat(row, column) { return this.selectDictLabel(this.xnxqOptions, row.xnxq); }, + + //控制按钮可用 + checkSelectable(row) { + var date = new Date(); + //console.log(date.toLocaleDateString()); + return this.CompareDate(row.activitytime, date.toLocaleDateString()); + }, + //比较日期大小 + CompareDate(d1, d2) { + return new Date(d1.replace(/-/g, "/")) > new Date(d2.replace(/-/g, "/")); + }, + // 取消按钮 cancel() { this.open = false; diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index a524a69b1..6002cf75e 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -50,6 +50,7 @@ import RaddarChart from "./dashboard/RaddarChart"; import PieChart from "./dashboard/PieChart"; import BarChart from "./dashboard/BarChart"; import { getSchoolCalendars } from "@/api/benyi/schoolcalendar"; +//备用进行班级园历显示操作import { getSchoolCalendarsClass } from "@/api/benyi/schoolcalendarclass"; export default { name: "Index", 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 2a44d07ca..9f000ca4f 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 @@ -48,10 +48,17 @@ public class BySchoolcalendarClassController extends BaseController @GetMapping("/list") public TableDataInfo list(BySchoolcalendarClass bySchoolcalendarClass) { - startPage(); - List list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); - System.out.println("---------------------分页"+list); - return getDataTable(list); + String strClassId = schoolCommon.getClassId(); + if(!schoolCommon.isStringEmpty(strClassId)){ + startPage(); + bySchoolcalendarClass.setClassid(schoolCommon.getClassId()); + List list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); + System.out.println("---------------------分页"+list); + return getDataTable(list); + }else{ + return null; + } + } /** diff --git a/ruoyi/src/main/resources/mybatis/benyi/BySchoolcalendarClassMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/BySchoolcalendarClassMapper.xml index a785074ff..827f04447 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/BySchoolcalendarClassMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/BySchoolcalendarClassMapper.xml @@ -44,10 +44,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"