|
@@ -4,19 +4,32 @@
|
|
|
<el-icon color="#f2f2f2" size="25" style="width:50px">
|
|
|
<Histogram />
|
|
|
</el-icon>
|
|
|
- <div style="flex:1;">系统井</div>
|
|
|
+ <div style="flex:1;">{{systreeShow?'系统井':'关注井'}}</div>
|
|
|
<el-icon color="#f2f2f2" size="25" style="width:50px;cursor:pointer;" @click="changeTree">
|
|
|
<DCaret />
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
<div class="side-body">
|
|
|
<el-scrollbar style="height:100%;padding:5px;box-sizing: border-box;">
|
|
|
- <el-tree :data="treedatas" :props="defaultProps" :highlight-current="true" class="tree">
|
|
|
+ <el-tree :data="sysWells" :props="defaultProps" :highlight-current="true" class="tree" v-show="systreeShow" @node-click="selWellHandle">
|
|
|
<template #default="{ node, data }">
|
|
|
<span class="custom-tree-node">
|
|
|
- <block v-if="node.isLeaf">
|
|
|
+ <template v-if="node.isLeaf">
|
|
|
<el-icon><help-filled/></el-icon><span style="margin-left:2px;">{{ node.label }}</span>
|
|
|
- </block>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <span v-else>{{ node.label }}</span>
|
|
|
+
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-tree>
|
|
|
+
|
|
|
+ <el-tree :data="customWells" :props="defaultProps" :highlight-current="true" class="tree" v-show="!systreeShow">
|
|
|
+ <template #default="{ node, data }">
|
|
|
+ <span class="custom-tree-node">
|
|
|
+ <template v-if="node.isLeaf">
|
|
|
+ <el-icon><help-filled/></el-icon><span style="margin-left:2px;">{{ node.label }}</span>
|
|
|
+ </template>
|
|
|
|
|
|
<span v-else>{{ node.label }}</span>
|
|
|
|
|
@@ -34,14 +47,14 @@
|
|
|
import {ref} from 'vue'
|
|
|
import {storeToRefs} from 'pinia'
|
|
|
import {useHomeStore} from "../store/home.js"
|
|
|
- import { fetchData } from "../api/sidetree.js"
|
|
|
+ import { fetchData,fetchCustomData } from "../api/sidetree.js"
|
|
|
|
|
|
|
|
|
const store = useHomeStore()
|
|
|
- const {collapse} = storeToRefs(store)
|
|
|
+ const {collapse,systreeShow} = storeToRefs(store)
|
|
|
|
|
|
const changeTree = () => {
|
|
|
- alert();
|
|
|
+ store.systreeShow=!store.systreeShow;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -52,14 +65,28 @@
|
|
|
isLeaf:'leaf'
|
|
|
}
|
|
|
|
|
|
- const treedatas = ref([])
|
|
|
+ const sysWells = ref([])
|
|
|
+
|
|
|
+ const customWells = ref([])
|
|
|
|
|
|
const getData = () => {
|
|
|
fetchData({}).then((res) => {
|
|
|
- treedatas.value=res
|
|
|
+ sysWells.value=res
|
|
|
});
|
|
|
};
|
|
|
getData();
|
|
|
+
|
|
|
+ const getCustomData = () => {
|
|
|
+ fetchCustomData({}).then((res) => {
|
|
|
+ customWells.value=res
|
|
|
+ });
|
|
|
+ };
|
|
|
+ getCustomData();
|
|
|
+
|
|
|
+ const selWellHandle = (nodeData, node, nodeComp,evn) =>{
|
|
|
+ console.log(nodeData)
|
|
|
+ store.currentTreeNode=nodeData
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|