
export default function () {
  const options={
    height:866,
    align:'center',
    border: true,
    resizable: true,
    keepSource:true,
    size:'mini',
    showOverflow: true,
    scrollY:{enabled:true},
    highlightCurrentRow:true,
    data:[],
    ycldw:null,
  }
  const ext={}
  const setExt=function (key,value){
    ext[key]=value
  }

  const nameFormat=function ({cellValue}){
    const workers=ext.workers
    for (const item of workers) {
      if(item.userCode===cellValue){
        return item.userName
      }
    }
  }
  const columns = [
    { type: 'checkbox', width: 40 },
    { type: 'seq', width: 50, title: '序号' },
    { field: 'pkbs', title: '坡口标识', width: 90,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'pscry', title: '坡口施工', width: 90,formatter:nameFormat,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'qbs', title: '曲面标识', width: 90,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'qscry', title: '曲面施工', width: 90,formatter:nameFormat,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'dmbs', title: '打磨标识', width: 90,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'dscry', title: '打磨施工', width: 90,formatter:nameFormat,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'qjgZt', title: '状态', width: 120,formatter: ['dictFormat','PGZT'],
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'czbh', title: '船号', width: 70,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'pl', title: '批量', width: 70,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'fd', title: '分段', width: 70,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'kw', title: '跨位', width: 70,formatter: ['dictFormat', 'QGKW'],
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'zl', title: '组立', width: 70,formatter:['dictFormat','ZLLB'],
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'tlth', title: '套料图号', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'ljbh', title: '零件编号', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'ljmc', title: '零件名称', width: 120,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'ljgg', title: '零件规格', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'ljcz', title: '零件材质', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'wpfl', title: '物品分类', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'jldw', title: '计量单位', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'sl', title: '数量', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'qfxqrqxz', title: '前方需求小组期', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'qfxqrqdz', title: '前方需求大组期', width: 120,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'qgdh', title: '曲工单号', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'qjgjhrq', title: '曲加工计划期', width: 120,editRender: { name: 'input' },
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    // { field: 'qsbbh', title: '曲设备编号', width: 120,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    // { field: 'qjgXfry', title: '曲派工人员', width: 120,editRender: { name: 'input' },
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'qjgXfrq', title: '曲派工日期', width: 120,editRender: { name: 'input' },
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'qjgFkry', title: '曲反馈人', width: 120,editRender: { name: 'input' },
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'qjgFkrq', title: '曲反馈日期', width: 120,editRender: { name: 'input' },
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'pgdh', title: '坡口工单号', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'pkjhrq', title: '坡口计划日期', width: 120,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    // { field: 'pksbbh', title: '坡口设备编号', width: 120,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'pklx', title: '坡口类型', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'pkcd', title: '坡口长度', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'pkXfry', title: '坡口派工人员', width: 120,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'pkXfrq', title: '坡口派工日期', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'pkFkrq', title: '坡口反馈日期', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'pkFkry', title: '坡口反馈人', width: 120,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'dgdh', title: '打磨工单号', width: 100,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'dmsbbh', title: '打磨设备编号', width: 100,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'dmcd', title: '打磨打磨长度', width: 100,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    // { field: 'dmXfry', title: '打磨派工人', width: 100,
    //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
    //   filterRender: { name: 'FilterCombination', },
    // },
    { field: 'dmXfrq', title: '打磨派工日期', width: 100,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'dmFkry', title: '打磨反馈人', width: 100,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
    { field: 'dmFkrq', title: '打磨反馈日期', width: 100,
      filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
      filterRender: { name: 'FilterCombination', },
    },
  ]

  return {
    options,
    columns,
    setExt
  }
}
