@@ -1,57 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "问卷管理"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title lrlt ">分类</div> | |||||
<div id="companyTree" class="lr-layout-body"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title"> | |||||
<span id="titleinfo" class="lrlt">未选择分类</span> - <span class="lrlt">分类信息</span> | |||||
</div> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<div id="multiple_condition_query"> | |||||
<div class="lr-query-formcontent"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">标题</div> | |||||
<input id="VTitle" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">问卷编号</div> | |||||
<input id="VSerial" type="text" class="form-control" /> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
<a id="lr_question" class="btn btn-default"><i class="fa fa-navicon"></i> 管理问题</a> | |||||
<a id="lr_answer" class="btn btn-default"><i class="fa fa-building-o"></i> 答题情况</a> | |||||
<a id="lr_analysis" class="btn btn-default"><i class="fa fa-building-o"></i> 结果分析</a> | |||||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看问卷</a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-lock"></i> 审核</a> | |||||
<a id="lr_unsubmit" class="btn btn-default"><i class="fa fa-unlock"></i> 去审核</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/Ask/Views/Ask_Main/Index.js") |
@@ -1,807 +0,0 @@ | |||||
using Hangfire; | |||||
using Learun.Application.Organization; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using Learun.Util; | |||||
using Newtonsoft.Json; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Data; | |||||
using System.Linq; | |||||
using System.Web.Mvc; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-06-14 11:02 | |||||
/// 描 述:考试成绩同步 | |||||
/// </summary> | |||||
public class StuScoreController : MvcControllerBase | |||||
{ | |||||
private StuScoreIBLL stuScoreIBLL = new StuScoreBLL(); | |||||
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); | |||||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||||
private CdMajorIBLL cdMajorIBLL = new CdMajorBLL(); | |||||
private UserIBLL userIBLL = new UserBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
[HttpGet] | |||||
public ActionResult Monitor() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 主页面【班级学生成绩初始化】 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ClassIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 班级成绩查看页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreQueryIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 全院班级成绩查看页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult AllScoreQueryIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 新版成绩录入 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult InputScoreIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 新版成绩录入 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult InputScoreIndexInTeacher() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 成绩统计分析 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreStatisticAnalysis() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 学生成绩录入可去审核页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreInputCancelIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 学生成绩录入可去审核页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreInputCancelForm() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取列表数据 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetList(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetList(queryJson); | |||||
return Success(data); | |||||
} | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetMonitorList(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetMonitorList(queryJson); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取列表分页数据 | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = stuScoreIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var data = stuScoreIBLL.GetEntity(keyValue); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取列表分页数据 | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreInputCancelPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var aa = JsonConvert.DeserializeObject<StuScoreEntity>(queryJson); | |||||
var data = new List<StuScoreEntity>(); | |||||
if (!string.IsNullOrEmpty(aa.AcademicYearNo) || !string.IsNullOrEmpty(aa.Semester) || !string.IsNullOrEmpty(aa.EmpNo) || !string.IsNullOrEmpty(aa.LessonNo) || !string.IsNullOrEmpty(aa.ClassNo) || !string.IsNullOrEmpty(aa.StuNo)) | |||||
{ | |||||
data = stuScoreIBLL.GetScoreInputCancelPageList(paginationobj, queryJson).ToList(); | |||||
} | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <param name="pagination">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreInputCancelFormData(string keyValue) | |||||
{ | |||||
var data = stuScoreIBLL.GetEntity(keyValue); | |||||
var StuSelectLessonListData = stuScoreIBLL.GetStuSelectLessonListEntity(data); | |||||
var jsonData = new | |||||
{ | |||||
StuScore = data, | |||||
StuSelectLessonList = StuSelectLessonListData | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取列表数据 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetEntityByJson(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetEntityByJson(queryJson); | |||||
return Success(data); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
stuScoreIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult Submit(string AcademicYearNo, string Semester, string LessonNo, string TeachClassNo, string EmpNo, string EditUserId) | |||||
{ | |||||
stuScoreIBLL.SubmitStuScore(AcademicYearNo, Semester, LessonNo, TeachClassNo, EmpNo); | |||||
var userEntity = userIBLL.GetEntityByAccount(EditUserId); | |||||
var name = EditUserId + "_" + userEntity?.F_RealName + "_成绩录入"; | |||||
//删除任务 | |||||
RecurringJob.RemoveIfExists(name); | |||||
return Success("操作成功!"); | |||||
} | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SyncList() | |||||
{ | |||||
stuScoreIBLL.SyncList(); | |||||
return Success("同步成功!"); | |||||
} | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteList() | |||||
{ | |||||
stuScoreIBLL.DeleteList(); | |||||
return Success("清空成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, StuScoreEntity entity) | |||||
{ | |||||
stuScoreIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 获取班级成绩初始化分页数据 | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageListAboutClass(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = stuScoreIBLL.GetPageListAboutClass(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 班级学生成绩录入初始化 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DoInitAboutClass(string academicYearNo, string semester, string classNo) | |||||
{ | |||||
stuScoreIBLL.DoInitAboutClass(academicYearNo, semester, classNo); | |||||
return Success("初始化成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 学年下拉框信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetAcademicYearNoData() | |||||
{ | |||||
var data = stuScoreIBLL.GetAcademicYearNoData(); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 学期下拉框信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetSemesterData() | |||||
{ | |||||
var data = WebHelper.GenerateNearBySemeter(); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 班级下拉框信息【成绩录入新页面】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetClassNoDataOfAll(string lessonNo) | |||||
{ | |||||
var data = stuScoreIBLL.GetClassNoData("", "", lessonNo); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 班级下拉框信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetClassNoData(string lessonNo) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetClassNoData(loginInfo.account, loginInfo.Description, lessonNo); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 班级下拉框信息【全院班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetAllClassNoData() | |||||
{ | |||||
var data = stuScoreIBLL.GetClassNoData("", "", ""); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 教师下拉框信息【学生成绩录入可去审核】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetEmpNoData() | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetEmpNoData(loginInfo.account, loginInfo.Description); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程下拉框信息【学生成绩录入可去审核】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoDataOfAll() | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程下拉框 带编号 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoDataOfAllWithNo() | |||||
{ | |||||
var data = stuScoreIBLL.GetLessonNoDataOfAll("", ""); | |||||
foreach (var item in data) | |||||
{ | |||||
item.text = string.Format("{0}({1})", item.text, item.value); | |||||
} | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程下拉框 带编号 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoDataWithNo() | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description); | |||||
foreach (var item in data) | |||||
{ | |||||
item.text = string.Format("{0}({1})", item.text, item.value); | |||||
} | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoData(string academicYearNo, string semester, string classNo) | |||||
{ | |||||
var data = stuScoreIBLL.GetLessonNoData(academicYearNo, semester, classNo).OrderBy(x => x.value); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取班级成绩列表 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreListByClassNo(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetScoreListByClassNo(queryJson); | |||||
var aa = data.GroupBy(x => new { x.StuNo, x.StuName, x.StuId }).Select(x => new | |||||
{ | |||||
StuId = x.Key.StuId, | |||||
StuNo = x.Key.StuNo, | |||||
StuName = x.Key.StuName, | |||||
TotalScore = x.Select(y => y.Score).Sum(), | |||||
LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) | |||||
}).OrderByDescending(x => x.TotalScore); | |||||
var result = new List<Dictionary<string, string>>(); | |||||
foreach (var item in aa) | |||||
{ | |||||
var aaa = new Dictionary<string, string>(); | |||||
aaa.Add("StuId", item.StuId); | |||||
aaa.Add("StuNo", item.StuNo); | |||||
aaa.Add("StuName", item.StuName); | |||||
aaa.Add("TotalScore", item.TotalScore.ToString()); | |||||
foreach (var lessonInfoItem in item.LessonInfo) | |||||
{ | |||||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); | |||||
} | |||||
result.Add(aaa); | |||||
} | |||||
return Success(result); | |||||
} | |||||
public ActionResult GetScoreCharts(string AcademicYearNo, string Semester, string ClassNo, string LessonNo) | |||||
{ | |||||
var data = stuScoreIBLL.GetScoreCharts(AcademicYearNo, Semester, ClassNo, LessonNo); | |||||
return Success(data); | |||||
} | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreInfo(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetScoreInfo(queryJson); | |||||
return JsonResult(data); | |||||
} | |||||
/// <summary> | |||||
/// 导出班级成绩列表 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
//[HttpGet] | |||||
//[AjaxOnly] | |||||
[HttpPost, ValidateInput(false)] | |||||
public ActionResult ExportScoreListByClassNo(string queryJson) | |||||
{ | |||||
var queryModel = JsonConvert.DeserializeObject<QueryModel>(queryJson); | |||||
var className = string.Empty; | |||||
if (!string.IsNullOrEmpty(queryModel.ClassNo)) | |||||
{ | |||||
var classInfoEntity = classInfoIBLL.GetClassInfoEntityByClassNo(queryModel.ClassNo); | |||||
className = classInfoEntity != null ? classInfoEntity.ClassName : string.Empty; | |||||
} | |||||
var data = stuScoreIBLL.GetScoreListByClassNo(queryJson); | |||||
var aa = data.GroupBy(x => new { x.StuNo, x.StuName }).Select(x => new | |||||
{ | |||||
StuNo = x.Key.StuNo, | |||||
StuName = x.Key.StuName, | |||||
TotalScore = x.Select(y => y.Score).Sum(), | |||||
LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) | |||||
}).OrderByDescending(x => x.TotalScore); | |||||
var result = new List<Dictionary<string, string>>(); | |||||
foreach (var item in aa) | |||||
{ | |||||
var aaa = new Dictionary<string, string>(); | |||||
aaa.Add("StuNo", item.StuNo); | |||||
aaa.Add("StuName", item.StuName); | |||||
aaa.Add("TotalScore", item.TotalScore.ToString()); | |||||
foreach (var lessonInfoItem in item.LessonInfo) | |||||
{ | |||||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); | |||||
} | |||||
result.Add(aaa); | |||||
} | |||||
var resultStr = JsonConvert.SerializeObject(result); | |||||
//班级成绩源 | |||||
var exportTable = resultStr.ToTable(); | |||||
//设置导出格式 | |||||
ExcelConfig excelconfig = new ExcelConfig(); | |||||
excelconfig.Title = className + " 班级成绩列表"; | |||||
excelconfig.TitleFont = "微软雅黑"; | |||||
excelconfig.TitlePoint = 20; | |||||
excelconfig.FileName = className + " 班级成绩导出.xls"; | |||||
excelconfig.IsAllSizeColumn = true; | |||||
//每一列的设置,没有设置的列信息,系统将按datatable中的列名导出 | |||||
excelconfig.ColumnEntity = new List<ColumnModel>(); | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "StuNo", ExcelColumn = "学号" }); | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "StuName", ExcelColumn = "姓名" }); | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "TotalScore", ExcelColumn = "总分" }); | |||||
//课程动态列 | |||||
var lessonTemp = stuScoreIBLL.GetLessonNoData(queryModel.AcademicYearNo, queryModel.Semester, queryModel.ClassNo).OrderBy(x => x.value); | |||||
foreach (var lessonTempItem in lessonTemp) | |||||
{ | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = lessonTempItem.value, ExcelColumn = lessonTempItem.text }); | |||||
} | |||||
//调用导出方法 | |||||
ExcelHelper.ExcelDownload(exportTable, excelconfig); | |||||
return Success("导出成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 查询条件模型【班级成绩查看】 | |||||
/// </summary> | |||||
public class QueryModel | |||||
{ | |||||
public string AcademicYearNo { get; set; } | |||||
public string Semester { get; set; } | |||||
public string ClassNo { get; set; } | |||||
} | |||||
/// <summary> | |||||
/// 获取打印成绩单数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreListByStuNoList(string stuNoList) | |||||
{ | |||||
var dataList = new List<object>(); | |||||
var stuNoArr = stuNoList.Split(','); | |||||
foreach (var stuNo in stuNoArr) | |||||
{ | |||||
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(stuNo); | |||||
if (stuInfoBasicEntity != null) | |||||
{ | |||||
var classInfoEntity = classInfoIBLL.GetClassInfoEntityByClassNo(stuInfoBasicEntity.ClassNo); | |||||
var cdMajorEntity = cdMajorIBLL.GetCdMajorEntityByMajorNo(stuInfoBasicEntity.MajorNo); | |||||
var scoreList = stuScoreIBLL.GetAllScoreListByStuNo(stuNo); | |||||
var scoreListOfSortNo1 = scoreList.Where(x => x.LessonSortNo == "1"); //必修课 | |||||
if (scoreListOfSortNo1.Any()) | |||||
{ | |||||
foreach (var item in scoreListOfSortNo1) | |||||
{ | |||||
if ((item.Score >= 0 && item.Score < 60) || item.Score == (-5) || item.Score == (-10)) | |||||
{ | |||||
item.StuNo = stuNo; | |||||
var scoreNotPassEntity = stuScoreIBLL.GetScoreNotPassByEntity(item); | |||||
if (scoreNotPassEntity != null) | |||||
{ | |||||
item.Score = scoreNotPassEntity.Score; | |||||
if ((scoreNotPassEntity.Score >= 0 && scoreNotPassEntity.Score < 60) || scoreNotPassEntity.Score == (-5) || scoreNotPassEntity.Score == (-10)) | |||||
{ | |||||
scoreNotPassEntity.StuNo = stuNo; | |||||
var scoreNotPassTwoEntity = stuScoreIBLL.GetScoreNotPassTwoByEntity(scoreNotPassEntity); | |||||
if (scoreNotPassTwoEntity != null) | |||||
{ | |||||
item.Score = scoreNotPassTwoEntity.Score; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
var list = scoreList.GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new | |||||
{ | |||||
academicYearNo = x.Key.AcademicYearNo, | |||||
semester = x.Key.Semester, | |||||
title = string.Format("{0}学年度第{1}学期", x.Key.AcademicYearNo, x.Key.Semester), | |||||
list = x.Select(y => new | |||||
{ | |||||
type = y.LessonSortNo == "1" ? "专业课" : y.LessonSortNo == "2" ? "选修课" : "公共课", | |||||
className = y.LessonName, | |||||
achievement = y.Score.HasValue ? y.Score.Value.ToString() : string.Empty, | |||||
lessonNo = y.LessonNo | |||||
}).OrderBy(y => y.lessonNo) | |||||
}).OrderByDescending(x => x.academicYearNo).OrderByDescending(x => x.semester); | |||||
var data = new | |||||
{ | |||||
schoolId = stuInfoBasicEntity.F_SchoolId, | |||||
school = string.Empty, | |||||
major = cdMajorEntity != null ? cdMajorEntity.MajorName : string.Empty, | |||||
className = classInfoEntity != null ? classInfoEntity.ClassName : string.Empty, | |||||
student = stuInfoBasicEntity.StuName, | |||||
number = stuInfoBasicEntity.StuNo, | |||||
arrangementId = stuInfoBasicEntity.EduSystem, | |||||
arrangement = string.Empty, | |||||
list = list.Select(x => new { x.title, list = x.list.Select(y => new { y.type, y.className, y.achievement }) }) | |||||
}; | |||||
dataList.Add(data); | |||||
} | |||||
} | |||||
return Success(dataList); | |||||
} | |||||
/// <summary> | |||||
/// 审核学生成绩 | |||||
/// </summary> | |||||
/// <param name="keyValue">成绩主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult CheckStuScore(string keyValue) | |||||
{ | |||||
stuScoreIBLL.CheckStuScore(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 去审核学生成绩 | |||||
/// </summary> | |||||
/// <param name="keyValue">成绩主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult UnCheckStuScore(string keyValue) | |||||
{ | |||||
stuScoreIBLL.UnCheckStuScore(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 开始录入:占用成绩 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult StartInputScore(string queryJson) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; | |||||
stuScoreIBLL.StartInputScore(queryJson); | |||||
//添加任务 | |||||
//RecurringJob.AddOrUpdate(name, | |||||
// () => SaveInputScoreStatus2(queryJson, name), | |||||
// Cron.MinuteInterval(3), TimeZoneInfo.Local); | |||||
var m = DateTime.Now.Minute + 30; | |||||
if (m >= 60) | |||||
{ | |||||
m = m - 60; | |||||
} | |||||
RecurringJob.AddOrUpdate(name, | |||||
() => SaveInputScoreStatus2(queryJson, name), | |||||
m + " * * * * ", TimeZoneInfo.Local); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 续时 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult AddMinutes(string queryJson, int minutes) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; | |||||
//更新任务 | |||||
var m = DateTime.Now.Minute + minutes; | |||||
if (m >= 60) | |||||
{ | |||||
m = m - 60; | |||||
} | |||||
RecurringJob.AddOrUpdate(name, | |||||
() => SaveInputScoreStatus2(queryJson, name), | |||||
m + " * * * * ", TimeZoneInfo.Local); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 提交成绩 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SaveInputScore(string data) | |||||
{ | |||||
var list = JsonConvert.DeserializeObject<List<StuScoreEntity>>(data); | |||||
if (list.Any()) | |||||
{ | |||||
stuScoreIBLL.SaveInputScore(list); | |||||
} | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 提交成绩:取消占用 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SaveInputScoreStatus(string queryJson) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; | |||||
stuScoreIBLL.SaveInputScoreStatus(queryJson); | |||||
//删除任务 | |||||
RecurringJob.RemoveIfExists(name); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 提交成绩:取消占用【服务】 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public ActionResult SaveInputScoreStatus2(string queryJson, string name) | |||||
{ | |||||
stuScoreIBLL.SaveInputScoreStatus2(queryJson, name); | |||||
//删除任务 | |||||
RecurringJob.RemoveIfExists(name); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 审核成绩 | |||||
/// </summary> | |||||
/// <param name="queryJson"></param> | |||||
/// <param name="checkMark">已审核:1;未审核:0;</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DoCheckScore(string queryJson, int checkMark) | |||||
{ | |||||
stuScoreIBLL.DoCheckScore(queryJson, checkMark); | |||||
return Success("操作成功"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -1,807 +0,0 @@ | |||||
using Hangfire; | |||||
using Learun.Application.Organization; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using Learun.Util; | |||||
using Newtonsoft.Json; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Data; | |||||
using System.Linq; | |||||
using System.Web.Mvc; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-06-14 11:02 | |||||
/// 描 述:考试成绩同步 | |||||
/// </summary> | |||||
public class StuScoreController : MvcControllerBase | |||||
{ | |||||
private StuScoreIBLL stuScoreIBLL = new StuScoreBLL(); | |||||
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); | |||||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||||
private CdMajorIBLL cdMajorIBLL = new CdMajorBLL(); | |||||
private UserIBLL userIBLL = new UserBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
[HttpGet] | |||||
public ActionResult Monitor() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 主页面【班级学生成绩初始化】 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ClassIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 班级成绩查看页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreQueryIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 全院班级成绩查看页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult AllScoreQueryIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 新版成绩录入 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult InputScoreIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 新版成绩录入 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult InputScoreIndexInTeacher() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 成绩统计分析 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreStatisticAnalysis() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 学生成绩录入可去审核页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreInputCancelIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 学生成绩录入可去审核页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ScoreInputCancelForm() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取列表数据 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetList(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetList(queryJson); | |||||
return Success(data); | |||||
} | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetMonitorList(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetMonitorList(queryJson); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取列表分页数据 | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = stuScoreIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var data = stuScoreIBLL.GetEntity(keyValue); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取列表分页数据 | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreInputCancelPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var aa = JsonConvert.DeserializeObject<StuScoreEntity>(queryJson); | |||||
var data = new List<StuScoreEntity>(); | |||||
if (!string.IsNullOrEmpty(aa.AcademicYearNo) || !string.IsNullOrEmpty(aa.Semester) || !string.IsNullOrEmpty(aa.EmpNo) || !string.IsNullOrEmpty(aa.LessonNo) || !string.IsNullOrEmpty(aa.ClassNo) || !string.IsNullOrEmpty(aa.StuNo)) | |||||
{ | |||||
data = stuScoreIBLL.GetScoreInputCancelPageList(paginationobj, queryJson).ToList(); | |||||
} | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <param name="pagination">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreInputCancelFormData(string keyValue) | |||||
{ | |||||
var data = stuScoreIBLL.GetEntity(keyValue); | |||||
var StuSelectLessonListData = stuScoreIBLL.GetStuSelectLessonListEntity(data); | |||||
var jsonData = new | |||||
{ | |||||
StuScore = data, | |||||
StuSelectLessonList = StuSelectLessonListData | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取列表数据 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetEntityByJson(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetEntityByJson(queryJson); | |||||
return Success(data); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
stuScoreIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult Submit(string AcademicYearNo, string Semester, string LessonNo, string TeachClassNo, string EmpNo, string EditUserId) | |||||
{ | |||||
stuScoreIBLL.SubmitStuScore(AcademicYearNo, Semester, LessonNo, TeachClassNo, EmpNo); | |||||
var userEntity = userIBLL.GetEntityByAccount(EditUserId); | |||||
var name = EditUserId + "_" + userEntity?.F_RealName + "_成绩录入"; | |||||
//删除任务 | |||||
RecurringJob.RemoveIfExists(name); | |||||
return Success("操作成功!"); | |||||
} | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SyncList() | |||||
{ | |||||
stuScoreIBLL.SyncList(); | |||||
return Success("同步成功!"); | |||||
} | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteList() | |||||
{ | |||||
stuScoreIBLL.DeleteList(); | |||||
return Success("清空成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, StuScoreEntity entity) | |||||
{ | |||||
stuScoreIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 获取班级成绩初始化分页数据 | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageListAboutClass(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = stuScoreIBLL.GetPageListAboutClass(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 班级学生成绩录入初始化 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DoInitAboutClass(string academicYearNo, string semester, string classNo) | |||||
{ | |||||
stuScoreIBLL.DoInitAboutClass(academicYearNo, semester, classNo); | |||||
return Success("初始化成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 学年下拉框信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetAcademicYearNoData() | |||||
{ | |||||
var data = stuScoreIBLL.GetAcademicYearNoData(); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 学期下拉框信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetSemesterData() | |||||
{ | |||||
var data = WebHelper.GenerateNearBySemeter(); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 班级下拉框信息【成绩录入新页面】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetClassNoDataOfAll(string lessonNo) | |||||
{ | |||||
var data = stuScoreIBLL.GetClassNoData("", "", lessonNo); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 班级下拉框信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetClassNoData(string lessonNo) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetClassNoData(loginInfo.account, loginInfo.Description, lessonNo); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 班级下拉框信息【全院班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetAllClassNoData() | |||||
{ | |||||
var data = stuScoreIBLL.GetClassNoData("", "", ""); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 教师下拉框信息【学生成绩录入可去审核】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetEmpNoData() | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetEmpNoData(loginInfo.account, loginInfo.Description); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程下拉框信息【学生成绩录入可去审核】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoDataOfAll() | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程下拉框 带编号 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoDataOfAllWithNo() | |||||
{ | |||||
var data = stuScoreIBLL.GetLessonNoDataOfAll("", ""); | |||||
foreach (var item in data) | |||||
{ | |||||
item.text = string.Format("{0}({1})", item.text, item.value); | |||||
} | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程下拉框 带编号 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoDataWithNo() | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description); | |||||
foreach (var item in data) | |||||
{ | |||||
item.text = string.Format("{0}({1})", item.text, item.value); | |||||
} | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 课程信息【班级成绩查看】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLessonNoData(string academicYearNo, string semester, string classNo) | |||||
{ | |||||
var data = stuScoreIBLL.GetLessonNoData(academicYearNo, semester, classNo).OrderBy(x => x.value); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取班级成绩列表 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreListByClassNo(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetScoreListByClassNo(queryJson); | |||||
var aa = data.GroupBy(x => new { x.StuNo, x.StuName, x.StuId }).Select(x => new | |||||
{ | |||||
StuId = x.Key.StuId, | |||||
StuNo = x.Key.StuNo, | |||||
StuName = x.Key.StuName, | |||||
TotalScore = x.Select(y => y.Score).Sum(), | |||||
LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) | |||||
}).OrderByDescending(x => x.TotalScore); | |||||
var result = new List<Dictionary<string, string>>(); | |||||
foreach (var item in aa) | |||||
{ | |||||
var aaa = new Dictionary<string, string>(); | |||||
aaa.Add("StuId", item.StuId); | |||||
aaa.Add("StuNo", item.StuNo); | |||||
aaa.Add("StuName", item.StuName); | |||||
aaa.Add("TotalScore", item.TotalScore.ToString()); | |||||
foreach (var lessonInfoItem in item.LessonInfo) | |||||
{ | |||||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); | |||||
} | |||||
result.Add(aaa); | |||||
} | |||||
return Success(result); | |||||
} | |||||
public ActionResult GetScoreCharts(string AcademicYearNo, string Semester, string ClassNo, string LessonNo) | |||||
{ | |||||
var data = stuScoreIBLL.GetScoreCharts(AcademicYearNo, Semester, ClassNo, LessonNo); | |||||
return Success(data); | |||||
} | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreInfo(string queryJson) | |||||
{ | |||||
var data = stuScoreIBLL.GetScoreInfo(queryJson); | |||||
return JsonResult(data); | |||||
} | |||||
/// <summary> | |||||
/// 导出班级成绩列表 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
//[HttpGet] | |||||
//[AjaxOnly] | |||||
[HttpPost, ValidateInput(false)] | |||||
public ActionResult ExportScoreListByClassNo(string queryJson) | |||||
{ | |||||
var queryModel = JsonConvert.DeserializeObject<QueryModel>(queryJson); | |||||
var className = string.Empty; | |||||
if (!string.IsNullOrEmpty(queryModel.ClassNo)) | |||||
{ | |||||
var classInfoEntity = classInfoIBLL.GetClassInfoEntityByClassNo(queryModel.ClassNo); | |||||
className = classInfoEntity != null ? classInfoEntity.ClassName : string.Empty; | |||||
} | |||||
var data = stuScoreIBLL.GetScoreListByClassNo(queryJson); | |||||
var aa = data.GroupBy(x => new { x.StuNo, x.StuName }).Select(x => new | |||||
{ | |||||
StuNo = x.Key.StuNo, | |||||
StuName = x.Key.StuName, | |||||
TotalScore = x.Select(y => y.Score).Sum(), | |||||
LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) | |||||
}).OrderByDescending(x => x.TotalScore); | |||||
var result = new List<Dictionary<string, string>>(); | |||||
foreach (var item in aa) | |||||
{ | |||||
var aaa = new Dictionary<string, string>(); | |||||
aaa.Add("StuNo", item.StuNo); | |||||
aaa.Add("StuName", item.StuName); | |||||
aaa.Add("TotalScore", item.TotalScore.ToString()); | |||||
foreach (var lessonInfoItem in item.LessonInfo) | |||||
{ | |||||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); | |||||
} | |||||
result.Add(aaa); | |||||
} | |||||
var resultStr = JsonConvert.SerializeObject(result); | |||||
//班级成绩源 | |||||
var exportTable = resultStr.ToTable(); | |||||
//设置导出格式 | |||||
ExcelConfig excelconfig = new ExcelConfig(); | |||||
excelconfig.Title = className + " 班级成绩列表"; | |||||
excelconfig.TitleFont = "微软雅黑"; | |||||
excelconfig.TitlePoint = 20; | |||||
excelconfig.FileName = className + " 班级成绩导出.xls"; | |||||
excelconfig.IsAllSizeColumn = true; | |||||
//每一列的设置,没有设置的列信息,系统将按datatable中的列名导出 | |||||
excelconfig.ColumnEntity = new List<ColumnModel>(); | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "StuNo", ExcelColumn = "学号" }); | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "StuName", ExcelColumn = "姓名" }); | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "TotalScore", ExcelColumn = "总分" }); | |||||
//课程动态列 | |||||
var lessonTemp = stuScoreIBLL.GetLessonNoData(queryModel.AcademicYearNo, queryModel.Semester, queryModel.ClassNo).OrderBy(x => x.value); | |||||
foreach (var lessonTempItem in lessonTemp) | |||||
{ | |||||
excelconfig.ColumnEntity.Add(new ColumnModel() { Column = lessonTempItem.value, ExcelColumn = lessonTempItem.text }); | |||||
} | |||||
//调用导出方法 | |||||
ExcelHelper.ExcelDownload(exportTable, excelconfig); | |||||
return Success("导出成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 查询条件模型【班级成绩查看】 | |||||
/// </summary> | |||||
public class QueryModel | |||||
{ | |||||
public string AcademicYearNo { get; set; } | |||||
public string Semester { get; set; } | |||||
public string ClassNo { get; set; } | |||||
} | |||||
/// <summary> | |||||
/// 获取打印成绩单数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetScoreListByStuNoList(string stuNoList) | |||||
{ | |||||
var dataList = new List<object>(); | |||||
var stuNoArr = stuNoList.Split(','); | |||||
foreach (var stuNo in stuNoArr) | |||||
{ | |||||
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(stuNo); | |||||
if (stuInfoBasicEntity != null) | |||||
{ | |||||
var classInfoEntity = classInfoIBLL.GetClassInfoEntityByClassNo(stuInfoBasicEntity.ClassNo); | |||||
var cdMajorEntity = cdMajorIBLL.GetCdMajorEntityByMajorNo(stuInfoBasicEntity.MajorNo); | |||||
var scoreList = stuScoreIBLL.GetAllScoreListByStuNo(stuNo); | |||||
var scoreListOfSortNo1 = scoreList.Where(x => x.LessonSortNo == "1"); //必修课 | |||||
if (scoreListOfSortNo1.Any()) | |||||
{ | |||||
foreach (var item in scoreListOfSortNo1) | |||||
{ | |||||
if ((item.Score >= 0 && item.Score < 60) || item.Score == (-5) || item.Score == (-10)) | |||||
{ | |||||
item.StuNo = stuNo; | |||||
var scoreNotPassEntity = stuScoreIBLL.GetScoreNotPassByEntity(item); | |||||
if (scoreNotPassEntity != null) | |||||
{ | |||||
item.Score = scoreNotPassEntity.Score; | |||||
if ((scoreNotPassEntity.Score >= 0 && scoreNotPassEntity.Score < 60) || scoreNotPassEntity.Score == (-5) || scoreNotPassEntity.Score == (-10)) | |||||
{ | |||||
scoreNotPassEntity.StuNo = stuNo; | |||||
var scoreNotPassTwoEntity = stuScoreIBLL.GetScoreNotPassTwoByEntity(scoreNotPassEntity); | |||||
if (scoreNotPassTwoEntity != null) | |||||
{ | |||||
item.Score = scoreNotPassTwoEntity.Score; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
var list = scoreList.GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new | |||||
{ | |||||
academicYearNo = x.Key.AcademicYearNo, | |||||
semester = x.Key.Semester, | |||||
title = string.Format("{0}学年度第{1}学期", x.Key.AcademicYearNo, x.Key.Semester), | |||||
list = x.Select(y => new | |||||
{ | |||||
type = y.LessonSortNo == "1" ? "专业课" : y.LessonSortNo == "2" ? "选修课" : "公共课", | |||||
className = y.LessonName, | |||||
achievement = y.Score.HasValue ? y.Score.Value.ToString() : string.Empty, | |||||
lessonNo = y.LessonNo | |||||
}).OrderBy(y => y.lessonNo) | |||||
}).OrderByDescending(x => x.academicYearNo).OrderByDescending(x => x.semester); | |||||
var data = new | |||||
{ | |||||
schoolId = stuInfoBasicEntity.F_SchoolId, | |||||
school = string.Empty, | |||||
major = cdMajorEntity != null ? cdMajorEntity.MajorName : string.Empty, | |||||
className = classInfoEntity != null ? classInfoEntity.ClassName : string.Empty, | |||||
student = stuInfoBasicEntity.StuName, | |||||
number = stuInfoBasicEntity.StuNo, | |||||
arrangementId = stuInfoBasicEntity.EduSystem, | |||||
arrangement = string.Empty, | |||||
list = list.Select(x => new { x.title, list = x.list.Select(y => new { y.type, y.className, y.achievement }) }) | |||||
}; | |||||
dataList.Add(data); | |||||
} | |||||
} | |||||
return Success(dataList); | |||||
} | |||||
/// <summary> | |||||
/// 审核学生成绩 | |||||
/// </summary> | |||||
/// <param name="keyValue">成绩主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult CheckStuScore(string keyValue) | |||||
{ | |||||
stuScoreIBLL.CheckStuScore(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 去审核学生成绩 | |||||
/// </summary> | |||||
/// <param name="keyValue">成绩主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult UnCheckStuScore(string keyValue) | |||||
{ | |||||
stuScoreIBLL.UnCheckStuScore(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 开始录入:占用成绩 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult StartInputScore(string queryJson) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; | |||||
stuScoreIBLL.StartInputScore(queryJson); | |||||
//添加任务 | |||||
RecurringJob.AddOrUpdate(name, | |||||
() => SaveInputScoreStatus2(queryJson, name), | |||||
Cron.MinuteInterval(3), TimeZoneInfo.Local); | |||||
var m = DateTime.Now.Minute + 30; | |||||
if (m >= 60) | |||||
{ | |||||
m = m - 60; | |||||
} | |||||
RecurringJob.AddOrUpdate(name, | |||||
() => SaveInputScoreStatus2(queryJson, name), | |||||
m + " * * * * ", TimeZoneInfo.Local); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 续时 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult AddMinutes(string queryJson, int minutes) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; | |||||
//更新任务 | |||||
var m = DateTime.Now.Minute + minutes; | |||||
if (m >= 60) | |||||
{ | |||||
m = m - 60; | |||||
} | |||||
RecurringJob.AddOrUpdate(name, | |||||
() => SaveInputScoreStatus2(queryJson, name), | |||||
m + " * * * * ", TimeZoneInfo.Local); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 提交成绩 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SaveInputScore(string data) | |||||
{ | |||||
var list = JsonConvert.DeserializeObject<List<StuScoreEntity>>(data); | |||||
if (list.Any()) | |||||
{ | |||||
stuScoreIBLL.SaveInputScore(list); | |||||
} | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 提交成绩:取消占用 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SaveInputScoreStatus(string queryJson) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; | |||||
stuScoreIBLL.SaveInputScoreStatus(queryJson); | |||||
//删除任务 | |||||
RecurringJob.RemoveIfExists(name); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 提交成绩:取消占用【服务】 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public ActionResult SaveInputScoreStatus2(string queryJson, string name) | |||||
{ | |||||
stuScoreIBLL.SaveInputScoreStatus2(queryJson, name); | |||||
//删除任务 | |||||
RecurringJob.RemoveIfExists(name); | |||||
return Success("操作成功"); | |||||
} | |||||
/// <summary> | |||||
/// 审核成绩 | |||||
/// </summary> | |||||
/// <param name="queryJson"></param> | |||||
/// <param name="checkMark">已审核:1;未审核:0;</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DoCheckScore(string queryJson, int checkMark) | |||||
{ | |||||
stuScoreIBLL.DoCheckScore(queryJson, checkMark); | |||||
return Success("操作成功"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -1,145 +0,0 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using System.Web.Mvc; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-04-11 10:08 | |||||
/// 描 述:公文收发 | |||||
/// </summary> | |||||
public class Sys_ReceiveFileController : MvcControllerBase | |||||
{ | |||||
private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = sys_ReceiveFileIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageListByUserId(string pagination, string queryJson) | |||||
{ | |||||
var UserInfoEntity = LoginUserInfo.Get(); | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = sys_ReceiveFileIBLL.GetPageListByUserId(paginationobj, queryJson, UserInfoEntity.userId); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var Sys_ReceiveFileData = sys_ReceiveFileIBLL.GetSys_ReceiveFileEntity(keyValue); | |||||
var jsonData = new | |||||
{ | |||||
Sys_ReceiveFile = Sys_ReceiveFileData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
sys_ReceiveFileIBLL.VirtualDeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, string strEntity) | |||||
{ | |||||
Sys_ReceiveFileEntity entity = strEntity.ToObject<Sys_ReceiveFileEntity>(); | |||||
sys_ReceiveFileIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 查看实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult Read(string keyValue) | |||||
{ | |||||
sys_ReceiveFileIBLL.ReadEntity(keyValue); | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -1,23 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表单设计数据表添加"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">数据表名<font face="宋体">*</font></div> | |||||
<div id="name" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">数据表字段<font face="宋体">*</font></div> | |||||
<div id="field" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">被关联表</div> | |||||
<div id="relationName"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">被关联表字段</div> | |||||
<div id="relationField"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/DataTableForm.js") |
@@ -1,93 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.11 | |||||
* 描 述:表单设计数据表添加 | |||||
*/ | |||||
var dbId = request('dbId'); | |||||
var selectedRow = top.layer_Form.selectedRow; | |||||
var dbTable = top.layer_Form.dbTable; | |||||
var acceptClick; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#field').lrselect({ | |||||
value: 'f_column', | |||||
text: 'f_column', | |||||
title: 'f_remark', | |||||
allowSearch: true | |||||
}); | |||||
$('#relationField').lrselect({ | |||||
value: 'f_column', | |||||
text: 'f_column', | |||||
title: 'f_remark', | |||||
allowSearch: true | |||||
}); | |||||
$('#name').lrselect({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetList', | |||||
param: { databaseLinkId: dbId }, | |||||
value: 'name', | |||||
text: 'name', | |||||
title: 'tdescription', | |||||
allowSearch: true, | |||||
select: function (item) { | |||||
if (!!item) { | |||||
$('#field').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetFieldList', | |||||
param: { databaseLinkId: dbId, tableName: item.name } | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
$('#relationName').lrselect({ | |||||
data: dbTable, | |||||
param: { databaseLinkId: dbId }, | |||||
value: 'name', | |||||
text: 'name', | |||||
maxHeight: 160, | |||||
allowSearch: true, | |||||
select: function (item) { | |||||
if (!!item) { | |||||
$('#relationField').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetFieldList', | |||||
param: { databaseLinkId: dbId, tableName: item.name } | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
initData: function () { | |||||
if (!!selectedRow) { | |||||
$('#form').lrSetFormData(selectedRow); | |||||
} | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var data = $('#form').lrGetFormData(); | |||||
if (data.name == data.relationName) | |||||
{ | |||||
learun.alert.error('关联表不能是自己本身!'); | |||||
return false; | |||||
} | |||||
if (!!callBack) { | |||||
callBack(data); | |||||
} | |||||
return true; | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,66 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单设计"; | |||||
Layout = "~/Views/Shared/_CustmerFormDesigner.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/Form.css") | |||||
<div class="widget-body"> | |||||
<div id="wizard" class="wizard" data-target="#wizard-steps"> | |||||
<ul class="steps"> | |||||
<li data-target="#step-1" class="active"><span class="step">1</span>基本配置<span class="chevron"></span></li> | |||||
<li data-target="#step-2"><span class="step">2</span>数据表设置<span class="chevron"></span></li> | |||||
<li data-target="#step-3"><span class="step">3</span>表单设计<span class="chevron"></span></li> | |||||
</ul> | |||||
</div> | |||||
<div class="step-content" id="wizard-steps"> | |||||
<div class="step-pane active step-pane-base" id="step-1"> | |||||
<div class="lr-alert"> | |||||
<div class="alert alert-danger"> | |||||
<i class="fa fa-warning alert-dismissible"></i> | |||||
请你填写表单信息,用于创建或修改表单! | |||||
</div> | |||||
</div> | |||||
<div class="panel panel-default lr-panel"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title">表单基本信息配置</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<input id="F_SchemeId" type="hidden" /> | |||||
<div class="col-xs-12 lr-form-item" style="top:15px;"> | |||||
<div class="lr-form-item-title">表单名称<font face="宋体">*</font></div> | |||||
<input id="F_Name" type="text" class="form-control" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" style="top:53px;"> | |||||
<div class="lr-form-item-title">表单分类<font face="宋体">*</font></div> | |||||
<div id="F_Category" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" style="position:relative;width:100%;height:100%;"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="F_Description" class="form-control" style="height: 100%;"></textarea> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="step-pane step-gird-pane" id="step-2"> | |||||
<div class="btn-tool-bar"> | |||||
<div class="btn-tool-bar-left"><div id="F_DbId" isvalid="yes" checkexpession="NotNull"></div></div> | |||||
<div class="btn-group btn-group-sm"> | |||||
<a id="lr_db_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_db_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_db_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
</div> | |||||
</div> | |||||
<div id="gridtable"></div> | |||||
</div> | |||||
<div class="step-pane" id="step-3"> | |||||
</div> | |||||
</div> | |||||
<div class="lr-form-bottom-button" id="wizard-actions"> | |||||
<a id="btn_prev" class="btn btn-default btn-prev" disabled>上一步</a> | |||||
<a id="btn_next" class="btn btn-default btn-next">下一步</a> | |||||
<a id="btn_draft" class="btn btn-warning">保存草稿</a> | |||||
<a id="btn_finish" class="btn btn-success" disabled>保存</a> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/Form.js") |
@@ -1,66 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单设计"; | |||||
Layout = "~/Views/Shared/_CustmerFormDesigner.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/Form.css") | |||||
<div class="widget-body"> | |||||
<div id="wizard" class="wizard" data-target="#wizard-steps"> | |||||
<ul class="steps"> | |||||
<li data-target="#step-1" class="active"><span class="step">1</span>基本配置<span class="chevron"></span></li> | |||||
<li data-target="#step-2"><span class="step">2</span>数据表设置<span class="chevron"></span></li> | |||||
<li data-target="#step-3"><span class="step">3</span>表单设计<span class="chevron"></span></li> | |||||
</ul> | |||||
</div> | |||||
<div class="step-content" id="wizard-steps"> | |||||
<div class="step-pane active step-pane-base" id="step-1"> | |||||
<div class="lr-alert"> | |||||
<div class="alert alert-danger"> | |||||
<i class="fa fa-warning alert-dismissible"></i> | |||||
请你填写表单信息,用于创建或修改表单! | |||||
</div> | |||||
</div> | |||||
<div class="panel panel-default lr-panel"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title">表单基本信息配置</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<input id="F_SchemeId" type="hidden" /> | |||||
<div class="col-xs-12 lr-form-item" style="top:15px;"> | |||||
<div class="lr-form-item-title">表单名称<font face="宋体">*</font></div> | |||||
<input id="F_Name" type="text" class="form-control" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" style="top:53px;"> | |||||
<div class="lr-form-item-title">表单分类<font face="宋体">*</font></div> | |||||
<div id="F_Category" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" style="position:relative;width:100%;height:100%;"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="F_Description" class="form-control" style="height: 100%;"></textarea> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="step-pane step-gird-pane" id="step-2"> | |||||
<div class="btn-tool-bar"> | |||||
<div class="btn-tool-bar-left"><div id="F_DbId" isvalid="yes" checkexpession="NotNull"></div></div> | |||||
<div class="btn-group btn-group-sm"> | |||||
<a id="lr_db_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_db_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_db_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
</div> | |||||
</div> | |||||
<div id="gridtable"></div> | |||||
</div> | |||||
<div class="step-pane" id="step-3"> | |||||
</div> | |||||
</div> | |||||
<div class="lr-form-bottom-button" id="wizard-actions"> | |||||
<a id="btn_prev" class="btn btn-default btn-prev" disabled>上一步</a> | |||||
<a id="btn_next" class="btn btn-default btn-next">下一步</a> | |||||
<a id="btn_draft" class="btn btn-warning">保存草稿</a> | |||||
<a id="btn_finish" class="btn btn-success" disabled>保存</a> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/Form.js") |
@@ -1,73 +0,0 @@ | |||||
.step-pane-base { | |||||
padding:10px; | |||||
padding-top:69px; | |||||
} | |||||
.lr-alert { | |||||
position:absolute; | |||||
top:10px; | |||||
left:0; | |||||
height:59px; | |||||
width:100%; | |||||
padding:0 10px; | |||||
} | |||||
.lr-alert .alert { | |||||
margin-bottom:0; | |||||
} | |||||
.lr-alert .alert > i { | |||||
position: relative; | |||||
top: 1px; | |||||
font-size: 15px; | |||||
padding-right: 5px; | |||||
} | |||||
.lr-panel { | |||||
position:relative; | |||||
width:100%; | |||||
height:100%; | |||||
margin-bottom:0; | |||||
padding-top:38px; | |||||
} | |||||
.lr-panel .panel-heading { | |||||
position:absolute; | |||||
top:0; | |||||
left:0; | |||||
width:100%; | |||||
height:38px; | |||||
} | |||||
.lr-panel .panel-body { | |||||
position:relative; | |||||
width:100%; | |||||
height:100%; | |||||
padding:91px 0 15px 0; | |||||
} | |||||
.lr-form-item { | |||||
position:absolute; | |||||
top:0; | |||||
left:0; | |||||
height:38px; | |||||
width:100%; | |||||
padding-right:20px; | |||||
} | |||||
.wizard { | |||||
z-index:3; | |||||
} | |||||
.btn-tool-bar { | |||||
position:absolute; | |||||
top:0; | |||||
width:100%; | |||||
text-align:right; | |||||
padding:5px; | |||||
border-bottom:1px solid #ddd; | |||||
} | |||||
.step-gird-pane { | |||||
padding-top:41px; | |||||
} | |||||
.btn-tool-bar-left { | |||||
position:absolute; | |||||
left:5px; | |||||
top:6px; | |||||
width:300px; | |||||
height:28px; | |||||
z-index:4; | |||||
text-align:left; | |||||
} |
@@ -1,73 +0,0 @@ | |||||
.step-pane-base { | |||||
padding:10px; | |||||
padding-top:69px; | |||||
} | |||||
.lr-alert { | |||||
position:absolute; | |||||
top:10px; | |||||
left:0; | |||||
height:59px; | |||||
width:100%; | |||||
padding:0 10px; | |||||
} | |||||
.lr-alert .alert { | |||||
margin-bottom:0; | |||||
} | |||||
.lr-alert .alert > i { | |||||
position: relative; | |||||
top: 1px; | |||||
font-size: 15px; | |||||
padding-right: 5px; | |||||
} | |||||
.lr-panel { | |||||
position:relative; | |||||
width:100%; | |||||
height:100%; | |||||
margin-bottom:0; | |||||
padding-top:38px; | |||||
} | |||||
.lr-panel .panel-heading { | |||||
position:absolute; | |||||
top:0; | |||||
left:0; | |||||
width:100%; | |||||
height:38px; | |||||
} | |||||
.lr-panel .panel-body { | |||||
position:relative; | |||||
width:100%; | |||||
height:100%; | |||||
padding:91px 0 15px 0; | |||||
} | |||||
.lr-form-item { | |||||
position:absolute; | |||||
top:0; | |||||
left:0; | |||||
height:38px; | |||||
width:100%; | |||||
padding-right:20px; | |||||
} | |||||
.wizard { | |||||
z-index:3; | |||||
} | |||||
.btn-tool-bar { | |||||
position:absolute; | |||||
top:0; | |||||
width:100%; | |||||
text-align:right; | |||||
padding:5px; | |||||
border-bottom:1px solid #ddd; | |||||
} | |||||
.step-gird-pane { | |||||
padding-top:41px; | |||||
} | |||||
.btn-tool-bar-left { | |||||
position:absolute; | |||||
left:5px; | |||||
top:6px; | |||||
width:300px; | |||||
height:28px; | |||||
z-index:4; | |||||
text-align:left; | |||||
} |
@@ -1,201 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.05 | |||||
* 描 述:自定义表单设计 | |||||
*/ | |||||
var keyValue = request('keyValue'); | |||||
var categoryId = request('categoryId'); | |||||
var dbTable = []; | |||||
var dbId = ''; | |||||
var selectedRow = null; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
/*绑定事件和初始化控件*/ | |||||
bind: function () { | |||||
// 加载导向 | |||||
$('#wizard').wizard().on('change', function (e, data) { | |||||
var $finish = $("#btn_finish"); | |||||
var $next = $("#btn_next"); | |||||
if (data.direction == "next") { | |||||
if (data.step == 1) { | |||||
if (!$('#step-1').lrValidform()) { | |||||
return false; | |||||
} | |||||
} else if (data.step == 2) { | |||||
dbTable = $('#gridtable').jfGridGet('rowdatas'); | |||||
if (dbId == '' || dbTable.length == 0) { | |||||
learun.alert.error('至少选择一张数据表'); | |||||
return false; | |||||
} | |||||
$('#step-3').lrCustmerFormDesigner('updatedb', { dbId: dbId, dbTable: dbTable }); | |||||
$finish.removeAttr('disabled'); | |||||
$next.attr('disabled', 'disabled'); | |||||
} | |||||
else { | |||||
$finish.attr('disabled', 'disabled'); | |||||
} | |||||
} else { | |||||
$finish.attr('disabled', 'disabled'); | |||||
$next.removeAttr('disabled'); | |||||
} | |||||
}); | |||||
// 数据库表选择 | |||||
$('#F_DbId').lrselect({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DatabaseLink/GetTreeList', | |||||
type: 'tree', | |||||
placeholder:'请选择数据库', | |||||
allowSearch: true, | |||||
select: function (item) { | |||||
if (item.hasChildren) { | |||||
dbId = ''; | |||||
dbTable = []; | |||||
$('#gridtable').jfGridSet('refreshdata', []); | |||||
} | |||||
else if (dbId != item.id) { | |||||
dbId = item.id; | |||||
dbTable = []; | |||||
$('#gridtable').jfGridSet('refreshdata', []); | |||||
} | |||||
} | |||||
}); | |||||
$('#F_Category').lrDataItemSelect({ code: 'FormSort' }); | |||||
$('#F_Category').lrselectSet(categoryId); | |||||
// 新增 | |||||
$('#lr_db_add').on('click', function () { | |||||
dbTable = $('#gridtable').jfGridGet('rowdatas'); | |||||
selectedRow = null; | |||||
learun.layerForm({ | |||||
id: 'DataTableForm', | |||||
title: '添加数据表', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/DataTableForm?dbId=' + dbId, | |||||
width: 600, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
$('#gridtable').jfGridSet('addRow', data); | |||||
}); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_db_edit').on('click', function () { | |||||
dbTable = $('#gridtable').jfGridGet('rowdatas'); | |||||
selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||||
var keyValue = $('#gridtable').jfGridValue('name'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'DataTableForm', | |||||
title: '编辑数据表', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/DataTableForm?dbId=' + dbId, | |||||
width: 600, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
$.extend(selectedRow, data); | |||||
$('#gridtable').jfGridSet('updateRow'); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_db_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('name'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||||
if (res) { | |||||
$('#gridtable').jfGridSet('removeRow', keyValue); | |||||
top.layer.close(index); //再执行关闭 | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
$('#gridtable').jfGrid({ | |||||
headData: [ | |||||
{ label: "数据表名", name: "name", width: 200, align: "left" }, | |||||
{ label: "数据表字段", name: "field", width: 200, align: "left" }, | |||||
{ label: "被关联表", name: "relationName", width: 200, align: "left" }, | |||||
{ label: "被关联表字段", name: "relationField", width: 200, align: "left" } | |||||
], | |||||
mainId: 'name', | |||||
reloadSelected: true | |||||
}); | |||||
// 设计页面初始化 | |||||
$('#step-3').lrCustmerFormDesigner('init'); | |||||
// 保存数据按钮 | |||||
$("#btn_finish").on('click', page.save); | |||||
$("#btn_draft").on('click', page.draftsave); | |||||
}, | |||||
/*初始化数据*/ | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetFormData?keyValue=' + keyValue, function (data) {// | |||||
$('#step-1').lrSetFormData(data.schemeInfoEntity); | |||||
var scheme = JSON.parse(data.schemeEntity.F_Scheme); | |||||
$('#F_DbId').lrselectSet(scheme.dbId); | |||||
$('#gridtable').jfGridSet('refreshdata', scheme.dbTable); | |||||
$('#step-3').lrCustmerFormDesigner('set', scheme); | |||||
}); | |||||
} | |||||
}, | |||||
/*保存数据*/ | |||||
save: function () { | |||||
var schemeInfo = $('#step-1').lrGetFormData(keyValue); | |||||
if (!$('#step-3').lrCustmerFormDesigner('valid')) { | |||||
return false; | |||||
} | |||||
var scheme = $('#step-3').lrCustmerFormDesigner('get'); | |||||
schemeInfo.F_Type = 0; | |||||
schemeInfo.F_EnabledMark = 1; | |||||
var postData = { | |||||
keyValue: keyValue, | |||||
schemeInfo: JSON.stringify(schemeInfo), | |||||
scheme: JSON.stringify(scheme), | |||||
type: 1 | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_FormModule/Custmerform/SaveForm', postData, function (res) { | |||||
// 保存成功后才回调 | |||||
learun.frameTab.currentIframe().refreshGirdData(); | |||||
}); | |||||
}, | |||||
/*保存草稿数据*/ | |||||
draftsave: function () { | |||||
var schemeInfo = $('#step-1').lrGetFormData(keyValue); | |||||
var scheme = $('#step-3').lrCustmerFormDesigner('get'); | |||||
dbTable = $('#gridtable').jfGridGet('rowdatas'); | |||||
scheme.dbId = dbId; | |||||
scheme.dbTable = dbTable; | |||||
schemeInfo.F_EnabledMark = 0; | |||||
schemeInfo.F_Type = 0; | |||||
var postData = { | |||||
keyValue: keyValue, | |||||
schemeInfo: JSON.stringify(schemeInfo), | |||||
scheme: JSON.stringify(scheme), | |||||
type: 2 | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_FormModule/Custmerform/SaveForm', postData, function (res) { | |||||
// 保存成功后才回调 | |||||
learun.frameTab.currentIframe().refreshGirdData(); | |||||
}); | |||||
} | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,24 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表单模板历史记录管理"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_SystemModule/Views/DataItem/ClassifyIndex.css") | |||||
<div class="lr-layout"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_preview" class="btn btn-default"><i class="fa fa-eye"></i> 预览模板</a> | |||||
<a id="lr_update" class="btn btn-default"><i class="fa fa-exchange"></i> 更新到此版本</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/HistoryForm.js") |
@@ -1,24 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表单模板历史记录管理"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_SystemModule/Views/DataItem/ClassifyIndex.css") | |||||
<div class="lr-layout"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_preview" class="btn btn-default"><i class="fa fa-eye"></i> 预览模板</a> | |||||
<a id="lr_update" class="btn btn-default"><i class="fa fa-exchange"></i> 更新到此版本</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/HistoryForm.js") |
@@ -1,117 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:表单模板记录 | |||||
*/ | |||||
var keyValue = request('keyValue'); | |||||
var refreshGirdData; // 更新数据 | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var nowschemeId = learun.frameTab.currentIframe().nowschemeId; | |||||
var page = { | |||||
init: function () { | |||||
page.initGrid(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 预览表单 | |||||
$('#lr_preview').on('click', function () { | |||||
var schemeId = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(schemeId)) { | |||||
learun.layerForm({ | |||||
id: 'custmerForm_PreviewForm', | |||||
title: '预览当前表单', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/PreviewForm?schemeInfoId=' + keyValue, | |||||
width: 800, | |||||
height: 600, | |||||
maxmin: true, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
// 更新到此版本 | |||||
$('#lr_update').on('click', function () { | |||||
var schemeId = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(schemeId)) { | |||||
if (schemeId != nowschemeId) { | |||||
learun.layerConfirm('是否要更新到该版本!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/LR_FormModule/Custmerform/UpdateScheme', { schemeInfoId: keyValue, schemeId: schemeId }, function () { | |||||
nowschemeId = schemeId; | |||||
learun.frameTab.currentIframe().nowschemeId = schemeId; | |||||
learun.frameTab.currentIframe().refreshGirdData(); | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
else { | |||||
learun.alert.warning('已经是当前版本了!'); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
initGrid: function () { | |||||
$('#gridtable').jfGrid({ | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/GetSchemePageList', | |||||
headData: [ | |||||
{ label: "创建人", name: "F_CreateUserName", width: 160, align: "left" }, | |||||
{ | |||||
label: "创建时间", name: "F_CreateDate", width: 160, align: "left", | |||||
formatter: function (cellvalue) { | |||||
return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss'); | |||||
} | |||||
}, | |||||
{ | |||||
label: "状态", name: "F_Type", width: 80, align: "center", | |||||
formatter: function (cellvalue, row) { | |||||
if (row.F_Type == 1) { | |||||
return '<span class=\"label label-success\" style=\"cursor: pointer;\">正式</span>'; | |||||
} | |||||
else { | |||||
return '<span class=\"label label-info\" style=\"cursor: pointer;\">草稿</span>'; | |||||
} | |||||
} | |||||
}, | |||||
{ | |||||
label: "", name: "F_Id", width: 80, align: "center", | |||||
formatter: function (cellvalue) { | |||||
if (cellvalue == nowschemeId) { | |||||
return '<span class=\"label label-danger\" style=\"cursor: pointer;\">当前版本</span>'; | |||||
} | |||||
} | |||||
} | |||||
], | |||||
mainId: 'F_Id', | |||||
reloadSelected: true, | |||||
isPage: true, | |||||
sidx: 'F_CreateDate', | |||||
sord: 'DESC' | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
$('#gridtable').jfGridSet('reload', { schemeInfoId: keyValue }); | |||||
} | |||||
}; | |||||
// 保存数据后回调刷新 | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
} | |||||
page.init(); | |||||
} |
@@ -1,53 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表单设计"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title lrlg ">表单分类</div> | |||||
<div class="lr-layout-body" id="lr_left_tree"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title"> | |||||
<span class="lrlg">模板数据</span> - <span id="titleinfo" class="lrlg">未选择分类</span> | |||||
</div> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入模板名称" /> | |||||
</div> | |||||
<div class="lr-layout-tool-item"> | |||||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> <span class="lrlg">查询</span></a> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> <span class="lrlg">新增</span></a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlg">编辑</span></a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlg">删除</span></a> | |||||
<a id="lr_more" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> | |||||
<i class="fa fa-reorder"></i> <span class="lrlg">更多</span><span class="caret"></span> | |||||
</a> | |||||
<ul class="dropdown-menu pull-right" aria-labelledby="lr-more"> | |||||
<li id="lr_preview"><a><i></i> <span class="lrlg">预览表单</span></a></li> | |||||
<li id="lr_enabled"><a><i></i> <span class="lrlg">启用表单</span></a></li> | |||||
<li id="lr_disabled"><a><i></i> <span class="lrlg">禁用表单</span></a></li> | |||||
<li id="lr_history"><a><i></i> <span class="lrlg">查看历史记录</span></a></li> | |||||
</ul> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_category" class="btn btn-default"><i class="fa fa-tags"></i> <span class="lrlg">分类管理</span></a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/Index.js") |
@@ -1,245 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:表单设计 | |||||
*/ | |||||
var refreshGirdData; // 更新数据 | |||||
var categoryId; | |||||
var nowschemeId; | |||||
var keyword; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.initGrid(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 左侧数据加载 | |||||
$('#lr_left_tree').lrtree({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailTree', | |||||
param: { itemCode: 'FormSort' }, | |||||
nodeClick: function (item) { | |||||
categoryId = item.value; | |||||
$('#titleinfo').text(item.text); | |||||
page.search(); | |||||
} | |||||
}); | |||||
// 查询 | |||||
$('#btn_Search').on('click', function () { | |||||
keyword = $('#txt_Keyword').val(); | |||||
page.search(); | |||||
}); | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'Form', | |||||
title: '自定义表单新增', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/Form?categoryId=' + categoryId, | |||||
width: 1200, | |||||
height: 700, | |||||
maxmin: true, | |||||
btn:null | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'Form', | |||||
title: '自定义表单编辑', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/Form?categoryId=' + categoryId + "&keyValue=" + keyValue, | |||||
width: 1200, | |||||
height: 700, | |||||
maxmin: true, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_FormModule/Custmerform/DeleteForm', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 预览表单 | |||||
$('#lr_preview').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'custmerForm_PreviewForm', | |||||
title: '预览当前表单', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/PreviewForm?schemeInfoId=' + keyValue, | |||||
width: 800, | |||||
height: 600, | |||||
maxmin: true, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
// 启用 | |||||
$('#lr_enabled').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
var enabledMark = $('#gridtable').jfGridValue('F_EnabledMark'); | |||||
var type = $('#gridtable').jfGridValue('F_Type'); | |||||
if (type == 2) { | |||||
learun.alert.warning('草稿模板不能启用!'); | |||||
return false; | |||||
} | |||||
if (learun.checkrow(keyValue)) { | |||||
if (enabledMark != 1) { | |||||
learun.layerConfirm('是否确认启用该表单模板!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/LR_FormModule/Custmerform/UpDateSate', { keyValue: keyValue, state: 1 }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
else { | |||||
learun.alert.warning('该表单已启用!'); | |||||
} | |||||
} | |||||
}); | |||||
// 禁用 | |||||
$('#lr_disabled').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
var enabledMark = $('#gridtable').jfGridValue('F_EnabledMark'); | |||||
var type = $('#gridtable').jfGridValue('F_Type'); | |||||
if (type == 2) { | |||||
learun.alert.warning('草稿模板不能禁用!'); | |||||
return false; | |||||
} | |||||
if (learun.checkrow(keyValue)) { | |||||
if (enabledMark == 1) { | |||||
learun.layerConfirm('是否确认禁用该表单模板!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/LR_FormModule/Custmerform/UpDateSate', { keyValue: keyValue, state: 0 }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
else { | |||||
learun.alert.warning('该表单已禁用!'); | |||||
} | |||||
} | |||||
}); | |||||
// 查看历史记录 | |||||
$('#lr_history').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
var Name = $('#gridtable').jfGridValue('F_Name'); | |||||
nowschemeId = $('#gridtable').jfGridValue('F_SchemeId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'HistoryForm', | |||||
title: '表单模板历史记录-' + Name, | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/HistoryForm?&keyValue=' + keyValue, | |||||
width: 600, | |||||
height: 400, | |||||
maxmin: true, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
/*分类管理*/ | |||||
$('#lr_category').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'ClassifyIndex', | |||||
title: '分类管理', | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataItem/DetailIndex?itemCode=FormSort', | |||||
width: 800, | |||||
height: 500, | |||||
maxmin: true, | |||||
btn: null, | |||||
end: function () { | |||||
learun.clientdata.update('dataItem'); | |||||
location.reload(); | |||||
} | |||||
}); | |||||
}); | |||||
}, | |||||
initGrid: function () { | |||||
$('#gridtable').lrAuthorizeJfGrid({ | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/GetPageList', | |||||
headData: [ | |||||
{ label: "名称", name: "F_Name", width: 150, align: "left" }, | |||||
{ | |||||
label: "分类", name: "F_Category", width: 150, align: "center", | |||||
formatterAsync: function (callback, value, row) { | |||||
learun.clientdata.getAsync('dataItem', { | |||||
key: value, | |||||
code: 'FormSort', | |||||
callback: function (_data) { | |||||
callback(_data.text); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "状态", name: "F_EnabledMark", width: 50, align: "center", | |||||
formatter: function (cellvalue, row) { | |||||
if (row.F_Type == 1) { | |||||
if (cellvalue == 1) { | |||||
return '<span class=\"label label-success\" style=\"cursor: pointer;\">启用</span>'; | |||||
} else if (cellvalue == 0) { | |||||
return '<span class=\"label label-default\" style=\"cursor: pointer;\">禁用</span>'; | |||||
} | |||||
} | |||||
else { | |||||
return '<span class=\"label label-info\" style=\"cursor: pointer;\">草稿</span>'; | |||||
} | |||||
} | |||||
}, | |||||
{ label: "创建人", name: "F_CreateUserName", width: 100, align: "center" }, | |||||
{ | |||||
label: "创建时间", name: "F_CreateDate", width: 150, align: "left", | |||||
formatter: function (cellvalue) { | |||||
return learun.formatDate(cellvalue, 'yyyy-MM-dd'); | |||||
} | |||||
}, | |||||
{ label: "备注", name: "F_Description", width: 500, align: "left" } | |||||
], | |||||
mainId: 'F_Id', | |||||
reloadSelected: true, | |||||
isPage: true | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
param.category = categoryId; | |||||
param.keyword = keyword; | |||||
$('#gridtable').jfGridSet('reload', param); | |||||
} | |||||
}; | |||||
// 保存数据后回调刷新 | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
} | |||||
page.init(); | |||||
} |
@@ -1,8 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单弹层实例"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/LayerInstanceForm.css") | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/LayerInstanceForm.js") | |||||
@@ -1,8 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单弹层实例"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/LayerInstanceForm.css") | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/LayerInstanceForm.js") | |||||
@@ -1,8 +0,0 @@ | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} |
@@ -1,8 +0,0 @@ | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} |
@@ -1,87 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:自定义表单 | |||||
*/ | |||||
var id = request('id'); | |||||
var keyValue = request('keyValue'); | |||||
var acceptClick; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var formModule; | |||||
var girdCompontMap; | |||||
var page = { | |||||
init: function () { | |||||
if (!!id) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetFormData?keyValue=' + id, function (data) {// | |||||
formModule = JSON.parse(data.schemeEntity.F_Scheme); | |||||
girdCompontMap = $('body').lrCustmerFormRender(formModule.data); | |||||
}); | |||||
} | |||||
page.initData(); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetInstanceForm?schemeInfoId=' + id + '&keyValue=' + keyValue, function (data) {// | |||||
page.setFormData(data); | |||||
}); | |||||
} | |||||
}, | |||||
setFormData: function (data) { | |||||
if (!!formModule) { | |||||
$.each(data, function (id, item) { | |||||
if (!!girdCompontMap[id]) { | |||||
var fieldMap = {}; | |||||
$.each(girdCompontMap[id].fieldsData, function (id, girdFiled) { | |||||
if (!!girdFiled.field) { | |||||
fieldMap[girdFiled.field.toLowerCase()] = girdFiled.field; | |||||
} | |||||
}); | |||||
var rowDatas = []; | |||||
for (var i = 0, l = item.length; i < l; i++) { | |||||
var _point = {}; | |||||
for (var _field in item[i]) { | |||||
_point[fieldMap[_field]] = item[i][_field]; | |||||
} | |||||
rowDatas.push(_point); | |||||
} | |||||
$('#' + girdCompontMap[id].id).jfGridSet('refreshdata', { rowdatas: rowDatas }); | |||||
} | |||||
else { | |||||
$('body').lrSetCustmerformData(item[0], id); | |||||
} | |||||
}); | |||||
} | |||||
else { | |||||
setTimeout(function () { | |||||
page.setFormData(data); | |||||
}, 100); | |||||
} | |||||
} | |||||
}; | |||||
page.init(); | |||||
// 保存调用函数 | |||||
acceptClick = function (callBack) { | |||||
if (!$.lrValidCustmerform()) { | |||||
return false; | |||||
} | |||||
var formData = $('body').lrGetCustmerformData(keyValue); | |||||
var postData = | |||||
{ | |||||
formData: JSON.stringify(formData) | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_FormModule/Custmerform/SaveInstanceForm?keyValue=' + keyValue + "&schemeInfoId=" + id, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
} | |||||
} |
@@ -1,6 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表单预览"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/PreviewForm.css") | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/PreviewForm.js") |
@@ -1,6 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表单预览"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/PreviewForm.css") | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/PreviewForm.js") |
@@ -1,8 +0,0 @@ | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} |
@@ -1,8 +0,0 @@ | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} |
@@ -1,36 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:自定义表单预览 | |||||
*/ | |||||
var keyValue = request('keyValue'); | |||||
var schemeInfoId = request('schemeInfoId'); | |||||
var schemeId = request('schemeId'); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var formData; | |||||
var page = { | |||||
init: function () { | |||||
if (!!schemeInfoId) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetFormData?keyValue=' + schemeInfoId, function (data) {// | |||||
formData = JSON.parse(data.schemeEntity.F_Scheme); | |||||
$('body').lrCustmerFormRender(formData.data); | |||||
}); | |||||
} | |||||
else if (!!schemeId) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetSchemeEntity?keyValue=' + schemeId, function (res) {// | |||||
formData = JSON.parse(res.F_Scheme); | |||||
$('body').lrCustmerFormRender(formData.data); | |||||
}); | |||||
} | |||||
else if (!!keyValue) { | |||||
formData = top[keyValue]; | |||||
$('body').lrCustmerFormRender(formData); | |||||
} | |||||
} | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,73 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "Form"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/SetFieldForm.css") | |||||
<div class="lr-form-layout"> | |||||
<div class="lr-form-layout-header" id="form"> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">上级列头</div> | |||||
<div id="parentId" class="lr-select-underline"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">显示名称<font face="宋体">*</font></div> | |||||
<input id="name" type="text" class="form-control lr-input-underline" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">绑定字段</div> | |||||
<div id="field" class="lr-select-underline"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">编辑类型<font face="宋体">*</font></div> | |||||
<div id="type" isvalid="yes" class="lr-select-underline" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item"> | |||||
<div class="lr-form-item-title">显示宽度<font face="宋体">*</font></div> | |||||
<input id="width" type="text" class="form-control lr-input-underline" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item"> | |||||
<div class="lr-form-item-title">对齐方式<font face="宋体">*</font></div> | |||||
<div id="align" class="lr-select-underline" isvalid="yes" checkexpession="NotNull"> | |||||
<ul> | |||||
<li data-value="left">left</li> | |||||
<li data-value="center">center</li> | |||||
<li data-value="right">right</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item"> | |||||
<div class="lr-form-item-title">排序号<font face="宋体">*</font></div> | |||||
<input id="sort" type="text" class="form-control lr-input-underline" isvalid="yes" checkexpession="isNum" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">数据来源<font face="宋体">*</font></div> | |||||
<div id="dataSource" class="lr-select-underline" ></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">数据选项<font face="宋体">*</font></div> | |||||
<div id="dataItemId" class="lr-select-underline" ></div> | |||||
<div id="dataSourceId" class="lr-select-underline" style="display:none;"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">窗口宽</div> | |||||
<input id="dataSourceWidth" type="text" class="form-control lr-input-underline" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">窗口高</div> | |||||
<input id="dataSourceHeight" type="text" class="form-control lr-input-underline" /> | |||||
</div> | |||||
</div> | |||||
<div class="lr-form-layout-body data-edit-select"> | |||||
<div class="lr-form-layout-body-title"> | |||||
<div class="lr-form-jfgrid-btns"> | |||||
<a id="lr_edit_datasource" class="btn btn-success"><i class="fa fa-pencil-square-o"></i> 修改</a> | |||||
</div> | |||||
<span>数据源字段设置</span> | |||||
</div> | |||||
<div id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/SetFieldForm.js") |
@@ -1,73 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "Form"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/SetFieldForm.css") | |||||
<div class="lr-form-layout"> | |||||
<div class="lr-form-layout-header" id="form"> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">上级列头</div> | |||||
<div id="parentId" class="lr-select-underline"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">显示名称<font face="宋体">*</font></div> | |||||
<input id="name" type="text" class="form-control lr-input-underline" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">绑定字段</div> | |||||
<div id="field" class="lr-select-underline"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">编辑类型<font face="宋体">*</font></div> | |||||
<div id="type" isvalid="yes" class="lr-select-underline" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item"> | |||||
<div class="lr-form-item-title">显示宽度<font face="宋体">*</font></div> | |||||
<input id="width" type="text" class="form-control lr-input-underline" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item"> | |||||
<div class="lr-form-item-title">对齐方式<font face="宋体">*</font></div> | |||||
<div id="align" class="lr-select-underline" isvalid="yes" checkexpession="NotNull"> | |||||
<ul> | |||||
<li data-value="left">left</li> | |||||
<li data-value="center">center</li> | |||||
<li data-value="right">right</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item"> | |||||
<div class="lr-form-item-title">排序号<font face="宋体">*</font></div> | |||||
<input id="sort" type="text" class="form-control lr-input-underline" isvalid="yes" checkexpession="isNum" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">数据来源<font face="宋体">*</font></div> | |||||
<div id="dataSource" class="lr-select-underline" ></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">数据选项<font face="宋体">*</font></div> | |||||
<div id="dataItemId" class="lr-select-underline" ></div> | |||||
<div id="dataSourceId" class="lr-select-underline" style="display:none;"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">窗口宽</div> | |||||
<input id="dataSourceWidth" type="text" class="form-control lr-input-underline" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item data-edit-select"> | |||||
<div class="lr-form-item-title">窗口高</div> | |||||
<input id="dataSourceHeight" type="text" class="form-control lr-input-underline" /> | |||||
</div> | |||||
</div> | |||||
<div class="lr-form-layout-body data-edit-select"> | |||||
<div class="lr-form-layout-body-title"> | |||||
<div class="lr-form-jfgrid-btns"> | |||||
<a id="lr_edit_datasource" class="btn btn-success"><i class="fa fa-pencil-square-o"></i> 修改</a> | |||||
</div> | |||||
<span>数据源字段设置</span> | |||||
</div> | |||||
<div id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/SetFieldForm.js") |
@@ -1,33 +0,0 @@ | |||||
body { | |||||
padding:5px; | |||||
} | |||||
.lr-form-layout { | |||||
padding-top:210px; | |||||
} | |||||
.lr-form-layout-header { | |||||
position: absolute; | |||||
top:0; | |||||
left:0; | |||||
width: 100%; | |||||
height: 210px; | |||||
padding: 10px; | |||||
border:1px solid #ccc; | |||||
z-index:2; | |||||
} | |||||
.lr-form-item-title { | |||||
width:58px; | |||||
padding-right:0px; | |||||
text-align:left; | |||||
} | |||||
.lr-form-item { | |||||
padding-left:58px; | |||||
} | |||||
.lr-form-layout-body | |||||
{ | |||||
padding-top:30px; | |||||
border:1px solid #ccc; | |||||
border-top:0px; | |||||
} | |||||
.data-edit-select,data-edit-fixedInfo { | |||||
display:none; | |||||
} |
@@ -1,33 +0,0 @@ | |||||
body { | |||||
padding:5px; | |||||
} | |||||
.lr-form-layout { | |||||
padding-top:210px; | |||||
} | |||||
.lr-form-layout-header { | |||||
position: absolute; | |||||
top:0; | |||||
left:0; | |||||
width: 100%; | |||||
height: 210px; | |||||
padding: 10px; | |||||
border:1px solid #ccc; | |||||
z-index:2; | |||||
} | |||||
.lr-form-item-title { | |||||
width:58px; | |||||
padding-right:0px; | |||||
text-align:left; | |||||
} | |||||
.lr-form-item { | |||||
padding-left:58px; | |||||
} | |||||
.lr-form-layout-body | |||||
{ | |||||
padding-top:30px; | |||||
border:1px solid #ccc; | |||||
border-top:0px; | |||||
} | |||||
.data-edit-select,data-edit-fixedInfo { | |||||
display:none; | |||||
} |
@@ -1,243 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.11 | |||||
* 描 述:自定义表格字段设置 | |||||
*/ | |||||
var dbId = request('dbId'); | |||||
var tableName = request('tableName'); | |||||
var keyValue = request('keyValue'); // 设置列的ID项 | |||||
var parentId = request('parentId'); // 设置列的ID项 | |||||
var acceptClick; | |||||
var selectFieldData = null; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var dataSourceField = []; | |||||
var dataSourceId = ''; | |||||
var itemCode = ''; | |||||
var colDatas = top.layer_custmerForm_editgrid_index.colDatas; | |||||
function setGridData(data) | |||||
{ | |||||
data = data || [ | |||||
{ label: '项目名', name: 'F_ItemName', value: '', width: '100', align: 'left', hide: '0', sort: 1 }, | |||||
{ label: '项目值', name: 'F_ItemValue', value: '', width: '100', align: 'left', hide: '0', sort: 2 } | |||||
]; | |||||
data = data.sort(function (a, b) { | |||||
return parseInt(a.hide) - parseInt(b.hide); | |||||
}); | |||||
data = data.sort(function (a, b) { | |||||
return parseInt(a.sort) - parseInt(b.sort); | |||||
}); | |||||
$('#gridtable').jfGridSet('refreshdata', data); | |||||
} | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
// 上级 | |||||
$('#parentId').lrselect({ | |||||
data: colDatas, | |||||
text: 'name', | |||||
value: 'id' | |||||
}).lrselectSet(parentId); | |||||
// 绑定字段 | |||||
$('#field').lrselect({ | |||||
value: 'f_column', | |||||
text: 'f_column', | |||||
title: 'f_remark', | |||||
allowSearch: true, | |||||
select: function (item) { | |||||
} | |||||
}); | |||||
learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetFieldList', { databaseLinkId: dbId, tableName: tableName }, function (data) { | |||||
$('#field').lrselectRefresh({ | |||||
data: data | |||||
}); | |||||
}); | |||||
// 编辑类型 | |||||
$('#type').lrselect({ | |||||
placeholder: false, | |||||
data: [{ id: 'input', text: 'input' }, { id: 'label', text: 'label' }, { id: 'select', text: 'select' }, { id: 'guid', text: 'GUID' }], | |||||
select: function (item) { | |||||
$('.data-edit-select').hide(); | |||||
if (item.id == "select") { | |||||
$('.data-edit-select').show(); | |||||
} | |||||
} | |||||
}).lrselectSet('input'); | |||||
// 对齐方式 | |||||
$('#align').lrselect({ placeholder: false }).lrselectSet('left'); | |||||
$('#gridtable').jfGrid({ | |||||
headData: [ | |||||
{ label: "字段名", name: "label", width: 120, align: "left" }, | |||||
{ label: "字段ID", name: "name", width: 120, align: "left" }, | |||||
{ label: "填充栏位", name: "value", width: 120, align: "left" }, | |||||
{ label: "宽度", name: "width", width: 70, align: "center" }, | |||||
{ label: "对齐方式", name: "align", width: 60, align: "center" }, | |||||
{ | |||||
label: "是否隐藏", name: "hide", width: 60, align: "center", | |||||
formatter: function (cellvalue, row) { | |||||
if (cellvalue == 1) { | |||||
return '<span class=\"label label-default \" style=\"cursor: pointer;\">是</span>'; | |||||
} else if (cellvalue == 0) { | |||||
return '<span class=\"label label-success \" style=\"cursor: pointer;\">否</span>'; | |||||
} | |||||
} | |||||
}// 1 隐藏 0 显示 | |||||
] | |||||
}); | |||||
// 数据字典选项 | |||||
$('#dataItemId').lrselect({ | |||||
allowSearch: true, | |||||
maxHeight: 150, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetClassifyTree', | |||||
type: 'tree', | |||||
select: function (item) { | |||||
dataSourceId = ''; | |||||
itemCode = ''; | |||||
if (!!item) { | |||||
itemCode = item.value; | |||||
dataSourceId = item.id; | |||||
} | |||||
} | |||||
}); | |||||
// 数据源 | |||||
$('#dataSourceId').lrselect({ | |||||
value: 'F_Code', | |||||
text: 'F_Name', | |||||
allowSearch: true, | |||||
maxHeight: 150, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetList', | |||||
select: function (item) { | |||||
dataSourceField = []; | |||||
dataSourceId = ''; | |||||
if (!!item) { | |||||
dataSourceId = item.F_Code; | |||||
learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataColName', { code: item.F_Code }, function (data) { | |||||
for (var i = 0, l = data.length; i < l; i++) { | |||||
if (data[i] != 'rownum') { | |||||
var point = { label: '', name: data[i], value: '', width: '100', align: 'left', hide: '1', sort: i }; | |||||
dataSourceField.push(point); | |||||
} | |||||
} | |||||
setGridData(dataSourceField); | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
// 数据来源 | |||||
$('#dataSource').lrselect({ | |||||
data: [{ id: '0', text: '数据字典' }, { id: '1', text: '数据源' }], | |||||
value: 'id', | |||||
text: 'text', | |||||
placeholder: false, | |||||
select: function (item) { | |||||
if (item.id == '0') { | |||||
$('#dataSourceId').hide(); | |||||
$('#dataItemId').show(); | |||||
// 如果是数据字典的话 | |||||
setGridData(); | |||||
} | |||||
else { | |||||
$('#dataItemId').hide(); | |||||
$('#dataSourceId').show(); | |||||
setGridData(dataSourceField); | |||||
} | |||||
} | |||||
}).lrselectSet('0'); | |||||
$('#lr_edit_datasource').on('click', function () { | |||||
selectFieldData = $('#gridtable').jfGridGet('rowdata'); | |||||
var _name = $('#gridtable').jfGridValue('name'); | |||||
if (learun.checkrow(_name)) { | |||||
learun.layerForm({ | |||||
id: 'SetSelectFieldForm', | |||||
title: '设置选择字段', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/SetSelectFieldForm?dbId=' + dbId + '&tableName=' + tableName, | |||||
width: 450, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
var rowdatas = $('#gridtable').jfGridGet('rowdatas'); | |||||
for (var i = 0, l = rowdatas.length; i < l; i++) { | |||||
if (rowdatas[i].name == data.name) { | |||||
rowdatas[i] = data; | |||||
} | |||||
} | |||||
setGridData(rowdatas); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
for (var i = 0, l = colDatas.length; i < l; i++) { | |||||
var item = colDatas[i]; | |||||
if (item.id == keyValue) { | |||||
item.dataItemId = item.dataSourceId; | |||||
$('#form').lrSetFormData(item); | |||||
if (item.type == 'select') { | |||||
$('#gridtable').jfGridSet('refreshdata', item.selectData); | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var formData = $('#form').lrGetFormData(); | |||||
var resdata = {}; | |||||
resdata.id = keyValue || learun.newGuid(); | |||||
resdata.name = formData.name; | |||||
resdata.field = formData.field; | |||||
resdata.width = formData.width; | |||||
resdata.sort = formData.sort; | |||||
resdata.type = formData.type; | |||||
resdata.align = formData.align; | |||||
resdata.parentId = formData.parentId; | |||||
switch (formData.type) { | |||||
case 'select': | |||||
resdata.dataSource = formData.dataSource; | |||||
resdata.dataSourceId = dataSourceId; | |||||
resdata.dataItemCode = itemCode; | |||||
resdata.dataSourceWidth = formData.dataSourceWidth; | |||||
resdata.dataSourceHeight = formData.dataSourceHeight; | |||||
resdata.selectData = $('#gridtable').jfGridGet('rowdatas'); | |||||
break; | |||||
case 'fixedInfo': | |||||
resdata.fixedInfoType = formData.fixedInfoType; | |||||
resdata.fixedInfoHide = formData.fixedInfoHide; | |||||
break; | |||||
} | |||||
callBack(resdata); | |||||
return true; | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,25 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表格字段设置"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout" style="padding:0;"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/SetFieldIndex.js") | |||||
@@ -1,25 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表格字段设置"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout" style="padding:0;"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/SetFieldIndex.js") | |||||
@@ -1,111 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.03.22 | |||||
* 描 述:表格数据字段编辑 | |||||
*/ | |||||
var keyValue = request('keyValue'); | |||||
var gridSetting = top[keyValue]; | |||||
var colDatas; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
colDatas = gridSetting.fields; | |||||
var page = { | |||||
init: function () { | |||||
page.initGrid(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
var _Id = $('#gridtable').jfGridValue('id'); | |||||
learun.layerForm({ | |||||
id: 'SetFieldForm', | |||||
title: '添加表格编辑字段', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/SetFieldForm?dbId=' + gridSetting.dbId + '&tableName=' + gridSetting.tableName + '&parentId=' + _Id, | |||||
width: 600, | |||||
height: 500, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
colDatas.push(data); | |||||
colDatas = colDatas.sort(function (a, b) { | |||||
return parseInt(a.sort) - parseInt(b.sort); | |||||
}); | |||||
$('#gridtable').jfGridSet('refreshdata', colDatas); | |||||
}); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var _Id = $('#gridtable').jfGridValue('id'); | |||||
if (learun.checkrow(_Id)) { | |||||
learun.layerForm({ | |||||
id: 'SetFieldForm', | |||||
title: '编辑表格编辑字段', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/SetFieldForm?dbId=' + gridSetting.dbId + '&tableName=' + gridSetting.tableName + '&keyValue=' + _Id, | |||||
width: 600, | |||||
height: 500, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
for (var i = 0, l = colDatas.length; i < l; i++) { | |||||
var item = colDatas[i]; | |||||
if (item.id == _Id) { | |||||
colDatas[i] = data; | |||||
break; | |||||
} | |||||
} | |||||
colDatas = colDatas.sort(function (a, b) { | |||||
return parseInt(a.sort) - parseInt(b.sort); | |||||
}); | |||||
$('#gridtable').jfGridSet('refreshdata', colDatas); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var _id = $('#gridtable').jfGridValue('id'); | |||||
if (learun.checkrow(_id)) { | |||||
learun.layerConfirm('是否确认删除该字段', function (res, index) { | |||||
if (res) { | |||||
for (var i = 0, l = colDatas.length; i < l; i++) { | |||||
var item = colDatas[i]; | |||||
if (item.id == _id) { | |||||
colDatas.splice(i, 1); | |||||
$('#gridtable').jfGridSet('refreshdata', colDatas); | |||||
break; | |||||
} | |||||
} | |||||
top.layer.close(index); //再执行关闭 | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
initGrid: function () { | |||||
$('#gridtable').jfGrid({ | |||||
headData: [ | |||||
{ label: "显示名称", name: "name", width: 200, align: "left" }, | |||||
{ label: "绑定字段", name: "field", width: 200, align: "left" }, | |||||
{ label: "显示宽度", name: "width", width: 80, align: "center" }, | |||||
{ label: "编辑类型", name: "type", width: 80, align: "center" } | |||||
], | |||||
mainId: 'id', | |||||
reloadSelected: true, | |||||
parentId: 'parentId', | |||||
isTree: true | |||||
}); | |||||
$('#gridtable').jfGridSet('refreshdata', colDatas); | |||||
} | |||||
}; | |||||
page.init(); | |||||
} | |||||
@@ -1,46 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表格选择项字段选择"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">字段ID</div> | |||||
<input id="name" type="text" readonly class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">字段名</div> | |||||
<input id="label" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">对应字段</div> | |||||
<div id="value"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">宽度<font face="宋体">*</font></div> | |||||
<input id="width" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">对齐方式<font face="宋体">*</font></div> | |||||
<div id="align" isvalid="yes" checkexpession="NotNull"> | |||||
<ul> | |||||
<li data-value="left">left</li> | |||||
<li data-value="center">center</li> | |||||
<li data-value="right">right</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">是否隐藏<font face="宋体">*</font></div> | |||||
<div id="hide" isvalid="yes" checkexpession="NotNull"> | |||||
<ul> | |||||
<li data-value="0">否</li> | |||||
<li data-value="1">是</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">排序号<font face="宋体">*</font></div> | |||||
<input id="sort" type="text" class="form-control" isvalid="yes" checkexpession="isNum" /> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/SetSelectFieldForm.js") |
@@ -1,46 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表格选择项字段选择"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">字段ID</div> | |||||
<input id="name" type="text" readonly class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">字段名</div> | |||||
<input id="label" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">对应字段</div> | |||||
<div id="value"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">宽度<font face="宋体">*</font></div> | |||||
<input id="width" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">对齐方式<font face="宋体">*</font></div> | |||||
<div id="align" isvalid="yes" checkexpession="NotNull"> | |||||
<ul> | |||||
<li data-value="left">left</li> | |||||
<li data-value="center">center</li> | |||||
<li data-value="right">right</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">是否隐藏<font face="宋体">*</font></div> | |||||
<div id="hide" isvalid="yes" checkexpession="NotNull"> | |||||
<ul> | |||||
<li data-value="0">否</li> | |||||
<li data-value="1">是</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">排序号<font face="宋体">*</font></div> | |||||
<input id="sort" type="text" class="form-control" isvalid="yes" checkexpession="isNum" /> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/SetSelectFieldForm.js") |
@@ -1,57 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.11 | |||||
* 描 述:表格选择项字段选择 | |||||
*/ | |||||
var dbId = request('dbId'); | |||||
var tableName = request('tableName'); | |||||
var acceptClick; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var selectFieldData = top.layer_SetFieldForm.selectFieldData; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
// 绑定字段 | |||||
$('#value').lrselect({ | |||||
value: 'f_column', | |||||
text: 'f_column', | |||||
title: 'f_remark', | |||||
allowSearch: true, | |||||
maxHeight:160 | |||||
}); | |||||
learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetFieldList', { databaseLinkId: dbId, tableName: tableName }, function (data) { | |||||
$('#value').lrselectRefresh({ | |||||
data: data | |||||
}); | |||||
}); | |||||
// 对齐方式 | |||||
$('#align').lrselect({ placeholder: false }).lrselectSet('left'); | |||||
// 是否隐藏 | |||||
$('#hide').lrselect({ placeholder: false }).lrselectSet('0'); | |||||
}, | |||||
initData: function () { | |||||
if (!!selectFieldData) | |||||
{ | |||||
$('#form').lrSetFormData(selectFieldData); | |||||
} | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(); | |||||
callBack(postData); | |||||
return true; | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,13 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单窗口页实例"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
<div class="top-btn-tool"> | |||||
<a id="savaAndAdd" class="btn btn-success">保存并新增</a> | |||||
<a id="save" class="btn btn-default">保存单据</a> | |||||
</div> | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/TabInstanceForm.css") | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/TabInstanceForm.js") | |||||
@@ -1,13 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单窗口页实例"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
<div class="top-btn-tool"> | |||||
<a id="savaAndAdd" class="btn btn-success">保存并新增</a> | |||||
<a id="save" class="btn btn-default">保存单据</a> | |||||
</div> | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/TabInstanceForm.css") | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/TabInstanceForm.js") | |||||
@@ -1,33 +0,0 @@ | |||||
body { | |||||
position: relative; | |||||
height: 100%; | |||||
width: 100%; | |||||
padding: 15px; | |||||
} | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} | |||||
.lr-form-wrap { | |||||
background-color: #fff; | |||||
border-radius: 5px; | |||||
border: 1px solid #ccc; | |||||
box-shadow: #bdbdbd 0 0 10px; | |||||
padding-top:30px; | |||||
} | |||||
.top-btn-tool { | |||||
position: absolute; | |||||
top: 0; | |||||
right: 25px; | |||||
background-color: rgba(0, 0, 0, 0.2); | |||||
border-radius: 0px 0px 6px 6px; | |||||
padding: 8px; | |||||
z-index:1; | |||||
} | |||||
.lr-form-bg { | |||||
display:none; | |||||
} |
@@ -1,33 +0,0 @@ | |||||
body { | |||||
position: relative; | |||||
height: 100%; | |||||
width: 100%; | |||||
padding: 15px; | |||||
} | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} | |||||
.lr-form-wrap { | |||||
background-color: #fff; | |||||
border-radius: 5px; | |||||
border: 1px solid #ccc; | |||||
box-shadow: #bdbdbd 0 0 10px; | |||||
padding-top:30px; | |||||
} | |||||
.top-btn-tool { | |||||
position: absolute; | |||||
top: 0; | |||||
right: 25px; | |||||
background-color: rgba(0, 0, 0, 0.2); | |||||
border-radius: 0px 0px 6px 6px; | |||||
padding: 8px; | |||||
z-index:1; | |||||
} | |||||
.lr-form-bg { | |||||
display:none; | |||||
} |
@@ -1,101 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:自定义表单 | |||||
*/ | |||||
var id = request('id'); | |||||
var keyValue = request('keyValue'); | |||||
var acceptClick; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var formModule; | |||||
var girdCompontMap; | |||||
var page = { | |||||
init: function () { | |||||
if (!!id) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetFormData?keyValue=' + id, function (data) {// | |||||
formModule = JSON.parse(data.schemeEntity.F_Scheme); | |||||
girdCompontMap = $('body').lrCustmerFormRender(formModule.data); | |||||
page.bind(); | |||||
}); | |||||
} | |||||
page.initData(); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetInstanceForm?schemeInfoId=' + id + '&keyValue=' + keyValue, function (data) {// | |||||
page.setFormData(data); | |||||
}); | |||||
} | |||||
}, | |||||
setFormData: function (data) { | |||||
if (!!formModule) { | |||||
$.each(data, function (id, item) { | |||||
if (!!girdCompontMap[id]) { | |||||
var fieldMap = {}; | |||||
$.each(girdCompontMap[id].fieldsData, function (id, girdFiled) { | |||||
if (!!girdFiled.field) { | |||||
fieldMap[girdFiled.field.toLowerCase()] = girdFiled.field; | |||||
} | |||||
}); | |||||
var rowDatas = []; | |||||
for (var i = 0, l = item.length; i < l; i++) { | |||||
var _point = {}; | |||||
for (var _field in item[i]) { | |||||
_point[fieldMap[_field]] = item[i][_field]; | |||||
} | |||||
rowDatas.push(_point); | |||||
} | |||||
$('#' + girdCompontMap[id].id).jfGridSet('refreshdata', rowDatas); | |||||
} | |||||
else { | |||||
$('body').lrSetCustmerformData(item[0],id); | |||||
} | |||||
}); | |||||
} | |||||
else { | |||||
setTimeout(function () { | |||||
page.setFormData(data); | |||||
}, 100); | |||||
} | |||||
}, | |||||
bind: function () { | |||||
// 保存数据 | |||||
$('#savaAndAdd').on('click', function () { | |||||
acceptClick(0); | |||||
}); | |||||
$('#save').on('click', function () { | |||||
acceptClick(1); | |||||
}); | |||||
} | |||||
}; | |||||
page.init(); | |||||
// 保存数据 | |||||
acceptClick = function (type) {// 0保存并新增 1保存 | |||||
if (!$.lrValidCustmerform()) { | |||||
return false; | |||||
} | |||||
var formData = $('body').lrGetCustmerformData(keyValue); | |||||
var postData = | |||||
{ | |||||
formData: JSON.stringify(formData) | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_FormModule/Custmerform/SaveInstanceForm?keyValue=' + keyValue + "&schemeInfoId=" + id, postData, function (res) { | |||||
if (res.code == 200) { | |||||
learun.frameTab.parentIframe().refreshGirdData(); | |||||
if (type == 0) { | |||||
window.location.href = top.$.rootUrl + '/LR_FormModule/Custmerform/TabInstanceForm?id=' + id; | |||||
} | |||||
else { | |||||
learun.frameTab.close(learun.frameTab.iframeId); | |||||
} | |||||
} | |||||
}); | |||||
}; | |||||
} |
@@ -1,6 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单用于工作流"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/Custmerform/WorkflowInstanceForm.css") | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/Custmerform/WorkflowInstanceForm.js") |
@@ -1,8 +0,0 @@ | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} |
@@ -1,8 +0,0 @@ | |||||
.lr-form-tab { | |||||
margin: 0 10px; | |||||
margin-top: 10px; | |||||
} | |||||
.jfgrid-data-cell { | |||||
border-bottom: 1px solid #ddd; | |||||
border-right:1px solid #ddd; | |||||
} |
@@ -1,195 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:自定义表单-用于工作流 | |||||
*/ | |||||
var id = request('id'); | |||||
var keyValue = ""; | |||||
var processIdName = ""; | |||||
var isUpdate = false; | |||||
// 保存数据 | |||||
var save; | |||||
// 设置权限 | |||||
var setAuthorize; | |||||
// 设置表单数据 | |||||
var setFormData; | |||||
// 验证数据是否填写完整 | |||||
var validForm; | |||||
// 获取表单数据 | |||||
var getFormData; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var formModule; | |||||
var girdCompontMap; | |||||
var authorizeData; | |||||
var page = { | |||||
init: function () { | |||||
if (!!id) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetFormData?keyValue=' + id, function (data) {// | |||||
formModule = JSON.parse(data.schemeEntity.F_Scheme); | |||||
}); | |||||
} | |||||
}, | |||||
setFormData: function (data) { | |||||
if (!!formModule && !!girdCompontMap) { | |||||
$.each(data, function (id, item) { | |||||
if (!!girdCompontMap[id]) { | |||||
var fieldMap = {}; | |||||
$.each(girdCompontMap[id].fieldsData, function (id, girdFiled) { | |||||
if (!!girdFiled.field) { | |||||
fieldMap[girdFiled.field.toLowerCase()] = girdFiled.field; | |||||
} | |||||
}); | |||||
var rowDatas = []; | |||||
for (var i = 0, l = item.length; i < l; i++) { | |||||
var _point = {}; | |||||
for (var _field in item[i]) { | |||||
_point[fieldMap[_field]] = item[i][_field]; | |||||
} | |||||
rowDatas.push(_point); | |||||
} | |||||
if (rowDatas.length > 0) { | |||||
isUpdate = true; | |||||
} | |||||
$('#' + girdCompontMap[id].id).jfGridSet('refreshdata', { rowdatas: rowDatas }); | |||||
} | |||||
else { | |||||
if (!!item[0]) { | |||||
isUpdate = true; | |||||
$('body').lrSetCustmerformData(item[0], id); | |||||
} | |||||
} | |||||
}); | |||||
$.each(authorizeData || [], function (_field, _item) { | |||||
var _field = _item.fieldId; | |||||
if (_item.isLook == 1 && _item.isEdit != 1) {// 如果没有查看权限就直接移除 | |||||
$('[name="' + _field + '"]').attr('disabled', 'disabled'); | |||||
} | |||||
}); | |||||
} | |||||
else { | |||||
setTimeout(function () { | |||||
page.setFormData(data); | |||||
}, 100); | |||||
} | |||||
} | |||||
}; | |||||
page.init(); | |||||
// 保存调用函数 | |||||
save = function (processId, callBack, i) { | |||||
if (isUpdate) { | |||||
keyValue = processId; | |||||
} | |||||
var formData = $('body').lrGetCustmerformData(keyValue); | |||||
if (!!processIdName) { | |||||
formData[processIdName] = processId; | |||||
} | |||||
var postData = | |||||
{ | |||||
formData: JSON.stringify(formData) | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_FormModule/Custmerform/SaveInstanceForm?keyValue=' + keyValue + "&schemeInfoId=" + id + '&processIdName=' + processIdName, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(res, formData, i); | |||||
} | |||||
}); | |||||
}; | |||||
// 设置权限 | |||||
setAuthorize = function (data) { | |||||
authorizeData = data; | |||||
if (!!formModule) { | |||||
var girdMap = {}; | |||||
var _flag = false; | |||||
for (var i = 0, l = data.length; i < l; i++) { | |||||
var field = data[i]; | |||||
var _ids = field.fieldId.split('|'); | |||||
if (_ids.length > 1) { | |||||
if (field.isLook != 1 || field.isEdit != 1) { | |||||
girdMap[_ids[0]] = girdMap[_ids[0]] || {}; | |||||
girdMap[_ids[0]][_ids[1]] = field; | |||||
_flag = true; | |||||
} | |||||
} | |||||
} | |||||
if (_flag) { | |||||
$.each(formModule.data, function (_i, _item) { | |||||
$.each(_item.componts, function (_j, _jitem) { | |||||
if ((_jitem.type == 'girdtable' || _jitem.type == 'gridtable') && !!girdMap[_jitem.id]) { | |||||
var _gird = girdMap[_jitem.id]; | |||||
var _fieldsData = []; | |||||
$.each(_jitem.fieldsData, function (_m, _mitem) { | |||||
if (!_gird[_mitem.id] || _gird[_mitem.id].isLook == 1) { | |||||
_fieldsData.push(_mitem); | |||||
if (!!_gird[_mitem.id] && _gird[_mitem.id].isEdit != 1) { | |||||
_mitem._isEdit = 1; | |||||
} | |||||
} | |||||
}); | |||||
_jitem.fieldsData = _fieldsData; | |||||
} | |||||
}); | |||||
}); | |||||
} | |||||
girdCompontMap = $('body').lrCustmerFormRender(formModule.data); | |||||
for (var i = 0, l = data.length; i < l; i++) { | |||||
var field = data[i]; | |||||
var _ids = field.fieldId.split('|'); | |||||
if (_ids.length == 1) { | |||||
if (field.isLook != 1) {// 如果没有查看权限就直接移除 | |||||
$('#' + _ids[0]).parent().remove(); | |||||
} | |||||
else { | |||||
if (field.isEdit != 1) { | |||||
$('#' + _ids[0]).attr('disabled', 'disabled'); | |||||
if ($('#' + _ids[0]).hasClass('lrUploader-wrap')) { | |||||
$('#' + _ids[0]).css({ 'padding-right': '58px' }); | |||||
$('#' + _ids[0]).find('.btn-success').remove(); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
else { | |||||
setTimeout(function () { | |||||
setAuthorize(data); | |||||
}, 100); | |||||
} | |||||
}; | |||||
// 设置表单数据 | |||||
setFormData = function (processId) { | |||||
if (!!processId) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetInstanceForm?schemeInfoId=' + id + '&keyValue=' + processId + '&processIdName=' + processIdName, function (data) {// | |||||
page.setFormData(data); | |||||
}); | |||||
} | |||||
}; | |||||
// 验证数据是否填写完整 | |||||
validForm = function () { | |||||
if (!$.lrValidCustmerform()) { | |||||
return false; | |||||
} | |||||
return true; | |||||
}; | |||||
// 获取表单数据 | |||||
getFormData = function () { | |||||
return $('body').lrGetCustmerformData(keyValue); | |||||
} | |||||
} |
@@ -1,29 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "列表字段字段添加"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">字段选择<font face="宋体">*</font></div> | |||||
<div id="fieldId" isvalid="yes" checkexpession="notNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">宽度<font face="宋体">*</font></div> | |||||
<input id="width" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">对齐方式<font face="宋体">*</font></div> | |||||
<div id="align" isvalid="yes" checkexpession="NotNull"> | |||||
<ul> | |||||
<li data-value="left">left</li> | |||||
<li data-value="center">center</li> | |||||
<li data-value="right">right</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">排序号<font face="宋体">*</font></div> | |||||
<input id="sort" type="text" class="form-control" isvalid="yes" checkexpession="isNum" /> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/FormRelation/ColFieldForm.js") |
@@ -1,64 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.11 | |||||
* 描 述:列表字段添加 | |||||
*/ | |||||
var id = request('id'); | |||||
var acceptClick; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var formscheme = top.layer_Form.formscheme; | |||||
var formFields = top.layer_Form.formFields; | |||||
var colData = top.layer_Form.colData; | |||||
var fieldName = ''; | |||||
var compontId = ''; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#fieldId').lrselect({ | |||||
text: 'title', | |||||
value: 'field', | |||||
data: formFields, | |||||
allowSearch: true, | |||||
select: function (item) { | |||||
fieldName = item.title; | |||||
compontId = item.id; | |||||
} | |||||
}); | |||||
// 所在行所占比 | |||||
$('#align').lrselect().lrselectSet('left'); | |||||
}, | |||||
initData: function () { | |||||
if (!!id) { | |||||
for (var i = 0, l = colData.length; i < l; i++) { | |||||
if (colData[i].id == id) { | |||||
$('#form').lrSetFormData(colData[i]); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(); | |||||
postData.id = id || learun.newGuid(); | |||||
postData.fieldName = fieldName; | |||||
postData.compontId = compontId; | |||||
callBack(postData); | |||||
return true; | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,148 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "发布表单功能"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Areas/LR_FormModule/Views/FormRelation/Form.css") | |||||
<div class="widget-body"> | |||||
<div id="wizard" class="wizard" data-target="#wizard-steps"> | |||||
<ul class="steps"> | |||||
<li data-target="#step-1" class="active"><span class="step">1</span>基础配置<span class="chevron"></span></li> | |||||
<li data-target="#step-2"><span class="step">2</span>条件配置<span class="chevron"></span></li> | |||||
<li data-target="#step-3"><span class="step">3</span>视图列表<span class="chevron"></span></li> | |||||
</ul> | |||||
</div> | |||||
<div class="step-content" id="wizard-steps"> | |||||
<div class="step-pane lr-form-wrap active" id="step-1"> | |||||
<input id="F_ModuleId" type="hidden" /> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">功能编号<font face="宋体">*</font></div> | |||||
<input id="F_EnCode" type="text" class="form-control" placeholder="请输入编号" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">功能名称<font face="宋体">*</font></div> | |||||
<input id="F_FullName" type="text" class="form-control" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">上级功能</div> | |||||
<div id="F_ParentId"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">功能图标</div> | |||||
<input id="F_Icon" type="text" class="form-control" placeholder="请选择图标" /> | |||||
<span id="selectIcon" class="lr-input-button" title="选取图标">...</span> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item lr-form-btnitem"> | |||||
<div class="lr-form-item-title">表单选择<font face="宋体">*</font></div> | |||||
<div id="F_FormId" isvalid="yes" checkexpession="NotNull"></div> | |||||
<a id="lr_preview" class="btn btn-default lr-form-item-btn">预览表单</a> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">表单打开方式<font face="宋体">*</font></div> | |||||
<div class="radio"> | |||||
<label> | |||||
<input name="formOpenType" type="radio" value="1" checked="checked" /> | |||||
弹层页 | |||||
</label> | |||||
<label> | |||||
<input name="formOpenType" type="radio" value="0" /> | |||||
窗口页 | |||||
</label> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">功能排序<font face="宋体">*</font></div> | |||||
<input id="F_SortCode" type="text" class="form-control" placeholder="请输入排序号" isvalid="yes" checkexpession="Num" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">表单框宽</div> | |||||
<input id="fromWidth" type="text" class="form-control" placeholder="请输入宽" value="600" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">表单框高</div> | |||||
<input id="fromHeight" type="text" class="form-control" placeholder="请输入高" value="400" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">功能描述</div> | |||||
<textarea id="F_Description" class="form-control" style="height: 140px;"></textarea> | |||||
</div> | |||||
</div> | |||||
<div class="step-pane step-gird-pane lr-form-layout" id="step-2"> | |||||
<div class="lr-form-layout-header"> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">时间查询</div> | |||||
<div class="radio"> | |||||
<label> | |||||
<input name="queryDatetime" type="radio" value="1" /> | |||||
启用 | |||||
</label> | |||||
<label> | |||||
<input name="queryDatetime" type="radio" value="0" checked="checked" /> | |||||
停用 | |||||
</label> | |||||
</div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">时间字段</div> | |||||
<div id="queryDatetime" class="lr-select-underline"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">搜索框宽</div> | |||||
<input id="queryWidth" type="text" class="form-control lr-input-underline" placeholder="请输入宽" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">搜索框高</div> | |||||
<input id="queryHeight" type="text" class="form-control lr-input-underline" placeholder="请输入高" /> | |||||
</div> | |||||
</div> | |||||
<div class="lr-form-layout-body"> | |||||
<div class="lr-form-layout-body-title"> | |||||
<div class="lr-form-jfgrid-btns"> | |||||
<a id="lr_add_query" class="btn btn-success"><i class="fa fa-plus"></i> 添加</a> | |||||
<a id="lr_edit_query" class="btn btn-info"><i class="fa fa-pencil-square-o"></i> 修改</a> | |||||
<a id="lr_delete_query" class="btn btn-danger"><i class="fa fa-trash-o"></i> 移除</a> | |||||
</div> | |||||
<span>条件项设计</span> | |||||
</div> | |||||
<div id="query_girdtable"></div> | |||||
</div> | |||||
</div> | |||||
<div class="step-pane step-gird-pane lr-form-layout" style="padding-top:41px;" id="step-3"> | |||||
<div class="lr-form-layout-header" style="padding:0px;height:41px;padding-left:10px;"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">是否分页</div> | |||||
<div class="radio"> | |||||
<label> | |||||
<input name="ispage" type="radio" value="1" /> | |||||
是 | |||||
</label> | |||||
<label> | |||||
<input name="ispage" type="radio" value="0" checked="checked" /> | |||||
否 | |||||
</label> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-form-layout-body"> | |||||
<div class="lr-form-layout-body-title"> | |||||
<div class="lr-form-jfgrid-btns"> | |||||
<a id="lr_add_col" class="btn btn-success"><i class="fa fa-plus"></i> 添加</a> | |||||
<a id="lr_edit_col" class="btn btn-info"><i class="fa fa-pencil-square-o"></i> 修改</a> | |||||
<a id="lr_delete_col" class="btn btn-danger"><i class="fa fa-trash-o"></i> 移除</a> | |||||
</div> | |||||
<span>页面列表设计</span> | |||||
</div> | |||||
<div id="col_girdtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-form-bottom-button" id="wizard-actions"> | |||||
<a id="btn_prev" class="btn btn-default btn-prev" disabled>上一步</a> | |||||
<a id="btn_next" class="btn btn-default btn-next">下一步</a> | |||||
<a id="btn_finish" class="btn btn-success">完成</a> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/FormRelation/Form.js") |
@@ -1,39 +0,0 @@ | |||||
.step-gird-pane { | |||||
padding-top:41px; | |||||
} | |||||
.lr-form-layout { | |||||
padding-top:81px; | |||||
} | |||||
.lr-form-layout-header { | |||||
position: absolute; | |||||
top:0; | |||||
left:0; | |||||
width: 100%; | |||||
height: 81px; | |||||
padding: 0px 10px 0px 10px; | |||||
border-bottom:1px solid #ccc; | |||||
z-index:10; | |||||
} | |||||
.lr-form-layout-header .lr-form-item-title { | |||||
width:58px; | |||||
padding-right:0px; | |||||
text-align:left; | |||||
} | |||||
.lr-form-layout-header .lr-form-item { | |||||
padding-left:58px; | |||||
} | |||||
.lr-form-layout-body | |||||
{ | |||||
padding-top:30px; | |||||
border:1px solid #ccc; | |||||
border-top:0px; | |||||
} | |||||
.btn-tool-bar { | |||||
position:absolute; | |||||
top:0; | |||||
width:100%; | |||||
text-align:right; | |||||
padding:5px; | |||||
border-bottom:1px solid #ddd; | |||||
} |
@@ -1,39 +0,0 @@ | |||||
.step-gird-pane { | |||||
padding-top:41px; | |||||
} | |||||
.lr-form-layout { | |||||
padding-top:81px; | |||||
} | |||||
.lr-form-layout-header { | |||||
position: absolute; | |||||
top:0; | |||||
left:0; | |||||
width: 100%; | |||||
height: 81px; | |||||
padding: 0px 10px 0px 10px; | |||||
border-bottom:1px solid #ccc; | |||||
z-index:10; | |||||
} | |||||
.lr-form-layout-header .lr-form-item-title { | |||||
width:58px; | |||||
padding-right:0px; | |||||
text-align:left; | |||||
} | |||||
.lr-form-layout-header .lr-form-item { | |||||
padding-left:58px; | |||||
} | |||||
.lr-form-layout-body | |||||
{ | |||||
padding-top:30px; | |||||
border:1px solid #ccc; | |||||
border-top:0px; | |||||
} | |||||
.btn-tool-bar { | |||||
position:absolute; | |||||
top:0; | |||||
width:100%; | |||||
text-align:right; | |||||
padding:5px; | |||||
border-bottom:1px solid #ddd; | |||||
} |
@@ -1,467 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2018.06.29 | |||||
* 描 述:功能模块 | |||||
*/ | |||||
var keyValue = request('keyValue'); | |||||
var tableFields = {}; // 用来缓存数据表字段 | |||||
var formscheme; | |||||
var setFormId = ""; | |||||
var formFields = []; | |||||
var queryData = []; | |||||
var colData = []; | |||||
var moduleForm = []; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initGrid(); | |||||
page.initData(); | |||||
}, | |||||
/*绑定事件和初始化控件*/ | |||||
bind: function () { | |||||
// 加载导向 | |||||
$('#wizard').wizard().on('change', function (e, data) { | |||||
var $finish = $("#btn_finish"); | |||||
var $next = $("#btn_next"); | |||||
if (data.direction == "next") { | |||||
if (data.step == 1) { | |||||
if (!$('#step-1').lrValidform()) { | |||||
return false; | |||||
} | |||||
// 加载表单数据 | |||||
var formId = $('#F_FormId').lrselectGet(); | |||||
if (setFormId != formId) { | |||||
queryData = []; | |||||
colData = []; | |||||
setFormId = formId; | |||||
$('#query_girdtable').jfGridSet('refreshdata', queryData); | |||||
$('#col_girdtable').jfGridSet('refreshdata', colData); | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetFormData?keyValue=' + formId, function (data) {// | |||||
formscheme = JSON.parse(data.schemeEntity.F_Scheme); | |||||
// 获取表单字段 | |||||
for (var i = 0, l = formscheme.data.length; i < l; i++) { | |||||
var componts = formscheme.data[i].componts; | |||||
for (var j = 0, jl = componts.length; j < jl; j++) { | |||||
var item = componts[j]; | |||||
if ((item.type != "gridtable" && item.type != "girdtable") && item.type != "label" && item.type != "html" && item.type != "guid" && item.type != "upload") { | |||||
formFields.push(item); | |||||
} | |||||
if (item.type != "gridtable" && item.type != "girdtable" && item.type != "guid") { | |||||
var point = { 'F_ModuleFormId': learun.newGuid(), 'F_EnCode': item.id, 'F_FullName': item.title }; | |||||
moduleForm.push(point); | |||||
} | |||||
} | |||||
} | |||||
// 获取主表字段 | |||||
// 确定主表信息 | |||||
var mainTable = ""; | |||||
for (var i = 0, l = formscheme.dbTable.length; i < l; i++) { | |||||
if (formscheme.dbTable[i].relationName == "") { | |||||
mainTable = formscheme.dbTable[i].name; | |||||
break; | |||||
} | |||||
} | |||||
if (!!tableFields[formscheme.dbId + mainTable]) { | |||||
$('#queryDatetime').lrselectRefresh({ | |||||
data: tableFields[formscheme.dbId + mainTable] | |||||
}); | |||||
} | |||||
else { | |||||
learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetFieldList', { databaseLinkId: formscheme.dbId, tableName: mainTable }, function (data) { | |||||
tableFields[formscheme.dbId + mainTable] = data; | |||||
$('#queryDatetime').lrselectRefresh({ | |||||
data: data | |||||
}); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
} else if (data.step == 2) { | |||||
$finish.removeAttr('disabled'); | |||||
$next.attr('disabled', 'disabled'); | |||||
} else { | |||||
$finish.attr('disabled', 'disabled'); | |||||
} | |||||
} else { | |||||
$finish.attr('disabled', 'disabled'); | |||||
$next.removeAttr('disabled'); | |||||
} | |||||
}); | |||||
// 上级 | |||||
$('#F_ParentId').lrselect({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/Module/GetExpendModuleTree', | |||||
type: 'tree', | |||||
maxHeight: 180, | |||||
allowSearch: true | |||||
}); | |||||
// 选择图标 | |||||
$('#selectIcon').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'iconForm', | |||||
title: '选择图标', | |||||
url: top.$.rootUrl + '/Utility/Icon', | |||||
height: 700, | |||||
width: 1000, | |||||
btn: null, | |||||
maxmin: true, | |||||
end: function () { | |||||
if (top._learunSelectIcon != '') { | |||||
$('#F_Icon').val(top._learunSelectIcon); | |||||
} | |||||
} | |||||
}); | |||||
}); | |||||
// 选在表单 | |||||
$('#F_FormId').lrselect({ | |||||
text: 'F_Name', | |||||
value: 'F_Id', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/GetSchemeInfoList', | |||||
allowSearch: true | |||||
}); | |||||
$('#lr_preview').on('click', function () { | |||||
var formId = $('#F_FormId').lrselectGet(); | |||||
if (!!formId) { | |||||
learun.layerForm({ | |||||
id: 'custmerForm_PreviewForm', | |||||
title: '预览当前表单', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/PreviewForm?schemeInfoId=' + formId, | |||||
width: 800, | |||||
height: 600, | |||||
maxmin: true, | |||||
btn: null | |||||
}); | |||||
} | |||||
else { | |||||
learun.alert.warning('请选择表单!'); | |||||
} | |||||
}); | |||||
// 条件设置 | |||||
$('#queryDatetime').lrselect({ | |||||
value: 'f_column', | |||||
text: 'f_column', | |||||
title: 'f_remark', | |||||
allowSearch: true | |||||
}); | |||||
// 新增 | |||||
$('#lr_add_query').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'QueryFieldForm', | |||||
title: '添加条件字段', | |||||
url: top.$.rootUrl + '/LR_FormModule/FormRelation/QueryFieldForm', | |||||
height: 300, | |||||
width: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
queryData.push(data); | |||||
queryData = queryData.sort(function (a, b) { | |||||
return parseInt(a.sort) - parseInt(b.sort); | |||||
}); | |||||
$('#query_girdtable').jfGridSet('refreshdata', queryData); | |||||
}); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit_query').on('click', function () { | |||||
var id = $('#query_girdtable').jfGridValue('id'); | |||||
if (learun.checkrow(id)) { | |||||
learun.layerForm({ | |||||
id: 'QueryFieldForm', | |||||
title: '添加条件字段', | |||||
url: top.$.rootUrl + '/LR_FormModule/FormRelation/QueryFieldForm?id=' + id, | |||||
height: 300, | |||||
width: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
for (var i = 0, l = queryData.length; i < l; i++) { | |||||
if (queryData[i].id == data.id) { | |||||
queryData[i] = data; | |||||
break; | |||||
} | |||||
} | |||||
queryData = queryData.sort(function (a, b) { | |||||
return parseInt(a.sort) - parseInt(b.sort); | |||||
}); | |||||
$('#query_girdtable').jfGridSet('refreshdata', queryData); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete_query').on('click', function () { | |||||
var id = $('#query_girdtable').jfGridValue('id'); | |||||
if (learun.checkrow(id)) { | |||||
learun.layerConfirm('是否确认删除该字段', function (res, index) { | |||||
if (res) { | |||||
for (var i = 0, l = queryData.length; i < l; i++) { | |||||
if (queryData[i].id == id) { | |||||
queryData.splice(id, 1); | |||||
break; | |||||
} | |||||
} | |||||
$('#query_girdtable').jfGridSet('refreshdata', queryData); | |||||
top.layer.close(index); //再执行关闭 | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 列表设置 | |||||
// 新增 | |||||
$('#lr_add_col').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'ColFieldForm', | |||||
title: '添加列表字段', | |||||
url: top.$.rootUrl + '/LR_FormModule/FormRelation/ColFieldForm', | |||||
height: 300, | |||||
width: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
colData.push(data); | |||||
colData = colData.sort(function (a, b) { | |||||
return parseInt(a.sort) - parseInt(b.sort); | |||||
}); | |||||
$('#col_girdtable').jfGridSet('refreshdata', colData); | |||||
}); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit_col').on('click', function () { | |||||
var id = $('#col_girdtable').jfGridValue('id'); | |||||
if (learun.checkrow(id)) { | |||||
learun.layerForm({ | |||||
id: 'ColFieldForm', | |||||
title: '添加条件字段', | |||||
url: top.$.rootUrl + '/LR_FormModule/FormRelation/ColFieldForm?id=' + id, | |||||
height: 300, | |||||
width: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
for (var i = 0, l = colData.length; i < l; i++) { | |||||
if (colData[i].id == data.id) { | |||||
colData[i] = data; | |||||
break; | |||||
} | |||||
} | |||||
colData = colData.sort(function (a, b) { | |||||
return parseInt(a.sort) - parseInt(b.sort); | |||||
}); | |||||
$('#col_girdtable').jfGridSet('refreshdata', colData); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete_col').on('click', function () { | |||||
var id = $('#col_girdtable').jfGridValue('id'); | |||||
if (learun.checkrow(id)) { | |||||
learun.layerConfirm('是否确认删除该字段', function (res, index) { | |||||
if (res) { | |||||
for (var i = 0, l = colData.length; i < l; i++) { | |||||
if (colData[i].id == id) { | |||||
colData.splice(i, 1); | |||||
break; | |||||
} | |||||
} | |||||
$('#col_girdtable').jfGridSet('refreshdata', colData); | |||||
top.layer.close(index); //再执行关闭 | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 保存数据按钮 | |||||
$("#btn_finish").on('click', page.save); | |||||
}, | |||||
/*初始化表格*/ | |||||
initGrid: function () { | |||||
$('#query_girdtable').jfGrid({ | |||||
headData: [ | |||||
{ label: "字段项名称", name: "fieldName", width: 260, align: "left" }, | |||||
{ | |||||
label: "所占行比例", name: "portion", width: 150, align: "left", | |||||
formatter: function (cellvalue, row) { | |||||
return '1/' + cellvalue; | |||||
} | |||||
}, | |||||
], | |||||
mainId: 'id', | |||||
}); | |||||
$('#col_girdtable').jfGrid({ | |||||
headData: [ | |||||
{ label: "字段名称", name: "fieldName", width: 260, align: "left" }, | |||||
{ label: "宽度", name: "width", width: 150, align: "left" }, | |||||
{ label: "对齐方式", name: "align", width: 150, align: "left" } | |||||
] | |||||
}); | |||||
}, | |||||
/*初始化数据*/ | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/FormRelation/GetFormData?keyValue=' + keyValue, function (data) {// | |||||
setFormId = data.relation.F_FormId; | |||||
$.lrSetForm(top.$.rootUrl + '/LR_FormModule/Custmerform/GetFormData?keyValue=' + setFormId, function (data) {// | |||||
formscheme = JSON.parse(data.schemeEntity.F_Scheme); | |||||
// 获取表单字段 | |||||
for (var i = 0, l = formscheme.data.length; i < l; i++) { | |||||
var componts = formscheme.data[i].componts; | |||||
for (var j = 0, jl = componts.length; j < jl; j++) { | |||||
var item = componts[j]; | |||||
if (item.type != "gridtable" && item.type != "label" && item.type != "html" && item.type != "guid" && item.type != "upload") { | |||||
formFields.push(item); | |||||
} | |||||
if (item.type != "gridtable" && item.type != "guid") { | |||||
var point = { 'F_ModuleFormId': learun.newGuid(), 'F_EnCode': item.id, 'F_FullName': item.title }; | |||||
moduleForm.push(point); | |||||
} | |||||
} | |||||
} | |||||
// 获取主表字段 | |||||
// 确定主表信息 | |||||
var mainTable = ""; | |||||
for (var i = 0, l = formscheme.dbTable.length; i < l; i++) { | |||||
if (formscheme.dbTable[i].relationName == "") { | |||||
mainTable = formscheme.dbTable[i].name; | |||||
break; | |||||
} | |||||
} | |||||
if (!!tableFields[formscheme.dbId + mainTable]) { | |||||
$('#queryDatetime').lrselectRefresh({ | |||||
data: tableFields[formscheme.dbId + mainTable] | |||||
}); | |||||
} | |||||
else { | |||||
learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetFieldList', { databaseLinkId: formscheme.dbId, tableName: mainTable }, function (data) { | |||||
tableFields[formscheme.dbId + mainTable] = data; | |||||
$('#queryDatetime').lrselectRefresh({ | |||||
data: data | |||||
}); | |||||
}); | |||||
} | |||||
}); | |||||
$('#step-1').lrSetFormData(data.module); | |||||
$('#F_FormId').lrselectSet(data.relation.F_FormId); | |||||
var settingJson = JSON.parse(data.relation.F_SettingJson); | |||||
$('[name="formOpenType"][value="' + settingJson.layer.opentype + '"]').attr('checked', 'checked'); | |||||
$('#fromWidth').val(settingJson.layer.width); | |||||
$('#fromHeight').val(settingJson.layer.height); | |||||
$('[name="queryDatetime"][value="' + settingJson.query.isDate + '"]').attr('checked', 'checked'); | |||||
$('#queryDatetime').lrselectSet(settingJson.query.DateField); | |||||
$('#queryWidth').val(settingJson.query.width); | |||||
$('#queryHeight').val(settingJson.query.height); | |||||
queryData = settingJson.query.fields; | |||||
console.log(queryData); | |||||
$('#query_girdtable').jfGridSet('refreshdata', queryData); | |||||
$('[name="ispage"][value="' + settingJson.col.isPage + '"]').attr('checked', 'checked'); | |||||
colData = settingJson.col.fields; | |||||
$('#col_girdtable').jfGridSet('refreshdata', colData); | |||||
}); | |||||
} | |||||
}, | |||||
/*保存数据*/ | |||||
save: function () { | |||||
if (!$('#step-1').lrValidform()) { | |||||
return false; | |||||
} | |||||
var formdata = $('#step-1').lrGetFormData(keyValue); | |||||
formdata.F_ParentId = formdata.F_ParentId || '0'; | |||||
// 设置信息 | |||||
var settingJson = { | |||||
layer: { | |||||
width: formdata.fromWidth, | |||||
height: formdata.fromHeight, | |||||
opentype: $('[name="formOpenType"]:checked').val() // 1 弹层 2窗口页 | |||||
}, | |||||
query: { | |||||
width: $('#queryWidth').val(), | |||||
height: $('#queryHeight').val(), | |||||
isDate: $('[name="queryDatetime"]:checked').val(), | |||||
DateField: $('#queryDatetime').lrselectGet(), | |||||
fields: queryData | |||||
}, | |||||
col: { | |||||
isPage: $('[name="ispage"]:checked').val(), | |||||
fields: colData | |||||
} | |||||
} | |||||
// 表单功能设置 | |||||
var relation = { | |||||
F_ModuleId: formdata.F_ModuleId, | |||||
F_FormId: formdata.F_FormId, | |||||
F_SettingJson: JSON.stringify(settingJson) | |||||
} | |||||
var tableIndex = 0; | |||||
var tableMap = {}; | |||||
var compontsMap = {}; | |||||
for (var i = 0, l = formscheme.data.length; i < l; i++) { | |||||
var componts = formscheme.data[i].componts; | |||||
for (var j = 0, jl = componts.length; j < jl; j++) { | |||||
var item = componts[j]; | |||||
compontsMap[item.id] = item; | |||||
if (!!item.table && tableMap[item.table] == undefined) { | |||||
tableMap[item.table] = tableIndex; | |||||
tableIndex++; | |||||
} | |||||
} | |||||
} | |||||
// 列表设置 | |||||
var moduleColumn = []; | |||||
for (var i = 0, l = colData.length; i < l; i++) { | |||||
var code = colData[i].fieldId + tableMap[compontsMap[colData[i].compontId].table]; | |||||
var point = { F_ModuleColumnId: learun.newGuid(), F_FullName: colData[i].fieldName, F_EnCode: code.toLowerCase() }; | |||||
moduleColumn.push(point); | |||||
} | |||||
// 提交数据 | |||||
var postData = { | |||||
relationJson:JSON.stringify(relation), | |||||
moduleJson: JSON.stringify(formdata), | |||||
moduleColumnJson: JSON.stringify(moduleColumn), | |||||
moduleFormJson: JSON.stringify(moduleForm) | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_FormModule/FormRelation/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
learun.frameTab.currentIframe().refreshGirdData(); | |||||
}); | |||||
} | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,32 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "发布表单功能"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout" id="lr_layout"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入模板名称" /> | |||||
</div> | |||||
<div class="lr-layout-tool-item"> | |||||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> <span class="lrlg">查询</span></a> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> <span class="lrlg">新增</span></a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlg">编辑</span></a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlg" >删除</span></a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/FormRelation/Index.js") |
@@ -1,106 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:发布表单功能 | |||||
*/ | |||||
var refreshGirdData; // 更新数据 | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.initGrid(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 查询 | |||||
$('#btn_Search').on('click', function () { | |||||
var keyword = $('#txt_Keyword').val(); | |||||
page.search({ keyword: keyword }); | |||||
}); | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'Form', | |||||
title: '发布表单功能', | |||||
url: top.$.rootUrl + '/LR_FormModule/FormRelation/Form', | |||||
width: 700, | |||||
height: 500, | |||||
btn: null | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'Form', | |||||
title: '编辑表单功能', | |||||
url: top.$.rootUrl + '/LR_FormModule/FormRelation/Form?keyValue=' + keyValue, | |||||
width: 700, | |||||
height: 500, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_FormModule/FormRelation/DeleteForm', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
initGrid: function () { | |||||
$('#gridtable').lrAuthorizeJfGrid({ | |||||
url: top.$.rootUrl + '/LR_FormModule/FormRelation/GetPageList', | |||||
headData: [ | |||||
{ label: "表单名称", name: "F_FormId", width: 250, align: "left" }, | |||||
{ label: "功能名称", name: "F_ModuleId", width: 250, align: "left" }, | |||||
{ | |||||
label: "编辑人", name: "F_CreateUserName", width: 150, align: "center", | |||||
formatter: function (cellvalue, row) { | |||||
return !!row.F_ModifyUserName ? row.F_ModifyUserName : cellvalue; | |||||
} | |||||
}, | |||||
{ | |||||
label: "编辑时间", name: "F_CreateDate", width: 150, align: "left", | |||||
formatter: function (cellvalue, row) { | |||||
var datetime = !!row.F_ModifyUserName ? row.F_ModifyDate : cellvalue; | |||||
return learun.formatDate(datetime, 'yyyy-MM-dd hh:mm'); | |||||
} | |||||
} | |||||
], | |||||
mainId: 'F_Id', | |||||
reloadSelected: true, | |||||
isPage: true | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
$('#gridtable').jfGridSet('reload', param); | |||||
} | |||||
}; | |||||
// 保存数据后回调刷新 | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
} | |||||
page.init(); | |||||
} |
@@ -1,34 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单功能"; | |||||
Layout = "~/Views/Shared/_CustmerIndexPreview.cshtml"; | |||||
} | |||||
<div class="lr-layout"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<div id="datesearch"></div> | |||||
</div> | |||||
<div class="lr-layout-tool-item" id="multiple_condition_query_item"> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/FormRelation/PreviewIndex.js") | |||||
@@ -1,34 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "自定义表单功能"; | |||||
Layout = "~/Views/Shared/_CustmerIndexPreview.cshtml"; | |||||
} | |||||
<div class="lr-layout"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<div id="datesearch"></div> | |||||
</div> | |||||
<div class="lr-layout-tool-item" id="multiple_condition_query_item"> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/FormRelation/PreviewIndex.js") | |||||
@@ -1,321 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.17 | |||||
* 描 述:自定义表单发布功能 | |||||
*/ | |||||
var id = request('id'); | |||||
var refreshGirdData; // 更新数据 | |||||
var formScheme; | |||||
var settingJson; | |||||
var relation; | |||||
var mainTablePk = ""; | |||||
var mainTable = ""; | |||||
var mainCompontId = ""; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var queryJson = {}; | |||||
var page = { | |||||
init: function () { | |||||
// 获取自定义表单设置内容 | |||||
learun.httpAsync('GET', top.$.rootUrl + '/LR_FormModule/FormRelation/GetCustmerFormData', { keyValue: id }, function (data) { | |||||
relation = data.relation; | |||||
settingJson = JSON.parse(data.relation.F_SettingJson); | |||||
formScheme = JSON.parse(data.scheme.F_Scheme); | |||||
for (var i = 0, l = formScheme.dbTable.length; i < l; i++) { | |||||
var tabledata = formScheme.dbTable[i]; | |||||
if (tabledata.relationName == "") { | |||||
mainTable = tabledata.name; | |||||
mainTablePk = tabledata.field; | |||||
} | |||||
} | |||||
// 条件项设置 | |||||
if (settingJson.query.isDate == '1' && !!settingJson.query.DateField) {// 时间搜索框 | |||||
$('#datesearch').lrdate({ | |||||
dfdata: [ | |||||
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||||
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||||
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||||
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||||
], | |||||
// 月 | |||||
mShow: false, | |||||
premShow: false, | |||||
// 季度 | |||||
jShow: false, | |||||
prejShow: false, | |||||
// 年 | |||||
ysShow: false, | |||||
yxShow: false, | |||||
preyShow: false, | |||||
yShow: false, | |||||
// 默认 | |||||
dfvalue: '1', | |||||
selectfn: function (begin, end) { | |||||
queryJson.lrbegin = begin; | |||||
queryJson.lrend = end; | |||||
queryJson.lrdateField = settingJson.query.DateField; | |||||
page.search(); | |||||
} | |||||
}); | |||||
} | |||||
// 复合条件查询 | |||||
if (!!settingJson.query.fields && settingJson.query.fields.length > 0) { | |||||
var height = 220; | |||||
if (!!settingJson.query.height) { | |||||
height = settingJson.query.height; | |||||
if (height <= 50) { | |||||
height = 220; | |||||
} | |||||
} | |||||
$('#multiple_condition_query_item').html('<div id="multiple_condition_query"><div class="lr-query-formcontent"></div></div>'); | |||||
$('#multiple_condition_query').lrMultipleQuery(function (_queryJson) { | |||||
queryJson = _queryJson; | |||||
page.search(); | |||||
}, height); | |||||
var $content = $('#multiple_condition_query .lr-query-content'); | |||||
var queryFieldMap = {}; | |||||
$.each(settingJson.query.fields, function (id, item) { | |||||
queryFieldMap[item.fieldId] = item; | |||||
}); | |||||
for (var i = 0, l = formScheme.data.length; i < l; i++) { | |||||
var componts = formScheme.data[i].componts; | |||||
for (var j = 0, jl = componts.length; j < jl; j++) { | |||||
var item = componts[j]; | |||||
var queryItem = queryFieldMap[item.id]; | |||||
if (!!queryItem) { | |||||
queryItem.compont = item; | |||||
} | |||||
} | |||||
} | |||||
$.each(queryFieldMap, function (id, item) { | |||||
if (!!item.compont) { | |||||
var $row = $('<div class="col-xs-' + (12 / parseInt(item.portion)) + ' lr-form-item" ></div>'); | |||||
var $title = $(' <div class="lr-form-item-title">' + item.fieldName + '</div>'); | |||||
$row.append($title); | |||||
$content.append($row); | |||||
$.lrFormComponents[item.compont.type].renderQuery(item.compont, $row)[0].compont = item.compont; | |||||
} | |||||
}); | |||||
} | |||||
// 列表设置 | |||||
page.initGrid(); | |||||
// 按钮绑定事件 | |||||
page.bind(); | |||||
}); | |||||
}, | |||||
bind: function () { | |||||
// 查询 | |||||
$('#btn_Search').on('click', function () { | |||||
var keyword = $('#txt_Keyword').val(); | |||||
page.search({ keyword: keyword }); | |||||
}); | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
if (settingJson.layer.opentype == '1') {// 窗口弹层页 | |||||
learun.layerForm({ | |||||
id: 'Form', | |||||
title: '新增', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/LayerInstanceForm?id=' + relation.F_FormId, | |||||
width: settingJson.layer.width, | |||||
height: settingJson.layer.height, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
else {// 窗口页 | |||||
learun.frameTab.open({ F_ModuleId: id, F_Icon: 'fa fa-pencil-square-o', F_FullName: '新增', F_UrlAddress: '/LR_FormModule/Custmerform/TabInstanceForm?id=' + relation.F_FormId }); | |||||
} | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue(mainCompontId.toLowerCase()); | |||||
if (learun.checkrow(keyValue)) { | |||||
if (settingJson.layer.opentype == '1') {// 窗口弹层页 | |||||
learun.layerForm({ | |||||
id: 'Form', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/LR_FormModule/Custmerform/LayerInstanceForm?id=' + relation.F_FormId + "&keyValue=" + keyValue, | |||||
width: settingJson.layer.width, | |||||
height: settingJson.layer.height, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
else {// 窗口页 | |||||
learun.frameTab.open({ F_ModuleId: id, F_Icon: 'fa fa-pencil-square-o', F_FullName: '编辑', F_UrlAddress: '/LR_FormModule/Custmerform/TabInstanceForm?id=' + relation.F_FormId + "&keyValue=" + keyValue }); | |||||
} | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue(mainCompontId.toLowerCase()); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_FormModule/Custmerform/DeleteInstanceForm', { keyValue: keyValue, schemeInfoId: relation.F_FormId }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
initGrid: function () { | |||||
var colFieldMap = {}; | |||||
for (var i = 0, l = settingJson.col.fields.length; i < l; i++) { | |||||
colFieldMap[settingJson.col.fields[i].compontId] = settingJson.col.fields[i]; | |||||
} | |||||
var headData = []; | |||||
var tableIndex = 0; | |||||
var tableMap = {}; | |||||
for (var i = 0, l = formScheme.data.length; i < l; i++) { | |||||
var componts = formScheme.data[i].componts; | |||||
for (var j = 0, jl = componts.length; j < jl; j++) { | |||||
var item = componts[j]; | |||||
if (!!item.table && tableMap[item.table] == undefined) { | |||||
tableMap[item.table] = tableIndex; | |||||
tableIndex++; | |||||
} | |||||
if (mainTable == item.table && mainTablePk == item.field) { | |||||
mainCompontId = item.field + tableMap[item.table]; | |||||
} | |||||
var colItem = colFieldMap[item.id]; | |||||
if (!!colItem) { | |||||
colItem.compont = item; | |||||
} | |||||
} | |||||
} | |||||
$.each(colFieldMap, function (id, item) { | |||||
if (!!item.compont) { | |||||
var point = { label: item.fieldName, name: (item.compont.field + tableMap[item.compont.table]).toLowerCase(), width: parseInt(item.width), align: item.align }; | |||||
switch (item.compont.type) { | |||||
case 'radio': | |||||
case 'checkbox': | |||||
case 'select': | |||||
if (item.compont.dataSource == "0") { | |||||
point.formatterAsync = function (callback, value, row) { | |||||
learun.clientdata.getAsync('dataItem', { | |||||
key: value, | |||||
code: item.compont.itemCode, | |||||
callback: function (_data) { | |||||
callback(_data.text); | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
else { | |||||
var vlist = item.compont.dataSourceId.split(','); | |||||
point.formatterAsync = function (callback, value, row) { | |||||
learun.clientdata.getAsync('sourceData', { | |||||
key: value, | |||||
keyId: vlist[2], | |||||
code: vlist[0], | |||||
callback: function (_data) { | |||||
callback(_data[vlist[1]]); | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
break; | |||||
case 'organize': | |||||
case 'currentInfo': | |||||
if (item.compont.dataType == 'user') { | |||||
point.formatterAsync = function (callback, value, row) { | |||||
learun.clientdata.getAsync('user', { | |||||
key: value, | |||||
callback: function (item) { | |||||
callback(item.name); | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
else if (item.compont.dataType == 'company') { | |||||
point.formatterAsync = function (callback, value, row) { | |||||
learun.clientdata.getAsync('company', { | |||||
key: value, | |||||
callback: function (_data) { | |||||
callback(_data.name); | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
else if (item.compont.dataType == 'department') { | |||||
point.formatterAsync = function (callback, value, row) { | |||||
learun.clientdata.getAsync('department', { | |||||
key: value, | |||||
callback: function (item) { | |||||
callback(item.name); | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
break; | |||||
} | |||||
headData.push(point); | |||||
} | |||||
}); | |||||
var girdurl = ""; | |||||
if (settingJson.col.isPage == "1") { | |||||
girdurl = top.$.rootUrl + '/LR_FormModule/FormRelation/GetPreviewPageList?keyValue=' + id; | |||||
} | |||||
else { | |||||
girdurl = top.$.rootUrl + '/LR_FormModule/FormRelation/GetPreviewList?keyValue=' + id; | |||||
} | |||||
$('#gridtable').lrAuthorizeJfGrid({ | |||||
url: girdurl, | |||||
headData: headData, | |||||
reloadSelected: true, | |||||
isPage: (settingJson.col.isPage == "1" ? true : false), | |||||
mainId: mainCompontId.toLowerCase() | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
param.queryJson = JSON.stringify(queryJson); | |||||
$('#gridtable').jfGridSet('reload', param); | |||||
} | |||||
}; | |||||
// 保存数据后回调刷新 | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
} | |||||
page.init(); | |||||
} | |||||
@@ -1,19 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "查询条件字段添加"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">字段选择<font face="宋体">*</font></div> | |||||
<div id="fieldId" isvalid="yes" checkexpession="notNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">所在行占比<font face="宋体">*</font></div> | |||||
<div id="portion" isvalid="yes" checkexpession="notNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">排序号<font face="宋体">*</font></div> | |||||
<input id="sort" type="text" class="form-control" isvalid="yes" checkexpession="isNum" /> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_FormModule/Views/FormRelation/QueryFieldForm.js") |
@@ -1,89 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
* 创建人:力软-前端开发组 | |||||
* 日 期:2017.04.11 | |||||
* 描 述:查询条件字段添加 | |||||
*/ | |||||
var id = request('id'); | |||||
var acceptClick; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var formscheme = top.layer_Form.formscheme; | |||||
var formFields = top.layer_Form.formFields; | |||||
var queryData = top.layer_Form.queryData; | |||||
var fieldName = ''; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
var formFields2 = []; | |||||
$.each(formFields, function (id, item) { | |||||
if (item.type != 'label' && item.type != 'datetime' && item.type != 'upload' && item.type != 'currentInfo') { | |||||
formFields2.push(item); | |||||
} | |||||
}); | |||||
$('#fieldId').lrselect({ | |||||
text: 'title', | |||||
data: formFields2, | |||||
allowSearch: true, | |||||
maxHeight: 140, | |||||
select: function (item) { | |||||
fieldName = item.title; | |||||
} | |||||
}); | |||||
// 所在行所占比 | |||||
$('#portion').lrselect({ | |||||
data: [ | |||||
{ | |||||
id: '1', text: '1' | |||||
}, | |||||
{ | |||||
id: '2', text: '1/2' | |||||
}, | |||||
{ | |||||
id: '3', text: '1/3' | |||||
}, | |||||
{ | |||||
id: '4', text: '1/4' | |||||
}, | |||||
{ | |||||
id: '6', text: '1/6' | |||||
} | |||||
], | |||||
placeholder: false, | |||||
value: 'id', | |||||
text: 'text' | |||||
}).lrselectSet('1'); | |||||
}, | |||||
initData: function () { | |||||
if (!!id) { | |||||
for (var i = 0, l = queryData.length; i < l; i++) { | |||||
if (queryData[i].id == id) { | |||||
$('#form').lrSetFormData(queryData[i]); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(); | |||||
postData.id = id || learun.newGuid(); | |||||
postData.fieldName = fieldName; | |||||
callBack(postData); | |||||
return true; | |||||
}; | |||||
page.init(); | |||||
} |
@@ -17,20 +17,20 @@ | |||||
} | } | ||||
</style> | </style> | ||||
@Html.AppendCssFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/MonitorForm.css") | @Html.AppendCssFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/MonitorForm.css") | ||||
<div class="lr-layout-panel-btn"> | |||||
<a id="print" class="btn btn-primary">打印表单</a> | |||||
</div> | |||||
<div class="lr-layout-panel"> | <div class="lr-layout-panel"> | ||||
<div class="lr-layout-panel-btn"> | |||||
<a id="print" class="btn btn-primary">打印表单</a> | |||||
</div> | |||||
<div class="tab-pane" id="forminfo" style="padding-bottom:40px;"> | |||||
<div class="tab-pane" id="forminfo"> | |||||
<div class="form-list" id="form_list_iframes"> | <div class="form-list" id="form_list_iframes"> | ||||
<div id="wf_timeline"> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="form-list-tabs" id="form_list_tabs_warp"> | <div class="form-list-tabs" id="form_list_tabs_warp"> | ||||
<ul class="nav nav-tabs" id="form_list_tabs"></ul> | <ul class="nav nav-tabs" id="form_list_tabs"></ul> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div id="wf_timeline"> | |||||
</div> | |||||
</div> | </div> | ||||
@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/MonitorForm.js") | @Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/MonitorForm.js") | ||||
@@ -4,13 +4,14 @@ | |||||
width: 100%; | width: 100%; | ||||
padding: 5px; | padding: 5px; | ||||
} | } | ||||
.lr-layout-panel { | .lr-layout-panel { | ||||
position: relative; | position: relative; | ||||
height: 100%; | height: 100%; | ||||
width: 100%; | width: 100%; | ||||
border: 1px solid #ccc; | border: 1px solid #ccc; | ||||
background: #fff; | background: #fff; | ||||
padding-top: 41px; | |||||
margin-top: 40px; | |||||
} | } | ||||
.lr-layout-panel-btn { | .lr-layout-panel-btn { | ||||
@@ -103,7 +104,10 @@ | |||||
} | } | ||||
.tab-pane { | .tab-pane { | ||||
position:relative; | |||||
height:100%; | |||||
width:100%; | |||||
} | |||||
position: relative; | |||||
/* height: auto; | |||||
width: auto; | |||||
*/} | |||||
#wf_timeline { | |||||
margin-top: 41px | |||||
} |
@@ -182,9 +182,7 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}); | }); | ||||
custmerForm.loadForm(nodeInfo.wfForms, true, true); | |||||
console.log(nodeInfo); | |||||
if (!processId && nodeId) { | if (!processId && nodeId) { | ||||
learun.httpAsync('GET', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/GetChildProcessDetails', { processId: processId, nodeId: nodeId }, function (data) { | learun.httpAsync('GET', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/GetChildProcessDetails', { processId: processId, nodeId: nodeId }, function (data) { | ||||
@@ -212,12 +210,13 @@ var bootstrap = function ($, learun) { | |||||
history = info.TaskLogList; | history = info.TaskLogList; | ||||
currentIds = info.CurrentNodeIds; | currentIds = info.CurrentNodeIds; | ||||
// page.loadFlowInfo(); | |||||
// page.loadFlowInfo(); | |||||
page.loadTimeLine(); | page.loadTimeLine(); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
custmerForm.loadForm(nodeInfo.wfForms, true, true); | |||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
@@ -238,16 +237,7 @@ var bootstrap = function ($, learun) { | |||||
$('#print').on('click', function () { | $('#print').on('click', function () { | ||||
//打印checkbox 选中效果打印不出来 | //打印checkbox 选中效果打印不出来 | ||||
$("input[type='checkbox']:checked").attr('checked', 'checked'); | $("input[type='checkbox']:checked").attr('checked', 'checked'); | ||||
var $iframes = $('#form_list_iframes'); | |||||
var iframeId = $iframes.find('.form-list-iframe.active').attr('id'); | |||||
if (iframeId) { | |||||
var $iframe = learun.iframe(iframeId, frames); | |||||
$iframe.$('.lr-form-wrap:visible').jqprint(); | |||||
} | |||||
else { | |||||
//$iframes.find('.form-list-container.active').find('.lr-form-wrap:visible').jqprint(); | |||||
$('#form_list_iframes').jqprint(); | |||||
} | |||||
$.print('.lr-layout-panel'); | |||||
}); | }); | ||||
$('#print').show(); | $('#print').show(); | ||||
}, | }, | ||||
@@ -344,6 +334,7 @@ var bootstrap = function ($, learun) { | |||||
callback: function (departmentMap) { | callback: function (departmentMap) { | ||||
learun.clientdata.getAllAsync('user', { | learun.clientdata.getAllAsync('user', { | ||||
callback: function (userMap) { | callback: function (userMap) { | ||||
history.sort(compareFunction("F_CreateDate")); | |||||
for (var i = 0, l = history.length; i < l; i++) { | for (var i = 0, l = history.length; i < l; i++) { | ||||
var item = history[i]; | var item = history[i]; | ||||
@@ -414,7 +405,7 @@ var bootstrap = function ($, learun) { | |||||
nodelist.push(point); | nodelist.push(point); | ||||
} | } | ||||
$('#wf_timeline').lrtimeline(nodelist); | |||||
$('#wf_timeline').lrtimelineEsc(nodelist); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
@@ -427,4 +418,22 @@ var bootstrap = function ($, learun) { | |||||
}; | }; | ||||
page.init(); | page.init(); | ||||
} | |||||
function compareFunction(propertyName) { | |||||
return function (src, tar) { | |||||
//获取比较的值 | |||||
var v1 = src[propertyName]; | |||||
var v2 = tar[propertyName]; | |||||
if (v1 > v2) { | |||||
return 1; | |||||
} | |||||
if (v1 < v2) { | |||||
return -1; | |||||
} | |||||
return 0; | |||||
}; | |||||
} | } |
@@ -1,400 +0,0 @@ | |||||
using Learun.Application.Organization; | |||||
using Learun.Util; | |||||
using System.Collections.Generic; | |||||
using System.Web.Mvc; | |||||
using Learun.Application.Base.AuthorizeModule; | |||||
using System.Linq; | |||||
using System; | |||||
using Learun.Application.Base.SystemModule; | |||||
namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创建人:陈彬彬 | |||||
/// 日 期:2017.03.09 | |||||
/// 描 述:用户管理控制器 | |||||
/// </summary> | |||||
public class UserController : MvcControllerBase | |||||
{ | |||||
private UserIBLL userIBLL = new UserBLL(); | |||||
private DepartmentIBLL departmentIBLL = new DepartmentBLL(); | |||||
private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | |||||
private RoleIBLL roleIBLL = new RoleBLL(); | |||||
#region 获取视图 | |||||
[HttpGet] | |||||
public ActionResult StudentIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 用户管理主页 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 用户管理表单 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 人员选择 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult SelectForm() | |||||
{ | |||||
return View(); | |||||
} | |||||
[HttpGet] | |||||
public ActionResult LookForm() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 人员选择 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult SelectOnlyForm() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取分页数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="keyword">关键字</param> | |||||
/// <param name="companyId">公司主键</param> | |||||
/// <param name="departmentId">部门主键</param> | |||||
/// <param name="tp">0 教师 1学生</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string keyword, string companyId, string departmentId, string tp) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = userIBLL.GetPageList(companyId, departmentId, paginationobj, keyword, tp); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records, | |||||
}; | |||||
return JsonResult(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取用户列表 | |||||
/// </summary> | |||||
/// <param name="companyId">公司主键</param> | |||||
/// <param name="departmentId">部门主键</param> | |||||
/// <param name="keyword">查询关键词</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetList(string companyId, string departmentId, string keyword) | |||||
{ | |||||
if (string.IsNullOrEmpty(companyId)) | |||||
{ | |||||
var department = departmentIBLL.GetEntity(departmentId); | |||||
if (department != null) | |||||
{ | |||||
var data = userIBLL.GetList(department.F_CompanyId, departmentId, keyword); | |||||
return JsonResult(data); | |||||
} | |||||
else | |||||
{ | |||||
return JsonResult(new List<string>()); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
var data = userIBLL.GetList(companyId, departmentId, keyword); | |||||
return JsonResult(data); | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 根据部门获取用户 | |||||
/// </summary> | |||||
/// <param name="departmentId">部门主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetListByDepartmentId(string departmentId) | |||||
{ | |||||
var data = userIBLL.GetListByDepartmentId(departmentId); | |||||
return JsonResult(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取本部门的人员 | |||||
/// </summary> | |||||
/// <param name="companyId">公司主键</param> | |||||
/// <param name="departmentId">部门主键</param> | |||||
/// <param name="keyword">查询关键词</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetMyDepartmentList() | |||||
{ | |||||
UserInfo userinfo = LoginUserInfo.Get(); | |||||
var data = userIBLL.GetList(userinfo.companyId, userinfo.departmentId, ""); | |||||
return JsonResult(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取用户信息列表 | |||||
/// </summary> | |||||
/// <param name="userIds">用户主键串</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetListByUserIds(string keyValue) | |||||
{ | |||||
var list = userIBLL.GetListByUserIds(keyValue); | |||||
string text = ""; | |||||
foreach (var item in list) | |||||
{ | |||||
if (!string.IsNullOrEmpty(text)) | |||||
{ | |||||
text += ","; | |||||
} | |||||
text += item.F_RealName; | |||||
} | |||||
return SuccessString(text); | |||||
} | |||||
/// <summary> | |||||
/// 获取用户信息列表 | |||||
/// </summary> | |||||
/// <param name="userIds">用户主键串</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetEntityListByUserIds(string keyValue) | |||||
{ | |||||
var list = userIBLL.GetListByUserIds(keyValue); | |||||
return JsonResult(list); | |||||
} | |||||
/// <summary> | |||||
/// 获取用户信息 | |||||
/// </summary> | |||||
/// <param name="userIds">用户主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetUserEntity(string userId) | |||||
{ | |||||
var data = userIBLL.GetEntityByUserId(userId); | |||||
return JsonResult(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取映射数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetMap(string ver) | |||||
{ | |||||
var data = userIBLL.GetModelMap(); | |||||
string md5 = Md5Helper.Encrypt(data.ToJson(), 32); | |||||
if (md5 == ver) | |||||
{ | |||||
return Success("no update"); | |||||
} | |||||
else | |||||
{ | |||||
var jsondata = new | |||||
{ | |||||
data = data, | |||||
ver = md5 | |||||
}; | |||||
return JsonResult(jsondata); | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取头像 | |||||
/// </summary> | |||||
/// <param name="userId">用户主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult GetImg(string userId) | |||||
{ | |||||
userIBLL.GetImg(userId); | |||||
return Success("获取成功。"); | |||||
} | |||||
[HttpGet] | |||||
public ActionResult GetImgForDC(string userId) | |||||
{ | |||||
userIBLL.GetImg(userId); | |||||
return Success("获取成功。"); | |||||
} | |||||
[HttpGet] | |||||
public ActionResult GetRoleList(string objectId) | |||||
{ | |||||
var roleList = userRelationIBLL.GetRoleListByUserId(objectId); | |||||
var jsonResult = new { roleInfoList = roleList }; | |||||
return Success(jsonResult); | |||||
} | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetLastLoginTime(string userId) | |||||
{ | |||||
return Success(LogBLL.GetUserLogList(userId)?.F_OperateTime); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 保存表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, UserEntity entity) | |||||
{ | |||||
userIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 删除表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
//userIBLL.VirtualDelete(keyValue); | |||||
userIBLL.VirtualDeleteBatch(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 启用禁用账号 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult UpdateState(string keyValue, int state) | |||||
{ | |||||
userIBLL.UpdateState(keyValue, state); | |||||
return Success("操作成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 重置用户账号密码 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult ResetPassword(string keyValue) | |||||
{ | |||||
userIBLL.ResetPassword(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 重置用户账号密码(八位) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult ResetPasswordEight(string keyValue) | |||||
{ | |||||
userIBLL.ResetPasswordEight(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult ResetStudentRelation() | |||||
{ | |||||
var allStudents = userIBLL.GetStudents(); | |||||
var studentRoleId = roleIBLL.GetIdByRoleName("学生"); | |||||
var hasStudentsRolePeople = userRelationIBLL.GetUserIdList(studentRoleId).Select(a => a.F_UserId); | |||||
var studentList = allStudents.Where(a => !hasStudentsRolePeople.Contains(a.F_UserId)); | |||||
var relationList = new List<UserRelationEntity>(); | |||||
var userIds = ""; | |||||
foreach (var item in allStudents) | |||||
{ | |||||
if (userIds != "") | |||||
{ | |||||
userIds += ","; | |||||
} | |||||
userIds += item.F_UserId; | |||||
} | |||||
userRelationIBLL.SaveEntityList(studentRoleId, 1, userIds); | |||||
return Success("操作成功"); | |||||
} | |||||
#endregion | |||||
#region 数据导出 | |||||
/// <summary> | |||||
/// 导出用户列表 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ExportUserList() | |||||
{ | |||||
userIBLL.GetExportList(); | |||||
return Success("导出成功。"); | |||||
} | |||||
/// <summary> | |||||
/// 导出用户列表【学生】 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ExportUserListOfStudent() | |||||
{ | |||||
userIBLL.GetExportListOfStudent(); | |||||
return Success("导出成功。"); | |||||
} | |||||
#endregion | |||||
#region 验证数据 | |||||
/// <summary> | |||||
/// 账号不能重复 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="F_Account">账号</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult ExistAccount(string keyValue, string F_Account) | |||||
{ | |||||
bool res = userIBLL.ExistAccount(F_Account, keyValue); | |||||
return JsonResult(res); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -1,47 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "应用管理"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap"> | |||||
<div class="col-xs-6 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">应用名称<font face="宋体">*</font></div> | |||||
<input id="FName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">分类名称<font face="宋体">*</font></div> | |||||
<div id="FTId" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">应用地址<font face="宋体">*</font></div> | |||||
<input id="FUrl" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">登录接口地址<font face="宋体">*</font></div> | |||||
<input id="FInterfaceUrl" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">应用私钥<font face="宋体">*</font></div> | |||||
<input id="FSecret" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">排序<font face="宋体">*</font></div> | |||||
<input id="FOrder" type="text" class="form-control" isvalid="yes" checkexpession="Num" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">是否启用<font face="宋体">*</font></div> | |||||
<div id="FEnabled" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">是否管理页<font face="宋体">*</font></div> | |||||
<div id="FIsManagePage" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">图片<font face="宋体">*</font></div> | |||||
<div id="FImage" isvalid="yes" checkexpession="NotNull" ></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="Perm_Function"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="FRemark" class="form-control" style="height:150px;"></textarea> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/Permission/Views/Perm_Function/Form.js") |
@@ -0,0 +1,255 @@ | |||||
/* @license | |||||
* jQuery.print, version 1.5.1 | |||||
* (c) Sathvik Ponangi, Doers' Guild | |||||
* Licence: CC-By (http://creativecommons.org/licenses/by/3.0/) | |||||
*--------------------------------------------------------------------------*/ | |||||
(function ($) { | |||||
"use strict"; | |||||
// A nice closure for our definitions | |||||
function getjQueryObject(string) { | |||||
// Make string a vaild jQuery thing | |||||
var jqObj = $(""); | |||||
try { | |||||
jqObj = $(string) | |||||
.clone(); | |||||
} catch (e) { | |||||
jqObj = $("<span />") | |||||
.html(string); | |||||
} | |||||
return jqObj; | |||||
} | |||||
function printFrame(frameWindow, content, options) { | |||||
// Print the selected window/iframe | |||||
var def = $.Deferred(); | |||||
try { | |||||
frameWindow = frameWindow.contentWindow || frameWindow.contentDocument || frameWindow; | |||||
var wdoc = frameWindow.document || frameWindow.contentDocument || frameWindow; | |||||
if(options.doctype) { | |||||
wdoc.write(options.doctype); | |||||
} | |||||
wdoc.write(content); | |||||
wdoc.close(); | |||||
var printed = false; | |||||
var callPrint = function () { | |||||
if(printed) { | |||||
return; | |||||
} | |||||
// Fix for IE : Allow it to render the iframe | |||||
frameWindow.focus(); | |||||
try { | |||||
// Fix for IE11 - printng the whole page instead of the iframe content | |||||
if (!frameWindow.document.execCommand('print', false, null)) { | |||||
// document.execCommand returns false if it failed -http://stackoverflow.com/a/21336448/937891 | |||||
frameWindow.print(); | |||||
} | |||||
// focus body as it is losing focus in iPad and content not getting printed | |||||
$('body').focus(); | |||||
} catch (e) { | |||||
frameWindow.print(); | |||||
} | |||||
frameWindow.close(); | |||||
printed = true; | |||||
def.resolve(); | |||||
} | |||||
// Print once the frame window loads - seems to work for the new-window option but unreliable for the iframe | |||||
$(frameWindow).on("load", callPrint); | |||||
// Fallback to printing directly if the frame doesn't fire the load event for whatever reason | |||||
setTimeout(callPrint, options.timeout); | |||||
} catch (err) { | |||||
def.reject(err); | |||||
} | |||||
return def; | |||||
} | |||||
function printContentInIFrame(content, options) { | |||||
var $iframe = $(options.iframe + ""); | |||||
var iframeCount = $iframe.length; | |||||
if (iframeCount === 0) { | |||||
// Create a new iFrame if none is given | |||||
$iframe = $('<iframe height="0" width="0" border="0" wmode="Opaque"/>') | |||||
.prependTo('body') | |||||
.css({ | |||||
"position": "absolute", | |||||
"top": -999, | |||||
"left": -999 | |||||
}); | |||||
} | |||||
var frameWindow = $iframe.get(0); | |||||
return printFrame(frameWindow, content, options) | |||||
.done(function () { | |||||
// Success | |||||
setTimeout(function () { | |||||
// Wait for IE | |||||
if (iframeCount === 0) { | |||||
// Destroy the iframe if created here | |||||
$iframe.remove(); | |||||
} | |||||
}, 1000); | |||||
}) | |||||
.fail(function (err) { | |||||
// Use the pop-up method if iframe fails for some reason | |||||
console.error("Failed to print from iframe", err); | |||||
printContentInNewWindow(content, options); | |||||
}) | |||||
.always(function () { | |||||
try { | |||||
options.deferred.resolve(); | |||||
} catch (err) { | |||||
console.warn('Error notifying deferred', err); | |||||
} | |||||
}); | |||||
} | |||||
function printContentInNewWindow(content, options) { | |||||
// Open a new window and print selected content | |||||
var frameWindow = window.open(); | |||||
return printFrame(frameWindow, content, options) | |||||
.always(function () { | |||||
try { | |||||
options.deferred.resolve(); | |||||
} catch (err) { | |||||
console.warn('Error notifying deferred', err); | |||||
} | |||||
}); | |||||
} | |||||
function isNode(o) { | |||||
/* http://stackoverflow.com/a/384380/937891 */ | |||||
return !!(typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"); | |||||
} | |||||
$.print = $.fn.print = function () { | |||||
// Print a given set of elements | |||||
var options, $this, self = this; | |||||
// console.log("Printing", this, arguments); | |||||
if (self instanceof $) { | |||||
// Get the node if it is a jQuery object | |||||
self = self.get(0); | |||||
} | |||||
if (isNode(self)) { | |||||
// If `this` is a HTML element, i.e. for | |||||
// $(selector).print() | |||||
$this = $(self); | |||||
if (arguments.length > 0) { | |||||
options = arguments[0]; | |||||
} | |||||
} else { | |||||
if (arguments.length > 0) { | |||||
// $.print(selector,options) | |||||
$this = $(arguments[0]); | |||||
if (isNode($this[0])) { | |||||
if (arguments.length > 1) { | |||||
options = arguments[1]; | |||||
} | |||||
} else { | |||||
// $.print(options) | |||||
options = arguments[0]; | |||||
$this = $("html"); | |||||
} | |||||
} else { | |||||
// $.print() | |||||
$this = $("html"); | |||||
} | |||||
} | |||||
// Default options | |||||
var defaults = { | |||||
globalStyles: true, | |||||
mediaPrint: false, | |||||
stylesheet: null, | |||||
noPrintSelector: ".no-print", | |||||
iframe: true, | |||||
append: null, | |||||
prepend: null, | |||||
manuallyCopyFormValues: true, | |||||
deferred: $.Deferred(), | |||||
timeout: 750, | |||||
title: null, | |||||
doctype: '<!doctype html>' | |||||
}; | |||||
// Merge with user-options | |||||
options = $.extend({}, defaults, (options || {})); | |||||
var $styles = $(""); | |||||
if (options.globalStyles) { | |||||
// Apply the stlyes from the current sheet to the printed page | |||||
$styles = $("style, link, meta, base, title"); | |||||
} else if (options.mediaPrint) { | |||||
// Apply the media-print stylesheet | |||||
$styles = $("link[media=print]"); | |||||
} | |||||
if (options.stylesheet) { | |||||
// Add a custom stylesheet if given | |||||
$styles = $.merge($styles, $('<link rel="stylesheet" href="' + options.stylesheet + '">')); | |||||
} | |||||
// Create a copy of the element to print | |||||
var copy = $this.clone(); | |||||
// Wrap it in a span to get the HTML markup string | |||||
copy = $("<span/>") | |||||
.append(copy); | |||||
// Remove unwanted elements | |||||
copy.find(options.noPrintSelector) | |||||
.remove(); | |||||
// Add in the styles | |||||
copy.append($styles.clone()); | |||||
// Update title | |||||
if (options.title) { | |||||
var title = $("title", copy); | |||||
if (title.length === 0) { | |||||
title = $("<title />"); | |||||
copy.append(title); | |||||
} | |||||
title.text(options.title); | |||||
} | |||||
// Appedned content | |||||
copy.append(getjQueryObject(options.append)); | |||||
// Prepended content | |||||
copy.prepend(getjQueryObject(options.prepend)); | |||||
if (options.manuallyCopyFormValues) { | |||||
// Manually copy form values into the HTML for printing user-modified input fields | |||||
// http://stackoverflow.com/a/26707753 | |||||
copy.find("input") | |||||
.each(function () { | |||||
var $field = $(this); | |||||
if ($field.is("[type='radio']") || $field.is("[type='checkbox']")) { | |||||
if ($field.prop("checked")) { | |||||
$field.attr("checked", "checked"); | |||||
} | |||||
} else { | |||||
$field.attr("value", $field.val()); | |||||
} | |||||
}); | |||||
copy.find("select").each(function () { | |||||
var $field = $(this); | |||||
$field.find(":selected").attr("selected", "selected"); | |||||
}); | |||||
copy.find("textarea").each(function () { | |||||
// Fix for https://github.com/DoersGuild/jQuery.print/issues/18#issuecomment-96451589 | |||||
var $field = $(this); | |||||
$field.text($field.val()); | |||||
}); | |||||
} | |||||
// Get the HTML markup string | |||||
var content = copy.html(); | |||||
// Notify with generated markup & cloned elements - useful for logging, etc | |||||
try { | |||||
options.deferred.notify('generated_markup', content, copy); | |||||
} catch (err) { | |||||
console.warn('Error notifying deferred', err); | |||||
} | |||||
// Destroy the copy | |||||
copy.remove(); | |||||
if (options.iframe) { | |||||
// Use an iframe for printing | |||||
try { | |||||
printContentInIFrame(content, options); | |||||
} catch (e) { | |||||
// Use the pop-up method if iframe fails for some reason | |||||
console.error("Failed to print from iframe", e.stack, e.message); | |||||
printContentInNewWindow(content, options); | |||||
} | |||||
} else { | |||||
// Use a new window for printing | |||||
printContentInNewWindow(content, options); | |||||
} | |||||
return this; | |||||
}; | |||||
})(jQuery); |
@@ -1,409 +0,0 @@ | |||||
using System; | |||||
using System.Configuration; | |||||
using System.IO; | |||||
using Learun.Application.Organization; | |||||
using Learun.Application.Base.SystemModule; | |||||
using Learun.Util; | |||||
using Learun.Util.Operat; | |||||
using System.Web.Mvc; | |||||
using ServiceStack; | |||||
using ServiceStack.Text; | |||||
using HttpMethods = Learun.Util.HttpMethods; | |||||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||||
using System.Linq; | |||||
using System.Net; | |||||
using System.Net.Http; | |||||
using Quanjiang.DigitalScholl.WebLicense; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using Newtonsoft.Json; | |||||
namespace Learun.Application.Web.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创建人:陈彬彬 | |||||
/// 日 期:2017.03.08 | |||||
/// 描 述:登录控制器 | |||||
/// </summary> | |||||
[HandlerLogin(FilterMode.Ignore)] | |||||
public class LoginController : MvcControllerBase | |||||
{ | |||||
#region 模块对象 | |||||
private UserIBLL userBll = new UserBLL(); | |||||
private Sys_QRCodeInLoginIBLL sys_QRCodeInLoginIBLL = new Sys_QRCodeInLoginBLL(); | |||||
private Sys_UpdateRecordIBLL sys_UpdateRecordIBLL = new Sys_UpdateRecordBLL(); | |||||
private TeachSwitchIBLL teachSwitchIBLL = new TeachSwitchBLL(); | |||||
#endregion | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 默认页面 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Default() | |||||
{ | |||||
return RedirectToAction("Index", "Login"); | |||||
} | |||||
/// <summary> | |||||
/// 登录页面 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
//授权验证 | |||||
var lc = LicenseChecker.CheckLicense(); | |||||
if (!lc.Result) | |||||
{ | |||||
return Content("<script>alert('" + lc.Message + "');location.href='/ShowRegister/Index';</script>"); | |||||
} | |||||
ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum(); | |||||
//获取高职版跳转地址 | |||||
ViewBag.DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"]; | |||||
ViewBag.Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port; | |||||
//获取登录页二维码配置信息 | |||||
ViewBag.HasQRCode = false; | |||||
var qrcodelist = sys_QRCodeInLoginIBLL.GetList().ToList().Where(x => x.EnabledMark == 1).OrderByDescending(x => x.CreateTime); | |||||
if (qrcodelist.Any()) | |||||
{ | |||||
ViewBag.HasQRCode = true; | |||||
ViewBag.QRCodeUrl = qrcodelist.FirstOrDefault().QRCodeUrl; | |||||
ViewBag.Title = qrcodelist.FirstOrDefault().Title; | |||||
} | |||||
//获取登录页面版本号 | |||||
ViewBag.Version = false; | |||||
var versionlist = sys_UpdateRecordIBLL.GetList().OrderByDescending(x => x.UpdateTime); | |||||
if (versionlist.Any()) | |||||
{ | |||||
ViewBag.Version = true; | |||||
ViewBag.VersionNum = versionlist.FirstOrDefault().VersionNum; | |||||
ViewBag.VersionList = JsonConvert.SerializeObject(versionlist); | |||||
} | |||||
var result = teachSwitchIBLL.FindFirst(); | |||||
ViewBag.TeachSwitch = result; | |||||
//获取在线用户人数 | |||||
ViewBag.OnlineUserNum = 0; | |||||
var onlineUserResult = sys_UpdateRecordIBLL.GetOnlineUserNum(); | |||||
if (onlineUserResult != null) | |||||
{ | |||||
ViewBag.OnlineUserNum = onlineUserResult.OnlineUserNum; | |||||
} | |||||
return View("Default"); | |||||
//string learn_UItheme = WebHelper.GetCookie("Learn_ADMS_V6.1_UItheme"); | |||||
//switch (learn_UItheme) | |||||
//{ | |||||
// case "1": | |||||
// return View("Default"); // 经典版本 | |||||
// case "2": | |||||
// return View("Accordion"); // 手风琴版本 | |||||
// case "3": | |||||
// return View("Window"); // Windos版本 | |||||
// case "4": | |||||
// return View("Top"); // 顶部菜单版本 | |||||
// default: | |||||
// return View("Default"); // 经典版本 | |||||
//} | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 生成验证码 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult VerifyCode() | |||||
{ | |||||
return File(new VerifyCode().GetVerifyCode(), @"image/Gif"); | |||||
} | |||||
/// <summary> | |||||
/// 获取用户登录信息 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
[HandlerLogin(FilterMode.Enforce)] | |||||
public ActionResult GetUserInfo() | |||||
{ | |||||
var data = LoginUserInfo.Get(); | |||||
data.imUrl = Config.GetValue("IMUrl"); | |||||
data.password = null; | |||||
data.secretkey = null; | |||||
return JsonResult(data); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 安全退出 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
[HandlerLogin(FilterMode.Enforce)] | |||||
public ActionResult OutLogin() | |||||
{ | |||||
var userInfo = LoginUserInfo.Get(); | |||||
LogEntity logEntity = new LogEntity(); | |||||
logEntity.F_CategoryId = 1; | |||||
logEntity.F_OperateTypeId = ((int)OperationType.Exit).ToString(); | |||||
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Exit); | |||||
logEntity.F_OperateAccount = userInfo.account + "(" + userInfo.realName + ")"; | |||||
logEntity.F_OperateUserId = userInfo.userId; | |||||
logEntity.F_ExecuteResult = 1; | |||||
logEntity.F_ExecuteResultJson = "退出系统"; | |||||
logEntity.F_Module = "登录"; | |||||
logEntity.WriteLog(); | |||||
Session.Abandon(); //清除当前会话 | |||||
Session.Clear(); //清除当前浏览器所有Session | |||||
OperatorHelper.Instance.EmptyCurrent(); | |||||
return Success("退出系统"); | |||||
} | |||||
/// <summary> | |||||
/// 登录验证 | |||||
/// </summary> | |||||
/// <param name="username">用户名</param> | |||||
/// <param name="password">密码</param> | |||||
/// <param name="verifycode">验证码</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
[HandlerValidateAntiForgeryToken] | |||||
public ActionResult CheckLogin(string username, string password, string verifycode) | |||||
{ | |||||
int error = OperatorHelper.Instance.GetCurrentErrorNum(); | |||||
if (error >= 3) | |||||
{ | |||||
#region 验证码验证 | |||||
verifycode = Md5Helper.Encrypt(verifycode.ToLower(), 16); | |||||
if (Session["session_verifycode"].IsEmpty() || verifycode != Session["session_verifycode"].ToString()) | |||||
{ | |||||
return Fail("验证码错误"); | |||||
} | |||||
#endregion | |||||
} | |||||
#region 内部账户验证 | |||||
UserEntity userEntity = userBll.CheckLogin(username, password); | |||||
#region 写入日志 | |||||
LogEntity logEntity = new LogEntity(); | |||||
logEntity.F_CategoryId = 1; | |||||
logEntity.F_OperateTypeId = ((int)OperationType.Login).ToString(); | |||||
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Login); | |||||
logEntity.F_OperateAccount = username + "(" + userEntity.F_RealName + ")"; | |||||
logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : username; | |||||
logEntity.F_Module = Config.GetValue("SoftName"); | |||||
#endregion | |||||
if (!userEntity.LoginOk)//登录失败 | |||||
{ | |||||
//写入日志 | |||||
logEntity.F_ExecuteResult = 0; | |||||
logEntity.F_ExecuteResultJson = "登录失败:" + userEntity.LoginMsg; | |||||
logEntity.WriteLog(); | |||||
int num = OperatorHelper.Instance.AddCurrentErrorNum(); | |||||
return Fail(userEntity.LoginMsg, num); | |||||
} | |||||
else | |||||
{ | |||||
OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 | |||||
//写入日志 | |||||
logEntity.F_ExecuteResult = 1; | |||||
logEntity.F_ExecuteResultJson = "登录成功"; | |||||
logEntity.WriteLog(); | |||||
OperatorHelper.Instance.ClearCurrentErrorNum(); | |||||
return Success("登录成功"); | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion | |||||
#region 飞星网盘 | |||||
[HttpGet] | |||||
public ActionResult GetResumFile() | |||||
{ | |||||
//用于获取当前文件是否是续传。和续传的字节数开始点。 | |||||
var md5str = Request.QueryString["md5str"]; | |||||
var userId = Request.QueryString["uid"]; | |||||
string uploadDate = DateTime.Now.ToString("yyyyMMdd"); | |||||
string virtualPath = $"~/Resource/DocumentFile/{userId}/{uploadDate}/"; | |||||
string fullFileName = this.Server.MapPath(virtualPath); | |||||
var saveFilePath = fullFileName + md5str; | |||||
if (!Directory.Exists(fullFileName)) | |||||
{ | |||||
Directory.CreateDirectory(fullFileName); | |||||
} | |||||
if (System.IO.File.Exists(saveFilePath)) | |||||
{ | |||||
var fs = new FileStream(saveFilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); | |||||
var fslength = fs.Length.ToString(); | |||||
fs.Close(); | |||||
return Json(fslength, JsonRequestBehavior.AllowGet); | |||||
} | |||||
return Json(0, JsonRequestBehavior.AllowGet); | |||||
} | |||||
[HttpPost] | |||||
public HttpResponseMessage Rsume() | |||||
{ | |||||
try | |||||
{ | |||||
var file = Request.InputStream; | |||||
var filename = Request.QueryString["filename"]; | |||||
var userId = Request.QueryString["uid"]; | |||||
string uploadDate = DateTime.Now.ToString("yyyyMMdd"); | |||||
string virtualPath = $"~/Resource/DocumentFile/{userId}/{uploadDate}/"; | |||||
string fullFileName = this.Server.MapPath(virtualPath); | |||||
var saveFilePath = fullFileName + filename; | |||||
Save(saveFilePath, file); | |||||
Response.StatusCode = 200; | |||||
return new HttpResponseMessage(HttpStatusCode.OK); | |||||
} | |||||
catch (Exception e) | |||||
{ | |||||
return new HttpResponseMessage(HttpStatusCode.InternalServerError); | |||||
} | |||||
} | |||||
private void Save(string saveFilePath, Stream stream) | |||||
{ | |||||
try | |||||
{ | |||||
long lStartPos = 0; | |||||
int startPosition = 0; | |||||
int endPosition = 0; | |||||
//var contentRange = HttpContext.Current.Request.Headers["Content-Range"]; | |||||
var contentRange = HttpContext.Request.Headers["Content-Range"].ToString(); | |||||
if (!string.IsNullOrEmpty(contentRange)) | |||||
{ | |||||
contentRange = contentRange.Replace("bytes", "").Trim(); | |||||
contentRange = contentRange.Substring(0, contentRange.IndexOf("/")); | |||||
string[] ranges = contentRange.Split('-'); | |||||
startPosition = int.Parse(ranges[0]); | |||||
endPosition = int.Parse(ranges[1]); | |||||
} | |||||
FileStream fs; | |||||
if (System.IO.File.Exists(saveFilePath)) | |||||
{ | |||||
fs = new System.IO.FileStream(saveFilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); | |||||
lStartPos = fs.Length; | |||||
} | |||||
else | |||||
{ | |||||
fs = new FileStream(saveFilePath, System.IO.FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite); | |||||
lStartPos = 0; | |||||
} | |||||
if (lStartPos > endPosition) | |||||
{ | |||||
fs.Close(); | |||||
return; | |||||
} | |||||
if (lStartPos < startPosition) | |||||
{ | |||||
lStartPos = startPosition; | |||||
} | |||||
else if (lStartPos > startPosition && lStartPos < endPosition) | |||||
{ | |||||
lStartPos = startPosition; | |||||
} | |||||
fs.Seek(lStartPos, System.IO.SeekOrigin.Current); | |||||
byte[] nbytes = new byte[512]; | |||||
int nReadSize = 0; | |||||
nReadSize = stream.Read(nbytes, 0, 512); | |||||
while (nReadSize > 0) | |||||
{ | |||||
fs.Write(nbytes, 0, nReadSize); | |||||
nReadSize = stream.Read(nbytes, 0, 512); | |||||
} | |||||
stream.Close(); | |||||
fs.Close(); | |||||
} | |||||
catch (Exception e) | |||||
{ | |||||
} | |||||
} | |||||
#endregion | |||||
#region 接口登录 | |||||
[HttpGet] | |||||
public ActionResult CheckLoginForSSO(string u, string p, string t) | |||||
{ | |||||
try | |||||
{ | |||||
string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"]; | |||||
string userkey = ConfigurationManager.AppSettings["SSOUserSecret"]; | |||||
string uid = Request.QueryString["u"]; | |||||
string pwd = Request.QueryString["p"]; | |||||
string logintime = Request.QueryString["t"]; | |||||
if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(logintime)) | |||||
{ | |||||
decimal decodelogintime = Convert.ToDecimal(DESEncrypt.Decrypt(DESEncrypt.Decrypt(logintime, publickey), userkey)); | |||||
decimal datetimenow = Convert.ToDecimal(DateTime.Now.ToString("yyyyMMddHHmmss")); | |||||
if (datetimenow - 300 <= decodelogintime && datetimenow + 300 >= decodelogintime) | |||||
{ | |||||
string username = DESEncrypt.Decrypt(DESEncrypt.Decrypt(uid, publickey), userkey); | |||||
string password = DESEncrypt.Decrypt(DESEncrypt.Decrypt(pwd, publickey), userkey); | |||||
UserEntity userEntity = userBll.CheckLogin(username, Md5Helper.Encrypt(password, 32)); | |||||
LogEntity logEntity = new LogEntity(); | |||||
logEntity.F_CategoryId = 1; | |||||
logEntity.F_OperateTypeId = ((int)OperationType.Login).ToString(); | |||||
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Login); | |||||
logEntity.F_OperateAccount = username + "(" + userEntity.F_RealName + ")"; | |||||
logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : username; | |||||
logEntity.F_Module = "接口登录"; | |||||
if (!userEntity.LoginOk)//登录失败 | |||||
{ | |||||
//写入日志 | |||||
logEntity.F_ExecuteResult = 0; | |||||
logEntity.F_ExecuteResultJson = "接口登录失败:" + userEntity.LoginMsg; | |||||
logEntity.WriteLog(); | |||||
return Fail(userEntity.LoginMsg); | |||||
} | |||||
else | |||||
{ | |||||
OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 | |||||
//写入日志 | |||||
logEntity.F_ExecuteResult = 1; | |||||
logEntity.F_ExecuteResultJson = "接口登录成功"; | |||||
logEntity.WriteLog(); | |||||
var DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"]; | |||||
var Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port; | |||||
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index"); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return Fail("时间戳验证失败"); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return Fail("参数错误"); | |||||
} | |||||
} | |||||
catch (Exception e) | |||||
{ | |||||
return Fail("参数错误"); | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -1959,6 +1959,7 @@ | |||||
<Content Include="Content\images\SsoSystem\search.png" /> | <Content Include="Content\images\SsoSystem\search.png" /> | ||||
<Content Include="Content\images\SsoSystem\user.jpg" /> | <Content Include="Content\images\SsoSystem\user.jpg" /> | ||||
<Content Include="Content\jquery\plugin\jqprint\jqprint.css" /> | <Content Include="Content\jquery\plugin\jqprint\jqprint.css" /> | ||||
<Content Include="Content\jquery\plugin\jqprint\jQuery.print.js" /> | |||||
<Content Include="Content\jquery\plugin\jSignature.min.js" /> | <Content Include="Content\jquery\plugin\jSignature.min.js" /> | ||||
<Content Include="Content\jquery\plugin\swiper\swiper-4.3.3.min.css" /> | <Content Include="Content\jquery\plugin\swiper\swiper-4.3.3.min.css" /> | ||||
<Content Include="Content\jquery\plugin\swiper\swiper-4.3.3.min.js" /> | <Content Include="Content\jquery\plugin\swiper\swiper-4.3.3.min.js" /> | ||||
@@ -3784,6 +3785,7 @@ | |||||
<Content Include="Views\LR_Content\plugin\scroll\scroll.js" /> | <Content Include="Views\LR_Content\plugin\scroll\scroll.js" /> | ||||
<Content Include="Views\LR_Content\plugin\select\lr-select.css" /> | <Content Include="Views\LR_Content\plugin\select\lr-select.css" /> | ||||
<Content Include="Views\LR_Content\plugin\select\lr-select.js" /> | <Content Include="Views\LR_Content\plugin\select\lr-select.js" /> | ||||
<Content Include="Views\LR_Content\plugin\timeline\lr-timelineEsc.js" /> | |||||
<Content Include="Views\LR_Content\plugin\timeline\lr-timeline.css" /> | <Content Include="Views\LR_Content\plugin\timeline\lr-timeline.css" /> | ||||
<Content Include="Views\LR_Content\plugin\timeline\lr-timeline.js" /> | <Content Include="Views\LR_Content\plugin\timeline\lr-timeline.js" /> | ||||
<Content Include="Views\LR_Content\plugin\tree\lr-tree.css" /> | <Content Include="Views\LR_Content\plugin\tree\lr-tree.css" /> | ||||
@@ -0,0 +1,64 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:Learun智慧校园-前端开发组 | |||||
* 日 期:2017.03.22 | |||||
* 描 述:时间轴方法(升序) | |||||
*/ | |||||
$.fn.lrtimelineEsc = function (nodelist) { | |||||
// title 标题 | |||||
// people 审核人 | |||||
// content 内容 | |||||
// time 时间 | |||||
var $self = $(this); | |||||
if ($self.length == 0) { | |||||
return $self; | |||||
} | |||||
$self.addClass('lr-timeline'); | |||||
var $wrap = $('<div class="lr-timeline-allwrap"></div>'); | |||||
var $ul = $('<ul></ul>'); | |||||
if (nodelist.length > 0) { | |||||
// 开始节点 | |||||
var $begin = $('<li class="lr-timeline-header"><div>开始</div></li>') | |||||
$ul.append($begin); | |||||
$.each(nodelist, function (_index, _item) { | |||||
// 中间节点 | |||||
var $li = $('<li class="lr-timeline-item" ><div class="lr-timeline-wrap" ></div></li>'); | |||||
if (_index == 0) { | |||||
$li.find('div').addClass('lr-timeline-current'); | |||||
} | |||||
var $itemwrap = $li.find('.lr-timeline-wrap'); | |||||
var $itemcontent = $('<div class="lr-timeline-content"><span class="arrow"></span></div>'); | |||||
$itemcontent.append('<div class="lr-timeline-title">' + _item.title + '</div>'); | |||||
$itemcontent.append('<div class="lr-timeline-body"><span>' + _item.people + '</span>' + _item.content + '</div>') | |||||
$itemwrap.append('<span class="lr-timeline-date">' + _item.time + '</span>'); | |||||
$itemwrap.append($itemcontent); | |||||
var $event = $itemcontent.find('.lr-event'); | |||||
if ($event.length > 0) { | |||||
$event[0].lrdata = _item; | |||||
$itemcontent.find('.lr-event').on('click', function () { | |||||
var data = $(this)[0].lrdata; | |||||
data.callback && data.callback(data); | |||||
}); | |||||
} | |||||
$ul.append($li); | |||||
}); | |||||
// 结束节点 | |||||
$ul.append('<li class="lr-timeline-ender"><div>当前</div></li>'); | |||||
} | |||||
$wrap.html($ul); | |||||
$self.html($wrap); | |||||
}; |
@@ -1,204 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:陈彬彬 | |||||
* 日 期:2017.03.16 | |||||
* 描 述:数据验证完整性 | |||||
*/ | |||||
(function ($, learun) { | |||||
"use strict"; | |||||
// 数据验证方法 | |||||
learun.validator = { | |||||
validReg: function (obj, reg, msg) { | |||||
var res = { code: true, msg: '' }; | |||||
if (!reg.test(obj)) { | |||||
res.code = false; | |||||
res.msg = msg; | |||||
} | |||||
return res; | |||||
}, | |||||
validRegOrNull: function (obj, reg, msg) { | |||||
var res = { code: true, msg: '' }; | |||||
if (obj == null || obj == undefined || obj.length == 0) { | |||||
return res; | |||||
} | |||||
if (!reg.test(obj)) { | |||||
res.code = false; | |||||
res.msg = msg; | |||||
} | |||||
return res; | |||||
}, | |||||
isNotNull: function (obj) {// 验证不为空 | |||||
var res = { code: true, msg: '' }; | |||||
obj = $.trim(obj); | |||||
if (obj == null || obj == undefined || obj.length == 0) { | |||||
res.code = false; | |||||
res.msg = '不能为空'; | |||||
} | |||||
return res; | |||||
}, | |||||
isNum: function (obj) {// 验证数字 | |||||
return learun.validator.validReg(obj, /^[-+]?\d+$/, '必须为数字'); | |||||
}, | |||||
isPositiveInteger: function (obj) {// 正整数 | |||||
return learun.validator.validReg(obj, /^[1-9]\d*$/, '必须为正整数'); | |||||
}, | |||||
isPositiveFloatintZero: function (obj) {// 整数或小数(不能为负数) | |||||
return learun.validator.validReg(obj, /^(0|[1-9]\d*|(0|[1-9]\d*)\.\d*[1-9])$/, '必须为整数或小数(不能为负数)'); | |||||
}, | |||||
isPositiveFloatint: function (obj) {// 整数或小数(不能为零和负数) | |||||
return learun.validator.validReg(obj, /^([1-9]\d*|(0|[1-9]\d*)\.\d*[1-9])$/, '请输入正确的整数或小数(不能为零和负数)'); | |||||
}, | |||||
isNumOrNull: function (obj) {// 验证数字 或者空 | |||||
return learun.validator.validRegOrNull(obj, /^[-+]?\d+$/, '数字或空'); | |||||
}, | |||||
isEmail: function (obj) {//Email验证 email | |||||
return learun.validator.validReg(obj, /^\w{3,}@\w+(\.\w+)+$/, '必须为E-mail格式'); | |||||
}, | |||||
isEmailOrNull: function (obj) {//Email验证 email 或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^\w{3,}@\w+(\.\w+)+$/, '必须为E-mail格式或空'); | |||||
}, | |||||
isEnglishStr: function (obj) {//验证只能输入英文字符串 echar | |||||
return learun.validator.validReg(obj, /^[a-z,A-Z]+$/, '必须为英文字符串'); | |||||
}, | |||||
isEnglishStrOrNull: function (obj) {//验证只能输入英文字符串 echar 或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^[a-z,A-Z]+$/, '必须为英文字符串或空'); | |||||
}, | |||||
isTelephone: function (obj) { //验证是否电话号码 phone | |||||
return learun.validator.validReg(obj, /^(\d{3,4}\-)?[1-9]\d{6,7}$/, '必须为电话格式'); | |||||
}, | |||||
isTelephoneOrNull: function (obj) {//验证是否电话号码 phone或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^(\d{3,4}\-)?[1-9]\d{6,7}$/, '必须为电话格式或空'); | |||||
}, | |||||
isMobile: function (obj) {//验证是否手机号 mobile | |||||
return learun.validator.validReg(obj, /^(\+\d{2,3}\-)?\d{11}$/, '必须为手机格式'); | |||||
}, | |||||
isMobileOrnull: function (obj) {//验证是否手机号 mobile或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^(\+\d{2,3}\-)?\d{11}$/, '必须为手机格式或空'); | |||||
}, | |||||
isMobileOrPhone: function (obj) {//验证是否手机号或电话号码 mobile phone | |||||
var res = { code: true, msg: '' }; | |||||
if (!learun.validator.isTelephone(obj).code && !learun.validator.isMobile(obj).code) { | |||||
res.code = false; | |||||
res.msg = '为电话格式或手机格式'; | |||||
} | |||||
return res; | |||||
}, | |||||
isMobileOrPhoneOrNull: function (obj) {//验证是否手机号或电话号码 mobile phone或者null,空 | |||||
var res = { code: true, msg: '' }; | |||||
if (learun.validator.isNotNull(obj).code && !learun.validator.isTelephone(obj).code && !learun.validator.isMobile(obj).code) { | |||||
res.code = false; | |||||
res.msg = '为电话格式或手机格式或空'; | |||||
} | |||||
return res; | |||||
}, | |||||
isUri: function (obj) {//验证网址 uri | |||||
return learun.validator.validReg(obj, /^http:\/\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/, '必须为网址格式'); | |||||
}, | |||||
isUriOrNull: function (obj) {//验证网址 uri或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^http:\/\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/, '必须为网址格式或空'); | |||||
}, | |||||
isDate: function (obj) {//判断日期类型是否为YYYY-MM-DD格式的类型 date | |||||
return learun.validator.validReg(obj, /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/, '必须为日期格式'); | |||||
}, | |||||
isDateOrNull: function (obj) {//判断日期类型是否为YYYY-MM-DD格式的类型 date或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/, '必须为日期格式或空'); | |||||
}, | |||||
isDateTime: function (obj) {//判断日期类型是否为YYYY-MM-DD hh:mm:ss格式的类型 datetime | |||||
return learun.validator.validReg(obj, /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/, '必须为日期时间格式'); | |||||
}, | |||||
isDateTimeOrNull: function (obj) {//判断日期类型是否为YYYY-MM-DD hh:mm:ss格式的类型 datetime或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/, '必须为日期时间格式'); | |||||
}, | |||||
isTime: function (obj) {//判断日期类型是否为hh:mm:ss格式的类型 time | |||||
return learun.validator.validReg(obj, /^((20|21|22|23|[0-1]\d)\:[0-5][0-9])(\:[0-5][0-9])?$/, '必须为时间格式'); | |||||
}, | |||||
isTimeOrNull: function (obj) {//判断日期类型是否为hh:mm:ss格式的类型 time或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^((20|21|22|23|[0-1]\d)\:[0-5][0-9])(\:[0-5][0-9])?$/, '必须为时间格式或空'); | |||||
}, | |||||
isChinese: function (obj) {//判断输入的字符是否为中文 cchar | |||||
return learun.validator.validReg(obj, /^[\u0391-\uFFE5]+$/, '必须为中文'); | |||||
}, | |||||
isChineseOrNull: function (obj) {//判断输入的字符是否为中文 cchar或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^[\u0391-\uFFE5]+$/, '必须为中文或空'); | |||||
}, | |||||
isZip: function (obj) {//判断输入的邮编(只能为六位)是否正确 zip | |||||
return learun.validator.validReg(obj, /^\d{6}$/, '必须为邮编格式'); | |||||
}, | |||||
isZipOrNull: function (obj) {//判断输入的邮编(只能为六位)是否正确 zip或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^\d{6}$/, '必须为邮编格式或空'); | |||||
}, | |||||
isDouble: function (obj) {//判断输入的字符是否为双精度 double | |||||
return learun.validator.validReg(obj, /^[-\+]?\d+(\.\d+)?$/, '必须为小数'); | |||||
}, | |||||
isDoubleOrNull: function (obj) {//判断输入的字符是否为双精度 double或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^[-\+]?\d+(\.\d+)?$/, '必须为小数或空'); | |||||
}, | |||||
isIDCard: function (obj) {//判断是否为身份证 idcard | |||||
return learun.validator.validReg(obj, /^\d{15}(\d{2}[A-Za-z0-9;])?$/, '必须为身份证格式'); | |||||
}, | |||||
isIDCardOrNull: function (obj) {//判断是否为身份证 idcard或者null,空 | |||||
return learun.validator.validRegOrNull(obj, /^\d{15}(\d{2}[A-Za-z0-9;])?$/, '必须为身份证格式或空'); | |||||
}, | |||||
isIP: function (obj) {//判断是否为IP地址格式 | |||||
var res = { code: true, msg: '' }; | |||||
var reg = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g //匹配IP地址的正则表达式 | |||||
var flag = false; | |||||
if (reg.test(obj)) { | |||||
if (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256) { flag = true }; | |||||
} | |||||
if (!flag) { | |||||
res.code = false; | |||||
res.msg = '必须为IP格式'; | |||||
} | |||||
return res; | |||||
}, | |||||
isIPOrNull: function (obj) {//判断是否为IP地址格式 或者null,空 | |||||
var res = { code: true, msg: '' }; | |||||
if (learun.validator.isNotNull(obj) && !learun.validator.isIP(obj).code) { | |||||
res.code = false; | |||||
res.msg = '必须为IP格式或空'; | |||||
} | |||||
return res; | |||||
}, | |||||
isLenNum: function (obj, n) {//验证是否是n位数字字符串编号 nnum | |||||
var res = { code: true, msg: '' }; | |||||
var reg = /^[0-9]+$/; | |||||
obj = $.trim(obj); | |||||
if (obj.length > n || !reg.test(obj)) { | |||||
res.code = false; | |||||
res.msg = '必须为' + n + '位数字'; | |||||
} | |||||
return res; | |||||
}, | |||||
isLenNumOrNull: function (obj, n) {//验证是否是n位数字字符串编号 nnum或者null,空 | |||||
var res = { code: true, msg: '' }; | |||||
if (learun.validator.isNotNull(obj).code && !learun.validator.isLenNum(obj)) { | |||||
res.code = false; | |||||
res.msg = '必须为' + n + '位数字或空'; | |||||
} | |||||
return res; | |||||
}, | |||||
isLenStr: function (obj, n) {//验证是否小于等于n位数的字符串 nchar | |||||
var res = { code: true, msg: '' }; | |||||
obj = $.trim(obj); | |||||
if (!learun.validator.isNotNull(obj).code || obj.length > n) { | |||||
res.code = false; | |||||
res.msg = '必须小于等于' + n + '位字符'; | |||||
} | |||||
return res; | |||||
}, | |||||
isLenStrOrNull: function (obj, n) {//验证是否小于等于n位数的字符串 nchar或者null,空 | |||||
var res = { code: true, msg: '' }; | |||||
obj = $.trim(obj); | |||||
if (learun.validator.isNotNull(obj).code && obj.length > n) { | |||||
res.code = false; | |||||
res.msg = '必须小于等于' + n + '位字符或空'; | |||||
} | |||||
return res; | |||||
} | |||||
}; | |||||
})(window.jQuery, top.learun); |
@@ -1,100 +0,0 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:陈彬彬 | |||||
* 日 期:2017.03.16 | |||||
* 描 述:表单数据验证完整性 | |||||
*/ | |||||
(function ($, learun) { | |||||
"use strict"; | |||||
$.lrValidformMessage = function ($this, errormsg) { | |||||
/*错误处理*/ | |||||
$this.addClass('lr-field-error'); | |||||
$this.parent().append('<div class="lr-field-error-info" title="' + errormsg + '!"><i class="fa fa-info-circle"></i></div>'); | |||||
var validatemsg = $this.parent().find('.form-item-title').text() + ' ' + errormsg; | |||||
learun.alert.error('表单信息输入有误,请检查!</br>' + validatemsg); | |||||
if ($this.attr('type') == 'lrselect') { | |||||
$this.on('change', function () { | |||||
removeErrorMessage($(this)); | |||||
}) | |||||
} | |||||
else if ($this.attr('type') == 'formselect') { | |||||
$this.on('change', function () { | |||||
removeErrorMessage($(this)); | |||||
}); | |||||
} | |||||
else if ($this.hasClass('lr-input-wdatepicker')) { | |||||
$this.on('change', function () { | |||||
var $input = $(this); | |||||
if ($input.val()) { | |||||
removeErrorMessage($input); | |||||
} | |||||
}); | |||||
} | |||||
else { | |||||
$this.on('input propertychange', function () { | |||||
var $input = $(this); | |||||
if ($input.val()) { | |||||
removeErrorMessage($input); | |||||
} | |||||
}); | |||||
} | |||||
}; | |||||
$.fn.lrRemoveValidMessage = function () { | |||||
removeErrorMessage($(this)); | |||||
} | |||||
$.fn.lrValidform = function () { | |||||
var validateflag = true; | |||||
var validHelper = learun.validator; | |||||
var formdata = $(this).lrGetFormData(); | |||||
$(this).find("[isvalid=yes]").each(function () { | |||||
var $this = $(this); | |||||
if ($this.parent().find('.lr-field-error-info').length > 0) { | |||||
validateflag = false; | |||||
return true; | |||||
} | |||||
var checkexpession = $(this).attr("checkexpession"); | |||||
var checkfn = validHelper['is' + checkexpession]; | |||||
if (!checkexpession || !checkfn) { return false; } | |||||
var errormsg = $(this).attr("errormsg") || ""; | |||||
var id = $this.attr('id'); | |||||
var value = formdata[id]; | |||||
//var type = $this.attr('type'); | |||||
//if (type == 'lrselect') { | |||||
// value = $this.lrselectGet(); | |||||
//} | |||||
//else if (type == 'formselect') { | |||||
// value = $this.lrformselectGet(); | |||||
//} | |||||
//else { | |||||
// value = $this.val(); | |||||
//} | |||||
var r = { code: true, msg: '' }; | |||||
if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') { | |||||
var len = $this.attr("length"); | |||||
r = checkfn(value, len); | |||||
} else { | |||||
r = checkfn(value); | |||||
} | |||||
if (!r.code) { | |||||
validateflag = false; | |||||
$.lrValidformMessage($this, errormsg + r.msg); | |||||
} | |||||
}); | |||||
return validateflag; | |||||
} | |||||
function removeErrorMessage($obj) { | |||||
$obj.removeClass('lr-field-error'); | |||||
$obj.parent().find('.lr-field-error-info').remove(); | |||||
} | |||||
})(window.jQuery, top.learun); |
@@ -90,6 +90,7 @@ | |||||
"/Views/LR_Content/plugin/wizard/wizard.js", | "/Views/LR_Content/plugin/wizard/wizard.js", | ||||
"/Views/LR_Content/plugin/layerselect/lr-layerselect.js", | "/Views/LR_Content/plugin/layerselect/lr-layerselect.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timeline.js", | "/Views/LR_Content/plugin/timeline/lr-timeline.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timelineEsc.js", | |||||
"/Views/LR_Content/plugin/formselect/lr-formselect.js", | "/Views/LR_Content/plugin/formselect/lr-formselect.js", | ||||
"/Views/LR_Content/plugin/uploader/lr-uploader.js", | "/Views/LR_Content/plugin/uploader/lr-uploader.js", | ||||
"/Views/LR_Content/plugin/date/lr-datepicker.js", | "/Views/LR_Content/plugin/date/lr-datepicker.js", | ||||
@@ -63,6 +63,7 @@ | |||||
"/Views/LR_Content/plugin/select/lr-select.js", | "/Views/LR_Content/plugin/select/lr-select.js", | ||||
"/Views/LR_Content/plugin/layerselect/lr-layerselect.js", | "/Views/LR_Content/plugin/layerselect/lr-layerselect.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timeline.js", | "/Views/LR_Content/plugin/timeline/lr-timeline.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timelineEsc.js", | |||||
"/Views/LR_Content/plugin/formselect/lr-formselect.js", | "/Views/LR_Content/plugin/formselect/lr-formselect.js", | ||||
"/Views/LR_Content/plugin/inputsearch/lr-isearch.js", | "/Views/LR_Content/plugin/inputsearch/lr-isearch.js", | ||||
"/Views/LR_Content/plugin/uploader/lr-uploader.js", | "/Views/LR_Content/plugin/uploader/lr-uploader.js", | ||||
@@ -62,6 +62,7 @@ | |||||
"/Views/LR_Content/plugin/tree/lr-tree.js", | "/Views/LR_Content/plugin/tree/lr-tree.js", | ||||
"/Views/LR_Content/plugin/select/lr-select.js", | "/Views/LR_Content/plugin/select/lr-select.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timeline.js", | "/Views/LR_Content/plugin/timeline/lr-timeline.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timelineEsc.js", | |||||
"/Views/LR_Content/plugin/formselect/lr-formselect.js", | "/Views/LR_Content/plugin/formselect/lr-formselect.js", | ||||
"/Views/LR_Content/plugin/custmerquery/lr-custmerquery.js", | "/Views/LR_Content/plugin/custmerquery/lr-custmerquery.js", | ||||
"/Views/LR_Content/plugin/date/lr-datepicker.js", | "/Views/LR_Content/plugin/date/lr-datepicker.js", | ||||
@@ -17,8 +17,8 @@ | |||||
"/Views/LR_Content/style/lr-common.css", | "/Views/LR_Content/style/lr-common.css", | ||||
"/Views/LR_Content/plugin/scroll/scroll.css", | "/Views/LR_Content/plugin/scroll/scroll.css", | ||||
"/Views/LR_Content/style/lr-iframe-form.css", | "/Views/LR_Content/style/lr-iframe-form.css", | ||||
"/Views/LR_Content/plugin/wizard/wizard.css", | |||||
"/Views/LR_Content/plugin/wizard/wizard.css", | |||||
"/Views/LR_Content/plugin/tree/lr-tree.css", | "/Views/LR_Content/plugin/tree/lr-tree.css", | ||||
"/Views/LR_Content/plugin/select/lr-select.css", | "/Views/LR_Content/plugin/select/lr-select.css", | ||||
"/Views/LR_Content/plugin/timeline/lr-timeline.css", | "/Views/LR_Content/plugin/timeline/lr-timeline.css", | ||||
@@ -31,6 +31,7 @@ | |||||
<script src="~/Content/jquery/jquery.md5.min.js"></script> | <script src="~/Content/jquery/jquery.md5.min.js"></script> | ||||
<script src="~/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script> | <script src="~/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script> | ||||
<script src="~/Content/datepicker/WdatePicker.js"></script> | <script src="~/Content/datepicker/WdatePicker.js"></script> | ||||
<script src="~/Content/jquery/plugin/jqprint/jQuery.print.js"></script> | |||||
<!--[if lt IE 9]> | <!--[if lt IE 9]> | ||||
<script src="~/Content/bootstrap/html5shiv.min.js"></script> | <script src="~/Content/bootstrap/html5shiv.min.js"></script> | ||||
<script src="~/Content/bootstrap/respond.min.js"></script> | <script src="~/Content/bootstrap/respond.min.js"></script> | ||||
@@ -38,7 +39,7 @@ | |||||
<script> | <script> | ||||
function request(d) { for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) { var b = c[a].split("="); if (b[0] == d) if ("undefined" == unescape(b[1])) break; else return unescape(b[1]) } return "" }; | function request(d) { for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) { var b = c[a].split("="); if (b[0] == d) if ("undefined" == unescape(b[1])) break; else return unescape(b[1]) } return "" }; | ||||
</script> | </script> | ||||
</head> | </head> | ||||
<body class="@Learun.Util.Net.Browser @Learun.Util.WebHelper.GetUITheme()"> | <body class="@Learun.Util.Net.Browser @Learun.Util.WebHelper.GetUITheme()"> | ||||
<div id="lr_form_bg" class="lr-form-bg"> | <div id="lr_form_bg" class="lr-form-bg"> | ||||
@@ -55,6 +56,7 @@ | |||||
"/Views/LR_Content/plugin/tree/lr-tree.js", | "/Views/LR_Content/plugin/tree/lr-tree.js", | ||||
"/Views/LR_Content/plugin/select/lr-select.js", | "/Views/LR_Content/plugin/select/lr-select.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timeline.js", | "/Views/LR_Content/plugin/timeline/lr-timeline.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timelineEsc.js", | |||||
"/Views/LR_Content/plugin/formselect/lr-formselect.js", | "/Views/LR_Content/plugin/formselect/lr-formselect.js", | ||||
"/Views/LR_Content/plugin/inputsearch/lr-isearch.js", | "/Views/LR_Content/plugin/inputsearch/lr-isearch.js", | ||||
"/Views/LR_Content/plugin/workflow/lr-workflow-ui.js", | "/Views/LR_Content/plugin/workflow/lr-workflow-ui.js", | ||||
@@ -33,6 +33,7 @@ | |||||
<script src="~/Content/jquery/jquery-1.10.2.min.js"></script> | <script src="~/Content/jquery/jquery-1.10.2.min.js"></script> | ||||
<script src="~/Content/jquery/jquery.md5.min.js"></script> | <script src="~/Content/jquery/jquery.md5.min.js"></script> | ||||
<script src="~/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script> | <script src="~/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script> | ||||
<script src="~/Content/jquery/plugin/jqprint/jQuery.print.js"></script> | |||||
<script src="~/Content/laydate/laydate.js"></script> | <script src="~/Content/laydate/laydate.js"></script> | ||||
<script src="~/Content/datepicker/WdatePicker.js"></script> | <script src="~/Content/datepicker/WdatePicker.js"></script> | ||||
<!--[if lt IE 9]> | <!--[if lt IE 9]> | ||||
@@ -59,6 +60,7 @@ | |||||
"/Views/LR_Content/plugin/tree/lr-tree.js", | "/Views/LR_Content/plugin/tree/lr-tree.js", | ||||
"/Views/LR_Content/plugin/select/lr-select.js", | "/Views/LR_Content/plugin/select/lr-select.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timeline.js", | "/Views/LR_Content/plugin/timeline/lr-timeline.js", | ||||
"/Views/LR_Content/plugin/timeline/lr-timelineEsc.js", | |||||
"/Views/LR_Content/plugin/formselect/lr-formselect.js", | "/Views/LR_Content/plugin/formselect/lr-formselect.js", | ||||
"/Views/LR_Content/plugin/inputsearch/lr-isearch.js", | "/Views/LR_Content/plugin/inputsearch/lr-isearch.js", | ||||
"/Views/LR_Content/plugin/custmerform/lr-formcomponts.js", | "/Views/LR_Content/plugin/custmerform/lr-formcomponts.js", | ||||
@@ -1,91 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="zh-CN"> | |||||
<head> | |||||
<meta name=”renderer” content=”webkit|ie-comp|ie-stand” /> | |||||
<meta name="viewport" content="width=device-width" /> | |||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge"> | |||||
<meta name="renderer" content="webkit"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |||||
<meta name="keywords" content="快速开发平台,Web快速开发平台,ASP.NET快速开发平台,工作流,快速开发框架,软件可视化开发平台,快速开发 开源,快速开发平台 开源,APP快速开发,敏捷开发框架,快速开发" /> | |||||
<meta name="description" content="力软敏捷开发框架,是一个Web可视化开发平台,是一个集PC快速开发、组织架构、工作流、表单设计、自定义报表、APP快速开发等全方位功能于一体的高效、稳定的快速开发平台。" /> | |||||
<link rel="icon" href="~/favicon.ico"> | |||||
<title>@ViewBag.Title</title> | |||||
<link href="~/Content/pace/pace-theme-loading-bar.css" rel="stylesheet" /> | |||||
<link href="~/Content/font/css/font-awesome.min.css" rel="stylesheet" /> | |||||
<link href="~/Content/font/learunfont/iconfont.css" rel="stylesheet" /> | |||||
<link href="~/Content/bootstrap/bootstrap.min.css" rel="stylesheet" /> | |||||
<link href="~/Content/jquery/plugin/toastr/toastr.css" rel="stylesheet" /> | |||||
@Html.AppendCssFile( | |||||
"/Views/LR_Content/style/lr-common.css", | |||||
"/Views/LR_Content/plugin/scroll/scroll.css", | |||||
"/Views/LR_Content/style/lr-admin.css", | |||||
"/Views/LR_Content/style/lr-layer.css", | |||||
"/Views/LR_Content/plugin/contextmenu/lr-contextmenu.css", | |||||
"/Views/LR_Content/plugin/tree/lr-tree.css", | |||||
"/Views/LR_Content/plugin/select/lr-select.css" | |||||
) | |||||
<script src="~/Content/pace/pace.min.js"></script> | |||||
<script src="~/Content/jquery/jquery-1.10.2.min.js"></script> | |||||
<script src="~/Content/signalr/jquery.signalR-2.2.2.min.js"></script> | |||||
<!--[if lt IE 9]> | |||||
<script src="~/Content/bootstrap/html5shiv.min.js"></script> | |||||
<script src="~/Content/bootstrap/respond.min.js"></script> | |||||
<![endif]--> | |||||
</head> | |||||
<body class="@Learun.Util.Net.Browser @Learun.Util.WebHelper.GetUITheme()"> | |||||
<div class="lr-loadbg" id="lr_loadbg"></div> | |||||
@RenderBody() | |||||
<div class="lr-frame-menu"><div class="lr-frame-menu-wrap" id="lr_frame_menu"></div></div> | |||||
<div class="lr-frame-tabs"> | |||||
<div class="lr-frame-tabs-wrap"> | |||||
<ul id="lr_frame_tabs_ul"></ul> | |||||
</div> | |||||
</div> | |||||
<div class="lr-frame-main" id="lr_frame_main"> | |||||
<img src="~/Content/images/iframebg.png"/> | |||||
</div> | |||||
<script src="~/Content/bootstrap/bootstrap.min.js"></script> | |||||
<script src="~/Content/jquery/plugin/layer/layer.js"></script> | |||||
<script src="~/Content/jquery/plugin/jquery.cookie.min.js"></script> | |||||
<script src="~/Content/jquery/jquery.md5.min.js"></script> | |||||
<script src="~/Content/jquery/plugin/toastr/toastr.min.js"></script> | |||||
<script> | |||||
$.rootUrl = '@Url.Content("~")'.substr(0, '@Url.Content("~")'.length - 1); | |||||
</script> | |||||
@Html.AppendJsFile( | |||||
"/Views/LR_Content/plugin/resize/resize.js", | |||||
"/Views/LR_Content/plugin/mousewheel/mousewheel.js", | |||||
"/Views/LR_Content/script/lr-base.js", | |||||
"/Views/LR_Content/plugin/scroll/scroll.js", | |||||
"/Views/LR_Content/script/lr-tabs.js", | |||||
"/Views/LR_Content/script/lr-date.js", | |||||
"/Views/LR_Content/script/lr-validator-helper.js", | |||||
"/Views/LR_Content/script/lr-layer.js", | |||||
"/Views/LR_Content/script/lr-ajax.js", | |||||
"/Views/LR_Content/script/lr-clientdata.js", | |||||
"/Views/LR_Content/script/lr-language.js", | |||||
"/Views/LR_Content/plugin/tree/lr-tree.js", | |||||
"/Views/LR_Content/plugin/select/lr-select.js", | |||||
"/Views/LR_Content/plugin/workflow/lr-workflow-api.js", | |||||
"/Views/LR_Content/plugin/contextmenu/lr-contextmenu.js", | |||||
"/Views/LR_Content/script/lr-im.js", | |||||
"/Views/LR_Content/script/lr-admin.js" | |||||
) | |||||
</body> | |||||
</html> | |||||
@@ -1,123 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="zh-CN"> | |||||
<head> | |||||
<meta name=”renderer” content=”webkit|ie-comp|ie-stand” /> | |||||
<meta name="viewport" content="width=device-width" /> | |||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |||||
<meta name="renderer" content="webkit"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |||||
<link rel="icon" href="~/favicon.ico"> | |||||
<title>@ViewBag.Title|力软信息|快速开发平台|Learun敏捷开发框架</title> | |||||
<link href="~/Content/pace/pace-theme-minimal.css" rel="stylesheet" /> | |||||
<link href="~/Content/font/css/font-awesome.min.css" rel="stylesheet" /> | |||||
<link href="~/Content/bootstrap/bootstrap.min.css" rel="stylesheet" /> | |||||
<script src="~/Content/pace/pace.min.js"></script> | |||||
<script src="~/Content/jquery/jquery-1.10.2.min.js"></script> | |||||
<script src="~/Content/bootstrap/bootstrap.min.js"></script> | |||||
<script src="~/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script> | |||||
@Html.AppendCssFile( | |||||
"/Views/LR_Content/style/lr-common.css", | |||||
"/Views/LR_Content/plugin/scroll/scroll.css", | |||||
"/Views/LR_Content/style/lr-iframe-index.css", | |||||
"/Views/LR_Content/plugin/layout/lr-layout.css", | |||||
"/Views/LR_Content/plugin/tree/lr-tree.css", | |||||
"/Views/LR_Content/plugin/select/lr-select.css", | |||||
"/Views/LR_Content/plugin/timeline/lr-timeline.css", | |||||
"/Views/LR_Content/plugin/formselect/lr-formselect.css", | |||||
"/Views/LR_Content/plugin/custmerquery/lr-custmerquery.css", | |||||
"/Views/LR_Content/plugin/date/lr-datepicker.css", | |||||
"/Views/LR_Content/plugin/grid/jfgrid.css" | |||||
) | |||||
<script src="~/Content/laydate/laydate.js"></script> | |||||
@*<script src="~/Content/datepicker/WdatePicker.js"></script>*@ | |||||
<!--[if lt IE 9]> | |||||
<script src="~/Content/bootstrap/html5shiv.min.js"></script> | |||||
<script src="~/Content/bootstrap/respond.min.js"></script> | |||||
<![endif]--> | |||||
<script> | |||||
function request(d) { for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) { var b = c[a].split("="); if (b[0] == d) if ("undefined" == unescape(b[1])) break; else return unescape(b[1]) } return "" }; | |||||
</script> | |||||
@Html.SetCurrentUrl() | |||||
</head> | |||||
<body class="@Learun.Util.Net.Browser @Learun.Util.WebHelper.GetUITheme()"> | |||||
@RenderBody() | |||||
@Html.AppendJsFile( | |||||
"/Views/LR_Content/plugin/resize/resize.js", | |||||
"/Views/LR_Content/plugin/mousewheel/mousewheel.js", | |||||
"/Views/LR_Content/plugin/scroll/scroll.js", | |||||
"/Views/LR_Content/plugin/layout/lr-layout.js", | |||||
"/Views/LR_Content/plugin/tree/lr-tree.js", | |||||
"/Views/LR_Content/plugin/select/lr-select.js", | |||||
"/Views/LR_Content/plugin/timeline/lr-timeline.js", | |||||
"/Views/LR_Content/plugin/formselect/lr-formselect.js", | |||||
"/Views/LR_Content/plugin/custmerquery/lr-custmerquery.js", | |||||
"/Views/LR_Content/plugin/date/lr-datepicker.js", | |||||
"/Views/LR_Content/script/lr-validator.js", | |||||
"/Views/LR_Content/script/lr-authorize.js", | |||||
"/Views/LR_Content/script/lr-excel.js", | |||||
"/Views/LR_Content/script/lr-form.js", | |||||
"/Views/LR_Content/plugin/grid/jfgrid.js" | |||||
) | |||||
<script> | |||||
$(function () { | |||||
$('#lr_layout').lrLayout(); | |||||
// 翻译指定标签 | |||||
$('.lrlg').each(function () { | |||||
var $this = $(this); | |||||
top.learun.language.get($this.text(), function (text) { | |||||
$this.text(text); | |||||
}); | |||||
}); | |||||
// 翻译表单标题 | |||||
$('.lr-form-item-title').each(function () { | |||||
var $this = $(this); | |||||
var $font = $this.find('font'); | |||||
$font.remove(); | |||||
top.learun.language.get($this.text(), function (text) { | |||||
if ($font.length > 0) { | |||||
$this.html(text + '<font face="宋体">*</font>'); | |||||
} | |||||
else { | |||||
$this.text(text); | |||||
} | |||||
}); | |||||
}); | |||||
// input placeholder 翻译 | |||||
$('input[placeholder]').each(function () { | |||||
var $this = $(this); | |||||
var _text = $this.attr('placeholder'); | |||||
top.learun.language.get(_text, function (text) { | |||||
$this.attr('placeholder', text); | |||||
}); | |||||
}); | |||||
top.learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/Module/GetAuthorizeButtonColumnList', { url: lrCurrentUrl }, function (data) { | |||||
lrModuleButtonList = data.btns; | |||||
lrModuleColumnList = data.cols; | |||||
lrModule = data.module; | |||||
window.lrModuleForms = data.forms; | |||||
if (!!window.bootstrap) { | |||||
bootstrap(jQuery, top.learun); | |||||
} | |||||
}); | |||||
}); | |||||
</script> | |||||
</body> | |||||
</html> |
@@ -1,799 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "个人中心"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
@Html.AppendCssFile("/Views/UserCenter/Index.css", | |||||
"/Views/UserCenter/user.css") | |||||
<style> | |||||
.lr-layout-center .lr-layout-wrap { | |||||
overflow: auto; | |||||
} | |||||
</style> | |||||
<div id="lr_layout" class="lr-layout lr-layout-left-center"> | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle" style="padding-top:10px;"> | |||||
<div class="lr-layout-body"> | |||||
<ul class="lr-left-list" id="lr_left_list"> | |||||
<li data-value="1">基本信息</li> | |||||
@*<li data-value="2">联系方式</li>*@ | |||||
@*<li data-value="3">我的头像</li>*@ | |||||
<li data-value="4">修改密码</li> | |||||
<li data-value="5">我的日志</li> | |||||
@if (ViewBag.UserType == "学生") | |||||
{ | |||||
<li data-value="6">选修流程</li> | |||||
} | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-wrap-item " id="lr_layout_item1"> | |||||
<div class="title"> | |||||
<div>基本信息</div> | |||||
</div> | |||||
<div class="content" style="padding-top:20px;"> | |||||
@if (ViewBag.UserType == "管理员") | |||||
{ | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">账号</div> | |||||
<input id="F_Account" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">工号</div> | |||||
<input id="F_EnCode" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">姓名</div> | |||||
<input id="F_RealName" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">性别</div> | |||||
<input id="F_Gender" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">公司</div> | |||||
<input id="F_Company" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">部门</div> | |||||
<input id="F_Department" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">岗位</div> | |||||
<input id="Post" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">角色</div> | |||||
<input id="Role" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="lr-form-item"> | |||||
<div class="lr-form-item-title">自我介绍</div> | |||||
<textarea id="F_Description" class="form-control" style="height:100px;" readonly></textarea> | |||||
</div> | |||||
} | |||||
else if (ViewBag.UserType == "学生") | |||||
{ | |||||
<div id="student" class="user_warpper student_warpper"> | |||||
<div class="index_sec index_sec1"> | |||||
@*<div class="userTitle">基本信息</div>*@ | |||||
<!-- / user_sec1 --> | |||||
<div class="user_sec1"> | |||||
<img src="~/Content/images/Login/user5.png" /> | |||||
<div class="userSec1Box"> | |||||
<div class="userSec1L"> | |||||
<div class="userSec1Img"> | |||||
@*<img src="~/Content/images/Login/user3.jpg" />*@ | |||||
<img id="headUrl" /> | |||||
</div> | |||||
<div class="userSec1T">{{studentInfo.StuName}}</div> | |||||
</div> | |||||
<ul class="userSec1R"> | |||||
<li>性 别 : {{studentInfo.GenderNo | sex}}</li> | |||||
<li>出生日期 : {{studentInfo.Birthday | date}}</li> | |||||
<li>联系电话 : {{studentInfo.mobile}}</li> | |||||
<li>校 区 : {{baseInfo.companyId | company}}</li> | |||||
<li>学 号 : {{studentInfo.StuNo}}</li> | |||||
<li>本 专 科 : {{studentInfo.GraduateNo | graduateNo}}</li> | |||||
<li>年 级 : {{studentInfo.Grade}}</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<!-- / user_sec1 --> | |||||
<!-- / user_sec2 --> | |||||
<div class="user_sec2"> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">基本信息 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>民 族 : {{studentInfo.NationalityNo |nationalityNo}}</li> | |||||
<li>政治面貌 : {{studentInfo.PartyFaceNo | partyFaceNo}}</li> | |||||
<li>身份证号 : {{studentInfo.IdentityCardNo}} </li> | |||||
<li>E-mail : {{studentInfo.EMail}}</li> | |||||
<li>户 籍 省 : {{studentInfo.F_ProvinceId | province}} </li> | |||||
<li>户籍地市 : {{studentInfo.F_CityId | city}} </li> | |||||
<li>户籍县区 : {{studentInfo.F_CountyId | area}} </li> | |||||
<li>户籍地址 : {{studentInfo.FatherUnit}}</li> | |||||
</ul> | |||||
</div> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">家庭情况 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>父亲姓名 : {{studentInfo.FatherName}} </li> | |||||
<li>父亲电话 : {{studentInfo.FatherPhone}} </li> | |||||
<li>母亲姓名 : {{studentInfo.MatherName}}</li> | |||||
<li> 母亲电话 : {{studentInfo.MatherPhone}}</li> | |||||
<li>港澳台侨 : {{studentInfo.OverseasChineseNo | overseasChineseNo}} </li> | |||||
<li>健康状况 : {{studentInfo.HealthStatusNo | healthStatusNo}}</li> | |||||
<li>邮政编码 : {{studentInfo.PostalCode}}</li> | |||||
<li>通信地址 : {{studentInfo.MailAddress}}</li> | |||||
</ul> | |||||
</div> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">学籍信息 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>通知书号 : {{studentInfo.NoticeNo}}</li> | |||||
<li> 考 生 号 : {{studentInfo.ksh}}</li> | |||||
<li>系所 : {{studentInfo.DeptNo | deptNo}} </li> | |||||
<li>专 业 : {{studentInfo.MajorNo | majorNo}}</li> | |||||
<li>班 级 : {{studentInfo.ClassNo | class}} </li> | |||||
<li>报到日期 : {{studentInfo.RegisterDate | date}} </li> | |||||
<li>入学年月 : {{studentInfo.EntranceDate | date}}</li> | |||||
<li>入党时间 : {{studentInfo.JoinPartyDate | date}}</li> | |||||
<li>入团时间 : {{studentInfo.JoinLeagueDate | date}} </li> | |||||
<li>档案地址 : {{studentInfo.MatherUnit}}</li> | |||||
</ul> | |||||
</div> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">联系方式 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>校内地址 : {{studentInfo.InSchoolAddress}}</li> | |||||
<li> QQ : {{studentInfo.QQ}}</li> | |||||
<li>校内电话 : {{studentInfo.InSchoolTelephone}}</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<!-- / user_sec2 --> | |||||
</div> | |||||
</div> | |||||
<script> | |||||
var vm = new Vue({ | |||||
el: "#student", | |||||
data: { | |||||
headUrl: "", | |||||
studentInfo: "", | |||||
baseInfo: "" | |||||
}, | |||||
methods: { | |||||
getData: function () { | |||||
$.get('/UserCenter/GetStudentInfo', function (ref) { | |||||
this.studentInfo = ref.data.userInfo; | |||||
this.baseInfo = ref.data.basicInfo; | |||||
console.log(ref); | |||||
}.bind(this), "json"); | |||||
}, | |||||
getUrl: function () { | |||||
var loginInfo = top.learun.clientdata.get(['userinfo']); | |||||
this.headUrl = '/LR_OrganizationModule/User/GetImg?userId=' + loginInfo.userId; | |||||
} | |||||
}, | |||||
created() { | |||||
this.getData(); | |||||
this.getUrl(); | |||||
}, | |||||
filters: { | |||||
sex: function (value) { | |||||
return value ? "男生" : "女生"; | |||||
}, | |||||
company: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', | |||||
key: value, | |||||
keyId: 'f_companyid', | |||||
callback: function (_data) { | |||||
result = _data.f_fullname; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
graduateNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('dataItem', { | |||||
key: value, | |||||
code: 'CollegeType', | |||||
callback: function (_data) { | |||||
result = _data.text; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
date: function (value) { | |||||
var date = new Date(value); | |||||
return date.toLocaleDateString(); | |||||
}, | |||||
nationalityNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdNationality', | |||||
key: value, | |||||
keyId: 'nationalityno', | |||||
callback: function (_data) { | |||||
result = _data['nationality']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
partyFaceNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace', | |||||
key: value, | |||||
keyId: 'partyfaceno', | |||||
callback: function (_data) { | |||||
result = _data['partyface']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
province: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE', | |||||
key: value, | |||||
keyId: 'pcode', | |||||
callback: function (_data) { | |||||
result = _data['pname']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
city: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', | |||||
key: value, | |||||
keyId: 'ccode', | |||||
callback: function (_data) { | |||||
result = _data['cname']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
area: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA', | |||||
key: value, | |||||
keyId: 'acode', | |||||
callback: function (_data) { | |||||
result = _data['aname']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
overseasChineseNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdOverseasChinese', | |||||
key: value, | |||||
keyId: 'overseaschineseno', | |||||
callback: function (_data) { | |||||
result = _data.overseaschinesename; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
healthStatusNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdHealthStatus', | |||||
key: value, | |||||
keyId: 'healthstatusno', | |||||
callback: function (_data) { | |||||
result = _data.healthstatus; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
deptNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||||
key: value, | |||||
keyId: 'deptno', | |||||
callback: function (_data) { | |||||
result = _data.deptname; | |||||
}.bind(this) | |||||
}); | |||||
return result; | |||||
}, | |||||
majorNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||||
key: value, | |||||
keyId: 'majorno', | |||||
callback: function (_data) { | |||||
result = _data.majorname; | |||||
}.bind(this) | |||||
}); | |||||
return result; | |||||
}, | |||||
class: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||||
key: value, | |||||
keyId: 'classno', | |||||
callback: function (_data) { | |||||
result = _data['classname']; | |||||
} | |||||
}); | |||||
return result; | |||||
} | |||||
} | |||||
}) | |||||
</script> | |||||
} | |||||
else if (ViewBag.UserType == "教师") | |||||
{ | |||||
<div id="teacher" class="user_warpper student_warpper"> | |||||
<div class="index_sec index_sec1"> | |||||
@*<div class="userTitle">基本信息</div>*@ | |||||
<!-- / user_sec1 --> | |||||
<div class="user_sec1"> | |||||
<img src="~/Content/images/Login/user4.png" /> | |||||
<div class="userSec1Box"> | |||||
<div class="userSec1L"> | |||||
<div class="userSec1Img"> | |||||
@*<img src="~/Content/images/Login/user3.jpg" />*@ | |||||
<img id="headUrl" /> | |||||
</div> | |||||
<div class="userSec1T">{{teacherInfo.EmpName}}</div> | |||||
</div> | |||||
<ul class="userSec1R"> | |||||
<li>职 工 号 :{{teacherInfo.EmpNo}} </li> | |||||
<li>性 别 : {{teacherInfo.GenderNo | sex}}</li> | |||||
<li>出生日期 : {{teacherInfo.Birthday | date}}</li> | |||||
<li>联系电话 : {{teacherInfo.mobile}}</li> | |||||
<li>校 区 : {{baseInfo.companyId | company}}</li> | |||||
<li>教职工类别 : {{teacherInfo.EmpSortNo | empSortNo}}</li> | |||||
<li>聘任职称 : {{teacherInfo.TitleOfTechPostNo | titleOfTechPostNo}}</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<!-- / user_sec1 --> | |||||
<!-- / user_sec2 --> | |||||
<div class="user_sec2"> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">基本信息 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>民 族 : {{teacherInfo.NationalityNo | nationalityNo}}</li> | |||||
<li>政治面貌 : {{teacherInfo.PartyFaceNo | partyFaceNo}}</li> | |||||
<li>身份证号 : {{teacherInfo.IdentityCardNo}} </li> | |||||
<li>E-mail : {{teacherInfo.EMail}}</li> | |||||
<li>档案所在地 : {{teacherInfo.LocusOfArchives}} </li> | |||||
<li>户口所在地 : {{teacherInfo.LocusOfResidence}} </li> | |||||
</ul> | |||||
</div> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">家庭情况 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>港澳台侨 : {{teacherInfo.OverseasChineseNo | overseasChineseNo}} </li> | |||||
<li>健康状况 : {{teacherInfo.HealthStatusNo | healthStatusNo}}</li> | |||||
<li>家庭出身 : {{teacherInfo.FamilyOriginNo | familyOriginNo}} </li> | |||||
<li>外语语种 : {{teacherInfo.ForeignLanguageNo | foreignLanguageNo}} </li> | |||||
<li>户籍省份 : {{teacherInfo.ProvinceNo | provinceNo}} </li> | |||||
<li>户籍地市 : {{teacherInfo.CityNo | cityNo}} </li> | |||||
<li>户籍县区 : {{teacherInfo.RegionNo | regionNo}} </li> | |||||
</ul> | |||||
</div> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">其他 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>学科门 : {{teacherInfo.SubjectSpeciesNo | subjectSpeciesNo}}</li> | |||||
<li>现任职务: {{teacherInfo.Title}}</li> | |||||
<li>所在系部 : {{teacherInfo.DeptNo | deptNo}} </li> | |||||
<li>文化程度 : {{teacherInfo.CultureDegreeNo | cultureDegreeNo}} </li> | |||||
<li>毕业学校 : {{teacherInfo.GraduateSchoolName}} </li> | |||||
<li>最高学位 : {{teacherInfo.DegreeNo | degreeNo}}</li> | |||||
<li>来校年月 : {{teacherInfo.InSchoolDate | date}}</li> | |||||
</ul> | |||||
</div> | |||||
<div class="userSec2Box"> | |||||
<div class="userSec2T">联系方式 <i class="fa fa-angle-right"></i></div> | |||||
<ul class="userSec2List"> | |||||
<li>紧急联系人 : {{teacherInfo.Linkman}}</li> | |||||
<li>紧急联系人电话 : {{teacherInfo.PhoneOfLinkman}}</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<!-- / user_sec2 --> | |||||
</div> | |||||
</div> | |||||
<script> | |||||
new Vue({ | |||||
el: "#teacher", | |||||
data: { | |||||
headUrl: "", | |||||
baseInfo: "", | |||||
teacherInfo: "", | |||||
}, | |||||
methods: { | |||||
getData: function () { | |||||
$.get('/UserCenter/GetTeacherInfo', function (ref) { | |||||
this.teacherInfo = ref.data.userInfo; | |||||
this.baseInfo = ref.data.basecInfo; | |||||
console.log(ref); | |||||
}.bind(this), "json"); | |||||
}, | |||||
getUrl: function () { | |||||
} | |||||
}, | |||||
created() { | |||||
this.getData(); | |||||
this.getUrl(); | |||||
}, | |||||
filters: { | |||||
sex: function (value) { | |||||
return value ? "男" : "女"; | |||||
}, | |||||
date: function (value) { | |||||
var date = new Date(value); | |||||
return date.toLocaleDateString(); | |||||
}, | |||||
company: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', | |||||
key: value, | |||||
keyId: 'f_companyid', | |||||
callback: function (_data) { | |||||
result = _data.f_fullname; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
nationalityNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdNationality', | |||||
key: value, | |||||
keyId: 'nationalityno', | |||||
callback: function (_data) { | |||||
result = _data['nationality']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
partyFaceNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace', | |||||
key: value, | |||||
keyId: 'partyfaceno', | |||||
callback: function (_data) { | |||||
result = _data['partyface']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
overseasChineseNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdOverseasChinese', | |||||
key: value, | |||||
keyId: 'overseaschineseno', | |||||
callback: function (_data) { | |||||
result = _data.overseaschinesename; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
healthStatusNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdHealthStatus', | |||||
key: value, | |||||
keyId: 'healthstatusno', | |||||
callback: function (_data) { | |||||
result = _data.healthstatus; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
deptNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||||
key: value, | |||||
keyId: 'deptno', | |||||
callback: function (_data) { | |||||
result = _data.deptname; | |||||
}.bind(this) | |||||
}); | |||||
return result; | |||||
}, | |||||
subjectSpeciesNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdSubjectSpecies', | |||||
key: value, | |||||
keyId: 'subjectspeciesno', | |||||
callback: function (_data) { | |||||
result = _data.subjectspecies; | |||||
}.bind(this) | |||||
}); | |||||
return result; | |||||
}, | |||||
familyOriginNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdFamilyOrigin', | |||||
key: value, | |||||
keyId: 'familyoriginno', | |||||
callback: function (_data) { | |||||
result = _data.familyorigin; | |||||
}.bind(this) | |||||
}); | |||||
return result; | |||||
}, | |||||
foreignLanguageNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdForeignLanguage', | |||||
key: value, | |||||
keyId: 'foreignlanguageno', | |||||
callback: function (_data) { | |||||
result = _data.foreignlanguagename; | |||||
}.bind(this) | |||||
}); | |||||
return result; | |||||
}, | |||||
provinceNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE', | |||||
key: value, | |||||
keyId: 'pcode', | |||||
callback: function (_data) { | |||||
result = _data['pname']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
cityNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', | |||||
key: value, | |||||
keyId: 'ccode', | |||||
callback: function (_data) { | |||||
result = _data['cname']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
regionNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA', | |||||
key: value, | |||||
keyId: 'acode', | |||||
callback: function (_data) { | |||||
result = _data['aname']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
cultureDegreeNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdCultureDegree', | |||||
key: value, | |||||
keyId: 'culturedegreeno', | |||||
callback: function (_data) { | |||||
result = _data['culturedegree']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
degreeNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdDegree', | |||||
key: value, | |||||
keyId: 'degreeno', | |||||
callback: function (_data) { | |||||
result = _data['degreename']; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
empSortNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('dataItem', { | |||||
key: value, | |||||
code: 'EmpSort', | |||||
callback: function (_data) { | |||||
result = _data.text; | |||||
} | |||||
}); | |||||
return result; | |||||
}, | |||||
titleOfTechPostNo: function (value) { | |||||
var result; | |||||
top.learun.clientdata.getAsync('custmerData', { | |||||
sync: true, | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdTitleOfTechPost', | |||||
key: value, | |||||
keyId: 'titleoftechpostno', | |||||
callback: function (_data) { | |||||
result = _data['titleoftechpost']; | |||||
} | |||||
}); | |||||
return result; | |||||
} | |||||
} | |||||
}) | |||||
</script> | |||||
} | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-wrap-item" id="lr_layout_item2"> | |||||
<div class="title"> | |||||
<div>联系方式</div> | |||||
</div> | |||||
<div class="content" style="padding-top:20px;"> | |||||
<iframe class="lr-layout-iframe" frameborder="0" src="~/UserCenter/ContactForm"></iframe> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-wrap-item" id="lr_layout_item3"> | |||||
<div class="title"> | |||||
<div>我的头像</div> | |||||
</div> | |||||
<div class="content" style="padding-top:20px;"> | |||||
<iframe class="lr-layout-iframe" frameborder="0" src="~/UserCenter/HeadForm"></iframe> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-wrap-item" id="lr_layout_item4"> | |||||
<div class="title"> | |||||
<div>修改密码</div> | |||||
</div> | |||||
<div class="content" style="padding-top:20px;"> | |||||
<iframe class="lr-layout-iframe" frameborder="0" src="~/UserCenter/PassWordForm"></iframe> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-wrap-item" id="lr_layout_item5" style="padding:0;"> | |||||
<iframe class="lr-layout-iframe" frameborder="0" src="~/UserCenter/LogIndex"></iframe> | |||||
</div> | |||||
@if (ViewBag.UserType == "学生") | |||||
{ | |||||
<div class="lr-layout-wrap-item " id="lr_layout_item6" style="padding: 10;"> | |||||
<center><h3> 西昌民族幼儿师范高等专科学校</h3></center> | |||||
<center> | |||||
<h3> | |||||
选修课选课流程 | |||||
</h3> | |||||
</center> | |||||
<div style="font-size:14px"> | |||||
<p> | |||||
亲爱的同学: | |||||
选修课选课流程如下: | |||||
</p> | |||||
<p> | |||||
点击左侧 <b style="color: red;">学子在线</b> 选择 <b style="color: red;">选课中心</b> 选择 <b style="color: red;">选修课选课</b> 可以查看到所有选修课课程信息,点击课程名称和教师名称可以查看到当前课程简介和教师简介,选中课程点击右上角的 <b style="color: red;">报名</b> 按钮,可以进行选课报名,选中已报名课程点击右上角 <b style="color: red;">取消报名</b> 可以取消当前课程的报名状态。 | |||||
</p> | |||||
<p> | |||||
点击左侧 <b style="color: red;">学子在线</b> 选择 <b style="color: red;">选课中心</b> 选择 <b style="color: red;">我的选修课</b> 可以查看到自己报名成功的选修课课程。 | |||||
</p> | |||||
<p> | |||||
注:1、如果老师已经审核通过的课程不能进行取消报名操作。<br /> | |||||
2、每个学生有且只能选择一门选修课进行报名。<br /> | |||||
3、选择课只开放三天,三天后自动关闭选课功能,每门选修课记2个选修学分,如果修不够选修学分将会无法毕业。<br /> | |||||
</p> | |||||
</div> | |||||
</div> | |||||
} | |||||
@if (ViewBag.UserType == "学生" || ViewBag.UserType == "教师") | |||||
{ | |||||
<div class="lr-layout-tool-right"> | |||||
<div class="btn-group btn-group-sm"> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
</div> | |||||
</div> | |||||
} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<script> | |||||
$(function () { | |||||
var loginInfo = top.learun.clientdata.get(['userinfo']); | |||||
$("#headUrl").attr("src", "/LR_OrganizationModule/User/GetImg?userId=" + loginInfo.userId); | |||||
if ('@ViewBag.UserType' == '学生') { | |||||
$("#lr_left_list").children('li').eq(4).addClass("active"); | |||||
$('.lr-layout-wrap-item').eq(5).addClass("active"); | |||||
} else { | |||||
$("#lr_left_list").children('li').eq(0).addClass("active"); | |||||
$('.lr-layout-wrap-item').eq(0).addClass("active"); | |||||
} | |||||
}) | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
if ('@ViewBag.UserType' == '学生') { | |||||
top.learun.layerFormForPercent({ | |||||
id: 'form', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Form?keyValue=@ViewBag.UserID&&isStudent=1', | |||||
width: "90%", | |||||
height: "90%", | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
else if ('@ViewBag.UserType' == '教师') { | |||||
top.learun.layerFormForPercent({ | |||||
id: 'form', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form?keyValue=@ViewBag.UserID&&isTeacher=1', | |||||
width: "90%", | |||||
height: "90%", | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
</script> | |||||
@Html.AppendJsFile("/Views/UserCenter/Index.js") |
@@ -1,7 +0,0 @@ | |||||
@{ | |||||
ViewBag.Title = "表单预览"; | |||||
Layout = "~/Views/Shared/_CustmerFormPreview.cshtml"; | |||||
} | |||||
@Html.AppendJsFile("/Views/Utility/PreviewForm.js") | |||||