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

修改表格配置项

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