Commit 5593eff1 authored by 皮倩雯's avatar 皮倩雯

去掉事件工单不用配置,工作流编辑流程名称验证不能重复

parent 60150b72
Pipeline #58744 passed with stages
...@@ -1758,7 +1758,7 @@ const AddModal = props => { ...@@ -1758,7 +1758,7 @@ const AddModal = props => {
<Input placeholder="请输入置顶条件" allowClear /> <Input placeholder="请输入置顶条件" allowClear />
</Item> </Item>
</Col> */} </Col> */}
<Col span={24}> {/* <Col span={24}>
<Item label="上报视图" name="ReportPage" labelCol={{ span: 5 }}> <Item label="上报视图" name="ReportPage" labelCol={{ span: 5 }}>
<Input placeholder="请输入上报视图" allowClear /> <Input placeholder="请输入上报视图" allowClear />
</Item> </Item>
...@@ -1767,7 +1767,7 @@ const AddModal = props => { ...@@ -1767,7 +1767,7 @@ const AddModal = props => {
<Item label="处理视图" name="DealPage" labelCol={{ span: 5 }}> <Item label="处理视图" name="DealPage" labelCol={{ span: 5 }}>
<Input placeholder="请输入处理视图" allowClear /> <Input placeholder="请输入处理视图" allowClear />
</Item> </Item>
</Col> </Col> */}
{/* <Col span={24}> {/* <Col span={24}>
<Item label="关联事件" name="RelatedEvents" labelCol={{ span: 5 }}> <Item label="关联事件" name="RelatedEvents" labelCol={{ span: 5 }}>
...@@ -1858,6 +1858,7 @@ const AddModal = props => { ...@@ -1858,6 +1858,7 @@ const AddModal = props => {
left: '34px', left: '34px',
top: '10px', top: '10px',
color: 'white', color: 'white',
zIndex:'2'
}} }}
/> />
</> </>
......
/* eslint-disable arrow-body-style */
/* eslint-disable no-useless-escape */ /* eslint-disable no-useless-escape */
/* eslint-disable no-lonely-if */ /* eslint-disable no-lonely-if */
/* eslint-disable no-unused-expressions */ /* eslint-disable no-unused-expressions */
...@@ -23,8 +24,6 @@ const PreviewModal = props => { ...@@ -23,8 +24,6 @@ const PreviewModal = props => {
const { Search } = Input; const { Search } = Input;
useEffect(() => { useEffect(() => {
console.log(imageUrl);
console.log(keepImgeUrl);
if (visible) { if (visible) {
setChooseItem(imageUrl); setChooseItem(imageUrl);
update(); update();
...@@ -118,15 +117,10 @@ const PreviewModal = props => { ...@@ -118,15 +117,10 @@ const PreviewModal = props => {
setImgData(bb); setImgData(bb);
resdata.data.map(i => { resdata.data.map(i => {
i.list.map((j, index) => { i.list.map((j, index) => {
console.log(j.value);
console.log(chooseItem);
if (`/${chooseItem}` == j.value) { if (`/${chooseItem}` == j.value) {
setKeepItem(i.text); setKeepItem(i.text);
setPickItem(index); setPickItem(index);
console.log(j.value);
setChooseItem(j.value); setChooseItem(j.value);
console.log(i.text);
console.log(index);
} }
}); });
}); });
......
...@@ -452,7 +452,7 @@ const NodeEdit = props => { ...@@ -452,7 +452,7 @@ const NodeEdit = props => {
/> />
</div> </div>
</Form.Item> */} </Form.Item> */}
<Form.Item label="前端视图" name="WebPage"> {/* <Form.Item label="前端视图" name="WebPage">
<Input placeholder="请配置前端视图" /> <Input placeholder="请配置前端视图" />
</Form.Item> </Form.Item>
<Form.Item label="手持视图" name="MobilePage"> <Form.Item label="手持视图" name="MobilePage">
...@@ -460,7 +460,7 @@ const NodeEdit = props => { ...@@ -460,7 +460,7 @@ const NodeEdit = props => {
</Form.Item> </Form.Item>
<Form.Item label="视图参数" name="PageParam"> <Form.Item label="视图参数" name="PageParam">
<Input placeholder="请配置视图参数" /> <Input placeholder="请配置视图参数" />
</Form.Item> </Form.Item> */}
<Form.Item label="反馈类型" name="FeedbackName"> <Form.Item label="反馈类型" name="FeedbackName">
<Select placeholder="请选择反馈类型" allowClear> <Select placeholder="请选择反馈类型" allowClear>
{backType.map(item => ( {backType.map(item => (
...@@ -470,13 +470,13 @@ const NodeEdit = props => { ...@@ -470,13 +470,13 @@ const NodeEdit = props => {
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item {/* <Form.Item
name="FeedbackToEvent" name="FeedbackToEvent"
valuePropName="checked" valuePropName="checked"
wrapperCol={{ offset: 5, span: 18 }} wrapperCol={{ offset: 5, span: 18 }}
> >
<Checkbox>将反馈信息显示到事件级别</Checkbox> <Checkbox>将反馈信息显示到事件级别</Checkbox>
</Form.Item> </Form.Item> */}
</Form> </Form>
{/* 字段集选择 */} {/* 字段集选择 */}
<Fieldselection <Fieldselection
......
/* eslint-disable prettier/prettier */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { WFGetAllFlow, GetFlowNode, DeleteFlow } from '@/services/workflow/workflow'; import { WFGetAllFlow, GetFlowNode, DeleteFlow } from '@/services/workflow/workflow';
...@@ -20,6 +21,7 @@ import FlowModal from './workFlowComponents/FlowModal'; ...@@ -20,6 +21,7 @@ import FlowModal from './workFlowComponents/FlowModal';
import FlowGroupModal from './workFlowComponents/FlowGroupModal'; import FlowGroupModal from './workFlowComponents/FlowGroupModal';
import styles from './workflow.less'; import styles from './workflow.less';
import { list } from 'postcss';
const { confirm } = Modal; const { confirm } = Modal;
const Workflow = () => { const Workflow = () => {
...@@ -36,6 +38,7 @@ const Workflow = () => { ...@@ -36,6 +38,7 @@ const Workflow = () => {
const [canSelect, setCanSelect] = useState(true); // 是否可以切换树 const [canSelect, setCanSelect] = useState(true); // 是否可以切换树
const [expandedKey, setExpandedKey] = useState(''); // 默认展开项 const [expandedKey, setExpandedKey] = useState(''); // 默认展开项
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
const [keep, setKeep] = useState([])
const [visible, setVisible] = useState({ const [visible, setVisible] = useState({
FlowModal: false, FlowModal: false,
FlowGroupModal: false, FlowGroupModal: false,
...@@ -81,6 +84,16 @@ const Workflow = () => { ...@@ -81,6 +84,16 @@ const Workflow = () => {
setTreeLoading(false); setTreeLoading(false);
if (res.code === 0) { if (res.code === 0) {
setFlag(flag + 1); setFlag(flag + 1);
let listdata =[]
res.data.map(i=>{
if(i.children.length>0){
i.children.map(j=>{
listdata.push(j.FlowName)
})
}
})
console.log(listdata)
setKeep(listdata)
let data = res.data.map(item => { let data = res.data.map(item => {
item.isOld = true; item.isOld = true;
return item; return item;
...@@ -338,6 +351,7 @@ const Workflow = () => { ...@@ -338,6 +351,7 @@ const Workflow = () => {
modalType={modalType} modalType={modalType}
handleCancel={() => showModal('FlowModal', false)} handleCancel={() => showModal('FlowModal', false)}
treeData={treeData} treeData={treeData}
keep={keep}
onSubumit={() => { onSubumit={() => {
showModal('FlowModal', false); showModal('FlowModal', false);
getFlowList(); getFlowList();
...@@ -350,6 +364,7 @@ const Workflow = () => { ...@@ -350,6 +364,7 @@ const Workflow = () => {
modalType={modalType} modalType={modalType}
handleCancel={() => showModal('FlowGroupModal', false)} handleCancel={() => showModal('FlowGroupModal', false)}
treeData={treeData} treeData={treeData}
keep={keep}
onSubumit={val => groupCallBack(val)} onSubumit={val => groupCallBack(val)}
/> />
</PageContainer> </PageContainer>
......
...@@ -3,11 +3,12 @@ import { UpdateFlowGroup } from '@/services/workflow/workflow'; ...@@ -3,11 +3,12 @@ import { UpdateFlowGroup } from '@/services/workflow/workflow';
import { Form, Modal, Input, notification } from 'antd'; import { Form, Modal, Input, notification } from 'antd';
const FlowGroupModal = props => { const FlowGroupModal = props => {
const { onSubumit, handleCancel, visible, msg, modalType, treeData } = props; const { onSubumit, handleCancel, visible, msg, modalType, treeData, keep } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
form.resetFields(); form.resetFields();
if (visible) { if (visible) {
console.log(keep);
if (modalType === 'edit') { if (modalType === 'edit') {
getFormData(); getFormData();
} }
......
...@@ -4,11 +4,13 @@ import { Form, Modal, Input, notification, Select } from 'antd'; ...@@ -4,11 +4,13 @@ import { Form, Modal, Input, notification, Select } from 'antd';
const { Option } = Select; const { Option } = Select;
const FlowModal = props => { const FlowModal = props => {
const { onSubumit, handleCancel, visible, msg, modalType, treeData } = props; const { onSubumit, handleCancel, visible, msg, modalType, treeData, keep } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
form.resetFields(); form.resetFields();
if (visible) { if (visible) {
console.log(keep);
console.log(msg);
if (modalType === 'edit') { if (modalType === 'edit') {
getFormData(); getFormData();
} else { } else {
...@@ -70,7 +72,27 @@ const FlowModal = props => { ...@@ -70,7 +72,27 @@ const FlowModal = props => {
<Form.Item <Form.Item
label="流程名称" label="流程名称"
name="FlowName" name="FlowName"
rules={[{ required: true, message: '请输入流程名称' }]} rules={[
{
required: true,
message: '请输入流程名称',
},
{
validator: (rule, value) => {
let aa = form.getFieldValue().FlowName;
if (modalType === 'add' && keep.indexOf(aa) != -1) {
return Promise.reject('流程名称已存在');
} else if (
modalType === 'edit' &&
keep.indexOf(aa) != -1 &&
aa != msg.FlowName
) {
return Promise.reject('流程名称已存在');
}
return Promise.resolve();
},
},
]}
> >
<Input placeholder="请输入流程名称" /> <Input placeholder="请输入流程名称" />
</Form.Item> </Form.Item>
......
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