Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

339 Zeilen
18 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. } else {
  120. //判断点击项是否为‘待办’的子项
  121. if (d[o].F_Id == "33d50f1a-a64d-4b86-a6d4-2d937226de95") {
  122. if (p.f_tasktype != 2) {
  123. top.learun.frameTab.open({
  124. F_ModuleId: p.f_id + "_homeopen",
  125. F_Icon: 'fa magic',
  126. F_FullName: '审核流程【' + p.f_processname + '/' + p.f_content + '】',
  127. F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/Index'
  128. //F_UrlAddress: '/LR_WorkFlowModule/WfMyTask/CustmerWorkFlowForm?tabIframeId=' + p.f_id + '&type=' + p.f_tasktype + '' + "&processId=" + p.f_processid + "&taskId=" + p.f_id
  129. });
  130. }
  131. } else {
  132. top["dtlist" + p.f_id] = p;
  133. top.learun.frameTab.open({
  134. F_ModuleId: "dtlist" + p.f_id,
  135. F_FullName: p.f_title,
  136. F_UrlAddress: "/Utility/ListContentIndex?id=" + p.f_id
  137. })
  138. }
  139. }
  140. return false
  141. })
  142. }
  143. })
  144. });
  145. //暂无数据
  146. g.find('.portal-panel-content2').each(function (i, n) {
  147. var len = $(n).find('.lr-msg-line').length;
  148. if (len == 0) {
  149. $(n).html(noHtml)
  150. }
  151. })
  152. //青桔课堂图片插入
  153. var htmlQj = '<div class="col-xs-12" id="qjImg" style="position: relative;border-radius: 4px;overflow: hidden;">' +
  154. '<a href="/Home/GoQingJu" target="_blank"><img src="/Content/images/qj.jpg" alt="" style="width: 100%;display: block;margin: 20px 0 10px" /></a>' +
  155. '<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>' +
  156. '</div>';
  157. //g.append(htmlQj);
  158. g.find(".portal-panel-title>.menu").on("click",
  159. function () {
  160. var i = $(this).parents(".col-xs-6");
  161. var j = i.attr("data-Id");
  162. top.learun.frameTab.open({
  163. F_ModuleId: j,
  164. F_FullName: d[j].F_Name,
  165. F_UrlAddress: d[j].F_Url
  166. });
  167. return false
  168. }).end().on('click', '.qjClose', function () {
  169. $(this).parent().addClass('active').slideUp(500)
  170. });
  171. if (h.length % 2 > 0) {
  172. g.find('[data-value="' + h[h.length - 1].F_Id + '"]').css("height", 425)
  173. }
  174. }
  175. }
  176. var b = {};
  177. function a(h) {
  178. if (h.length > 0) {
  179. var g = $(".lr-desktop-panel>.lr-scroll-box");
  180. $.each(h,
  181. function (j, k) {
  182. var stylex = k.Background ? 'background:' + k.Background + ';color:' + k.Color + ';border-color:transparent' : '';
  183. 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>';
  184. g.append(i);
  185. b[k.F_Id] = echarts.init(document.getElementById(k.F_Id));
  186. top.learun.httpAsync("GET", top.$.rootUrl + "/LR_Desktop/DTChart/GetSqlData", {
  187. Id: k.F_Id
  188. },
  189. function (l) {
  190. // console.log(l)
  191. if (l) {
  192. if (l.value.length == 0) {
  193. $('#' + k.F_Id).html(noHtml)
  194. return
  195. }
  196. var o = $("#" + l.Id).attr("data-type");
  197. var m = [];
  198. var p = [];
  199. $.each(l.value,
  200. function (q, r) {
  201. m.push(r.name);
  202. p.push(r.value)
  203. });
  204. var n = {};
  205. switch (o) {
  206. case "0":
  207. n.legend = {
  208. bottom: "bottom",
  209. data: m
  210. };
  211. n.series = [{
  212. name: "占比",
  213. type: "pie",
  214. radius: "75%",
  215. center: ["50%", "50%"],
  216. label: {
  217. normal: {
  218. formatter: "{b}:{c}: ({d}%)",
  219. textStyle: {
  220. fontWeight: "normal",
  221. fontSize: 12,
  222. color: "#333"
  223. }
  224. }
  225. },
  226. data: l.value,
  227. itemStyle: {
  228. emphasis: {
  229. shadowBlur: 10,
  230. shadowOffsetX: 0,
  231. shadowColor: "rgba(0, 0, 0, 0.5)"
  232. }
  233. }
  234. }];
  235. n.color = ["#df4d4b", "#304552", "#52bbc8", "rgb(224,134,105)", "#8dd5b4", "#5eb57d", "#d78d2f"];
  236. break;
  237. case "1":
  238. n.tooltip = {
  239. trigger: "axis"
  240. };
  241. n.grid = {
  242. bottom: "8%",
  243. containLabel: true
  244. };
  245. n.xAxis = {
  246. type: "category",
  247. boundaryGap: false,
  248. data: m
  249. };
  250. n.yAxis = {
  251. type: "value"
  252. };
  253. n.series = [{
  254. type: "line",
  255. data: p
  256. }];
  257. break;
  258. case "2":
  259. n.tooltip = {
  260. trigger: "axis"
  261. };
  262. n.grid = {
  263. bottom: "8%",
  264. containLabel: true
  265. };
  266. n.xAxis = {
  267. type: "category",
  268. boundaryGap: false,
  269. data: m
  270. };
  271. n.yAxis = {
  272. type: "value"
  273. };
  274. n.series = [{
  275. type: "bar",
  276. data: p
  277. }];
  278. break
  279. }
  280. b[l.Id].setOption(n)
  281. }
  282. })
  283. });
  284. window.onresize = function (i) {
  285. $.each(b,
  286. function (j, k) {
  287. k.resize(i)
  288. })
  289. }
  290. }
  291. }
  292. $(".lr-desktop-panel").lrscroll();
  293. top.learun.clientdata.getAsync("desktop", {
  294. callback: function (g) {
  295. c(g.list || []);
  296. e(g.target || []);
  297. a(g.chart || [])
  298. }
  299. })
  300. funopen();
  301. window.setInterval(funopen, 60000);
  302. //window.clearInterval(t1);
  303. //消息提醒
  304. function funopen() {
  305. $.ajax({
  306. url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetCountForUnread',
  307. type: "get",
  308. dataType: "json",
  309. async: false,
  310. success: function (data) {
  311. if (data.data != 0) {
  312. document.getElementById("sound").src = '/Resource/wav/收到新消息.wav';
  313. top.learun.layeropen({
  314. //id: 'form',
  315. type: 2,
  316. title: "消息提示",
  317. closeBtn: 0, //不显示关闭按钮
  318. shade: [0],
  319. area: ['340px', '215px'],
  320. offset: 'rb', //右下角弹出
  321. anim: 2,
  322. content: top.$.rootUrl + '/LR_Desktop/MessageRind/UnreadIndex',
  323. callBack: function (id) {
  324. return top[id].acceptClick(refreshGirdData);
  325. }
  326. });
  327. }
  328. }
  329. });
  330. };
  331. });