Commit 41eda484 by 张杰

v1.5.0版本需求

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