import { useCountryInfoStore } from '/@/stores/countryInfo';


const countryInfoStore = useCountryInfoStore();

export const columns = [
  { type: 'seq', width: 50, align: 'center', fixed: 'left' },
  {
    field: 'operaterName', title: '运营', width: 'auto', align: 'center',  fixed: 'left',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.operaterName ? row.operaterName : '--' }</span>;
      }
    }
  },
  {
    field: 'platformNumber', title: '平台编号', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.platformNumber ? row.platformNumber : '--' }</span>;
      }
    }
  },
  {
    field: 'platformName', title: '平台名称', width: 'auto', align: 'center', slots: {
      default({ row }: any) {
        return <span class={ 'font-semibold' } style={{color: '#303133'}}>{ row.platformName ? row.platformName : '--' }</span>;
      }
    }
  },
  {
    field: 'country', title: '国家', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        const country = countryInfoStore.countries.find(c => c.name === row.country);
        const color = country ? country.color : '#3875F6';
        return <el-tag effect="plain" round style={{ color: color, borderColor: color }}>{ row.country ? row.country : '--' }</el-tag>;
      }
    }
  },
  {
    field: 'brandName', title: '品牌名称', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.brandName ? row.brandName : '--' }</span>;
      }
    }
  },
  {
    field: 'currencyCode', title: '货币代码', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.currencyCode ? row.currencyCode : '--' }</span>;
      }
    }
  },
  {
    field: 'status', title: '状态', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.status ? row.status : '--' }</span>;
      }
    }
  },
  {
    field: 'platform', title: '平台', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.platform ? row.platform : '--' }</span>;
      }
    }
  },
  {
    field: 'line', title: '线路', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.line ? row.line : '--' }</span>;
      }
    }
  },
  {
    field: 'ipaddress', title: 'IP地址', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.ipaddress ? row.ipaddress : '--' }</span>;
      }
    }
  },
  {
    field: 'company', title: '公司名称', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.company ? row.company : '--' }</span>;
      }
    }
  },
  {
    field: 'companyEnglishName', title: '公司英文名称', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.companyEnglishName ? row.companyEnglishName : '--' }</span>;
      }
    }
  },
  {
    field: 'address', title: '公司地址', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.address ? row.address : '--' }</span>;
      }
    }
  },
  {
    field: 'juridicalPerson', title: '法人', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.juridicalPerson ? row.juridicalPerson : '--' }</span>;
      }
    }
  },
  {
    field: 'juridicalPersonCreditCard', title: '法人信用卡', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.juridicalPersonCreditCard ? row.juridicalPersonCreditCard : '--' }</span>;
      }
    }
  },
  {
    field: 'juridicalPersonCreditCardAddress', title: '法人信用卡地址', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.juridicalPersonCreditCardAddress ? row.juridicalPersonCreditCardAddress : '--' }</span>;
      }
    }
  },
  {
    field: 'receivablesAccount', title: '收款账户', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.receivablesAccount ? row.receivablesAccount : '--' }</span>;
      }
    }
  },
  {
    field: 'receivablesAccountCompany', title: '收款账户公司', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.receivablesAccountCompany ? row.receivablesAccountCompany : '--' }</span>;
      }
    }
  },
  {
    field: 'vatNumber', title: 'VAT税号', minWidth: 200, align: 'left',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.vatNumber ? row.vatNumber : '--' }</span>;
      }
    }
  },
  {
    field: 'vatCompany', title: 'VAT公司', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.vatCompany ? row.vatCompany : '--' }</span>;
      }
    }
  },
  {
    field: 'shopPhoneEmail', title: '店铺电话与邮箱', width: 'auto', align: 'center',
    slots: {
      default({ row }: any) {
        return <span class={ 'font-medium' }>{ row.shopPhoneEmail ? row.shopPhoneEmail : '--' }</span>;
      }
    }
  }
];
