org.vue
1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
<view class="org-content">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<view>
<luyj-tree @sendValue="confirm" :is-check="isCheck" search-placeholder="请输入搜索内容" :search-if="true" v-slot:default="{ item }" :max="max" :trees="tree" :nodes="false">
<view>
<view class="content-item">
<view class="word">{{ item.name }}</view>
</view>
</view>
</luyj-tree>
</view>
</view>
</template>
<script>
import fTabbar from '@/components/module/f-tabbar/f-tabbar';
import { transOrgFunc } from '@/config/common.js';
export default {
components: {
fTabbar
},
data() {
return {
isCheck: true, // 是否可选
tree: [],
max: 5,
id: ''
};
},
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
this.loadData();
},
methods: {
loadData() {
uni.$u.http
.get('/yt/organization/me/list')
.then(res => {
if (res) {
const list = transOrgFunc(res);
this.tree = list;
}
})
.catch(e => {
uni.$u.toast(e.data.message);
});
},
confirm(val) {
this.id = val[0].id;
let pages = getCurrentPages(); //获取所有页面栈实例列表
let nowPage = pages[pages.length - 1]; //当前页页面实例
let prevPage = pages[pages.length - 2]; //上一页页面实例
prevPage.$vm.orgId = this.id;
uni.navigateBack({
delta: 1
});
}
}
};
</script>
<style lang="scss" scoped>
.org-content {
padding: 0 10rpx;
}
</style>