zhou zhou
14 小时以前 50e95b985a72fcec4a93a2470e9efdfb2620148a
rsf-design/src/views/basic-info/contract/contractTable.columns.js
@@ -1,16 +1,17 @@
import { h } from 'vue'
import { ElTag } from 'element-plus'
import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue'
import { $t } from '@/locales'
export function createContractTableColumns({ handleView, handleEdit, handleDelete, canEdit = true, canDelete = true }) {
  const operations = [{ key: 'view', label: '详情', icon: 'ri:eye-line' }]
  const operations = [{ key: 'view', label: $t('common.actions.detail'), icon: 'ri:eye-line' }]
  if (canEdit && handleEdit) {
    operations.push({ key: 'edit', label: '编辑', icon: 'ri:pencil-line' })
    operations.push({ key: 'edit', label: $t('common.actions.edit'), icon: 'ri:pencil-line' })
  }
  if (canDelete && handleDelete) {
    operations.push({ key: 'delete', label: '删除', icon: 'ri:delete-bin-5-line', color: 'var(--art-error)' })
    operations.push({ key: 'delete', label: $t('common.actions.delete'), icon: 'ri:delete-bin-5-line', color: 'var(--art-error)' })
  }
  return [
@@ -21,68 +22,68 @@
    },
    {
      type: 'globalIndex',
      label: '序号',
      label: $t('table.index'),
      width: 72,
      align: 'center'
    },
    {
      prop: 'code',
      label: '合同编码',
      label: $t('pages.basicInfo.contract.table.code'),
      minWidth: 160,
      showOverflowTooltip: true
    },
    {
      prop: 'name',
      label: '合同名称',
      label: $t('pages.basicInfo.contract.table.name'),
      minWidth: 180,
      showOverflowTooltip: true
    },
    {
      prop: 'projectName',
      label: '项目名称',
      label: $t('pages.basicInfo.contract.table.projectName'),
      minWidth: 180,
      showOverflowTooltip: true
    },
    {
      prop: 'status',
      label: '状态',
      label: $t('table.status'),
      width: 100,
      align: 'center',
      formatter: (row) => h(ElTag, { type: row.statusType || 'info', effect: 'light' }, () => row.statusText || '--')
    },
    {
      prop: 'updateByText',
      label: '更新人',
      label: $t('table.updateBy'),
      minWidth: 120,
      showOverflowTooltip: true
    },
    {
      prop: 'updateTimeText',
      label: '更新时间',
      label: $t('table.updateTime'),
      minWidth: 170,
      showOverflowTooltip: true
    },
    {
      prop: 'createByText',
      label: '创建人',
      label: $t('table.createBy'),
      minWidth: 120,
      showOverflowTooltip: true
    },
    {
      prop: 'createTimeText',
      label: '创建时间',
      label: $t('table.createTime'),
      minWidth: 170,
      showOverflowTooltip: true
    },
    {
      prop: 'memo',
      label: '备注',
      label: $t('table.remark'),
      minWidth: 200,
      showOverflowTooltip: true
    },
    {
      prop: 'operation',
      label: '操作',
      label: $t('table.operation'),
      width: 120,
      align: 'center',
      fixed: 'right',