<script setup>
import { ref } from 'vue';
const columns = ref(["患者1", "患者2", "患者3", "患者4"])
const options = ref(["选项1", "选项2", "选项3", "选项4"])
const value = ref("患者1")
const date = ref(Date.now())
const formatValue = ref("")
const btnsValue = ref([])
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 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 class="cause">
                    <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="item in options" :key="item" :modelValue="item" shape="button">{{ item }}</wd-checkbox>
                                    </wd-checkbox-group>
                                </wd-drop-menu-item>
                            </wd-drop-menu>
                        </view>
                    </view>
                    <view class="tag">
                        <wd-tag type="primary" round v-for="tag in btnsValue" :key="tag">{{ tag }}</wd-tag>
                    </view>
                </view>
                <view>
                    <view>是否加急</view>
                    <view>
                        <wd-checkbox :modelValue="true" shape="button">加急</wd-checkbox>
                    </view>
                </view>
                <view>
                    <view>院内执行</view>
                    <view>
                        <wd-checkbox :modelValue="true" shape="button">执行</wd-checkbox>
                    </view>
                </view>
            </view>
        </view>
        <view class="file">
            <view>任务文件</view>
            <view>
                <wd-upload image-mode="aspectFill" :action="''"></wd-upload>
            </view>
        </view>
        <view class="save">
            <wd-button :block="true">保存</wd-button>
        </view>
    </view>
</template>
<style lang="scss" scoped>
@import "/static/css/variables.scss";
.title {
    display: flex;
    font-weight: bold;
    padding: 15rpx 20rpx;
    font-size: 25rpx;
    align-items: center;
    background-color: $blue;
    color: #fff;
}
.item {
    >view {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 25rpx;
        border-bottom: 1px solid #e0e0e0;
        font-size: 28rpx;
    }
    .cause {
        display: block;
        transition: all 0.3s ease;
        >view {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .tag {
            gap: 15rpx;
            justify-content: flex-start;
        }
    }
}
.file {
    padding: 25rpx 25rpx 0;
    font-size: 28rpx;
    >view {
        margin-bottom: 15rpx;
    }
}
.save {
    width: 80%;
    margin: 0 auto;
    padding-bottom: 20rpx;
}
</style>