Commit ae36840f authored by Wallen姚文辉's avatar Wallen姚文辉

修复滚动条bug和新增路径不重置bug

parent a5c0996b
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/dist/plugins/css/pluginsCss.css"/><link rel="stylesheet" href="/dist/plugins/plugins.css"/><link rel="stylesheet" href="/dist/css/luckysheet.css"/><link rel="stylesheet" href="/dist/assets/iconfont/iconfont.css"/><script src="/dist/plugins/js/plugin.js"></script><script src="/dist/luckysheet.umd.js"></script><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.2cb101ab.js"></script><script defer="defer" src="/js/app.6751b024.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.a162d9fa.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/dist/plugins/css/pluginsCss.css"/><link rel="stylesheet" href="/dist/plugins/plugins.css"/><link rel="stylesheet" href="/dist/css/luckysheet.css"/><link rel="stylesheet" href="/dist/assets/iconfont/iconfont.css"/><script src="/dist/plugins/js/plugin.js"></script><script src="/dist/luckysheet.umd.js"></script><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.2cb101ab.js"></script><script defer="defer" src="/js/app.7322e2c5.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.a162d9fa.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -19,96 +19,104 @@
</Space>
</template>
</PageHeader>
<Tabs size="large" type="card" closable @on-tab-remove="handleTabRemove" draggable @on-drag-drop="handleDragDrop"
:animated="false" v-model="choicedkey">
<template v-for="item_1 in keys">
<TabPane :label='item_1' :name="item_1">
<a style="font-size: large;" @click="choicePath(-1)">{{ item_1 }}&nbsp;</a>
<a v-for="m in path" @click="choicePath(m)" style="font-size: large;">/&nbsp;{{ m }}&nbsp;</a>
<div class="demo-spin-article" style="height: 630px;overflow: auto;">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="9">
<div align="center"><strong>代码覆盖率</strong></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">
<div align="center"><strong>行覆盖</strong></div>
</td>
<td colspan="3">
<div align="center"><strong>函数覆盖</strong></div>
</td>
<td colspan="3">
<div align="center"><strong>类覆盖</strong></div>
</td>
</tr>
</thead>
<tbody>
<template v-for="item in dirInfo">
<tr v-if="!state || state && item.change">
<td :class="getStatus(item, 0, 1)" v-if="item.source == 'Total'">总计</td>
<td :class="getStatus(item, 0, 1)" v-else>
<template v-if="!render_type">
<template v-if="item.source.indexOf('.')!=-1">
<img src="@/assets/file-code.svg" class="octicon">
</template>
<template v-else>
<img src="@/assets/file-directory.svg" class="octicon">
</template>
<a @click="path.push(item.source)">{{ item.source }}</a>
</template>
<template v-else>
<template v-if="item.start != 0 && !item.start">
<abbr :title="path.join('/').slice(0, path.join('/').indexOf('.'))">{{
item.source }}</abbr>
<div style="display: flex;flex-direction: column;">
<div style="position: static;">
<a style="font-size: large;" @click="choicePath(-1)">{{ item_1 }}&nbsp;</a>
<a v-for="m in path" @click="choicePath(m)" style="font-size: large;">/&nbsp;{{ m
}}&nbsp;</a>
</div>
<div id="run_c" class="demo-spin-article" style="max-height: 630px;overflow-y:scroll;">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="9">
<div align="center"><strong>代码覆盖率</strong></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">
<div align="center"><strong>行覆盖</strong></div>
</td>
<td colspan="3">
<div align="center"><strong>函数覆盖</strong></div>
</td>
<td colspan="3">
<div align="center"><strong>类覆盖</strong></div>
</td>
</tr>
</thead>
<tbody>
<template v-for="item in dirInfo">
<tr v-if="!state || state && item.change">
<td :class="getStatus(item, 0, 1)" v-if="item.source == 'Total'">总计</td>
<td :class="getStatus(item, 0, 1)" v-else>
<template v-if="!render_type">
<template v-if="item.source.indexOf('.') != -1">
<img src="@/assets/file-code.svg" class="octicon">
</template>
<template v-else>
<img src="@/assets/file-directory.svg" class="octicon">
</template>
<a @click="path.push(item.source)">{{ item.source }}</a>
</template>
<template v-else>
&nbsp;
<a :href="'#' + item.start"><abbr :title="item.source + '()'">{{
item.source
}}</abbr></a>
<template v-if="item.start != 0 && !item.start">
<abbr
:title="path.join('/').slice(0, path.join('/').indexOf('.'))">{{
item.source }}</abbr>
</template>
<template v-else>
&nbsp;
<a @click="smoothScroll(item.start)"><abbr :title="item.source + '()'">{{
item.source
}}</abbr></a>
</template>
</template>
</template>
</td>
<template v-for="i in [0, 1, 2]">
<template v-if="getStatus(item, 0, i) != ''">
<td :class="getStatus(item, 0, i) + ' big'">
<div class="progress">
<div :class="'progress-bar ' + getStatus(item, 1, i)"
role="progressbar" :aria-valuenow="getProgerss(item, 0, i)"
aria-valuemin="0" aria-valuemax="100"
:style="'width: ' + getProgerss(item, 1, i) + '%'">
<span class="sr-only">{{ getProgerss(item, 0, i) }}% covered ({{
getStatus(item, 0, i)
}})</span>
</td>
<template v-for="i in [0, 1, 2]">
<template v-if="getStatus(item, 0, i) != ''">
<td :class="getStatus(item, 0, i) + ' big'">
<div class="progress">
<div :class="'progress-bar ' + getStatus(item, 1, i)"
role="progressbar" :aria-valuenow="getProgerss(item, 0, i)"
aria-valuemin="0" aria-valuemax="100"
:style="'width: ' + getProgerss(item, 1, i) + '%'">
<span class="sr-only">{{ getProgerss(item, 0, i) }}%
covered
({{
getStatus(item, 0, i)
}})</span>
</div>
</div>
</div>
</td>
<td :class="getStatus(item, 0, i) + ' small'">
<div align="right">{{ getProgerss(item, 0, i) }}%</div>
</td>
<td :class="getStatus(item, 0, i) + ' small'">
<div align="right">
{{ getcoverInfo(item, i)[1] }}&nbsp;/&nbsp;{{ getcoverInfo(item,
i)[0]
}}
</div>
</td>
</td>
<td :class="getStatus(item, 0, i) + ' small'">
<div align="right">{{ getProgerss(item, 0, i) }}%</div>
</td>
<td :class="getStatus(item, 0, i) + ' small'">
<div align="right">
{{ getcoverInfo(item, i)[1] }}&nbsp;/&nbsp;{{
getcoverInfo(item,
i)[0]
}}
</div>
</td>
</template>
</template>
</template>
</tr>
</template>
</tbody>
</table>
<table style="width: 100%;" v-html="fileAll" v-if="render_type && !state">
</table>
<table style="width: 100%;" v-html="fileChange" v-if="render_type && state"></table>
<Spin size="large" fix :show="spinShow"></Spin>
</tr>
</template>
</tbody>
</table>
<table style="width: 100%;" v-html="fileAll" v-if="render_type && !state">
</table>
<table style="width: 100%;" v-html="fileChange" v-if="render_type && state"></table>
<Spin size="large" fix :show="spinShow"></Spin>
</div>
</div>
</TabPane>
<Modal v-model="modal" title="添加预警" @on-ok="addLogs" @on-cancel="modal = false">
......@@ -231,6 +239,23 @@ function getStatus(item, type, who) {
}
}
function smoothScroll(targetId) {
// const container = document.getElementById('scroll-container');
const target = document.getElementById(targetId);
const b=document.getElementById('run_c');
console.info(target.parentNode.parentNode.parentNode.parentNode.offsetTop)
console.info(target.parentNode.parentNode.offsetTop)
b.scrollTop = target.parentNode.parentNode.offsetTop+target.parentNode.parentNode.parentNode.parentNode.offsetTop-80;
// 平滑滚动到目标元素
// target.scrollIntoView({
// behavior: 'instant',
// block: 'nearest', // 使目标元素在视口内对齐
// });
// 阻止默认的页面滚动行为
// return false;
}
function choicePath(a) {
if (a == -1) {
return path.value.length = 0
......@@ -247,7 +272,7 @@ function getLogs(callback = () => { }) {
function addLogs() {
request("post", "/codecover/addlog", searchinfo, this, () => {
choicedkey.value = searchinfo.product_key; searchinfo.product = null; searchinfo.product_key = null; searchinfo.commit_source = null; searchinfo.commit_target = null; getLogs(()=>{render_key(choicedkey.value,path.value)});
choicedkey.value = searchinfo.product_key; searchinfo.product = null; searchinfo.product_key = null; searchinfo.commit_source = null; searchinfo.commit_target = null; path.value=[],getLogs(() => { });
})
}
......@@ -275,15 +300,15 @@ function handleDragDrop(name, newName, a, b, names) {
})
}
function render_key(value,path){
function render_key(value, path) {
spinShow.value = true
request("get", "/codecover/dirinfo", { key: value, path: path.join('/') }, this, (res) => {
dirInfo.value = res.data;
spinShow.value = false
},(err) => {
spinShow.value = false
dirInfo.value = []
})
request("get", "/codecover/dirinfo", { key: value, path: path.join('/') }, this, (res) => {
dirInfo.value = res.data;
spinShow.value = false
}, (err) => {
spinShow.value = false
dirInfo.value = []
})
}
watch(
......@@ -292,7 +317,7 @@ watch(
path.value.length = 0
render_type.value = 0
console.info(newVal, oldVal)
render_key(newVal,path.value)
render_key(newVal, path.value)
})
watch(
......@@ -301,7 +326,7 @@ watch(
if (newVal.length == 0 || newVal[newVal.length - 1].indexOf('.') == -1) {
render_type.value = 0
spinShow.value = true
render_key(choicedkey.value,newVal)
render_key(choicedkey.value, newVal)
} else {
render_type.value = 1
spinShow.value = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment