diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index a2d2bfc71..949a52caf 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -6,6 +6,7 @@ body { min-width: 1024px; margin: 0px !important; padding:0px !important; + cursor: default !important; } html { height: 100%; @@ -929,7 +930,38 @@ li{ padding:2px 5px; border-radius: 4px; } - +.nz-table .danger>span { + background-color: $danger-color; + color: white; + padding:2px 5px; + border-radius: 4px; +} +.nz-table .success>span { + background-color: $success-color; + color: white; + padding:2px 5px; + border-radius: 4px; +} +.nz-table .suspended>span { + background-color: $suspended-color; + color: white; + padding:2px 5px; + border-radius: 4px; +} +.nz-table .warning>span { + background-color: $warning-color; + color: white; + padding:2px 5px; + border-radius: 4px; +} +.col-resize-area { + position: absolute; + top: 0; + right: 0; + width: 4px; + height: 100%; + cursor: col-resize; +} .nz-table th { padding: 0; } @@ -2429,3 +2461,8 @@ li{ text-align: left; } +.table-tooltip { + position: fixed !important; + visibility: hidden; +} + diff --git a/nezha-fronted/src/components/common/home.vue b/nezha-fronted/src/components/common/home.vue index bfa3a8a09..0c69a7f40 100644 --- a/nezha-fronted/src/components/common/home.vue +++ b/nezha-fronted/src/components/common/home.vue @@ -7,6 +7,7 @@ + diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index a563aaf2b..dad0b1f85 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -304,7 +304,7 @@ export function calcDurationByStringTimeB(startTime, endTime) { }else if(durationSecond > 60) { result = `${(Math.floor(durationSecond/60))%60}m ${result}`; } - + return result; } export function unixTimeParseToString(unixTime,fmt='yyyy-MM-dd hh:mm:ss'){ @@ -742,3 +742,26 @@ export function clickLegend(echart,legendName,index){ } } + +export function showTableTooltip(content, show = true, e) { + //console.info(content, e) + if (show) { + let dom = document.querySelector(".table-tooltip"); + dom.innerHTML = content; + dom.setAttribute("style", `visibility: visible; top: ${e.clientY-e.offsetY+e.target.offsetHeight*0.5-dom.offsetHeight*0.5}px; left: ${e.clientX-e.offsetX+e.target.offsetWidth}px`); + } +} +export function hideTableTooltip() { + let dom = document.querySelector(".table-tooltip"); + dom.setAttribute("style", "visibility: hidden;"); + dom.innerHTML = ""; +} + +/*function getTdDom(dom) { + let tagName = dom.tagName; + if (tagName.toLowerCase() === 'td') { + return dom; + } else { + return getTdDom(dom.parentElement); + } +}*/ diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 9fd5d66e7..0431a5056 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -47,7 +47,6 @@ border v-loading="tools.loading" ref="assetTable" - :cell-class-name="messageStyle" @sort-change="tableDataSort" @row-dblclick="detail" @selection-change="(selection)=>{this.batchDeleteObjs=selection}" @@ -65,6 +64,7 @@ :key="`col_${index}`" :label="item.label" :fixed="item.fixed" + :width="item.width" :class-name="item.prop == 'option' ? 'content-right-options' : ''" :sortable="$tableSet.sortableShow(item.prop,'asset')" :prop="$tableSet.propTitle(item.prop,'asset')" @@ -72,7 +72,10 @@ >