From 3eba968908773995dd591d559b61f33f001afe7d Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期一, 23 九月 2024 11:21:57 +0800 Subject: [PATCH] 按钮设置:图标 --- WebTM/layuiadmin/HideButton_New.js | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/WebTM/layuiadmin/HideButton_New.js b/WebTM/layuiadmin/HideButton_New.js index 416cfca..917d923 100644 --- a/WebTM/layuiadmin/HideButton_New.js +++ b/WebTM/layuiadmin/HideButton_New.js @@ -81,6 +81,7 @@ , "HClassValue": btns[i].getAttribute('class') , "HLay_Event": btns[i].getAttribute('lay-event') , "HValue": btns[i].innerText + , "childLiElement": btns[i].querySelectorAll('i') }) //璁板綍鏁版嵁搴撲腑娌℃湁璁剧疆鏁版嵁鐨勬寜閽妭鐐圭殑淇℃伅 if ($.inArray(btns[i].id, btnsData_InDataBase) == -1) { @@ -106,7 +107,16 @@ child.className = btns_info[index_temp].HClassValue; child.setAttribute('lay-event', btns_info[index_temp].HLay_Event); child.id = btns_info[index_temp].HButtonID; - child.innerHTML = data1.data[i]["HOtherName"] == "" ? btns_info[index_temp].HValue : data1.data[i]["HOtherName"]; + + if (btns_info[index_temp].childLiElement.length > 0) { + child.appendChild(btns_info[index_temp].childLiElement[0]); + } + + var element_i = document.createElement('text'); + element_i.innerHTML = btns_info[index_temp].HValue; + child.appendChild(element_i); + + //child.innerHTML = data1.data[i]["HOtherName"] == "" ? btns_info[index_temp].HValue : data1.data[i]["HOtherName"]; if (data1.data[i]["HHideFlag"] == true) { child.style = "display:none;"; } else { @@ -127,7 +137,16 @@ child.className = btns_info[index_temp].HClassValue; child.setAttribute('lay-event', btns_info[index_temp].HLay_Event); child.id = btns_info[index_temp].HButtonID; - child.innerHTML = btns_info[index_temp].HValue; + + if (btns_info[index_temp].childLiElement.length > 0) { + child.appendChild(btns_info[index_temp].childLiElement[0]); + } + + var element_i = document.createElement('text'); + element_i.innerHTML = btns_info[index_temp].HValue; + child.appendChild(element_i); + + //child.innerHTML = btns_info[index_temp].HValue; child.style = "display:inline;"; // 灏嗗瓙鑺傜偣娣诲姞鍒扮埗鑺傜偣涓� -- Gitblit v1.9.1