Commit 278df086 authored by 邓超's avatar 邓超

fix: 优化事件

parent 3334c5c6
Pipeline #67167 canceled with stages
...@@ -20,8 +20,9 @@ import { ...@@ -20,8 +20,9 @@ import {
Drawer, Drawer,
Space, Space,
Button, Button,
Tooltip,
} from 'antd'; } from 'antd';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined, InfoCircleOutlined } from '@ant-design/icons';
import ChangeAddFlows from './ChangeAddFlows'; import ChangeAddFlows from './ChangeAddFlows';
import RMSComponents from '@/components/RolePmSite/index'; import RMSComponents from '@/components/RolePmSite/index';
import { import {
...@@ -65,12 +66,30 @@ const AddFlowsModal = props => { ...@@ -65,12 +66,30 @@ const AddFlowsModal = props => {
useEffect(() => { useEffect(() => {
getRole(); getRole();
CM_Event_ReloadFlows({ eventTypeId: obj }).then(res => { CM_Event_ReloadFlows({ eventTypeId: obj }).then(res => {
if (res.msg === 'Ok') { if (res.code === 0) {
res.data.forEach(item => {
item.System = item.System.split('\\')[0];
});
console.log(res.data);
let arr = formateArrDataA(res.data, 'System'); let arr = formateArrDataA(res.data, 'System');
let newArr = [];
Object.keys(arr).map((item, index) => { console.log(arr, 'arr');
newArr.push(item); let newArr = Object.keys(arr).map((item, index) => {
// newArr.push(item);
arr[item].sort((a, b) => b.IsOptional - a.IsOptional);
return {
label: item,
options: arr[item].map(ele => ({
label: ele.FlowName,
value: ele.FlowName,
disabled: !ele.IsOptional,
})),
};
}); });
// Object.keys(arr).map((item, index) => {
// newArr.push(arr[item]);
// });
console.log(newArr, 'newArr');
setStandingTable(newArr); setStandingTable(newArr);
} }
}); });
...@@ -363,38 +382,31 @@ const AddFlowsModal = props => { ...@@ -363,38 +382,31 @@ const AddFlowsModal = props => {
<Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}> <Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}>
<Row> <Row>
<Col span={24}> <Col span={24}>
{type === 'edit' ? ( <Item
<> label={
<Item label="受理流程" name="FlowName" labelCol={{ span: 4 }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<Select placeholder="选择受理流程" placeholder={selectValue} disabled> <Tooltip title="若存在不可用流程,请检查流程配置">
{standingTable <InfoCircleOutlined
? standingTable.map((item, index) => ( style={{
<Option key={index} value={item}> color: '#1890ff',
{item} }}
</Option> />
)) </Tooltip>
: ''} <span>受理流程</span>
</Select> </div>
</Item> }
</> name="FlowName"
) : ( labelCol={{ span: 5 }}
<> >
<Item label="受理流程" name="FlowName" labelCol={{ span: 4 }}> <Select
<Select placeholder="选择受理流程"> options={standingTable}
{standingTable placeholder="选择受理流程"
? standingTable.map((item, index) => ( disabled={type === 'edit'}
<Option key={index} value={item}> />
{item}
</Option>
))
: ''}
</Select>
</Item> </Item>
</>
)}
</Col> </Col>
<Col span={24}> <Col span={24}>
<Item label="受理权限" name="Roles" labelCol={{ span: 4 }}> <Item label="受理权限" name="Roles" labelCol={{ span: 5 }}>
<div style={{ display: 'flex', alignContent: 'flex-start' }}> <div style={{ display: 'flex', alignContent: 'flex-start' }}>
<TextArea <TextArea
style={{ width: '83%' }} style={{ width: '83%' }}
......
...@@ -495,6 +495,7 @@ const AddModal = props => { ...@@ -495,6 +495,7 @@ const AddModal = props => {
const [previewModal, setPreviewModal] = useState(false); const [previewModal, setPreviewModal] = useState(false);
const [show, setShow] = useState('hidden'); const [show, setShow] = useState('hidden');
const [visibleChecked, setVisibleChecked] = useState(false); const [visibleChecked, setVisibleChecked] = useState(false);
const [initWay, setInitWay] = useState(); // 初始上报方式
const onSubmit = () => { const onSubmit = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
...@@ -713,6 +714,7 @@ const AddModal = props => { ...@@ -713,6 +714,7 @@ const AddModal = props => {
} }
setFlag(0); setFlag(0);
} else if (type == 'edit' || type == 'add') { } else if (type == 'edit' || type == 'add') {
setInitWay(null);
setEditable(false); setEditable(false);
setReportFromMobile(false); setReportFromMobile(false);
setReportFromWeb(false); setReportFromWeb(false);
...@@ -1526,17 +1528,17 @@ const AddModal = props => { ...@@ -1526,17 +1528,17 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
</Row> </Row>
<Item style={{marginBottom:'0px'}}> <Item style={{ marginBottom: '0px' }}>
<span style={{ marginLeft: '112px' }}>客户端上报(需配置事件权限、受理流程)</span> <span style={{ marginLeft: '112px' }}>客户端上报(需配置事件权限、受理流程)</span>
</Item> </Item>
<div style={{display:'inline-block', marginLeft:'112px', marginRight:'50px'}}> <div style={{ display: 'inline-block', marginLeft: '112px', marginRight: '50px' }}>
<Item name="ReportFromWeb"> <Item name="ReportFromWeb">
<Checkbox onChange={onChange3} checked={ReportFromWeb}> <Checkbox onChange={onChange3} checked={ReportFromWeb}>
前端 前端
</Checkbox> </Checkbox>
</Item> </Item>
</div> </div>
<div style={{display:'inline-block'}}> <div style={{ display: 'inline-block' }}>
<Item name="ReportFromMobile"> <Item name="ReportFromMobile">
<Checkbox onChange={onChange4} checked={ReportFromMobile}> <Checkbox onChange={onChange4} checked={ReportFromMobile}>
手持 手持
......
/* eslint-disable react-hooks/rules-of-hooks */ /* eslint-disable react-hooks/rules-of-hooks */
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { import { Modal, Table, Tooltip, notification, Space, Popconfirm, Spin, Button } from 'antd';
Modal,
Table,
Tooltip,
notification,
Space,
Popconfirm,
Spin,
Button,
} from 'antd';
import { import {
PlusSquareFilled, PlusSquareFilled,
EditTwoTone, EditTwoTone,
...@@ -20,10 +11,7 @@ import { ...@@ -20,10 +11,7 @@ import {
} from '@ant-design/icons'; } from '@ant-design/icons';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import styles from './incident.less'; import styles from './incident.less';
import { import { GetCM_Event_LoadEvenFlows, CM_Event_RemoveEvenFlow } from '@/services/standingBook/api';
GetCM_Event_LoadEvenFlows,
CM_Event_RemoveEvenFlow,
} from '@/services/standingBook/api';
import AddFlowsModal from './AddFlowsModal'; import AddFlowsModal from './AddFlowsModal';
const incidentFlow = props => { const incidentFlow = props => {
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
...@@ -57,10 +45,7 @@ const incidentFlow = props => { ...@@ -57,10 +45,7 @@ const incidentFlow = props => {
render: record => ( render: record => (
<Space size="middle"> <Space size="middle">
<Tooltip title="编辑用户"> <Tooltip title="编辑用户">
<EditTwoTone <EditTwoTone onClick={() => editEventType(record)} style={{ fontSize: '16px' }} />
onClick={() => editEventType(record)}
style={{ fontSize: '16px' }}
/>
</Tooltip> </Tooltip>
<Tooltip title="删除"> <Tooltip title="删除">
<Popconfirm <Popconfirm
...@@ -80,7 +65,7 @@ const incidentFlow = props => { ...@@ -80,7 +65,7 @@ const incidentFlow = props => {
useEffect(() => { useEffect(() => {
console.log(props); console.log(props);
console.log(props.location.state.title1); console.log(props.location.state.formObj);
setTreeLoading(true); setTreeLoading(true);
GetCM_Event_LoadEvenFlows({ GetCM_Event_LoadEvenFlows({
eventTypeId: props.location.state.formObj.ID, eventTypeId: props.location.state.formObj.ID,
...@@ -147,11 +132,12 @@ const incidentFlow = props => { ...@@ -147,11 +132,12 @@ const incidentFlow = props => {
<Spin tip="loading..." spinning={treeLoading}> <Spin tip="loading..." spinning={treeLoading}>
<div className={styles.containerBox}> <div className={styles.containerBox}>
<div className={styles.config}> <div className={styles.config}>
<div className={styles.title}>{`${ <div className={styles.title}>{`${props.location.state.title1}受理流程和权限`}</div>
props.location.state.title1
}受理流程和权限`}</div>
<div className={styles.btn}> <div className={styles.btn}>
<Button <Button
disabled={
props.location.state.formObj.createMode === '工单分派' && tableData.length >= 1
}
type="primary" type="primary"
icon={<PlusSquareOutlined />} icon={<PlusSquareOutlined />}
onClick={() => addIncident()} onClick={() => addIncident()}
...@@ -159,11 +145,7 @@ const incidentFlow = props => { ...@@ -159,11 +145,7 @@ const incidentFlow = props => {
新增 新增
</Button> </Button>
<Button <Button type="primary" icon={<RollbackOutlined />} onClick={() => back()}>
type="primary"
icon={<RollbackOutlined />}
onClick={() => back()}
>
返回 返回
</Button> </Button>
</div> </div>
......
...@@ -8,11 +8,13 @@ import { ...@@ -8,11 +8,13 @@ import {
DeleteOutlined, DeleteOutlined,
ExclamationCircleOutlined, ExclamationCircleOutlined,
HighlightOutlined, HighlightOutlined,
UnorderedListOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import gsap, { TweenMax, TimelineMax, ScrollToPlugin } from 'gsap/all'; import gsap, { TweenMax, TimelineMax, ScrollToPlugin } from 'gsap/all';
import FlowModal from './workFlowComponents/FlowModal'; import FlowModal from './workFlowComponents/FlowModal';
import FlowGroupModal from './workFlowComponents/FlowGroupModal'; import FlowGroupModal from './workFlowComponents/FlowGroupModal';
import Order from './workFlowComponents/Order';
import styles from './WorkflowHomePage.less'; import styles from './WorkflowHomePage.less';
import { WFGetAllFlow, GetFlowNode, DeleteFlow } from '@/services/workflow/workflow'; import { WFGetAllFlow, GetFlowNode, DeleteFlow } from '@/services/workflow/workflow';
const plugins = [ScrollToPlugin]; const plugins = [ScrollToPlugin];
...@@ -34,6 +36,7 @@ const WorkflowHomePage = () => { ...@@ -34,6 +36,7 @@ const WorkflowHomePage = () => {
const [visible, setVisible] = useState({ const [visible, setVisible] = useState({
FlowModal: false, FlowModal: false,
FlowGroupModal: false, FlowGroupModal: false,
order: false,
}); // 弹窗显示 }); // 弹窗显示
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const activeKey = useRef(null); const activeKey = useRef(null);
...@@ -318,10 +321,16 @@ const WorkflowHomePage = () => { ...@@ -318,10 +321,16 @@ const WorkflowHomePage = () => {
</Tabs> */} </Tabs> */}
</div> </div>
</div> </div>
{/* <div className={styles.right} onClick={addFlowGroup}> <div
<div className={styles.icon} /> className={styles.right}
<div>新增分组</div> onClick={() => {
</div> */} showModal('order', true);
}}
>
{/* <div className={styles.icon} /> */}
<UnorderedListOutlined style={{ marginRight: '5px' }} />
<div>流程排序</div>
</div>
</div> </div>
<div className={styles.controlBox}> <div className={styles.controlBox}>
<div className={styles.left}> <div className={styles.left}>
...@@ -414,9 +423,9 @@ const WorkflowHomePage = () => { ...@@ -414,9 +423,9 @@ const WorkflowHomePage = () => {
</div> </div>
</div> </div>
<img <img
src={`${window.location.origin}/${ src={`${
ele.PreviewImage window.location.origin
}?v=${new Date().getTime()}`} }/PandaOMS/OMS/FileCenter/DownLoadFiles?filePath=${ele.PreviewImage}`}
alt="" alt=""
/> />
</div> </div>
...@@ -454,6 +463,17 @@ const WorkflowHomePage = () => { ...@@ -454,6 +463,17 @@ const WorkflowHomePage = () => {
keep={flowNames} keep={flowNames}
onSubumit={val => groupCallBack(val)} onSubumit={val => groupCallBack(val)}
/> />
{/* 排序弹窗 */}
<Order
visible={visible.order}
processData={flowList}
handleCancel={() => showModal('order', false)}
submitCallBack={() => {
// activeKey.current = currentList[0];
showModal('order', false);
getFlowList();
}}
/>
</div> </div>
); );
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 17:26:13 * @Date: 2022-01-13 17:26:13
* @LastEditTime: 2023-01-29 14:28:04 * @LastEditTime: 2023-02-08 15:43:35
* @LastEditors: dengchao 754083046@qq.com * @LastEditors: dengchao 754083046@qq.com
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -33,9 +33,9 @@ const Order = props => { ...@@ -33,9 +33,9 @@ const Order = props => {
let ids = ''; let ids = '';
orderTable.forEach((item, index) => { orderTable.forEach((item, index) => {
if (index === orderTable.length - 1) { if (index === orderTable.length - 1) {
ids += `${item.FlowID}`; ids += `${item.ExtendID}`;
} else { } else {
ids += `${item.FlowID},`; ids += `${item.ExtendID},`;
} }
}); });
setFlowIDs(ids); setFlowIDs(ids);
......
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