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

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

    return {
        ...conditionSharedConfig,
        dependentKeys: ['year'],
        independentKeys: ['location'],
        handler: async (params) => await dispatchCache(cacheActions.getSectionModes, params),
        key: 'mode',
        title: '科类',
        keyName: 'modeName',
        keyValue: 'mode',
        ...options
    }
}