123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- shr.defineClass("shr.perfweb.perfportalNew", shr.framework.Core, {
- _SHOW_TODO: 1, // 右侧显示绩效待办
- _SHOW_AXVTODO: 2, // 右侧显示业绩待办
- _SHOW_IFRAME: 3, // 右侧显示iframe
- _RESOURCETARGET_AXV: 'achivementData', // 初始化默认点击业绩数据维护菜单
- initalizeDOM: function () {
- // 初始化JS环境
- shr.perfweb.perfportalNew.superClass.initalizeDOM.call(this);
- if (shr.getUrlParam("inFrame") == null || shr.getUrlParam("inFrame") == '') {
- window.location.href = shr.getContextPath() + '/dynamic.do?uipk=' + shr.getCurrentViewPage().uipk + '&inFrame=true';
- }
- this.initMenu(); // 初始化菜单
- if (shr.getUrlRequestParam("resourceTag") == this._RESOURCETARGET_AXV) {
- //选中 业绩维护 菜单
- $('#perfAchivementManagementParent').trigger('click');
- $('#perfAchivementManagementTag').trigger('click');
- } else {
- // 自动跳转默认展示菜单
- var defautMenu = shr.getUrlRequestParam("defautMenu");
- if (defautMenu != undefined && defautMenu != "") {
- var $menuLi = $('li[name="' + defautMenu + '"]');
- var $menuParent = $menuLi.parent("ul").parent(".menuList");
- $menuParent.trigger('click');
- $menuLi.trigger('click');
- } else {
- this.initTodoContent(); // 初始化绩效待办
- this.initMyOngoingData(); // 初始化我参与进行中的考核
- }
- }
- //yien BT1468810 没任何组织绩效待办卡片权限时 ,组织绩效待办框 字段去掉(个人)
- this.initPersonAndOrgCardPanel();
- defaultPage = this.initData['perfBatchScoreList_defaultPage'];
- defaultPage4Org = this.initData['orgPerfBatchScoreList_defaultPage'];
- },
- /**
- * 初始左侧菜单
- */
- initMenu: function () {
- $('#workAreaDiv').append($("#leftMenuTpl").html());
- $("#leftMenuTpl").remove();
- this.menuClickEvent();
- },
- /**
- * 菜单点击事件
- */
- menuClickEvent: function () {
- var _self = this;
- $('.menuList').unbind('click').bind('click', function (event) {
- _self._menuClickStyle($(this));
- var contentid = $(this).attr('for');
- var breadcrumb = $(this).attr('breadcrumb');
- var shruicode = $(this).attr('shruicode');
- var perfshruicode = $(this).attr('perfshruicode');
- // 【BT-01105576】breadcrumb取不到值,面包屑显示有问题
- if (breadcrumb == undefined) {
- breadcrumb = $("li[for='myEvaluationContent']").attr("breadcrumbValue");
- }
- if (contentid == 'myEvaluationContent') {
- _self.initTodoContent(breadcrumb); // 初始化绩效待办
- _self.initMyOngoingData(); // 初始化我参与进行中的考核
- } else if (contentid == 'axvManagementContent') {
- _self.initAxvTodoContent(breadcrumb); // 初始化业绩待办
- } else if (!_self.customerMenuClickEvent($(this), contentid)) {
- _self.initIframeContent($(this).attr("uipk"), $(this).attr("iframeName"), shruicode, perfshruicode); // 跳转配置的uipk对应页面
- }
- stopEvent(event);
- });
- },
- /**
- * 自定义菜单点击事件
- * @param obj
- * @param contentid
- * @returns {boolean}
- */
- customerMenuClickEvent: function (obj, contentid) {
- return false;
- },
- /**
- * 待办卡片点击事件
- */
- cardClickEvent: function () {
- var _self = this;
- var $rightContentArea = $("#rightContentArea");
- $rightContentArea.find('.board').unbind('click').bind('click', function (event) {
- // var count = $(this).find(".count").html();
- var count = $(this).attr("count");
- var uipk = $(this).attr("uipk");
- var serviceId = decodeURIComponent($(this).attr("serviceid"));
- var personId = $(this).attr("personid");
- var action = $(this).attr("action");
- var isOrg = $(this).attr("isorg");
- var iframe = $(this).attr("iframe");
- // 交叉视图拆分入口携带参数
- var shruicode = $(this).attr("shruicode");
- // 子页面交叉视图拆分入口携带参数
- var perfshruicode = $(this).attr("perfshruicode");
- if (action != undefined && action != "") {
- action += "Action";
- // 卡片定义了action属性的调用action对应的方法
- shr.proxyCall.call(_self, action, _self, $(this), uipk, serviceId, personId, isOrg, shruicode, perfshruicode);
- } else if (iframe != undefined && iframe != "") {
- _self.initIframeContent(uipk, "", shruicode, perfshruicode); // 跳转配置的uipk对应页面
- } else if (uipk != undefined && uipk != "") {
- if (count == "0") {
- // 待办数为0显示暂无待办事项
- _self._showNoneTodoMessage();
- } else {
- var param = {
- uipk: uipk,
- isOrg: isOrg,
- serviceId: serviceId,
- period: ''
- }
- _self._addShruicode(param, shruicode, perfshruicode);
- // 否则根据uipk重载页面
- _self.reloadPage(param);
- }
- }
- });
- },
- /**
- * 团队目标下达待办卡片点击处理
- * @param obj
- * @param uipk
- * @param serviceId
- * @param personId
- * @param isOrg
- * @param shruicode
- * @param perfshruicode
- */
- getTeamPersonalTargetDataAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
- var _self = this;
- $.block.show();
- var param = {
- uipk: uipk,
- serviceId: serviceId,
- }
- if (isOrg != undefined && isOrg != "") {
- param.isOrg = isOrg;
- }
- _self._addShruicode(param, shruicode, perfshruicode);
- _self.reloadPage(param);
- /*this.remoteCall({
- method: "getTeamPersonalTargetData",
- param: {
- personId: personId,
- evaObjName: '',
- isOrg: isOrg
- },
- async: true,
- success: function (data) {
- $.block.hide();
- if (data != null && data.totalCount > 0) {
- //将下达数量为0的考核周期过滤掉
- var periodId = '';
- for (var i = 0, len = data.evaPerfPeriodBeanList.length; i < len; i++) {
- if (data.evaPerfPeriodBeanList[i].evaCountPerPeriod > 0) {
- periodId = data.evaPerfPeriodBeanList[i].periodId;
- break;
- }
- }
- var param = {
- uipk: uipk,
- serviceId: serviceId,
- period: periodId
- }
- if (isOrg != undefined && isOrg != "") {
- param.isOrg = isOrg;
- }
- _self._addShruicode(param, shruicode, perfshruicode);
- _self.reloadPage(param);
- } else {
- _self._showNoneTodoMessage();
- }
- }
- });*/
- },
- /**
- * 团队个人目标评价待办卡片点击处理
- * @param obj
- * @param uipk
- * @param serviceId
- * @param personId
- * @param isOrg
- * @param shruicode
- * @param perfshruicode
- */
- getTeamTargetCommentListAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
- var _self = this;
- $.block.show();
- //打分页面性能优化 by huan_xiong 去掉有无数据判断,直接跳转
- var param = {
- uipk: uipk,
- serviceId: serviceId,
- personId: personId
- }
- _self._addShruicode(param, shruicode, perfshruicode);
- _self.reloadPage(param);
- /* this.remoteCall({
- method: "getTeamTargetCommentList",
- async: true,
- success: function (data) {
- $.block.hide();
- if (data != null && data.totalCount > 0) {
- var periodId = data.evaPerfPeriodBeanList[0].periodId;
- _self.reloadPage({
- uipk: uipk,
- period: periodId,
- serviceId: serviceId,
- personId: personId
- });
- } else {
- _self._showNoneTodoMessage();
- }
- }
- });*/
- },
- /**
- * 我的考核目标待办卡片点击处理
- * @param obj
- * @param uipk
- * @param serviceId
- * @param personId
- * @param isOrg
- * @param shruicode
- * @param perfshruicode
- */
- getMyTargetDataAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
- var _self = this;
- this.remoteCall({
- method: "getMyTargetData",
- param: {
- evaObjName: '',
- isOrg: isOrg
- },
- async: false,
- success: function (data) {
- /*if (data != null && data.length > 0) {*/
- var curPeriodId;
- if (data != null && data.length > 0){
- curPeriodId = data[0];
- }else{
- curPeriodId = '';
- }
- var param = {
- uipk: uipk,
- serviceId: serviceId,
- period: curPeriodId
- }
- _self._addShruicode(param, shruicode, perfshruicode);
- _self.reloadPage(param);
- /*} else {
- _self._showNoneTodoMessage();
- }*/
- }
- });
- },
- /**
- * 我的考核自评待办卡片点击处理
- * @param obj
- * @param uipk
- * @param serviceId
- * @param personId
- * @param isOrg
- * @param shruicode
- * @param perfshruicode
- */
- getPersonalTargetCommentListAction: function (obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
- var _self = this;
- if (_self._hideboardwrap(obj)) {
- return;
- }
- $.block.show();
- var param = {
- personId: personId
- };
- if (isOrg != undefined && isOrg != "") {
- param.isOrg = isOrg;
- }
- this.remoteCall({
- method: "getPersonalTargetCommentList",
- param: param,
- async: true,
- success: function (data) {
- $.block.hide();
- if (data != null && data.length > 0) {
- globalPersonnalTargetData = data;
- _self._loadingSelfAssessmentData(data, obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode);
- } else {
- _self._showNoneTodoMessage2(obj.find(".nameboard"));
- }
- _self._openNameboardList(obj);
- }
- });
- },
- /**
- * 其他绩效待办卡片点击处理
- * @param obj
- * @param uipk
- * @param serviceId
- * @param personId
- */
- othersTodoAction: function (obj, uipk, serviceId, personId) {
- var safeUrl = shr.safeUrl(shr.getContextPath().replace("/shr", "") +
- "/easweb/webviews/workflow/processcenter.jsp?waf2skin=eas&entitypk=" + encodeURIComponent(uipk));
- window.open(safeUrl);
- },
- /**
- * 隐藏卡片下拉显示
- * @private
- */
- _hideboardwrap: function (obj) {
- var boardwrapH = obj.parents('.boardwrap').height();
- if (obj.hasClass('boardfooterclick')) {
- $.block.hide();
- obj.animate({height: boardwrapH + 'px'}, function () {
- obj.removeClass('boardfooterclick');
- obj.removeClass('boxshadow');
- obj.css('z-index', '0');
- });
- return true;
- }
- return false;
- },
- /**
- * 加载【我的考核自评】数据
- * @param data
- * @param obj
- * @param uipk
- * @param serviceId
- * @param personId
- * @param isOrg
- * @param shruicode
- * @param perfshruicode
- * @private
- */
- _loadingSelfAssessmentData: function (data, obj, uipk, serviceId, personId, isOrg, shruicode, perfshruicode) {
- var _self = this;
- var $nameboard = obj.find('.nameboard');
- if (data == undefined || data == null || data == '') {
- _self._showNoneTodoMessage2($nameboard);
- } else {
- $nameboard.html('');
- $nameboard.append(_self._myselfEvalutionLoadList(data));
- }
- //跳转到我的自评打分页面
- obj.find('.megList li .batch, .one_column').each(function (index, el) {
- $(el).live('click', function () {
- var evaObj = $(this).attr("evaobj");
- var periodId = $(this).attr("periodId");
- var gradeTaskNode = $(this).attr("gradeTasknode");
- var wfLevel = $(this).attr("wfLevel");
- //var defaultPage = $('#defaultPage').text();
- if(isOrg == "1") {
- if (defaultPage4Org == 'list') {
- uipk = 'com.kingdee.shr.perfweb.app.perfscoreNew4Org.core'
- }
- }else {
- if (defaultPage == 'list') {
- uipk = 'com.kingdee.shr.perfweb.app.perfscoreNew.core';
- }
- }
- var param = {
- uipk: uipk,
- evaObj: evaObj,
- periodId: periodId,
- personId: personId,
- serviceId: serviceId,
- //personNumber: personNumber,
- entryType: 'myselfEvalu',
- gradeTaskNode: gradeTaskNode,
- wfLevel: wfLevel
- }
- _self._addShruicode(param, shruicode, perfshruicode);
- _self.reloadPage(param);
- });
- })
- },
- /**
- * 我的考核自评待办卡片数据预览Html
- * @param data
- * @private
- */
- _myselfEvalutionLoadList: function (data) {
- var $nameboardTpl = $("#nameboardTpl");
- var nameboardTpl = juicerUtils.parseHtml2JuicerTpl($nameboardTpl.html());
- return juicer(nameboardTpl, {rows: data})
- },
- /**
- * 打开待办卡片预览
- * @param obj
- * @private
- */
- _openNameboardList: function (obj) {
- var board = obj;
- var boardwrapH = obj.parents('.boardwrap').height();
- var nameboard = obj.find('.nameboard');
- var zIndex = $('.boardfooterclick').length + 2;
- board.css('z-index', zIndex);
- obj.addClass('boardfooterclick');
- board.addClass('boxshadow');
- var height = nameboard.innerHeight() + boardwrapH + 10 + 'px';
- board.animate({height: height});
- },
- /**
- * 刷新待办卡片数量
- */
- initDataAction: function (updateCountFlag) {
- $.block.show();
- this.remoteCall({
- method: 'initData',
- param: {
- updateCountFlag: updateCountFlag
- },
- success: function (data) {
- if (data && data.length > 0) {
- for (var item in data) {
- $("div[id='" + item + "']").html(data[item]); // 刷新待办数
- }
- }
- $.block.hide();
- }
- });
- },
- /**
- * 初始化右侧区域
- * @param contentIndex 1:显示绩效待办 2:显示业绩数据 3:显示iframe
- * @param uipk iframe的src
- * @param iframeName 兼容老代码,有些地方iframe的子页面需要根据父页面iframe名称来定位
- * @param shruicode
- * @param perfshruicode
- */
- initRightContent: function (contentIndex, uipk, iframeName, shruicode, perfshruicode) {
- var $rightContentArea = $("#rightContentArea");
- var $otherContent = $rightContentArea.find("div.content[index!='" + contentIndex + "']");
- var $content;
- if ($rightContentArea != undefined) {
- $content = $rightContentArea.find("div.content[index='" + contentIndex + "']");
- }
- // 右侧显示iframe
- if (contentIndex == this._SHOW_IFRAME) {
- if (uipk == undefined) {
- return;
- }
- $otherContent.hide();
- $content.remove();
- } else if ($content.length > 0) {
- // 右侧区域已渲染的情况下,重新渲染待办卡片数即可
- this.initDataAction(contentIndex + "");
- if (contentIndex == this._SHOW_TODO) {
- this.initMyOngoingData(); // 初始化我参与进行中的考核;
- }
- $otherContent.hide();
- $content.show();
- return;
- }
- $otherContent.hide();
- // 根据视图配置模板解析右侧区域
- this._parseRightContent(contentIndex, uipk, iframeName, shruicode, perfshruicode);
- },
- /**
- * 初始化绩效待办区域
- */
- initTodoContent: function (breadcrumb) {
- if (breadcrumb == undefined) {
- breadcrumb = $("li[for='myEvaluationContent']").attr("breadcrumbValue");
- }
- this.initRightContent(this._SHOW_TODO);
- var resourceTag = shr.getUrlRequestParam("resourceTag");
- var url = window.location.href;
- if (resourceTag != "" && resourceTag != undefined) {
- url = url.replace(/(&resourceTag=.*?)&/g, '&');
- window.history.pushState({}, 0, url);
- }
- this.initNavigationStore({
- uipk: shr.getCurrentViewPage().uipk,
- name: breadcrumb,
- url: url
- });
- this.cardClickEvent();
- },
- /**
- * 初始化业绩数据待办区域
- */
- initAxvTodoContent: function (breadcrumb) {
- this.initRightContent(this._SHOW_AXVTODO);
- var uipk = shr.getCurrentViewPage().uipk;
- var resourceTag = shr.getUrlRequestParam("resourceTag");
- if (resourceTag == "" || resourceTag == undefined) {
- uipk += "&resourceTag=achivementData";
- }
- this.initNavigationStore({
- uipk: uipk,
- name: breadcrumb
- });
- this.cardClickEvent();
- },
- /**
- * 初始化iframe区域
- */
- initIframeContent: function (uipk, iframeName, shruicode, perfshruicode) {
- if (iframeName == "" || iframeName == undefined) {
- iframeName = "rightContentIframe";
- }
- this.initRightContent(this._SHOW_IFRAME, uipk, iframeName, shruicode, perfshruicode);
- },
- /**
- * 初始化面包屑导航数据
- */
- initNavigationStore: function (item) {
- var items = shrDataManager.pageNavigationStore.getDatas();
- if (typeof items != "undefined" && items.length == 2) {
- var oldUipk = items[1].uipk;
- var newUipk = item['uipk'];
- var newUrl = item['url'];
- items[1].name = item['name'];
- items[1].uipk = newUipk;
- if (newUrl != undefined && newUrl != "") {
- items[1].url = newUrl;
- } else {
- items[1].url = items[1].url.replace(oldUipk, newUipk);
- }
- shrDataManager.pageNavigationStore.setDatas(items);
- }
- },
- /**
- * 初始化我参与进行中的考核
- */
- initMyOngoingData: function () {
- $.block.show();
- var _self = this;
- var $rightContentArea = $("#rightContentArea");
- var $myOngoingTpl = $("#myOngoingTpl");
- var myOngoingTpl = juicerUtils.parseHtml2JuicerTpl($myOngoingTpl.html());
- this.remoteCall({
- method: "getMyOngoingAsmtList",
- async: true,
- param: {rows: $myOngoingTpl.attr("rows")},
- success: function (result) {
- if (result && null != result.baseData && result.baseData != undefined) {
- var baseData = result.baseData;
- var processViewData = result.processViewData;
- var rows = [];
- for (var i = 0; i < baseData.length; i++) {
- var item = baseData[i];
- var it = {};
- it.planname = item["perfPlan.name"] ? item["perfPlan.name"] : ' ';
- if(0===item["evaObj.isOrg"].value){
- it.objname = item["person.name"];
- }else {
- it.objname = item["adminOrgUnit.name"];
- }
- it.asignmentPoolID = item["asignmentPool.id"];
- var processViewDatas = processViewData.data;
- var datas = {};
- for (var k = 0; k < processViewDatas.length; k++) {
- var elem = processViewDatas[k][0][0][0];
- if (elem.asignmentPoolID == it.asignmentPoolID) {
- datas.data = processViewDatas[k];
- break;
- }
- }
- datas.photo = processViewData.photo;
- var processViewHtml = generateProcessView(datas);
- it.processViewHtml = processViewHtml
- rows.push(it);
- }
- $rightContentArea.find('#ongoingRows').html(juicer(myOngoingTpl, {rows: rows}));
- }
- _self._myOngoingViewClick();
- $.block.hide();
- }
- });
- },
- /**
- * 显示暂无待办事项
- * @private
- */
- _showNoneTodoMessage: function () {
- shr.showInfo({
- message: $("#todoMessage1").attr("value"),
- hideAfter: 3
- })
- },
- /**
- * 显示暂无待办事项
- * @param obj
- * @private
- */
- _showNoneTodoMessage2: function (obj) {
- obj.html($("#todoMessage2").html());
- },
- /**
- * 根据视图配置模板解析右侧区域
- * @param contentIndex
- * @param uipk
- * @param iframeName
- * @private
- */
- _parseRightContent: function (contentIndex, uipk, iframeName, shruicode, perfshruicode) {
- var _self = this;
- var $rightContentArea = $("#rightContentArea");
- var $workAreaDiv = $('#workAreaDiv');
- var rightContentTpl = juicerUtils.parseHtml2JuicerTpl($("#rightContentTpl" + contentIndex).html());
- var minHeight = $(window).height() - $('.menu').offset().top - 5;
- var serviceId = shr.getUrlRequestParam("serviceId", window.location.href);
- if (uipk != undefined && uipk != "" && uipk.indexOf("serviceId") < 0) {
- uipk += "&serviceId=" + serviceId;
- }
- var param = {
- minheight: minHeight,
- width: $rightContentArea.width(),
- src: shr.getContextPath() + "/dynamic.do?uipk=" + decodeURIComponent(uipk),
- iframeName: iframeName
- }
- if (shruicode != undefined && shruicode != "") {
- param.src += "&shruicode=" + shruicode;
- }
- if (perfshruicode != undefined && perfshruicode != "") {
- param.src += "&perfshruicode=" + perfshruicode;
- }
- var parseRightHtml = $(juicer(rightContentTpl, param));
- $rightContentArea.append(parseRightHtml);
- $workAreaDiv.append($rightContentArea);
- if (contentIndex != this._SHOW_IFRAME) {
- var $cardTpl = $("#cardTpl" + contentIndex);
- var $orgCardTpl = $("#orgCardTpl" + contentIndex);
- var $content = $rightContentArea.find("div.content[index='" + contentIndex + "']")
- this._parseCardTpl($cardTpl, $content.find('.todo'), "0");
- this._parseCardTpl($orgCardTpl, $content.find('.orgtodo'), "1");
- } else if (uipk != undefined && uipk != "") {
- var $iframe = $rightContentArea.find("iframe[name='" + iframeName + "']");
- $.block.show({
- text: $iframe.attr("loadtext")
- });
- $iframe.css('min-height', minHeight + 'px');
- $iframe.load(function () {
- $.block.hide();
- });
- }
- },
- /**
- * 菜单点击样式控制
- * @param obj
- */
- _menuClickStyle: function (obj) {
- var $this = obj;
- var currentClass = 'selectedmenu';
- if (obj.closest('ul').hasClass('menu_second')) { //二级菜单
- $this = obj.closest('li');
- currentClass = 'subCurrentSelsct';
- }
- var borderleft = $this.parent().find('.borderleft');
- var index = $this.index();
- $('.' + currentClass).removeClass(currentClass);
- obj.addClass(currentClass);
- if (obj.attr('hasSecondMenu') == 'true') {
- var secondMenu = obj.find('.menu_second');
- if (secondMenu.is(':hidden')) {
- $('.menu_second').hide();
- secondMenu.show();
- } else {
- secondMenu.hide();
- }
- } else if (obj.closest('ul').hasClass('menu_list')) {
- $('.menu_second').hide();
- $('.subCurrentSelsct').removeClass('subCurrentSelsct');
- }
- var top = (parseInt($this.css("margin-bottom")) + $this.height()) * index + 'px';
- borderleft.animate({top: top}, 100);
- },
- /**
- * 我参与进行中的考核点击事件
- */
- _myOngoingViewClick: function () {
- var _self = this;
- $('.linkstyle').unbind('click').bind('click', function () {
- var li = $(this).parent('li');
- var chart = li.find('.assessment_chart');
- if (!$(this).hasClass('viewapread')) {
- li.animate({height: 57 + chart.innerHeight() + 'px'});
- $(this).addClass('viewapread');
- li.addClass('boxshadow');
- } else {
- li.animate({height: '57px'}, function () {
- li.removeClass('boxshadow');
- });
- $(this).removeClass('viewapread');
- }
- });
- $('.more').die('click').live('click', function () {
- uipk = $(this).attr("uipk");
- _self.reloadPage({
- uipk: uipk,
- serviceId: '' //处理点击更多报500的问题 R20200401-2163
- });
- });
- },
- /**
- * 解析视图待办卡片模板
- * @param $cardTpl
- * @param $appendTo
- * @param isOrg 是否组织考核
- */
- _parseCardTpl: function ($cardTpl, $appendTo, isOrg) {
- var $cardParseTpl = juicerUtils.parseHtml2JuicerTpl($("#cardTpl").html());
- $cardTpl.find("cardx").each(function () {
- var param = {
- title: $(this).attr("title"), // 卡片标题
- desc: $(this).attr("desc"), // 卡片描述
- count: $(this).attr("count"), // 待办数
- uipk: $(this).attr("uipk"),
- serviceid: $(this).attr("serviceid"),
- countflag: $(this).attr("countflag"), // 更新待办数id
- display: $(this).attr("display"), // 是否可见
- action: $(this).attr("action"), // 点击执行自定义方法,
- isOrg: isOrg, // 是否组织考核
- iframe: $(this).attr("iframe"),
- shruicode: $(this).attr("shruicode"), // 交叉视图拆分入口携带参数
- perfshruicode: $(this).attr("perfshruicode"), // 子页面交叉视图拆分入口携带参数
- }
- if (param.display == "true" || param.display == undefined) {
- $(juicer($cardParseTpl, param)).appendTo($appendTo);
- }
- });
- },
- /**
- * yien 补丁11 根据权限是否隐藏个人、组织填报的面板
- */
- initPersonAndOrgCardPanel: function() {
- if($('#cardTpl1 cardx[display="true"]').length < 1) {
- $('.content[index="1"] .todo').remove();
- }
- if($('#orgCardTpl1 cardx[display="true"]').length < 1) {
- $('.orgtodo').remove();
- }
- },
- /**
- * 给param添加shruicode参数
- * @param param
- * @param shruicode
- * @param perfshruicode
- * @private
- */
- _addShruicode: function(param, shruicode, perfshruicode) {
- if (shruicode != undefined && shruicode != "") {
- param.shruicode = shruicode;
- }
- if (perfshruicode != undefined && perfshruicode != "") {
- param.perfshruicode = perfshruicode;
- }
- }
- });
- /**
- * 阻止事件冒泡
- * @param event
- */
- function stopEvent(event) {
- var e = arguments.callee.caller.arguments[0] || event;//这里是因为除了IE有event其他浏览器没有所以要做兼容
- if (e && e.stopPropagation) { //其他浏览器
- e.stopPropagation();
- } else if (window.event) { //IE浏览器
- e.cancelBubble = true;
- }
- }
- function setIframeHeight(id) {
- shr.setIframeHeight(id);
- }
|