From 709e6102ed1838dd125665319f390a63a919e9d1 Mon Sep 17 00:00:00 2001 From: lijiangt Date: Sun, 9 Dec 2018 16:44:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/dwz.ui.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/dwz.ui.js b/js/dwz.ui.js index 131b396..b8d2f1e 100644 --- a/js/dwz.ui.js +++ b/js/dwz.ui.js @@ -229,7 +229,6 @@ function initUI($p){ options.minable = eval($this.attr("minable") || "true"); options.fresh = eval($this.attr("fresh") || "true"); options.resizable = eval($this.attr("resizable") || "true"); - options.resizable = eval($this.attr("resizable") || "true"); options.drawable = eval($this.attr("drawable") || "true"); options.close = eval($this.attr("close") || ""); options.param = $this.attr("param") || ""; -- Gitee From 3de302381e563c75ef1174a8cb9c50ba674b80c4 Mon Sep 17 00:00:00 2001 From: lijiangt Date: Sun, 9 Dec 2018 16:51:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0selectOneNewTab=E3=80=81s?= =?UTF-8?q?electOneDialog=E3=80=81selectMultipleDialog=E4=B8=89=E7=A7=8D?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/dwz.ui.js | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/js/dwz.ui.js b/js/dwz.ui.js index b8d2f1e..ecffd39 100644 --- a/js/dwz.ui.js +++ b/js/dwz.ui.js @@ -268,6 +268,185 @@ function initUI($p){ }); }); + //selectOneNewTab + $("a[target=selectOneNewTab]", $p).each(function(){ + + $(this).click(function(event){ + var $this = $(this); + var title = $this.attr("title") || $this.text(); + var rel = $this.attr("sname") || "ids"; + + var targetType = $this.attr("targetType"); + var ids = ""; + var $box = targetType == "dialog" ? $.pdialog.getCurrent() : navTab.getCurrentPanel(); + $box.find("input:checked").filter("[name='"+rel+"']").each(function(i){ + var val = $(this).val(); + ids += i==0 ? val : ","+val; + }); + if (!ids) { + alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); + return false; + } + if (ids.indexOf(',')!=-1) { + alertMsg.error($this.attr("warn")||"只能选择一条信息"); + return false; + } + var check = $(this).attr("check"); + if(check){ + check = check.substring(0,check.indexOf("(")); + if (typeof window[check]==='function'){ + if(!(window[check]())){ + return false; + } + } + } + var tabid = $this.attr("rel") || "_blank"; + var fresh = eval($this.attr("fresh") || "true"); + var external = eval($this.attr("external") || "false"); + var url = ($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first")); + url = url +ids; + DWZ.debug(url); + if (!url.isFinishedTm()) { + alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); + return false; + } + navTab.openTab(tabid, url,{title:title, fresh:fresh, external:external}); + + event.preventDefault(); + + }); + }) + + //selectOneDialog + $("a[target=selectOneDialog]", $p).each(function(){ + + $(this).click(function(event){ + var $this = $(this); + var title = $this.attr("title") || $this.text(); + var rel = $this.attr("sname") || "ids"; + + var targetType = $this.attr("targetType"); + var ids = ""; + var $box = targetType == "dialog" ? $.pdialog.getCurrent() : navTab.getCurrentPanel(); + $box.find("input:checked").filter("[name='"+rel+"']").each(function(i){ + var val = $(this).val(); + ids += i==0 ? val : ","+val; + }); + if (!ids) { + alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); + return false; + } + if (ids.indexOf(',')!=-1) { + alertMsg.error($this.attr("warn")||"只能选择一条信息"); + return false; + } + var check = $(this).attr("check"); + if(check){ + check = check.substring(0,check.indexOf("(")); + if (typeof window[check]==='function'){ + if(!(window[check]())){ + return false; + } + } + } + var options = {}; + var w = $this.attr("width"); + var h = $this.attr("height"); + if(w&&/.*%$/.test(w)){ + var sw = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + w = Number(w.substring(0,w.length-1))*sw/100; + } + if(h&&/.*%$/.test(h)){ + var sh = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; + h = Number(h.substring(0,h.length-1))*sh/100; + } + if (w) options.width = w; + if (h) options.height = h; + options.max = eval($this.attr("max") || "false"); + options.mask = eval($this.attr("mask") || "false"); + options.maxable = eval($this.attr("maxable") || "true"); + options.minable = eval($this.attr("minable") || "true"); + options.fresh = eval($this.attr("fresh") || "true"); + options.resizable = eval($this.attr("resizable") || "true"); + options.drawable = eval($this.attr("drawable") || "true"); + options.close = eval($this.attr("close") || ""); + options.param = $this.attr("param") || ""; + var url = ($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first")); + url = url +ids; + DWZ.debug(url); + if (!url.isFinishedTm()) { + alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); + return false; + } + $.pdialog.open(url, rel, title, options); + + return false; + }); + }) + + //selectMultipleDialog + $("a[target=selectMultipleDialog]", $p).each(function(){ + + $(this).click(function(event){ + var $this = $(this); + var title = $this.attr("title") || $this.text(); + var rel = $this.attr("sname") || "ids"; + + var targetType = $this.attr("targetType"); + var ids = ""; + var $box = targetType == "dialog" ? $.pdialog.getCurrent() : navTab.getCurrentPanel(); + $box.find("input:checked").filter("[name='"+rel+"']").each(function(i){ + var val = $(this).val(); + ids += i==0 ? val : ","+val; + }); + if (!ids) { + alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); + return false; + } + var check = $(this).attr("check"); + if(check){ + check = check.substring(0,check.indexOf("(")); + if (typeof window[check]==='function'){ + if(!(window[check]())){ + return false; + } + } + } + var options = {}; + var w = $this.attr("width"); + var h = $this.attr("height"); + if(w&&/.*%$/.test(w)){ + var sw = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + w = Number(w.substring(0,w.length-1))*sw/100; + } + if(h&&/.*%$/.test(h)){ + var sh = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; + h = Number(h.substring(0,h.length-1))*sh/100; + } + if (w) options.width = w; + if (h) options.height = h; + options.max = eval($this.attr("max") || "false"); + options.mask = eval($this.attr("mask") || "false"); + options.maxable = eval($this.attr("maxable") || "true"); + options.minable = eval($this.attr("minable") || "true"); + options.fresh = eval($this.attr("fresh") || "true"); + options.resizable = eval($this.attr("resizable") || "true"); + options.drawable = eval($this.attr("drawable") || "true"); + options.close = eval($this.attr("close") || ""); + options.param = $this.attr("param") || ""; + var url = ($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first")); + url = url +ids; + DWZ.debug(url); + if (!url.isFinishedTm()) { + alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); + return false; + } + $.pdialog.open(url, rel, title, options); + + return false; + }); + }) + $("div.pagination", $p).each(function(){ var $this = $(this); $this.pagination({ -- Gitee