import { defineStore } from 'pinia'

const useWorkAssignmentStore = defineStore('workAssignment', {
    state: () => {
        return {
            searchData: {
                state: '1',
                machineNumber: '',
                model: '',
                aviation: '',
                terminal: '',
                feedbackTime: '',
                sponsor: ''
            },
            details: undefined
        }
    },
    getters: {},
    actions: {
        resetForm() {
            this.searchData = {
                state: '1',
                machineNumber: '',
                model: '',
                aviation: '',
                terminal: '',
                feedbackTime: '',
                sponsor: ''
            }
        },
        setState(...args) {
            this.$patch({ [args[0]]: args[1] })
        }
    },
    // 配置持久化
    persist: false
})
export default useWorkAssignmentStore
