From 320c89fffd538198576d2ccb19ec6fa6ea3cbd7b Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Tue, 29 Apr 2025 17:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=AE=A1=E7=90=86-=E7=BA=BF?= =?UTF-8?q?=E8=B7=AF=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/lineManagement/child/importTower.js | 4 +-- .../lineManagement/child/ropewayFormTemp.js | 11 +++++-- .../basic/lineManagement/child/ropewayList.js | 7 ++-- .../lineManagement/child/threeSpanFormTemp.js | 6 ++-- .../lineManagement/child/threeSpanList.js | 32 +++++++++++-------- .../lineManagement/child/towerFormTemp.js | 10 ++++-- .../basic/lineManagement/child/towerList.js | 11 ++++--- .../lineManagement/child/importTower.html | 4 +-- 8 files changed, 54 insertions(+), 31 deletions(-) diff --git a/src/main/resources/static/js/basic/lineManagement/child/importTower.js b/src/main/resources/static/js/basic/lineManagement/child/importTower.js index 2d491cb..c0fc875 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/importTower.js +++ b/src/main/resources/static/js/basic/lineManagement/child/importTower.js @@ -147,13 +147,13 @@ function setParams(params) { success: function(res) { layer.close(loadingMsg); if (res.code === 200) { - layer.msg(res.data, {icon: 1}); + layer.msg(res.msg, {icon: 1}); setTimeout(function() { closePage(1); },3000) // 关闭页面并刷新父页面 } else { - layer.msg(res.data || '上传失败', {icon: 2}); + layer.msg(res.msg || '上传失败', {icon: 2}); // 上传失败时重置 resetFileSelection(); } diff --git a/src/main/resources/static/js/basic/lineManagement/child/ropewayFormTemp.js b/src/main/resources/static/js/basic/lineManagement/child/ropewayFormTemp.js index 2349221..35755e8 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/ropewayFormTemp.js +++ b/src/main/resources/static/js/basic/lineManagement/child/ropewayFormTemp.js @@ -155,11 +155,15 @@ function saveData(data) { }, function (result) { layer.close(loadingMsg); if (result.code === 200) { - closePage(1); - parent.layer.msg(result.msg, {icon: 1}); + layer.msg(result.msg, {icon: 1}); + setTimeout(function () { + closePage(1); + },3000) } else { layer.alert(result.msg, {icon: 2}) - enableForm(); + setTimeout(function () { + enableForm(); + },3000) } }, function (xhr) { layer.close(loadingMsg); @@ -174,5 +178,6 @@ function closePage(type) { parent.layer.close(index); if (type === 1) { parent.reloadData() + parent.parent.reloadData() } } \ No newline at end of file diff --git a/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js b/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js index cd2f970..f2930cb 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js +++ b/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js @@ -171,8 +171,11 @@ function delData(id) { }, function (result) { layer.close(loadingMsg); // 关闭提示层 if (result.code === 200) { - parent.layer.msg(result.msg, {icon: 1}) - query() + layer.msg(result.msg, {icon: 1}) + setTimeout(function () { + parent.reloadData() + query() + },1000) } else if (result.code === 500) { layer.alert(result.msg, {icon: 2}) } diff --git a/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js b/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js index 12e29f2..2dd682d 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js +++ b/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js @@ -394,8 +394,10 @@ function saveData(data) { }, function (result) { layer.close(loadingMsg); if (result.code === 200) { - closePage(1); - parent.layer.msg(result.msg, {icon: 1}); + layer.msg(result.msg, {icon: 1}); + setTimeout(function () { + closePage(1); + },3000) } else { layer.alert(result.msg, {icon: 2}) setTimeout(function () { diff --git a/src/main/resources/static/js/basic/lineManagement/child/threeSpanList.js b/src/main/resources/static/js/basic/lineManagement/child/threeSpanList.js index 2fc4781..d6d4dcd 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/threeSpanList.js +++ b/src/main/resources/static/js/basic/lineManagement/child/threeSpanList.js @@ -115,8 +115,9 @@ function initTable(dataList, limit, page) { title: "操作", unresize: true, width: 200, align: "center", templet: function (d) { let html = ''; - let del = "删除" - let edit = "修改"; + let encodedTowerList = encodeURIComponent(JSON.stringify(d.tbSpanTowerList)); + let del = "删除"; + let edit = "修改"; html = edit + del; if (d.delFlag == 1) { return ''; @@ -193,11 +194,13 @@ function addDataThreeSpan(id) { function delData(id, tbSpanTowerList) { // 将字符串转回对象 try { - // 将字符串转回对象 + // 处理可能的编码问题 + tbSpanTowerList = tbSpanTowerList.replace(/[\u0000-\u0019]+/g,""); // 移除不可见字符 tbSpanTowerList = JSON.parse(tbSpanTowerList); } catch(e) { tbSpanTowerList = []; } + layer.confirm("确定删除吗?", { move: false }, function () { @@ -205,26 +208,29 @@ function delData(id, tbSpanTowerList) { let url = dataUrl + "/tbThreeSpan/delTbThreeSpan"; let params = { 'id': id, - 'tbSpanTowerList':tbSpanTowerList + 'tbSpanTowerList': tbSpanTowerList } params = { encryptedData: encryptCBC(JSON.stringify(params)) } + ajaxRequest(url, "POST", params, true, function () { }, function (result) { - layer.close(loadingMsg); // 关闭提示层 + layer.close(loadingMsg); if (result.code === 200) { - parent.layer.msg(result.data, {icon: 1}) - parent.reloadData() - query() - } else if (result.code === 500) { - layer.alert(result.data, {icon: 2}) + layer.msg(result.msg, {icon: 1}); + setTimeout(function () { + parent.reloadData(); + query(); + }, 3000); + } else { + layer.alert(result.msg, {icon: 2}); } }, function (xhr) { - layer.close(loadingMsg); // 关闭提示层 - error(xhr) + layer.close(loadingMsg); + error(xhr); }); - }) + }); } function exportThreeSpan(){ diff --git a/src/main/resources/static/js/basic/lineManagement/child/towerFormTemp.js b/src/main/resources/static/js/basic/lineManagement/child/towerFormTemp.js index 80932aa..602d9c0 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/towerFormTemp.js +++ b/src/main/resources/static/js/basic/lineManagement/child/towerFormTemp.js @@ -217,11 +217,15 @@ function saveData(data) { }, function (result) { layer.close(loadingMsg); if (result.code === 200) { - closePage(1); - parent.layer.msg(result.msg, {icon: 1}); + layer.msg(result.msg, {icon: 1}); + setTimeout(function () { + closePage(1); + },3000) } else { layer.alert(result.msg, {icon: 2}) - enableForm(); // 保存失败时启用表单 + setTimeout(function () { + enableForm(); + },3000) } }, function (xhr) { layer.close(loadingMsg); diff --git a/src/main/resources/static/js/basic/lineManagement/child/towerList.js b/src/main/resources/static/js/basic/lineManagement/child/towerList.js index 063f13f..e7399d2 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/towerList.js +++ b/src/main/resources/static/js/basic/lineManagement/child/towerList.js @@ -169,11 +169,14 @@ function delData(id) { }, function (result) { layer.close(loadingMsg); // 关闭提示层 if (result.code === 200) { - parent.layer.msg(result.data, {icon: 1}) - parent.reloadData() - query() + layer.msg(result.msg, {icon: 1}) + setTimeout(function () { + parent.reloadData() + query() + },1000) + } else if (result.code === 500) { - layer.alert(result.data, {icon: 2}) + layer.alert(result.msg, {icon: 2}) } }, function (xhr) { layer.close(loadingMsg); // 关闭提示层 diff --git a/src/main/resources/static/pages/basic/lineManagement/child/importTower.html b/src/main/resources/static/pages/basic/lineManagement/child/importTower.html index 6dd0212..700524c 100644 --- a/src/main/resources/static/pages/basic/lineManagement/child/importTower.html +++ b/src/main/resources/static/pages/basic/lineManagement/child/importTower.html @@ -197,7 +197,7 @@