Commit 18126bcf by liang ce

会议室时间筛选重写

parent b7a3ec00
{
"pages": [
"pages/index/index",
"pages/meetingRoomList/meetingRoomList",
"pages/uploadFile/uploadFile",
"pages/repetitionTime/repetitionTime",
"pages/createOrEditSchedule/createOrEditSchedule",
......@@ -12,7 +13,6 @@
"pages/place/place",
"pages/participantsDetail/participantsDetail",
"pages/editFile/editFile",
"pages/meetingRoomList/meetingRoomList",
"pages/createOrEditSchedule/createOrEditSchedule"
]
}
@import "../../font/iconfont.acss";
/* 区域选择样式 */
.lableTreeBox{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,.1);
display: flex;
align-items: flex-end;
}
.lableTreeContent{
width: 100%;
height: 527rpx;
background: #FFFFFF;
box-shadow: 0 -2rpx 20rpx 0 rgba(25,31,37,0.12);
border-radius: 19rpx 19rpx 0px 0px;
}
.lableTreeHeader{
width: 100%;
height: 104rpx;
padding: 0 32rpx;
line-height: 104rpx;
font-size: 34rpx;
display: flex;
box-sizing: border-box;
border-bottom: 1px solid rgba(25,31,37,0.12);
}
.lableTreeHeader>view{
flex: 1;
height: 104rpx;
}
.lableTreeHeader>view:nth-of-type(1) {
color: #191F25;
}
.lableTreeHeader>view:nth-of-type(2) {
color: #3296FA;
text-align: right
}
.lableTreeModal{
width: 100%;
padding-right: 32rpx;
box-sizing: border-box;
}
/* tree样式 */
.treeUl {
position: relative;
padding-left: 45rpx;
padding-left: 32rpx;
display: block;
box-sizing: border-box;
}
.treeLi {
position: relative;
display: block;
}
.firstTreeUl{
margin: 0;
padding: 0;
height: 62rpx;
font-size: 28rpx;
line-height: 62rpx;
}
.treeName {
height: 60rpx;
......@@ -25,45 +69,14 @@
}
.treeLabel {
flex: 1;
display: flex;
padding-right: 32rpx;
box-sizing: border-box;
}
.selectView{
width: 40rpx;
}
.firstTreeUl>.treeLi {
padding: 0 32rpx;
border-bottom: 16rpx solid #f6f6f6;
}
/* 水平方向 */
.firstTreeUl .treeUl>.treeLi:after {
content: ' ';
position: absolute;
top: 28rpx;
left: -28rpx;
width: 28rpx;
border: none;
border-top: 1px dashed #3296FA;
}
/* 垂直方向 */
.firstTreeUl .treeUl>.treeLi:not(:last-child):before {
content: '';
position: absolute;
top: 0;
left: -30rpx;
height: 100%;
border: none;
border-left: 1px dashed #3296FA;
}
.firstTreeUl .treeUl>.treeLi:before {
content: ' ';
position: absolute;
top: 0;
left: -30rpx;
height: 30rpx;
border: none;
border-left: 1px dashed rgb(240, 245, 250);
.treeLabel > view:nth-of-type(1) {
flex: 1;
}
.selectViewAction {
color: #fff;
background: #3296FA;
.lableTreeChecked {
background: rgba(25,31,37,0.05);
border-radius: 4rpx;
}
\ No newline at end of file
<view class="treeUl">
<block a:for="{{lableTree}}">
<view data-selectid="{{item.id}}" class="treeLi">
<view class="treeName">
<view class="labelIsShow" data-index="{{index}}" catchTap="onChangeStatus">
{{item.status === 'show' ? '1' : '0'}}
</view>
<view class="treeLabel" data-index="{{index}}" catchTap="onChangeAreId">
{{item.name}}
</view>
<view class="selectView">
{{locationId === item.id ? '1' : '0'}}
</view>
<view class="lableTreeBox">
<view class="lableTreeContent">
<view class="lableTreeHeader">
<view catchTap="cancelSelectAre">
取消
</view>
<pang-tree
a:if="{{item.children && item.status}}"
cycleTimes="{{index + 1}}"
locationName="{{locationName}}"
areTreeList="{{item.children}}"
locationId="{{locationId}}"
onPropsCS="onPropsCS"
>
</pang-tree>
<view catchTap="sureSelectAre">
确定
</view>
</view>
<view class="lableTreeModal">
<scroll-view scroll-y="{{true}}" style="height: 422rpx;">
<view class="treeUl">
<block a:for="{{lableTree}}">
<view data-selectid="{{item.id}}" class="treeLi">
<view class="treeName {{ item.id===locationId ? 'lableTreeChecked' : '' }}">
<view class="labelIsShow" data-index="{{[index]}}" data-cycle="1" catchTap="onChangeStatus">
{{item.status === 'show' ? '1' : '0'}}
</view>
<view class="treeLabel" data-id="{{item.id}}" data-name="{{item.name}}" data-cycle="1" catchTap="onChangeAreId">
<view>
{{item.name}}
</view>
<view a:if="{{item.id===locationId}}" style="color: #1890FF;">
ok
</view>
</view>
</view>
<view a:if="{{item.children.length > 0 && item.status}}" class="treeUl">
<block a:for="{{item.children}}" a:for-index="index2" a:for-item="item2">
<view data-selectid="{{item2.id}}" class="treeLi">
<view class="treeName {{ item2.id===locationId ? 'lableTreeChecked' : '' }}">
<view class="labelIsShow" data-index="{{[index,index2]}}" data-cycle="2" catchTap="onChangeStatus">
{{item2.status === 'show' ? '1' : '0'}}
</view>
<view class="treeLabel" data-id="{{item2.id}}" data-name="{{item2.name}}" catchTap="onChangeAreId">
<view>
{{item2.name}}
</view>
<view a:if="{{item2.id===locationId}}" style="color: #1890FF;">
ok
</view>
</view>
</view>
</view>
<view a:if="{{item2.children.length > 0 && item2.status}}" class="treeUl">
<block a:for="{{item2.children}}" a:for-index="index3" a:for-item="item3">
<view data-selectid="{{item3.id}}" class="treeLi">
<view class="treeName {{ item3.id===locationId ? 'lableTreeChecked' : '' }}">
<!-- <view class="labelIsShow" data-index="{{[index,index2,index3]}}" data-cycle="3" catchTap="onChangeStatus">
{{item3.status === 'show' ? '1' : '0'}}
</view> -->
<view class="treeLabel" data-id="{{item3.id}}" data-name="{{item3.name}}" catchTap="onChangeAreId">
<view>
{{item3.name}}
</view>
<view a:if="{{item3.id===locationId}}" style="color: #1890FF;">
ok
</view>
</view>
</view>
</view>
</block>
</view>
</block>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
</block>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {
index: 0,
lableTree: []
lableTree: [],
locationName: '全部区域',//区域name
locationId: '',// 区域id
},
props: {
cycleTimes: '0',// 循环次数
locationName: '',//区域name
locationId: '',// 区域id
areTreeList: []
},
didMount() {
let lableTree = this.props.areTreeList.map(item => {
return {
...item,
status: true
}
})
const addKey = data => data.map(item => ({
...item,
status: true,
children: addKey(item.children)
}))
const lableTree = addKey(this.props.areTreeList)
this.setData({
lableTree: lableTree,
index: parseInt(this.props.cycleTimes)
locationId: this.props.locationId,
locationName: this.props.locationName,
})
},
didUpdate() {},
......@@ -27,20 +28,43 @@ Component({
methods: {
onChangeStatus(e) {
let index = e.target.dataset.index
let listStr = `lableTree[${index}].status`
let cycleTimes = e.target.dataset.cycle
if (cycleTimes == 1) {
let listStr = `lableTree[${index[0]}].status`
this.setData({
[listStr]: this.data.lableTree[index[0]].status ? false : true
})
} else if (cycleTimes == 2) {
let listStr = `lableTree[${index[0]}].children[${index[1]}].status`
this.setData({
[listStr]: this.data.lableTree[index[0]].children[index[1]].status ? false : true
})
}
// else if (cycleTimes == 3) {
// let listStr = `lableTree[${index[0]}].children[${index[1]}].children[${index[2]}].status`
// this.setData({
// [listStr]: this.data.lableTree[index[0]].children[index[1]].children[index[2]].status ? false : true
// })
// }
},
onChangeAreId(e){
this.setData({
[listStr]: this.data.lableTree[index].status ? false : true
locationId: this.data.locationId === e.target.dataset.id ? '' : e.target.dataset.id,
locationName: this.data.locationId === e.target.dataset.id ? '全部区域' : e.target.dataset.name
})
},
onChangeAreId(e){
let index = e.target.dataset.index
cancelSelectAre() {
let data = {
id: this.data.lableTree[index].id === this.props.locationId ? '' : this.data.lableTree[index].id,
name: this.data.lableTree[index].id === this.props.locationId ? '全部区域' : this.data.lableTree[index].name
type: 'cancel'
}
this.onPropsCS(data)
this.props.onPropsCS(data)
},
onPropsCS(data) {
sureSelectAre() {
let data = {
type: 'sure',
id: this.data.locationId,
name: this.data.locationName
}
this.props.onPropsCS(data)
}
},
......
......@@ -270,6 +270,9 @@
background: #3296FA;
box-sizing: border-box;
}
.iconyigouxuan{
color: #3296FA;
}
/* 区域选择样式 */
.lableTreeBox{
position: fixed;
......@@ -308,4 +311,7 @@
.lableTreeHeader>view:nth-of-type(2) {
color: #3296FA;
text-align: right
}
.dataNumSelected {
color: #3296FA;
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ create.Page({
equipFacilityIds: [],
time: ''
},
dataNum: '0',
location:{
id: '',
name: ''
......@@ -462,11 +463,13 @@ create.Page({
}
})
that.setData({
modalList: modalList2
modalList: modalList2,
dataNum: num
})
} else {
that.setData({
modalList: modalList
modalList: modalList,
dataNum: num
})
}
})
......@@ -556,28 +559,20 @@ create.Page({
})
},
onPropsCS(e){
console.log(e)
this.setData({
'location.id': e.id,
'location.name': e.name
})
},
cancelSelectAre() {
this.setData({
isShowLableModal: false,
'location.id': '',
'location.name': ''
})
},
sureSelectAre() {
let that = this
this.setData({
isShowLableModal: false,
'search.locationId': this.data.location.id,
'search.locationName': this.data.location.name
},() => {
that.getRoomList()
})
if (e.type == 'sure') {
this.setData({
isShowLableModal: false,
'search.locationId': e.id,
'search.locationName': e.name
},() => {
that.getRoomList()
})
} else {
this.setData({
isShowLableModal: false
})
}
},
changeSearchEquipFacility(e){
let that = this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment