Commit 324a8005 authored by 皮倩雯's avatar 皮倩雯

fix: '优化流程节点配置界面'

parent be33879e
Pipeline #63624 passed with stages
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -471,35 +471,41 @@ const AddModal = props => {
}
};
const getData =()=>{
const getData = () => {
let last = [];
let aa = []; // 固定分组数据
keepTree.map((i,j)=>{
if(i=='工单编号'||i=='事件编号'){
aa.push(i)
}else{
let kk ={}
kk.name = i
kk.ID = j+1
last.push(kk)
}
})
let bb ={}// 固定分组对象
bb.name='固定分组';
bb.ID=0;
bb.children=aa;
console.log(bb);
let cc = [];
cc.push(bb)
console.log(cc.concat(last))
if(aa.length>0){
setFeildValue(cc.concat(last));
}else{
let aa = ['工单编号','事件编号']; // 固定分组数据
let kk = []
keepTree.map((i, j) => {
if (i != '工单编号' && i != '事件编号') {
// let kk = {};
// kk.name = i;
// kk.ID = j + 1;
// last.push(kk);
kk.push(i);
}
});
let bb = {}; // 内置字段对象
bb.name = '内置字段';
bb.ID = 0;
bb.children = aa;
last.push(bb)
let dd ={}; // 附加字段对象
dd.name = '附加字段';
dd.ID = 1;
dd.children = kk;
last.push(dd)
setFeildValue(last);
}
// 编辑时过滤下拉框初始数据
}
// let cc = [];
// cc.push(bb);
// console.log(cc.concat(last));
// if (aa.length > 0) {
// setFeildValue(cc.concat(last));
// } else {
// setFeildValue(last);
// }
// 编辑时过滤下拉框初始数据
};
useEffect(() => {
if (isVisible) {
......@@ -1107,12 +1113,12 @@ const AddModal = props => {
});
};
const seach = e =>{
const seach = e => {
let rueslt = keepStandingBook.find(i => i.name == e);
getMapFelidValue(rueslt.tableName);
formAdd.resetFields();
form.setFieldsValue({workOrder:'',eventOrder:''})
}
form.setFieldsValue({ workOrder: '', eventOrder: '' });
};
const handleChange = value => {
form.setFieldsValue({ schemename: value });
......@@ -1438,7 +1444,7 @@ const AddModal = props => {
const onSelect = (i, e) => {
console.log(i);
console.log(e);
setMapFeildValue([])
setMapFeildValue([]);
if (e.node.org.storeType && e.node.org.storeType == 'datetime') {
setCharacteristics1([
{
......@@ -2675,7 +2681,7 @@ const AddModal = props => {
eventOrder: '',
configName: '',
});
setVisibleChecked(true);
// setVisibleChecked(true);
setCse('');
setPopeleShape('');
setRadio(0);
......@@ -3407,7 +3413,11 @@ const AddModal = props => {
labelCol={{ span: 4 }}
rules={[{ required: true, message: '请选择台账名' }]}
>
<Select showSearch onChange={e=>seach(e)}>
<Select
placeholder="请选择台账名"
showSearch
onChange={e => seach(e)}
>
{keepStandingBook
? keepStandingBook.map((item, index) => (
<Option key={index} value={item.name}>
......@@ -3443,20 +3453,6 @@ const AddModal = props => {
rules={[{ required: true, message: '请输入字段名' }]}
style={{ marginBottom: 0 }}
>
{/* <Input placeholder="请输入字段名" style={{width:'208px'}}/> */}
{/* <Select
placeholder="选择字段名"
showSearch
style={{ width: '208px' }}
>
{fieldValue
? fieldValue.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select> */}
<TreeSelect
showSearch
style={{ width: '208px' }}
......@@ -3554,19 +3550,6 @@ const AddModal = props => {
},
]}
>
{/* <Select
placeholder="选择字段名"
showSearch
style={{ width: '208px', marginLeft: '98px' }}
>
{fieldValue
? fieldValue.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select> */}
<TreeSelect
showSearch
style={{ width: '208px', marginLeft: '98px' }}
......
......@@ -717,7 +717,48 @@ const AddModal = props => {
</Item>
</Col>
<Col span={24}>
<Item label="SQL过滤" name="filterCondition" labelCol={{ span: 5 }}>
<Item
label="SQL过滤"
name="filterCondition"
labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldsValue().filterCondition;
if (aa) {
let bb = [];
bb.push(aa.indexOf('+') != -1);
bb.push(aa.indexOf('=') != -1);
bb.push(aa.indexOf('-') != -1);
bb.push(aa.indexOf('*') != -1);
bb.push(aa.indexOf('/') != -1);
bb.push(aa.indexOf('>') != -1);
bb.push(aa.indexOf('<') != -1);
bb.push(aa.indexOf('!=') != -1);
bb.push(aa.indexOf('<=') != -1);
bb.push(aa.indexOf('>-') != -1);
// console.log(bb);
let re = /[`~,.<>;:”“‘’\/\[\]\、{}()_@$%^,。;?]/;
console.log(re.test(aa));
if (aa.substring(0, 3) !== 'and' && aa.substring(0, 3) !== 'AND') {
return Promise.reject('请以and开头');
}
if (bb.indexOf(true) == -1) {
return Promise.reject(
'支持英文模式下运算符(+、-、*、/、>、<、=、!=、<=、>=)',
);
}
if (re.test(aa)) {
return Promise.reject('禁止输入特殊字符');
}
return Promise.resolve();
}
return Promise.resolve();
},
},
]}
>
<TextArea placeholder="例如:and 泵房品牌='熊猫'" />
</Item>
</Col>
......
......@@ -563,10 +563,7 @@ const AddModal = props => {
setKeepData(keep);
formAdd.resetFields();
}
console.log(e);
console.log(keepAllData);
let aa = keepAllData.find(i => i.name === e);
console.log(aa);
if (aa) {
getReloadTableField(aa.tableName, i); // 找到关联事件对应事件表获取对应表的所有字段
}
......
import React, { useEffect, useState } from 'react';
import { useHistory } from 'react-router-dom';
import { reloadFlowNodes, removeFlowNodeExtend } from '@/services/flow/flow';
import { Space, Table, Popconfirm, Tooltip, notification, message, Button, Spin } from 'antd';
import { Space, Table, Popconfirm, Tooltip, notification, message, Button, Spin, Tag } from 'antd';
import { RollbackOutlined, EditTwoTone, ControlOutlined, DeleteOutlined } from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer';
import NodeEdit from './flowNodeComponents/NodeEdit';
import AuxiliaryView from './flowNodeComponents/AuxiliaryView';
import styles from './flowNode.less';
import start from '@/assets/images/icons/开始节点.png';
import end from '@/assets/images/icons/结束节点.png';
const FlowNode = () => {
const history = useHistory();
......@@ -98,16 +100,58 @@ const FlowNode = () => {
ellipsis: {
showTitle: true,
},
render: (text, record) => (
render: (text, record) => {
console.log(record);
if (record.type == 1) {
return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
<img
src={start}
style={{ height: '18px', marginTop: '2px', marginRight: '5px' }}
alt=""
/>
<div
style={{
textAlign: 'center',
color: record.colorType === 2 ? 'red' : '#000000D9',
}}
>
{text}
</div>
),
</div>
);
}
if (record.type == 2) {
return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
<img
src={end}
style={{ height: '18px', marginTop: '2px', marginRight: '5px' }}
alt=""
/>
<div
style={{
color: record.colorType === 2 ? 'red' : '#000000D9',
}}
>
{text}
</div>
</div>
);
}
if (record.type == 0) {
return (
<div
style={{
display: 'flex',
justifyContent: 'center',
color: record.colorType === 2 ? 'red' : '#000000D9',
}}
>
{text}
</div>
);
}
},
},
{
title: '节点别名',
......@@ -194,18 +238,34 @@ const FlowNode = () => {
dataIndex: 'extendEditableLater',
align: 'center',
width: 80,
render: (text, record) => (
<span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>{text}</span>
),
render: (text, record) => {
if (record.colorType === 2) {
return <span style={{ color: 'red' }}>{text}</span>;
}
if (text == '是') {
return <Tag color="success">{text}</Tag>;
}
if (text == '否') {
return <Tag color="processing">{text}</Tag>;
}
},
},
{
title: '可退',
dataIndex: 'extendRollbackable',
align: 'center',
width: 80,
render: (text, record) => (
<span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>{text}</span>
),
render: (text, record) => {
if (record.colorType === 2) {
return <span style={{ color: 'red' }}>{text}</span>;
}
if (text == '是') {
return <Tag color="success">{text}</Tag>;
}
if (text == '否') {
return <Tag color="processing">{text}</Tag>;
}
},
},
// {
// title: '退至',
......@@ -226,9 +286,17 @@ const FlowNode = () => {
dataIndex: 'tranferable',
align: 'center',
width: 80,
render: (text, record) => (
<span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>{text}</span>
),
render: (text, record) => {
if (record.colorType === 2) {
return <span style={{ color: 'red' }}>{text}</span>;
}
if (text == '是') {
return <Tag color="success">{text}</Tag>;
}
if (text == '否') {
return <Tag color="processing">{text}</Tag>;
}
},
},
// {
// title: '显示事件信息',
......
......@@ -38,10 +38,10 @@ const NodeEdit = props => {
const [isDisable, setIsDisable] = useState(); // 允许回退是否可选择
const [filedData, setFiledData] = useState([]); // 已选字段列表
const [filedList, setFiledList] = useState([]); // 当前选择表的所有字段
const [visibleChecked, setVisibleChecked] = useState(false);
const [visibleChecked1, setVisibleChecked1] = useState(false);
const [visibleChecked2, setVisibleChecked2] = useState(true);
const [visibleChecked3, setVisibleChecked3] = useState(false);
const [visibleChecked, setVisibleChecked] = useState('');
const [visibleChecked1, setVisibleChecked1] = useState('');
const [visibleChecked2, setVisibleChecked2] = useState('');
const [visibleChecked3, setVisibleChecked3] = useState('');
const [autoClose, setAutoClose] = useState(false);
const [transfer, setTransfer] = useState(false);
......@@ -374,6 +374,7 @@ const NodeEdit = props => {
console.log(e);
setVisibleChecked3(e);
};
return (
<Drawer
title="流程节点配置"
......@@ -482,7 +483,23 @@ const NodeEdit = props => {
<Option value={2}>一人接收,一人办理</Option>
</Select>
</Form.Item> */}
<Form.Item label="转办" name="Transferable">
<Form.Item
label={
<div style={{ display: 'flex', alignItems: 'center' }}>
{transfer ? (
<>
<Tooltip title="开始节点不允许转单">
<InfoCircleOutlined style={{ color: '#1890ff', marginRight: '3px' }} />
</Tooltip>
<span>转单</span>
</>
) : (
<span>转单</span>
)}
</div>
}
name="Transferable"
>
<Switch
checkedChildren="是"
unCheckedChildren="否"
......@@ -490,10 +507,32 @@ const NodeEdit = props => {
onChange={change}
disabled={transfer}
/>
{/* <Radio.Group>
<Radio value="0">否</Radio>
<Radio value="1">是</Radio>
</Radio.Group> */}
</Form.Item>
<Form.Item
label={
<div style={{ display: 'flex', alignItems: 'center' }}>
{autoClose == false ? (
<>
<Tooltip title="结束节点可配置自动关单">
<InfoCircleOutlined style={{ color: '#1890ff', marginRight: '3px' }} />
</Tooltip>
<span>自动关单</span>
</>
) : (
<span>自动关单</span>
)}
</div>
}
name="AutoClose"
>
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={visibleChecked3}
onChange={change3}
disabled={!autoClose}
/>
</Form.Item>
<Form.Item label="显示事件信息" name="EventsInformation">
......@@ -520,16 +559,6 @@ const NodeEdit = props => {
<Radio value={1}>是</Radio>
</Radio.Group> */}
</Form.Item>
{autoClose && (
<Form.Item label="自动关单" name="AutoClose">
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={visibleChecked3}
onChange={change3}
/>
</Form.Item>
)}
<Form.Item
label={
......
......@@ -22,7 +22,7 @@ const AddForm = props => {
console.log(nodeObj, 'nodeObj');
const layout = {
layout: 'horizontal',
labelCol: { span: 4, offset: 1 },
labelCol: { span: 5, offset: 1 },
wrapperCol: { span: 16 },
};
const submit = () => {
......@@ -66,7 +66,7 @@ const AddForm = props => {
</Item>
{addType === 1 && (
<Item
label="在线图标"
label="选中图标"
name="imageUrl"
rules={[
{
......@@ -80,7 +80,7 @@ const AddForm = props => {
)}
{addType === 1 && (
<Item
label="离线图标"
label="未选中图标"
name="offlineImgUrl"
rules={[
{
......@@ -143,7 +143,7 @@ const AddForm = props => {
</Item>
{addType === 3 && (
<Item
label="在线图标"
label="选中图标"
name="imageUrl"
rules={[
{
......@@ -157,7 +157,7 @@ const AddForm = props => {
)}
{addType === 3 && (
<Item
label="离线图标"
label="未选中图标"
name="offlineImgUrl"
rules={[
{
......
......@@ -19,7 +19,7 @@ const EditForm = props => {
const layout = {
layout: 'horizontal',
labelCol: { span: 2, offset: 0 },
wrapperCol: { span: 20 },
wrapperCol: { span: 21 },
};
// 回显表单
useEffect(() => {
......@@ -28,7 +28,6 @@ const EditForm = props => {
setPlainOptions(inf);
}, [info]);
useEffect(() => {
console.log(info);
if (nodeType === 1 || nodeType === 2) {
let arr = Object.keys(form.getFieldsValue());
let obj = {};
......@@ -91,14 +90,10 @@ const EditForm = props => {
const submit = () => {
if (nodeType === 1 || nodeType === 2) {
let obj = form.getFieldsValue();
console.log(obj, '1,2');
submitCallback(obj);
}
if (nodeType === 3 || nodeType === 4) {
let obj = otherForm.getFieldsValue();
console.log(obj, '3,4');
console.log(obj);
console.log(plainOptions);
let data = [];
plainOptions.map(item => {
item.checkedList.forEach(i => {
......@@ -118,7 +113,6 @@ const EditForm = props => {
};
// 添加功能路劲参数
const addParama = () => {
console.log(otherForm.getFieldValue('pageUrl'));
if (!otherForm.getFieldValue('pageUrl')) {
notification.error({ message: '提示', duration: 3, description: '请先填写功能路径' });
return;
......@@ -265,7 +259,7 @@ const EditForm = props => {
return (
<div className={classnames({ [styles.divbox]: true })}>
{(nodeType === 1 || nodeType === 2) && (
<Form form={form} name="editGroup" onFinish={onFinish}>
<Form form={form} name="editGroup" onFinish={onFinish} {...layout}>
<Item
label="菜单组名称"
name="menuName"
......@@ -278,13 +272,12 @@ const EditForm = props => {
>
<Input placeholder="请输入菜单组名称" style={{ width: '100%' }} />
</Item>
<Item label="菜单组别名" name="shortName" style={{ marginLeft: '11px' }}>
<Item label="菜单组别名" name="shortName">
<Input placeholder="请输入菜单组别名" style={{ width: '100%' }} />
</Item>
{nodeType === 1 && (
<Item
style={{ marginLeft: '14px' }}
label="在线图标"
label="选中图标"
name="imageUrl"
rules={[
{
......@@ -298,8 +291,7 @@ const EditForm = props => {
)}
{nodeType === 1 && (
<Item
style={{ marginLeft: '14px' }}
label="离线图标"
label="未选中图标"
name="offlineImgUrl"
rules={[
{
......@@ -326,7 +318,7 @@ const EditForm = props => {
<PicturesWall picType="androidMenu" style={{ width: '100%' }} />
</Item>
)}
<Item label="功能参数" name="funParam" style={{ marginLeft: '26px' }}>
<Item label="功能参数" name="funParam">
<Input style={{ width: '100%' }} />
</Item>
<Item wrapperCol={{ offset: 10 }} style={{ marginTop: '40px' }}>
......@@ -338,7 +330,7 @@ const EditForm = props => {
)}
{(nodeType === 3 || nodeType === 4) && (
<Form form={otherForm} name="editMenu" onFinish={onFinish}>
<Form form={otherForm} name="editMenu" onFinish={onFinish} {...layout}>
<Item
label="菜单名称"
name="menuName"
......@@ -351,12 +343,12 @@ const EditForm = props => {
>
<Input style={{ width: '100%' }} />
</Item>
<Item label="菜单别名" name="shortName" style={{ marginLeft: '11px' }}>
<Item label="菜单别名" name="shortName">
<Input style={{ width: '100%' }} />
</Item>
{nodeType === 3 && (
<Item
label="在线图标"
label="选中图标"
name="imageUrl"
rules={[
{
......@@ -370,7 +362,7 @@ const EditForm = props => {
)}
{nodeType === 3 && (
<Item
label="离线图标"
label="未选中图标"
name="offlineImgUrl"
rules={[
{
......@@ -413,7 +405,7 @@ const EditForm = props => {
<Button onClick={addParama}>参数管理</Button>
</div>
</Item>
<Item label="功能参数" name="funParam" style={{ marginLeft: '11px' }}>
<Item label="功能参数" name="funParam">
<Input style={{ width: '100%' }} />
</Item>
{/* <CheckList
......@@ -437,8 +429,7 @@ const EditForm = props => {
</Checkbox>
</div>
{plainOptions && plainOptions.length > 0 ? (
plainOptions.map((item, index) => {
return (
plainOptions.map((item, index) => (
<div
className={classnames({
[styles.divBox]: item.groupName.length > 0,
......@@ -465,8 +456,7 @@ const EditForm = props => {
{item.groupName.length == 0 ? (
<>
<Row>
{item.list.map((val, i) => {
return (
{item.list.map((val, i) => (
<Col span={4} style={{ marginBottom: '10px' }}>
<Checkbox
onChange={e => {
......@@ -477,15 +467,13 @@ const EditForm = props => {
{val.relatedRoleName}
</Checkbox>
</Col>
);
})}
))}
</Row>
</>
) : (
<>
<Row>
{item.list.map((val, i) => {
return (
{item.list.map((val, i) => (
<Col span={4}>
<Checkbox
onChange={e => {
......@@ -496,15 +484,13 @@ const EditForm = props => {
{val.relatedRoleName}
</Checkbox>
</Col>
);
})}
))}
</Row>
</>
)}
</div>
</div>
);
})
))
) : (
<span />
)}
......
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