Browse Source

定额下拉框背景色,选中色,等调整

zhangweicheng 6 years ago
parent
commit
d36fffe8a1
2 changed files with 17 additions and 4 deletions
  1. 11 3
      public/web/tree_sheet/tree_sheet_helper.js
  2. 6 1
      web/building_saas/css/custom.css

+ 11 - 3
public/web/tree_sheet/tree_sheet_helper.js

@@ -521,15 +521,16 @@ var TREE_SHEET_HELPER = {
 
             TreeNodeCellType.prototype.updateEditor = function (editorContext, cellStyle, cellRect, context) {
                 let me = this;
-                $(editorContext).append(`<div><ul class="es-list" style="display: block;background-color:${cellStyle.backColor}"></ul></div>`);//<li class="" data-value="" style=""> <br></li>
+                $(editorContext).append(`<div><ul class="es-list" style="display: block;"></ul></div>`);//<li class="" data-value="" style=""> <br></li> //background-color:${cellStyle.backColor}
                 $('#esInput').val(context.sheet.getValue(context.row,context.col));
                 $('#esInput').select();
                 projectObj.project.Ration.getNearRations(initNode.data,function(rations){
                     if(rations.length > 0){
                         let li_html = "";
                         for(let r of rations){
-                            if(r.code==initNode.data.code) continue; //排除自已
-                            li_html += `<li class="es_li" data-value="${r.code}" >${r.code} ${r.name} ${r.unit}</li>`;//定额编码+空格+定额名称+空格+定额单位。
+                            let selfstyle = ""
+                            if(r.code==initNode.data.code) selfstyle="es-list-selected" //continue; //改为不排除,标记本身
+                            li_html += `<li class="es_li ${selfstyle}" data-value="${r.code}" >${r.code} ${r.name} ${r.unit}</li>`;//定额编码+空格+定额名称+空格+定额单位。
                         }
                         $(".es-list").html(li_html);
                         $(".es-list").css("min-width",cellRect.width);
@@ -541,6 +542,13 @@ var TREE_SHEET_HELPER = {
                         $(".es-list").hide();
                         context.sheet.endEdit();
                     })
+                    $(".es-list").children(".es_li").hover(function(){
+                        $(this).css("background-color",cellStyle.backColor);
+                    },function(){
+                        $(this).css("background-color","");
+                    });
+
+
                     $("#esBtn").bind('click',function(e){
                         $(".es-list").toggle();
                     });

+ 6 - 1
web/building_saas/css/custom.css

@@ -231,9 +231,14 @@ legend.legend{
     border:none;
 }
 
-.es-list>li:hover{
+/*.es-list>li:hover{
+    background: lightgrey;
+}*/
+
+.es-list-selected{
     background: lightgrey;
 }
+
 .es-list>li{
     font-size:13px;
 }