diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js index 2034ceda..8bc29bd1 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js @@ -82,77 +82,79 @@ class DataTables extends Component { }); } }; + const getColumns = _.map(columns, item => { + const { dataIndex } = item; + if (dataIndex === "username") { + return { + ...item, + render: (text, record) => { + return window.pointerXY(e)} + title={text} + > + {text} + ; + } + }; + } else if (dataIndex === "operate") { + return { + ...item, + render: (text, record) => ( +
+ { + !isSpecial && + + onViewDetails(record)}>查看明细 + { + showOperateBtn && + onTableOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + } + + } + { + isSpecial && + + { + showOperateBtn && + + onTableOperate({ key: "handleAddData" }, record)}>编辑 + onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除 + + } + + } +
+ ) + }; + } else { + return { + ...item, + render: (text) => { + return {text} ; + } + }; + } + }); return { - const { dataIndex } = item; - if (dataIndex === "username") { - return { - ...item, - render: (text, record) => { - return window.pointerXY(e)} - title={text} - > - {text} - ; - } - }; - } else if (dataIndex === "operate") { - return { - ...item, - render: (text, record) => ( -
- { - !isSpecial && - - onViewDetails(record)}>查看明细 - { - showOperateBtn && - onTableOperate(e, record)}> - 编辑 - 删除 - } title=""> - - - } - - } - { - isSpecial && - - { - showOperateBtn && - - onTableOperate({ key: "handleAddData" }, record)}>编辑 - onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除 - - } - - } -
- ) - }; - } else { - return { - ...item, - render: (text) => { - return {text} ; - } - }; - } - })} + columns={getColumns} dataSource={dataSource} pagination={pagination} loading={loading.query} + xWidth={getColumns.length * 120} />; } }