import {
  factorySelect,
  shopSelectByFactory,
  productionLineSelectByShops,
  sectionSelectByShops,
  userSelect,
  departmentTree,
  roleSelect,
} from "@/services/system";
export default {
  accountName: {
    value: null,
    type: "input",
    title: "用户名",
    name: ["accountName"],
    required: true,
  },
  userName: {
    value: null,
    type: "input",
    title: "姓名",
    name: ["userName"],
    required: true,
  },
  gender: {
    value: null,
    type: "select",
    title: "性别",
    name: ["gender"],
    required: false,
    options: [
      {
        label: "男",
        value: 1,
      },
      {
        label: "女",
        value: 2,
      },
    ],
  },
  telephone: {
    value: null,
    type: "input",
    title: "联系电话",
    name: ["telephone"],
    required: true,
  },
  factoryId: {
    value: null,
    type: "select",
    title: "工厂",
    name: ["factoryId"],
    required: true,
    options: {
      database: factorySelect,
      params: {},
    },
    linked: true,
  },
  departmentId: {
    value: null,
    type: "treeselect",
    title: "部门",
    name: ["departmentId"],
    required: true,
    options: {
      database: departmentTree,
      params: {},
    },
  },
  shopIdList: {
    value: null,
    type: "select",
    title: "负责车间",
    name: ["shopIdList"],
    required: false,
    belinked: {
      options: {
        database: shopSelectByFactory,
        params: { factoryId: "linked" },
      },
    },
    linked: true,
    multiple: true,
  },
  sectionIdList: {
    value: null,
    type: "select",
    title: "负责工段",
    name: ["sectionIdList"],
    required: false,
    belinked: {
      options: {
        database: sectionSelectByShops,
        params: { shopIdList: "linked", factoryId: "linked" },
      },
    },
    multiple: true,
  },
  productionLineIdList: {
    value: null,
    type: "select",
    title: "负责产线",
    name: ["productionLineIdList"],
    required: false,
    belinked: {
      options: {
        database: productionLineSelectByShops,
        params: { shopIdList: "linked", factoryId: "linked" },
      },
    },
    multiple: true,
  },
  roleIdList: {
    value: null,
    type: "select",
    title: "角色配置",
    name: ["roleIdList"],
    required: false,
    belinked: {
      options: {
        database: roleSelect,
        params: {},
      },
    },
    multiple: true,
  },
  parentId: {
    value: null,
    type: "select",
    title: "直属领导",
    name: ["parentId"],
    required: false,
    belinked: {
      options: {
        database: userSelect,
        params: {},
      },
    },
  },
  mailNo: {
    value: null,
    type: "input",
    title: "邮箱",
    name: ["mailNo"],
    required: false,
    col: {
      span: 12,
    },
  },
  academicCareer: {
    value: null,
    type: "input",
    title: "学历",
    name: ["academicCareer"],
    required: false,
    col: {
      span: 12,
    },
  },
  university: {
    value: null,
    type: "input",
    title: "毕业院校",
    name: ["university"],
    required: false,
    col: {
      span: 12,
    },
  },
  major: {
    value: null,
    type: "input",
    title: "专业",
    name: ["major"],
    required: false,
    col: {
      span: 12,
    },
  },
  userImgList: {
    value: null,
    type: "upload",
    title: "个人图片",
    name: ["userImgList"],
    required: false,
    col: {
      span: 24,
    },
    listType: "img",
    multiple: false,
    limit: 1,
  },
};
