重写排课表
parent
6d3dd5a1a8
commit
6132346d5c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"dev": {
|
||||
"baseURL": "http://localhost:9090/server/",
|
||||
"session": "D64E087EB7B2831DC53FA03A02F2C0FF"
|
||||
"session": "0DA92B7ABBDC4AFB7B6358E5DCBC6C2D"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@
|
||||
package com.ibeetl.jlw.dao;
|
||||
|
||||
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionSnap;
|
||||
import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionSnapQuery;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.beetl.sql.mapper.BaseMapper;
|
||||
import org.beetl.sql.mapper.annotation.SqlResource;
|
||||
import org.beetl.sql.mapper.annotation.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 课表快照 Dao
|
||||
*/
|
||||
@SqlResource("jlw.teacherOpenCourseScheduleSessionSnap")
|
||||
public interface TeacherOpenCourseScheduleSessionSnapDao extends BaseMapper<TeacherOpenCourseScheduleSessionSnap>{
|
||||
PageQuery<TeacherOpenCourseScheduleSessionSnap> queryByCondition(PageQuery query);
|
||||
PageQuery<TeacherOpenCourseScheduleSessionSnap> queryByConditionQuery(PageQuery query);
|
||||
@Update
|
||||
void deleteTeacherOpenCourseScheduleSessionSnapByIds(String ids);
|
||||
@Update
|
||||
void deleteByIds(String ids);
|
||||
@Update
|
||||
int updateGivenByIds(TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery);
|
||||
List<TeacherOpenCourseScheduleSessionSnap> getByIds(String ids);
|
||||
List<TeacherOpenCourseScheduleSessionSnap> getValuesByQuery(TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery);
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package com.ibeetl.jlw.service;
|
||||
|
||||
import cn.jlw.util.ToolUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ibeetl.admin.core.service.CoreBaseService;
|
||||
import com.ibeetl.admin.core.util.PlatformException;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import com.ibeetl.admin.core.web.JsonReturnCode;
|
||||
import com.ibeetl.jlw.dao.TeacherOpenCourseScheduleSessionSnapDao;
|
||||
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionSnap;
|
||||
import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionSnapQuery;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.beetl.sql.core.SqlId;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 课表快照 Service
|
||||
* 当分布式ID开启后请勿使用insert(*,true)
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class TeacherOpenCourseScheduleSessionSnapService extends CoreBaseService<TeacherOpenCourseScheduleSessionSnap>{
|
||||
|
||||
@Resource private TeacherOpenCourseScheduleSessionSnapDao teacherOpenCourseScheduleSessionSnapDao;
|
||||
|
||||
public PageQuery<TeacherOpenCourseScheduleSessionSnap>queryByCondition(PageQuery query){
|
||||
PageQuery ret = teacherOpenCourseScheduleSessionSnapDao.queryByCondition(query);
|
||||
queryListAfter(ret.getList());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public PageQuery<TeacherOpenCourseScheduleSessionSnap>queryByConditionQuery(PageQuery query){
|
||||
PageQuery ret = teacherOpenCourseScheduleSessionSnapDao.queryByConditionQuery(query);
|
||||
queryListAfter(ret.getList());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void deleteByList(List list){
|
||||
String ids = "";
|
||||
ToolUtils.deleteNullList(list);
|
||||
for(int i=0;null != list && i<list.size();i++){
|
||||
ids += list.get(i).toString()+(i==list.size()-1?"":",");
|
||||
}
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
teacherOpenCourseScheduleSessionSnapDao.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteTeacherOpenCourseScheduleSessionSnap(String ids){
|
||||
try {
|
||||
teacherOpenCourseScheduleSessionSnapDao.deleteTeacherOpenCourseScheduleSessionSnapByIds(ids);
|
||||
} catch (Exception e) {
|
||||
throw new PlatformException("批量删除课表快照失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
public String addAll(TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery){
|
||||
String msg = "";
|
||||
List<TeacherOpenCourseScheduleSessionSnap> teacherOpenCourseScheduleSessionSnapList = new ArrayList<>();
|
||||
try {
|
||||
teacherOpenCourseScheduleSessionSnapList = JSON.parseArray(teacherOpenCourseScheduleSessionSnapQuery.getTeacherOpenCourseScheduleSessionSnapJsonStr(), TeacherOpenCourseScheduleSessionSnap.class);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
teacherOpenCourseScheduleSessionSnapList.add(JSONObject.parseObject(teacherOpenCourseScheduleSessionSnapQuery.getTeacherOpenCourseScheduleSessionSnapJsonStr(), TeacherOpenCourseScheduleSessionSnap.class));
|
||||
} catch (Exception e1) {}
|
||||
}
|
||||
ToolUtils.deleteNullList(teacherOpenCourseScheduleSessionSnapList);
|
||||
if(null != teacherOpenCourseScheduleSessionSnapList && teacherOpenCourseScheduleSessionSnapList.size()>0){
|
||||
for(int i=0;i<teacherOpenCourseScheduleSessionSnapList.size();i++){
|
||||
TeacherOpenCourseScheduleSessionSnap teacherOpenCourseScheduleSessionSnap = teacherOpenCourseScheduleSessionSnapList.get(i);
|
||||
teacherOpenCourseScheduleSessionSnap.setUserId(teacherOpenCourseScheduleSessionSnapQuery.getUserId());
|
||||
teacherOpenCourseScheduleSessionSnap.setOrgId(teacherOpenCourseScheduleSessionSnapQuery.getOrgId());
|
||||
}
|
||||
insertBatch(teacherOpenCourseScheduleSessionSnapList);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public JsonResult add(TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery){
|
||||
String msg = "";
|
||||
TeacherOpenCourseScheduleSessionSnap teacherOpenCourseScheduleSessionSnap = teacherOpenCourseScheduleSessionSnapQuery.pojo();
|
||||
teacherOpenCourseScheduleSessionSnapDao.insert(teacherOpenCourseScheduleSessionSnap);
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setTeacherOpenCourseScheduleSessionSnapId(teacherOpenCourseScheduleSessionSnap.getTeacherOpenCourseScheduleSessionSnapId());
|
||||
JsonResult jsonResult = new JsonResult();
|
||||
jsonResult.setData(teacherOpenCourseScheduleSessionSnap.getTeacherOpenCourseScheduleSessionSnapId());//自增的ID丢进去
|
||||
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
|
||||
jsonResult.setMsg(msg);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
public String edit(TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery){
|
||||
String msg = "";
|
||||
TeacherOpenCourseScheduleSessionSnap teacherOpenCourseScheduleSessionSnap = teacherOpenCourseScheduleSessionSnapQuery.pojo();
|
||||
teacherOpenCourseScheduleSessionSnapDao.updateTemplateById(teacherOpenCourseScheduleSessionSnap);
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String updateGivenByIds(TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery){
|
||||
String msg = "";
|
||||
if(StringUtils.isNotBlank(teacherOpenCourseScheduleSessionSnapQuery.get_given())){
|
||||
boolean flag = teacherOpenCourseScheduleSessionSnapDao.updateGivenByIds(teacherOpenCourseScheduleSessionSnapQuery) > 0;
|
||||
if(!flag){
|
||||
msg = "更新指定参数失败";
|
||||
}
|
||||
}else{
|
||||
msg = "指定参数为空";
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public List<TeacherOpenCourseScheduleSessionSnap> getValues (Object paras){
|
||||
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseScheduleSessionSnap.getTeacherOpenCourseScheduleSessionSnapValues"), TeacherOpenCourseScheduleSessionSnap.class, paras);
|
||||
}
|
||||
|
||||
public List<TeacherOpenCourseScheduleSessionSnap> getValuesByQuery (TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery){
|
||||
return teacherOpenCourseScheduleSessionSnapDao.getValuesByQuery(teacherOpenCourseScheduleSessionSnapQuery);
|
||||
}
|
||||
|
||||
public TeacherOpenCourseScheduleSessionSnap getInfo (Long teacherOpenCourseScheduleSessionSnapId){
|
||||
TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery = new TeacherOpenCourseScheduleSessionSnapQuery();
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setTeacherOpenCourseScheduleSessionSnapId(teacherOpenCourseScheduleSessionSnapId);
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setTeacherOpenCourseScheduleSessionSnapStatusPlural("1,2");//需要根据实际情况来
|
||||
List<TeacherOpenCourseScheduleSessionSnap> list = teacherOpenCourseScheduleSessionSnapDao.getValuesByQuery(teacherOpenCourseScheduleSessionSnapQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public TeacherOpenCourseScheduleSessionSnap getInfo (TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery){
|
||||
List<TeacherOpenCourseScheduleSessionSnap> list = teacherOpenCourseScheduleSessionSnapDao.getValuesByQuery(teacherOpenCourseScheduleSessionSnapQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
package com.ibeetl.jlw.web;
|
||||
|
||||
import cn.jlw.Interceptor.SCoreUser;
|
||||
import cn.jlw.validate.ValidateConfig;
|
||||
import com.ibeetl.admin.core.annotation.Function;
|
||||
import com.ibeetl.admin.core.entity.CoreUser;
|
||||
import com.ibeetl.admin.core.file.FileService;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionSnap;
|
||||
import com.ibeetl.jlw.service.TeacherOpenCourseScheduleSessionSnapService;
|
||||
import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionSnapQuery;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 课表快照 课程开课-排课管理-课表--属性快照 接口
|
||||
* 切记不要对非线程安全的静态变量进行写操作
|
||||
*/
|
||||
|
||||
@RestController
|
||||
public class TeacherOpenCourseScheduleSessionSnapController{
|
||||
|
||||
private final Log log = LogFactory.getLog(this.getClass());
|
||||
private static final String MODEL = "/jlw/teacherOpenCourseScheduleSessionSnap";
|
||||
private static final String API = "/api/teacherOpenCourseScheduleSessionSnap";
|
||||
|
||||
|
||||
@Resource private TeacherOpenCourseScheduleSessionSnapService teacherOpenCourseScheduleSessionSnapService;
|
||||
|
||||
@Resource FileService fileService;
|
||||
|
||||
/* 前端接口 */
|
||||
|
||||
@PostMapping(API + "/getPageList.do")
|
||||
public JsonResult<PageQuery> getPageList(TeacherOpenCourseScheduleSessionSnapQuery condition,@SCoreUser CoreUser coreUser){
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
PageQuery page = condition.getPageQuery();
|
||||
teacherOpenCourseScheduleSessionSnapService.queryByConditionQuery(page);
|
||||
return JsonResult.success(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(API + "/getInfo.do")
|
||||
public JsonResult<TeacherOpenCourseScheduleSessionSnap>getInfo(TeacherOpenCourseScheduleSessionSnapQuery param,@SCoreUser CoreUser coreUser) {
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
TeacherOpenCourseScheduleSessionSnap teacherOpenCourseScheduleSessionSnap = teacherOpenCourseScheduleSessionSnapService.getInfo(param);
|
||||
return JsonResult.success(teacherOpenCourseScheduleSessionSnap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(API + "/getList.do")
|
||||
public JsonResult<List<TeacherOpenCourseScheduleSessionSnap>>getList(TeacherOpenCourseScheduleSessionSnapQuery param,@SCoreUser CoreUser coreUser) {
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
List<TeacherOpenCourseScheduleSessionSnap>list = teacherOpenCourseScheduleSessionSnapService.getValuesByQuery(param);
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 后台页面 */
|
||||
|
||||
@GetMapping(MODEL + "/index.do")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.query")
|
||||
public ModelAndView index() {
|
||||
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseScheduleSessionSnap/index.html") ;
|
||||
view.addObject("search", TeacherOpenCourseScheduleSessionSnapQuery.class.getName());
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/edit.do")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.edit")
|
||||
public ModelAndView edit(Long teacherOpenCourseScheduleSessionSnapId) {
|
||||
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseScheduleSessionSnap/edit.html");
|
||||
TeacherOpenCourseScheduleSessionSnap teacherOpenCourseScheduleSessionSnap = teacherOpenCourseScheduleSessionSnapService.queryById(teacherOpenCourseScheduleSessionSnapId);
|
||||
view.addObject("teacherOpenCourseScheduleSessionSnap", teacherOpenCourseScheduleSessionSnap);
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/add.do")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.add")
|
||||
public ModelAndView add(Long teacherOpenCourseScheduleSessionSnapId) {
|
||||
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseScheduleSessionSnap/add.html");
|
||||
if(null != teacherOpenCourseScheduleSessionSnapId){
|
||||
TeacherOpenCourseScheduleSessionSnap teacherOpenCourseScheduleSessionSnap = teacherOpenCourseScheduleSessionSnapService.queryById(teacherOpenCourseScheduleSessionSnapId);
|
||||
view.addObject("teacherOpenCourseScheduleSessionSnap", teacherOpenCourseScheduleSessionSnap);
|
||||
}else {
|
||||
view.addObject("teacherOpenCourseScheduleSessionSnap", new TeacherOpenCourseScheduleSessionSnap());
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
/* 后台接口 */
|
||||
|
||||
@PostMapping(MODEL + "/list.json")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.query")
|
||||
public JsonResult<PageQuery> list(TeacherOpenCourseScheduleSessionSnapQuery condition){
|
||||
PageQuery page = condition.getPageQuery();
|
||||
teacherOpenCourseScheduleSessionSnapService.queryByCondition(page);
|
||||
return JsonResult.success(page);
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/addAll.json")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.add")
|
||||
public JsonResult addAll(TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery,@SCoreUser CoreUser coreUser){
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setUserId(coreUser.getId());
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setOrgId(coreUser.getOrgId());
|
||||
String msg = teacherOpenCourseScheduleSessionSnapService.addAll(teacherOpenCourseScheduleSessionSnapQuery);
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
return JsonResult.success();
|
||||
} else {
|
||||
return JsonResult.failMessage("新增失败,"+msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/add.json")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.add")
|
||||
public JsonResult add(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery, BindingResult result,@SCoreUser CoreUser coreUser){
|
||||
if(result.hasErrors()){
|
||||
return JsonResult.failMessage(result);
|
||||
}else{
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setUserId(coreUser.getId());
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setOrgId(coreUser.getOrgId());
|
||||
if(null == teacherOpenCourseScheduleSessionSnapQuery.getTeacherOpenCourseScheduleSessionSnapStatus()){
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setTeacherOpenCourseScheduleSessionSnapStatus(1);
|
||||
}
|
||||
return teacherOpenCourseScheduleSessionSnapService.add(teacherOpenCourseScheduleSessionSnapQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/edit.json")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.edit")
|
||||
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) TeacherOpenCourseScheduleSessionSnapQuery teacherOpenCourseScheduleSessionSnapQuery, BindingResult result) {
|
||||
if(result.hasErrors()){
|
||||
return JsonResult.failMessage(result);
|
||||
}else {
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setUserId(null);
|
||||
teacherOpenCourseScheduleSessionSnapQuery.setOrgId(null);
|
||||
String msg = teacherOpenCourseScheduleSessionSnapService.edit(teacherOpenCourseScheduleSessionSnapQuery);
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
return JsonResult.success();
|
||||
} else {
|
||||
return JsonResult.failMessage("更新失败,"+msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(MODEL + "/view.json")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.query")
|
||||
public JsonResult<TeacherOpenCourseScheduleSessionSnap>queryInfo(Long teacherOpenCourseScheduleSessionSnapId) {
|
||||
TeacherOpenCourseScheduleSessionSnap teacherOpenCourseScheduleSessionSnap = teacherOpenCourseScheduleSessionSnapService.queryById( teacherOpenCourseScheduleSessionSnapId);
|
||||
return JsonResult.success(teacherOpenCourseScheduleSessionSnap);
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/getValues.json")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.query")
|
||||
public JsonResult<List<TeacherOpenCourseScheduleSessionSnap>>getValues(TeacherOpenCourseScheduleSessionSnapQuery param) {
|
||||
List<TeacherOpenCourseScheduleSessionSnap>list = teacherOpenCourseScheduleSessionSnapService.getValuesByQuery(param);
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(MODEL + "/delete.json")
|
||||
@Function("teacherOpenCourseScheduleSessionSnap.delete")
|
||||
@ResponseBody
|
||||
public JsonResult delete(String ids) {
|
||||
teacherOpenCourseScheduleSessionSnapService.deleteTeacherOpenCourseScheduleSessionSnap(ids);
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
layui.define([ 'form', 'laydate', 'table','teacherOpenCourseScheduleSessionSnapApi'], function(exports) {
|
||||
var form = layui.form;
|
||||
var teacherOpenCourseScheduleSessionSnapApi = layui.teacherOpenCourseScheduleSessionSnapApi;
|
||||
var index = layui.index;
|
||||
var view = {
|
||||
init:function(){
|
||||
Lib.initGenrealForm($("#addForm"),form);
|
||||
this.initSubmit();
|
||||
},
|
||||
initSubmit:function(){
|
||||
$("#addButton").click(function(){
|
||||
form.on('submit(form)', function(){
|
||||
var teacherOpenCourseScheduleSessionSnapId = $("#addForm input[name='teacherOpenCourseScheduleSessionSnapId']").val();
|
||||
if(!$.isEmpty(teacherOpenCourseScheduleSessionSnapId)){
|
||||
teacherOpenCourseScheduleSessionSnapApi.updateTeacherOpenCourseScheduleSessionSnap($('#addForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("更新成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}else{
|
||||
teacherOpenCourseScheduleSessionSnapApi.addTeacherOpenCourseScheduleSessionSnap($('#addForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("添加成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$("#addButton-cancel").click(function(){
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
exports('add',view);
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
layui.define(['table', 'teacherOpenCourseScheduleSessionSnapApi'], function(exports) {
|
||||
var teacherOpenCourseScheduleSessionSnapApi = layui.teacherOpenCourseScheduleSessionSnapApi;
|
||||
var table=layui.table;
|
||||
var view = {
|
||||
init:function(){
|
||||
},
|
||||
delBatch:function(){
|
||||
var data = Common.getMoreDataFromTable(table,"teacherOpenCourseScheduleSessionSnapTable");
|
||||
if(data==null){
|
||||
return ;
|
||||
}
|
||||
Common.openConfirm("确认要删除这些课表快照?",function(){
|
||||
var ids =Common.concatBatchId(data,"teacherOpenCourseScheduleSessionSnapId");
|
||||
teacherOpenCourseScheduleSessionSnapApi.del(ids,function(){
|
||||
Common.info("删除成功");
|
||||
dataReload();
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
exports('del',view);
|
||||
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
layui.define([ 'form', 'laydate', 'table','teacherOpenCourseScheduleSessionSnapApi'], function(exports) {
|
||||
var form = layui.form;
|
||||
var teacherOpenCourseScheduleSessionSnapApi = layui.teacherOpenCourseScheduleSessionSnapApi;
|
||||
var index = layui.index;
|
||||
var view = {
|
||||
init:function(){
|
||||
Lib.initGenrealForm($("#updateForm"),form);
|
||||
this.initSubmit();
|
||||
},
|
||||
initSubmit:function(){
|
||||
$("#updateButton").click(function(){
|
||||
form.on('submit(form)', function(){
|
||||
teacherOpenCourseScheduleSessionSnapApi.updateTeacherOpenCourseScheduleSessionSnap($('#updateForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("更新成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
});
|
||||
});
|
||||
$("#updateButton-cancel").click(function(){
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
exports('edit',view);
|
||||
|
||||
});
|
@ -0,0 +1,18 @@
|
||||
/*访问后台的代码*/
|
||||
layui.define([], function(exports) {
|
||||
var api={
|
||||
updateTeacherOpenCourseScheduleSessionSnap:function(form,callback){
|
||||
Lib.submitForm("/jlw/teacherOpenCourseScheduleSessionSnap/edit.json",form,{},callback)
|
||||
},
|
||||
addTeacherOpenCourseScheduleSessionSnap:function(form,callback){
|
||||
Lib.submitForm("/jlw/teacherOpenCourseScheduleSessionSnap/add.json",form,{},callback)
|
||||
},
|
||||
del:function(ids,callback){
|
||||
Common.post("/jlw/teacherOpenCourseScheduleSessionSnap/delete.json",{"ids":ids},function(){
|
||||
callback();
|
||||
})
|
||||
}
|
||||
|
||||
};
|
||||
exports('teacherOpenCourseScheduleSessionSnapApi',api);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseScheduleSessionSnap/"}){ -->
|
||||
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
|
||||
</layui:searchForm>
|
||||
<table id="teacherOpenCourseScheduleSessionSnapTable" lay-filter="teacherOpenCourseScheduleSessionSnapTable"></table>
|
||||
<!--#} -->
|
||||
|
||||
<script type="text/html" id="toolbar_teacherOpenCourseScheduleSessionSnap">
|
||||
<div class="layui-btn-container">
|
||||
<div class="layui-btn-group" >
|
||||
<!--# if(!isEmpty(search)) {-->
|
||||
<layui:accessButton function="teacherOpenCourseScheduleSessionSnap.query" id="searchFormSearch" action="search"><i class="layui-icon"></i>搜索</layui:accessButton>
|
||||
<!--# }-->
|
||||
<layui:accessButton function="teacherOpenCourseScheduleSessionSnap.add" action="add">添加</layui:accessButton>
|
||||
<layui:accessButton function="teacherOpenCourseScheduleSessionSnap.edit" action="edit">修改</layui:accessButton>
|
||||
<layui:accessButton function="teacherOpenCourseScheduleSessionSnap.del" action="del">删除</layui:accessButton>
|
||||
<!--# if(!isEmpty(search)) {-->
|
||||
<layui:accessButton function="teacherOpenCourseScheduleSessionSnap.query" action="refresh"><i class="layui-icon"></i>刷新</layui:accessButton>
|
||||
<!--# }-->
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
|
||||
layui.use(['index'], function(){
|
||||
var index = layui.index;
|
||||
index.init();
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue