Commit 4f2ba10a authored by 皮倩雯's avatar 皮倩雯

三级模态增加路由

parent 6c891ab0
...@@ -24,6 +24,7 @@ const AddFlowsModal = props => { ...@@ -24,6 +24,7 @@ const AddFlowsModal = props => {
useEffect(() => { useEffect(() => {
console.log(formObj)
getRole() getRole()
console.log(obj) console.log(obj)
CM_Event_ReloadFlows({ eventTypeId: obj }).then(res => { CM_Event_ReloadFlows({ eventTypeId: obj }).then(res => {
...@@ -365,14 +366,13 @@ const AddFlowsModal = props => { ...@@ -365,14 +366,13 @@ const AddFlowsModal = props => {
</Form> </Form>
<ChangeAddFlows <ChangeAddFlows
visible={visible1} visible={visible1}
onClose={() => setVisible1(false)} onCancel={() => setVisible1(false)}
callBackSubmit={onOKk} callBackSubmit={onOKk}
newCheckedList={checkedList1} newCheckedList={checkedList1}
filed1={filed1} filed1={filed1}
pickItem={pickItem} pickItem={pickItem}
characterValue={characterValue} characterValue={characterValue}
formObj={formObj} formObj={formObj}
placement="right"
/> />
</Drawer> </Drawer>
) )
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, notification, message, Row, Col, Select, Checkbox, Radio, Button, Dropdown, Menu } from 'antd'; import { Modal, Drawer, Form, Input, notification, message, Space, Row, Col, Select, Checkbox, Radio, Dropdown, Menu, Button } from 'antd';
import { GetCM_Event_LoadEventTypeTable, LoadEventFields, CM_Event_LoadDepartmentAndRoles, CM_Event_EditEventTable, GetCM_Event_QueryEventType, CM_Event_AddEventTable } from '@/services/standingBook/api' import { GetCM_Event_LoadEventTypeTable, LoadEventFields, CM_Event_LoadDepartmentAndRoles, CM_Event_EditEventTable, GetCM_Event_QueryEventType, CM_Event_AddEventTable } from '@/services/standingBook/api'
import styles from './incident.less'; import styles from './incident.less';
import ChangeAdd from './changeAdd' import ChangeAdd from './changeAdd'
...@@ -582,23 +582,24 @@ const AddModal = props => { ...@@ -582,23 +582,24 @@ const AddModal = props => {
setIsVisible1(false) setIsVisible1(false)
} }
const title = <ModalDrag title={type === 'add' ? '添加事件类型' : '编辑事件类型'} /> // const title = <ModalDrag title={type === 'add' ? '添加事件类型' : '编辑事件类型'} />
return ( return (
<Modal <Drawer
title={title} title={type === 'add' ? '添加事件类型' : '编辑事件类型'}
maskClosable={false}
width="800px" width="800px"
destroyOnClose destroyOnClose
okText="确认"
mask={false}
cancelText="取消"
{...props} {...props}
onOk={() => onSubmit()} footer={
<Space>
<Button onClick={onSubmit} type="primary" >
确定
</Button>
</Space>
}
// confirmLoading={loading} // confirmLoading={loading}
forceRender={true}
getContainer={false}
> >
<Form form={form} labelCol={{ span: 7 }} style={{ height: '38rem', overflowY: 'scroll' }}> <Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}>
<Row> <Row>
<Col span={13}> <Col span={13}>
<Item <Item
...@@ -625,7 +626,7 @@ const AddModal = props => { ...@@ -625,7 +626,7 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input style={{ width: '12rem' }} value={prefixName} placeholder="请输入编码前缀" /> <Input style={{ width: '12.5rem' }} value={prefixName} placeholder="请输入编码前缀" />
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
...@@ -676,10 +677,10 @@ const AddModal = props => { ...@@ -676,10 +677,10 @@ const AddModal = props => {
placement='bottomRight' placement='bottomRight'
style={{ width: '20rem' }} style={{ width: '20rem' }}
overlay={<Menu> overlay={<Menu>
{treeData.length ? treeData.map((item, index) => { return <Menu.Item onClick={() => { setType1(item); form.setFieldsValue({ BusinessType: item }) }} style={{ width: '580px', marginLeft: '-8px' }} key={index}>{item}</Menu.Item> }) : ''} {treeData.length ? treeData.map((item, index) => { return <Menu.Item onClick={() => { setType1(item); form.setFieldsValue({ BusinessType: item }) }} style={{ width: '580px', marginLeft:'-8px'}} key={index}>{item}</Menu.Item> }) : ''}
</Menu>} > </Menu>} >
<div className={styles.linkDrowp} onClick={e => e.preventDefault()}> <div onClick={e => e.preventDefault()} style={{position:'absolute', left:'94%', width: '1rem',top:'0', marginTop:'6px'}}>
<DownOutlined style={{ fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)' }} /> <DownOutlined style={{fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)' }} />
</div> </div>
</Dropdown> </Dropdown>
</div> </div>
...@@ -966,7 +967,7 @@ const AddModal = props => { ...@@ -966,7 +967,7 @@ const AddModal = props => {
</Form> </Form>
<ChangeAdd <ChangeAdd
visible={isVisible} visible={isVisible}
onClose={onCancel} onCancel={onCancel}
callBackSubmit={onOK} callBackSubmit={onOK}
newCheckedList={checkedList1} newCheckedList={checkedList1}
isType={types} isType={types}
...@@ -976,14 +977,13 @@ const AddModal = props => { ...@@ -976,14 +977,13 @@ const AddModal = props => {
pickItem={pickItem} pickItem={pickItem}
characterValue={characterValue} characterValue={characterValue}
formObj={formObj} formObj={formObj}
placement="right"
/> />
<ChangeImage <ChangeImage
visible={isVisible1} visible={isVisible1}
callBackSubmit={oKK} callBackSubmit={oKK}
onCancel={onCancel1} onCancel={onCancel1}
/> />
</Modal> </Drawer>
); );
}; };
......
import React, { useState, useEffect, useCallback, useRef } from 'react'; import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Form, Drawer, Space, Divider, Radio, Checkbox, Button } from 'antd'; import { Form, Modal, Space, Divider, Radio, Checkbox, Button } from 'antd';
import styles from './incident.less'; import styles from './incident.less';
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const ChangeAddFlows = props =>{ const ChangeAddFlows = props => {
const { callBackSubmit = () => { }, pickItem, visible, filed1, characterValue, newCheckedList } = props; const { callBackSubmit = () => { }, pickItem, visible, filed1, characterValue, newCheckedList } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [value, setValue] = useState(''); const [value, setValue] = useState('');
...@@ -17,7 +17,7 @@ const ChangeAddFlows = props =>{ ...@@ -17,7 +17,7 @@ const ChangeAddFlows = props =>{
const [checkAll, setCheckAll] = useState([]); const [checkAll, setCheckAll] = useState([]);
const [selectData, setSelectData] = useState([]) const [selectData, setSelectData] = useState([])
let objArr = [] let objArr = []
const onChangeList1 = (list, index, title) => { const onChangeList1 = (list, index, title) => {
const checkedListArr = [...checkedList] const checkedListArr = [...checkedList]
checkedListArr[index] = list checkedListArr[index] = list
...@@ -34,7 +34,7 @@ const ChangeAddFlows = props =>{ ...@@ -34,7 +34,7 @@ const ChangeAddFlows = props =>{
console.log(selectData.join(",")) console.log(selectData.join(","))
console.log(pickItem) console.log(pickItem)
console.log(checkedList) console.log(checkedList)
callBackSubmit({ checkedList, str: selectData.join(","), pickItem, stt:selectData, title:title, filed22:filed1 }); callBackSubmit({ checkedList, str: selectData.join(","), pickItem, stt: selectData, title: title, filed22: filed1 });
} }
const onCheckAllChange = e => { const onCheckAllChange = e => {
const indeterminateArr = [...indeterminate] const indeterminateArr = [...indeterminate]
...@@ -60,34 +60,34 @@ const ChangeAddFlows = props =>{ ...@@ -60,34 +60,34 @@ const ChangeAddFlows = props =>{
} }
useEffect(() => { useEffect(() => {
console.log(characterValue) console.log(characterValue)
console.log(pickItem) console.log(pickItem)
console.log(filed1) console.log(filed1)
let arr = Object.keys(filed1) let arr = Object.keys(filed1)
console.log(arr, 'arr') console.log(arr, 'arr')
setTitle(arr) setTitle(arr)
let checkArr = [] let checkArr = []
let indeterminateArr = [] let indeterminateArr = []
let checkAllArr = [] let checkAllArr = []
console.log(newCheckedList); console.log(newCheckedList);
arr.map((item, index) => { arr.map((item, index) => {
checkArr[index] = [] checkArr[index] = []
newCheckedList.map(checkItem => { newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) { if (filed1[item].includes(checkItem)) {
checkArr[index].push(checkItem) checkArr[index].push(checkItem)
} }
})
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
}) })
console.log(checkArr) indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
setCheckedList(checkArr) checkAllArr.push(checkArr[index].length === filed1[item].length)
setIndeterminate(indeterminateArr) })
setCheckAll(checkAllArr) console.log(checkArr)
let newArr = characterValue.length ? characterValue.split(",") : [] setCheckedList(checkArr)
setSelectData(newArr) setIndeterminate(indeterminateArr)
draftSort() setCheckAll(checkAllArr)
let newArr = characterValue.length ? characterValue.split(",") : []
setSelectData(newArr)
draftSort()
}, [visible]); }, [visible]);
...@@ -112,19 +112,18 @@ const ChangeAddFlows = props =>{ ...@@ -112,19 +112,18 @@ const ChangeAddFlows = props =>{
return ( return (
<Drawer <Modal
title='部门或角色' title='部门或角色'
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
width="700px" width="700px"
destroyOnClose destroyOnClose
centered={true}
cancelText="取消"
okText="确认"
{...props} {...props}
footer={ onOk={() => onSubmit()}
<Space> forceRender={true}
<Button onClick={onSubmit} type="primary" > getContainer={false}
确定
</Button>
</Space>
}
> >
{visible && ( {visible && (
<div className={styles.listCard}> <div className={styles.listCard}>
...@@ -167,8 +166,8 @@ const ChangeAddFlows = props =>{ ...@@ -167,8 +166,8 @@ const ChangeAddFlows = props =>{
) )
} }
</Drawer> </Modal>
) )
}; };
export default ChangeAddFlows; export default ChangeAddFlows;
\ No newline at end of file
import React, { useState, useEffect, useCallback, useRef } from 'react'; import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Form, Drawer, Space, Divider, Checkbox, Button } from 'antd'; import { Form, Modal, Divider, Checkbox} from 'antd';
import styles from './incident.less'; import styles from './incident.less';
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
...@@ -41,7 +41,7 @@ const AddModal = props => { ...@@ -41,7 +41,7 @@ const AddModal = props => {
}; };
const onSubmit = () => { const onSubmit = () => {
isType === 'rule' ? callBackSubmit(`${value === '无' || value === '' ? '' : value + ','}${checkValue.join(',')}`) : callBackSubmit({ checkedList, str: selectData.join(","), pickItem, stt:selectData, title:title, filed22:filed1, isType:isType }); isType === 'rule' ? callBackSubmit(`${value === '无' || value === '' ? '' : value + ','}${checkValue.join(',')}`) : callBackSubmit({ checkedList, str: selectData.join(","), pickItem, stt: selectData, title: title, filed22: filed1, isType: isType });
} }
const onCheckAllChange = e => { const onCheckAllChange = e => {
const indeterminateArr = [...indeterminate] const indeterminateArr = [...indeterminate]
...@@ -143,52 +143,51 @@ const AddModal = props => { ...@@ -143,52 +143,51 @@ const AddModal = props => {
} }
if (isType != 'app') { if (isType != 'app') {
return ( return (
<Drawer <Modal
title='字段集选择' title='字段集选择'
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
width="700px" width="700px"
destroyOnClose destroyOnClose
{...props} centered={true}
footer={ cancelText="取消"
<Space> okText="确认"
<Button onClick={onSubmit} type="primary"> {...props}
确定 onOk={() => onSubmit()}
</Button> forceRender={true}
</Space> getContainer={false}
}
> >
{visible && ( {visible && (
<div className={styles.listCard}> <div className={styles.listCard}>
<div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}> <div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选字段列表</Divider> <Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选字段列表</Divider>
{flag === 0 ? {flag === 0 ?
<> <>
<div className={styles.cardContent}> <div className={styles.cardContent}>
<span style={{color: 'red',fontSize: '1rem', marginLeft: '25px'}}>请先选择事件主表</span> <span style={{ color: 'red', fontSize: '1rem', marginLeft: '25px' }}>请先选择事件主表</span>
</div>
</>:
<>
{JSON.stringify(filed) == "{}" ?
<>
<div className={styles.cardContent}>
<span style={{color: 'red',fontSize: '1rem', marginLeft: '25px'}}>表字段缺失请先配置表/字段</span>
</div>
</>
:
<>
<div className={styles.cardContent}>
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}>{item} <Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed[item]} checked={checkAll[index]}> </Checkbox></Divider>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index, item)} /></div>
})}
</div> </div>
</> </> :
} <>
{JSON.stringify(filed) == "{}" ?
<>
<div className={styles.cardContent}>
<span style={{ color: 'red', fontSize: '1rem', marginLeft: '25px' }}>表字段缺失请先配置表/字段</span>
</div>
</>
:
<>
<div className={styles.cardContent}>
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}><Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed[item]} checked={checkAll[index]} style={{ marginRight: '7px' }}></Checkbox>{item}</Divider>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index, item)} /></div>
})}
</div>
</>
}
</> </>
} }
</div> </div>
...@@ -221,35 +220,35 @@ const AddModal = props => { ...@@ -221,35 +220,35 @@ const AddModal = props => {
) )
} }
</Drawer> </Modal>
); );
} else if (isType === 'app') { } else if (isType === 'app') {
return ( return (
<Drawer <Modal
title= '部门或角色' title='部门或角色'
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
width="700px" width="700px"
destroyOnClose style={{ top: '10px' }}
{...props} destroyOnClose
footer={ centered={true}
<Space> cancelText="取消"
<Button onClick={onSubmit} type="primary" > okText="确认"
确定 {...props}
</Button> onOk={() => onSubmit()}
</Space> forceRender={true}
} getContainer={false}
> >
{visible && ( {visible && (
<div className={styles.listCard}> <div className={styles.listCard}>
<div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}> <div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选字段列表</Divider> <Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选字段列表</Divider>
<div className={styles.cardContent}> <div className={styles.cardContent}>
{title.map((item, index) => { {title.map((item, index) => {
return <div className={styles.cardItemData} key={index}> return <div className={styles.cardItemData} key={index}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}>{item} <Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed1[item]} checked={checkAll[index]}> </Checkbox></Divider> <Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}><Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed1[item]} checked={checkAll[index]} style={{ marginRight: '7px' }}></Checkbox>{item}</Divider>
<CheckboxGroup options={filed1[item]} value={checkedList[index]} onChange={(e) => onChangeList1(e, index, item)} /></div> <CheckboxGroup options={filed1[item]} value={checkedList[index]} onChange={(e) => onChangeList1(e, index, item)} /></div>
})} })}
</div> </div>
</div> </div>
<div className={styles.cardItem}> <div className={styles.cardItem}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>已选字段列表</Divider> <Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>已选字段列表</Divider>
...@@ -280,7 +279,7 @@ const AddModal = props => { ...@@ -280,7 +279,7 @@ const AddModal = props => {
) )
} }
</Drawer> </Modal>
); );
} }
}; };
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import styles from './incident.less'; import styles from './incident.less';
import { import {
Form, Form,
...@@ -33,6 +34,7 @@ import ViewModal from './ViewModal' ...@@ -33,6 +34,7 @@ import ViewModal from './ViewModal'
const incident = () => { const incident = () => {
const history = useHistory();
const [treeLoading, setTreeLoading] = useState(false); const [treeLoading, setTreeLoading] = useState(false);
const [treeVisible, setTreeVisible] = useState(true); // 左边列表是否可见 const [treeVisible, setTreeVisible] = useState(true); // 左边列表是否可见
const [treeData, setTreeData] = useState([]); // 事件表数据 const [treeData, setTreeData] = useState([]); // 事件表数据
...@@ -229,13 +231,13 @@ const incident = () => { ...@@ -229,13 +231,13 @@ const incident = () => {
</Tooltip> </Tooltip>
<Tooltip title="受理流程"> <Tooltip title="受理流程">
<ApartmentOutlined <ApartmentOutlined
onClick={() => process(record)} onClick={() => process1(record)}
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
/> />
</Tooltip> </Tooltip>
<Tooltip title="辅助视图"> <Tooltip title="辅助视图">
<DesktopOutlined <DesktopOutlined
onClick={() => auxiliaryView(record)} onClick={() => auxiliaryView1(record)}
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
/> />
</Tooltip> </Tooltip>
...@@ -385,15 +387,28 @@ const incident = () => { ...@@ -385,15 +387,28 @@ const incident = () => {
console.log(tableData[pickItem]) console.log(tableData[pickItem])
setSortData(tableData[pickItem]) setSortData(tableData[pickItem])
} }
const process = record => { // const process = record => {
setProcessVisible(true); // setProcessVisible(true);
setFormObj(record); // setFormObj(record);
setTitle1(record.name) // setTitle1(record.name)
// }
const process1 = record =>{
history.push({
pathname: '/platformCenter/bsmanger/incidentFlow',
state: { formObj:record, title1:record.name },
});
} }
const auxiliaryView = record => { // const auxiliaryView = record => {
setFormObj(record); // setFormObj(record);
setViewVisible(true) // setViewVisible(true)
setTitle2(record.name) // setTitle2(record.name)
// }
const auxiliaryView1 = record => {
history.push({
pathname: '/platformCenter/bsmanger/incidentView',
state: { formObj:record, title2:record.name },
});
} }
const onSubmit = () => { const onSubmit = () => {
setAddvisible(false) setAddvisible(false)
...@@ -530,19 +545,20 @@ const incident = () => { ...@@ -530,19 +545,20 @@ const incident = () => {
formObj={formObj} formObj={formObj}
rember1={rember1} rember1={rember1}
maxLength={maxLength} maxLength={maxLength}
onCancel={() => setAddvisible(false)} onClose={() => setAddvisible(false)}
treeData={treeData} treeData={treeData}
selectData={select} selectData={select}
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
placement="right"
/> />
<ProcessModal {/* <ProcessModal
visible={processVisible} visible={processVisible}
formObj={formObj} formObj={formObj}
title1={title1} title1={title1}
maxLength={maxLength} maxLength={maxLength}
onCancel={() => setProcessVisible(false)} onCancel={() => setProcessVisible(false)}
callBackSubmit={onOK1} callBackSubmit={onOK1}
/> /> */}
<SortModal <SortModal
title="调整顺序" title="调整顺序"
visible={sortVisible} visible={sortVisible}
...@@ -551,13 +567,13 @@ const incident = () => { ...@@ -551,13 +567,13 @@ const incident = () => {
onCancel={() => setSortVisible(false)} onCancel={() => setSortVisible(false)}
callBackSubmit={onOK} callBackSubmit={onOK}
/> />
<ViewModal {/* <ViewModal
formObj={formObj} formObj={formObj}
visible={viewVisible} visible={viewVisible}
onCancel={() => setViewVisible(false)} onCancel={() => setViewVisible(false)}
title2={title2} title2={title2}
callBackSubmit={onOK11} callBackSubmit={onOK11}
/> /> */}
</div> </div>
</div> </div>
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
.linkDrowp{ .linkDrowp{
position: absolute; position: absolute;
top: 0;
left: 93.5%; left: 93.5%;
width: 1rem; width: 1rem;
height: 100%; height: 100%;
...@@ -184,7 +183,7 @@ ...@@ -184,7 +183,7 @@
padding: 0.5rem; padding: 0.5rem;
} }
.cardContent{ .cardContent{
// height: 30rem; height: 30rem;
overflow-y: scroll; overflow-y: scroll;
width: 19rem; width: 19rem;
} }
...@@ -192,6 +191,7 @@ ...@@ -192,6 +191,7 @@
padding: 1rem; padding: 1rem;
border: 1px solid #b5b8c8; border: 1px solid #b5b8c8;
margin-bottom: 1rem; margin-bottom: 1rem;
overflow-x: hidden;
} }
} }
.doctorTable { .doctorTable {
...@@ -221,4 +221,42 @@ ...@@ -221,4 +221,42 @@
.ant-drawer-footer { .ant-drawer-footer {
display:flex; display:flex;
justify-content: flex-end; justify-content: flex-end;
}
.config{
display: flex;
padding: 1rem 0 0.5rem 0.5rem;
justify-content: space-between;
width: calc(100% - 10px);
.title{
font-size: 18px;
color: rgba(0, 114, 255, 1);
font-weight: bold;
}
.btn{
display: flex;
justify-content: space-around;
width: 20rem;
}
.ant-btn{
display: flex;
align-items: center;
}
}
.containerBox {
width: 100vm;
height: calc(100vh - 90px) ;
background: #ffffff;
.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{
margin-left: 0;
}
.ant-table.ant-table-bordered > .ant-table-container{
border: none;
}
.clickRowStyle{
background: #cfe7fd;
}
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
} }
\ No newline at end of file
import React, { useEffect, useState } from 'react';
import { Modal, Table, Tooltip, notification, Space, Popconfirm, Spin, Button } from 'antd';
import {
PlusSquareFilled,
EditTwoTone,
DeleteOutlined,
PlusSquareOutlined,
RollbackOutlined
} from '@ant-design/icons';
import { useHistory } from 'react-router-dom';
import styles from './incident.less';
import { GetCM_Event_LoadEvenFlows, CM_Event_RemoveEvenFlow } from '@/services/standingBook/api';
import AddFlowsModal from './AddFlowsModal'
const incidentFlow = (props) => {
const [tableData, setTableData] = useState([])
const history = useHistory();
const [addVisible, setAddVisible] = useState(false)
const [treeLoading, setTreeLoading] = useState(false);
const [isType, setIsType] = useState(''); // 弹窗类型
const [record1, setRecord1] = useState('')
const [obj, setObj] = useState('')
const [flag, setFlag] = useState(0)
const columns = [
{
title: () => (<span style={{ fontWeight: 'bold' }}>流程名称</span>),
dataIndex: 'FlowName',
key: 'FlowName',
width: 250,
ellipsis: true,
}
,
{
title: () => (<span style={{ fontWeight: 'bold' }}>受理权限</span>),
dataIndex: 'FlowRoles',
key: 'FlowRoles',
ellipsis: true,
},
{
title: () => (<span style={{ fontWeight: 'bold' }}>操作</span>),
key: 'action',
width: 150,
aligin: 'center',
render: record => (
<Space size="middle">
<Tooltip title="编辑用户">
<EditTwoTone
onClick={() => editEventType(record)}
style={{ fontSize: '16px' }}
/>
</Tooltip>
<Tooltip title="删除">
<Popconfirm
placement="bottomRight"
title={
<p>
即将删除事件流程,是否确认删除?
</p>
}
okText="确认"
cancelText="取消"
onConfirm={() => deleteEventType(record)}
>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
</Popconfirm>
</Tooltip>
</Space>
)
}
]
useEffect(() => {
console.log(props)
console.log(props.location.state.title1)
setTreeLoading(true);
GetCM_Event_LoadEvenFlows({ eventTypeId: props.location.state.formObj.ID }).then(res => {
setTreeLoading(false);
if (res.msg === 'Ok') {
console.log(res.data)
setTableData(res.data)
}
})
}, [flag])
const addIncident = () => {
console.log(props.location.state.formObj.ID)
setObj(props.location.state.formObj.ID)
setAddVisible(true)
setIsType('add')
}
const editEventType = record => {
setObj(props.location.state.formObj.ID)
setRecord1(record)
setIsType('edit');
setAddVisible(true)
}
const back = () => {
let formObj = props.location.state.formObj;
history.push({
pathname: '/platformCenter/bsmanger/incident',
state: { formObj },
});
};
const deleteEventType = record => {
console.log(record)
CM_Event_RemoveEvenFlow({ eventFlowIds: record.ID }).then(res => {
if (res.msg === '') {
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
setFlag(flag + 1)
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
})
}
const onOK = () => {
setAddVisible(false)
GetCM_Event_LoadEvenFlows({ eventTypeId: props.location.state.formObj.ID }).then(res => {
if (res.msg === 'Ok') {
console.log(res.data)
setTableData(res.data)
}
})
}
return (
<>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.containerBox}>
<div className={styles.config}>
<div className={styles.title}>{`${props.location.state.title1}受理流程和权限`}</div>
<div className={styles.btn}>
<Button
type="primary"
icon={<PlusSquareOutlined />}
onClick={() => addIncident()}
>
新增
</Button>
<Button type="primary" icon={<RollbackOutlined />} onClick={()=>back()}>
返回
</Button>
</div>
</div>
<Table
size="small"
rowKey='ID'
bordered
style={{ overflowY: 'scroll'}}
onRow={record => {
return {
onDoubleClick: event => { event.stopPropagation(); editEventType(record); }, //双击
};
}}
columns={columns}
dataSource={tableData}
pagination={false} />
</div>
</Spin>
<AddFlowsModal
visible={addVisible}
obj={obj}
formObj={props.location.state.formObj}
type={isType}
record={record1}
// maxLength={maxLength}
onClose={() => setAddVisible(false)}
callBackSubmit={onOK}
placement="right"
/>
</>
)
}
export default incidentFlow;
\ No newline at end of file
import React, { useEffect, useState } from 'react';
import { Form, Modal, Table, Input, Select, Tooltip, Button, notification, Spin, Image, Menu, Dropdown, Space, Popconfirm } from 'antd';
import { CM_Event_ReloadEventExtendPages, CM_Event_RemoveEventExtendPage } from '@/services/standingBook/api';
import {
PlusSquareFilled,
EditTwoTone,
DeleteOutlined,
PlusSquareOutlined,
RollbackOutlined
} from '@ant-design/icons';
import AddViewModal from './AddViewModal'
import { useHistory } from 'react-router-dom';
import { set } from 'immutable';
import styles from './incident.less';
const incidentView = props => {
const history = useHistory();
const [tableData, setTableData] = useState([])
const [addViewVisible, setAddViewVisible] = useState(false)
const [treeLoading, setTreeLoading] = useState(false)
const [flag,setFlag] = useState(0)
const [obj,setObj] = useState('')
const [type,setType] = useState('')
const columns = [
{
title: () => (<span style={{fontWeight:'bold'}}>视图标签</span>),
dataIndex: 'WebLabel',
key: 'WebLabel',
width: 150,
ellipsis: true,
render: item => (
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
)
}
,
{
title: () => (<span style={{fontWeight:'bold'}}>视图模块</span>),
dataIndex: 'WebPage',
key: 'WebPage',
width: 150,
ellipsis: true,
render: item => (
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
)
},
{
title: () => (<span style={{fontWeight:'bold'}}>视图参数</span>),
dataIndex: 'WebParam',
key: 'WebParam',
width: 150,
ellipsis: true,
render: item => (
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
)
},
,
{
title: () => (<span style={{fontWeight:'bold'}}>手持视图标签</span>),
dataIndex: 'MobileLabel',
key: 'MobileLabel',
width: 150,
ellipsis: true,
render: item => (
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
)
},
{
title: () => (<span style={{fontWeight:'bold'}}>手持视图模块</span>),
dataIndex: 'MobilePage',
key: 'MobilePage',
width: 150,
ellipsis: true,
render: item => (
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
)
},
,
{
title: () => (<span style={{fontWeight:'bold'}}>手持视图参数</span>),
dataIndex: 'MobileParam',
key: 'MobileParam',
width: 150,
ellipsis: true,
render: item => (
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
)
},
{
title: () => (<span style={{fontWeight:'bold'}}>操作</span>),
key: 'action',
aligin: 'center',
width: 50,
render: record => (
<Space size="middle">
<Tooltip title="编辑用户">
<EditTwoTone
onClick={() => editView(record)}
style={{ fontSize: '16px' }}
/>
</Tooltip>
<Tooltip title="删除">
<Popconfirm
placement="bottomRight"
title={
<p>
即将删除事件处理流程,是否确认删除?
</p>
}
okText="确认"
cancelText="取消"
onConfirm={() => deleteView(record)}
>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
</Popconfirm>
</Tooltip>
</Space>
)
}
]
useEffect(()=>{
setTreeLoading(true);
CM_Event_ReloadEventExtendPages({eventName:props.location.state.formObj.name}).then(res=>{
setTreeLoading(false);
if (res.msg === 'Ok'||res.msg==='') {
console.log(res.data)
setTableData(res.data)
}
})
},[flag])
const onSumbit =()=>{
callBackSubmit()
}
const addView=()=>{
setType('add')
setAddViewVisible(true)
}
const editView = record =>{
setType('edit')
setAddViewVisible(true)
setObj(record.ID)
}
const deleteView= record =>{
console.log(record)
CM_Event_RemoveEventExtendPage({eventExtendId:record.ID}).then(res=>{
if (res.msg === '') {
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
setFlag(flag + 1);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
})
}
const okk =()=>{
setAddViewVisible(false)
setFlag(flag+1)
}
const back = () => {
let formObj = props.location.state.formObj;
history.push({
pathname: '/platformCenter/bsmanger/incident',
state: { formObj },
});
};
return(
<>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.containerBox}>
<div className={styles.config}>
<div className={styles.title}>{`${props.location.state.title2}受理流程和权限`}</div>
<div className={styles.btn}>
<Button
type="primary"
icon={<PlusSquareOutlined />}
onClick={() => addView()}
>
新增
</Button>
<Button type="primary" icon={<RollbackOutlined />} onClick={()=>back()}>
返回
</Button>
</div>
</div>
<Table
size="small"
rowKey='ID'
bordered
onRow={record => {
return {
onDoubleClick: event => {event.stopPropagation(); editView(record)}, //双击
};
}}
columns={columns}
style={{ height: '15rem', overflowY: 'scroll', marginLeft: '25px', marginRight: '25px' }}
dataSource={tableData}
pagination={false}
scroll={{ x: 'max-content'}}
/>
</div>
</Spin>
<AddViewModal
visible={addViewVisible}
title="事件辅助视图配置"
onClose={()=>setAddViewVisible(false)}
title2={props.location.state.title2}
callBackSubmit={okk}
obj={obj}
type={type}
placement="right"
/>
</>
)
}
export default incidentView;
\ No newline at end of file
...@@ -358,7 +358,8 @@ const AddModal = props => { ...@@ -358,7 +358,8 @@ const AddModal = props => {
}; };
// 返回上一级 // 返回上一级
const back = () => { const back = () => {
let template = props.history.location.state.template; console.log(props)
let template = props.location.state.template;
history.push({ history.push({
pathname: '/platformCenter/bsmanger/tablemanger', pathname: '/platformCenter/bsmanger/tablemanger',
state: { template }, state: { template },
......
...@@ -51,6 +51,8 @@ import TableManager from '@/pages/platformCenter/bsmanager/tablemanager'; ...@@ -51,6 +51,8 @@ import TableManager from '@/pages/platformCenter/bsmanager/tablemanager';
import StandingBook from '@/pages/platformCenter/standingBook/standingBook'; import StandingBook from '@/pages/platformCenter/standingBook/standingBook';
import FiledConfig from '@/pages/platformCenter/filedConfig/filedConfig'; import FiledConfig from '@/pages/platformCenter/filedConfig/filedConfig';
import Incident from '@/pages/platformCenter/bsmanager/workOrder/incident'; import Incident from '@/pages/platformCenter/bsmanager/workOrder/incident';
import IncidentFlow from '@/pages/platformCenter/bsmanager/workOrder/incidentFlow';
import IncidentView from '@/pages/platformCenter/bsmanager/workOrder/incidentView';
import Maintenance from '@/pages/platformCenter/bsmanager/maintenance/maintenance'; import Maintenance from '@/pages/platformCenter/bsmanager/maintenance/maintenance';
import Flow from '@/pages/platformCenter/bsmanager/workFlow/flow'; import Flow from '@/pages/platformCenter/bsmanager/workFlow/flow';
import FlowNode from '@/pages/platformCenter/bsmanager/workFlow/flowNode/flowNode'; import FlowNode from '@/pages/platformCenter/bsmanager/workFlow/flowNode/flowNode';
...@@ -291,6 +293,18 @@ export default { ...@@ -291,6 +293,18 @@ export default {
name: '事件', name: '事件',
component: Incident, component: Incident,
}, },
{
path: '/platformCenter/bsmanger/incidentFlow',
name: '事件受理流程',
hideMenu: true,
component: IncidentFlow,
},
{
path: '/platformCenter/bsmanger/incidentView',
name: '事件辅助视图',
hideMenu: true,
component: IncidentView,
},
{ {
path: '/platformCenter/bsmanger/flow', path: '/platformCenter/bsmanger/flow',
name: '流程', name: '流程',
......
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