zhou zhou
2 天以前 7c2bffa1a495cc4a3a263f654c08c231009c5c4e
rsf-design/src/views/system/menu/menuTable.columns.js
@@ -1,5 +1,6 @@
import { h } from 'vue'
import { ElTag } from 'element-plus'
import { $t } from '@/locales'
import ArtSvgIcon from '@/components/core/base/art-svg-icon/index.vue'
import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue'
import {
@@ -21,13 +22,13 @@
  return [
    {
      prop: 'meta.title',
      label: '菜单名称',
      label: $t('pages.system.menu.search.name'),
      minWidth: 180,
      formatter: (row) => getMenuDisplayTitle(row, titleFormatter)
    },
    {
      prop: 'meta.icon',
      label: '图标预览',
      label: $t('table.iconPreview'),
      width: 96,
      align: 'center',
      formatter: (row) => {
@@ -47,14 +48,14 @@
    },
    {
      prop: 'type',
      label: '菜单类型',
      label: $t('table.menuType'),
      width: 110,
      formatter: (row) =>
        h(ElTag, { type: getMenuTypeTag(row), effect: 'light' }, () => getMenuTypeText(row))
    },
    {
      prop: 'route',
      label: '路由',
      label: $t('pages.system.menu.search.route'),
      minWidth: 180,
      formatter: (row) => {
        if (row.meta?.isAuthButton) return ''
@@ -62,25 +63,43 @@
      }
    },
    {
      prop: 'component',
      label: $t('table.componentKey'),
      minWidth: 160,
      showOverflowTooltip: true,
      formatter: (row) => {
        if (row.meta?.isAuthButton) return ''
        return row.component || ''
      }
    },
    {
      prop: 'authority',
      label: '权限标识',
      label: $t('table.permissionKey'),
      minWidth: 180,
      formatter: (row) => {
        if (row.meta?.isAuthButton) {
          return row.authority || row.meta?.authMark || ''
        }
        if (!row.meta?.authList?.length) return row.authority || ''
        return `${row.meta.authList.length} 个权限标识`
        return $t('pages.system.menu.messages.authCount', {
          count: row.meta.authList.length
        })
      }
    },
    {
      prop: 'sort',
      label: '排序',
      label: $t('table.sort'),
      width: 90
    },
    {
      prop: 'id',
      label: $t('table.id'),
      width: 96,
      align: 'center'
    },
    {
      prop: 'status',
      label: '状态',
      label: $t('table.status'),
      width: 100,
      formatter: (row) => {
        const statusMeta = getMenuStatusMeta(row.status)
@@ -89,18 +108,18 @@
    },
    {
      prop: 'memo',
      label: '备注',
      label: $t('table.remark'),
      minWidth: 180,
      showOverflowTooltip: true,
      formatter: (row) => row.memo || '-'
    },
    {
      prop: 'operation',
      label: '操作',
      label: $t('table.operation'),
      width: 180,
      align: 'right',
      align: 'center',
      formatter: (row) => {
        const buttonStyle = { class: 'flex justify-end' }
        const buttonStyle = { class: 'flex justify-center' }
        if (row.meta?.isAuthButton) {
          return h('div', buttonStyle, [
            h(ArtButtonTable, {
@@ -117,7 +136,7 @@
          h(ArtButtonTable, {
            type: 'add',
            onClick: () => handleAddAuth(row),
            title: '新增权限'
            title: $t('pages.system.menu.actions.addAuth')
          }),
          h(ArtButtonTable, {
            type: 'edit',