Commit 186214cc by 和金晶

数据资产添加中英文排序

parent 79b2cb5e
...@@ -752,7 +752,6 @@ const AssetTable = (props) => { ...@@ -752,7 +752,6 @@ const AssetTable = (props) => {
} }
const onReportAnalyseClick = (val) => { const onReportAnalyseClick = (val) => {
console.log(val)
if ((checkedKeys||[]).length === 0) { if ((checkedKeys||[]).length === 0) {
showMessage('warn', '请先选择一个资产'); showMessage('warn', '请先选择一个资产');
} else if ((checkedKeys||[]).length > 1) { } else if ((checkedKeys||[]).length > 1) {
...@@ -1059,13 +1058,38 @@ const AssetTable = (props) => { ...@@ -1059,13 +1058,38 @@ const AssetTable = (props) => {
loading={loading} loading={loading}
columns={ columns={
(realColumns||[]).map((column, index) => { (realColumns||[]).map((column, index) => {
if(column.title === '中文名称') {
return { return {
...column, ...column,
onHeaderCell: column => ({ onHeaderCell: column => ({
width: column.width, width: column.width,
onResize: handleResize(index), onResize: handleResize(index),
}), }),
sorter: (a, b) => {
return a.element2.localeCompare(b.element2,'zh-CN');
},
};
} else if (column.title === '英文名称') {
return {
...column,
onHeaderCell: column => ({
width: column.width,
onResize: handleResize(index),
}),
sorter: (a, b) => {
return a.element2.localeCompare(b.element2);
},
}; };
} else {
return {
...column,
onHeaderCell: column => ({
width: column.width,
onResize: handleResize(index),
}),
};
}
}) })
} }
rowKey='id' rowKey='id'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment