zhou zhou
13 小时以前 50e95b985a72fcec4a93a2470e9efdfb2620148a
rsf-design/src/views/system/dict-type/dictTypeTable.columns.js
@@ -1,51 +1,53 @@
import { h } from 'vue'
import { ElTag } from 'element-plus'
import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue'
import { $t } from '@/locales'
export function createDictTypeTableColumns({ handleView, handleEdit, handleDelete }) {
export function createDictTypeTableColumns({ handleView, handleEdit, handleDelete, t = $t }) {
  return [
    {
      prop: 'code',
      label: '编码',
      label: t('table.code'),
      minWidth: 180,
      showOverflowTooltip: true
    },
    {
      prop: 'name',
      label: '名称',
      label: t('table.name'),
      minWidth: 180,
      showOverflowTooltip: true
    },
    {
      prop: 'description',
      label: '描述',
      label: t('pages.system.dictType.table.description'),
      minWidth: 220,
      showOverflowTooltip: true,
      formatter: (row) => row.description || '-'
      formatter: (row) => row.description || t('common.placeholder.empty')
    },
    {
      prop: 'status',
      label: '状态',
      label: t('table.status'),
      width: 100,
      formatter: (row) => h(ElTag, { type: row.statusType, effect: 'light' }, () => row.statusText || '-')
      formatter: (row) =>
        h(ElTag, { type: row.statusType, effect: 'light' }, () => row.statusText || t('common.placeholder.empty'))
    },
    {
      prop: 'updateByLabel',
      label: '更新人',
      label: t('table.updateBy'),
      width: 120,
      formatter: (row) => row.updateByLabel || '-'
      formatter: (row) => row.updateByLabel || t('common.placeholder.empty')
    },
    {
      prop: 'updateTimeText',
      label: '更新时间',
      label: t('table.updateTime'),
      minWidth: 180,
      formatter: (row) => row.updateTimeText || '-'
      formatter: (row) => row.updateTimeText || t('common.placeholder.empty')
    },
    {
      prop: 'operation',
      label: '操作',
      label: t('table.operation'),
      width: handleDelete ? 160 : 120,
      align: 'right',
      align: 'center',
      formatter: (row) => {
        const buttons = [
          h(ArtButtonTable, {
@@ -67,7 +69,7 @@
          )
        }
        return h('div', { class: 'flex justify-end' }, buttons)
        return h('div', { class: 'flex justify-center' }, buttons)
      }
    }
  ]