| | |
| | | import { $t } from '@/locales' |
| | | |
| | | export function createDictTypeSearchState() { |
| | | return { |
| | | condition: '', |
| | |
| | | } |
| | | } |
| | | |
| | | export function getDictTypeStatusMeta(status) { |
| | | export function getDictTypeStatusMeta(status, t = $t) { |
| | | return Number(status) === 1 |
| | | ? { text: '正常', type: 'success', bool: true } |
| | | : { text: '冻结', type: 'danger', bool: false } |
| | | ? { text: t('common.status.normal'), type: 'success', bool: true } |
| | | : { text: t('common.status.frozen'), type: 'danger', bool: false } |
| | | } |
| | | |
| | | export function buildDictTypeSearchParams(params = {}) { |
| | |
| | | } |
| | | } |
| | | |
| | | export function normalizeDictTypeListRow(record = {}) { |
| | | const statusMeta = getDictTypeStatusMeta(record.status) |
| | | export function normalizeDictTypeListRow(record = {}, t = $t) { |
| | | const statusMeta = getDictTypeStatusMeta(record.status, t) |
| | | return { |
| | | ...record, |
| | | code: record.code || '', |