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> <!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 \ 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 @@ ...@@ -19,96 +19,104 @@
</Space> </Space>
</template> </template>
</PageHeader> </PageHeader>
<Tabs size="large" type="card" closable @on-tab-remove="handleTabRemove" draggable @on-drag-drop="handleDragDrop" <Tabs size="large" type="card" closable @on-tab-remove="handleTabRemove" draggable @on-drag-drop="handleDragDrop"
:animated="false" v-model="choicedkey"> :animated="false" v-model="choicedkey">
<template v-for="item_1 in keys"> <template v-for="item_1 in keys">
<TabPane :label='item_1' :name="item_1"> <TabPane :label='item_1' :name="item_1">
<a style="font-size: large;" @click="choicePath(-1)">{{ item_1 }}&nbsp;</a> <div style="display: flex;flex-direction: column;">
<a v-for="m in path" @click="choicePath(m)" style="font-size: large;">/&nbsp;{{ m }}&nbsp;</a> <div style="position: static;">
<div class="demo-spin-article" style="height: 630px;overflow: auto;"> <a style="font-size: large;" @click="choicePath(-1)">{{ item_1 }}&nbsp;</a>
<table class="table table-bordered"> <a v-for="m in path" @click="choicePath(m)" style="font-size: large;">/&nbsp;{{ m
<thead> }}&nbsp;</a>
<tr> </div>
<td>&nbsp;</td> <div id="run_c" class="demo-spin-article" style="max-height: 630px;overflow-y:scroll;">
<td colspan="9"> <table class="table table-bordered">
<div align="center"><strong>代码覆盖率</strong></div> <thead>
</td> <tr>
</tr> <td>&nbsp;</td>
<tr> <td colspan="9">
<td>&nbsp;</td> <div align="center"><strong>代码覆盖率</strong></div>
<td colspan="3"> </td>
<div align="center"><strong>行覆盖</strong></div> </tr>
</td> <tr>
<td colspan="3"> <td>&nbsp;</td>
<div align="center"><strong>函数覆盖</strong></div> <td colspan="3">
</td> <div align="center"><strong>行覆盖</strong></div>
<td colspan="3"> </td>
<div align="center"><strong>类覆盖</strong></div> <td colspan="3">
</td> <div align="center"><strong>函数覆盖</strong></div>
</tr> </td>
</thead> <td colspan="3">
<tbody> <div align="center"><strong>类覆盖</strong></div>
<template v-for="item in dirInfo"> </td>
<tr v-if="!state || state && item.change"> </tr>
<td :class="getStatus(item, 0, 1)" v-if="item.source == 'Total'">总计</td> </thead>
<td :class="getStatus(item, 0, 1)" v-else> <tbody>
<template v-if="!render_type"> <template v-for="item in dirInfo">
<template v-if="item.source.indexOf('.')!=-1"> <tr v-if="!state || state && item.change">
<img src="@/assets/file-code.svg" class="octicon"> <td :class="getStatus(item, 0, 1)" v-if="item.source == 'Total'">总计</td>
</template> <td :class="getStatus(item, 0, 1)" v-else>
<template v-else> <template v-if="!render_type">
<img src="@/assets/file-directory.svg" class="octicon"> <template v-if="item.source.indexOf('.') != -1">
</template> <img src="@/assets/file-code.svg" class="octicon">
<a @click="path.push(item.source)">{{ item.source }}</a> </template>
</template> <template v-else>
<template v-else> <img src="@/assets/file-directory.svg" class="octicon">
<template v-if="item.start != 0 && !item.start"> </template>
<abbr :title="path.join('/').slice(0, path.join('/').indexOf('.'))">{{ <a @click="path.push(item.source)">{{ item.source }}</a>
item.source }}</abbr>
</template> </template>
<template v-else> <template v-else>
&nbsp; <template v-if="item.start != 0 && !item.start">
<a :href="'#' + item.start"><abbr :title="item.source + '()'">{{ <abbr
item.source :title="path.join('/').slice(0, path.join('/').indexOf('.'))">{{
}}</abbr></a> item.source }}</abbr>
</template>
<template v-else>
&nbsp;
<a @click="smoothScroll(item.start)"><abbr :title="item.source + '()'">{{
item.source
}}</abbr></a>
</template>
</template> </template>
</template> </td>
</td> <template v-for="i in [0, 1, 2]">
<template v-for="i in [0, 1, 2]"> <template v-if="getStatus(item, 0, i) != ''">
<template v-if="getStatus(item, 0, i) != ''"> <td :class="getStatus(item, 0, i) + ' big'">
<td :class="getStatus(item, 0, i) + ' big'"> <div class="progress">
<div class="progress"> <div :class="'progress-bar ' + getStatus(item, 1, i)"
<div :class="'progress-bar ' + getStatus(item, 1, i)" role="progressbar" :aria-valuenow="getProgerss(item, 0, i)"
role="progressbar" :aria-valuenow="getProgerss(item, 0, i)" aria-valuemin="0" aria-valuemax="100"
aria-valuemin="0" aria-valuemax="100" :style="'width: ' + getProgerss(item, 1, i) + '%'">
:style="'width: ' + getProgerss(item, 1, i) + '%'"> <span class="sr-only">{{ getProgerss(item, 0, i) }}%
<span class="sr-only">{{ getProgerss(item, 0, i) }}% covered ({{ covered
getStatus(item, 0, i) ({{
}})</span> getStatus(item, 0, i)
}})</span>
</div>
</div> </div>
</div> </td>
</td> <td :class="getStatus(item, 0, i) + ' small'">
<td :class="getStatus(item, 0, i) + ' small'"> <div align="right">{{ getProgerss(item, 0, i) }}%</div>
<div align="right">{{ getProgerss(item, 0, i) }}%</div> </td>
</td> <td :class="getStatus(item, 0, i) + ' small'">
<td :class="getStatus(item, 0, i) + ' small'"> <div align="right">
<div align="right"> {{ getcoverInfo(item, i)[1] }}&nbsp;/&nbsp;{{
{{ getcoverInfo(item, i)[1] }}&nbsp;/&nbsp;{{ getcoverInfo(item, getcoverInfo(item,
i)[0] i)[0]
}} }}
</div> </div>
</td> </td>
</template>
</template> </template>
</template> </tr>
</tr> </template>
</template> </tbody>
</tbody> </table>
</table> <table style="width: 100%;" v-html="fileAll" v-if="render_type && !state">
<table style="width: 100%;" v-html="fileAll" v-if="render_type && !state"> </table>
</table> <table style="width: 100%;" v-html="fileChange" 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>
<Spin size="large" fix :show="spinShow"></Spin> </div>
</div> </div>
</TabPane> </TabPane>
<Modal v-model="modal" title="添加预警" @on-ok="addLogs" @on-cancel="modal = false"> <Modal v-model="modal" title="添加预警" @on-ok="addLogs" @on-cancel="modal = false">
...@@ -231,6 +239,23 @@ function getStatus(item, type, who) { ...@@ -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) { function choicePath(a) {
if (a == -1) { if (a == -1) {
return path.value.length = 0 return path.value.length = 0
...@@ -247,7 +272,7 @@ function getLogs(callback = () => { }) { ...@@ -247,7 +272,7 @@ function getLogs(callback = () => { }) {
function addLogs() { function addLogs() {
request("post", "/codecover/addlog", searchinfo, this, () => { 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) { ...@@ -275,15 +300,15 @@ function handleDragDrop(name, newName, a, b, names) {
}) })
} }
function render_key(value,path){ function render_key(value, path) {
spinShow.value = true spinShow.value = true
request("get", "/codecover/dirinfo", { key: value, path: path.join('/') }, this, (res) => { request("get", "/codecover/dirinfo", { key: value, path: path.join('/') }, this, (res) => {
dirInfo.value = res.data; dirInfo.value = res.data;
spinShow.value = false spinShow.value = false
},(err) => { }, (err) => {
spinShow.value = false spinShow.value = false
dirInfo.value = [] dirInfo.value = []
}) })
} }
watch( watch(
...@@ -292,7 +317,7 @@ watch( ...@@ -292,7 +317,7 @@ watch(
path.value.length = 0 path.value.length = 0
render_type.value = 0 render_type.value = 0
console.info(newVal, oldVal) console.info(newVal, oldVal)
render_key(newVal,path.value) render_key(newVal, path.value)
}) })
watch( watch(
...@@ -301,7 +326,7 @@ watch( ...@@ -301,7 +326,7 @@ watch(
if (newVal.length == 0 || newVal[newVal.length - 1].indexOf('.') == -1) { if (newVal.length == 0 || newVal[newVal.length - 1].indexOf('.') == -1) {
render_type.value = 0 render_type.value = 0
spinShow.value = true spinShow.value = true
render_key(choicedkey.value,newVal) render_key(choicedkey.value, newVal)
} else { } else {
render_type.value = 1 render_type.value = 1
spinShow.value = true 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