节点重构

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

@@ -102,8 +102,10 @@ export default {
}); });
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
this.groupId = res.data[0].id; this.groupId = res.data[0].id;
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.groupId); this.$refs.tree.setCurrentKey(this.groupId);
this.$emit('click', this.groupId); this.$emit('click', this.groupId);
})
} }
}) })
}, },

View File

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

View File

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