• TZW's avatar
    bug · 51ed0b35
    TZW authored
    51ed0b35
columns.js 2.04 KB
function getcolumns(ifs) {
  return [
    { title: '产线代码', dataIndex: 'productionLineCode', key: 'productionLineCode', width: 180 },
    {
      title: '产线名称',
      dataIndex: 'productionLineName',
      key: 'productionLineName',
      width: 180,
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
    },
    {
      title: '所属工厂',
      dataIndex: 'factoryName',
      fieldProps: {
        showSearch: true,
      },
      hideInForm: true,
      key: 'factoryId',
      width: 180,
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
    },
    {
      title: '所属车间',
      dataIndex: 'shopName',
      key: 'shopId',
      hideInForm: true,
      fieldProps: {
        showSearch: true,
      },
      width: 180,
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      options: {
        path: '/auth/sysShop/getAllShopSelection',
      },
    },
    {
      title: '所属工厂',
      dataIndex: 'factoryName',
      key: 'factoryId',
      width: 180,
      hideInTable: true,
      search: false,
      fieldProps: {
        disabled: ifs,
      },
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
    },
    {
      title: '所属车间',
      dataIndex: 'shopName',
      key: 'shopId',
      hideInTable: true,
      search: false,
      fieldProps: {
        disabled: ifs,
      },
      width: 180,
      formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
      valueType: 'select',
      options: {
        path: '/auth/sysShop/getShopSelectionByFactory',
        linkParams: {
          factoryId: '', //key 后面如果存在value 则该value会在调用接口时format
        },
      },
    },
  ];
}

export default getcolumns;