From 6e831c9dd9a46a1dbd727f5f06068c10aef99b46 Mon Sep 17 00:00:00 2001 From: liaoxujun@qq.com <liaoxujun@qq.com> Date: 星期五, 23 二月 2024 17:35:12 +0800 Subject: [PATCH] no message --- cy_scdz/Areas/Setting/Views/Setting/index.cshtml | 38 ++++++++++++++++++++++++++++++-------- 1 files changed, 30 insertions(+), 8 deletions(-) diff --git a/cy_scdz/Areas/Setting/Views/Setting/index.cshtml b/cy_scdz/Areas/Setting/Views/Setting/index.cshtml index 7fe57a9..928870c 100644 --- a/cy_scdz/Areas/Setting/Views/Setting/index.cshtml +++ b/cy_scdz/Areas/Setting/Views/Setting/index.cshtml @@ -93,15 +93,21 @@ // 鑾峰彇褰撳墠鐐瑰嚮鎸夐挳鐨刬d灞炴�у�� var buttonId = ""; + var strct = ""; switch (this.id) { case 'zbgys': buttonId = "璇疯緭鍏ユ柊澧炰腑鏍囦緵搴斿晢鍚嶇О"; + strct = '<div><label>鍚嶇О锛�</label><input type="text" id="textValue"></div>'; break; case 'fmzz': buttonId = "璇疯緭鍏ユ柊澧炲皝闈㈢焊寮犺鏍�"; + strct = '<div><label>鍚嶇О锛�</label><input type="text" id="textValue"></div>' + + '<div><label>鍏嬮噸锛�</label><input type="number" id="numValue"></div>'; break; case 'nyzz': buttonId = "璇疯緭鍏ユ柊澧炲唴椤电焊寮犺鏍�"; + strct = '<div><label>鍚嶇О锛�</label><input type="text" id="textValue"></div>' + + '<div><label>鍏嬮噸锛�</label><input type="number" id="numValue"></div>'; break; default: buttonId = ""; @@ -110,16 +116,32 @@ } var btid = this.id; - - // 寮瑰嚭涓�涓璇濇璁╃敤鎴疯緭鍏ュ唴瀹� - layer.prompt({ + layer.open({ + type: 1, title: buttonId, - formType: 0 // 0 琛ㄧず鏂囨湰杈撳叆妗� - }, function (value, index, elem) { - // 鍦ㄨ繖閲屾墽琛屾彁浜ら�昏緫锛屼緥濡傚悜鏈嶅姟鍣ㄥ彂閫佹暟鎹瓑 - submitData(btid, value, index); + content: strct, + btn: ['纭', '鍙栨秷'], + yes: function (index, layero) { + var textVal = $('#textValue').val(); + var numVal = $('#numValue').val(); + if (!isNaN(numVal)) { + submitData(btid, { text: textVal, number: numVal }, index); + } else { + layer.msg('鏁板瓧杈撳叆涓嶅悎娉曪紝璇疯緭鍏ユ湁鏁堢殑鏁板瓧'); + } + } }); + + // // 寮瑰嚭涓�涓璇濇璁╃敤鎴疯緭鍏ュ唴瀹� + // layer.prompt({ + // title: buttonId, + // formType: 0 // 0 琛ㄧず鏂囨湰杈撳叆妗� + // }, function (value, index, elem) { + // // 鍦ㄨ繖閲屾墽琛屾彁浜ら�昏緫锛屼緥濡傚悜鏈嶅姟鍣ㄥ彂閫佹暟鎹瓑 + // submitData(btid, value, index); + + // }); }); function submitData(id, value, index) { @@ -129,7 +151,7 @@ type: "POST" , contentType: "application/json; charset=utf-8" , dataType: "json" - , data: JSON.stringify({ key: id, name: value }) + , data: JSON.stringify({ key: id, name: value.text, val: value.number }) , success: function (result) { -- Gitblit v1.9.1