"use strict";
/**
 * 字段相关工具函数
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAiField = isAiField;
exports.isAgentField = isAgentField;
exports.isFormulaField = isFormulaField;
exports.getFieldLabel = getFieldLabel;
exports.getAiTaskType = getAiTaskType;
exports.getFieldIcon = getFieldIcon;
exports.generateColumnCode = generateColumnCode;
exports.generateFieldId = generateFieldId;
const constants_1 = require("../constants");
/**
 * 判断是否为 AI 字段
 */
function isAiField(fieldType) {
    return constants_1.AI_FIELD_TYPES.includes(fieldType);
}
/**
 * 判断是否为 Agent 字段
 */
function isAgentField(fieldType) {
    return constants_1.AGENT_FIELD_TYPES.includes(fieldType);
}
/**
 * 判断是否为公式字段
 */
function isFormulaField(fieldType) {
    return constants_1.FORMULA_FIELD_TYPES.includes(fieldType);
}
/**
 * 获取字段类型对应的中文标签
 */
function getFieldLabel(fieldType) {
    return constants_1.FIELD_LABEL_MAP[fieldType] || fieldType;
}
/**
 * 获取 AI 任务类型
 */
function getAiTaskType(fieldType) {
    return constants_1.AI_TASK_TYPE_MAP[fieldType] || fieldType;
}
/**
 * 根据组件类型获取图标
 */
function getFieldIcon(component) {
    return constants_1.COMPONENT_ICON_MAP[component || ''] || 'edit';
}
/**
 * 生成列 code
 */
function generateColumnCode(existingCode) {
    if (existingCode) {
        return existingCode;
    }
    return `ai_column_${Date.now()}`;
}
/**
 * 生成新字段 ID
 */
function generateFieldId(fieldType) {
    return `field_${fieldType}_${Date.now()}`;
}
