<template>
    <global-page-search @reset="handleReset" @confirm="handleConfirm">
        <up-form labelPosition="left" labelWidth="auto">
            <up-form-item label="值班经理" prop="dutyManagerUname" :borderBottom="true">
                <up-input v-model="formData.dutyManagerUname" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
            </up-form-item>
            <up-form-item label="监察领导" prop="monitorLeaderUname" :borderBottom="true">
                <up-input v-model="formData.monitorLeaderUname" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
            </up-form-item>
            <up-form-item label="状态" prop="statusStr" :borderBottom="true">
                <global-picker v-model="formData.statusStr" pickAlign="right" clearable dictkey="dl_status"></global-picker>
            </up-form-item>
            <up-form-item label="值班日期" :borderBottom="true">
                <global-calendar
                    pickAlign="right"
                    v-model:startTime="formData.dutyDateS"
                    v-model:endTime="formData.dutyDateE"
                    clearable
                ></global-calendar>
            </up-form-item>
        </up-form>
    </global-page-search>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import { ref } from 'vue'
import useDutyLogStore from 'mocp/store/dutyLog'

//获取下拉框选项
const dutyLogStore = useDutyLogStore()
//获取查询表单数据
const { searchData } = storeToRefs(dutyLogStore)
const formData = ref(cloneDeep(searchData.value))
const handleReset = () => {
    dutyLogStore.resetForm()
    uni.$mocpJump.navigateBack()
    uni.$emit('dutyLogReload')
}
const handleConfirm = () => {
    dutyLogStore.setState('searchData', formData.value)
    uni.$mocpJump.navigateBack()
    uni.$emit('dutyLogReload')
}
</script>
<style lang="scss" scoped></style>
