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.
......@@ -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) => (
<div
style={{
textAlign: 'center',
color: record.colorType === 2 ? 'red' : '#000000D9',
}}
>
{text}
</div>
),
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={{
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={[
{
......
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