From 7b59484829ca81738e9881553e913e0c562eef87 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 26 Mar 2022 23:43:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E6=9C=8D=E5=8A=A1=E6=8B=86=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/js/customertype/customertypeadd.js | 2 +- .../template/js/customertype/customertypeedit.js | 4 ++-- .../template/js/customertype/customertypelist.js | 12 ++++++------ .../resources/template/assets/lib/layui/custom.js | 2 ++ .../assets/lib/layui/customer/ajaxPostUtil.js | 9 +++++++++ 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/crm/src/main/resources/template/js/customertype/customertypeadd.js b/crm/src/main/resources/template/js/customertype/customertypeadd.js index 6703b5b07..cf5719193 100644 --- a/crm/src/main/resources/template/js/customertype/customertypeadd.js +++ b/crm/src/main/resources/template/js/customertype/customertypeadd.js @@ -17,7 +17,7 @@ layui.config({ var params = { typeName: $("#typeName").val() }; - AjaxPostUtil.request({url: reqBasePath + "customertype002", params: params, type: 'json', callback: function(json){ + AjaxPostUtil.request({url: flowableBasePath + "customertype002", params: params, type: 'json', callback: function(json){ if (json.returnCode == 0){ parent.layer.close(index); parent.refreshCode = '0'; diff --git a/crm/src/main/resources/template/js/customertype/customertypeedit.js b/crm/src/main/resources/template/js/customertype/customertypeedit.js index 512c7794d..b0060dc79 100644 --- a/crm/src/main/resources/template/js/customertype/customertypeedit.js +++ b/crm/src/main/resources/template/js/customertype/customertypeedit.js @@ -12,7 +12,7 @@ layui.config({ showGrid({ id: "showForm", - url: reqBasePath + "customertype003", + url: flowableBasePath + "customertype003", params: {rowId: parent.rowId}, pagination: false, template: getFileContent('tpl/customertype/customertypeeditTemplate.tpl'), @@ -27,7 +27,7 @@ layui.config({ rowId: parent.rowId, typeName: $("#typeName").val() }; - AjaxPostUtil.request({url: reqBasePath + "customertype004", params: params, type: 'json', callback: function(json){ + AjaxPostUtil.request({url: flowableBasePath + "customertype004", params: params, type: 'json', callback: function(json){ if (json.returnCode == 0){ parent.layer.close(index); parent.refreshCode = '0'; diff --git a/crm/src/main/resources/template/js/customertype/customertypelist.js b/crm/src/main/resources/template/js/customertype/customertypelist.js index 7d6eb0dc8..836dd7e15 100644 --- a/crm/src/main/resources/template/js/customertype/customertypelist.js +++ b/crm/src/main/resources/template/js/customertype/customertypelist.js @@ -16,7 +16,7 @@ layui.config({ id: 'messageTable', elem: '#messageTable', method: 'post', - url: reqBasePath + 'customertype001', + url: flowableBasePath + 'customertype001', where: {typeName: $("#typeName").val(), state: $("#state").val()}, even: true, page: true, @@ -115,7 +115,7 @@ layui.config({ function del(data, obj){ layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){ layer.close(index); - AjaxPostUtil.request({url: reqBasePath + "customertype005", params: {rowId: data.id}, type: 'json', callback: function(json){ + AjaxPostUtil.request({url: flowableBasePath + "customertype005", params: {rowId: data.id}, type: 'json', callback: function(json){ if(json.returnCode == 0){ winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1,time: 2000}); loadTable(); @@ -126,12 +126,12 @@ layui.config({ }); } - //上线 + // 上线 function up(data, obj){ var msg = obj ? '确认将【' + obj.data.typeName + '】上线吗?' : '确认将选中数据上线吗?'; layer.confirm(msg, {icon: 3, title: '类型上线'}, function (index) { layer.close(index); - AjaxPostUtil.request({url: reqBasePath + "customertype006", params: {rowId: data.id}, type: 'json', callback: function(json){ + AjaxPostUtil.request({url: flowableBasePath + "customertype006", params: {rowId: data.id}, type: 'json', callback: function(json){ if(json.returnCode == 0){ winui.window.msg("上线成功", {icon: 1, time: 2000}); loadTable(); @@ -142,12 +142,12 @@ layui.config({ }); } - //下线 + // 下线 function down(data, obj){ var msg = obj ? '确认将【' + obj.data.typeName + '】下线吗?' : '确认将选中数据下线吗?'; layer.confirm(msg, {icon: 3, title: '类型下线'}, function (index) { layer.close(index); - AjaxPostUtil.request({url: reqBasePath + "customertype007", params: {rowId: data.id}, type: 'json', callback: function(json){ + AjaxPostUtil.request({url: flowableBasePath + "customertype007", params: {rowId: data.id}, type: 'json', callback: function(json){ if(json.returnCode == 0){ winui.window.msg("下线成功", {icon: 1, time: 2000}); loadTable(); diff --git a/web/src/main/resources/template/assets/lib/layui/custom.js b/web/src/main/resources/template/assets/lib/layui/custom.js index 832491d4d..6ffffc6c4 100644 --- a/web/src/main/resources/template/assets/lib/layui/custom.js +++ b/web/src/main/resources/template/assets/lib/layui/custom.js @@ -47,6 +47,7 @@ var fileBasePath; // 接口请求地址 var reqBasePath; // 总项目 var shopBasePath; // 商城项目 +var flowableBasePath; // 工作流相关功能的项目 var webSocketPath;//聊天socket-开发 @@ -56,6 +57,7 @@ function initBaseParams(){ reqBasePath = sysMainMation.reqBasePath; shopBasePath = sysMainMation.shopBasePath; webSocketPath = sysMainMation.webSocketPath; + flowableBasePath = sysMainMation.flowableBasePath; } // 编辑加载自定义的js文件 diff --git a/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js index 1b6da6089..34581fa4b 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js @@ -99,6 +99,15 @@ var AjaxPostUtil = { } else { this.options.callback.call(this); } + }else if(xmlhttp.readyState == 4 && (xmlhttp.status == 404)) { + // 移除请求遮罩层 + layui.$("body").find(".mask-req-str").remove(); + returnValue = eval('(' + '{"returnMessage":"接口请求:404","returnCode":-9999,"total":0,"rows":"","bean":""}' + ')'); + if(returnValue) { + this.options.callback.call(this, returnValue); + } else { + this.options.callback.call(this); + } } }, -- GitLab