You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

330 lines
11 KiB

  1. $(function() {
  2. var f = {};
  3. var d = {};
  4. function e(i) {
  5. top.learun.httpSync('get', top.$.rootUrl + '/LR_Desktop/DTTitle/GetID', '{}', function(res) {
  6. var background = res.Background;
  7. var color = res.Color;
  8. if(background){
  9. $("#TitleColor").css({background: background, color: color, borderColor: 'transparent'})
  10. }
  11. })
  12. if(i.length > 0) {
  13. $("#lr_target").lrscroll();
  14. var j = 210;
  15. var h = 0;
  16. var k = $("#lr_target").width() - 10;
  17. var j = k / i.length;
  18. if(j < 210) {
  19. j = 210
  20. }
  21. h = j * i.length;
  22. var g = $("#lr_target .lr-scroll-box");
  23. g.css("width", h);
  24. $.each(i,
  25. function(m, n) {
  26. f[n.F_Id] = n;
  27. var l = ' <div class="lr-item-20"> <div class="task-stat" > <div class="visual"> <i class="' + n.F_Icon + '"></i> </div> <div class="details"> <div class="number" data-value="' + n.F_Id + '"></div> <div class="desc">' + n.F_Name + "</div> </div>";
  28. if(n.F_Url) {
  29. l += '<a class="more" data-Id="' + n.F_Id + '" > 查看更多 <i class="fa fa-arrow-circle-right"></i> </a>'
  30. }
  31. l += "</div> </div>";
  32. g.append(l);
  33. top.learun.httpAsync("GET", top.$.rootUrl + "/LR_Desktop/DTTarget/GetSqlData", {
  34. Id: n.F_Id
  35. },
  36. function(o) {
  37. if(o) {
  38. g.find('[data-value="' + o.Id + '"]').text(o.value)
  39. }
  40. })
  41. });
  42. g.find(".lr-item-20 .more").on("click",
  43. function() {
  44. var l = $(this).attr("data-Id");
  45. top.learun.frameTab.open({
  46. F_ModuleId: l,
  47. F_FullName: f[l].F_Name,
  48. F_UrlAddress: f[l].F_Url
  49. });
  50. return false
  51. });
  52. g.find(".lr-item-20").css("width", j);
  53. $("#lr_target").resize(function() {
  54. var m = $("#lr_target").width() - 10;
  55. var l = m / i.length;
  56. if(l < 210) {
  57. l = 210
  58. }
  59. h = l * i.length;
  60. g.css("width", h);
  61. g.find(".lr-item-20").css("width", l)
  62. })
  63. }
  64. }
  65. function c(h) {
  66. if(h.length > 0) {
  67. var g = $(".lr-desktop-panel>.lr-scroll-box");
  68. $.each(h,
  69. function(j, k) {
  70. d[k.F_Id] = k;
  71. var stylex = k.Background? 'background:' + k.Background + ';color:' + k.Color + ';border-color:transparent' : '';
  72. var i = '<div class="col-xs-6" data-Id="' + k.F_Id + '"> <div style="'+ stylex +'" class="portal-panel-title "><i class="' + k.F_Icon + '"></i>&nbsp;&nbsp;' + k.F_Name + '<span class="menu" title="更多"> <span style="border:1px solid ' + k.Color + '" class="point"></span><span style="border:1px solid ' + k.Color + '" class="point"></span><span style="border:1px solid ' + k.Color + '" class="point"></span> </span> </div> <div class="portal-panel-content" style="overflow: hidden;padding-top: 20px; padding-left: 30px; padding-right: 50px;height:225px;" data-value="' + k.F_Id + '" ></div></div>';
  73. g.append(i);
  74. top.learun.httpAsync("GET", top.$.rootUrl + "/LR_Desktop/DTList/GetSqlData", {
  75. Id: k.F_Id
  76. },
  77. function(m) {
  78. if(m) {
  79. var l = g.find('[data-value="' + m.Id + '"]');
  80. $.each(m.value,
  81. function(p, q) {
  82. var o = ' <div class="lr-msg-line"> <a href="#" style="text-decoration: none;" >' + q.f_title + "</a> <label>" + q.f_time + "</label> </div>";
  83. var n = $(o);
  84. n.find("a")[0].item = q;
  85. l.append(n)
  86. });
  87. l.find(".lr-msg-line>a").on("click",
  88. function() {
  89. var n = $(this).parents(".col-xs-6");
  90. var o = n.attr("data-Id");
  91. var p = $(this)[0].item;
  92. if(d[o].F_ItemUrl) {
  93. top.learun.frameTab.open({
  94. F_ModuleId: "dtlist" + p.f_id,
  95. F_FullName: p.f_title,
  96. F_UrlAddress: d[o].F_ItemUrl + p.f_id
  97. })
  98. } else {
  99. //判断点击项是否为‘待办’的子项
  100. if(d[o].F_Id == "33d50f1a-a64d-4b86-a6d4-2d937226de95") {
  101. if(p.f_tasktype != 2) {
  102. top.learun.frameTab.open({
  103. F_ModuleId: p.f_id + "_homeopen",
  104. F_Icon: 'fa magic',
  105. F_FullName: '审核流程【' + p.f_processname + '/' + p.f_content + '】',
  106. F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/Index'
  107. //F_UrlAddress: '/LR_WorkFlowModule/WfMyTask/CustmerWorkFlowForm?tabIframeId=' + p.f_id + '&type=' + p.f_tasktype + '' + "&processId=" + p.f_processid + "&taskId=" + p.f_id
  108. });
  109. }
  110. }
  111. else if (d[o].F_Id == "574a4149-6556-4e4a-8f40-b022c5b90b14") {
  112. top.learun.frameTab.open({
  113. F_ModuleId: p.f_id + "_homeopen",
  114. F_Icon: 'fa magic',
  115. F_FullName: '公文查阅',
  116. F_UrlAddress: '/EducationalAdministration/Sys_ReceiveFile/Index'
  117. });
  118. }
  119. else {
  120. top["dtlist" + p.f_id] = p;
  121. top.learun.frameTab.open({
  122. F_ModuleId: "dtlist" + p.f_id,
  123. F_FullName: p.f_title,
  124. F_UrlAddress: "/Utility/ListContentIndex?id=" + p.f_id
  125. })
  126. }
  127. }
  128. return false
  129. })
  130. }
  131. })
  132. });
  133. //青桔课堂图片插入
  134. var htmlQj = '<div class="col-xs-12" id="qjImg" style="position: relative;border-radius: 4px;overflow: hidden;">' +
  135. '<a href="/Home/GoQingJu" target="_blank"><img src="/Content/images/qj.jpg" alt="" style="width: 100%;display: block;margin: 20px 0 10px" /></a>' +
  136. '<div class="qjClose" style="background: #7c89f3;border-radius: 2px;text-align: center;line-height: 24px;width: 50px;font-size: 12px;color: #fff;position: absolute;top: 31px;right: 13px;height: 24px;cursor: pointer;">关闭</div>' +
  137. '</div>';
  138. //g.append(htmlQj);
  139. g.find(".portal-panel-title>.menu").on("click",
  140. function() {
  141. var i = $(this).parents(".col-xs-6");
  142. var j = i.attr("data-Id");
  143. top.learun.frameTab.open({
  144. F_ModuleId: j,
  145. F_FullName: d[j].F_Name,
  146. F_UrlAddress: d[j].F_Url
  147. });
  148. return false
  149. }).end().on('click', '.qjClose', function() {
  150. $(this).parent().addClass('active').slideUp(500)
  151. });
  152. if(h.length % 2 > 0) {
  153. g.find('[data-value="' + h[h.length - 1].F_Id + '"]').css("height", 425)
  154. }
  155. }
  156. }
  157. var b = {};
  158. function a(h) {
  159. if(h.length > 0) {
  160. var g = $(".lr-desktop-panel>.lr-scroll-box");
  161. $.each(h,
  162. function(j, k) {
  163. var stylex = k.Background? 'background:' + k.Background + ';color:' + k.Color + ';border-color:transparent' : '';
  164. var i = ' <div class="col-xs-' + (12 / parseInt(k.F_Proportion1)) + '"> <div style="'+ stylex+'" class="portal-panel-title"> <i class="' + k.F_Icon + '"></i>&nbsp;&nbsp;' + k.F_Name + ' </div> <div class="portal-panel-content"> <div id="' + k.F_Id + '" class="lr-chart-container" data-type="' + k.F_Type + '" ></div> </div> </div>';
  165. g.append(i);
  166. b[k.F_Id] = echarts.init(document.getElementById(k.F_Id));
  167. top.learun.httpAsync("GET", top.$.rootUrl + "/LR_Desktop/DTChart/GetSqlData", {
  168. Id: k.F_Id
  169. },
  170. function(l) {
  171. if(l) {
  172. var o = $("#" + l.Id).attr("data-type");
  173. var m = [];
  174. var p = [];
  175. $.each(l.value,
  176. function(q, r) {
  177. m.push(r.name);
  178. p.push(r.value)
  179. });
  180. var n = {};
  181. switch(o) {
  182. case "0":
  183. n.legend = {
  184. bottom: "bottom",
  185. data: m
  186. };
  187. n.series = [{
  188. name: "占比",
  189. type: "pie",
  190. radius: "75%",
  191. center: ["50%", "50%"],
  192. label: {
  193. normal: {
  194. formatter: "{b}:{c}: ({d}%)",
  195. textStyle: {
  196. fontWeight: "normal",
  197. fontSize: 12,
  198. color: "#333"
  199. }
  200. }
  201. },
  202. data: l.value,
  203. itemStyle: {
  204. emphasis: {
  205. shadowBlur: 10,
  206. shadowOffsetX: 0,
  207. shadowColor: "rgba(0, 0, 0, 0.5)"
  208. }
  209. }
  210. }];
  211. n.color = ["#df4d4b", "#304552", "#52bbc8", "rgb(224,134,105)", "#8dd5b4", "#5eb57d", "#d78d2f"];
  212. break;
  213. case "1":
  214. n.tooltip = {
  215. trigger: "axis"
  216. };
  217. n.grid = {
  218. bottom: "8%",
  219. containLabel: true
  220. };
  221. n.xAxis = {
  222. type: "category",
  223. boundaryGap: false,
  224. data: m
  225. };
  226. n.yAxis = {
  227. type: "value"
  228. };
  229. n.series = [{
  230. type: "line",
  231. data: p
  232. }];
  233. break;
  234. case "2":
  235. n.tooltip = {
  236. trigger: "axis"
  237. };
  238. n.grid = {
  239. bottom: "8%",
  240. containLabel: true
  241. };
  242. n.xAxis = {
  243. type: "category",
  244. boundaryGap: false,
  245. data: m
  246. };
  247. n.yAxis = {
  248. type: "value"
  249. };
  250. n.series = [{
  251. type: "bar",
  252. data: p
  253. }];
  254. break
  255. }
  256. b[l.Id].setOption(n)
  257. }
  258. })
  259. });
  260. window.onresize = function(i) {
  261. $.each(b,
  262. function(j, k) {
  263. k.resize(i)
  264. })
  265. }
  266. }
  267. }
  268. //$(".lr-desktop-panel").lrscroll();
  269. //top.learun.clientdata.getAsync("desktop", {
  270. // callback: function(g) {
  271. // e(g.target || []);
  272. // c(g.list || []);
  273. // a(g.chart || [])
  274. // }
  275. //})
  276. setTimeout(onload(), 10000);
  277. function onload() {
  278. $(".lr-desktop-panel").lrscroll();
  279. top.learun.clientdata.getAsync("desktop",
  280. {
  281. callback: function(g) {
  282. e(g.target || []);
  283. c(g.list || []);
  284. a(g.chart || []);
  285. }
  286. });
  287. funopen();
  288. }
  289. window.setInterval(funopen, 60000);
  290. //消息提醒
  291. function funopen() {
  292. $.ajax({
  293. url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetCountForUnread',
  294. type: "get",
  295. dataType: "json",
  296. async: false,
  297. success: function (data) {
  298. if (data.data != 0) {
  299. document.getElementById("sound").src = '/Resource/wav/收到新消息.wav';
  300. top.learun.layeropen({
  301. //id: 'form',
  302. type: 2,
  303. title: "消息提示",
  304. closeBtn: 0, //不显示关闭按钮
  305. shade: [0],
  306. area: ['340px', '215px'],
  307. offset: 'rb', //右下角弹出
  308. anim: 2,
  309. content: top.$.rootUrl + '/LR_Desktop/MessageRind/UnreadIndex',
  310. callBack: function (id) {
  311. return top[id].acceptClick(refreshGirdData);
  312. }
  313. });
  314. }
  315. }
  316. });
  317. };
  318. });