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

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

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