| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- var prjKey = "";
- function loadLeftMenu() {
- var prjKey = $("[name='prjKey']").val();
- var params = {
- "prjType" : "2",
- "prjKey" : prjKey
- };
- sendAsyncAjax(params, "toMain.do", "json", loadLeftMenuProcess);
- }
- function loadLeftMenuProcess(data) {
- var html = '';
- for (var i = 0; i < data.length; i++) {
- html += '<div title="' + data[i].text + '">';
- html += '<div style="height: 7px;"></div>';
- html += '<ul id="' + data[i].key
- + '" class="tree" style="margin-top: 3px;">';
- html += '</div> ';
- }
- if (html != '') {
- $("#accordion1").append($(html));
- }
- loadAccord();
- }
- function f_tree(treeId) {
- var raRegExp = new RegExp(":", "g");
- var url = "loadMenu.do?key=" + treeId + "&prjKey=" + prjKey + "&t="
- + new Date().getTime();
- url = url.replace(raRegExp, "__");
- treeId = treeId.replace(raRegExp, "\\:");
- $("#" + treeId).ligerTree(
- {
- url : url,
- checkbox : false,
- slide : false,
- openFolderEven : true,
- nodeWidth : 120,
- attribute : [ 'nodename', 'url', 'hide', 'target' ],
- onSelect : function(node) {
- if (node.data == null || !node.data.url)
- return;
- var tabid = $(node.target).attr("tabid");
- if (!tabid) {
- tabid = node.data.url;
- $(node.target).attr("tabid", tabid);
- }
- var target = node.data.target;
- if (target == '_blank') {
- window.open(node.data.url, node.data.text);
- } else {
- var isSms = node.data.isSms; // sms-chenjb-change
- if (isSms == "1") {
- f_addTab(tabid, node.data.text,
- "SmsAction.do?task=validate_sms&return_tab="
- + node.data.url);
- } else {
- f_addTab(tabid, node.data.text, node.data.url);
- }
- }
- },
- onAppend : function(parentNode, newdata) {
- if (newdata.length == 1 && newdata[0] == null) {
- $("#" + treeId).parent().prev().remove();
- $("#" + treeId).parent().remove();
- }
- },
- onSuccess : function(e) {
- if (!e[0])
- return;
- var from = e[0].text;
- $(".l-ln").each(function() {
- var obj = $(this).parent();
- var tree = $(this).parents(".l-tree");
- var target = "-" + $(tree).attr("id");
- if (from == target) {
- $(obj).height($(this).height());
- }
- });
- }
- });
- }
- function toRecList() {
- var tabid = "ligerui" + new Date().toDateString();
- addTab(tabid, "消息接收列表", "toRecieveMsgList.do?date=" + new Date());
- }
- function changeDept() {
- var cot = $("#followDepts").html();
- dialog = $.ligerDialog.open({
- title : '在职部门',
- content : cot
- });
- }
- function changeFaces() {
- var cot = $("#indexfaces").html();
- dialog = $.ligerDialog.open({
- title : '选择皮肤',
- content : cot
- });
- }
- function loadClient() {
- var cot = $("#dclient").html();
- dialog = $.ligerDialog.open({
- title : '下载EU客户端',
- content : cot
- });
- }
- function logoutSystem() {
- var rs = confirm("是否退出系统");
- if (rs == true)
- submitTargetAUrl("logout.do", "_top");
- if (rs == false)
- return false;
- }
- function hide() {
- $("#heard1").hide();
- $("body").removeClass("index_body_hidden");
- $("#heard").removeClass("heard_hidden");
- $("#heard").height("35px");
- $("#er_heard").height("35px");
- $(".heard1_1_2").html();
- layout._onResize();
- }
- function show() {
- $("#heard1").show();
- $("body").addClass("index_body_hidden");
- $("#heard").addClass("heard_hidden");
- $("#heard").height("90px");
- $("#er_heard").height("90px");
- layout._onResize();
- }
- function hide2() {
- $(".heard1_1_1").hide();
- $("#weather_show").hide();
- $(".time").hide();
- $(".heard1_3").hide();
- $("body").removeClass("index_body_hidden");
- $("#heard").removeClass("heard_hidden");
- $("#heard").height("35px");
- $("#er_heard").height("35px");
- $(".heard1_1_2").html();
- // liger/lib/ligerUI/skins/Aqua/images/index/down.png
- $("#hidetop")
- .css("background",
- "url(liger/lib/ligerUI/skins/Aqua/images/index/down.png) no-repeat center left");
- $("#hidetop").hover(function() {
- $("#hidetop")
- .css("background",
- "url(liger/lib/ligerUI/skins/Aqua/images/index/down_hover.png) no-repeat center left");
- },function() {
- $("#hidetop")
- .css("background",
- "url(liger/lib/ligerUI/skins/Aqua/images/index/down.png) no-repeat center left");
- });
- // $("#hidetop").text("显示顶部");
- $("#hidetop").attr("title","显示顶部");
- document.getElementById('hidetop').onclick = function() {
- show2();
- };
- layout._onResize();
- }
- function show2() {
- $(".heard1_1_1").show();
- $("#weather_show").show();
- $(".time").show();
- $(".heard1_3").show();
- $("body").addClass("index_body_hidden");
- $("#heard").addClass("heard_hidden");
- $("#heard").height("90px");
- $("#er_heard").height("90px");
- $("#hidetop")
- .css("background",
- "url(liger/lib/ligerUI/skins/Aqua/images/index/up.png) no-repeat center left");
- // $("#hidetop").text("隐藏顶部");
- $("#hidetop").attr("title","隐藏顶部");
- $("#hidetop").hover(function() {
- $("#hidetop")
- .css("background",
- "url(liger/lib/ligerUI/skins/Aqua/images/index/up_hover.png) no-repeat center left");
- },function() {
- $("#hidetop")
- .css("background",
- "url(liger/lib/ligerUI/skins/Aqua/images/index/up.png) no-repeat center left");
- });
- document.getElementById('hidetop').onclick = function() {
- hide2();
- };
- layout._onResize();
- }
- function showDutyMsg() {
- $.ligerDialog.open({
- width : 380,
- height : 400,
- title : '岗位职责',
- url : 'getPositionDes.do'
- });
- }
- function headHide() {
- if (navigator.appName == "Microsoft Internet Explorer"
- && navigator.appVersion.match(/7./i) == "7.") {
- $("#showtop").hide();
- $("#hidetop").hide();
- } else {
- $("#showtop").show();
- $("#hidetop").show();
- }
- }
- function loadMenu(e) {
- var treeId = $(".tree", $(e).next()).attr("id");
- var h = $("li", $(".tree", $(e).next()));
- if (h.length != 0)
- return;
- f_tree(treeId);
- manager = $("#" + treeId).ligerGetTreeManager();
- if (manager == null)
- return;
- manager.expandAll();
- }
- function changeMenu(e, prname) {
- $(".l-layout-header-inner").html(prname);
- var param = {
- 'prjType' : '1',
- 'prjKey' : e
- };
- prjKey = e;
- sendAsyncAjax(param, "toMain.do", "html", backCall);
- }
- function backCall(data) {
- $("#accordion1").empty();
- $("#accordion1").append(data);
- accordion._render();
- }
- function findTabContent() {
- tab = $("#framecenter").ligerGetTabManager();
- return tab;
- }
- function f_heightChanged(options) {
- if (tab)
- tab.addHeight(options.diff);
- if (accordion && options.middleHeight - 24 > 0)
- accordion.setHeight(options.middleHeight - 24);
- }
- function f_addTab(tabid, text, url) {
- // 2014-11-14 cxx 点击菜单刷新页面
- if (tab.isTabItemExist(tabid)) {
- tab.selectTabItem(tabid);
- tab.reload(tabid);
- } else {
- tab.addTabItem({
- tabid : tabid,
- text : text,
- url : url
- });
- }
- }
- function f_closeTab(tabid) {
- tab.removeTabItem(tabid);
- // tab.removeSelectedTabItem();
- }
- function f_reloadTab(tabid) {
- tab.reload(tabid);
- }
- function f_selectTab(tabid) {
- tab.selectTabItem(tabid);
- }
- function successMsg(msg) {
- $.ligerDialog.success(msg);
- }
- function errorMsg(msg) {
- $.ligerDialog.error(msg);
- }
- function confirmDialog(content, backValidate) {
- $.ligerDialog.confirm(content, backValidate);
- }
- function openDialog(option) {
- return $.ligerDialog.open(option);
- }
- function waitMsg(msg, time) {
- $.ligerDialog.waitting(msg);
- setTimeout(function() {
- $.ligerDialog.closeWaitting();
- }, time);
- }
- function configType() {
- $("#client").val("1");
- }
- function loadConfigType() {
- return $("#client").val();
- }
|