import { reactive } from 'vue'; /** * 任务 tab 的身份维度视角。 * * 范围维度(全部 / 某状态 / 某具体执行)由父组件的 selectedStatus + selectedExecution 单独维护, * 与本身份维度自由组合。 * * - my: 我参与的(owner 或活跃协办) * - all: 所有任务(需 project:task:query 权限) */ export type ViewContextType = 'my' | 'all'; export interface ViewContext { type: ViewContextType; } export function useTaskViewContext() { const state = reactive({ type: 'my' }); function switchToMine() { state.type = 'my'; } function switchToAll() { state.type = 'all'; } return { context: state, switchToMine, switchToAll }; }