123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796 |
-
- //****************************************************************************************//
- //**************************************jquery扩展****************************************//
- //$(function () {
- // $(document.forms).submit(function () {
- // });
- //})
- $.extend({
- cmsPost: function (url, data, callback, type) {
- var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + url.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- return $.post(newUrl, data, callback, type);
- },
- cmsGet: function (url, data, callback, type) {
- var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + url.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- return $.get(newUrl, data, callback, type);
- },
- cmsGetJSON: function (url, data, callback) {
- var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + url.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- return $.getJSON(newUrl, data, callback);
- },
- cmsAjax: function (url, settings) {
- var ajaxOptions = {};
- if (settings) {
- $.extend(ajaxOptions, settings);
- ajaxOptions.url = ("/" + CMS_SystemConfig.VirtualDirectoryPath + url.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- }
- else {
- $.extend(ajaxOptions, url);
- ajaxOptions.url = ("/" + CMS_SystemConfig.VirtualDirectoryPath + ajaxOptions.url.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- }
- return $.ajax(ajaxOptions);
- },
- cmsGetScript: function (url, callback) {
- var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + url.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- return $.getScript(newUrl, callback);
- },
- exceptionThrow: function (jsonResult, callBackFun) {
- /// <summary>
- /// 异常抛出方法
- /// </summary>
- if (jsonResult) {
- var documentID;
- if (jsonResult.LogID) {
- documentID = "#" + jsonResult.LogID;
- }
- else {
- documentID = null;
- }
- if (jsonResult.StackTrace) {
- var errorWinHTML = "<div id='" + jsonResult.LogID + "' style=\"background: blanchedalmond;\"><b>" + $.decode(jsonResult.StackTrace) + "</b></div>";
- $(errorWinHTML).appendTo(window.top.document.body);
- $(documentID).window({
- width: 800,
- height: 600,
- modal: true,
- closed: true,
- collapsible: false,
- minimizable: false,
- title: '错误信息跟踪'
- });
- }
- else {
- var logID = (jsonResult.LogID ? "错误日志ID:<br />[<span style=\"color:red;\" >" + jsonResult.LogID + "</span>]<br /><br />" : "");
- var errorMsg = (jsonResult.ErrorMsg ? jsonResult.ErrorMsg + "<br /><br />" : "");
- var stackTrace = (jsonResult.StackTrace ? "错误跟踪:<a href=\"JavaScript:void(0);\" onclick=\"JavaScript:\$('" + documentID + "').window('open');\" >展开</a><br /><br />" : "");
- var returnVal = null;
- $.messager.alert('系统提示 ', logID + errorMsg + stackTrace, 'error', function () {
- if (documentID != null) {
- $(documentID).window('window').remove();
- if (callBackFun) {
- callBackFun();
- }
- else {
- returnVal = false;
- }
- }
- });
- if (returnVal != null) {
- return returnVal;
- }
- }
- }
- },
- bindClipBoard: function (id, obj) {
- var clip = new ZeroClipboard.Client();
- clip.setHandCursor(true);
- clip.setText(obj);
- clip.glue(id);
- clip.addEventListener('complete', function (client, text) {
- $.messager.alert("系统提示", "复制成功", "info");
- });
- },
- String2XML: function (xmlString) {
- // for IE
- if (window.ActiveXObject) {
- var xmlobject = new ActiveXObject("Microsoft.XMLDOM");
- xmlobject.async = "false";
- xmlobject.loadXML(xmlString);
- return xmlobject;
- }
- // for other browsers
- else {
- var parser = new DOMParser();
- var xmlobject = parser.parseFromString(xmlString, "text/xml");
- return xmlobject;
- }
- }
- });
- $.fn.extend({
- ajaxClick: function (config) {// 异步点击操作事件
- if (!config) {
- this.triggerHandler("ajaxPostEvent");
- } else {
- this.each(function () {
- var _this = $(this);
- var defaultConfig = { postData: {}, postUrl: "", postResponse: function (responseJson) { }, autoAlertMessage: true, progress: false };
- var ajaxClickConfig = $.data(_this, "ajaxClickConfig");
- if (!ajaxClickConfig) {
- $.data(_this, "ajaxClickConfig", defaultConfig);
- $.data(_this, "ajaxClickEventManager", { "postResponse": [] });
- }
- var ajaxClickEventManager = $.data(_this, "ajaxClickEventManager");
- if (typeof (config) === "function") {
- ajaxClickEventManager["postResponse"].push(config);
- } else if (typeof (config) === "object") {
- config = $.extend({}, defaultConfig, config);
- $.data(_this, "ajaxClickConfig", config);
- if (config.postResponse) {
- ajaxClickEventManager["postResponse"].push(config.postResponse);
- }
- $.data(_this, "ajaxClickEventManager", ajaxClickEventManager);
- _this.unbind("ajaxPostEvent");
- _this.bind("ajaxPostEvent", function () {
- _this.disable();
- var ajaxClickConfig = $.data(_this, "ajaxClickConfig");
- if (ajaxClickConfig.progress) {
- //$.messager.progress({ msg: "等待服务器返回处理结果", autoClose: true, interval: 600 });
- $.cmsLoading.show("等待服务器返回处理结果");
- }
- var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + ajaxClickConfig.postUrl.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- $.post(newUrl,
- typeof (ajaxClickConfig.postData) == "function" ? ajaxClickConfig.postData() : ajaxClickConfig.postData,
- function (responseJson) {
- _this.enable();
- //$.messager.CloseProgress();
- $.cmsLoading.hide();
- //自动alert回传的提示内容
- if (ajaxClickConfig.autoAlertMessage && $.isPlainObject(responseJson) && responseJson.message) {
- $.messager.alert("系统提示", responseJson.message, "info", function () {
- var ajaxClickEventManager = $.data(_this, "ajaxClickEventManager");
- $.each(ajaxClickEventManager["postResponse"], function () {
- this.call(_this, responseJson);
- });
- });
- } else {
- var ajaxClickEventManager = $.data(_this, "ajaxClickEventManager");
- $.each(ajaxClickEventManager["postResponse"], function () {
- this.call(_this, responseJson);
- });
- }
- }, "json").error(function () {
- _this.enable();
- //$.messager.CloseProgress();
- $.cmsLoading.hide();
- });
- });
- }
- });
- }
- },
- exportClick: function (config) {
- var defaultConfig = {
- postUrl: '',
- dowloadName: "",
- postData: {},
- progress: true
- };
- config = $.extend({}, defaultConfig, config);
- config.postResponse = function (responseJson) {
- if (responseJson.fileUrl) {
- var url = "/Common/ExportExcel?filePath=" + responseJson.fileUrl;
- var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + url).replaceDoubleSlashesToSingle();
- var src = "src='" + newUrl;
- if (config.dowloadName != "") {
- src.concat("&dowloadName=", config.dowloadName);
- }
- var iframHtml = "".concat("<iframe ", src, "' frameborder='0' style='border:0;width:0;height:0;' />");
- $("body").append(iframHtml);
- } else {
- if (!responseJson.IsSuccess) {
- $.messager.alert('警告', responseJson.Message);
- } else {
- $.messager.alert("警告", "响应错误:未能找到属性:filePath");
- }
- }
- };
- config.autoAlertMessage = false;
- this.ajaxClick(config);
- this.ajaxClick();
- }
- });
- //******************************************End******************************************//
- //***************************************************************************************//
- //****************************************************************************************//
- //**********************************CMS系统内置脚本对象***********************************//
- var CMS_SystemScriptObject = {
- LogoutConfirm: function () {//注销登录
- $.messager.confirm('提示', "是否确定退出系統?", "warning", function (r) {
- if (r) {
- $.System.logout();
- }
- });
- }
- };
- //******************************************End******************************************//
- //***************************************************************************************//
- //****************************************************************************************//
- //**********************************页面PageLoad事件**************************************//
- var IndexTabStatus = new Array();
- var CMS_PageLoadEvents = {
- AddStarToRequired: function () {
- //所有必填项提示,用"*"符号. added by 劳炳辉 2013-08-09
- var targets = $("[validtype]").closest("li").prev("li").not($("[validtype]").closest("li").find("b.requiredstar"));
- $(targets).each(function () {
- if ($(this).find("b.requiredstar").length == 0) {
- $(this).append("<b class=\"requiredstar\">*</b>"); //没有
- }
- });
- },
- SystemHandle: function () {
- $.System = (function () {
- var indexConfig = {};
- indexConfig['indexTabPanel'] = function () {
- return $('#index_center_tabs');
- };
- indexConfig['indexMenuPanel'] = $('#panelLeft');
- var f_init = function () {
- //屏蔽脚本错误
- window.onerror = function () { };
- $(window).resize(function () {
- if ($.System.resizePageingTimeout) {
- clearTimeout($.System.resizePageingTimeout);
- }
- $.System.resizePageingTimeout = setTimeout(function () {
- $.System.resizePage();
- }, 0);
- });
- //$.System.addTab('系统管理', '/EasyUI/Form');
- indexConfig['indexMenuPanel'].cmsMenu({
- onMenuClick: function (node) {
- if (node.text == "系统首页") {
- $.System.showDefaultIndex(true);
- return false;
- } else if (node.text == "系统注销") {
- CMS_SystemScriptObject.LogoutConfirm();
- return false;
- }
- if (node.url == null || node.url == '') return false;
- $.System.addTab(node.text, node.url, node.mnuNo);
- }
- });
- this.showDefaultIndex();
- //this.resizePage();
- //2013-07-10 解决用了uploadify的页面,在tab关闭时报空指针的问题
- var tabPanel = this.getTabPanel();
- tabPanel.tabs({
- onBeforeClose: function (title, index) {
- var tab = tabPanel.tabs('getTab', title);
- if (tab) {
- try {
- tab.find("div.easyui-AttachmentUploader").AttachmentUploader("destroy");
- } catch (ignore) { }
- }
- return true;
- }
- });
- };
- var f_resizePage = function () {
- indexConfig['indexTabPanel']().tabs("resize");
- if (typeof (this.selectedTabTimeout) != "undefined") {
- clearTimeout(this.selectedTabTimeout);
- }
- this.selectedTabTimeout = setTimeout(function () {
- try {
- var tabPanel = $.System.getTabPanel();
- var selectedTab = tabPanel.tabs('getSelected');
- var selectedTabIndex = tabPanel.tabs('getTabIndex', selectedTab);
- tabPanel.tabs('select', selectedTabIndex);
- } catch (ignore) { }
- }, 1000);
- };
- var f_addTab = function (title, url, mnuNo, postData) {
- var newUrl = url;
- newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + newUrl.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- var tabPanel = this.getTabPanel();
- var oldTab = tabPanel.tabs('getTab', title);
- if (oldTab) {//&& oldTab.href == url) {
- tabPanel.tabs('select', title);
- //tabPanel.tabs('getSelected').panel("refresh", url);
- } else {
- postData = postData || {};
- var urlParams = $.param(postData);
- if (newUrl.indexOf("?") > -1) {
- newUrl += "&" + urlParams;
- } else {
- newUrl += "?&" + urlParams;
- }
- tabPanel.tabs('add', {
- title: title,
- //href: newUrl,
- content: '<iframe frameborder="0" scrolling="no" style="border:0;width:100%;height:99.6%;overflow:hidden;"></iframe><div data-tab="" style="width:100%;height:100%;top:50px;left:0;position:absolute;background-color:White;filter:alpha(opacity=50); -moz-opacity:0.5;opacity:0.5;"><img src="../../Content/images/loading.gif" alt="" style="top:48%;left:48%;position:absolute;" /></div>',
- cache: true,
- closable: true,
- fit: true,
- maximized: true,
- postData: postData
- });
- var tabIndex = tabPanel.tabs('getTabIndex', tabPanel.tabs("getSelected"));
- IndexTabStatus.push({ index: tabIndex, firstLoad: true });
- tabPanel.tabs("getSelected").panel("body").find("iframe").attr("src", newUrl);
- }
- $.System.hideDefaultIndex();
- };
- //刷新当前tab,可以指定新的url跟title
- var f_refreshCurrentTab = function (newUrl, title, postData) {
- newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + newUrl.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- var tabPanel = this.getTabPanel();
- var tab = tabPanel.tabs('getSelected');
- postData = postData || {};
- var urlParams = $.param(postData);
- if (newUrl.indexOf("?") > -1) {
- newUrl += "&" + urlParams;
- } else {
- newUrl += "?&" + urlParams;
- }
- if (tab) {
- try {
- tab.find("div.easyui-AttachmentUploader").AttachmentUploader("destroy");
- } catch (ignore) {
- }
- // tabPanel.tabs("update", {
- // tab: tab,
- // options: {
- // title: title,
- // content: '<iframe src="#" frameborder="0" scrolling="no" style="border:0;width:100%;height:100%;overflow:hidden;"></iframe><div data-tab="" style="width:100%;height:100%;top:50px;left:0;position:absolute;background-color:White;filter:alpha(opacity=50); -moz-opacity:0.5;opacity:0.5;"><img src="../../Content/images/loading.gif" alt="" style="top:48%;left:48%;position:absolute;" /></div>',
- // cache: true,
- // closable: true,
- // fit: true,
- // postData: postData
- // }
- // });
- //var $iframe=tabPanel.tabs("getSelected").panel("body").find("iframe")
- var $iframe = tabPanel.panel("body").find("iframe");
- //$iframe.attr("src", "#");
- $iframe.attr("src", newUrl);
- }
- };
- var f_closeTabByTitle = function (title) {
- try {
- var tabPanel = this.getTabPanel();
- tabPanel.tabs("close", title);
- } catch (ignore) { }
- };
- //newUrl, title, postData
- var f_closeTab = function (reflashOptions) {
- var tabPanel = this.getTabPanel();
- var selectedTable = tabPanel.tabs("getSelected");
- var tableIndex = tabPanel.tabs("getTabIndex", selectedTable);
- tabPanel.tabs("close", tableIndex);
- if (reflashOptions != undefined) {
- if (typeof (reflashOptions.newUrl) != "undefined" && reflashOptions.newUrl != "") {
- var newUrl = reflashOptions.newUrl;
- newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + newUrl.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle();
- if (reflashOptions.title) {
- var currentTab = tabPanel.tabs("getTab", reflashOptions.title);
- if (currentTab) {
- // tabPanel.tabs("update", { tab: currentTab, options: {
- // title: reflashOptions.title,
- // content: '<iframe src="#" frameborder="0" scrolling="no" style="border:0;width:100%;height:100%;overflow:hidden;"></iframe><div data-tab="" style="width:100%;height:100%;top:50px;left:0;position:absolute;background-color:White;filter:alpha(opacity=50); -moz-opacity:0.5;opacity:0.5;"><img src="../../Content/images/loading.gif" alt="" style="top:48%;left:48%;position:absolute;" /></div>',
- // cache: true,
- // closable: true,
- // fit: true,
- // postData: {}
- // }
- // });
- var $iframe = tabPanel.panel("body").find("iframe");
- //$iframe.attr("src", "#");
- $iframe.attr("src", newUrl);
- }
- }
- else {
- var reflashPanel = tabPanel.tabs("getSelected");
- if (reflashPanel) {
- reflashPanel.panel("open").panel('refresh', newUrl);
- }
- }
- }
- }
- };
- var f_refreshDefaultIndexPage = function () {
- $("#index_main_content").cmsLoadHtml();
- };
- var f_showDefaultIndex = function (isRefresh) {
- $('#index_center_tabs').hide();
- $('#index_main_content').show();
- isRefresh = isRefresh || false;
- if (isRefresh) {
- $.System.refreshDefaultIndexPage();
- }
- };
- var f_hideDefaultIndex = function () {
- $('#index_main_content').hide();
- $('#index_center_tabs').show();
- var homepagetab = $('.easyui-tabs').find('.tabs-title:contains("首页")');
- if (homepagetab.length > 0) {
- homepagetab.css("padding-right", "8px");
- homepagetab.parent().css("width", "50px");
- homepagetab.parent().parent().find('.tabs-close').css('display', 'none');
- }
- $.System.resizePage();
- };
- var val_tabPanel = indexConfig['indexTabPanel']();
- val_tabPanel.tabs({
- onClose: function (title, index) {
- var allTabs = val_tabPanel.tabs('tabs');
- if (allTabs.length == 0) {
- $.System.showDefaultIndex(true);
- }
- }
- });
- var f_logout = function () {
- document.location = ("/" + CMS_SystemConfig.VirtualDirectoryPath + "/Account/LogOff").replaceDoubleSlashesToSingle();
- };
- var f_onMainPageLoad = function () {
- $.System.resizePage();
- };
- var f_maxSizeBrowser = function () {
- if (window.screen) { //判断浏览器是否支持window.screen判断浏览器是否支持screen
- var myw = screen.availWidth; //定义一个myw,接受到当前全屏的宽
- var myh = screen.availHeight; //定义一个myw,接受到当前全屏的高
- window.moveTo(0, 0); //把window放在左上脚
- window.resizeTo(myw, myh); //把当前窗体的长宽跳转为myw和myh
- }
- };
- return { 'closeTabByTitle': f_closeTabByTitle, 'refreshDefaultIndexPage': f_refreshDefaultIndexPage, 'maxSizeBrowser': f_maxSizeBrowser, 'onMainPageLoad': f_onMainPageLoad, 'refreshCurrentTab': f_refreshCurrentTab, 'init': f_init, 'resizePage': f_resizePage, 'getTabPanel': indexConfig['indexTabPanel'], 'addTab': f_addTab, 'showDefaultIndex': f_showDefaultIndex, 'hideDefaultIndex': f_hideDefaultIndex, 'closeTab': f_closeTab, 'logout': f_logout };
- })();
- $.System.init();
- },
- BrowserHandle: function () {
- if ($.browser.msie) {
- if ($.browser.version < 7) {
- $("body:first", document).addClass("ie6");
- //document.execCommand("BackgroundImageCache", false, true);
- } else if ($.browser.version < 8) {
- $("body:first", document).addClass("ie7");
- }
- }
- },
- UserExperience: function () {//增强用户体验
- //add by suzd 去掉下拉框后退事件
- document.onkeydown = function (event) {
- event = window.event || event;
- if (event.keyCode == 8) {
- event.keyCode = 0;
- event.returnvalue = false;
- }
- };
- //add by suzd 文本框回车激发提交事件
- $("div.search_keyword").find("input[type='text']").live("keydown", function (event) {
- var target = $(this);
- switch (event.keyCode) {
- case 13:
- target.closest("div.search_keyword").find("div").not("search_input").find(".easyui-linkbutton").focus().click().blur();
- break;
- }
- });
- //扩展DateTimeBox控件,用户点击input输入框等同点击后面的日期图标
- $('span.datebox').find('input.combo-text').live('click', function () {
- $(this).siblings('span').find('span.combo-arrow').click();
- });
- //扩展DropdownList控件,用户点击input输入框等同点击后面的下拉图标
- $('span.combo').find('input.combo-text').live('click', function () {
- $(this).siblings('span').find('span.combo-arrow').click();
- });
- },
- ValidateSelectBox: function () {
- $("select.easyui-validatebox:not(:disabled)").validatebox("validate");
- }
- };
- (function ($) {
- if ($.parser) {
- $.parser.parseEasyUI = function (loadPlugins) {
- if (loadPlugins.length > 0) {
- for (var i = 0; i < loadPlugins.length; i++) {
- var _3 = loadPlugins[i];
- var r = $(".easyui-" + _3);
- if (r.length) {
- if (r[_3]) {
- r[_3]();
- }
- }
- }
- } else {
- $.parser.parse();
- }
- };
- }
- // $(document).click(function() {
- // var o = $(window.event.srcElement);
- // if (o.get(0).tagName.toLowerCase() == "input" && o.attr("type").toLowerCase() == "text") {
- // o.select();
- // }
- // });
- })(jQuery);
- $(function () {
- CMS_PageLoadEvents.SystemHandle();
- CMS_PageLoadEvents.BrowserHandle();
- CMS_PageLoadEvents.UserExperience();
- var delay = 0;
- if ($.browser.msie) {
- if ($.browser.version < 7) {
- delay = 100;
- }
- }
- setTimeout(function () {
- // var dStart = new Date();
- //CMS_PageLoadEvents.AddStarToRequired();
- if ($.browser.msie && $.browser.version > 6) {
- CMS_PageLoadEvents.ValidateSelectBox();
- }
- //var dEnd = new Date();
- //alert(dEnd - dStart);
- }, delay);
- $('.frm-btn').click(function () {
- var $this = $(this),
- confirm = $this.data('confirm') || '';
- if (confirm == '') {
- var frmId = $this.data('frmid'),
- $frm = $('#' + frmId),
- actionUrl = $this.data('url'),
- afterValidate = $this.data('aftervalidate') || '',
- afterValidateRet = true,
- isValid = $frm.form('validate');
- if (isValid && afterValidate != '') {
- afterValidateRet = window[afterValidate]();
- }
- if (isValid && afterValidateRet) {
- $frm.attr('action', actionUrl);
- $.cmsLoading.show("等待服务器返回处理结果");
- $frm.submit();
- }
- return false;
- }
- $.messager.confirm("系统提示", confirm, function (r) {
- if (r) {
- var frmId = $this.data('frmid'),
- $frm = $('#' + frmId),
- actionUrl = $this.data('url'),
- afterValidate = $this.data('aftervalidate') || '',
- afterValidateRet = true,
- isValid = $frm.form('validate');
- if (isValid && afterValidate != '') {
- afterValidateRet = window[afterValidate]();
- }
- if (isValid && afterValidateRet) {
- $frm.attr('action', actionUrl);
- $.cmsLoading.show("等待服务器返回处理结果");
- $frm.submit();
- }
- }
- });
- return false;
- });
- });
- $.fn.extend({
- getFormParams: function () {
- var jsonString = "({'QueryParamsDatas':'";
- $(this).find('[name]').each(function (i, n) {
- var jn = $(n);
- if (jn.attr("name")) {
- jsonString += jn.attr("name") + "|*|" + jn.val() + "|@|";
- }
- else {
- var ezobject = jn.attr("comboname");
- if (ezobject) {
- if ($("[name='" + ezobject + "']").length > 0) {
- jsonString += ezobject + "|*|" + $("[name='" + ezobject + "']").val() + "|@|";
- }
- if ($("[submitName='" + ezobject + "']").length > 0) {
- jsonString += ezobject + "|*|" + $("[submitName='" + ezobject + "']").val() + "|@|";
- }
- }
- }
- });
- jsonString += "'})";
- return eval(jsonString);
- },
- getJsonFormParams: function () {
- var jsonString = "({";
- $(this).find('[name]').each(function (i, n) {
- var jn = $(n);
- if (jn.attr("name")) {
- jsonString += jn.attr("name") + ":'" + jn.val() + "',";
- }
- else {
- var ezobject = jn.attr("comboname");
- if (ezobject) {
- if ($("[name='" + ezobject + "']").length > 0) {
- jsonString += ezobject + ":'" + $("[name='" + ezobject + "']").val() + "',";
- }
- if ($("[submitName='" + ezobject + "']").length > 0) {
- jsonString += ezobject + ":'" + $("[submitName='" + ezobject + "']").val() + "',";
- }
- }
- }
- });
- jsonString += "})";
- return eval(jsonString);
- }
- });
- $.extend({
- getDataGridParams: function (gridid) {
- var jsonString = "({'QueryParamsDatas':'";
- $("[data-condition='" + gridid + "']").each(function (i, n) {
- var jn = $(n);
- if (jn.attr("type") == "checkbox") {
- var jnValue = jn.attr("checked") == "checked";
- jsonString += jn.attr("name") + "|*|" + jnValue + "|@|";
- }
- else if (jn.attr("name")) {
- jsonString += jn.attr("name") + "|*|" + jn.val() + "|@|";
- }
- else {
- var ezobject = jn.attr("comboname");
- if (ezobject) {
- if ($("[name='" + ezobject + "']").length > 0) {
- jsonString += ezobject + "|*|" + $("[name='" + ezobject + "']").val() + "|@|";
- }
- if ($("[submitName='" + ezobject + "']").length > 0) {
- jsonString += ezobject + "|*|" + $("[submitName='" + ezobject + "']").val() + "|@|";
- }
- }
- }
- });
- jsonString += "'})";
- return eval(jsonString);
- }
- });
- //******************************************End******************************************//
- //***************************************************************************************//
|