Commit e7bf77e8 authored by 田翔's avatar 田翔

fix: 解决防止搜索已选数据失效问题

parent e73864ee
{
"name": "panda-xform",
"version": "6.0.12",
"description": "6.0.12 删除台账接口增加时限",
"version": "6.0.13",
"description": "6.0.13 解决防止搜索已选数据失效问题",
"keywords": [
"panda-xform"
],
......
......@@ -79,11 +79,15 @@ const AccountSelector = (props) => {
const { data, code, msg } = await GetAccountPageList(param);
if (code === 0) {
if (data.jsonData) {
let dataSource = JSON.parse(data.jsonData);
setDataSource(dataSource);
let valueArr = value ? value.split(',') : [];
let rows = dataSource.filter(v => valueArr.includes(v[fieldshine[0].fromField]));
setKeys(rows.map(v => v.ID));
let Data = JSON.parse(data.jsonData);
let dataKeys = dataSource.filter(v => keys.includes(v.ID))
let otherData = Data.filter(v => !keys.includes(v.ID))
setDataSource([...otherData, ...dataKeys]);
if (!keys.length) {
let valueArr = value ? value.split(',') : [];
let rows = Data.filter(v => valueArr.includes(v[fieldshine[0].fromField]));
setKeys(rows.map(v => v.ID));
}
setParams({ ...params, ...outParams, total: data.totalCount });
} else {
setDataSource([])
......
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