<mobile-main frameStyle="{{frameStyle}}" bind:back="back" bind:tabPath="tabPath">
    <view slot="info" class="container main">
        <view class="zero one">
            <view wx:if="{{view==='graph'}}">
                <view class="button">
                    <button type="primary" size="mini" bind:tap="toAutoInitData" wx:if="{{!arrangeData._id}}">自动生成</button>
                    <button type="primary" size="mini" bind:tap="turnView" data-view="race">设置比赛</button>
                    <!-- <button>保存</button> -->
                </view>
                <f6-tree list="{{data}}" arrange="{{arrangeList}}" bind:tapNode="nodeTap"></f6-tree>
                <view class="list">
                    <van-popup show="{{ show }}" bind:close="toClose" position="bottom" custom-style="height: 40%;">
                        <van-picker columns="{{ personList }}" bind:confirm="onChange" value-key="label" show-toolbar="{{true}}" bind:cancel="toClose" />
                    </van-popup>
                </view>
            </view>
            <view wx:if="{{view==='race'}}" class="race">
                <view class="button">
                    <button type="primary" size="mini" bind:tap="turnView" data-view="graph">返回</button>
                    <button type="primary" size="mini" bind:tap="toSubmit">保存</button>
                </view>
                <view class="list">
                    <scroll-view scroll-y="true" class="scroll-view">
                        <view class="list-scroll-view">
                            <view wx:for="{{raceList}}" wx:for-item="r" wx:key="node_one_id">
                                <view class="name"> {{r.player_one_name}} VS {{r.player_two_name}}</view>
                                <f-picker value="{{r.ground_id}}" label="场地" model="{{r.groundModelName}}" bind:selected="toSelected" columns="{{groundList}}" valueKey="_id" labelKey="name">
                                </f-picker>
                                <f-picker value="{{r.referee_id}}" label="裁判" model="{{r.refereeModelName}}" bind:selected="toSelected" columns="{{refereeList}}" valueKey="openid" labelKey="name">
                                </f-picker>
                                <f-time-picker label="比赛时间" model="{{r.timeModelName}}" value="{{r.match_time}}" bind:selected="toSelected" />
                            </view>
                        </view>
                    </scroll-view>
                </view>
            </view>
        </view>
    </view>
</mobile-main>