田源
2023-10-30 262ba3da78fae09dcba3a26aa7b9ee49b293c2a9
Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -1,9 +1,12 @@
<template>
  <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false"
             :option="Treeoption"
             style="height: calc(100vh - 150px);"
             @node-click=" nodeClick"
  ></avue-tree>
  <div class="app" style="display: flex;">
    <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" :option="Treeoption" @node-click="nodeClick" style="width: fit-content;">
      <template slot-scope="{ node }">
        <span style="display: inline-block;">{{ node.label }}</span>
      </template>
    </avue-tree>
    <div style="display: inline-block;"><i class="el-icon-refresh refresh-icon" @click="getTreeLists"></i></div>
  </div>
</template>
<script>
@@ -95,7 +98,7 @@
          }
        }
      }).catch(res => {
        console.log(res)
        // console.log(res)
        this.$message.error(res)
      });
    },
@@ -147,7 +150,7 @@
          List.forEach(item => {
            let columnItem = {
              label: item.title,
              prop: item.field,
              prop: item.queryField,
              // type: this.columnType[item.type],
              sortable: item.sort,
              width: item.minWidth
@@ -166,8 +169,9 @@
    //树点击事件
    async nodeClick(data) {
      try {
        console.log(data)
        // console.log(data)
        this.TreeValue=data.label.split(" ")[0].trim();
        // console.log('TreeValue',this.TreeValue)
        this.$emit('TreeValue',this.TreeValue)
        this.nodeClickList = data;
        this.tableHeadDataFateher = []
@@ -185,6 +189,28 @@
}
</script>
<style scoped>
<style lang="scss" scoped>
.app{
  overflow: auto;
  height: calc(100vh - 150px);
}
 .app::-webkit-scrollbar {
  height: 15px ; // 纵向滚动条 必写
  background: white;
  border: white;
  width: 10px;
}
// 滚动条的滑块
 .app::-webkit-scrollbar-thumb {
  background-color: #ececec;
  border-radius: 20px;
  border: #ececec;
}
.refresh-icon {
  color: #409EFF;
  margin-top: 8px;
  margin-left: 6px;
  font-size: 18px;
}
</style>