Commit f147400a authored by 杨子龙's avatar 杨子龙

修改表格配置项

parent 2e77d3e5
...@@ -6,6 +6,8 @@ import FileView from '../../../Account/components/TablePack/components/FileView' ...@@ -6,6 +6,8 @@ import FileView from '../../../Account/components/TablePack/components/FileView'
import TagPack from '../../../components/TagPack' import TagPack from '../../../components/TagPack'
import eventEmitter from '../../../../utils/eventEmitter' import eventEmitter from '../../../../utils/eventEmitter'
import { isArray } from "lodash";
import styles from './index.less'; import styles from './index.less';
const DataTable = props => { const DataTable = props => {
...@@ -54,7 +56,7 @@ const DataTable = props => { ...@@ -54,7 +56,7 @@ const DataTable = props => {
break break
} }
eventEmitter.emit(`${addons?.dataPath}_${actionItem.action}` , { eventEmitter.emit(`${addons?.dataPath}_event` , {
...row, ...row,
action: actionItem.action action: actionItem.action
}) })
...@@ -221,8 +223,6 @@ const DataTable = props => { ...@@ -221,8 +223,6 @@ const DataTable = props => {
return <FileView value={row[`${item.fieldType}-${item.fieldName}`]} {...schema} />; return <FileView value={row[`${item.fieldType}-${item.fieldName}`]} {...schema} />;
}, },
}); });
} else if (item.fieldType === '台账' && item.fieldName === '反馈状态') {
//统一最后一行添加
} else { } else {
const dataIndex = !isGIS ? item.fieldName : `${item.fieldType}-${item.fieldName}`; const dataIndex = !isGIS ? item.fieldName : `${item.fieldType}-${item.fieldName}`;
...@@ -316,7 +316,21 @@ const DataTable = props => { ...@@ -316,7 +316,21 @@ const DataTable = props => {
const columns = getColumns(); const columns = getColumns();
useEffect(() => { useEffect(() => {
const list = [...dataSource];
eventEmitter.on(addons?.dataPath , (res) => { 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);
}
})
} else {
if(list.some(v=> v['gis-GIS编号'] === res['gis-GIS编号'])) return;
list.push(res);
}
setVisible(false); setVisible(false);
res.forEach((item , index) => { res.forEach((item , index) => {
......
...@@ -149,7 +149,7 @@ const OptionRender = (props) => { ...@@ -149,7 +149,7 @@ const OptionRender = (props) => {
<Space> <Space>
<Switch checkedChildren="开启" <Switch checkedChildren="开启"
unCheckedChildren="关闭" unCheckedChildren="关闭"
value={r} checked={r}
onChange={(e) => inputChange(e, i , "isMapped" , _)} onChange={(e) => inputChange(e, i , "isMapped" , _)}
/> />
{ {
...@@ -226,12 +226,12 @@ const OptionRender = (props) => { ...@@ -226,12 +226,12 @@ const OptionRender = (props) => {
value: "update" value: "update"
}, },
{ {
label: "跳转", label: "自定义事件",
value: "href" value: "selfEvent"
} }
]} value={r} ]} value={r}
style={{ style={{
width: 80 width: 100
}} }}
onChange={(e) => inputChange(e, i, "action")} /> onChange={(e) => inputChange(e, i, "action")} />
</Fragment> </Fragment>
......
...@@ -192,7 +192,7 @@ const StatusOption = (props) => { ...@@ -192,7 +192,7 @@ const StatusOption = (props) => {
<Space> <Space>
<Switch checkedChildren="开启" <Switch checkedChildren="开启"
unCheckedChildren="关闭" unCheckedChildren="关闭"
value={r} checked={r}
onChange={(e) => inputChange(e, i , "isMapped" , _)} onChange={(e) => inputChange(e, i , "isMapped" , _)}
/> />
{ {
......
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