Commit 993c197a authored by 杨子龙's avatar 杨子龙

优化表格数据获取

parent 72fe6f2c
......@@ -316,16 +316,11 @@ const DataTable = props => {
const columns = getColumns();
useEffect(() => {
const list = [...dataSource];
let list = [...dataSource];
eventEmitter.on(addons?.dataPath , (res) => {
if(isArray(res)){
res.forEach((item) => {
const currentItem = list.find(l => l['gis-GIS编号'] === item['gis-GIS编号']);
if(!currentItem){
list.push(item);
}
})
list = [].concat(res);
} else {
if(list.some(v=> v['gis-GIS编号'] === res['gis-GIS编号'])) return;
list.push(res);
......
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