通知公告
parent
7579ef4e4a
commit
edb71a511a
@ -0,0 +1,27 @@
|
||||
package com.ibeetl.jlw.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ibeetl.jlw.entity.*;
|
||||
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery;
|
||||
|
||||
import org.beetl.sql.mapper.annotation.SqlResource;
|
||||
import org.beetl.sql.mapper.BaseMapper;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.beetl.sql.mapper.annotation.Update;
|
||||
|
||||
/**
|
||||
* 通知公告 Dao
|
||||
*/
|
||||
@SqlResource("jlw.teacherOpenCourseNotice")
|
||||
public interface TeacherOpenCourseNoticeDao extends BaseMapper<TeacherOpenCourseNotice>{
|
||||
PageQuery<TeacherOpenCourseNotice> queryByCondition(PageQuery query);
|
||||
PageQuery<TeacherOpenCourseNotice> queryByConditionQuery(PageQuery query);
|
||||
@Update
|
||||
void deleteTeacherOpenCourseNoticeByIds(String ids);
|
||||
@Update
|
||||
int updateGivenByIds(TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery);
|
||||
List<TeacherOpenCourseNotice> getByIds(String ids);
|
||||
List<TeacherOpenCourseNotice> getValuesByQuery(TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery);
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
package com.ibeetl.jlw.service;
|
||||
|
||||
import java.io.*;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import cn.jlw.util.ToolUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ibeetl.admin.core.entity.CoreUser;
|
||||
import com.ibeetl.admin.core.util.TimeTool;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import com.ibeetl.admin.core.web.JsonReturnCode;
|
||||
import com.ibeetl.jlw.dao.TeacherOpenCourseNoticeDao;
|
||||
import com.ibeetl.jlw.entity.TeacherOpenCourseNotice;
|
||||
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery;
|
||||
import com.ibeetl.jlw.entity.FileEntity;
|
||||
|
||||
import com.ibeetl.admin.core.service.CoreBaseService;
|
||||
import com.ibeetl.admin.core.util.PlatformException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.beetl.sql.core.SqlId;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 通知公告 Service
|
||||
* 当分布式ID开启后请勿使用insert(*,true)
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
@Validated
|
||||
public class TeacherOpenCourseNoticeService extends CoreBaseService<TeacherOpenCourseNotice>{
|
||||
|
||||
@Resource private TeacherOpenCourseNoticeDao teacherOpenCourseNoticeDao;
|
||||
|
||||
public PageQuery<TeacherOpenCourseNotice>queryByCondition(PageQuery query){
|
||||
PageQuery ret = teacherOpenCourseNoticeDao.queryByCondition(query);
|
||||
queryListAfter(ret.getList());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public PageQuery<TeacherOpenCourseNotice>queryByConditionQuery(PageQuery query){
|
||||
PageQuery ret = teacherOpenCourseNoticeDao.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)){
|
||||
teacherOpenCourseNoticeDao.deleteTeacherOpenCourseNoticeByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteTeacherOpenCourseNotice(String ids){
|
||||
try {
|
||||
teacherOpenCourseNoticeDao.deleteTeacherOpenCourseNoticeByIds(ids);
|
||||
} catch (Exception e) {
|
||||
throw new PlatformException("批量删除通知公告失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
public String addAll(TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery){
|
||||
String msg = "";
|
||||
List<TeacherOpenCourseNotice> teacherOpenCourseNoticeList = new ArrayList<>();
|
||||
try {
|
||||
teacherOpenCourseNoticeList = JSON.parseArray(teacherOpenCourseNoticeQuery.getTeacherOpenCourseNoticeJsonStr(), TeacherOpenCourseNotice.class);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
teacherOpenCourseNoticeList.add(JSONObject.parseObject(teacherOpenCourseNoticeQuery.getTeacherOpenCourseNoticeJsonStr(), TeacherOpenCourseNotice.class));
|
||||
} catch (Exception e1) {}
|
||||
}
|
||||
ToolUtils.deleteNullList(teacherOpenCourseNoticeList);
|
||||
if(null != teacherOpenCourseNoticeList && teacherOpenCourseNoticeList.size()>0){
|
||||
for(int i=0;i<teacherOpenCourseNoticeList.size();i++){
|
||||
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeList.get(i);
|
||||
teacherOpenCourseNotice.setUserId(teacherOpenCourseNoticeQuery.getUserId());
|
||||
teacherOpenCourseNotice.setOrgId(teacherOpenCourseNoticeQuery.getOrgId());
|
||||
}
|
||||
insertBatch(teacherOpenCourseNoticeList);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public JsonResult add(TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery){
|
||||
String msg = "";
|
||||
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeQuery.pojo();
|
||||
teacherOpenCourseNoticeDao.insert(teacherOpenCourseNotice);
|
||||
teacherOpenCourseNoticeQuery.setTeacherOpenCourseNoticeId(teacherOpenCourseNotice.getTeacherOpenCourseNoticeId());
|
||||
JsonResult jsonResult = new JsonResult();
|
||||
jsonResult.setData(teacherOpenCourseNotice.getTeacherOpenCourseNoticeId());//自增的ID丢进去
|
||||
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
|
||||
jsonResult.setMsg(msg);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
public String edit(TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery){
|
||||
String msg = "";
|
||||
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeQuery.pojo();
|
||||
teacherOpenCourseNoticeDao.updateTemplateById(teacherOpenCourseNotice);
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String updateGivenByIds(TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery){
|
||||
String msg = "";
|
||||
if(StringUtils.isNotBlank(teacherOpenCourseNoticeQuery.get_given())){
|
||||
boolean flag = teacherOpenCourseNoticeDao.updateGivenByIds(teacherOpenCourseNoticeQuery) > 0;
|
||||
if(!flag){
|
||||
msg = "更新指定参数失败";
|
||||
}
|
||||
}else{
|
||||
msg = "指定参数为空";
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public List<TeacherOpenCourseNotice> getValues (Object paras){
|
||||
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseNotice.getTeacherOpenCourseNoticeValues"), TeacherOpenCourseNotice.class, paras);
|
||||
}
|
||||
|
||||
public List<TeacherOpenCourseNotice> getValuesByQuery (TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery){
|
||||
return teacherOpenCourseNoticeDao.getValuesByQuery(teacherOpenCourseNoticeQuery);
|
||||
}
|
||||
|
||||
public TeacherOpenCourseNotice getInfo (Long teacherOpenCourseNoticeId){
|
||||
TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery();
|
||||
teacherOpenCourseNoticeQuery.setTeacherOpenCourseNoticeId(teacherOpenCourseNoticeId);
|
||||
List<TeacherOpenCourseNotice> list = teacherOpenCourseNoticeDao.getValuesByQuery(teacherOpenCourseNoticeQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public TeacherOpenCourseNotice getInfo (TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery){
|
||||
List<TeacherOpenCourseNotice> list = teacherOpenCourseNoticeDao.getValuesByQuery(teacherOpenCourseNoticeQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ibeetl.jlw.web;
|
||||
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 统计分析web
|
||||
*
|
||||
* @Version 0.0.1
|
||||
* @Author 许良彤
|
||||
* @Date 2022/10/6 11:08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/statisticalAnalysis")
|
||||
public class StatisticalAnalysisController {
|
||||
|
||||
@RequestMapping("/detail")
|
||||
public JsonResult<Object> detail(@RequestBody Map<String, Object> map) {
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,224 @@
|
||||
package com.ibeetl.jlw.web;
|
||||
|
||||
import cn.jlw.Interceptor.RFile;
|
||||
import cn.jlw.Interceptor.SCoreUser;
|
||||
import cn.jlw.Interceptor.GetFile;
|
||||
import cn.jlw.util.ToolUtils;
|
||||
import cn.jlw.validate.ValidateConfig;
|
||||
import com.ibeetl.admin.core.entity.CoreUser;
|
||||
import com.ibeetl.admin.core.file.FileService;
|
||||
import com.ibeetl.admin.core.util.ConvertUtil;
|
||||
import com.ibeetl.admin.core.util.PlatformException;
|
||||
import com.ibeetl.admin.core.util.TimeTool;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
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.validation.annotation.Validated;
|
||||
|
||||
import com.ibeetl.admin.console.web.dto.DictExcelImportData;
|
||||
import com.ibeetl.admin.console.web.query.UserQuery;
|
||||
import com.ibeetl.admin.core.annotation.Function;
|
||||
import com.ibeetl.jlw.entity.*;
|
||||
import com.ibeetl.jlw.service.*;
|
||||
import com.ibeetl.jlw.web.query.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 通知公告 教师-课程开课-通知公告 接口
|
||||
* 切记不要对非线程安全的静态变量进行写操作
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class TeacherOpenCourseNoticeController{
|
||||
|
||||
private final Log log = LogFactory.getLog(this.getClass());
|
||||
private static final String MODEL = "/jlw/teacherOpenCourseNotice";
|
||||
private static final String API = "/api/teacherOpenCourseNotice";
|
||||
|
||||
|
||||
@Resource private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService;
|
||||
|
||||
@Resource FileService fileService;
|
||||
|
||||
/* 前端接口 */
|
||||
|
||||
@PostMapping(API + "/getPageList.do")
|
||||
public JsonResult<PageQuery> getPageList(TeacherOpenCourseNoticeQuery condition,@SCoreUser CoreUser coreUser){
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
PageQuery page = condition.getPageQuery();
|
||||
teacherOpenCourseNoticeService.queryByConditionQuery(page);
|
||||
return JsonResult.success(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(API + "/getInfo.do")
|
||||
public JsonResult<TeacherOpenCourseNotice>getInfo(TeacherOpenCourseNoticeQuery param,@SCoreUser CoreUser coreUser) {
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeService.getInfo(param);
|
||||
return JsonResult.success(teacherOpenCourseNotice);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(API + "/getList.do")
|
||||
public JsonResult<List<TeacherOpenCourseNotice>>getList(TeacherOpenCourseNoticeQuery param,@SCoreUser CoreUser coreUser) {
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
List<TeacherOpenCourseNotice>list = teacherOpenCourseNoticeService.getValuesByQuery(param);
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 后台页面 */
|
||||
|
||||
@GetMapping(MODEL + "/index.do")
|
||||
@Function("teacherOpenCourseNotice.query")
|
||||
public ModelAndView index() {
|
||||
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseNotice/index.html") ;
|
||||
view.addObject("search", TeacherOpenCourseNoticeQuery.class.getName());
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/edit.do")
|
||||
@Function("teacherOpenCourseNotice.edit")
|
||||
public ModelAndView edit(Long teacherOpenCourseNoticeId) {
|
||||
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseNotice/edit.html");
|
||||
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeService.queryById(teacherOpenCourseNoticeId);
|
||||
view.addObject("teacherOpenCourseNotice", teacherOpenCourseNotice);
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/add.do")
|
||||
@Function("teacherOpenCourseNotice.add")
|
||||
public ModelAndView add(Long teacherOpenCourseNoticeId) {
|
||||
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseNotice/add.html");
|
||||
if(null != teacherOpenCourseNoticeId){
|
||||
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeService.queryById(teacherOpenCourseNoticeId);
|
||||
view.addObject("teacherOpenCourseNotice", teacherOpenCourseNotice);
|
||||
}else {
|
||||
view.addObject("teacherOpenCourseNotice", new TeacherOpenCourseNotice());
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
/* 后台接口 */
|
||||
|
||||
@PostMapping(MODEL + "/list.json")
|
||||
@Function("teacherOpenCourseNotice.query")
|
||||
public JsonResult<PageQuery> list(TeacherOpenCourseNoticeQuery condition){
|
||||
PageQuery page = condition.getPageQuery();
|
||||
teacherOpenCourseNoticeService.queryByCondition(page);
|
||||
return JsonResult.success(page);
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/addAll.json")
|
||||
@Function("teacherOpenCourseNotice.add")
|
||||
public JsonResult addAll(TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery,@SCoreUser CoreUser coreUser){
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
teacherOpenCourseNoticeQuery.setUserId(coreUser.getId());
|
||||
teacherOpenCourseNoticeQuery.setOrgId(coreUser.getOrgId());
|
||||
String msg = teacherOpenCourseNoticeService.addAll(teacherOpenCourseNoticeQuery);
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
return JsonResult.success();
|
||||
} else {
|
||||
return JsonResult.failMessage("新增失败,"+msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/add.json")
|
||||
@Function("teacherOpenCourseNotice.add")
|
||||
public JsonResult add(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery, BindingResult result,@SCoreUser CoreUser coreUser){
|
||||
if(result.hasErrors()){
|
||||
return JsonResult.failMessage(result);
|
||||
}else{
|
||||
teacherOpenCourseNoticeQuery.setUserId(coreUser.getId());
|
||||
teacherOpenCourseNoticeQuery.setOrgId(coreUser.getOrgId());
|
||||
return teacherOpenCourseNoticeService.add(teacherOpenCourseNoticeQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/edit.json")
|
||||
@Function("teacherOpenCourseNotice.edit")
|
||||
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery, BindingResult result) {
|
||||
if(result.hasErrors()){
|
||||
return JsonResult.failMessage(result);
|
||||
}else {
|
||||
teacherOpenCourseNoticeQuery.setUserId(null);
|
||||
teacherOpenCourseNoticeQuery.setOrgId(null);
|
||||
String msg = teacherOpenCourseNoticeService.edit(teacherOpenCourseNoticeQuery);
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
return JsonResult.success();
|
||||
} else {
|
||||
return JsonResult.failMessage("更新失败,"+msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(MODEL + "/view.json")
|
||||
@Function("teacherOpenCourseNotice.query")
|
||||
public JsonResult<TeacherOpenCourseNotice>queryInfo(Long teacherOpenCourseNoticeId) {
|
||||
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeService.queryById( teacherOpenCourseNoticeId);
|
||||
return JsonResult.success(teacherOpenCourseNotice);
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/getValues.json")
|
||||
@Function("teacherOpenCourseNotice.query")
|
||||
public JsonResult<List<TeacherOpenCourseNotice>>getValues(TeacherOpenCourseNoticeQuery param) {
|
||||
List<TeacherOpenCourseNotice>list = teacherOpenCourseNoticeService.getValuesByQuery(param);
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(MODEL + "/delete.json")
|
||||
@Function("teacherOpenCourseNotice.delete")
|
||||
@ResponseBody
|
||||
public JsonResult delete(String ids) {
|
||||
teacherOpenCourseNoticeService.deleteTeacherOpenCourseNotice(ids);
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
layui.define([ 'form', 'laydate', 'table','teacherOpenCourseNoticeApi', 'layedit'], function(exports) {
|
||||
var form = layui.form;
|
||||
var teacherOpenCourseNoticeApi = layui.teacherOpenCourseNoticeApi;
|
||||
var index = layui.index;
|
||||
var layeidt = layui.layedit;
|
||||
var one = layeidt.build('noticeContent');
|
||||
var view = {
|
||||
init:function(){
|
||||
Lib.initGenrealForm($("#addForm"),form);
|
||||
this.initSubmit();
|
||||
},
|
||||
initSubmit:function(){
|
||||
$("#addButton").click(function(){
|
||||
form.on('submit(form)', function(){
|
||||
var teacherOpenCourseNoticeId = $("#addForm input[name='teacherOpenCourseNoticeId']").val();
|
||||
if(!$.isEmpty(teacherOpenCourseNoticeId)){
|
||||
teacherOpenCourseNoticeApi.updateTeacherOpenCourseNotice($('#addForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("更新成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}else{
|
||||
teacherOpenCourseNoticeApi.addTeacherOpenCourseNotice($('#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', 'teacherOpenCourseNoticeApi'], function(exports) {
|
||||
var teacherOpenCourseNoticeApi = layui.teacherOpenCourseNoticeApi;
|
||||
var table=layui.table;
|
||||
var view = {
|
||||
init:function(){
|
||||
},
|
||||
delBatch:function(){
|
||||
var data = Common.getMoreDataFromTable(table,"teacherOpenCourseNoticeTable");
|
||||
if(data==null){
|
||||
return ;
|
||||
}
|
||||
Common.openConfirm("确认要删除这些通知公告?",function(){
|
||||
var ids =Common.concatBatchId(data,"teacherOpenCourseNoticeId");
|
||||
teacherOpenCourseNoticeApi.del(ids,function(){
|
||||
Common.info("删除成功");
|
||||
dataReload();
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
exports('del',view);
|
||||
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
layui.define([ 'form', 'laydate', 'table','teacherOpenCourseNoticeApi'], function(exports) {
|
||||
var form = layui.form;
|
||||
var teacherOpenCourseNoticeApi = layui.teacherOpenCourseNoticeApi;
|
||||
var index = layui.index;
|
||||
var view = {
|
||||
init:function(){
|
||||
Lib.initGenrealForm($("#updateForm"),form);
|
||||
this.initSubmit();
|
||||
},
|
||||
initSubmit:function(){
|
||||
$("#updateButton").click(function(){
|
||||
form.on('submit(form)', function(){
|
||||
teacherOpenCourseNoticeApi.updateTeacherOpenCourseNotice($('#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={
|
||||
updateTeacherOpenCourseNotice:function(form,callback){
|
||||
Lib.submitForm("/jlw/teacherOpenCourseNotice/edit.json",form,{},callback)
|
||||
},
|
||||
addTeacherOpenCourseNotice:function(form,callback){
|
||||
Lib.submitForm("/jlw/teacherOpenCourseNotice/add.json",form,{},callback)
|
||||
},
|
||||
del:function(ids,callback){
|
||||
Common.post("/jlw/teacherOpenCourseNotice/delete.json",{"ids":ids},function(){
|
||||
callback();
|
||||
})
|
||||
}
|
||||
|
||||
};
|
||||
exports('teacherOpenCourseNoticeApi',api);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseNotice/"}){ -->
|
||||
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
|
||||
</layui:searchForm>
|
||||
<table id="teacherOpenCourseNoticeTable" lay-filter="teacherOpenCourseNoticeTable"></table>
|
||||
<!--#} -->
|
||||
|
||||
<script type="text/html" id="toolbar_teacherOpenCourseNotice">
|
||||
<div class="layui-btn-container">
|
||||
<div class="layui-btn-group" >
|
||||
<!--# if(core.searchIsShow(search)) {-->
|
||||
<layui:accessButton function="teacherOpenCourseNotice.query" id="searchFormSearch" action="search"><i class="layui-icon"></i>搜索</layui:accessButton>
|
||||
<!--# }-->
|
||||
<layui:accessButton function="teacherOpenCourseNotice.add" action="add">添加</layui:accessButton>
|
||||
<layui:accessButton function="teacherOpenCourseNotice.edit" action="edit">修改</layui:accessButton>
|
||||
<layui:accessButton function="teacherOpenCourseNotice.del" action="del">删除</layui:accessButton>
|
||||
<!--# if(!isEmpty(search)) {-->
|
||||
<layui:accessButton function="teacherOpenCourseNotice.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