zhou zhou
4 小时以前 6877c9caa25162e570a3e2a99a5b2ce3ef88368b
rsf-design/src/views/system/dict-type/dictTypeTable.columns.js
@@ -3,7 +3,15 @@
import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue'
import { $t } from '@/locales'
export function createDictTypeTableColumns({ handleView, handleEdit, handleDelete, t = $t }) {
export function createDictTypeTableColumns({
  handleView,
  handleEdit,
  handleDelete,
  handleManageData,
  t = $t
}) {
  const hasStandaloneView = !handleManageData && handleView
  return [
    {
      prop: 'code',
@@ -29,7 +37,11 @@
      label: t('table.status'),
      width: 100,
      formatter: (row) =>
        h(ElTag, { type: row.statusType, effect: 'light' }, () => row.statusText || t('common.placeholder.empty'))
        h(
          ElTag,
          { type: row.statusType, effect: 'light' },
          () => row.statusText || t('common.placeholder.empty')
        )
    },
    {
      prop: 'updateByLabel',
@@ -46,19 +58,35 @@
    {
      prop: 'operation',
      label: t('table.operation'),
      width: handleDelete ? 160 : 120,
      width: handleDelete ? (hasStandaloneView ? 200 : 240) : hasStandaloneView ? 160 : 200,
      align: 'center',
      formatter: (row) => {
        const buttons = [
          h(ArtButtonTable, {
            type: 'view',
            onClick: () => handleView(row)
          }),
        const buttons = []
        if (handleManageData) {
          buttons.push(
            h(ArtButtonTable, {
              type: 'view',
              onClick: () => handleManageData(row)
            })
          )
        }
        if (hasStandaloneView) {
          buttons.push(
            h(ArtButtonTable, {
              type: 'view',
              onClick: () => handleView(row)
            })
          )
        }
        buttons.push(
          h(ArtButtonTable, {
            type: 'edit',
            onClick: () => handleEdit(row)
          })
        ]
        )
        if (handleDelete) {
          buttons.push(
@@ -69,7 +97,7 @@
          )
        }
        return h('div', { class: 'flex justify-center' }, buttons)
        return h('div', { class: 'flex items-center justify-center gap-2' }, buttons)
      }
    }
  ]