import {useCacheStore} from "@/hooks/useCacheStore";
import {conditionSharedConfig} from "@/components/mx-condition/modules/conditionSharedConfig";
import {cacheActions} from "@/hooks/defineCacheActions";

export const useConditionSegmentYear = function (options = {}) {
    const {dispatchCache} = useCacheStore()

    return {
        ...conditionSharedConfig,
        dependentKeys: ['location'],
        handler: async (params) => await dispatchCache(cacheActions.getSectionYears, params),
        key: 'year',
        title: '年份',
        keyName: 'text',
        keyValue: 'value',
        required: true,
        ...options
    }
}