|
@@ -3,6 +3,7 @@
|
|
|
<div class="tree-top">
|
|
|
<el-switch
|
|
|
v-model="switchValue"
|
|
|
+ active-text="包含下一级"
|
|
|
size="mini">
|
|
|
</el-switch>
|
|
|
</div>
|
|
@@ -74,13 +75,22 @@
|
|
|
this.value={}
|
|
|
let newData = this.getChildData([data]);
|
|
|
if(this.attrs.retConfig){
|
|
|
- for(const item of newData){
|
|
|
+ if(this.switchValue){
|
|
|
+ for(const item of newData){
|
|
|
+ for(const key in this.attrs.retConfig){
|
|
|
+ if(!this.value[key]) this.value[key] = [];
|
|
|
+ this.value[key].push(item[this.attrs.retConfig[key]])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
for(const key in this.attrs.retConfig){
|
|
|
if(!this.value[key]) this.value[key] = [];
|
|
|
- this.value[key].push(item[this.attrs.retConfig[key]])
|
|
|
+ this.value[key].push(data[this.attrs.retConfig[key]])
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
this.onChange();
|
|
|
}
|
|
|
onChange(){
|
|
@@ -127,4 +137,12 @@
|
|
|
justify-content: flex-end;
|
|
|
padding-bottom: 8px;
|
|
|
}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.tree-top{
|
|
|
+ .el-switch__label *{
|
|
|
+ font-size: 12px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|