import { defineStore } from 'pinia'

const useInforDisclosureStore = defineStore('inforDisclosure', {
    state: () => {
        return {
            searchData: {
                state: '',
                machine_number: '',
                planeModel: '',
                aviation: '',
                termin: '',
                startTime: '',
                stopTime: '',
                guarantee: '',
                rlease_state: '',
                function_Info: '',
                failure_state: '',
                professional: ''
            },
            details: undefined,
            releaseBasisDetails: undefined,
            currentTabsIndex: 0
        }
    },
    getters: {},
    actions: {
        resetForm () {
            this.searchData = {
                state: '',
                machine_number: '',
                planeModel: '',
                aviation: '',
                termin: '',
                startTime: '',
                stopTime: '',
                guarantee: '',
                rlease_state: '',
                function_Info: '',
                failure_state: '',
                professional: ''
            }
        },
        setState (...args) {
            this.$patch({[args[0]]: args[1]})
        }
    },
    // 配置持久化
    persist: false
})
export default useInforDisclosureStore
