123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- $(document).ready(function() {
- $(".unlogin").removeClass("displayNone");
- var footerHeight = $("footer").outerHeight(true);
- $('#container').css("padding-bottom", footerHeight + "px");
-
- $(window).resize(function() {
- footerHeight = $("footer").outerHeight(true);
- $('#container').css("padding-bottom", footerHeight + "px");
-
- });
- $(document).scroll(function() {
- var top = $(document).scrollTop();
- if(top == 0) {
- $(".navheader").removeClass("navhdown");
- } else {
- $(".navheader").addClass("navhdown");
- }
- })
-
- $("#exitLogin").on("click", function() {
- exit();
- })
-
- var orgId = $.cookie("orgId");
- if(orgId && orgId != "null" && orgId != null) {
- $(".unlogin").addClass("displayNone");
- $(".onlogin").removeClass("displayNone");
- $.ajax("/ajax/image/hasOrgLogo", {
- data: {
- "id": orgId
- },
- type: "GET",
- dataType: 'json',
- async: false,
- success: function($data) {
- if($data.success) {
- if($data.data) {
- $("#imglogo").attr("src", "/images/org/" + orgId + ".jpg");
- }
- }
- },
- error: function() {
- $.MsgBox.Alert('提示', '服务器请求失败')
- },
- });
- } else {
- $(".unlogin").removeClass("displayNone");
- $(".onlogin").addClass("displayNone");
- }
- });
- function modelOpen() {
- $(".blackcover").fadeIn();
- $(".modelContain").slideDown();
- $("body").addClass("modelOpen");
- }
- function modelClose() {
- $(".modelContain").slideUp();
- $(".blackcover").fadeOut();
- $("body").removeClass("modelOpen");
- }
- function exit() {
- $.cookie('orgId', null, {
- path: "/"
- });
- $.cookie('orgAuth', null, {
- path: "/"
- });
- $.cookie('orgEmail', null, {
- path: "/"
- });
- $.cookie('orgName', null, {
- path: "/"
- });
- $.cookie('orgType', null, {
- path: "/"
- });
- location.href = "cmp-settled-log.html"
- }
- function GetQueryString(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
- var r = window.location.search.substr(1).match(reg);
- var context = "";
- if(r != null)
- context = r[2];
- reg = null;
- r = null;
- return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
- }
- function changeTime(dealtime) {
- var s = dealtime;
-
- if(dealtime.length == 8) {
- var y = s.substr(0, 4);
- var m = s.substr(4, 2);
- var d = s.substr(6, 2);
- var formatTime = y + "-" + m + "-" + d;
- return formatTime;
- } else {
- var y = s.substr(0, 4);
- var m = s.substr(4, 2);
- var d = s.substr(6, 2);
- var h = s.substr(8, 2);
- var minute = s.substr(10, 2);
- var formatTime = y + "-" + m + "-" + d + " " + h + ":" + minute;
- return formatTime;
- }
- }
- function replaceStr(s) {
- var pattern = new RegExp("-");
- var rs = "";
- for(var i = 0; i < s.length; i++) {
- rs = rs + s.substr(i, 1).replace(pattern, '');
- }
- return rs;
- }
- var hash = {
- 'qq.com': 'http://mail.qq.com',
- 'gmail.com': 'http://mail.google.com',
- 'sina.com': 'http://mail.sina.com.cn',
- '163.com': 'http://mail.163.com',
- '126.com': 'http://mail.126.com',
- 'yeah.net': 'http://www.yeah.net/',
- 'sohu.com': 'http://mail.sohu.com/',
- 'tom.com': 'http://mail.tom.com/',
- 'sogou.com': 'http://mail.sogou.com/',
- '139.com': 'http://mail.10086.cn/',
- 'hotmail.com': 'http://www.hotmail.com',
- 'live.com': 'http://login.live.com/',
- 'live.cn': 'http://login.live.cn/',
- 'live.com.cn': 'http://login.live.com.cn',
- '189.com': 'http://webmail16.189.cn/webmail/',
- 'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
- 'yahoo.cn': 'http://mail.cn.yahoo.com/',
- 'eyou.com': 'http://www.eyou.com/',
- '21cn.com': 'http://mail.21cn.com/',
- '188.com': 'http://www.188.com/',
- 'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
- 'foxmail.coom': 'http://www.foxmail.com'
- };
- function autho() {
- if(arguments[0] == 1) {
- return {
- "sty": "authicon-pro",
- "title": "科袖认证专家"
- }
- } else {
- if(arguments[1] == 1) {
- return {
- "sty": "authicon-staff-ok",
- "title": "企业认证员工"
- }
- } else {
- if(arguments[2] == 3) {
- return {
- "sty": "authicon-real",
- "title": "实名认证用户"
- }
- } else {
- return {
- "sty": "e",
- "title": " "
- }
- }
- }
- }
- }
- $(document).on("click", "#Province li a", function() {
- var aVal = $(this).text();
- $(this).parent().parent().parent().find('.mr_show').text(aVal);
- $(this).parent().parent().parent().find('input[name=cho_Province]').val(aVal);
- if($("#oprovince").text() == "请选择企业总部所在省或直辖市") {
- $("#oprovince").removeClass("mr_select");
- $("#ocity").removeClass("mr_select");
- } else {
- $("#oprovince").addClass("mr_select");
- $("#ocity").removeClass("mr_select");
- }
- });
- $(document).on("click", "#City li a", function() {
- var aVal = $(this).text();
- $(this).parent().parent().parent().find('.mr_show').text(aVal);
- $(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
- if($("#ocity").text() == "请选择企业总部所在城市") {
- $("#ocity").removeClass("mr_select");
- } else {
- $("#ocity").addClass("mr_select");
- }
- });
- function hotKey(sel) {
- $(sel).bind({
- paste: function(e) {
- var pastedText;
- if (window.clipboardData && window.clipboardData.getData) {
-
- pastedText = $(this).val() + window.clipboardData.getData('Text');
- }
- else {
- pastedText = $(this).val() + e.originalEvent.clipboardData.getData('Text');
-
- }
- $(this).val(pastedText);
- var $this = $(this);
- setTimeout(function() {
- if($this.val().trim()) {
- $this.siblings("button").show();
- } else {
- $this.siblings("button").hide();
- }
- }, 1);
- e.preventDefault();
- },
- cut: function(e) {
- var $this = $(this);
- setTimeout(function() {
- if($this.val().trim()) {
- $this.siblings("button").show();
- } else {
- $this.siblings("button").hide();
- }
- }, 1);
- },
- blur: function() {
- var $this = $(this);
- setTimeout(function() {
- $this.siblings(".keydrop").hide();
- }, 500)
- },
- focus: function() {
- $(this).siblings(".keydrop").show();
- },
- keyup: function(e) {
- if($(this).val().trim()) {
- $(this).siblings("button").show();
- var lNum = $.trim($(this).val()).length;
- if(0 < lNum) {
- var $this = $(this)
- $("#addKeyword").show();
- $.ajax({
- "url": "/ajax/dataDict/qaHotKey",
- "type": "GET",
- "success": function(data) {
- console.log(data);
- if(data.success) {
- if(data.data.length == 0) {
- $this.siblings(".keydrop").addClass("displayNone");
- $this.siblings(".keydrop").find("ul").html("");
- } else {
- $this.siblings(".keydrop").removeClass("displayNone");
- var oSr = "";
- for(var i = 0; i < data.data.length; i++) {
- oSr += '<li>' + data.data[i].caption + '<div class="closeThis"></div></li>';
- }
- $this.siblings(".keydrop").find("ul").html(oSr);
- }
- } else {
- $this.siblings(".keydrop").addClass("displayNone");
- $this.siblings(".keydrop").find("ul").html("");
- }
- },
- "data": {
- "key": $(this).val()
- },
- dataType: "json",
- 'error': function() {
- $.MsgBox.Alert('提示', '服务器连接超时!');
- }
- });
- }
- } else {
- $(this).siblings("button").hide();
- $(this).siblings(".keydrop").addClass("displayNone");
- $(this).siblings(".keydrop").find("ul").html("");
- }
- }
- })
- $(".keydrop").on("click", "li", function() {
- var oValue = $(this).text();
- var oJudge = $(this).parents(".col-w-12").siblings().find("ul.ulspace li");
- var addNum=$(this).parents(".keydrop").siblings("input").attr("data-num");
-
- for(var i = 0; i < oJudge.length; i++) {
- if(oValue == oJudge[i].innerText) {
- $.MsgBox.Alert('提示', '添加内容不能重复');
- return;
- }
- }
- $(this).parents(".col-w-12").siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
- $(this).parents(".keydrop").siblings("input").val("");
- $(this).parents(".keydrop").siblings("button").hide();
- if(oJudge.length == addNum-1) {
- $(this).parents(".keydrop").siblings("input").val("");
- $(this).parents(".col-w-12").hide();
- }
- $(this).parent("ul").html("")
- })
-
- $("button:contains('添加')").click(function() {
- var oValue = $(this).siblings("input").val().trim();
- var oJudge = $(this).parent().siblings().find("ul.ulspace li");
- var addContent=$(this).siblings("input").attr("data-pro");
- var addNum=$(this).siblings("input").attr("data-num");
- var addfontSizeNum=$(this).siblings("input").attr("data-fontSizeN");
- if(!oValue) {
- $.MsgBox.Alert('提示', '请先填写内容');
- return;
- }
- if(oValue.length > addfontSizeNum) {
- $.MsgBox.Alert('提示', addContent);
- return;
- }
- for(var i = 0; i < oJudge.length; i++) {
- if(oValue == oJudge[i].innerText) {
- $.MsgBox.Alert('提示', '添加内容不能重复');
- return;
- }
- }
- $(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
- $(this).hide();
- $(this).siblings("input").val("");
- if(oJudge.length == addNum-1) {
- $(this).val("").parents(".col-w-12").hide();
- }
- $(this).siblings(".keydrop").find("ul").html("");
- })
- }
- function TimeTr(dealtime) {
- var myDate = new Date();
- var s = dealtime;
- var y = s.substr(0, 4);
- var m = s.substr(4, 2);
- var d = s.substr(6, 2);
- var h = s.substr(8, 2);
- var minute = s.substr(10, 2);
- var formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
- if(y != myDate.getFullYear()) {
- formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
- }
- return formatTime;
- }
|