import { useDictionaryStore } from "@/store";
const { dicts } = useDictionaryStore();
import dictDataUtil from "@/common/configs/dictDataUtil";

const switchOp = [
  {
    label: "否",
    value: 0,
  },
  {
    label: "是",
    value: 1,
  },
];
export const tableConfig = {
  PROCESS_SELECT: {
    url: "/api/v1/category/detail/operation",
    column: [
      {
        label: "工序名称",
        prop: "operationName",
        span: 12,
        search: true,
        rules: [
          {
            required: true,
            message: "工序名称不能为空",
            trigger: "blur",
          },
        ],
      },
      {
        label: "工序编码",
        prop: "operationCode",
        span: 12,
        search: true,
        display: false,
      },

      {
        label: "工艺条件",
        prop: "processAsk",
        span: 12,
        minWidth: 300,
        rules: [
          {
            required: true,
            message: "工艺条件不能为空",
            trigger: "blur",
          },
        ],
      },

      {
        label: "标准工时(分)",
        prop: "standardWorktime",
        type: "number",
        span: 12,
        rules: [
          {
            required: true,
            message: "标准工时不能为空",
            trigger: "blur",
          },
        ],
      },


      {
        label: "工序标注",
        prop: "operationLabel",
        span: 12,
        rules: [
          {
            max: 16,
            message: "工序标注不能超过16个字符",
            trigger: "blur",
          },
        ],
      },
      {
        label: "方法",
        prop: "method",
        span: 12,
      },
      {
        label: "试验规程编号",
        prop: "testPlanCode",
        span: 12,
      },
      {
        label: "是否可跳过",
        prop: "skipped",
        span: 8,
        hide: true,
        type: "switch",
        dicData: switchOp,
        value: 0,
      },
      {
        label: "是否关键工序",
        prop: "keyProcesses",
        span: 8,
        type: "switch",
        dicData: switchOp,
        value: 0,
      },
      {
        label: "是否特殊工序",
        prop: "isSpecial",
        span: 8,
        type: "switch",
        dicData: switchOp,
        value: 0,
      },
      {
        label: "是否禁用",
        prop: "enabled",
        hide: true,
        span: 8,
        type: "switch",
        dicData: switchOp,
        value: 0,
      },
    ],
  },
};
