import {
  factorySelect,
  shopSelectByFactory,
  productionLineSelectByShop,
  sectionSelectByShop,
} from "@/services/system";
import regValue from "@/utils/regValue";
export default {
  stationCode: {
    value: null,
    type: "input",
    title: "工位编号",
    name: ["stationCode"],
    required: true,
  },
  stationName: {
    value: null,
    type: "input",
    title: "工位名称",
    name: ["stationName"],
    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" },
      },
    },
    linked: true,
  },
  sectionId: {
    value: null,
    type: "select",
    title: "所属工段",
    name: ["sectionId"],
    required: true,
    belinked: {
      options: {
        database: sectionSelectByShop,
        params: { shopId: "linked", factoryId: "linked" },
      },
    },
  },
  productionLineId: {
    value: null,
    type: "select",
    title: "所属产线",
    name: ["productionLineId"],
    required: true,
    belinked: {
      options: {
        database: productionLineSelectByShop,
        params: { shopId: "linked", factoryId: "linked" },
      },
    },
  },
  stationType: {
    value: null,
    type: "select",
    title: "工位类型",
    name: ["stationType"],
    required: false,
    options: [
      {
        label: "待加工",
        value: 0,
      },
      {
        label: "在加工",
        value: 1,
      },
    ],
  },
  stationDifficultyCoefficient: {
    value: null,
    type: "inputnumber",
    title: "难易系数",
    name: ["stationDifficultyCoefficient"],
    required: false,
    ...regValue(null, 6, 3),
  },
  capacity: {
    value: null,
    type: "inputnumber",
    title: "能力",
    name: ["capacity"],
    required: false,
    ...regValue(null, 6, 3),
  },
  remark: {
    value: null,
    type: "textarea",
    title: "描述",
    name: ["remark"],
    required: false,
    col: { span: 24 },
  },
};