You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.0 KiB
94 lines
2.0 KiB
Component({
|
|
properties: {
|
|
// 级联选择器数据
|
|
cascaderList: {
|
|
type: Array,
|
|
value: [
|
|
{
|
|
label: '全部',
|
|
value: '1',
|
|
children: [
|
|
{
|
|
label: '云台社区',
|
|
value: '333',
|
|
children: [],
|
|
},
|
|
{
|
|
label: '云台社区2',
|
|
value: '3333',
|
|
children: [],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: '安宁街道',
|
|
value: '1268515320847425537',
|
|
children: [
|
|
{
|
|
label: '云台社区',
|
|
value: '333',
|
|
children: [],
|
|
},
|
|
{
|
|
label: '云台社区2',
|
|
value: '3333',
|
|
children: [],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
choosedValue: {
|
|
type: Object,
|
|
value: {
|
|
title: '安宁街道',
|
|
id: '1268515320847425537',
|
|
},
|
|
},
|
|
value: {
|
|
type: Array,
|
|
value: ['1268515320847425537'],
|
|
}, //默认选中的
|
|
},
|
|
data: {
|
|
streetVisible: false,
|
|
ifClose: false //
|
|
},
|
|
// lifetimes: {
|
|
// async attached() {},
|
|
// },
|
|
methods: {
|
|
// 显示街道下拉框
|
|
showStreet() {
|
|
if(!this.data.ifClose){
|
|
this.setData({
|
|
streetVisible: true,
|
|
})
|
|
this.triggerEvent('showSelectStreet')
|
|
} else {
|
|
this.setData({
|
|
ifClose: false,
|
|
})
|
|
}
|
|
},
|
|
onChange(e) {
|
|
// this.setData({
|
|
// value: e.detail.value,
|
|
// 'choosedValue.title': e.detail.options.map((n) => n.label).join('/'),
|
|
// deptId: e.detail.value[e.detail.value.length - 1],
|
|
// })
|
|
this.triggerEvent('chooseId', e.detail)
|
|
},
|
|
onClose() {
|
|
this.setData({
|
|
streetVisible: false,
|
|
ifClose: true
|
|
})
|
|
}
|
|
// closeSelect() {
|
|
// this.setData({
|
|
// streetVisible: false,
|
|
// })
|
|
// },
|
|
},
|
|
})
|
|
|