import { factorySelect, shopSelectByFactory } from "@/services/system";
import regValue from "@/utils/regValue";
export default {
  productionLineCode: {
    value: null,
    type: "input",
    title: "产线编号",
    name: ["productionLineCode"],
    required: true,
  },
  productionLineName: {
    value: null,
    type: "input",
    title: "产线名称",
    name: ["productionLineName"],
    required: true,
  },
  factoryId: {
    value: null,
    type: "select",
    title: "所属工厂",
    name: ["factoryId"],
    required: true,
    options: {
      database: factorySelect,
      params: {},
    },
    linked: true,
  },
  shopId: {
    value: null,
    type: "select",
    title: "所属车间",
    name: ["shopId"],
    required: true,
    belinked: {
      options: {
        database: shopSelectByFactory,
        params: { factoryId: "linked" },
      },
    },
  },
  processingCapacity: {
    value: null,
    type: "inputnumber",
    title: "加工能力（小时）",
    name: ["processingCapacity"],
    required: false,
    ...regValue(null, 6, 3),
  },
  processingType: {
    value: null,
    type: "select",
    title: "加工类型",
    name: ["processingType"],
    required: false,
    options: [
      {
        label: "并行",
        value: 0,
      },
      {
        label: "串行",
        value: 1,
      },
    ],
  },
  capacityCoefficient: {
    value: null,
    type: "inputnumber",
    title: "能力系数",
    name: ["capacityCoefficient"],
    required: false,
    ...regValue(null, 6, 3),
  },
  dailyProcessingOutput: {
    value: null,
    type: "inputnumber",
    title: "加工日产量",
    name: ["dailyProcessingOutput"],
    required: false,
    ...regValue(null, 6, 3),
  },
  remark: {
    value: null,
    type: "textarea",
    title: "描述",
    name: ["remark"],
    required: false,
    col: { span: 24 },
  },
};
