diff --git a/plugins/data_query/static/css/data.css b/plugins/data_query/static/css/data.css index 5dfb28eb5..be2ee24d6 100644 --- a/plugins/data_query/static/css/data.css +++ b/plugins/data_query/static/css/data.css @@ -37,4 +37,12 @@ #mongodb_search xm-select .xm-label .xm-label-block{ height: 20px; line-height: 20px; +} + +#mongodb td:last-child, th:last-child { + width: 44px; + position:sticky; + right:0; /* 首行永远固定在左侧 */ + z-index:1; + background-color:white; } \ No newline at end of file diff --git a/plugins/data_query/static/html/index.html b/plugins/data_query/static/html/index.html index 75b21a649..b35852e61 100644 --- a/plugins/data_query/static/html/index.html +++ b/plugins/data_query/static/html/index.html @@ -16,6 +16,7 @@ +
diff --git a/plugins/data_query/static/js/app.js b/plugins/data_query/static/js/app.js index 80a740ac7..0b87cb500 100755 --- a/plugins/data_query/static/js/app.js +++ b/plugins/data_query/static/js/app.js @@ -152,7 +152,13 @@ function mongodbGetDbName(){ var mogodb_db_list; function mongodbCollectionName(){ - return mogodb_db_list.getValue('value')[0]; + // console.log(mogodb_db_list); + var v = mogodb_db_list.getValue('value'); + if (v.length == 0){ + console.log($('#mongodb').data('collection')); + return $('#mongodb').data('collection'); + } + return v[0]; } function mongodbGetList(){ @@ -214,6 +220,7 @@ function mongodbGetCollections(name){ //isAdd, 此次操作是新增还是删除 var isAdd = data.isAdd; if (isAdd){ + $('#mongodb').data('collection',change[0].value); mongodbDataList(1); } }, @@ -243,7 +250,7 @@ function mongodbDataList(p){ var sid = mongodbGetSid(); var db = mongodbGetDbName(); var collection = mongodbCollectionName(); - console.log({'sid':sid,'db':db,'collection':collection,"p":p}); + // console.log({'sid':sid,'db':db,'collection':collection,"p":p}); mgdbPostCB('get_data_list',{'sid':sid,'db':db,'collection':collection,"p":p} ,function(rdata){ if (rdata.data.status){ var data = rdata.data.data; @@ -257,7 +264,7 @@ function mongodbDataList(p){ for (var i =0 ; i'; } - header_field += '操作'; + header_field += '操作'; $('.mongodb_table thead tr').html(header_field); @@ -278,8 +285,7 @@ function mongodbDataList(p){ } } - tbody += '\ - 编辑 | \ + tbody += '\ 删除\ '; @@ -287,8 +293,8 @@ function mongodbDataList(p){ } // console.log($(window).width()-230); - $('#mongodb_table').css('width', $(window).width()+80).parent().css('width', $(window).width()-240).css('overflow','scroll'); - $('#mongodb').css('width',$(window).width()-240).css('overflow','hidden'); + $('#mongodb_table').css('width', $(document).width()+240).parent().css('width', $(document).width()-240).css('overflow','scroll'); + $('#mongodb').css('width',$(document).width()-240).css('overflow','hidden'); $('.mongodb_table tbody').html(tbody); $('.mongodb_list_page').html(data.page); } @@ -360,15 +366,13 @@ function redisGetKeyList(page,search = ''){ tbody += ''+data[i].type+''; tbody += ''+data[i].len+''; - if (data[i].endtime == -1){ tbody += '永久'; } else { tbody += ''+data[i].endtime+''; } - - tbody += '\ + tbody += '\ 编辑 | \ 删除\ ';