// XCharge 组件测试配置文件 - 最新最全版本
// 包含所有功能：图标、徽章、混合支付模式、XTitle集成等

// 1. 完整功能配置 - 混合支付手动模式（带图标和徽章）
export const testChargeConfig = {
  title: '结算-收费方式', // 使用XTitle组件显示标题
  amountFields: [
    {
      field: 'f_amount',
      disabled: false,
      label: '费用总额'
    },
    {
      field: 'f_insurance_amount',
      disabled: true,
      label: '医保支付'
    },
    {
      field: 'f_self_amount',
      disabled: true,
      label: '自费金额'
    },
    {
      field: 'out_of_pocket_amount',
      disabled: true,
      label: '自付金额'
    },
    {
      field: 'biscount_amount',
      disabled: true,
      label: '折扣金额'
    },
    {
      field: 'billing_amount',
      disabled: true,
      label: '记账金额'
    }
  ],
  paymentMethods: [
    {
      key: '医保卡',
      label: '医保卡',
      icon: '/img/paymentMethod/medical-card.png'
    },
    {
      key: '微信/支付宝',
      label: '微信/支付宝',
      icon: '/img/paymentMethod/wechat-alipay.png'
    },
    {
      key: '银行卡',
      label: '银行卡',
      icon: '/img/paymentMethod/bank-card.png'
    },
    {
      key: '现金',
      label: '现金',
      icon: '/img/paymentMethod/cash.png'
    }
  ],
  bottomFields: [
    {
      field: 'f_balance',
      label: '账户余额',
      disabled: false
    },
    {
      field: 'received',
      label: '实收',
      disabled: false
    },
    {
      field: 'change',
      label: '找零',
      disabled: false
    }
  ],
  actionButtons: [
    {
      key: 'charge',
      label: '收费',
      icon: 'check'
    },
    {
      key: 'refund',
      label: '退费',
      icon: 'undo'
    },
    {
      key: 'print',
      label: '打印',
      icon: 'printer'
    }
  ],
  enableMixedPayment: true, // 启用混合支付
  mixedPaymentMode: 'manual', // 混合支付模式：'manual'手动输入，'auto'自动模式
  // 可配置事件名，参考 fronImport 风格
  eventNames: {
    method: 'method',
    methods: 'methods',
    totalPaymentAmount: 'totalPaymentAmount',
    action: 'action'
  },
  dataSourceConfig: 'testChargeLogic'
}

// 2. 混合支付自动模式配置（外部控制金额分配）
export const testAutoMixedChargeConfig = {
  title: '自动收费管理',
  amountFields: [
    {
      field: 'f_amount',
      disabled: false,
      label: '费用总额'
    },
    {
      field: 'f_insurance_amount',
      disabled: true,
      label: '医保支付'
    },
    {
      field: 'f_self_amount',
      disabled: true,
      label: '自费金额'
    },
    {
      field: 'out_of_pocket_amount',
      disabled: true,
      label: '自付金额'
    }
  ],
  paymentMethods: [
    {
      key: '医保卡',
      label: '医保卡',
      icon: 'icon1'
    },
    {
      key: '微信/支付宝',
      label: '微信/支付宝',
      icons: ['icon1', 'icon1']
    },
    {
      key: '银行卡',
      label: '银行卡',
      icon: 'icon1'
    },
    {
      key: '现金',
      label: '现金',
      icon: 'icon1'
    }
  ],
  bottomFields: [
    {
      field: 'f_balance',
      label: '账户余额',
      disabled: false
    },
    {
      field: 'received',
      label: '实收',
      disabled: false
    },
    {
      field: 'change',
      label: '找零',
      disabled: false
    }
  ],
  actionButtons: [
    {
      key: 'charge',
      label: '收费',
      icon: 'check'
    },
    {
      key: 'refund',
      label: '退费',
      icon: 'undo'
    },
    {
      key: 'print',
      label: '打印',
      icon: 'printer'
    }
  ],
  enableMixedPayment: true, // 启用混合支付
  mixedPaymentMode: 'auto', // 自动模式：不需要手动输入金额，由外部控制
  eventNames: {
    method: 'method',
    methods: 'methods',
    totalPaymentAmount: 'totalPaymentAmount',
    action: 'action'
  },
  dataSourceConfig: 'testChargeLogic'
}

// 3. 单选模式配置（传统单选支付方式）
export const testSingleChargeConfig = {
  title: '简单收费',
  amountFields: [
    {
      field: 'f_amount',
      disabled: false,
      label: '费用总额'
    },
    {
      field: 'f_insurance_amount',
      disabled: true,
      label: '医保支付'
    }
  ],
  paymentMethods: [
    {
      key: '医保卡',
      label: '医保卡',
      icon: 'icon2'
    },
    {
      key: '现金',
      label: '现金',
      icon: 'icon1'
    }
  ],
  bottomFields: [
    {
      field: 'received',
      label: '实收',
      disabled: false
    },
    {
      field: 'change',
      label: '找零',
      disabled: false
    }
  ],
  actionButtons: [
    {
      key: 'charge',
      label: '收费',
      icon: 'check'
    }
  ],
  enableMixedPayment: false, // 禁用混合支付（单选模式）
  eventNames: {
    method: 'method',
    methods: 'methods',
    totalPaymentAmount: 'totalPaymentAmount',
    action: 'action'
  },
  dataSourceConfig: 'testChargeLogic'
}

// 4. 最小配置示例（仅必需字段）
export const testMinimalConfig = {
  title: '最小配置',
  enableMixedPayment: true,
  paymentMethods: [
    {
      key: '医保卡',
      label: '医保卡',
      icon: 'icon1'
    },
    {
      key: '微信/支付宝',
      label: '微信/支付宝',
      icon: 'icon1'
    }
  ],
  amountFields: [
    { field: 'f_amount', label: '费用总额' }
  ],
  bottomFields: [
    { field: 'received', label: '实收' },
    { field: 'change', label: '找零' }
  ],
  actionButtons: [
    { key: 'charge', label: '收费' }
  ]
}

// 5. 高级配置示例（包含所有可选字段）
export const testAdvancedConfig = {
  title: '高级收费管理',
  amountFields: [
    {
      field: 'f_amount',
      disabled: false,
      label: '费用总额'
    },
    {
      field: 'f_insurance_amount',
      disabled: true,
      label: '医保支付'
    },
    {
      field: 'f_self_amount',
      disabled: true,
      label: '自费金额'
    },
    {
      field: 'out_of_pocket_amount',
      disabled: true,
      label: '自付金额'
    },
    {
      field: 'biscount_amount',
      disabled: true,
      label: '折扣金额'
    },
    {
      field: 'billing_amount',
      disabled: true,
      label: '记账金额'
    }
  ],
  paymentMethods: [
    {
      key: '医保卡',
      label: '医保卡',
      icon: '/img/paymentMethod/medical-card.png'
    },
    {
      key: '微信',
      label: '微信支付',
      icon: '/img/paymentMethod/wechat.png'
    },
    {
      key: '支付宝',
      label: '支付宝',
      icon: '/img/paymentMethod/alipay.png'
    },
    {
      key: '银行卡',
      label: '银行卡',
      icon: '/img/paymentMethod/bank-card.png'
    },
    {
      key: '现金',
      label: '现金',
      icon: '/img/paymentMethod/cash.png'
    },
    {
      key: '其他',
      label: '其他方式',
      icon: '/img/paymentMethod/other.png'
    }
  ],
  bottomFields: [
    {
      field: 'f_balance',
      label: '账户余额',
      disabled: false
    },
    {
      field: 'received',
      label: '实收',
      disabled: false
    },
    {
      field: 'change',
      label: '找零',
      disabled: false
    },
    {
      field: 'discount',
      label: '优惠金额',
      disabled: false
    }
  ],
  actionButtons: [
    {
      key: 'charge',
      label: '收费',
      icon: 'check'
    },
    {
      key: 'refund',
      label: '退费',
      icon: 'undo'
    },
    {
      key: 'print',
      label: '打印',
      icon: 'printer'
    },
    {
      key: 'save',
      label: '保存',
      icon: 'save'
    }
  ],
  enableMixedPayment: true,
  mixedPaymentMode: 'manual',
  // 自定义事件名
  eventNames: {
    method: 'onPaymentMethodChange',
    methods: 'onPaymentMethodsChange',
    totalPaymentAmount: 'onTotalAmountChange',
    action: 'onActionClick'
  },
  dataSourceConfig: 'advancedChargeLogic'
}

// 6. 无图标配置示例（测试占位符功能）
export const testNoIconConfig = {
  title: '无图标测试',
  enableMixedPayment: true,
  paymentMethods: [
    {
      key: '方式一',
      label: '方式一'
      // 无icon配置，将显示首字母占位符
    },
    {
      key: '方式二',
      label: '方式二'
      // 无icon配置，将显示首字母占位符
    }
  ],
  amountFields: [
    { field: 'f_amount', label: '费用总额' }
  ],
  bottomFields: [
    { field: 'received', label: '实收' }
  ],
  actionButtons: [
    { key: 'charge', label: '收费' }
  ]
}

// 配置说明：
// 1. title: 标题文本，支持XTitle组件的所有功能
// 2. paymentMethods.icon: 图标路径，支持相对路径和绝对路径
// 3. mixedPaymentMode: 'manual'手动输入模式，'auto'自动模式
// 4. enableMixedPayment: true启用混合支付，false为单选模式
// 5. eventNames: 可自定义事件名称
// 6. dataSourceConfig: 数据源逻辑配置名
