zhou zhou
14 小时以前 0d93ec4c10d146ffe287e7f4430ee66ad5832a17
rsf-design/src/views/orders/delivery/deliveryTable.columns.js
@@ -4,10 +4,22 @@
import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue'
import { getDeliveryActionList } from './deliveryPage.helpers.js'
export function createDeliveryTableColumns({ handleActionClick } = {}) {
export function createDeliveryTableColumns({
  handleActionClick,
  canEdit = true,
  canDelete = true
} = {}) {
  return [
    { type: 'selection', width: 48, align: 'center' },
    { type: 'globalIndex', label: $t('table.index'), width: 72, align: 'center' },
    {
      prop: 'id',
      label: $t('table.id'),
      width: 100,
      align: 'right',
      visible: false,
      formatter: (row) => row.id ?? '--'
    },
    {
      prop: 'code',
      label: $t('pages.orders.delivery.search.code'),
@@ -73,7 +85,7 @@
    },
    {
      prop: 'status',
      label: $t('pages.orders.transfer.search.status'),
      label: $t('table.status'),
      width: 96,
      align: 'center',
      formatter: (row) =>
@@ -85,7 +97,11 @@
      minWidth: 120,
      showOverflowTooltip: true,
      formatter: (row) =>
        h(ElTag, { type: row.exceStatusTagType || 'info', effect: 'light' }, () => row.exceStatusText || '--')
        h(
          ElTag,
          { type: row.exceStatusTagType || 'info', effect: 'light' },
          () => row.exceStatusText || '--'
        )
    },
    {
      prop: 'startTimeText',
@@ -102,6 +118,38 @@
      formatter: (row) => row.endTimeText || '--'
    },
    {
      prop: 'updateByText',
      label: $t('table.updateBy'),
      minWidth: 130,
      visible: false,
      showOverflowTooltip: true,
      formatter: (row) => row.updateByText || '--'
    },
    {
      prop: 'updateTimeText',
      label: $t('table.updateTime'),
      minWidth: 170,
      visible: false,
      showOverflowTooltip: true,
      formatter: (row) => row.updateTimeText || '--'
    },
    {
      prop: 'createByText',
      label: $t('table.createBy'),
      minWidth: 130,
      visible: false,
      showOverflowTooltip: true,
      formatter: (row) => row.createByText || '--'
    },
    {
      prop: 'createTimeText',
      label: $t('table.createTime'),
      minWidth: 170,
      visible: false,
      showOverflowTooltip: true,
      formatter: (row) => row.createTimeText || '--'
    },
    {
      prop: 'memo',
      label: $t('pages.orders.delivery.search.memo'),
      minWidth: 180,
@@ -116,7 +164,7 @@
      fixed: 'right',
      formatter: (row) =>
        h(ArtButtonMore, {
          list: getDeliveryActionList(row),
          list: getDeliveryActionList(row, { canEdit, canDelete }),
          onClick: (item) => handleActionClick?.(item, row)
        })
    }