Commit 767b1342 authored by 李苏's avatar 李苏 💬

过滤无用数据

parent 6093fcc2
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<div class="sblxtreeTitle"> <div class="sblxtreeTitle">
节点流向关系查询 节点流向关系查询
<!-- 全屏查询--> <!-- 全屏查询-->
<i title='在单独页面查看' @click="toFullPage" style="float: right;line-height: 30px;margin-right: 15px;font-size: 16px;cursor: pointer;" class="el-icon-full-screen"></i> <i title='在单独页面查看' @click="toFullPage"
style="float: right;line-height: 30px;margin-right: 15px;font-size: 16px;cursor: pointer;"
class="el-icon-full-screen"></i>
</div> </div>
<!-- 查询框--> <!-- 查询框-->
<div style="padding: 10px;"> <div style="padding: 10px;">
...@@ -34,6 +36,10 @@ ...@@ -34,6 +36,10 @@
<div v-if="showList.length!=0" class="padding-10"> <div v-if="showList.length!=0" class="padding-10">
<el-collapse v-model='activeName' @change='change' accordion> <el-collapse v-model='activeName' @change='change' accordion>
<el-collapse-item v-for="(item,index) in showList" :title="item.name" :name="index"> <el-collapse-item v-for="(item,index) in showList" :title="item.name" :name="index">
<!-- -->
<!-- <i title='保存流向' @click="savefile()"
style="float: right;line-height: 30px;margin-right: 15px;font-size: 16px;cursor: pointer;"
class="el-icon-paperclip"></i> -->
<div class="padding-10 divlist" :id='item.name' :ref="item.name"> <div class="padding-10 divlist" :id='item.name' :ref="item.name">
</div> </div>
...@@ -46,10 +52,12 @@ ...@@ -46,10 +52,12 @@
</template> </template>
<script> <script>
const html2canvas = require('html2canvas');
export default { export default {
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
const scrollableDiv = document.getElementById('sblxtree'); const scrollableDiv = document.body
scrollableDiv.addEventListener('scroll', () => { scrollableDiv.addEventListener('scroll', () => {
this.arrowLineList.forEach(item => item.position()) this.arrowLineList.forEach(item => item.position())
}); });
...@@ -60,14 +68,14 @@ ...@@ -60,14 +68,14 @@
}, },
beforeDestroy() { beforeDestroy() {
this.arrowLineList.forEach(item => item.remove()) this.arrowLineList.forEach(item => item.remove())
this.arrowLineList=[] this.arrowLineList = []
clearInterval(this.timer) clearInterval(this.timer)
this.activeName=-1 this.activeName = -1
}, },
deactivated (){ deactivated() {
this.arrowLineList.forEach(item => item.remove()) this.arrowLineList.forEach(item => item.remove())
this.arrowLineList=[] this.arrowLineList = []
this.activeName=-1 this.activeName = -1
}, },
data() { data() {
return { return {
...@@ -168,17 +176,23 @@ ...@@ -168,17 +176,23 @@
let name = this.showList[val].name let name = this.showList[val].name
let lxList = this.showList[val].data let lxList = this.showList[val].data
lxList.forEach(item => { lxList.forEach(item => {
let arrobj = new LeaderLine(document.querySelector(`[data-jd="${name+item.syjd}"]`), document if(item.syjd==item.dqjd){
.querySelector(`[data-jd="${name+item.dqjd}"]`), { console.log(`绘制${item.syjd}====>${item.dqjd}节点重复,取消绘制`)
path: 'arc', }else{
startPlugColor: '#1a6be0', let arrobj = new LeaderLine(document.querySelector(`[data-jd="${name+item.syjd}"]`), document
endPlugColor: '#1efdaa', .querySelector(`[data-jd="${name+item.dqjd}"]`), {
gradient: true, path: 'arc',
dash: { startPlugColor: '#1a6be0',
animation: true endPlugColor: '#1efdaa',
} gradient: true,
}); dash: {
this.arrowLineList.push(arrobj) animation: true
}
});
this.arrowLineList.push(arrobj)
}
}) })
this.arrowLineList.forEach(item => item.position()) this.arrowLineList.forEach(item => item.position())
this.lxObj = this.showList[val] this.lxObj = this.showList[val]
...@@ -193,7 +207,18 @@ ...@@ -193,7 +207,18 @@
}, },
toFullPage(){ savefile(){
const element = document.getElementsByName('body');
html2canvas(element).then(canvas => {
const imgData = canvas.toDataURL('image/png');
var link = document.createElement('a');
link.href = imgData;
link.download = 'image.png';
link.click();
link.remove()
});
},
toFullPage() {
const url = `${location.origin}/#/sblxtree` const url = `${location.origin}/#/sblxtree`
window.open(url, '_blank'); // 第二个参数 '_blank' 表示在新窗口或标签页中打开 window.open(url, '_blank'); // 第二个参数 '_blank' 表示在新窗口或标签页中打开
......
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