Commit 41eda484 by 张杰

v1.5.0版本需求

1 parent 018c49fa
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
</div> </div>
<div class="tree_box"> <div class="tree_box">
<el-scrollbar class="el_scroll"> <el-scrollbar class="el_scroll" v-loading="treeLoading">
<el-tree :data="vehicleList" :props="treeProps" :default-checked-keys="checkKeys" v-loading="treeLoading" show-checkbox lazy node-key="id" :load="loadNode" :render-content="renderTreeContent" @check="onCheckChange"> <el-tree :key="id" :data="vehicleList" :props="treeProps" :default-checked-keys="checkKeys" show-checkbox lazy node-key="id" :load="loadNode" :render-content="renderTreeContent" @check="onCheckChange">
</el-tree> </el-tree>
</el-scrollbar> </el-scrollbar>
</div> </div>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</el-input> </el-input>
</div> </div>
<div class="tree_box"> <div class="tree_box">
<el-scrollbar ref="scrollbar" class="el_scroll"> <el-scrollbar ref="scrollbar" class="el_scroll" v-loading="rightLoading">
<el-checkbox-group class="el_checkbox_group" v-model="rightCheckList"> <el-checkbox-group class="el_checkbox_group" v-model="rightCheckList">
<el-checkbox v-for="(item,index) in showCheckList" :key="index" :label="item.id"> <el-checkbox v-for="(item,index) in showCheckList" :key="index" :label="item.id">
<span class="checkbox_label" :title="`${item.label}/${item.label1}`">{{showLabels(item)}}</span> <span class="checkbox_label" :title="`${item.label}/${item.label1}`">{{showLabels(item)}}</span>
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
checkList: [], // 所有已选择的车辆 checkList: [], // 所有已选择的车辆
showCheckList: [], // 动态渲染的列表 showCheckList: [], // 动态渲染的列表
pageNum: 1, // 渲染下标 pageNum: 1, // 渲染下标
vehicleList: this.$store.state.userVehicleTree, vehicleList: [],
treeProps: { treeProps: {
label: "label", label: "label",
children: "children", children: "children",
...@@ -115,16 +115,17 @@ export default { ...@@ -115,16 +115,17 @@ export default {
resultList: [], resultList: [],
placeholderText: "请输入至少两个关键字", placeholderText: "请输入至少两个关键字",
treeLoading: true, treeLoading: true,
rightLoading: true,
}; };
}, },
mounted() { mounted() {
let list = this.$store.state.userVehicleTree; let list = this.$store.state.userVehicleTree;
this.vehicleList = list; console.log("树数据:", list);
if (!list || list.length <= 0) { if (!list || list.length <= 0) {
this.getList(); this.getList();
} else { } else {
this.treeLoading = false; this.treeLoading = false;
this.vehicleList = list;
} }
this.handleScroll(); this.handleScroll();
this.getInfo(); this.getInfo();
...@@ -388,7 +389,9 @@ export default { ...@@ -388,7 +389,9 @@ export default {
getInfo() { getInfo() {
let oParams = {}; let oParams = {};
oParams.receiverId = this.id; oParams.receiverId = this.id;
GET_USER_ASSIGN_INFO(oParams).then((res) => { GET_USER_ASSIGN_INFO(oParams)
.then((res) => {
this.rightLoading = false;
let list = res.data || []; let list = res.data || [];
let arr = []; let arr = [];
list.map((k) => { list.map((k) => {
...@@ -405,6 +408,9 @@ export default { ...@@ -405,6 +408,9 @@ export default {
this.checkKeys = arr; this.checkKeys = arr;
console.log(arr); console.log(arr);
this.loadList(); this.loadList();
})
.catch((error) => {
this.rightLoading = false;
}); });
}, },
...@@ -585,6 +591,7 @@ export default { ...@@ -585,6 +591,7 @@ export default {
} }
} }
.el_checkbox_group { .el_checkbox_group {
height:100%;
padding: 0 10px; padding: 0 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!