<script setup>
import { ref } from 'vue';
const columns = ref(["患者1", "患者2", "患者3", "患者4"])
const value = ref("患者1")
const date = ref(Date.now())
const formatValue = ref("")
const btnsValue = ref([1])
const handleDate = ({ value }) => {
    console.log(66, value);

    formatValue.value = new Date(value).toJSON().split("T")[0]
}
</script>
<template>
    <view class="box">
        <view>
            <view class="title">选择患者</view>
            <view>
                <wd-picker v-model="value" :columns="columns" title="选择患者" label="请选择患者" confirm-button-text="确定" />
            </view>
        </view>
        <view>
            <view class="title">患者信息</view>
            <view class="item">
                <view>
                    <view>住院号</view>
                    <view>00000</view>
                </view>
                <view>
                    <view>姓名</view>
                    <view>00000</view>
                </view>
                <view>
                    <view>手术名称</view>
                    <view>00000</view>
                </view>
                <view>
                    <view>手术日期</view>
                    <view>00000</view>
                </view>
            </view>
        </view>
        <view>
            <view class="title">植入物信息</view>
            <view class="item">
                <view>
                    <view>植入物名称</view>
                    <view>11111</view>
                </view>
                <view>
                    <view>植入物型号</view>
                    <view>11111</view>
                </view>
                <view>
                    <view>植入物时间</view>
                    <view>11111</view>
                </view>
            </view>
        </view>
        <view>
            <view>
                院内执行
                <wd-checkbox :modelValue="true" shape="button">加急</wd-checkbox>
            </view>
        </view>
        <view>
            <view class="title">分流调节计划</view>
            <view class="item">
                <view>
                    <view>计划调节时间</view>
                    <wd-calendar v-model="date" @confirm="handleDate">
                        <view v-if="formatValue">{{ formatValue }}</view>
                        <wd-button v-else size="small">选择日期</wd-button>
                    </wd-calendar>
                </view>
                <view>
                    <view>目标压力</view>
                    <view>
                        <wd-picker v-model="value" :columns="columns" confirm-button-text="确定" />
                    </view>
                </view>
                <view>
                    <view>调压原因</view>   
                    <view>
                        <wd-drop-menu direction="up">
                            <wd-drop-menu-item title="筛选" ref="dropMenu">
                                <wd-checkbox-group v-model="btnsValue" cell shape="button">
                                    <wd-checkbox v-for="value in 5" :key="value" :modelValue="value" shape="button">选项{{ value }}</wd-checkbox>
                                </wd-checkbox-group>
                            </wd-drop-menu-item>
                        </wd-drop-menu>
                    </view>
                </view>
                <view>
                    <view>是否加急</view>
                    <view>
                        <wd-checkbox :modelValue="true" shape="button">加急</wd-checkbox>
                    </view>
                </view>
            </view>
        </view>
        <view>
            <view>任务文件</view>
            <view>
                <wd-upload image-mode="aspectFill" :action="''"></wd-upload>
            </view>
        </view>
        <wd-button>保存</wd-button>
    </view>
</template>
<style lang="scss" scoped>
// .box {
//     min-height: 95vh;
//     padding: 20rpx;
//     background-color: #fff;
// }
.title {
    display: flex;
    font-weight: bold;
    font-size: 30rpx;
    align-items: center;
    margin: 20rpx 0;

    &::before {
        content: "";
        width: 8rpx;
        height: 35rpx;
        background-color: aqua;
        border-radius: 5rpx;
        margin: 0 15rpx;
    }
}

.item {
    >view {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 25rpx;
        border-bottom: 1px solid #e0e0e0;
        font-size: 28rpx;
    }
}
</style>