perfportalNew.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. shr.defineClass("shr.perfweb.perfportalNew", shr.framework.Core, {
  2. _SHOW_TODO: 1, // 右侧显示绩效待办
  3. _SHOW_AXVTODO: 2, // 右侧显示业绩待办
  4. _SHOW_IFRAME: 3, // 右侧显示iframe
  5. _RESOURCETARGET_AXV: 'achivementData', // 初始化默认点击业绩数据维护菜单
  6. initalizeDOM: function () {
  7. // 初始化JS环境
  8. shr.perfweb.perfportalNew.superClass.initalizeDOM.call(this);
  9. if (shr.getUrlParam("inFrame") == null || shr.getUrlParam("inFrame") == '') {
  10. window.location.href = shr.getContextPath() + '/dynamic.do?uipk=' + shr.getCurrentViewPage().uipk + '&inFrame=true';
  11. }
  12. this.initMenu(); // 初始化菜单
  13. if (shr.getUrlRequestParam("resourceTag") == this._RESOURCETARGET_AXV) {
  14. //选中 业绩维护 菜单
  15. $('#perfAchivementManagementParent').trigger('click');
  16. $('#perfAchivementManagementTag').trigger('click');
  17. } else {
  18. // 自动跳转默认展示菜单
  19. var defautMenu = shr.getUrlRequestParam("defautMenu");
  20. if (defautMenu != undefined && defautMenu != "") {
  21. var $menuLi = $('li[name="' + defautMenu + '"]');
  22. var $menuParent = $menuLi.parent("ul").parent(".menuList");
  23. $menuParent.trigger('click');
  24. $menuLi.trigger('click');
  25. } else {
  26. this.initTodoContent(); // 初始化绩效待办
  27. this.initMyOngoingData(); // 初始化我参与进行中的考核
  28. }
  29. }
  30. //yien BT1468810 没任何组织绩效待办卡片权限时 ,组织绩效待办框 字段去掉(个人)
  31. this.initPersonAndOrgCardPanel();
  32. defaultPage = this.initData['perfBatchScoreList_defaultPage'];
  33. defaultPage4Org = this.initData['orgPerfBatchScoreList_defaultPage'];
  34. },
  35. /**
  36. * 初始左侧菜单
  37. */
  38. initMenu: function () {
  39. $('#workAreaDiv').append($("#leftMenuTpl").html());
  40. $("#leftMenuTpl").remove();
  41. this.menuClickEvent();
  42. },
  43. /**
  44. * 菜单点击事件
  45. */
  46. menuClickEvent: function () {
  47. var _self = this;
  48. $('.menuList').unbind('click').bind('click', function (event) {
  49. _self._menuClickStyle($(this));
  50. var contentid = $(this).attr('for');
  51. var breadcrumb = $(this).attr('breadcrumb');
  52. var shruicode = $(this).attr('shruicode');
  53. var perfshruicode = $(this).attr('perfshruicode');
  54. // 【BT-01105576】breadcrumb取不到值,面包屑显示有问题
  55. if (breadcrumb == undefined) {
  56. breadcrumb = $("li[for='myEvaluationContent']").attr("breadcrumbValue");
  57. }
  58. if (contentid == 'myEvaluationContent') {
  59. _self.initTodoContent(breadcrumb); // 初始化绩效待办
  60. _self.initMyOngoingData(); // 初始化我参与进行中的考核
  61. } else if (contentid == 'axvManagementContent') {
  62. _self.initAxvTodoContent(breadcrumb); // 初始化业绩待办
  63. } else if (!_self.customerMenuClickEvent($(this), contentid)) {
  64. _self.initIframeContent($(this).attr("uipk"), $(this).attr("iframeName"), shruicode, perfshruicode); // 跳转配置的uipk对应页面
  65. }
  66. stopEvent(event);
  67. });
  68. },
  69. /**
  70. * 自定义菜单点击事件
  71. * @param obj
  72. * @param contentid
  73. * @returns {boolean}
  74. */
  75. customerMenuClickEvent: function (obj, contentid) {
  76. return false;
  77. },
  78. /**
  79. * 待办卡片点击事件
  80. */
  81. cardClickEvent: function () {
  82. var _self = this;
  83. var $rightContentArea = $("#rightContentArea");
  84. $rightContentArea.find('.board').unbind('click').bind('click', function (event) {
  85. // var count = $(this).find(".count").html();
  86. var count = $(this).attr("count");
  87. var uipk = $(this).attr("uipk");
  88. var serviceId = decodeURIComponent($(this).attr("serviceid"));
  89. var personId = $(this).attr("personid");
  90. var action = $(this).attr("action");
  91. var isOrg = $(this).attr("isorg");
  92. var iframe = $(this).attr("iframe");
  93. // 交叉视图拆分入口携带参数
  94. var shruicode = $(this).attr("shruicode");
  95. // 子页面交叉视图拆分入口携带参数
  96. var perfshruicode = $(this).attr("perfshruicode");
  97. if (action != undefined && action != "") {
  98. action += "Action";
  99. // 卡片定义了action属性的调用action对应的方法
  100. shr.proxyCall.call(_self, action, _self, $(this), uipk, serviceId, personId, isOrg, shruicode, perfshruicode);
  101. } else if (iframe != undefined && iframe != "") {
  102. _self.initIframeContent(uipk, "", shruicode, perfshruicode); // 跳转配置的uipk对应页面
  103. } else if (uipk != undefined && uipk != "") {
  104. if (count == "0") {
  105. // 待办数为0显示暂无待办事项
  106. _self._showNoneTodoMessage();
  107. } else {
  108. var param = {
  109. uipk: uipk,
  110. isOrg: isOrg,
  111. serviceId: serviceId,
  112. period: ''
  113. }
  114. _self._addShruicode(param, shruicode, perfshruicode);
  115. // 否则根据uipk重载页面
  116. _self.reloadPage(param);
  117. }
  118. }
  119. });
  120. },
  121. /**
  122. * 团队目标下达待办卡片点击处理
  123. * @param obj
  124. * @param uipk
  125. * @param serviceId
  126. * @param personId
  127. * @param isOrg
  128. * @param shruicode
  129. * @param perfshruicode
  130. */
  131. getTeamPersonalTargetDataAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
  132. var _self = this;
  133. $.block.show();
  134. var param = {
  135. uipk: uipk,
  136. serviceId: serviceId,
  137. }
  138. if (isOrg != undefined && isOrg != "") {
  139. param.isOrg = isOrg;
  140. }
  141. _self._addShruicode(param, shruicode, perfshruicode);
  142. _self.reloadPage(param);
  143. /*this.remoteCall({
  144. method: "getTeamPersonalTargetData",
  145. param: {
  146. personId: personId,
  147. evaObjName: '',
  148. isOrg: isOrg
  149. },
  150. async: true,
  151. success: function (data) {
  152. $.block.hide();
  153. if (data != null && data.totalCount > 0) {
  154. //将下达数量为0的考核周期过滤掉
  155. var periodId = '';
  156. for (var i = 0, len = data.evaPerfPeriodBeanList.length; i < len; i++) {
  157. if (data.evaPerfPeriodBeanList[i].evaCountPerPeriod > 0) {
  158. periodId = data.evaPerfPeriodBeanList[i].periodId;
  159. break;
  160. }
  161. }
  162. var param = {
  163. uipk: uipk,
  164. serviceId: serviceId,
  165. period: periodId
  166. }
  167. if (isOrg != undefined && isOrg != "") {
  168. param.isOrg = isOrg;
  169. }
  170. _self._addShruicode(param, shruicode, perfshruicode);
  171. _self.reloadPage(param);
  172. } else {
  173. _self._showNoneTodoMessage();
  174. }
  175. }
  176. });*/
  177. },
  178. /**
  179. * 团队个人目标评价待办卡片点击处理
  180. * @param obj
  181. * @param uipk
  182. * @param serviceId
  183. * @param personId
  184. * @param isOrg
  185. * @param shruicode
  186. * @param perfshruicode
  187. */
  188. getTeamTargetCommentListAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
  189. var _self = this;
  190. $.block.show();
  191. //打分页面性能优化 by huan_xiong 去掉有无数据判断,直接跳转
  192. var param = {
  193. uipk: uipk,
  194. serviceId: serviceId,
  195. personId: personId
  196. }
  197. _self._addShruicode(param, shruicode, perfshruicode);
  198. _self.reloadPage(param);
  199. /* this.remoteCall({
  200. method: "getTeamTargetCommentList",
  201. async: true,
  202. success: function (data) {
  203. $.block.hide();
  204. if (data != null && data.totalCount > 0) {
  205. var periodId = data.evaPerfPeriodBeanList[0].periodId;
  206. _self.reloadPage({
  207. uipk: uipk,
  208. period: periodId,
  209. serviceId: serviceId,
  210. personId: personId
  211. });
  212. } else {
  213. _self._showNoneTodoMessage();
  214. }
  215. }
  216. });*/
  217. },
  218. /**
  219. * 我的考核目标待办卡片点击处理
  220. * @param obj
  221. * @param uipk
  222. * @param serviceId
  223. * @param personId
  224. * @param isOrg
  225. * @param shruicode
  226. * @param perfshruicode
  227. */
  228. getMyTargetDataAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
  229. var _self = this;
  230. this.remoteCall({
  231. method: "getMyTargetData",
  232. param: {
  233. evaObjName: '',
  234. isOrg: isOrg
  235. },
  236. async: false,
  237. success: function (data) {
  238. /*if (data != null && data.length > 0) {*/
  239. var curPeriodId;
  240. if (data != null && data.length > 0){
  241. curPeriodId = data[0];
  242. }else{
  243. curPeriodId = '';
  244. }
  245. var param = {
  246. uipk: uipk,
  247. serviceId: serviceId,
  248. period: curPeriodId
  249. }
  250. _self._addShruicode(param, shruicode, perfshruicode);
  251. _self.reloadPage(param);
  252. /*} else {
  253. _self._showNoneTodoMessage();
  254. }*/
  255. }
  256. });
  257. },
  258. /**
  259. * 我的考核自评待办卡片点击处理
  260. * @param obj
  261. * @param uipk
  262. * @param serviceId
  263. * @param personId
  264. * @param isOrg
  265. * @param shruicode
  266. * @param perfshruicode
  267. */
  268. getPersonalTargetCommentListAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
  269. var _self = this;
  270. if (_self._hideboardwrap(obj)) {
  271. return;
  272. }
  273. $.block.show();
  274. var param = {
  275. personId: personId
  276. };
  277. if (isOrg != undefined && isOrg != "") {
  278. param.isOrg = isOrg;
  279. }
  280. this.remoteCall({
  281. method: "getPersonalTargetCommentList",
  282. param: param,
  283. async: true,
  284. success: function (data) {
  285. $.block.hide();
  286. if (data != null && data.length > 0) {
  287. globalPersonnalTargetData = data;
  288. _self._loadingSelfAssessmentData(data, obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode);
  289. } else {
  290. _self._showNoneTodoMessage2(obj.find(".nameboard"));
  291. }
  292. _self._openNameboardList(obj);
  293. }
  294. });
  295. },
  296. /**
  297. * 其他绩效待办卡片点击处理
  298. * @param obj
  299. * @param uipk
  300. * @param serviceId
  301. * @param personId
  302. */
  303. othersTodoAction: function (obj, uipk, serviceId, personId) {
  304. var safeUrl = shr.safeUrl(shr.getContextPath().replace("/shr", "") +
  305. "/easweb/webviews/workflow/processcenter.jsp?waf2skin=eas&entitypk=" + encodeURIComponent(uipk));
  306. window.open(safeUrl);
  307. },
  308. /**
  309. * 隐藏卡片下拉显示
  310. * @private
  311. */
  312. _hideboardwrap: function (obj) {
  313. var boardwrapH = obj.parents('.boardwrap').height();
  314. if (obj.hasClass('boardfooterclick')) {
  315. $.block.hide();
  316. obj.animate({height: boardwrapH + 'px'}, function () {
  317. obj.removeClass('boardfooterclick');
  318. obj.removeClass('boxshadow');
  319. obj.css('z-index', '0');
  320. });
  321. return true;
  322. }
  323. return false;
  324. },
  325. /**
  326. * 加载【我的考核自评】数据
  327. * @param data
  328. * @param obj
  329. * @param uipk
  330. * @param serviceId
  331. * @param personId
  332. * @param isOrg
  333. * @param shruicode
  334. * @param perfshruicode
  335. * @private
  336. */
  337. _loadingSelfAssessmentData: function (data, obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
  338. var _self = this;
  339. var $nameboard = obj.find('.nameboard');
  340. if (data == undefined || data == null || data == '') {
  341. _self._showNoneTodoMessage2($nameboard);
  342. } else {
  343. $nameboard.html('');
  344. $nameboard.append(_self._myselfEvalutionLoadList(data));
  345. }
  346. //跳转到我的自评打分页面
  347. obj.find('.megList li .batch, .one_column').each(function (index, el) {
  348. $(el).live('click', function () {
  349. var evaObj = $(this).attr("evaobj");
  350. var periodId = $(this).attr("periodId");
  351. var gradeTaskNode = $(this).attr("gradeTasknode");
  352. var wfLevel = $(this).attr("wfLevel");
  353. //var defaultPage = $('#defaultPage').text();
  354. if(isOrg == "1") {
  355. if (defaultPage4Org == 'list') {
  356. uipk = 'com.kingdee.shr.perfweb.app.perfscoreNew4Org.core'
  357. }
  358. }else {
  359. if (defaultPage == 'list') {
  360. uipk = 'com.kingdee.shr.perfweb.app.perfscoreNew.core';
  361. }
  362. }
  363. var param = {
  364. uipk: uipk,
  365. evaObj: evaObj,
  366. periodId: periodId,
  367. personId: personId,
  368. serviceId: serviceId,
  369. //personNumber: personNumber,
  370. entryType: 'myselfEvalu',
  371. gradeTaskNode: gradeTaskNode,
  372. wfLevel: wfLevel
  373. }
  374. _self._addShruicode(param, shruicode, perfshruicode);
  375. _self.reloadPage(param);
  376. });
  377. })
  378. },
  379. /**
  380. * 我的考核自评待办卡片数据预览Html
  381. * @param data
  382. * @private
  383. */
  384. _myselfEvalutionLoadList: function (data) {
  385. var $nameboardTpl = $("#nameboardTpl");
  386. var nameboardTpl = juicerUtils.parseHtml2JuicerTpl($nameboardTpl.html());
  387. return juicer(nameboardTpl, {rows: data})
  388. },
  389. /**
  390. * 打开待办卡片预览
  391. * @param obj
  392. * @private
  393. */
  394. _openNameboardList: function (obj) {
  395. var board = obj;
  396. var boardwrapH = obj.parents('.boardwrap').height();
  397. var nameboard = obj.find('.nameboard');
  398. var zIndex = $('.boardfooterclick').length + 2;
  399. board.css('z-index', zIndex);
  400. obj.addClass('boardfooterclick');
  401. board.addClass('boxshadow');
  402. var height = nameboard.innerHeight() + boardwrapH + 10 + 'px';
  403. board.animate({height: height});
  404. },
  405. /**
  406. * 刷新待办卡片数量
  407. */
  408. initDataAction: function (updateCountFlag) {
  409. $.block.show();
  410. this.remoteCall({
  411. method: 'initData',
  412. param: {
  413. updateCountFlag: updateCountFlag
  414. },
  415. success: function (data) {
  416. if (data && data.length > 0) {
  417. for (var item in data) {
  418. $("div[id='" + item + "']").html(data[item]); // 刷新待办数
  419. }
  420. }
  421. $.block.hide();
  422. }
  423. });
  424. },
  425. /**
  426. * 初始化右侧区域
  427. * @param contentIndex 1:显示绩效待办 2:显示业绩数据 3:显示iframe
  428. * @param uipk iframe的src
  429. * @param iframeName 兼容老代码,有些地方iframe的子页面需要根据父页面iframe名称来定位
  430. * @param shruicode
  431. * @param perfshruicode
  432. */
  433. initRightContent: function (contentIndex, uipk, iframeName, shruicode, perfshruicode) {
  434. var $rightContentArea = $("#rightContentArea");
  435. var $otherContent = $rightContentArea.find("div.content[index!='" + contentIndex + "']");
  436. var $content;
  437. if ($rightContentArea != undefined) {
  438. $content = $rightContentArea.find("div.content[index='" + contentIndex + "']");
  439. }
  440. // 右侧显示iframe
  441. if (contentIndex == this._SHOW_IFRAME) {
  442. if (uipk == undefined) {
  443. return;
  444. }
  445. $otherContent.hide();
  446. $content.remove();
  447. } else if ($content.length > 0) {
  448. // 右侧区域已渲染的情况下,重新渲染待办卡片数即可
  449. this.initDataAction(contentIndex + "");
  450. if (contentIndex == this._SHOW_TODO) {
  451. this.initMyOngoingData(); // 初始化我参与进行中的考核;
  452. }
  453. $otherContent.hide();
  454. $content.show();
  455. return;
  456. }
  457. $otherContent.hide();
  458. // 根据视图配置模板解析右侧区域
  459. this._parseRightContent(contentIndex, uipk, iframeName, shruicode, perfshruicode);
  460. },
  461. /**
  462. * 初始化绩效待办区域
  463. */
  464. initTodoContent: function (breadcrumb) {
  465. if (breadcrumb == undefined) {
  466. breadcrumb = $("li[for='myEvaluationContent']").attr("breadcrumbValue");
  467. }
  468. this.initRightContent(this._SHOW_TODO);
  469. var resourceTag = shr.getUrlRequestParam("resourceTag");
  470. var url = window.location.href;
  471. if (resourceTag != "" && resourceTag != undefined) {
  472. url = url.replace(/(&resourceTag=.*?)&/g, '&');
  473. window.history.pushState({}, 0, url);
  474. }
  475. this.initNavigationStore({
  476. uipk: shr.getCurrentViewPage().uipk,
  477. name: breadcrumb,
  478. url: url
  479. });
  480. this.cardClickEvent();
  481. },
  482. /**
  483. * 初始化业绩数据待办区域
  484. */
  485. initAxvTodoContent: function (breadcrumb) {
  486. this.initRightContent(this._SHOW_AXVTODO);
  487. var uipk = shr.getCurrentViewPage().uipk;
  488. var resourceTag = shr.getUrlRequestParam("resourceTag");
  489. if (resourceTag == "" || resourceTag == undefined) {
  490. uipk += "&resourceTag=achivementData";
  491. }
  492. this.initNavigationStore({
  493. uipk: uipk,
  494. name: breadcrumb
  495. });
  496. this.cardClickEvent();
  497. },
  498. /**
  499. * 初始化iframe区域
  500. */
  501. initIframeContent: function (uipk, iframeName, shruicode, perfshruicode) {
  502. if (iframeName == "" || iframeName == undefined) {
  503. iframeName = "rightContentIframe";
  504. }
  505. this.initRightContent(this._SHOW_IFRAME, uipk, iframeName, shruicode, perfshruicode);
  506. },
  507. /**
  508. * 初始化面包屑导航数据
  509. */
  510. initNavigationStore: function (item) {
  511. var items = shrDataManager.pageNavigationStore.getDatas();
  512. if (typeof items != "undefined" && items.length == 2) {
  513. var oldUipk = items[1].uipk;
  514. var newUipk = item['uipk'];
  515. var newUrl = item['url'];
  516. items[1].name = item['name'];
  517. items[1].uipk = newUipk;
  518. if (newUrl != undefined && newUrl != "") {
  519. items[1].url = newUrl;
  520. } else {
  521. items[1].url = items[1].url.replace(oldUipk, newUipk);
  522. }
  523. shrDataManager.pageNavigationStore.setDatas(items);
  524. }
  525. },
  526. /**
  527. * 初始化我参与进行中的考核
  528. */
  529. initMyOngoingData: function () {
  530. $.block.show();
  531. var _self = this;
  532. var $rightContentArea = $("#rightContentArea");
  533. var $myOngoingTpl = $("#myOngoingTpl");
  534. var myOngoingTpl = juicerUtils.parseHtml2JuicerTpl($myOngoingTpl.html());
  535. this.remoteCall({
  536. method: "getMyOngoingAsmtList",
  537. async: true,
  538. param: {rows: $myOngoingTpl.attr("rows")},
  539. success: function (result) {
  540. if (result && null != result.baseData && result.baseData != undefined) {
  541. var baseData = result.baseData;
  542. var processViewData = result.processViewData;
  543. var rows = [];
  544. for (var i = 0; i < baseData.length; i++) {
  545. var item = baseData[i];
  546. var it = {};
  547. it.planname = item["perfPlan.name"] ? item["perfPlan.name"] : '&nbsp;&nbsp;';
  548. if(0===item["evaObj.isOrg"].value){
  549. it.objname = item["person.name"];
  550. }else {
  551. it.objname = item["adminOrgUnit.name"];
  552. }
  553. it.asignmentPoolID = item["asignmentPool.id"];
  554. var processViewDatas = processViewData.data;
  555. var datas = {};
  556. for (var k = 0; k < processViewDatas.length; k++) {
  557. var elem = processViewDatas[k][0][0][0];
  558. if (elem.asignmentPoolID == it.asignmentPoolID) {
  559. datas.data = processViewDatas[k];
  560. break;
  561. }
  562. }
  563. datas.photo = processViewData.photo;
  564. var processViewHtml = generateProcessView(datas);
  565. it.processViewHtml = processViewHtml
  566. rows.push(it);
  567. }
  568. $rightContentArea.find('#ongoingRows').html(juicer(myOngoingTpl, {rows: rows}));
  569. }
  570. _self._myOngoingViewClick();
  571. $.block.hide();
  572. }
  573. });
  574. },
  575. /**
  576. * 显示暂无待办事项
  577. * @private
  578. */
  579. _showNoneTodoMessage: function () {
  580. shr.showInfo({
  581. message: $("#todoMessage1").attr("value"),
  582. hideAfter: 3
  583. })
  584. },
  585. /**
  586. * 显示暂无待办事项
  587. * @param obj
  588. * @private
  589. */
  590. _showNoneTodoMessage2: function (obj) {
  591. obj.html($("#todoMessage2").html());
  592. },
  593. /**
  594. * 根据视图配置模板解析右侧区域
  595. * @param contentIndex
  596. * @param uipk
  597. * @param iframeName
  598. * @private
  599. */
  600. _parseRightContent: function (contentIndex, uipk, iframeName, shruicode, perfshruicode) {
  601. var _self = this;
  602. var $rightContentArea = $("#rightContentArea");
  603. var $workAreaDiv = $('#workAreaDiv');
  604. var rightContentTpl = juicerUtils.parseHtml2JuicerTpl($("#rightContentTpl" + contentIndex).html());
  605. var minHeight = $(window).height() - $('.menu').offset().top - 5;
  606. var serviceId = shr.getUrlRequestParam("serviceId", window.location.href);
  607. if (uipk != undefined && uipk != "" && uipk.indexOf("serviceId") < 0) {
  608. uipk += "&serviceId=" + serviceId;
  609. }
  610. var param = {
  611. minheight: minHeight,
  612. width: $rightContentArea.width(),
  613. src: shr.getContextPath() + "/dynamic.do?uipk=" + decodeURIComponent(uipk),
  614. iframeName: iframeName
  615. }
  616. if (shruicode != undefined && shruicode != "") {
  617. param.src += "&shruicode=" + shruicode;
  618. }
  619. if (perfshruicode != undefined && perfshruicode != "") {
  620. param.src += "&perfshruicode=" + perfshruicode;
  621. }
  622. var parseRightHtml = $(juicer(rightContentTpl, param));
  623. $rightContentArea.append(parseRightHtml);
  624. $workAreaDiv.append($rightContentArea);
  625. if (contentIndex != this._SHOW_IFRAME) {
  626. var $cardTpl = $("#cardTpl" + contentIndex);
  627. var $orgCardTpl = $("#orgCardTpl" + contentIndex);
  628. var $content = $rightContentArea.find("div.content[index='" + contentIndex + "']")
  629. this._parseCardTpl($cardTpl, $content.find('.todo'), "0");
  630. this._parseCardTpl($orgCardTpl, $content.find('.orgtodo'), "1");
  631. } else if (uipk != undefined && uipk != "") {
  632. var $iframe = $rightContentArea.find("iframe[name='" + iframeName + "']");
  633. $.block.show({
  634. text: $iframe.attr("loadtext")
  635. });
  636. $iframe.css('min-height', minHeight + 'px');
  637. $iframe.load(function () {
  638. $.block.hide();
  639. });
  640. }
  641. },
  642. /**
  643. * 菜单点击样式控制
  644. * @param obj
  645. */
  646. _menuClickStyle: function (obj) {
  647. var $this = obj;
  648. var currentClass = 'selectedmenu';
  649. if (obj.closest('ul').hasClass('menu_second')) { //二级菜单
  650. $this = obj.closest('li');
  651. currentClass = 'subCurrentSelsct';
  652. }
  653. var borderleft = $this.parent().find('.borderleft');
  654. var index = $this.index();
  655. $('.' + currentClass).removeClass(currentClass);
  656. obj.addClass(currentClass);
  657. if (obj.attr('hasSecondMenu') == 'true') {
  658. var secondMenu = obj.find('.menu_second');
  659. if (secondMenu.is(':hidden')) {
  660. $('.menu_second').hide();
  661. secondMenu.show();
  662. } else {
  663. secondMenu.hide();
  664. }
  665. } else if (obj.closest('ul').hasClass('menu_list')) {
  666. $('.menu_second').hide();
  667. $('.subCurrentSelsct').removeClass('subCurrentSelsct');
  668. }
  669. var top = (parseInt($this.css("margin-bottom")) + $this.height()) * index + 'px';
  670. borderleft.animate({top: top}, 100);
  671. },
  672. /**
  673. * 我参与进行中的考核点击事件
  674. */
  675. _myOngoingViewClick: function () {
  676. var _self = this;
  677. $('.linkstyle').unbind('click').bind('click', function () {
  678. var li = $(this).parent('li');
  679. var chart = li.find('.assessment_chart');
  680. if (!$(this).hasClass('viewapread')) {
  681. li.animate({height: 57 + chart.innerHeight() + 'px'});
  682. $(this).addClass('viewapread');
  683. li.addClass('boxshadow');
  684. } else {
  685. li.animate({height: '57px'}, function () {
  686. li.removeClass('boxshadow');
  687. });
  688. $(this).removeClass('viewapread');
  689. }
  690. });
  691. $('.more').die('click').live('click', function () {
  692. uipk = $(this).attr("uipk");
  693. _self.reloadPage({
  694. uipk: uipk,
  695. serviceId: '' //处理点击更多报500的问题 R20200401-2163
  696. });
  697. });
  698. },
  699. /**
  700. * 解析视图待办卡片模板
  701. * @param $cardTpl
  702. * @param $appendTo
  703. * @param isOrg 是否组织考核
  704. */
  705. _parseCardTpl: function ($cardTpl, $appendTo, isOrg) {
  706. var $cardParseTpl = juicerUtils.parseHtml2JuicerTpl($("#cardTpl").html());
  707. $cardTpl.find("cardx").each(function () {
  708. var param = {
  709. title: $(this).attr("title"), // 卡片标题
  710. desc: $(this).attr("desc"), // 卡片描述
  711. count: $(this).attr("count"), // 待办数
  712. uipk: $(this).attr("uipk"),
  713. serviceid: $(this).attr("serviceid"),
  714. countflag: $(this).attr("countflag"), // 更新待办数id
  715. display: $(this).attr("display"), // 是否可见
  716. action: $(this).attr("action"), // 点击执行自定义方法,
  717. isOrg: isOrg, // 是否组织考核
  718. iframe: $(this).attr("iframe"),
  719. shruicode: $(this).attr("shruicode"), // 交叉视图拆分入口携带参数
  720. perfshruicode: $(this).attr("perfshruicode"), // 子页面交叉视图拆分入口携带参数
  721. }
  722. if (param.display == "true" || param.display == undefined) {
  723. $(juicer($cardParseTpl, param)).appendTo($appendTo);
  724. }
  725. });
  726. },
  727. /**
  728. * yien 补丁11 根据权限是否隐藏个人、组织填报的面板
  729. */
  730. initPersonAndOrgCardPanel: function() {
  731. if($('#cardTpl1 cardx[display="true"]').length < 1) {
  732. $('.content[index="1"] .todo').remove();
  733. }
  734. if($('#orgCardTpl1 cardx[display="true"]').length < 1) {
  735. $('.orgtodo').remove();
  736. }
  737. },
  738. /**
  739. * 给param添加shruicode参数
  740. * @param param
  741. * @param shruicode
  742. * @param perfshruicode
  743. * @private
  744. */
  745. _addShruicode: function(param, shruicode, perfshruicode) {
  746. if (shruicode != undefined && shruicode != "") {
  747. param.shruicode = shruicode;
  748. }
  749. if (perfshruicode != undefined && perfshruicode != "") {
  750. param.perfshruicode = perfshruicode;
  751. }
  752. }
  753. });
  754. /**
  755. * 阻止事件冒泡
  756. * @param event
  757. */
  758. function stopEvent(event) {
  759. var e = arguments.callee.caller.arguments[0] || event;//这里是因为除了IE有event其他浏览器没有所以要做兼容
  760. if (e && e.stopPropagation) { //其他浏览器
  761. e.stopPropagation();
  762. } else if (window.event) { //IE浏览器
  763. e.cancelBubble = true;
  764. }
  765. }
  766. function setIframeHeight(id) {
  767. shr.setIframeHeight(id);
  768. }