zhou zhou
16 小时以前 50e95b985a72fcec4a93a2470e9efdfb2620148a
rsf-design/src/views/basic-info/companys/companysPage.helpers.js
@@ -1,9 +1,11 @@
const STATUS_META = {
  1: { text: '正常', type: 'success', bool: true },
  0: { text: '冻结', type: 'danger', bool: false }
  1: { textKey: 'common.status.normal', fallback: 'Normal', type: 'success', bool: true },
  0: { textKey: 'common.status.frozen', fallback: 'Frozen', type: 'danger', bool: false }
}
export const COMPANYS_REPORT_TITLE = '往来企业报表'
export function getCompanysReportTitle(t) {
  return typeof t === 'function' ? t('pages.basicInfo.companys.reportTitle') : 'Company Report'
}
export const COMPANYS_REPORT_STYLE = {
  titleAlign: 'center',
  titleLevel: 'strong',
@@ -61,10 +63,10 @@
  }
}
export function getCompanysStatusOptions() {
export function getCompanysStatusOptions(t) {
  return [
    { label: '正常', value: 1 },
    { label: '冻结', value: 0 }
    { label: typeof t === 'function' ? t('common.status.normal') : 'Normal', value: 1 },
    { label: typeof t === 'function' ? t('common.status.frozen') : 'Frozen', value: 0 }
  ]
}
@@ -82,7 +84,7 @@
  if (status === false || Number(status) === 0) {
    return STATUS_META[0]
  }
  return { text: '未知', type: 'info', bool: false }
  return { textKey: 'common.status.unknown', fallback: 'Unknown', type: 'info', bool: false }
}
export function buildCompanysTypeOptions(records = []) {
@@ -212,7 +214,8 @@
    city: normalizeText(record.city || ''),
    address: normalizeText(record.address || ''),
    memo: normalizeText(record.memo || ''),
    statusText: statusMeta.text,
    statusTextKey: statusMeta.textKey,
    statusText: statusMeta.fallback,
    statusType: statusMeta.type,
    statusBool: record.statusBool !== void 0 ? Boolean(record.statusBool) : statusMeta.bool,
    createByText: normalizeText(record.createBy$ || record.createByText || ''),
@@ -239,7 +242,7 @@
  orientation = COMPANYS_REPORT_STYLE.orientation
} = {}) {
  return {
    reportTitle: COMPANYS_REPORT_TITLE,
    reportTitle: previewMeta.reportTitle,
    reportDate: previewMeta.reportDate,
    printedAt: previewMeta.printedAt,
    operator: previewMeta.operator,