<!--pages/workBenchTodoList/index.wxml-->
<navigator canBack="{{true}}" title="工单列表" />
<view class="wrapper">
    <searchSelectWrapper 
        label="选择园区" 
        placeholder="请选择园区"
        text="{{parkName}}"
        bind:search="onParkFocus"
    />

    <searchSelectWrapper 
        label="选择电表" 
        placeholder="请选择电表"
        text="{{meterName}}"
        bind:search="onMeterFocus"
    />
    <searchSelectWrapper 
        label="流程类型" 
        placeholder="请选择流程类型"
        text="{{noticeFlowTypeName}}"
        bind:search="onNoticeFlowFocus"
    />
    <searchSelectWrapper 
        label="确认状态" 
        placeholder="请选择确认状态"
        text="{{noticeFlowStatusName}}"
        bind:search="onNoticeFlowStatusFocus"
    />
    <view>
    <view wx:if="{{list.length}}">
        <view class="tableWrapper">
            <view class="table">
                <view class="thead">
                    <view class="th" style="flex: 0 0 130rpx;"> 时间</view>
                    <view class="th" style="flex: 0 0 150rpx;"> 类型 </view>
                    <view class="th"  style="flex: 0 0 150rpx;">电表地址</view>
                    <view class="th"  style="flex: 0 0 150rpx;">状态</view>
                    <view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view>
                </view>
                <view class="tbody">
                    <van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
                        <block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
                            <view class="tr" style="display: flex; align-items: center; ">
                                <view class="th" style="flex: 0 0 130rpx;">
                                    {{ item.time }}
                                </view>
                                <view class="th" style="flex: 0 0 150rpx;">
                                    {{ noticeFlowType[item.types - 1] }}
                                </view>
                          
                                <view class="th" style="flex: 0 0 150rpx;">
                                    {{ item.address }}
                                </view>
                                <view class="th" style="flex: 0 0 150rpx;">
                                    {{ item.flow_status === 1 ? "处理中" : "已确认" }}
                                </view>
                                <view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;">
                                    <van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-data="{{index}}" class="more-icon" />
                                    <van-action-sheet 
                                        show="{{ currentActionSheet === item.id }}" 
                                        actions="{{ actionItems }}" 
                                        bind:close="hideActionMenu" 
                                        bind:select="onMenuSelect" 
                                        data-id="{{item.id}}" 
                                        close-on-click-action 
                                    />
                                    <!-- <view 
                                        class="primaryTextBtn" 
                                        wx:if="{{item.flow_status === 1}}"
                                        data-id="{{item.id}}"    
                                    > 确认 </view> -->
                                </view>
                            </view>

                        </block>
                    </van-radio-group>
                </view>
            </view>
        </view>

        <pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />

    </view>
    <empty bind:refresh="init" wx:else />

</view>



<search-select 
    show="{{show}}" 
    title="{{title}}" 
    type="{{type}}" 
    park="{{park}}"
    bindconfirm="onConfirm"
    bindcancel="onCancel"
    wx:if="{{show}}"
/>
</view>
