Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

357 lignes
19 KiB

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