export default function (_height=0) { let height=window.innerHeight if (height > 1024) { height = window.innerHeight*0.88 }else{ height = window.innerHeight*0.78 } if (_height>0){ height=_height } const options={ height:height, align:'center', border: true, resizable: true, keepSource:true, size:'mini', showOverflow: true, scrollY:{enable:true}, data:[], ycldw:[] } 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 gdhFormat=function ({cellValue}){ if (cellValue){ return 'PW'+cellValue } return '' } const dwFormat=function ({cellValue}){ for (const item of options.ycldw) { if (cellValue===item.id){ return item.name } } } const columns = [ { type: 'checkbox', width: 40 }, { type: 'seq',title:'序号', width: 60 }, {field: 'dwId', title: '垛位', width: 100,formatter: dwFormat}, {field: 'ceng', title: '层数', width: 60}, {field: 'czbh', title: '船号'}, {field: 'pl', title: '批量'}, {field: 'fd', title: '分段',visible:false}, {field: 'tlth', title: '套料图号',visible:false}, {field: 'wpgg', title: '物品规格', }, {field: 'wlh', title: '物料号', }, {field: 'nm', title: '内码',visible:false }, {field: '', title: '备注',visible:false }, ] return { options, columns, setExt } }