function getcolumns(ifs) {
  return [
    { title: '工段代码', dataIndex: 'sectionCode', key: 'sectionCode' },
    {
      title: '工段名称',
      dataIndex: 'sectionName',
      key: 'sectionName',
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
    },
    {
      title: '所属工厂',
      dataIndex: 'factoryName',
      search: false,
      width: 180,
      key: 'factoryId',
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      fieldProps: {
        disabled: ifs,
      },
      options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
    },
    {
      title: '所属车间',
      dataIndex: 'shopName',
      width: 180,
      search: false,
      key: 'shopId',
      fieldProps: {
        disabled: ifs,
      },
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      options: {
        path: '/auth/sysShop/getShopSelectionByFactory',
        linkParams: {
          factoryId: '', //key 后面如果存在value 则该value会在调用接口时format
        },
      },
    },
    {
      title: '所属工厂',
      dataIndex: 'factoryName',
      width: 180,
      key: 'factoryId',
      fieldProps: {
        showSearch: true,
      },
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      hideInTable: true,
      hideInForm: true,
      options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
    },
    {
      title: '所属车间',
      dataIndex: 'shopName',
      width: 180,
      key: 'shopId',
      hideInTable: true,
      hideInForm: true,
      fieldProps: {
        showSearch: true,
      },
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      options: {
        path: '/auth/sysShop/getAllShopSelection',
        params: {},
      },
    },
  ];
}

export default getcolumns;