退出bug
parent
1097a4a88f
commit
0717e9e033
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,378 @@
|
||||
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.entity.CoreUser;
|
||||
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.QuestionLogSummaryDao;
|
||||
import com.ibeetl.jlw.entity.FileEntity;
|
||||
import com.ibeetl.jlw.entity.QuestionLogSummary;
|
||||
import com.ibeetl.jlw.enums.BusinessCourseInfoEnum;
|
||||
import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum;
|
||||
import com.ibeetl.jlw.web.query.QuestionLogSummaryQuery;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
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.SqlId;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
|
||||
|
||||
/**
|
||||
* 通用题目日志汇总 Service
|
||||
* 当分布式ID开启后请勿使用insert(*,true)
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
@Validated
|
||||
public class QuestionLogSummaryService extends CoreBaseService<QuestionLogSummary>{
|
||||
|
||||
@Autowired private QuestionLogSummaryDao questionLogSummaryDao;
|
||||
|
||||
public PageQuery<QuestionLogSummary>queryByCondition(PageQuery query){
|
||||
PageQuery ret = questionLogSummaryDao.queryByCondition(query);
|
||||
queryListAfter(ret.getList());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public PageQuery<QuestionLogSummary>queryByConditionQuery(PageQuery query){
|
||||
PageQuery ret = questionLogSummaryDao.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)){
|
||||
questionLogSummaryDao.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteQuestionLogSummary(String ids){
|
||||
try {
|
||||
questionLogSummaryDao.deleteQuestionLogSummaryByIds(ids);
|
||||
} catch (Exception e) {
|
||||
throw new PlatformException("批量删除通用题目日志汇总失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
public String addAll(QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
String msg = "";
|
||||
List<QuestionLogSummary> questionLogSummaryList = new ArrayList<>();
|
||||
try {
|
||||
questionLogSummaryList = JSON.parseArray(questionLogSummaryQuery.getQuestionLogSummaryJsonStr(), QuestionLogSummary.class);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
questionLogSummaryList.add(JSONObject.parseObject(questionLogSummaryQuery.getQuestionLogSummaryJsonStr(), QuestionLogSummary.class));
|
||||
} catch (Exception e1) {}
|
||||
}
|
||||
ToolUtils.deleteNullList(questionLogSummaryList);
|
||||
if(null != questionLogSummaryList && questionLogSummaryList.size()>0){
|
||||
for(int i=0;i<questionLogSummaryList.size();i++){
|
||||
QuestionLogSummary questionLogSummary = questionLogSummaryList.get(i);
|
||||
questionLogSummary.setQuestionLogSummaryAddTime(questionLogSummaryQuery.getQuestionLogSummaryAddTime());
|
||||
questionLogSummary.setUserId(questionLogSummaryQuery.getUserId());
|
||||
questionLogSummary.setOrgId(questionLogSummaryQuery.getOrgId());
|
||||
}
|
||||
insertBatch(questionLogSummaryList);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public JsonResult add(QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
String msg = "";
|
||||
QuestionLogSummary questionLogSummary = questionLogSummaryQuery.pojo();
|
||||
questionLogSummaryDao.insert(questionLogSummary);
|
||||
questionLogSummaryQuery.setQuestionLogSummaryId(questionLogSummary.getQuestionLogSummaryId());
|
||||
JsonResult jsonResult = new JsonResult();
|
||||
jsonResult.setData(questionLogSummary.getQuestionLogSummaryId());//自增的ID丢进去
|
||||
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
|
||||
jsonResult.setMsg(msg);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
public String edit(QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
String msg = "";
|
||||
QuestionLogSummary questionLogSummary = questionLogSummaryQuery.pojo();
|
||||
questionLogSummaryDao.updateTemplateById(questionLogSummary);
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String updateGivenByIds(QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
String msg = "";
|
||||
if(StringUtils.isNotBlank(questionLogSummaryQuery.get_given())){
|
||||
boolean flag = questionLogSummaryDao.updateGivenByIds(questionLogSummaryQuery) > 0;
|
||||
if(!flag){
|
||||
msg = "更新指定参数失败";
|
||||
}
|
||||
}else{
|
||||
msg = "指定参数为空";
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public List<QuestionLogSummary> getValues (Object paras){
|
||||
return sqlManager.select(SqlId.of("jlw.questionLogSummary.getQuestionLogSummaryValues"), QuestionLogSummary.class, paras);
|
||||
}
|
||||
|
||||
public List<QuestionLogSummary> getValuesByQuery (QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
return questionLogSummaryDao.getValuesByQuery(questionLogSummaryQuery);
|
||||
}
|
||||
|
||||
public List<QuestionLogSummary> getValuesByQueryNotWithPermission (QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
return questionLogSummaryDao.getValuesByQueryNotWithPermission(questionLogSummaryQuery);
|
||||
}
|
||||
|
||||
public QuestionLogSummary getInfo (Long questionLogSummaryId){
|
||||
QuestionLogSummaryQuery questionLogSummaryQuery = new QuestionLogSummaryQuery();
|
||||
questionLogSummaryQuery.setQuestionLogSummaryId(questionLogSummaryId);
|
||||
questionLogSummaryQuery.setQuestionLogSummaryStatusPlural("1,2");//需要根据实际情况来
|
||||
List<QuestionLogSummary> list = questionLogSummaryDao.getValuesByQuery(questionLogSummaryQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public QuestionLogSummary getInfo (QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
List<QuestionLogSummary> list = questionLogSummaryDao.getValuesByQuery(questionLogSummaryQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public JsonResult importTemplate(List<FileEntity> fileEntityList,List<Long>list,CoreUser coreUser){
|
||||
List<String[]>errMsg = new ArrayList<>();
|
||||
String msg ="";
|
||||
int count = 0;
|
||||
Date date = new Date();
|
||||
for(int item=0;null != fileEntityList && item<fileEntityList.size();item++){
|
||||
FileEntity fileEntity = fileEntityList.get(item);
|
||||
if(null != fileEntity){
|
||||
File file = new File(fileEntity.getAbsoluteUrl());
|
||||
if(file.exists() && file.isFile() && file.canRead() && ToolUtils.findInSet("xls,xlsx",fileEntity.getFormat())){
|
||||
Workbook wb = null;
|
||||
InputStream is = null;
|
||||
try {
|
||||
is = new FileInputStream(fileEntity.getAbsoluteUrl());
|
||||
if("xls".equals(fileEntity.getFormat())){
|
||||
wb = new HSSFWorkbook(is);
|
||||
}else if("xlsx".equals(fileEntity.getFormat())){
|
||||
wb = new XSSFWorkbook(is);
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
if(null != is){
|
||||
is.close();
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(wb != null){
|
||||
//获取Sheet1
|
||||
Sheet sheet = wb.getSheet("Sheet1");
|
||||
//获取最大行数
|
||||
int rowNum = sheet.getPhysicalNumberOfRows();
|
||||
//获取第一行
|
||||
Row firstRow = sheet.getRow(0);
|
||||
//获取最大列数
|
||||
int colNum = firstRow.getPhysicalNumberOfCells();
|
||||
|
||||
String columns[] = {
|
||||
"题目配置",
|
||||
"题目配置名称",
|
||||
"类型 枚举",
|
||||
"来源类型 枚举",
|
||||
"配置的题目总分数",
|
||||
"人员",
|
||||
"配置的题目总数",
|
||||
"学生做题总数",
|
||||
"全对数量",
|
||||
"半对数量",
|
||||
"错题数量",
|
||||
"正确率,最大100",
|
||||
"当前配置的及格比率",
|
||||
"是否及格",
|
||||
"状态",
|
||||
};
|
||||
|
||||
Map<String,Integer> map = new HashMap<>();//获取需要的表头的列
|
||||
|
||||
//从第一列找到需要的表头
|
||||
for (int i=0; i<colNum; i++){
|
||||
String cellData = getCellFormatValue(firstRow.getCell(i));
|
||||
for(int j=0;j<columns.length;j++){
|
||||
if(columns[j].equals(cellData)){
|
||||
map.put(columns[j],i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//验证所需要的表头是否全
|
||||
Integer flag = 0;
|
||||
for(int i=0;i<columns.length;i++){
|
||||
if(null != map.get(columns[i])){
|
||||
flag ++;
|
||||
}
|
||||
}
|
||||
if(flag != columns.length){
|
||||
String str = " ";
|
||||
for(int i=0;i<columns.length;i++){
|
||||
str += "\""+columns[i]+"\""+(i == columns.length-1?"":", ");
|
||||
}
|
||||
return JsonResult.failMessage("导入失败,表格表头应包含"+str);
|
||||
}
|
||||
|
||||
for (int i = 1; i<rowNum; i++) {
|
||||
Row row = sheet.getRow(i);
|
||||
if(null == row){
|
||||
errMsg.add(new String[]{"第"+(i+1)+"数据为空"});
|
||||
continue;
|
||||
}
|
||||
|
||||
String questionSettingId = getCellFormatValue(row.getCell(map.get(columns[0])));
|
||||
String questionSettingName = getCellFormatValue(row.getCell(map.get(columns[1])));
|
||||
String questionSettingType = getCellFormatValue(row.getCell(map.get(columns[2])));
|
||||
String questionLogSummaryFromType = getCellFormatValue(row.getCell(map.get(columns[3])));
|
||||
String questionSettingTotalScore = getCellFormatValue(row.getCell(map.get(columns[4])));
|
||||
String personId = getCellFormatValue(row.getCell(map.get(columns[5])));
|
||||
String questionLogSummaryQuestionTotalCount = getCellFormatValue(row.getCell(map.get(columns[6])));
|
||||
String questionLogSummaryStudentDoCount = getCellFormatValue(row.getCell(map.get(columns[7])));
|
||||
String questionLogSummarySuccessCount = getCellFormatValue(row.getCell(map.get(columns[8])));
|
||||
String questionLogSummaryHalfSuccessCount = getCellFormatValue(row.getCell(map.get(columns[9])));
|
||||
String questionLogSummaryErrorCount = getCellFormatValue(row.getCell(map.get(columns[10])));
|
||||
String questionLogSummarySuccessRate = getCellFormatValue(row.getCell(map.get(columns[11])));
|
||||
String questionLogSummaryCurrentPassRate = getCellFormatValue(row.getCell(map.get(columns[12])));
|
||||
String questionLogSummaryIsPass = getCellFormatValue(row.getCell(map.get(columns[13])));
|
||||
String questionLogSummaryStatus = getCellFormatValue(row.getCell(map.get(columns[14])));
|
||||
//TODO 判断(如重复等复杂判断要额外写)
|
||||
if(StringUtils.isBlank(questionSettingId)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[0])+1)+"列,第"+(i+1)+"行题目配置为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionSettingName)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[1])+1)+"列,第"+(i+1)+"行题目配置名称为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionSettingType)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[2])+1)+"列,第"+(i+1)+"行类型 枚举为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryFromType)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[3])+1)+"列,第"+(i+1)+"行来源类型 枚举为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionSettingTotalScore)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[4])+1)+"列,第"+(i+1)+"行配置的题目总分数为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(personId)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[5])+1)+"列,第"+(i+1)+"行人员为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryQuestionTotalCount)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[6])+1)+"列,第"+(i+1)+"行配置的题目总数为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryStudentDoCount)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[7])+1)+"列,第"+(i+1)+"行学生做题总数为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummarySuccessCount)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[8])+1)+"列,第"+(i+1)+"行全对数量为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryHalfSuccessCount)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[9])+1)+"列,第"+(i+1)+"行半对数量为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryErrorCount)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[10])+1)+"列,第"+(i+1)+"行错题数量为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummarySuccessRate)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[11])+1)+"列,第"+(i+1)+"行正确率,最大100为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryCurrentPassRate)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[12])+1)+"列,第"+(i+1)+"行当前配置的及格比率为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryIsPass)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[13])+1)+"列,第"+(i+1)+"行是否及格为空"});
|
||||
continue;
|
||||
}else
|
||||
if(StringUtils.isBlank(questionLogSummaryStatus)){
|
||||
errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[14])+1)+"列,第"+(i+1)+"行状态为空"});
|
||||
continue;
|
||||
}else
|
||||
{
|
||||
//TODO 保存
|
||||
QuestionLogSummary questionLogSummary = new QuestionLogSummary();
|
||||
questionLogSummary.setQuestionSettingId(Long.parseLong(questionSettingId));
|
||||
questionLogSummary.setQuestionSettingName(Long.parseLong(questionSettingName));
|
||||
questionLogSummary.setQuestionSettingType(ResourcesQuestionSnapshotFromTypeEnum.valueOf(questionSettingType));
|
||||
questionLogSummary.setQuestionLogSummaryFromType(BusinessCourseInfoEnum.valueOf(questionLogSummaryFromType));
|
||||
questionLogSummary.setQuestionSettingTotalScore(Integer.parseInt(questionSettingTotalScore));
|
||||
questionLogSummary.setPersonId(Long.parseLong(personId));
|
||||
questionLogSummary.setQuestionLogSummaryQuestionTotalCount(Integer.parseInt(questionLogSummaryQuestionTotalCount));
|
||||
questionLogSummary.setQuestionLogSummaryStudentDoCount(Integer.parseInt(questionLogSummaryStudentDoCount));
|
||||
questionLogSummary.setQuestionLogSummarySuccessCount(Integer.parseInt(questionLogSummarySuccessCount));
|
||||
questionLogSummary.setQuestionLogSummaryHalfSuccessCount(Integer.parseInt(questionLogSummaryHalfSuccessCount));
|
||||
questionLogSummary.setQuestionLogSummaryErrorCount(Integer.parseInt(questionLogSummaryErrorCount));
|
||||
questionLogSummary.setQuestionLogSummarySuccessRate(new BigDecimal(questionLogSummarySuccessRate));
|
||||
questionLogSummary.setQuestionLogSummaryCurrentPassRate(new BigDecimal(questionLogSummaryCurrentPassRate));
|
||||
questionLogSummary.setQuestionLogSummaryIsPass(Integer.parseInt(questionLogSummaryIsPass));
|
||||
questionLogSummary.setQuestionLogSummaryStatus(Integer.parseInt(questionLogSummaryStatus));
|
||||
questionLogSummary.setQuestionLogSummaryAddTime(new Date());
|
||||
questionLogSummary.setOrgId(coreUser.getOrgId());
|
||||
questionLogSummary.setUserId(coreUser.getId());
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
JsonResult jsonResult = new JsonResult();
|
||||
jsonResult.setCode(count>0?JsonReturnCode.SUCCESS.getCode():JsonReturnCode.FAIL.getCode());
|
||||
jsonResult.setData(errMsg);
|
||||
jsonResult.setMsg((count>0?"导入成功,共导入"+count+"条":"导入失败")+(StringUtils.isNotBlank(msg)?"<br>"+msg:""));
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> getExcelValues (QuestionLogSummaryQuery questionLogSummaryQuery){
|
||||
return questionLogSummaryDao.getExcelValues(questionLogSummaryQuery);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
layui.define([ 'form', 'laydate', 'table','questionLogSummaryApi'], function(exports) {
|
||||
var form = layui.form;
|
||||
var questionLogSummaryApi = layui.questionLogSummaryApi;
|
||||
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 questionLogSummaryId = $("#addForm input[name='questionLogSummaryId']").val();
|
||||
if(!$.isEmpty(questionLogSummaryId)){
|
||||
questionLogSummaryApi.updateQuestionLogSummary($('#addForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("更新成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}else{
|
||||
questionLogSummaryApi.addQuestionLogSummary($('#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', 'questionLogSummaryApi'], function(exports) {
|
||||
var questionLogSummaryApi = layui.questionLogSummaryApi;
|
||||
var table=layui.table;
|
||||
var view = {
|
||||
init:function(){
|
||||
},
|
||||
delBatch:function(){
|
||||
var data = Common.getMoreDataFromTable(table,"questionLogSummaryTable");
|
||||
if(data==null){
|
||||
return ;
|
||||
}
|
||||
Common.openConfirm("确认要删除这些通用题目日志汇总?",function(){
|
||||
var ids =Common.concatBatchId(data,"questionLogSummaryId");
|
||||
questionLogSummaryApi.del(ids,function(){
|
||||
Common.info("删除成功");
|
||||
dataReload();
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
exports('del',view);
|
||||
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
layui.define([ 'form', 'laydate', 'table','questionLogSummaryApi'], function(exports) {
|
||||
var form = layui.form;
|
||||
var questionLogSummaryApi = layui.questionLogSummaryApi;
|
||||
var index = layui.index;
|
||||
var view = {
|
||||
init:function(){
|
||||
Lib.initGenrealForm($("#updateForm"),form);
|
||||
this.initSubmit();
|
||||
},
|
||||
initSubmit:function(){
|
||||
$("#updateButton").click(function(){
|
||||
form.on('submit(form)', function(){
|
||||
questionLogSummaryApi.updateQuestionLogSummary($('#updateForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("更新成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
});
|
||||
});
|
||||
$("#updateButton-cancel").click(function(){
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
exports('edit',view);
|
||||
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
/*访问后台的代码*/
|
||||
layui.define([], function(exports) {
|
||||
var api={
|
||||
updateQuestionLogSummary:function(form,callback){
|
||||
Lib.submitForm("/jlw/questionLogSummary/edit.json",form,{},callback)
|
||||
},
|
||||
addQuestionLogSummary:function(form,callback){
|
||||
Lib.submitForm("/jlw/questionLogSummary/add.json",form,{},callback)
|
||||
},
|
||||
del:function(ids,callback){
|
||||
Common.post("/jlw/questionLogSummary/delete.json",{"ids":ids},function(){
|
||||
callback();
|
||||
})
|
||||
}
|
||||
,
|
||||
exportExcel:function(form,callback){
|
||||
var formPara = form.serializeJson();
|
||||
Common.downLoad("/jlw/questionLogSummary/excel/export.json", formPara, 'POST')
|
||||
// Common.post("/jlw/questionLogSummary/excel/export.json", formPara, function(fileId) {
|
||||
// callback(fileId);
|
||||
// })
|
||||
}
|
||||
|
||||
};
|
||||
exports('questionLogSummaryApi',api);
|
||||
});
|
@ -0,0 +1,31 @@
|
||||
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/questionLogSummary/"}){ -->
|
||||
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
|
||||
</layui:searchForm>
|
||||
<table id="questionLogSummaryTable" lay-filter="questionLogSummaryTable"></table>
|
||||
<!--#} -->
|
||||
|
||||
<script type="text/html" id="toolbar_questionLogSummary">
|
||||
<div class="layui-btn-container">
|
||||
<div class="layui-btn-group" >
|
||||
<!--# if(core.searchIsShow(search)) {-->
|
||||
<layui:accessButton function="questionLogSummary.query" id="searchFormSearch" action="search"><i class="layui-icon"></i>搜索</layui:accessButton>
|
||||
<!--# }-->
|
||||
<layui:accessButton function="questionLogSummary.add" action="add">添加</layui:accessButton>
|
||||
<layui:accessButton function="questionLogSummary.edit" action="edit">修改</layui:accessButton>
|
||||
<layui:accessButton function="questionLogSummary.del" action="del">删除</layui:accessButton>
|
||||
<!--# if(!isEmpty(search)) {-->
|
||||
<layui:accessButton function="questionLogSummary.query" action="refresh"><i class="layui-icon"></i>刷新</layui:accessButton>
|
||||
<!--# }-->
|
||||
<layui:accessButton function="questionLogSummary.exportDocument" action="exportDocument">导出</layui:accessButton>
|
||||
<layui:accessButton function="questionLogSummary.importTemplate" action="importDocument">导入</layui:accessButton>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
|
||||
layui.use(['index'], function(){
|
||||
var index = layui.index;
|
||||
index.init();
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue