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