节点重构

This commit is contained in:
2025-02-12 14:21:19 +08:00
parent 977722f2c2
commit fb3b97fd30
3 changed files with 25 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-container>
<el-aside>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" style="margin-bottom: 10px" clearable />
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" style="margin-bottom: 10px" clearable/>
<el-tree class="filter-tree" :data="groupList" @node-click="nodeClick" node-key="id" highlight-current :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree" :default-expanded-keys="[0]">
<span class="custom-tree-node" slot-scope="{ node, data }" v-if="groupState !== 'list' && editId === data.id">
<span>
@@ -102,8 +102,10 @@ export default {
});
if (res.data && res.data.length > 0) {
this.groupId = res.data[0].id;
this.$refs.tree.setCurrentKey(this.groupId);
this.$emit('click', this.groupId);
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.groupId);
this.$emit('click', this.groupId);
})
}
})
},

View File

@@ -1,5 +1,5 @@
<template>
<folder-page type="api" @click="nodeSelected">
<folder-page type="api" @click="folderHandleSelected">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="接口名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入接口名称" clearable @keyup.enter.native="handleQuery"/>
@@ -85,7 +85,7 @@ export default {
}
},
methods: {
nodeSelected(id) {
folderHandleSelected(id) {
this.queryParams.groupId = id;
this.getList();
},

View File

@@ -1,11 +1,27 @@
<template>
<div>
<folder-page type="case" @click="folderHandleSelected">
case
</div>
</folder-page>
</template>
<script>
import FolderPage from "@/components/FolderPage/index.vue";
export default {
name: "Case",
components: {FolderPage},
data() {
return {
}
},
methods: {
folderHandleSelected(id) {
console.log(id)
}
}
}
</script>
<style scoped lang="scss">