| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852 |
- function FindParam(url111, name) {
- var url = url111; //获取url中"?"符后的字串
- var theRequest = new Object();
- if (url.indexOf("?") != -1) {
- var str = url.substr(url.indexOf("?") + 1);
- strs = str.split("&");
- for (var i = 0; i < strs.length; i++) {
- theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
- }
- }
-
- return theRequest[name];
-
-
- }
-
-
-
-
- /**
- * 跟随元素显示 follow_id:跟随元素id, title:弹出层标题,可空, htmlContent:显示的HTML片段
- */
- function followAlertHtml(follow_id, title, htmlContent) {
- if (!follow_id) {} else {
- if (!htmlContent) {
- return;
- }
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $('#' + follow_id).hover(function() {
- dialog = artDialog({
- // id : 'follow',
- title: title,
- fixed: false,
- // cancel: true,
- // cancelVal:"关闭",
- lock: false,
- padding: '0',
- content: htmlContent,
- follow: document.getElementById(follow_id),
- });
- dialog.flag = false;
-
- /**
- * for(var i in dialog){ console.log(i); }
- */
- }, function() {
- closeFollowDialog(dialog);
- });
- }
- }
- /**
- * 跟随元素显示 follow_dom:跟随dom元素, title:弹出层标题,可空, htmlContent:显示的HTML片段
- */
- function followAlertHtmlByDom(follow_dom, title, htmlContent) {
- if (!follow_dom) {} else {
- if (!htmlContent) {
- return;
- }
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $(follow_dom).hover(function() {
- dialog = artDialog({
- // id : 'follow',
- title: title,
- fixed: false,
- // cancel: true,
- // cancelVal:"关闭",
- lock: false,
- padding: '0',
- content: htmlContent,
- follow: follow_dom
- });
- dialog.flag = false;
- }, function() {
- closeFollowDialog(dialog);
- });
- }
- }
-
- function followAjaxAlterHtmlByDom(follow_dom, title, helpHaShCode) {
- if (!follow_dom) {} else {
- if (!helpHaShCode) {
- return;
- }
- var htmlContent = null;
- $
- .ajax({
- url: "/service?ssServ=queryHelpByHaHex",
- type: "POST",
- data: {
- helpHaHex: helpHaShCode
- },
- async: false,
- success: function(data) {
- htmlContent = '<html><head><title></title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body>' +
- '代码:' +
- helpHaShCode +
- '<br>' +
- data +
- '</body></html>';
- }
- });
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $(follow_dom).hover(function() {
- dialog = artDialog({
- // id : 'follow',
- title: title,
- fixed: false,
- // cancel: true,
- // cancelVal:"关闭",
- lock: false,
- padding: '0',
- content: htmlContent,
- follow: follow_dom
- });
- dialog.flag = false;
- }, function() {
- closeFollowDialog(dialog);
- });
- }
- }
-
- function followAlertHtml1(follow_id, title, htmlContent) {
- if (!follow_id) {} else {
- if (!htmlContent) {
- return;
- }
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $('#' + follow_id).hover(function() {
- dialog = artDialog({
- // id : 'follow',
- title: title,
- fixed: false,
- // cancel: true,
- // cancelVal:"关闭",
- lock: false,
- padding: '0',
- content: htmlContent,
- follow: document.getElementById(follow_id)
- });
- dialog.flag = false;
- }, function() {
- closeFollowDialog(dialog);
- });
- }
- }
- /**
- * 跟随元素显示 follow_id:元素id, url:显示的url页面路径, title:弹出层标题,可空 param:传递参数
- * ,格式:name1=value1&name2=value2&name3=value3
- */
- function followAlertUrlByid(follow_id, title, url, param) {
- if (!follow_id) {} else {
- if (!url) {
- return;
- }
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $('#' + follow_id).hover(function() {
- $.ajax({
- // async : false,
- url: url,
- data: param,
- success: function(data) {
- if (data != null && data != "") {
- dialog = art.dialog({
- // id : 'follow1',
- title: title,
- // cancel: true,
- // cancelVal:"关闭",
- fixed: false,
- lock: false,
- overflow: "auto",
- padding: '0',
- content: data,
- follow: document.getElementById(follow_id)
- });
- }
- },
- cache: false
- });
- }, function() {
-
- });
-
- }
- }
- /**
- * 跟随元素显示 follow_object:元素对象(jquery对象), url:显示的url页面路径, title:弹出层标题,可空
- * param:传递参数 ,格式:name1=value1&name2=value2&name3=value3
- */
- function followAlertUrlByObject(follow_object, title, url, param) {
- if (!follow_object) {} else {
- if (!url) {
- return;
- }
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $(follow_object).hover(function() {
- $.ajax({
- // async : false,
- url: url,
- data: param,
- success: function(data) {
- if (data != null && data != "") {
- dialog = art.dialog({
- // id : 'follow_object',
- title: title,
- // cancel: true,
- // cancelVal:"关闭",
- fixed: true,
- lock: false,
- overflow: "auto",
- padding: '0',
- content: data,
- follow: follow_object.get(0)
- });
- }
- },
- cache: false
- });
- dialog.flag = false;
- }, function() {
- closeFollowDialog(dialog);
- });
-
- }
- }
- /**
- * 跟随元素显示 follow_dom:元素对象(dom对象), url:显示的url页面路径, title:弹出层标题,可空 param:传递参数
- * ,格式:name1=value1&name2=value2&name3=value3
- */
- function followAlertUrlByDom(follow_dom, title, url, param) {
- if (!follow_dom) {} else {
- if (!url) {
- return;
- }
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $(follow_dom).hover(function() {
- $.ajax({
- // async : false,
- url: url,
- data: param,
- success: function(data) {
- if (data != null && data != "") {
- dialog = art.dialog({
- // id : 'follow_dom',
- title: title,
- // cancel: true,
- // cancelVal:"关闭",
- fixed: true,
- lock: false,
- overflow: "auto",
- padding: '0',
- content: data,
- follow: follow_dom
- });
- }
- },
- cache: false
- });
- dialog.flag = false;
- }, function() {
- closeFollowDialog(dialog);
- });
-
- }
- }
-
- function followAlertHelp(title, url, appName) {
- if (!url || appName == null || appName.trim() == "") {
- return;
- }
- $("[wdHelp]").each(
- function(i) {
- var follow_object = $(this);
- var helpCode = $(this).attr("wdHelp");
- if (follow_object != null && helpCode != null &&
- helpCode.trim() != "") {
- followAlertUrlByObject(follow_object, title, url,
- "helpCode=" + helpCode + "&appName=" + appName);
- }
- });
- }
-
- function onFollowAlertHelp(follow_dom, title, url, helpCode) {
- var param = "helpCode=" + helpCode;
- $.ajax({
- // async : false,
- url: url,
- data: param,
- success: function(data) {
- if (data != null && data != "") {
- var dialog = art.dialog({
- id: 'follow_dom',
- title: title,
- // cancel: true,
- // cancelVal:"关闭",
- fixed: true,
- lock: false,
- overflow: "auto",
- padding: '0',
- content: data,
- follow: follow_dom
- });
- if (dialog != null) {
- dialog.DOM.wrap.bind('mouseleave', function() {
- dialog.close();
- });
- }
- }
- },
- cache: false
- });
- }
-
-
- //右键显示(根据id)
- function onRightfollowAlertHtml(follow_id, title, htmlContent) {
- if (!follow_id) {} else {
- if (!htmlContent) {
- return;
- }
- var dialog = null;
- if (title == null || title == "") {
- title = false;
- }
- $('#' + follow_id).bind('contextmenu', function(e) {
- return false;
- });
- $('#' + follow_id).mousedown(function(e) {
- if (e.which == 3) { // 1 = 鼠标左键 left; 2 = 鼠标中键; 3 = 鼠标右键
- dialog = artDialog({
- //id : 'follow',
- title: title,
- fixed: false,
- // cancel: true,
- // cancelVal:"关闭",
- lock: false,
- padding: '0',
- content: htmlContent,
- follow: document.getElementById(follow_id),
- });
- dialog.flag = false;
- $('#' + follow_id).bind('mouseleave', function(e) {
- closeFollowDialog(dialog);
- $(this).unbind('mouseleave');
- });
- }
-
- });
- }
- }
-
-
-
- //右键显示(根据dom元素)
- function onRightfollowAjaxAlterHtmlByDom(name, title, helpsize, helpHaShCode,token) {
- try {
- // var selector = "[name=" + name + "]";
- // var follow_dom = document.querySelector(selector);
- // if (!follow_dom) return;
- // changeImage(selector);
- var data = { helpContent: document.querySelector("#helpcontent" + helpHaShCode).innerHTML, helpSize: helpsize ,token:token};
- data.title = title;
- data.name = name;
- data.helpHaShCode = helpHaShCode;
-
- //计算当前页面有效的帮助
- var count=0;
-
- //选项卡3级帮助
- if(token){
- /* 再改,规范 <li wdTabClick= 命名。Lin
- * 先改,是 wdtabclick,不是 wdTabClick
- var tabli=$("[wdtabclick]").filter(function(){return this.getAttribute("wdtabclick").indexOf(token)!=-1;})
- */ var tabli=$("[ssTabClick]").filter(function(){return this.getAttribute("ssTabClick").indexOf(token)!=-1;})
- if(tabli.length==1){
- initwdHelpElement(tabli[0], "rightclick", title, data, helpHaShCode, window);
- changeImage(tabli[0]);
- count++;
- }
-
- }else{
- var elements=[];
- var inputbox=wd.display.getInputBox(name);
- //4级帮助
- if(inputbox!=null){
- elements.push(inputbox.container);
- }else{
- $("[name=" + name + "]").each(function() {
- // initwdHelpElement(this, "rightclick", title, data, helpHaShCode, window);
- // changeImage(this);
- // count++;
- elements.push(this);
- })
- }
-
- for(var i=0;i<elements.length;i++){
- initwdHelpElement(elements[i], "rightclick", title, data, helpHaShCode, window);
- changeImage(elements[i]);
- count++;
-
- }
-
- }
-
-
-
- if(count>0){
- addHelpData(data, true);
- var wdDialogId = wd.display.getwdDialogId();
- showwdHelpButton(wdDialogId);
- }
- } catch (e) {
- console.log(e)
- }
-
- }
-
- function closeFollowDialog(dialog) {
- if (dialog != null) {
- dialog.DOM.wrap.bind('mouseover', function() {
- dialog.flag = true;
- });
- dialog.DOM.wrap.bind('mouseleave', function() {
- dialog.close();
- dialog.flag = false;
- });
- window.setTimeout(function() {
- if (!dialog.flag) {
- // console.log('flag:'+dialog.flag);
- dialog.close();
- }
- }, 10);
- }
- }
-
- function getClass(obj, attr) {
- if (obj.currentStyle) {
- if (attr == "backgroundPosition") {
- return obj.currentStyle.backgroundPositionX + " " +
- obj.currentStyle.backgroundPositionY;
- } else {
- return obj.currentStyle[attr];
- }
- } else {
- return document.defaultView.getComputedStyle(obj, null)[attr];
- }
- }
-
- function changeImage(dom) {
- // var domBgUrl = getClass(dom, "backgroundImage");
- // domBgUrl = domBgUrl.substring(4, domBgUrl.length - 1);
- // domBgUrl = domBgUrl.replace(/http:\/\/([^\s\/])+/, "");
- //
- // var imgPath = domBgUrl.substring(0, domBgUrl.lastIndexOf("?"));
- // if (domBgUrl.lastIndexOf("?") != -1) {
- // imgPath = imgPath.substring(0, imgPath.lastIndexOf("/") + 1);// 图片所在的文件位置
- // var changeImgStartIndex = domBgUrl.lastIndexOf("=") + 1;
- // var changeImg = domBgUrl.substring(parseInt(changeImgStartIndex),
- // parseInt(domBgUrl.length));
- // changeImg = imgPath + changeImg;
- // changeImg = changeImg.replace(/\"/g, "");
- // var imgUrl = "url(" + changeImg + ")";// 图片URL
- //
- // dom.style.backgroundImage = imgUrl;
- // }
- // dom.style.cursor = "url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSgBBwcHCggKEwoKEygaFhooKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKP/AABEIABoAGgMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APTvjhbwS3f2mWGN7mw8L63e2czIC9tcRmzMcsZ6o6nkMMEdjQB2Om+PNHub46ff/aNI1JZltnt9QjCATsFZIRMpaF5WV0YRpIzEN04IAB1VAHwB+1H/AMl28Tf9uv8A6SxUAfUfhfwcZ9Zl0zW7++1COx0q60fUor+9lla7+0i2K3URcl1SVInDKHCo8bKgJV3YA7bUvCOkX90s9zb7y9419PG2HjuXa0a0IkVgQVMTY2jAJUHnJyAcJ4N+JFyuh+GNL8iC/wBTfSrN5Td37x3Ny5s1nd0HlsG+Xd8zuoZlcA5U07AfK/7Rt/Bqvxh1rUbMs1tdw2VxEWGCUezhYZHbgikB9t+Lo7vTdf0jXdM0+7vid9hfwWiqWeAq0kchBK7ikiBVyflE8uB8xoAyPFepah4j0G60O38N67ANU22M09xFEqwwSsI5pMiQ8rGzsODyBxQBT8f6Tf33juDyIrxrO8trOymMVs7boftLtOizrxbjZtL5/wBYoULgqDTTA+Tv2nYo4Pjh4jhgjSOKNbVERAAqqLWEAADoKQD/APhoP4n/APQzf+SFr/8AG6AD/hoP4n/9DN/5IWv/AMboAP8AhoP4n/8AQzf+SFr/APG6AOA8U+IdU8Va7dazr119r1K52+bN5ax7tqhF+VQAPlUDgdqAP//Z),auto";
- // dom.style.cursor='url("/wd/theme/standard/img/wdHelp_mouse.png")';
- // dom.setAttribute("wdHelp_mark","true");
- //
-
- //pointer手
- var cursor = $(dom).css("cursor");
- // $(dom).attr("ceeee",cursor);
- if (cursor == "pointer") {
- $(dom).addClass("cursor-clickHelp")
- } else {
- $(dom).addClass("cursor-help");
- }
- $(dom).children("textarea").each(function(){
- changeImage(this);
- })
-
- }
-
- function jsCopy(text) {
- const isRTL = document.documentElement.getAttribute('dir') == 'rtl';
- var fakeElem = document.createElement('textarea');
- // Prevent zooming on iOS
- fakeElem.style.fontSize = '12pt';
- // Reset box model
- fakeElem.style.border = '0';
- fakeElem.style.padding = '0';
- fakeElem.style.margin = '0';
- // Move element out of screen horizontally
- fakeElem.style.position = 'absolute';
- fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
- // Move element to the same position vertically
- fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';
- fakeElem.setAttribute('readonly', '');
- fakeElem.value = text;
- document.body.appendChild(fakeElem);
- fakeElem.select();
- let succeeded;
- try {
- succeeded = document.execCommand('copy');
- } catch (err) {
- succeeded = false;
- }
- removeFake(fakeElem);
- return succeeded;
- }
-
- function removeFake(fakeElem) {
- if (fakeElem) {
- document.body.removeChild(fakeElem);
- fakeElem = null;
- }
- }
-
-
-
-
- var showWdHelp = null;
-
- function showwdHelpButton(wdDialogId){
- // console.log(wdDialogId);
- var win = wd.topWindow.dhxWins.window(wdDialogId);
-
- // if(win.getFrame().contentWindow.window!=window)
- // return;
- if(!win)return;
-
-
- // if(!$(win.button("wdHelp")).is(":hidden"))return;
-
- win.button("wdHelp").show()
-
- win.button("wdHelp").onclick = function() {
- var url = wd.display.replaceDynamicParam(wd.topWindow.helpDialogUrl, { dialogid: wdDialogId });
- eval(url);
- }
-
- }
-
- /**
- * 控制帮助按钮显示和隐藏
- * 帮助按钮绑定事件
- * @param {Object} title
- * @param {Object} helpHaShCode
- */
- function setupWdHelpIcon(title, helpsize, helpHaShCode) {
-
- var wdDialogId = wd.display.getwdDialogId();
- var data = { helpContent: document.querySelector("#helpcontent" + helpHaShCode).innerHTML, helpSize: helpsize, win: wd.topWindow }
- data.title = title;
- data.name = name;
- data.helpHaShCode = helpHaShCode;
-
-
-
- if (wdDialogId) {
-
- showwdHelpButton(wdDialogId);
-
-
- //弹出窗口
- } else if (wd.topWindow.wdHelpIcon) { //应用页面
-
-
-
- var url = wd.topWindow.document.querySelector("iframe[name=win2]").contentWindow.location.href;
- //个人首页
- var isgrsy = false;
- if (url.indexOf("yeMianEdit") != -1) {
- isgrsy = true;
- //页面
- }
-
-
- if (isgrsy) {
-
- var $b = $("#helpcontent" + helpHaShCode).parents("[initurl]").first().find(".icon-helpButton").show();
-
- initwdHelpElement($b[0], "click", title, data, helpHaShCode, window);
- } else {
- wd.topWindow.wdHelpIcon.style.display = "inline";
- wd.topWindow.wdHelpIcon.onclick = function() {
- var url = wd.display.replaceDynamicParam(wd.topWindow.helpDialogUrl, { dialogid: "" });
- eval(url);
- }
- }
-
- }
-
-
-
- addHelpData(data, false);
-
-
- }
-
-
-
- function initwdHelpElement(ele, eventName, title, data, helpHaShCode, environment) {
- var win = environment ? environment.window : window
- var artDialogFunction = environment ? environment.artDialog : artDialog;
- win.wdHelpDailog(ele, eventName, title, data, helpHaShCode);
- }
-
- var wdhelpdialogid = null;
- var wdhelpTimeOutObj = null;
-
- function wdHelpDailog(ele, eventName, title, data, helpHaShCode) {
- $(ele).bind('contextmenu', function(e) {
- return false;
- });
- // console.log(data)
- //仅仅右键
- // if(eventName=="rightclick"){
- $(ele).mouseleave(function(e) {
-
- var helpdiv = wd.topWindow.document.getElementById("wdhelpdialog");
- if (helpdiv != null) {
-
- if (!wd.topWindow.helpdialogid) {
- wd.topWindow.helpdialogid = [];
- }
- for (var i = 0; i < wd.topWindow.helpdialogid.length; i++) {
- wd.topWindow.clearTimeout(wd.topWindow.helpdialogid[i]);
- }
- if (!/l.*/i.test(data.helpSize)) {
- var timeoutid = wd.topWindow.setTimeout(function() {
- if ($(wd.topWindow.document).find("#wdhelpdialog .close").is(":visible") == false) {
- $(wd.topWindow.document).find("#wdhelpdialog").remove();
- }
- }, 1000);
- wd.topWindow.helpdialogid.push(timeoutid);
- }
- }
- })
- $(ele).mousedown(function(e) {
-
- if (eventName == "rightclick" && e.which != 3) return;
-
-
- e.stopPropagation();
- e.preventDefault();
- //防止重复点击
- if (wd.topWindow.dhxWins.window(wdhelpdialogid)) {
- return
- } else {
- wdhelpdialogid = null;
- }
- var params = { show: ["wdhelpdialog"], url: data.helpContent, 'title': title, 'helpHaShCode': helpHaShCode }
- wdHelpDailogParams(data, params, this);
-
- var helpContent = data.helpContent + "";
-
- //替换正文class
-
- // help-title 标题行
- // help-content 正文默认字体
- // help-content-title 帮助标题(文章顶部居中的那个)
- // help-content-title1 一级标题
- // help-content-title2 二级标题
- // help-content-item 项目
- //
- //
- // smallHelp-content 正文默认字体
- // smallHelp-content-title 帮助标题(文章顶部居中的那个)
- // smallHelp-content-title1 一级标题
- // smallHelp-content-title2 二级标题
- // smallHelp-content-item 项目
-
- //大窗口
- // if (/l.*/i.test(data.helpSize)) {
- // helpContent = helpContent.replace(/help\-text/g, "help")
- // helpContent = helpContent.replace(/help\-titleText/g, "help-title")
- // helpContent = helpContent.replace(/help\-title1Text/g, "help-title1")
- // helpContent = helpContent.replace(/help\-title2Text/g, "help-title2")
- // helpContent = helpContent.replace(/help\-itemText/g, "help-itemText")
- // //
- // } else {
- // helpContent = helpContent.replace(/help\-text/g, "smallHelp")
- // helpContent = helpContent.replace(/help\-titleText/g, "smallHelp-title")
- // helpContent = helpContent.replace(/help\-title1Text/g, "smallHelp-title1")
- // helpContent = helpContent.replace(/help\-title2Text/g, "smallHelp-title2")
- // helpContent = helpContent.replace(/help\-itemText/g, "smallHelp-item")
- // }
-
- if (/l.*/i.test(data.helpSize)) {
- // helpContent = helpContent.replace(/help\-text/g, "help")
- // helpContent = helpContent.replace(/help\-titleText/g, "help-title")
- // helpContent = helpContent.replace(/help\-title1Text/g, "help-title1")
- // helpContent = helpContent.replace(/help\-title2Text/g, "help-title2")
- // helpContent = helpContent.replace(/help\-itemText/g, "help-itemText")
- //
- } else {
- helpContent = helpContent.replace(/class=\"help/g, "class=\"smallHelp")
- // helpContent = helpContent.replace(/class=\"help\"/g, "class=\"smallHelp\"")
- // helpContent = helpContent.replace(/class=\"help\-title\"/g, "class=\"smallHelp-title\"")
- // helpContent = helpContent.replace(/class=\"help\-title1\"/g, "class=\"smallHelp-title1\"")
- // helpContent = helpContent.replace(/class=\"help\-title2\"/g, "class=\"smallHelp-title2\"")
- // helpContent = helpContent.replace(/class=\"help\-item\"/g, "class=\"smallHelp-item\"")
- }
-
-
-
-
-
-
-
-
-
-
- var helpdiv = null;
- helpdiv = wd.topWindow.document.getElementById("wdhelpdialog");
- if (helpdiv) {
- helpdiv.parentNode.removeChild(helpdiv)
- }
- // if(!wd.topWindow.document.querySelector("#wdhelpcss")){
- // $(wd.topWindow.document).find("head").append("<link id=\"wdhelpcss\" rel='stylesheet' type='text/css' href='/env/js/artDialog/artDialog.css'/>");
- // }
-
- var closeClass, copyClass, pinClass, helpDivClass, helpTitleClass, contentClass
- var styleContent="";
- if (/l.*/i.test(data.helpSize)) { //大窗口
- closeClass = "icon-close"
- copyClass = "icon-key"
- pinClass = "lightDialog-fixButton"
- helpDivClass = "lightDialog-div"
- helpTitleClass = "lightDialog-title hLine"
- contentClass = "help-div"
- styleContent="<style>.copy{position: absolute;right: 45px;}</style>";
- } else { //小只窗口
- closeClass = "invertIcon-close"
- copyClass = "invertIcon-key"
- pinClass = "invertIcon-unpin"
- helpDivClass = "flashMsg-div"
- helpTitleClass = "flashMsg-title"
- contentClass = ""
- }
- helpDivClass += " help-size-" + data.helpSize.toLowerCase();
-
- $(wd.topWindow.document.body).append(""
-
- +
- "<div id=\"wdhelpdialog\" style=\"position: absolute;z-index: 999;opacity:0;\" class=\"" + helpDivClass + "\">"
- +"<style>.help-size-l{width: 700px;}.help-size-m{width: 500px;}.help-size-s{width: 300px;}</style>"
- +styleContent
- // + ((data.helpSize.toLowerCase() == "l") ? "" : "<div class=\"triangle smallHelp-div-triangle\"><span></span></div>")
- +
- ((data.helpSize.toLowerCase() == "l") ? "" : "<div class=\"flashMsg-up\"></div>") +
- "<div class=\"" + helpTitleClass + "\">" +
- " <div title=\"帮助标题\">" + params.title + "</div>" +
- " <div title=\"复制代码\" class=\"copy " + copyClass + "\" ></div>" +
- " <div title=\"已锁定\" class=\"pin " + pinClass + "\" ></div>" +
- " <div title=\"关闭\" class=\"close " + closeClass + "\" ></div>" +
- "</div>" +
- "<div class=\"" + contentClass + "\">" +
- helpContent +
- "</div></div>"
- )
- helpdiv = wd.topWindow.document.getElementById("wdhelpdialog");
-
- // $(helpdiv).css({'width':params.width,
- // 'left':params.x,
- // 'top':params.y});
- // if(params.height)
- // $(helpdiv).css({'height':params.height})
- function calHelpDislogPos(){
- var pos = calPso(ele, helpdiv, params.win ? params.win : window, params.center);
-
- var triangle = helpdiv.querySelector(".triangle");
-
- $(helpdiv).css({ 'opacity':1,'left': pos.left, 'top': (triangle ? 15 : 0) + pos.top });
-
- if(pos.tooRight){
- var $tail=$(helpdiv).find(".flashMsg-up");
- var tailleft= parseInt($tail.css("left"));
- $tail.css({left:pos.dialogwidth+tailleft});
- }
- }
- //calHelpDislogPos();
- setTimeout(calHelpDislogPos,500);
- // setTimeout(calHelpDislogPos,1000);
- // 记时消失
- // var timeout = data.helpSize.toLowerCase() == "s" ? 2000 : 4000;
- var timeout = 5000;
- clearTimeout(wdhelpTimeOutObj);
- wdhelpTimeOutObj = setTimeout(function() {
- if (top.$("#wdhelpdialog .close").css("display") != "block") {
- top.$("#wdhelpdialog").remove();
- }
- }, timeout);
-
- if (!/l.*/i.test(data.helpSize)) {
- $(helpdiv).find(".close").hide();
- } else {
- $(helpdiv).find(".pin").hide();
- }
-
- //表单事件
- wd.topWindow.$(helpdiv).on("click", ".close", function() {
- var helpdiv = wd.topWindow.document.getElementById("wdhelpdialog");
- if (helpdiv) {
- helpdiv.parentNode.removeChild(helpdiv)
- }
- }).on("click", ".copy", function() {
- //复制帮助代码
- supplyCopy(params.helpHaShCode);
- }).on("click", ".pin", function() {
- //点击锁定后,显示关闭按钮
- $(helpdiv).find(".close").show();
- $(this).hide();
- }).on("mouseleave", function() {
- //鼠标移除后,定时关闭
- // if(!wd.topWindow.helpdialogid){
- // wd.topWindow.helpdialogid=[];
- // }
- // for(var i=0;i<wd.topWindow.helpdialogid.length;i++){
- // wd.topWindow.clearTimeout(wd.topWindow.helpdialogid[i]);
- // }
- // wd.topWindow.helpdialogid=[]
- // var helpdiv=wd.topWindow.document.getElementById("wdhelpdialog");
- // if (!/l.*/i.test(data.helpSize)) {
- // var timeoutid= wd.topWindow.setTimeout(function(){
- // if ($(wd.topWindow.document).find("#wdhelpdialog .close").is(":visible") == false) {
- // $(wd.topWindow.document).find("#wdhelpdialog").remove();
- // }
- // },2000);
- // wd.topWindow.helpdialogid.push(timeoutid);
- // }
- this.allowmove = false;
- // console.log(wd.topWindow.helpdialogid);
- // var helpdiv=wd.topWindow.document.getElementById("wdhelpdialog");
- // if(helpdiv){
- // helpdiv.parentNode.removeChild(helpdiv)
- // }
- }).on("mousedown", function(e) {
-
- var event = e || window.event;
-
- if ($(this).find(".close").is(":hidden") == false) {
- this.allowmove = true;
- //开始坐标
- this.startleft = parseInt(this.style.left);
- this.starttop = parseInt(this.style.top);
-
- //点击位置坐标
- this.startx = event.clientX;
- this.starty = event.clientY;
- }
- }).on("mousemove", function(e) {
- if (!wd.topWindow.helpdialogid) {
- wd.topWindow.helpdialogid = [];
- }
- for (var i = 0; i < wd.topWindow.helpdialogid.length; i++) {
- wd.topWindow.clearTimeout(wd.topWindow.helpdialogid[i]);
- }
- var event = e || window.event;
- if (this.allowmove) {
- var x = event.clientX;
- var y = event.clientY;
- this.style.left = this.startleft + x - this.startx + "px";
- this.style.top = this.starttop + y - this.starty + "px";
- }
-
-
- }).on("mouseup", function() {
- this.allowmove = false;
- })
- $(window).unload(function() {
- $(wd.topWindow.document).find("#wdhelpdialog").remove();
- })
-
- })
- // }
-
- // //左击键
- // if(eventName=="click"){
- // $(ele).mousedown(function(e){
- // //防止重复点击
- // if(wd.topWindow.dhxWins.window(wdhelpdialogid)){
- // return
- // }else{
- // wdhelpdialogid=null;
- // }
- //
- // var params={show:["wdhelpdialog"],url:data.helpContent,'title':title,'helpHaShCode':helpHaShCode}
- // params.center=true;
- // wdHelpDailogParams(data,params,this)
- //
- // var id=wd.display.showComponent(params);
- // wdhelpdialogid=id
- // return false
- // })
- // }
- }
-
- function calPso(ele, dialog, wind, center) {
-
-
- var winXY = (function(win) {
- function getTop(e) {
- var offset = e.offsetTop;
- if (e.offsetParent != null) offset += arguments.callee(e.offsetParent);
- return offset;
- }
-
- function getLeft(e) {
- var offset = e.offsetLeft;
- if (e.offsetParent != null) offset += arguments.callee(e.offsetParent);
- return offset;
- }
-
- function recursionIframe(win) {
-
- win = win || window;
-
- function getTop(e) {
- var offset = e.offsetTop;
- if (e.offsetParent != null)
- offset += getTop(e.offsetParent);
- return offset;
- }
-
- function getLeft(e) {
- var offset = e.offsetLeft;
- if (e.offsetParent != null)
- offset += getLeft(e.offsetParent);
- return offset;
- }
-
- if (win.parent == top && win.parent == win) {
-
- return {
- "left": 0,
- "top": 0
- };
- }
-
- var winPar = win.parent;
- var iframeArr = winPar.document.getElementsByTagName('IFRAME');
- var targetIframe;
-
- var iframeArr1 = win.document.getElementsByTagName('IFRAME');
- for (var i = 0; i < iframeArr1.length; i++) {
- var iframeElem = iframeArr1[i];
- if (iframeElem.contentWindow == win) {
- targetIframe = iframeElem;
- break;
- }
- }
-
- for (var i = 0; i < iframeArr.length; i++) {
- var iframeElem = iframeArr[i];
- if (iframeElem.contentWindow == win) {
- targetIframe = iframeElem;
- break;
- }
- }
-
- var xy = {
- left: getLeft(targetIframe),
- top: getTop(targetIframe)
- }
-
- if (winPar.parent != winPar) {
- var xy2 = arguments.callee(winPar);
- xy.left += xy2.left;
- xy.top += xy2.top;
- }
-
- return xy
- }
-
-
-
-
- if (win.parent == top && win.parent == win) {
- return { "left": 0, "top": 0 };
- }
- var winPar = win.parent; // .opener
- var iframeArr = winPar.document.getElementsByTagName('IFRAME');
- var targetIframe;
- for (var i = 0; i < iframeArr.length; i++) {
- var iframeElem = iframeArr[i];
- if (iframeElem.contentWindow == win) {
- targetIframe = iframeElem;
- break;
- }
- }
- var xy = { left: getLeft(targetIframe), top: getTop(targetIframe) }
- if (winPar.parent != winPar) {
- var xy2 = recursionIframe(winPar);
- xy.left += xy2.left;
- xy.top += xy2.top;
- }
-
- xy.top = xy.top;
-
- return xy
- })(wind)
-
-
- var result = { left: 0, top: 0 }
-
- var dialogwidth = parseInt($(dialog).width());
- var dialogheight = parseInt($(dialog).height());
- var winHeight = (wind.document.body.scrollTop + wind.document.body.scrollHeight) ||
- (wind.document.documentElement.scrollTop + wind.document.documentElement.scrollHeight);
- var winWidth = (wind.document.body.scrollLeft + wind.document.body.scrollWidth) ||
- (wind.document.documentElement.scrollLeft + wind.document.documentElement.scrollWidth);
-
- result.dialogwidth=dialogwidth;
- result.dialogheight=dialogheight;
-
- if (center) {
- wind = wd.topWindow;
-
-
-
- result.left = (winWidth - dialogwidth) * 0.5;
- result.top = (winHeight - dialogheight) * 0.5;
-
-
-
- } else {
- var bouding = ele.getBoundingClientRect();
- //整屏宽
- // var winWidth = recursionIframe(win).left * 2 + win.innerWidth;
- result.left += winXY.left + bouding.left;
- result.top += winXY.top + bouding.top + bouding.height;
-
- //太靠右
- if(result.left+dialogwidth>winWidth){
- result.left=winXY.left + bouding.left-dialogwidth;
- result.tooRight=true;
- }
-
- }
-
-
- return result;
-
-
-
-
- }
-
-
-
- function wdHelpDailogParams(data, params, ele) {
- console.log(data)
- if (data.helpTitle) {
- params.title = data.helpTitle;
- }
-
- //大
- if (/l.*/i.test(data.helpSize)) {
- // params.width=700;
- // params.height=500;
- //图钉自动按下
- params.pin = true;
- params.center = true;
- // params.className="help-div";
- console.log("大窗口");
- //中
- } else if (/m.*/i.test(data.helpSize)) {
- // params.width=500;
- // params.height=200;
- // params.className="smallHelp-div";
-
- console.log("中窗口");
- //小,默认
- } else {
- // params.width=300;
- // params.height=100;
- // params.className="smallHelp-div";
-
-
- console.log("小窗口");
- }
-
-
-
-
-
-
-
-
- console.log(params)
-
-
-
-
- return params;
- }
-
-
-
-
-
- /**
- * 复制文本到粘贴
- * @param {Object} val
- */
- function supplyCopy(val) {
- const isRTL = document.documentElement.getAttribute('dir') == 'rtl';
- var fakeElem = document.createElement('textarea');
- // Prevent zooming on iOS
- fakeElem.style.fontSize = '12pt';
- // Reset box model
- fakeElem.style.border = '0';
- fakeElem.style.padding = '0';
- fakeElem.style.margin = '0';
- // Move element out of screen horizontally
- fakeElem.style.position = 'absolute';
- fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
- // Move element to the same position vertically
- fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';
- fakeElem.setAttribute('readonly', '');
- fakeElem.value = val;
- document.body.appendChild(fakeElem);
- fakeElem.select();
- let succeeded;
- try {
- succeeded = document.execCommand('copy');
- wd.display.alert("复制成功");
-
- } catch (err) {
- succeeded = false;
- wd.display.alert("复制失败");
- }
-
- removeFake(fakeElem);
-
- return succeeded;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /**
- * 编辑帮助
- */
-
-
-
- if (!wd) {
- var wd = {}
- }
- if (!wd.edit) {
- wd.edit = {};
- }
-
- if (!wd.edit.wdHelp) {
- wd.edit.wdHelp = {};
- }
-
- wd.edit.wdHelp.show = function() {
- if (!wd.wdHelpObj) {
- wd.wdHelpObj = new wd.edit.wdHelp.wdHelpFunction().init();
- }
-
- wd.wdHelpObj.show();
- }
-
- wd.edit.wdHelp.hide = function(real) {
- if (!wd.wdHelpObj) {
- wd.wdHelpObj = new wd.edit.wdHelp.wdHelpFunction().init();
- }
-
- wd.wdHelpObj.hide(real);
- }
-
-
-
-
-
-
-
- wd.edit.wdHelp.wdHelpFunction = function() {
- this.dialogClassName = "wdHelp";
- this.secondClick = false;
- this.wdHelpValue = {};
-
- this.init = function() {
- return this;
- }
- this.show = function() {
-
- $("[wdSecondaryTab]").attr("wdSecondaryTab","false").find("#tabOption").show();
-
- var wdHelpElement = this.findWdHelpElement();
- // console.log(wdHelpElement);
- if (wdHelpElement.length == 0) {
- // alert("找不到元素设置帮助信息");
- return;
- }
-
-
- for (var i=0;i<wdHelpElement.length;i++) {
- this.showDialog(wdHelpElement[i]);
- }
-
- }
-
- this.hide = function(real) {
- if(real)
- $("[wdSecondaryTab]").attr("wdSecondaryTab","true");
-
- $("." + this.dialogClassName).remove();
- }
-
-
-
- this.showDialog = function(group) {
-
- var ele=group.container;
- var topDoc = window.document;
- var chartDiv = topDoc.createElement('div');
- chartDiv.className = this.dialogClassName;
-
- chartDiv.record = ele;
- chartDiv.innerHTML = this.buildCheckBox(ele) //根据数据库已经保存结果返回checkbox
- // with(chartDiv.style) {
- // zIndex = 65535;
- // background = 'bisque';
- // cursor= 'pointer';
- // width="10px";
- // }
- chartDiv.style.display = $(ele).css("display");
- chartDiv.setAttribute("class", "icon-empty " + this.dialogClassName)
- chartDiv.style.position = 'absolute';
-
- $(ele).after(chartDiv)
- // var bounding=ele.getBoundingClientRect();
-
- // var $p=$(ele).parents().filter(function(){
- // if($(this).css("position")=="relative"|| $(this).css("position") == "absolute"|| $(this).css("position") == "fixed")return true;
- // }).first()
- // var $p=$(ele).offsetParent();
- // if($p.length==0)$p=null
- //
- // var chartDivWidth=chartDiv.offsetWidth;
- //
- // var pbounding=$p? $p[0].getBoundingClientRect():null;
- //
- // chartDiv.style.left =(bounding.width+bounding.left-(pbounding?pbounding.left:0) )+"px"
- // chartDiv.style.top =(bounding.top-(pbounding?pbounding.top:0)+(bounding.height-chartDiv.offsetHeight)*0.5)+"px"
-
- var position = $(ele).position();
- chartDiv.style.left = position.left + $(ele).width() + "px"
- chartDiv.style.top = position.top + ($(ele).height() - $(chartDiv).height()) * 0.5 + "px"
-
- var leftx = $(chartDiv).offset().left + $(chartDiv).width() - $(window).width();
- if (leftx > 0) {
- $(chartDiv).animate({ left: "-=" + leftx });
- }
-
-
-
-
- // chartDiv.style.marginLeft="-"+chartDiv.offsetWidth;
- // var top=this.getTop(ele)
- // var left=this.getLeft(ele)
- // var xy={x:0,y:0}
- // chartDiv.style.left = xy.x+left+ele.offsetWidth+"px"
- // chartDiv.style.top = xy.y+top+"px";
- // chartDiv.style.left =ele.offsetWidth+"px"
-
- // function FindParam(url,name){
- // //获取url中"?"符后的字串
- // var theRequest = new Object();
- // if (url.indexOf("?") != -1) {
- // var str = url.substr(1);
- // strs = str.split("&");
- // for(var i = 0; i < strs.length; i ++) {
- // theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
- // }
- // }
- //
- // return theRequest[name];
- //
- // }
-
- var exist = false;
-
- $.ajax({
- url: "/service?ssServ=queryHelpByCode",
- type: "POST",
- data: {
- tokenstring:(group.token|| FindParam(window.location.href, "ssToken")), // , "token")),。Lin
- helpElementName: group.name,
- resultType: "ajax"
- },
- async: false,
- dataType: "json",
- success: function(data) {
-
- if (data) {
- exist = true;
- // chartDiv.style.background = 'red';
-
- }
-
- }
- });
-
- //chartDiv.style.background = 'red';
- if (exist)
- chartDiv.setAttribute("class", "icon-warningFull " + this.dialogClassName)
-
- $(chartDiv).on("click", (function() {
- var helpElementName = group.name;
- return function() {
-
-
-
-
- // top.editHelpDialog
- // var url= '/service?wdApplication=wd&wdService=queryHelpByCode&wdOutputComponent=440164702'
- var pageurl = window.location.href;
- // url+="&helpElementName="+helpElementName;
- // url+="&tokenstring="+;
- //// url+="&pageurl="+pageurl;
- // wd.display.showComponent({show:["wdDialog"],hide:[],url:url,title:"编辑帮助",width:500,height:500});
- var url = wd.display.replaceDynamicParam(wd.topWindow.editHelpDialog,
- {tokenstring:(group.token|| FindParam(location.search, "ssToken")), // , "token")),。Lin
- helpElementName: helpElementName
- });
-
- eval(url);
-
- }
- })())
-
- }
-
- this.buildCheckBox = function(ele) {
- var eleName = ele.getAttribute("name")
- var result = "";
- // result+='<input title=\"设置帮助\" value=\"h\" type="button" style=\"opacity: 0.5;\" />';
- // result+='<input title=\"设置帮助\" type="checkbox" style=\"opacity: 0.5;cursor: pointer;\" />';
- return result;
- }
-
- this.recursionIframe = function(win) {
-
- if (win.parent == top && win.parent == win) {
- // var xy = this.getAbsPoint(win);
-
- return { "x": 0, "y": 0, "w": 0, "h": 0 };
- }
- var winPar = win.parent; // .opener
- var iframeArr = winPar.document.getElementsByTagName('IFRAME');
- var targetIframe;
- for (var i = 0; i < iframeArr.length; i++) {
- var iframeElem = iframeArr[i];
- if (iframeElem.contentWindow == win) {
- targetIframe = iframeElem;
- break;
- }
- }
- // alert(targetIframe==null)
- // var xy = this.getAbsPoint(targetIframe);
- var xy = { x: this.getLeft(targetIframe), y: this.getTop(targetIframe) }
-
- if (winPar.parent != winPar) {
- var xy2 = this.recursionIframe(winPar);
- xy.x += xy2.x;
- xy.y += xy2.y;
- }
-
- return xy
- }
-
- this.getTop = function(e) {
- var offset = e.offsetTop;
- if (e.offsetParent != null) offset += this.getTop(e.offsetParent);
- return offset;
- }
-
- this.getLeft = function(e) {
- var offset = e.offsetLeft;
- if (e.offsetParent != null) offset += this.getLeft(e.offsetParent);
- return offset;
- }
-
- /*
- * 返回页面所有带wdRecord="true"的元素
- */
- this.findWdHelpElement = function() {
- var wdRecordList = []
- // var selectList2 = document.querySelectorAll("[name]");
- // for (var i = 0; i < selectList2.length; i++) {
- // if (selectList2[i].clientWidth > 0 && selectList2[i].tagName != "IFRAME") {
- // // if(!/^wd.*/.test(selectList2[i].getAttribute("name")))
- // var p = selectList2[i].parentNode;
- //
- // if (p.offsetWidth > 0 && p.getAttribute("name"))
- // continue;
- //
- //
- // wdRecordList.push(selectList2[i]);
- // }
- // }
-
-
-
-
- //输入框
- var groups=wd.display.getInputsGroups();
- for(var key in groups){
- wdRecordList.push(groups[key]);
- }
-
- //选项卡:三级帮助 所以不需要name
- var iframe=document.querySelector("iframe");
- if(iframe&&iframe.tabObj){
-
- var tabList= iframe.tabObj.wdTabList;
- for(var i=0;i<tabList.length;i++){
-
- if(tabList[i].secondaryTabList.length>0){
-
- for(var j=0;j<tabList[i].secondaryTabList.length;j++){
- var secondary=tabList[i].secondaryTabList[j];
- /* 再改,规范 <li wdTabClick=、&token= 命名。Lin
- * 先改,是 wdtabclick,不是 wdTabClick
- wdRecordList.push({container:secondary,token:FindParam(secondary.getAttribute("wdtabclick"),"token"),name:""});
- */ wdRecordList.push({container:secondary,token:FindParam(secondary.getAttribute("ssTabClick"),"ssToken"),name:""});
- }
- continue;
- }
- var li= tabList[i].dom;
- /* 再改,规范 <li wdTabClick= 命名。Lin
- * 先改,是 wdtabclick,不是 wdTabClick
- var url=li.getAttribute("wdtabclick");
- */ var url=li.getAttribute("ssTabClick");
- if(li.offsetWidth==0||!url)continue;
- wdRecordList.push({container:li,token:FindParam(url,"ssToken"),name:""}); // ,"token"),。Lin
- }
- }
- //其他
- var allContainer=[];
- var allName={};
- for(var i=0;i<wdRecordList.length;i++){
- allContainer.push(wdRecordList[i].container);
- var name=wdRecordList[i].name;
- if(name){
- allName[name]=1;
- }
- }
- var $allContainer=$(allContainer);
- $("input[name][class]").each(function(){
- var name=this.getAttribute("name");
- if(!$allContainer.is(this)&&!$.contains($allContainer,this)&&!allName[name]&&!wd.display.filterInputBoxNames[name]){
- wdRecordList.push({container:this,name:name});
- }
- })
- return wdRecordList;
- }
- this.findDialog = function() {
- return document.getElementsByClassName(this.dialogClassName)
- }
- /*删除勾选框*/
- this.removeDialog = function() {
-
- while (this.findDialog().length > 0) {
- var record = {}
- var removeEle = this.findDialog()[0];
-
- // console.log(removeEle.record)
- removeEle.parentNode.removeChild(removeEle)
- }
-
-
- }
-
- /*获得部件ID:bjid */
- getBjid = function() {
- var bjid = document.getElementsByName("wdComponentID")[0].value
- return bjid
- }
- /*根据勾选框+元素值生成数据 */
- this.getRecordData = function() {
- var recordZhi = {};
- var dialogList = this.findDialog();
- // {"nrid": {value:"440120001400",defualt:true},"bt":{"nrid": {value:"标题",defualt:false} }
- for (var i = 0; i < dialogList.length; i++) {
- var recordName = dialogList[i].record.getAttribute("name");
- var recordValue = dialogList[i].record.value
- var recordDefault = dialogList[i].getElementsByTagName("input")[0].checked;
- var lastValue = dialogList[i].getElementsByTagName("input")[1].checked;
- if (recordDefault || lastValue) {
- recordZhi[recordName] = { value: recordValue, default: recordDefault }
- }
- }
-
-
-
-
- return recordZhi;
-
- }
-
-
-
-
-
-
- }
-
-
- function addHelpData(data, isdialog) {
- var a = window.wdHelpData;
- if (!a) {
- window.wdHelpData = [];
- a = window.wdHelpData;
- }
-
- for (var i = 0; i < a.length; i++) {
- if (a[i].helpHaShCode == data.helpHaShCode) {
- a[i] = data;
- return;
- }
- }
-
-
-
-
- if (data.title)
- a.push(data);
-
- // if(data.helpContent){
- // data.helpContent=data.helpContent.replace(/style=\".*?\"/g,"")
- // }
- //
- console.log(data)
- // var topiframe=wd.topWindow.document.querySelector("iframe[name="+wd.topWindow.MenuSetting.target+"]")
- // if(isdialog){
- // console.log(wd.display.getwdDialogWindows())
- // console.log(wd.display.getwdDialogId());
- // }else{
- // console.log(wd.display.getwdDialogWindows())
- //
- // console.log(wd.display.getwdDialogId());
- // }
- //
- //
- //
- // console.log(data);
- }
-
-
-
-
- wd.edit.findAllHelpData = function(wdDialogId) {
- var result = [];
- if (wdDialogId) {
- console.log(wdDialogId);
- var allWindows = wd.display.getwdDialogWindowObjects(parseInt(wdDialogId));
-
- for (var i = 0; i < allWindows.length; i++) {
- if (allWindows[i].wdHelpData) {
-
- result = result.concat(allWindows[i].wdHelpData);
- }
- }
- } else {
-
- var topiframe = wd.topWindow.document.querySelector("iframe[name=" + wd.topWindow.MenuSetting.target + "]")
- // console.log(topiframe.contentWindow);
- if (topiframe.contentWindow) {
- if (topiframe.contentWindow.wdHelpData)
- result = result.concat(topiframe.contentWindow.wdHelpData);
-
- var alliframe = topiframe.contentWindow.document.querySelectorAll("iframe");
- for (var i = 0; i < alliframe.length; i++) {
- if (alliframe[i].contentWindow && alliframe[i].contentWindow.wdHelpData) {
- result = result.concat(alliframe[i].contentWindow.wdHelpData);
- }
- }
- }
-
- }
-
-
-
-
- return result;
-
-
- }
-
-
-
- $(function() {
- if (window.location.href.indexOf("view") > 0) return;
- //非开发模式下隐藏
-
- if (!wd.topWindow.wd.edit)
- wd.topWindow.wd.edit = {};
-
- if (!wd.topWindow.wd.edit.findAllHelpData) {
- wd.topWindow.wd.edit.findAllHelpData = wd.edit.findAllHelpData;
- }
-
- if (!wd.topWindow.IS_ALLOW_EDIT_WDHELP) return;
-
- var wdDialogId = wd.display.getwdDialogId();
- //窗口状态
- if (wdDialogId) {
-
- if ("0" == window.loginStatus)
- return;
-
-
- var win = wd.topWindow.dhxWins.window(wdDialogId);
- //没有提供按钮
- if (!win.button("editWdHelp")) return;
- win.button("editWdHelp").show();
- var editbutton = win.button("editWdHelp");
- var savebutton = win.button("editWdHelp_save");
- var allWindows = wd.display.getwdDialogWindowObjects(wdDialogId);
- for (var i = 0; i < allWindows.length; i++) {
- try{
- if (allWindows[i].wd && allWindows[i].wd.edit && allWindows[i].wd.edit.wdHelp) {
- allWindows[i].wd.edit.wdHelp.hide();
- }
- }catch(e){
- console.error(e);
- }
-
- }
- editbutton.edit = false;
- var thisUrl = win.getFrame().contentWindow.location.href
- editbutton.onclick = function() {
- var edit = editbutton.edit;
- editbutton.edit = !(editbutton.edit ? true : false);
- edit = true;
- for (var i = 0; i < allWindows.length; i++) {
- try{
- if (!allWindows[i].wd.edit || !allWindows[i].wd.edit.wdHelp) continue;
- allWindows[i].wd.edit.wdHelp.show();
- }catch(e){
- console.error(e);
- }
- }
- var url = wd.display.replaceDynamicParam(wd.topWindow.editHelpDialog, { tokenstring: FindParam(thisUrl, "ssToken"), helpElementName: "" }); // , "token"),。Lin
- eval(url);
- this.hide();
- savebutton.show()
- }
- savebutton.onclick = function() {
-
- for (var i = 0; i < allWindows.length; i++) {
- try{
- if (!allWindows[i].wd.edit || !allWindows[i].wd.edit.wdHelp) continue;
- allWindows[i].wd.edit.wdHelp.hide(true);
- }catch(e){
- console.error(e);
- }
- }
- this.hide();
- editbutton.show()
- }
- //页面状态
- } else if (wd.topWindow.editWdHelp) {
-
-
- var url = wd.topWindow.document.querySelector("iframe[name=win2]").contentWindow.location.href;
- var THIS = window;
- //个人首页
- var isgrsy = false;
- if (url.indexOf("yeMianEdit") != -1) {
- isgrsy = true;
-
-
- function initsybjBodyHelp(ele,t){
-
- var mytt;
- var myttime=0;
- mytt=setInterval(function(){
- //console.log(mytt)
- myttime++;
- if(myttime>10)
- clearInterval(mytt);
-
- var $button=$(ele).find(".icon-setHelpButton");
- if($button.length==0)
- return true;
- clearInterval(mytt);
- $button.show().on("click", function() {
- var thisUrl = $(this).parents("[initurl]").first().attr("initurl");
- var url = THIS.wd.display.replaceDynamicParam(wd.topWindow.editHelpDialog, { tokenstring: THIS.FindParam(thisUrl, "ssToken"), helpElementName: "" }); // , "token"),。Lin
- eval(url);
- })
-
- },t?t:2000);
- }
-
- function initGrsyHelp(){
- //刷新之后,重新 绑定点击事件
- window.gridster.$el.on("click", ".img-header", function() {
- var $this1=$(this).parents("[initurl]");
- initsybjBodyHelp($this1,10000)
- })
- THIS.gridster.$widgets.each(function(){
- initsybjBodyHelp(this);
- })
- }
- if(THIS.json&&THIS.json!="[]"){
- var tt=THIS.setInterval(function(){
- try{
- console.log(tt);
- if( THIS.gridster.$widgets.length==0)
- throw "wait wait";
- initGrsyHelp();
- THIS.clearInterval(tt);
- }catch(e){
- console.log(e);
- }
- },3000);
- }
- $(wd.topWindow.editWdHelp).show();
- //页面
- } else {
- $(wd.topWindow.editWdHelp).show();
- setTimeout(function() {
- $(wd.topWindow.editWdHelp).show();
- }, 5000)
- }
-
- var settingClass="largeIcon-setHelp";
- var okClass="largeInvertIcon-save";
- wd.topWindow.editWdHelp.isSaveButton=false;
- wd.topWindow.editWdHelp.setAttribute("class",settingClass);
- wd.topWindow.editWdHelp.onclick = function() {
- if(isgrsy){
- eval(wd.topWindow.editHelpEditTab);
- return;
- }
-
- if(this.isSaveButton){
- THIS.wd.edit.wdHelp.hide();
- this.isSaveButton=false;
- this.setAttribute("class",settingClass);
- }else{
- this.setAttribute("class",okClass);
- this.isSaveButton=true;
- THIS.wd.edit.wdHelp.hide();
- THIS.wd.edit.wdHelp.show(wd.topWindow.editWdHelp);
- var url="";
- if(!isgrsy){
- var thisUrl = THIS.location.href;
- url= wd.display.replaceDynamicParam(wd.topWindow.editHelpDialog, { tokenstring: FindParam(thisUrl, "ssToken"), helpElementName: "" }); // , "token"),。Lin
- eval(url);
- }
- }
- }
-
-
-
- // wd.topWindow.editWdHelp.onclick=(function(){
- // var thiswindow=window;
- // return function(){
- // thiswindow.wd.edit.wdHelp.hide();
- // thiswindow.wd.edit.wdHelp.show(wd.topWindow.editWdHelp);
- // var thisUrl=window.location.href;
- // var url=wd.display.replaceDynamicParam(wd.topWindow.editHelpDialog,{tokenstring:FindParam(thisUrl,"token"),helpElementName:""});
- // eval(url);
- //
- // }
- // })()
- }
-
- })
-
-
-
- //刷新单前窗口
- function refreshHelpChart(wind) {
-
- //refreshHelpChart(wd.display.getwdDialogOpener())
- var wdDialogId = wind.wd.display.getwdDialogId();
- //窗口状态
- if (wdDialogId) {
- var win = wd.topWindow.dhxWins.window(wdDialogId);
-
- var allWindows = wd.display.getwdDialogWindowObjects(wdDialogId);
- for (var i = 0; i < allWindows.length; i++) {
- if (allWindows[i].wd && allWindows[i].wd.edit && allWindows[i].wd.edit.wdHelp) {
- allWindows[i].wd.edit.wdHelp.hide();
- allWindows[i].wd.edit.wdHelp.show();
- }
- }
-
- //页面状态
- } else if (wd.topWindow.editWdHelp) {
- wind.wd.edit.wdHelp.hide();
- wind.wd.edit.wdHelp.show(wd.topWindow.editWdHelp);
- }
-
-
-
- }
|