Commit b50d73dd authored by 邓超's avatar 邓超

fix: 流程模块添加外部字段交互,修复web移动配置动态添加url bug

parent 05fd8036
Pipeline #42075 passed with stages
in 6 minutes 46 seconds
...@@ -25,10 +25,14 @@ const ParmarModal = props => { ...@@ -25,10 +25,14 @@ const ParmarModal = props => {
if (validate) { if (validate) {
let parma = form let parma = form
.getFieldValue('parmars') .getFieldValue('parmars')
.map(item => `${item.key}=${item.value}`) ?.map(item => `${item.key}=${item.value}`)
.join('&'); .join('&');
console.log(parma, 'parma'); console.log(parma, 'parma');
parmarCallBack(`${pageUrl.split('?')[0]}?${parma}`); if (parma) {
parmarCallBack(`${pageUrl.split('?')[0]}?${parma}`);
} else {
parmarCallBack(`${pageUrl.split('?')[0]}`);
}
} }
}); });
}; };
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { import { message, notification, Tooltip, Modal, Input, Button, Spin, Empty } from 'antd';
message,
notification,
Tooltip,
Modal,
Input,
Button,
Spin,
Empty,
} from 'antd';
import { import {
FileAddTwoTone, FileAddTwoTone,
FolderAddTwoTone, FolderAddTwoTone,
...@@ -142,8 +133,7 @@ const MiniMenu = props => { ...@@ -142,8 +133,7 @@ const MiniMenu = props => {
), ),
key: obj.menuID, key: obj.menuID,
icon: icon:
obj.menuType !== 'MiniAppMenuThree' && obj.menuType !== 'MiniAppMenuThree' && obj.menuType !== 'MiniAppMenu' ? (
obj.menuType !== 'MiniAppMenu' ? (
<FolderFilled /> <FolderFilled />
) : ( ) : (
<FileOutlined /> <FileOutlined />
...@@ -397,8 +387,7 @@ const MiniMenu = props => { ...@@ -397,8 +387,7 @@ const MiniMenu = props => {
const dropKey = infos.node.key; const dropKey = infos.node.key;
const dragKey = infos.dragNode.key; const dragKey = infos.dragNode.key;
const dropPos = infos.node.pos.split('-'); const dropPos = infos.node.pos.split('-');
const dropPosition = const dropPosition = infos.dropPosition - Number(dropPos[dropPos.length - 1]);
infos.dropPosition - Number(dropPos[dropPos.length - 1]);
const data = JSON.parse(JSON.stringify(treeData)); const data = JSON.parse(JSON.stringify(treeData));
// 找到拖拽的元素 // 找到拖拽的元素
let dragObj; let dragObj;
...@@ -420,8 +409,7 @@ const MiniMenu = props => { ...@@ -420,8 +409,7 @@ const MiniMenu = props => {
// console.log(dropPos, 'dropPosition'); // console.log(dropPos, 'dropPosition');
// 拖拽到的位置不能在菜单下面 // 拖拽到的位置不能在菜单下面
if ( if (
(dropObj.menuType === 'MiniAppMenuThree' || (dropObj.menuType === 'MiniAppMenuThree' || dropObj.menuType === 'MiniAppMenu') &&
dropObj.menuType === 'MiniAppMenu') &&
!infos.dropToGap !infos.dropToGap
) { ) {
return; return;
...@@ -433,24 +421,21 @@ const MiniMenu = props => { ...@@ -433,24 +421,21 @@ const MiniMenu = props => {
// 菜单不能拖拽到跟一级菜单组下 // 菜单不能拖拽到跟一级菜单组下
if ( if (
dropObj.menuType === 'MiniAppMenuGroup' && dropObj.menuType === 'MiniAppMenuGroup' &&
(dragObj.menuType === 'MiniAppMenuThree' || (dragObj.menuType === 'MiniAppMenuThree' || dragObj.menuType === 'MiniAppMenu')
dragObj.menuType === 'MiniAppMenu')
) { ) {
return; return;
} }
// 一级菜单组只能在一级菜单组平级拖拽 // 一级菜单组只能在一级菜单组平级拖拽
if ( if (
dragObj.menuType === 'MiniAppMenuGroup' && dragObj.menuType === 'MiniAppMenuGroup' &&
(dropObj.menuType === 'MiniAppMenuGroup' || (dropObj.menuType === 'MiniAppMenuGroup' || dropObj.menuType === 'MiniAppMenuGroupTwo')
dropObj.menuType === 'MiniAppMenuGroupTwo')
) { ) {
return; return;
} }
// 二级菜单组只能在一级的菜单组下面 // 二级菜单组只能在一级的菜单组下面
if ( if (
dragObj.menuType === 'MiniAppMenuGroupTwo' && dragObj.menuType === 'MiniAppMenuGroupTwo' &&
(dropObj.menuType === 'MiniAppMenuGroupTwo' || (dropObj.menuType === 'MiniAppMenuGroupTwo' || dropObj.menuType === 'MiniAppMenu')
dropObj.menuType === 'MiniAppMenu')
) { ) {
return; return;
} }
...@@ -463,16 +448,14 @@ const MiniMenu = props => { ...@@ -463,16 +448,14 @@ const MiniMenu = props => {
// 菜单不能拖拽到跟一级菜单组下 // 菜单不能拖拽到跟一级菜单组下
if ( if (
dropObj.menuType === 'MiniAppMenuGroupTwo' && dropObj.menuType === 'MiniAppMenuGroupTwo' &&
(dragObj.menuType === 'MiniAppMenuThree' || (dragObj.menuType === 'MiniAppMenuThree' || dragObj.menuType === 'MiniAppMenu')
dragObj.menuType === 'MiniAppMenu')
) { ) {
return; return;
} }
// 一级菜单组只能在一级菜单组平级拖拽 // 一级菜单组只能在一级菜单组平级拖拽
if ( if (
dragObj.menuType === 'MiniAppMenuGroup' && dragObj.menuType === 'MiniAppMenuGroup' &&
(dropObj.menuType === 'MiniAppMenuGroupTwo' || (dropObj.menuType === 'MiniAppMenuGroupTwo' || dropObj.menuType === 'MiniAppMenuThree')
dropObj.menuType === 'MiniAppMenuThree')
) { ) {
return; return;
} }
...@@ -594,10 +577,7 @@ const MiniMenu = props => { ...@@ -594,10 +577,7 @@ const MiniMenu = props => {
/> />
</div> </div>
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无菜单" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂无菜单"
/>
)} )}
</div> </div>
<Modal <Modal
...@@ -695,10 +675,7 @@ const MiniMenu = props => { ...@@ -695,10 +675,7 @@ const MiniMenu = props => {
</div> */} </div> */}
</div> </div>
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="当前未选中菜单" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="当前未选中菜单"
/>
)} )}
</div> </div>
</div> </div>
......
...@@ -111,13 +111,20 @@ const FlowNode = () => { ...@@ -111,13 +111,20 @@ const FlowNode = () => {
dataIndex: 'aliasName', dataIndex: 'aliasName',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => <span>{text}</span>, ellipsis: {
showTitle: true,
},
render: (text, record) => (
<Tooltip placement="topLeft" title={text}>
<span style={{ color: textStyleOne(text, record) }}>{text}</span>
</Tooltip>
),
}, },
{ {
title: '移交方式', title: '移交方式',
dataIndex: 'extendHandover', dataIndex: 'extendHandover',
align: 'center', align: 'center',
width: 80, width: 100,
render: (text, record) => <span style={{ color: textStyleOne(text, record) }}>{text}</span>, render: (text, record) => <span style={{ color: textStyleOne(text, record) }}>{text}</span>,
}, },
{ {
...@@ -308,7 +315,7 @@ const FlowNode = () => { ...@@ -308,7 +315,7 @@ const FlowNode = () => {
{ {
title: '移交方式', title: '移交方式',
align: 'center', align: 'center',
width: 80, width: 100,
}, },
{ {
title: '节点类型', title: '节点类型',
......
...@@ -36,6 +36,8 @@ const NodeEdit = props => { ...@@ -36,6 +36,8 @@ const NodeEdit = props => {
const [eventTable, setEventTable] = useState([]); // 表名 const [eventTable, setEventTable] = useState([]); // 表名
const [isDisable, setIsDisable] = useState(); // 允许回退是否可选择 const [isDisable, setIsDisable] = useState(); // 允许回退是否可选择
const [filedData, setFiledData] = useState([]); // 已选字段列表 const [filedData, setFiledData] = useState([]); // 已选字段列表
const [filedList, setFiledList] = useState([]); // 当前选择表的所有字段
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
...@@ -64,6 +66,7 @@ const NodeEdit = props => { ...@@ -64,6 +66,7 @@ const NodeEdit = props => {
} else { } else {
setIsDisable(true); setIsDisable(true);
} }
changTable(obj.TableName);
form.setFieldsValue(obj); form.setFieldsValue(obj);
} }
}); });
...@@ -183,6 +186,7 @@ const NodeEdit = props => { ...@@ -183,6 +186,7 @@ const NodeEdit = props => {
let obj = {}; let obj = {};
obj[fieldName] = Fields; obj[fieldName] = Fields;
form.setFieldsValue(obj); form.setFieldsValue(obj);
saveOutFieldsLength(fieldName, filedList);
setShowField(false); setShowField(false);
}; };
// 提交表单 // 提交表单
...@@ -226,6 +230,55 @@ const NodeEdit = props => { ...@@ -226,6 +230,55 @@ const NodeEdit = props => {
} }
} }
}; };
// 表切换
const changTable = val => {
loadEventFields({ eventTableName: val }).then(res => {
if (res.code === 0) {
let initList = [];
res.data.forEach(item => {
item.root.forEach(ele => {
initList.push(ele.fieldName);
});
});
// 处理外部字段
Object.keys(form.getFieldsValue()).forEach(key => {
saveOutFieldsLength(key, initList);
});
setFiledList(initList);
}
});
};
// 保存外部字段个数
const saveOutFieldsLength = (key, initList) => {
switch (key) {
case 'Fields':
form.setFieldsValue({ OutFields: dealExternal(key, initList) });
break;
case 'SeeFields':
form.setFieldsValue({ OutSeeFields: dealExternal(key, initList) });
break;
default:
break;
}
};
// 处理外部字段
const dealExternal = (fileds, list) => {
let isExternal;
let externalLength = 0;
if (form.getFieldValue(fileds)) {
form
.getFieldValue(fileds)
.split(',')
.forEach(item => {
isExternal = list.some(val => val === item);
if (!isExternal && item !== '') {
// eslint-disable-next-line no-plusplus
externalLength++;
}
});
}
return externalLength;
};
return ( return (
<Drawer <Drawer
title="流程节点配置" title="流程节点配置"
...@@ -317,7 +370,7 @@ const NodeEdit = props => { ...@@ -317,7 +370,7 @@ const NodeEdit = props => {
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item label="工单主表" name="TableName"> <Form.Item label="工单主表" name="TableName">
<Select placeholder="请选择工单主表"> <Select placeholder="请选择工单主表" onChange={changTable}>
{eventTable.map(item => ( {eventTable.map(item => (
<Option value={item.Name} key={item.ID}> <Option value={item.Name} key={item.ID}>
{item.Name} {item.Name}
...@@ -328,7 +381,7 @@ const NodeEdit = props => { ...@@ -328,7 +381,7 @@ const NodeEdit = props => {
<Form.Item <Form.Item
label={ label={
<div className={styles.formData_label}> <div className={styles.formData_label}>
{form.getFieldValue('OutFields') > 0 ? ( {form.getFieldValue('OutFields') ? (
<Tooltip title={`外部字段${form.getFieldValue('OutFields')}个`}> <Tooltip title={`外部字段${form.getFieldValue('OutFields')}个`}>
<InfoCircleOutlined style={{ color: 'red', padding: '0.2rem 0.2rem 0 0' }} /> <InfoCircleOutlined style={{ color: 'red', padding: '0.2rem 0.2rem 0 0' }} />
</Tooltip> </Tooltip>
...@@ -355,8 +408,8 @@ const NodeEdit = props => { ...@@ -355,8 +408,8 @@ const NodeEdit = props => {
<Form.Item <Form.Item
label={ label={
<div className={styles.formData_label}> <div className={styles.formData_label}>
{form.getFieldValue('OutSearchFields') > 0 ? ( {form.getFieldValue('OutSeeFields') ? (
<Tooltip title={`外部字段${form.getFieldValue('OutSearchFields')}个`}> <Tooltip title={`外部字段${form.getFieldValue('OutSeeFields')}个`}>
<InfoCircleOutlined style={{ color: 'red', padding: '0.2rem 0.2rem 0 0' }} /> <InfoCircleOutlined style={{ color: 'red', padding: '0.2rem 0.2rem 0 0' }} />
</Tooltip> </Tooltip>
) : ( ) : (
......
...@@ -10,13 +10,7 @@ import styles from './incident.less'; ...@@ -10,13 +10,7 @@ import styles from './incident.less';
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const { TabPane } = Tabs; const { TabPane } = Tabs;
const ChangeAddFlows = props => { const ChangeAddFlows = props => {
const { const { callBackSubmit = () => {}, pickItem, visible, filed11, newCheckedList } = props;
callBackSubmit = () => {},
pickItem,
visible,
filed11,
newCheckedList,
} = props;
const [value, setValue] = useState(''); const [value, setValue] = useState('');
const [checkValue, setCheckValue] = useState([]); const [checkValue, setCheckValue] = useState([]);
const [title, setTitle] = useState([]); const [title, setTitle] = useState([]);
...@@ -500,11 +494,7 @@ const ChangeAddFlows = props => { ...@@ -500,11 +494,7 @@ const ChangeAddFlows = props => {
<div className={styles.listCard1}> <div className={styles.listCard1}>
<div className={styles.cardItem1}> <div className={styles.cardItem1}>
<div className={styles.cardContent1}> <div className={styles.cardContent1}>
<Tabs <Tabs activeKey={keyValue} className={styles.tab} onChange={handleParChange}>
activeKey={keyValue}
className={styles.tab}
onChange={handleParChange}
>
<TabPane tab="角色" key="0"> <TabPane tab="角色" key="0">
<div className={styles.cardItemData1}> <div className={styles.cardItemData1}>
{emptyValue == 0 ? ( {emptyValue == 0 ? (
...@@ -514,10 +504,7 @@ const ChangeAddFlows = props => { ...@@ -514,10 +504,7 @@ const ChangeAddFlows = props => {
onChange={onChangeListNew} onChange={onChangeListNew}
/> />
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂无数据"
/>
)} )}
</div> </div>
</TabPane> </TabPane>
...@@ -530,10 +517,7 @@ const ChangeAddFlows = props => { ...@@ -530,10 +517,7 @@ const ChangeAddFlows = props => {
onChange={onChangeListNew1} onChange={onChangeListNew1}
/> />
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂无数据"
/>
)} )}
</div> </div>
</TabPane> </TabPane>
...@@ -546,10 +530,7 @@ const ChangeAddFlows = props => { ...@@ -546,10 +530,7 @@ const ChangeAddFlows = props => {
onChange={onChangeListNew2} onChange={onChangeListNew2}
/> />
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂无数据"
/>
)} )}
</div> </div>
</TabPane> </TabPane>
......
...@@ -22,14 +22,7 @@ import styles from './incident.less'; ...@@ -22,14 +22,7 @@ import styles from './incident.less';
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const { TabPane } = Tabs; const { TabPane } = Tabs;
const ChangeAdd = props => { const ChangeAdd = props => {
const { const { callBackSubmit = () => {}, isType, pickItem, visible, filed11, newCheckedList } = props;
callBackSubmit = () => {},
isType,
pickItem,
visible,
filed11,
newCheckedList,
} = props;
const [title, setTitle] = useState([]); const [title, setTitle] = useState([]);
const [checkedList, setCheckedList] = useState([]); // 选中复选框内容 const [checkedList, setCheckedList] = useState([]); // 选中复选框内容
const [searchWord, setSearchWord] = useState(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
...@@ -464,11 +457,7 @@ const ChangeAdd = props => { ...@@ -464,11 +457,7 @@ const ChangeAdd = props => {
<div className={styles.listCard1}> <div className={styles.listCard1}>
<div className={styles.cardItem1}> <div className={styles.cardItem1}>
<div className={styles.cardContent1}> <div className={styles.cardContent1}>
<Tabs <Tabs activeKey={keyValue} className={styles.tab} onChange={handleParChange}>
activeKey={keyValue}
className={styles.tab}
onChange={handleParChange}
>
<TabPane tab="角色" key="0"> <TabPane tab="角色" key="0">
<div className={styles.cardItemData1}> <div className={styles.cardItemData1}>
{emptyValue == 0 ? ( {emptyValue == 0 ? (
...@@ -478,10 +467,7 @@ const ChangeAdd = props => { ...@@ -478,10 +467,7 @@ const ChangeAdd = props => {
onChange={onChangeListNew} onChange={onChangeListNew}
/> />
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂无数据"
/>
)} )}
</div> </div>
</TabPane> </TabPane>
...@@ -494,10 +480,7 @@ const ChangeAdd = props => { ...@@ -494,10 +480,7 @@ const ChangeAdd = props => {
onChange={onChangeListNew1} onChange={onChangeListNew1}
/> />
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂无数据"
/>
)} )}
</div> </div>
</TabPane> </TabPane>
...@@ -510,10 +493,7 @@ const ChangeAdd = props => { ...@@ -510,10 +493,7 @@ const ChangeAdd = props => {
onChange={onChangeListNew2} onChange={onChangeListNew2}
/> />
) : ( ) : (
<Empty <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂无数据"
/>
)} )}
</div> </div>
</TabPane> </TabPane>
...@@ -522,11 +502,7 @@ const ChangeAdd = props => { ...@@ -522,11 +502,7 @@ const ChangeAdd = props => {
</div> </div>
<div className={styles.cardItem11}> <div className={styles.cardItem11}>
<div className={styles.cardContent1}> <div className={styles.cardContent1}>
<Tabs <Tabs className={styles.tab} activeKey={keyValue} onChange={handleParChange}>
className={styles.tab}
activeKey={keyValue}
onChange={handleParChange}
>
<TabPane tab="角色" key="0"> <TabPane tab="角色" key="0">
{checkDataRole.map((item, index) => ( {checkDataRole.map((item, index) => (
<div <div
......
...@@ -192,7 +192,6 @@ const SelectUser = props => { ...@@ -192,7 +192,6 @@ const SelectUser = props => {
// 删除角色 // 删除角色
const deleteRol = key => { const deleteRol = key => {
const dataSource = [...checkList]; const dataSource = [...checkList];
console.log(key, dataSource, 'key');
setCheckList(dataSource.filter(item => item.value !== key)); setCheckList(dataSource.filter(item => item.value !== key));
setDeleKey(key); setDeleKey(key);
setDelFlag(delFlag + 1); setDelFlag(delFlag + 1);
......
...@@ -22,14 +22,16 @@ const ParmarModal = props => { ...@@ -22,14 +22,16 @@ const ParmarModal = props => {
const onFinish = () => { const onFinish = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
console.log(validate, 'validate');
let parma = form let parma = form
.getFieldValue('parmars') .getFieldValue('parmars')
.map(item => `${item.key}=${item.value}`) ?.map(item => `${item.key}=${item.value}`)
.join('&'); .join('&');
console.log(parma, 'parma'); console.log(parma, 'parma');
parmarCallBack(`${pageUrl.split('|')[0]}|${parma}`); if (parma) {
parmarCallBack(`${pageUrl.split('|')[0]}|${parma}`);
} else {
parmarCallBack(`${pageUrl.split('|')[0]}`);
}
} }
}); });
}; };
......
...@@ -90,7 +90,7 @@ const EditForm = props => { ...@@ -90,7 +90,7 @@ const EditForm = props => {
<Item label="菜单别名" name="shortName"> <Item label="菜单别名" name="shortName">
<Input placeholder="请输入菜单别名" /> <Input placeholder="请输入菜单别名" />
</Item> </Item>
<Item label="产品类型" name="product"> <Item label="产品类型" name="product">
<Select placeholder="请选择产品类型" allowClear> <Select placeholder="请选择产品类型" allowClear>
{productList && {productList &&
productList.length > 0 && productList.length > 0 &&
......
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