点击爬虫跳转相应文件 pipelines.py

This commit is contained in:
marvzhang
2020-02-21 19:05:32 +08:00
parent 21323f0d28
commit e2014b10a8
3 changed files with 41 additions and 3 deletions

View File

@@ -409,6 +409,23 @@ export default {
this.isShowDelete = false
this.showFile = false
this.$st.sendEv('爬虫详情', '文件', '删除')
},
clickPipeline () {
const filename = 'pipelines.py'
for (let i = 0; i < this.computedFileTree.length; i++) {
const dataLv1 = this.computedFileTree[i]
const nodeLv1 = this.$refs['tree'].getNode(dataLv1.path)
if (dataLv1.is_dir) {
for (let j = 0; j < dataLv1.children.length; j++) {
const nodeLv2 = dataLv1.children[j]
if (nodeLv2.path.match(filename)) {
this.onFileClick(nodeLv2)
nodeLv1.expanded = true
return
}
}
}
}
}
},
async created () {

View File

@@ -349,6 +349,7 @@
v-for="s in spiderScrapyPipelines"
:key="s"
class="item"
@click="$emit('click-pipeline')"
>
<i class="el-icon-star-on"></i>
{{s}}