diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js
index a391d4f2a..0bf789c22 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js
@@ -55,7 +55,7 @@ var bootstrap = function ($, learun) {
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/DeleteForm', { keyValue: keyValue}, function () {
+ learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
@@ -66,34 +66,74 @@ var bootstrap = function ($, learun) {
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
+ //发布
+ $('#lr_publish').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('StudyID');
+ var GuideState = $('#gridtable').jfGridValue('GuideState');
+ if (learun.checkrow(keyValue)) {
+ if (GuideState.indexOf('0') != -1) {
+ return learun.alert.warning('选中记录包含已发布的记录!');
+ }
+ learun.layerConfirm('是否确认发布选中记录!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/Publish', { keyValue: keyValue, GuideState: 0 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ //取消发布
+ $('#lr_nopublish').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('StudyID');
+ var GuideState = $('#gridtable').jfGridValue('GuideState');
+ if (learun.checkrow(keyValue)) {
+ if (GuideState.indexOf('1') != -1) {
+ return learun.alert.warning('选中记录包含未发布的记录!');
+ }
+ learun.layerConfirm('是否确认发布选中记录!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/Publish', { keyValue: keyValue, GuideState: 1 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/PersonnelManagement/StudyGuide/GetPageList',
headData: [
- { label: "标题", name: "StudyName", width: 100, align: "left"},
- { label: "创建用户", name: "GuideName", width: 100, align: "left"},
- { label: "添加时间", name: "Guidetime", width: 100, align: "left"},
- { label: "是否发布", name: "GuideState", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op,$cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'YesOrNoInt',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }},
+ { label: "标题", name: "StudyName", width: 100, align: "left" },
+ { label: "创建用户", name: "CreateUserName", width: 100, align: "left" },
+ {
+ label: "添加时间", name: "CreateTime", width: 100, align: "left",
+ formatter: function (value) {
+ return learun.formatDate(value, 'yyyy-MM-dd');
+ }
+ },
+ {
+ label: "发布状态", name: "GuideState", width: 100, align: "left",
+ formatter: function (cellvalue, row) {
+ if (cellvalue == 0) {
+ return '
发布';
+ } else if (cellvalue == 1) {
+ return '
暂未发布';
+ }
+ }
+ },
],
- mainId:'StudyID',
- isPage: true
+ mainId: 'StudyID',
+ isPage: true,
+ isMultiselect: true,
});
page.search();
},
search: function (param) {
param = param || {};
- $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
+ $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js
index 712f454ab..2295edbc5 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js
@@ -24,7 +24,7 @@ $(document).ready(function () {
var keyword = $('#headSearchInput').val();
if ($.trim(keyword) != "") {
$.each($('.search').find('.searchLi'), function (i, item) {
- if ($(item).children('.searchLiTxt').html().indexOf(keyword) != -1) {
+ if ($(item).find('.searchLiTxt').html().indexOf(keyword) != -1) {
$(item).show();
} else {
$(item).hide();
@@ -77,12 +77,85 @@ $(document).ready(function () {
}
}
});
- }).on('click', '.inSec1List2 .fa', function () {
+ }).on('click', '#flowList .fa', function () {//可用应用
//是否收藏
+ var modelCode = $('#ModelCode').val();
+ var userId = $('#UserId').val();
+ var Id = $(this).parent('li').attr('data-Id');
+ var isCollect = true;
+ var tipMsg = "";
if ($(this).hasClass('fa-heart')) {
- $(this).removeClass('fa-heart').addClass('fa-heart-o');
+ //ajax取消收藏操作
+ isCollect = false;
+ tipMsg = "取消收藏成功!";
} else {
- $(this).removeClass('fa-heart-o').addClass('fa-heart');
+ //ajax收藏操作
+ isCollect = true;
+ tipMsg = "收藏成功!";
+ }
+ if (userId != "" && userId != undefined && modelCode != "" && modelCode != undefined && Id != "" && Id != undefined) {
+ $.ajax({
+ url: "/SSOSystem/DoCollectFlow",
+ headers: { __RequestVerificationToken: $.lrToken },
+ data: { userId: userId, modelCode: modelCode, id: Id, isCollect: isCollect },
+ type: "post",
+ dataType: "json",
+ success: function (res) {
+ if (res.code == 200) {
+ //操作成功执行代码
+ layer.msg(tipMsg);
+ //刷新可用应用列表
+ flowListJson = res.data.flowList;
+ $("#flowTypeList").find("li.active .itemName").trigger("click");
+ //刷新我的收藏列表
+ flowListOfCollectJson = res.data.flowListOfCollect;
+ updateCollectCount(flowListOfCollectJson);
+ $("#flowTypeListOfCollect").find("li.active .itemName").trigger("click");
+ }
+ else if (res.code == 400) {
+ layer.msg(res.info);
+ }
+ else if (res.code == 500) {
+ layer.msg('服务端异常,请联系管理员');
+ }
+ }
+ });
+ }
+ }).on('click', '#flowListOfCollect .fa', function () {//我的收藏
+ //是否收藏
+ var modelCode = $('#ModelCode').val();
+ var userId = $('#UserId').val();
+ var Id = $(this).parent('li').attr('data-Id');
+ if ($(this).hasClass('fa-heart')) {
+ //ajax取消收藏操作
+ if (userId != "" && userId != undefined && modelCode != "" && modelCode != undefined && Id != "" && Id != undefined) {
+ $.ajax({
+ url: "/SSOSystem/DoCollectFlow",
+ headers: { __RequestVerificationToken: $.lrToken },
+ data: { userId: userId, modelCode: modelCode, id: Id, isCollect: false },
+ type: "post",
+ dataType: "json",
+ success: function (res) {
+ if (res.code == 200) {
+ //操作成功执行代码
+ layer.msg('取消收藏成功!');
+ //刷新我的收藏列表
+ flowListOfCollectJson = res.data.flowListOfCollect;
+ updateCollectCount(flowListOfCollectJson);
+ $("#flowTypeListOfCollect").find("li.active .itemName").trigger("click");
+ //刷新可用应用列表
+ flowListJson = res.data.flowList;
+ $("#flowTypeList").find("li.active .itemName").trigger("click");
+ }
+ else if (res.code == 400) {
+ layer.msg(res.info);
+ }
+ else if (res.code == 500) {
+ layer.msg('服务端异常,请联系管理员');
+ }
+ }
+ });
+ }
}
});
//登录
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs
index e6dd2a1b3..cefa58f67 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs
@@ -56,6 +56,7 @@ namespace Learun.Application.Web.Controllers
private TeachSwitchIBLL teachSwitchIBLL = new TeachSwitchBLL();
private StuSaverecordIBLL stuSaverecordIBLL = new StuSaverecordBLL();
private StuConsumptionIBLL stuConsumptionIBLL = new StuConsumptionBLL();
+ private SSO_Drag_CollectManageIBLL sSO_Drag_CollectManageIBLL = new SSO_Drag_CollectManageBLL();
#region 统一身份认证2.0
///
@@ -1190,18 +1191,34 @@ namespace Learun.Application.Web.Controllers
ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
//流程
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
- var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
+ var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList().OrderBy(x => x.F_Id);
+ var flowListOfCollect = sSO_Drag_CollectManageIBLL.GetList("{\"UserId\":\"" + userInfo.userId + "\",\"ModelCode\":\"one\"}").OrderBy(x => x.SchemeInfoId);
+ foreach (var item in flowList)
+ {
+ item.IsCollect = false;
+ if (flowListOfCollect.Where(x => x.SchemeInfoId == item.F_Id).Any())
+ {
+ item.IsCollect = true;
+ }
+ }
var allCount = 0;
+ var allCountOfCollect = 0;
foreach (var flow in flowType)
{
- var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
+ var count = flowList.Count(a => a.F_Category == flow.F_ItemValue);
flow.FlowCount = count;
allCount += count;
+ var countOfCollect = flowListOfCollect.Count(x => x.F_Category == flow.F_ItemValue);
+ flow.FlowCountOfCollect = countOfCollect;
+ allCountOfCollect += countOfCollect;
}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
+ //流程-收藏
+ ViewBag.AllCountOfCollect = allCountOfCollect;
+ ViewBag.FlowListOfCollect = JsonConvert.SerializeObject(flowListOfCollect);
//校园一卡通余额
ViewBag.StuSaveRecordTotalNum = 0;
var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
@@ -1471,15 +1488,6 @@ namespace Learun.Application.Web.Controllers
}).ToList();
ViewBag.OffenusedGroup = mm;
ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
- //todo:
- //删begin
- ViewBag.OffenusedJiao = modulelist.Where(x => x.F_FullName.Contains("教"));
- ViewBag.OffenusedGuan = modulelist.Where(x => x.F_FullName.Contains("管理"));
- ViewBag.Offenused = modulelist.Except(modulelist.Where(x => x.F_FullName.Contains("教") || x.F_FullName.Contains("管理"))).Take(6);
- ViewBag.OffenusedJiaoStr = JsonConvert.SerializeObject(ViewBag.OffenusedJiao);
- ViewBag.OffenusedGuanStr = JsonConvert.SerializeObject(ViewBag.OffenusedGuan);
- ViewBag.OffenusedStr = JsonConvert.SerializeObject(ViewBag.Offenused);
- //删end
//查找服务
List searchmodulelist = new List();
foreach (var item in moduledata)
@@ -1520,18 +1528,34 @@ namespace Learun.Application.Web.Controllers
ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
//流程
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
- var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
+ var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList().OrderBy(x => x.F_Id);
+ var flowListOfCollect = sSO_Drag_CollectManageIBLL.GetList("{\"UserId\":\"" + userInfo.userId + "\",\"ModelCode\":\"two\"}").OrderBy(x => x.SchemeInfoId);
+ foreach (var item in flowList)
+ {
+ item.IsCollect = false;
+ if (flowListOfCollect.Where(x => x.SchemeInfoId == item.F_Id).Any())
+ {
+ item.IsCollect = true;
+ }
+ }
var allCount = 0;
+ var allCountOfCollect = 0;
foreach (var flow in flowType)
{
- var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
+ var count = flowList.Count(a => a.F_Category == flow.F_ItemValue);
flow.FlowCount = count;
allCount += count;
+ var countOfCollect = flowListOfCollect.Count(x => x.F_Category == flow.F_ItemValue);
+ flow.FlowCountOfCollect = countOfCollect;
+ allCountOfCollect += countOfCollect;
}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
+ //流程-收藏
+ ViewBag.AllCountOfCollect = allCountOfCollect;
+ ViewBag.FlowListOfCollect = JsonConvert.SerializeObject(flowListOfCollect);
//校园一卡通余额
ViewBag.StuSaveRecordTotalNum = 0;
var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
@@ -1815,5 +1839,38 @@ namespace Learun.Application.Web.Controllers
return Success("操作成功");
}
+ ///
+ /// 网上办事大厅拖拽版-收藏应用
+ ///
+ ///
+ ///
+ ///
+ /// true:收藏,false:取消收藏
+ ///
+ public ActionResult DoCollectFlow(string userId, string modelCode, string id, bool isCollect)
+ {
+ sSO_Drag_CollectManageIBLL.DoCollectFlow(userId, modelCode, id, isCollect);
+
+ //可用应用列表数据
+ var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList().OrderBy(x => x.F_Id);
+ //我的收藏列表数据
+ var flowListOfCollect = sSO_Drag_CollectManageIBLL.GetList("{\"UserId\":\"" + userId + "\",\"ModelCode\":\"" + modelCode + "\"}").OrderBy(x => x.SchemeInfoId);
+ foreach (var item in flowList)
+ {
+ item.IsCollect = false;
+ if (flowListOfCollect.Where(x => x.SchemeInfoId == item.F_Id).Any())
+ {
+ item.IsCollect = true;
+ }
+ }
+ var data = new
+ {
+ flowList = flowList,
+ flowListOfCollect = flowListOfCollect
+ };
+
+ return Success("操作成功", data);
+ }
+
}
}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
index 790a76bc8..898a4c094 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
@@ -315,6 +315,7 @@
+
@@ -805,6 +806,11 @@
+
+
+
+
+
@@ -1387,8 +1393,12 @@
+
+
+
+
@@ -6374,6 +6384,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -7175,11 +7205,17 @@
+
+
+
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml
index c955538ce..fe76349bb 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml
@@ -308,7 +308,7 @@
html += '