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.
......@@ -19,14 +19,17 @@
</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">
<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 class="demo-spin-article" style="height: 630px;overflow: auto;">
<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>
......@@ -54,7 +57,7 @@
<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">
<template v-if="item.source.indexOf('.') != -1">
<img src="@/assets/file-code.svg" class="octicon">
</template>
<template v-else>
......@@ -64,12 +67,13 @@
</template>
<template v-else>
<template v-if="item.start != 0 && !item.start">
<abbr :title="path.join('/').slice(0, path.join('/').indexOf('.'))">{{
<abbr
:title="path.join('/').slice(0, path.join('/').indexOf('.'))">{{
item.source }}</abbr>
</template>
<template v-else>
&nbsp;
<a :href="'#' + item.start"><abbr :title="item.source + '()'">{{
<a @click="smoothScroll(item.start)"><abbr :title="item.source + '()'">{{
item.source
}}</abbr></a>
</template>
......@@ -83,7 +87,9 @@
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 ({{
<span class="sr-only">{{ getProgerss(item, 0, i) }}%
covered
({{
getStatus(item, 0, i)
}})</span>
</div>
......@@ -94,7 +100,8 @@
</td>
<td :class="getStatus(item, 0, i) + ' small'">
<div align="right">
{{ getcoverInfo(item, i)[1] }}&nbsp;/&nbsp;{{ getcoverInfo(item,
{{ getcoverInfo(item, i)[1] }}&nbsp;/&nbsp;{{
getcoverInfo(item,
i)[0]
}}
</div>
......@@ -110,6 +117,7 @@
<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">
<p>该标签页已存在,确认提交将更改原同名标签</p>
......@@ -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,12 +300,12 @@ 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) => {
}, (err) => {
spinShow.value = false
dirInfo.value = []
})
......@@ -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