|
@@ -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();
|
|
|
});
|