spring
2026-07-03 2540d86f0dbd77f654f558c3bf9d5ddbe7422f16
src/views/mes/pd/archive/data.ts
@@ -1,71 +1,79 @@
import type { VbenFormSchema } from "#/adapter/form";
import type { VxeTableGridOptions } from "#/adapter/vxe-table";
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from "#/packages/constants/src";
import { getDictOptions } from "#/packages/effects/hooks/src";
import { DICT_TYPE } from '#/packages/constants/src';
import { getDictOptions } from '#/packages/effects/hooks/src';
export function useGridFormSchema(): VbenFormSchema[] {
  return [
    {
      fieldName: "code",
      label: "归档编号",
      component: "Input",
      componentProps: { placeholder: "请输入归档编号" },
      fieldName: 'archiveCode',
      label: '归档编号',
      component: 'Input',
      componentProps: { placeholder: '请输入归档编号' },
    },
    {
      fieldName: "projectCode",
      label: "任务编码",
      component: "Input",
      componentProps: { placeholder: "请输入任务编码" },
      fieldName: 'productCode',
      label: '产品编码',
      component: 'Input',
      componentProps: { placeholder: '请输入产品编码' },
    },
    {
      fieldName: "productCode",
      label: "产品编码",
      component: "Input",
      componentProps: { placeholder: "请输入产品编码" },
      fieldName: 'productName',
      label: '产品名称',
      component: 'Input',
      componentProps: { placeholder: '请输入产品名称' },
    },
    {
      fieldName: "archiveStatus",
      label: "归档状态",
      component: "Select",
      fieldName: 'archiveStatus',
      label: '归档状态',
      component: 'Select',
      componentProps: {
        allowClear: true,
        options: getDictOptions(DICT_TYPE.MES_PD_ARCHIVE_STATUS, "number"),
        placeholder: "请选择归档状态",
        options: getDictOptions(DICT_TYPE.MES_PD_ARCHIVE_STATUS, 'number'),
        placeholder: '请选择归档状态',
      },
    },
  ];
}
export function useGridColumns(): VxeTableGridOptions["columns"] {
export function useGridColumns(): VxeTableGridOptions['columns'] {
  return [
    {
      field: "code",
      title: "归档编号",
      field: 'archiveCode',
      title: '归档编号',
      minWidth: 130,
      slots: { default: "code" },
      slots: { default: 'archiveCode' },
    },
    { field: "projectCode", title: "任务编码", minWidth: 120 },
    { field: "projectName", title: "任务名称", minWidth: 140 },
    { field: "productCode", title: "产品编码", minWidth: 120 },
    { field: "productName", title: "产品名称", minWidth: 140 },
    { field: "version", title: "版本号", minWidth: 90 },
    { field: 'productCode', title: '产品编码', minWidth: 120 },
    { field: 'productName', title: '产品名称', minWidth: 140 },
    { field: 'taskCode', title: '任务编码', minWidth: 130 },
    { field: 'taskName', title: '任务名称', minWidth: 160 },
    { field: 'archiveCount', title: '归档数量', minWidth: 90 },
    {
      field: "archiveStatus",
      title: "归档状态",
      field: 'archiveStatus',
      title: '归档状态',
      minWidth: 100,
      cellRender: {
        name: "CellDict",
        name: 'CellDict',
        props: { type: DICT_TYPE.MES_PD_ARCHIVE_STATUS },
      },
    },
    { field: "documentCount", title: "资料数", minWidth: 80 },
    { field: "archiverName", title: "归档人", minWidth: 100 },
    { field: 'archiverNickname', title: '归档人', minWidth: 100 },
    {
      field: "archiveTime",
      title: "归档时间",
      field: 'archiveTime',
      title: '归档时间',
      minWidth: 160,
      formatter: "formatDateTime",
      formatter: 'formatDateTime',
    },
    { field: 'updaterNickname', title: '更新人', minWidth: 100 },
    {
      field: 'updateTime',
      title: '更新时间',
      minWidth: 160,
      formatter: 'formatDateTime',
    },
  ];
}