Commit 6ec08a58 authored by 皮倩雯's avatar 皮倩雯

事件工单全局排序

parent 3e3176b1
Pipeline #59442 passed with stages
...@@ -14,12 +14,11 @@ import Sortable from 'sortablejs'; ...@@ -14,12 +14,11 @@ import Sortable from 'sortablejs';
import styles from './incident.less'; import styles from './incident.less';
import DragTable from '@/components/DragTable/DragTable'; import DragTable from '@/components/DragTable/DragTable';
const SortModal = props => { const SortModal = props => {
const { callBackSubmit = () => {}, title, visible, onCancel, sortData1 } = props; const { callBackSubmit = () => {}, title, visible, onCancel, sortData1, keepIdValue } = props;
const [orderTable, setOrderTable] = useState([]); const [orderTable, setOrderTable] = useState([]);
const [flowIDs, setFlowIDs] = useState([]); const [flowIDs, setFlowIDs] = useState([]);
const onSumbit = () => { const onSumbit = () => {
console.log(flowIDs);
callBackSubmit({ str: flowIDs }); callBackSubmit({ str: flowIDs });
}; };
...@@ -29,25 +28,41 @@ const SortModal = props => { ...@@ -29,25 +28,41 @@ const SortModal = props => {
orderTable.map(item => { orderTable.map(item => {
ids.push(item.ID); ids.push(item.ID);
}); });
console.log(ids);
setFlowIDs(ids); setFlowIDs(ids);
}, [orderTable]); }, [orderTable]);
useEffect(() => { useEffect(() => {
console.log(sortData1);
if (visible) { if (visible) {
setOrderTable(sortData1); let aa = [];
keepIdValue.map(i => {
i.root.map(j => {
aa.push(j);
});
});
setOrderTable(aa);
} }
}, [visible]); }, [visible]);
// 拖拽回调函数 // 拖拽回调函数
const dragCallBack = data => { const dragCallBack = data => {
console.log(data);
if (data) { if (data) {
setOrderTable(data); setOrderTable(data);
} }
}; };
const columns = [ const columns = [
{
title: '序号',
dataIndex: 'order',
width: 50,
key: 'order',
},
{
title: '业务类型',
dataIndex: 'businessType',
width: 150,
key: 'businessType',
},
{ {
title: '字段名', title: '字段名',
dataIndex: 'name', dataIndex: 'name',
...@@ -55,47 +70,33 @@ const SortModal = props => { ...@@ -55,47 +70,33 @@ const SortModal = props => {
key: 'name', key: 'name',
}, },
]; ];
return ( return (
<Modal <Modal
title={title} title={title}
width="600px"
visible={visible} visible={visible}
onCancel={onCancel} onCancel={onCancel}
onOk={onSumbit} onOk={onSumbit}
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
> >
<div <div className={styles.cardContent} style={{ width: '90%', marginLeft: '24px' }}>
className={styles.cardContent} <div style={{ minHeight: '200px' }}>
style={{ width: '26rem', marginLeft: '24px', maxHeight: '400px', overflow: 'auto' }}
>
<div className={styles.doctorTable}>
{/* <table style={{ width: '104%', marginLeft: '-5px' }}>
<thead>
<tr>
<td>事件名称</td>
</tr>
</thead>
<tbody id="doctor-drag-items">
{sortData1.map((item, index) => (
<tr drag-id={item.ID} key={item.ID} style={{ cursor: 'move' }}>
<td>
<span title={item.name}>{item.name}</span>
</td>
</tr>
))}
</tbody>
</table> */}
<DragTable <DragTable
bordered bordered
style={{ marginBottom: '10px' }} style={{ marginBottom: '10px' }}
rowKey={record => record.extendID} rowKey={record => record.extendID}
columns={columns} columns={columns}
dataSource={orderTable} dataSource={orderTable}
showHeader={false} // showHeader={false}
pagination={false} pagination={false}
size="small" size="small"
dragCallBack={dragCallBack} dragCallBack={dragCallBack}
ItemTypes="flowOrder" ItemTypes="flowOrder"
scroll={{
y: 500,
}}
/> />
</div> </div>
</div> </div>
......
...@@ -70,6 +70,7 @@ const incident = () => { ...@@ -70,6 +70,7 @@ const incident = () => {
const [maxLength, setMaxLength] = useState(0); const [maxLength, setMaxLength] = useState(0);
const [pickItem, setPickItem] = useState(''); const [pickItem, setPickItem] = useState('');
const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引 const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引
const [keepIdValue, setKeepIdValue] = useState([])
const columns = [ const columns = [
{ {
...@@ -252,6 +253,7 @@ const incident = () => { ...@@ -252,6 +253,7 @@ const incident = () => {
setTreeLoading(false); setTreeLoading(false);
if (res.code === 0) { if (res.code === 0) {
console.log(res.data); console.log(res.data);
setKeepIdValue(res.data);
// setMaxLength(res.data.root.length + 1) // setMaxLength(res.data.root.length + 1)
let arr = formateArrDataA(res.data, 'businessType'); let arr = formateArrDataA(res.data, 'businessType');
console.log(arr); console.log(arr);
...@@ -599,6 +601,7 @@ const incident = () => { ...@@ -599,6 +601,7 @@ const incident = () => {
pickItem={pickItem} pickItem={pickItem}
onCancel={() => setSortVisible(false)} onCancel={() => setSortVisible(false)}
callBackSubmit={onOK} callBackSubmit={onOK}
keepIdValue={keepIdValue}
/> />
</div> </div>
</div> </div>
......
...@@ -324,6 +324,7 @@ const Flow = () => { ...@@ -324,6 +324,7 @@ const Flow = () => {
<Order <Order
visible={visible.order} visible={visible.order}
tableData={tableData} tableData={tableData}
processData={processData}
handleCancel={() => showModal('order', false)} handleCancel={() => showModal('order', false)}
submitCallBack={() => { submitCallBack={() => {
showModal('order', false); showModal('order', false);
......
...@@ -10,17 +10,26 @@ import { flowReOrder } from '@/services/flow/flow'; ...@@ -10,17 +10,26 @@ import { flowReOrder } from '@/services/flow/flow';
import { Modal, notification } from 'antd'; import { Modal, notification } from 'antd';
import DragTable from '@/components/DragTable/DragTable'; import DragTable from '@/components/DragTable/DragTable';
const Order = props => { const Order = props => {
const { visible, handleCancel, tableData, submitCallBack } = props; const { visible, handleCancel, tableData, submitCallBack, processData } = props;
const [orderTable, setOrderTable] = useState([]); const [orderTable, setOrderTable] = useState([]);
const [flowIDs, setFlowIDs] = useState(''); const [flowIDs, setFlowIDs] = useState('');
// 页面弹出的时候初始化拖拽数据 // 页面弹出的时候初始化拖拽数据
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
setOrderTable(() => { console.log(tableData);
let table; console.log(processData);
table = tableData.filter(item => item.extendID !== -1); let aa = [];
return table; processData.map(i => {
i.root.map(j => {
aa.push(j);
});
}); });
setOrderTable(aa);
// setOrderTable(() => {
// let table;
// table = tableData.filter(item => item.extendID !== -1);
// return table;
// });
} }
}, [visible]); }, [visible]);
// 根据orderTable值改变flowIDs // 根据orderTable值改变flowIDs
...@@ -61,6 +70,18 @@ const Order = props => { ...@@ -61,6 +70,18 @@ const Order = props => {
} }
}; };
const columns = [ const columns = [
{
title: '序号',
dataIndex: 'order',
width: 50,
key: 'order',
},
{
title: '分组名',
dataIndex: 'group',
width: 150,
key: 'group',
},
{ {
title: '字段名', title: '字段名',
dataIndex: 'name', dataIndex: 'name',
...@@ -71,24 +92,28 @@ const Order = props => { ...@@ -71,24 +92,28 @@ const Order = props => {
return ( return (
<Modal <Modal
title="调整顺序" title="调整顺序"
width="600px"
visible={visible} visible={visible}
onOk={onSubmit} onOk={onSubmit}
onCancel={handleCancel} onCancel={handleCancel}
maskClosable={false} maskClosable={false}
destroyOnClose destroyOnClose
> >
<div style={{ maxHeight: '400px', overflow: 'auto' }}> <div style={{ minHeight: '200px' }}>
<DragTable <DragTable
bordered bordered
style={{ marginBottom: '10px' }} style={{ marginBottom: '10px' }}
rowKey={record => record.extendID} rowKey={record => record.extendID}
columns={columns} columns={columns}
dataSource={orderTable} dataSource={orderTable}
showHeader={false} // showHeader={false}
pagination={false} pagination={false}
size="small" size="small"
dragCallBack={dragCallBack} dragCallBack={dragCallBack}
ItemTypes="flowOrder" ItemTypes="flowOrder"
scroll={{
y: 500,
}}
/> />
</div> </div>
</Modal> </Modal>
......
...@@ -41,6 +41,7 @@ const NewSelectUser = props => { ...@@ -41,6 +41,7 @@ const NewSelectUser = props => {
}; };
// 获取初始数据 // 获取初始数据
const getInitialData = () => { const getInitialData = () => {
console.log(itemObj);
let p1 = getStationUsers({ stationId: itemObj.roleID }); let p1 = getStationUsers({ stationId: itemObj.roleID });
let p2 = GetGroupUserTree({ let p2 = GetGroupUserTree({
key: '', key: '',
......
...@@ -43,6 +43,7 @@ const SelectUser = props => { ...@@ -43,6 +43,7 @@ const SelectUser = props => {
}; };
// 获取初始数据 // 获取初始数据
const getInitialData = () => { const getInitialData = () => {
console.log(itemObj);
let p1 = getStationUsers({ stationId: itemObj.roleID }); let p1 = getStationUsers({ stationId: itemObj.roleID });
let p2 = GetGroupUserTree({ let p2 = GetGroupUserTree({
key: '', key: '',
......
...@@ -2,7 +2,6 @@ import useModal from 'antd/lib/modal/useModal'; ...@@ -2,7 +2,6 @@ import useModal from 'antd/lib/modal/useModal';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import SiteModal from '@/components/Modal/SiteModa'; import SiteModal from '@/components/Modal/SiteModa';
import classnames from 'classnames'; import classnames from 'classnames';
import styles from './UserModal.less';
import lodash, { clone } from 'lodash'; import lodash, { clone } from 'lodash';
import { Card, Empty, Pagination, Checkbox, notification, Input, Row, Col } from 'antd'; import { Card, Empty, Pagination, Checkbox, notification, Input, Row, Col } from 'antd';
import { import {
...@@ -18,6 +17,7 @@ import { ...@@ -18,6 +17,7 @@ import {
} from '@/services/siteManage/api'; } from '@/services/siteManage/api';
import { UserOutlined } from '@ant-design/icons'; import { UserOutlined } from '@ant-design/icons';
import qs from 'qs'; import qs from 'qs';
import styles from './UserModal.less';
const { Search } = Input; const { Search } = Input;
const placeholder = '请输入机构名称'; const placeholder = '请输入机构名称';
const UserModal = props => { const UserModal = props => {
...@@ -44,9 +44,11 @@ const UserModal = props => { ...@@ -44,9 +44,11 @@ const UserModal = props => {
}, [visible]); }, [visible]);
// 切换站点,提交时触发已勾选列表更新 // 切换站点,提交时触发已勾选列表更新
useEffect(() => { useEffect(() => {
if (!itemObj) return; // if (!itemObj) return;
// getAllcheckList(); // getAllcheckList();
getAllCheckListNew(); if (itemObj) {
getAllCheckListNew();
}
}, [itemObj, updateCheck]); }, [itemObj, updateCheck]);
// 获取当前站点可编辑用户(已勾选和未勾选)分页展示 // 获取当前站点可编辑用户(已勾选和未勾选)分页展示
...@@ -56,7 +58,7 @@ const UserModal = props => { ...@@ -56,7 +58,7 @@ const UserModal = props => {
PageIndex: +page.pageNum, PageIndex: +page.pageNum,
PageSize: +page.pageSize, PageSize: +page.pageSize,
}; };
console.log(123) console.log(123);
if (name) params = { ...params, name }; if (name) params = { ...params, name };
groupUserPagingList(params).then(res => { groupUserPagingList(params).then(res => {
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
......
...@@ -228,6 +228,7 @@ const SiteManageV2 = () => { ...@@ -228,6 +228,7 @@ const SiteManageV2 = () => {
}); });
} }
handleShowModal('loading', false); handleShowModal('loading', false);
console.log(lodash.cloneDeep(list));
setdataList(lodash.cloneDeep(list)); setdataList(lodash.cloneDeep(list));
setTotal(res.data.count); setTotal(res.data.count);
} else { } else {
...@@ -624,8 +625,30 @@ const SiteManageV2 = () => { ...@@ -624,8 +625,30 @@ const SiteManageV2 = () => {
} }
}); });
}; };
const indeterminate = i => {
let aa = [];
i.users.map(i => {
if (i.isChecked) {
aa.push(i.userName);
}
});
if (i.isChecked) {
console.log(12);
return false;
}
if (!i.isChecked && aa.length < i.users.length && aa.length != 0) {
console.log(34);
return true;
}
if (!i.isChecked && aa.length == 0) {
console.log(56);
return false;
}
};
const Panels = React.memo(props => { const Panels = React.memo(props => {
let { index, groupId, groupName, users, isChecked, isShow, color } = props; let { index, groupId, groupName, users, isChecked, isShow, color, item } = props;
return ( return (
<div className={styles.sitePanel} key={groupId} id={`siteId${groupId}`}> <div className={styles.sitePanel} key={groupId} id={`siteId${groupId}`}>
{/* onClick={() => props.handleChangeCollpase(GroupId, isShow)} */} {/* onClick={() => props.handleChangeCollpase(GroupId, isShow)} */}
...@@ -642,6 +665,7 @@ const SiteManageV2 = () => { ...@@ -642,6 +665,7 @@ const SiteManageV2 = () => {
key="0" key="0"
className={styles.siteListTitle} className={styles.siteListTitle}
checked={isChecked} checked={isChecked}
indeterminate={indeterminate(item)}
onClick={e => props.handleChangeAll(e, index)} onClick={e => props.handleChangeAll(e, index)}
> >
全选 全选
...@@ -856,6 +880,7 @@ const SiteManageV2 = () => { ...@@ -856,6 +880,7 @@ const SiteManageV2 = () => {
handleChangeCollpase={handleChangeCollpase} handleChangeCollpase={handleChangeCollpase}
handleChangeAll={handleChangeAll} handleChangeAll={handleChangeAll}
handleChangeSignel={handleChangeSignel} handleChangeSignel={handleChangeSignel}
item={item}
/> />
))} ))}
</div> </div>
......
...@@ -16,14 +16,9 @@ const AddUserModal = props => { ...@@ -16,14 +16,9 @@ const AddUserModal = props => {
const submitAddOrg = () => { const submitAddOrg = () => {
// 顶级机构 // 顶级机构
if (orgID == -1) { if (orgID == -1) {
addOrg( addOrg(orgID, addOrgForm.getFieldsValue().OUName, addOrgForm.getFieldsValue().description)
orgID,
addOrgForm.getFieldValue('OUName'),
addOrgForm.getFieldValue('desrciption') || '',
'',
)
.then(res => { .then(res => {
if (res.msg === 'Ok') { if (res.code === 0) {
onCancel(); onCancel();
notification.success({ notification.success({
message: '提交成功', message: '提交成功',
...@@ -44,14 +39,9 @@ const AddUserModal = props => { ...@@ -44,14 +39,9 @@ const AddUserModal = props => {
message.error(err); message.error(err);
}); });
} else { } else {
addOrg( addOrg(orgID.id, addOrgForm.getFieldsValue().OUName, addOrgForm.getFieldsValue().description)
orgID.id,
addOrgForm.getFieldValue('OUName'),
addOrgForm.getFieldValue('desrciption') || '',
'',
)
.then(res => { .then(res => {
if (res.msg === 'Ok') { if (res.code === 0) {
onCancel(); onCancel();
notification.success({ notification.success({
message: '提交成功', message: '提交成功',
......
...@@ -18,9 +18,7 @@ const EditOrgModal = props => { ...@@ -18,9 +18,7 @@ const EditOrgModal = props => {
console.log(orgTitle1); console.log(orgTitle1);
console.log(orgID); console.log(orgID);
if (visible && orgID) { if (visible && orgID) {
console.log(orgID.text); editOrgForm.setFieldsValue({ OUName: orgID.text, description: orgID.describe });
editOrgForm.setFieldsValue({ OUName: orgID.text });
console.log(editOrgForm.getFieldValue('OUName'));
} }
}, [visible]); }, [visible]);
...@@ -28,9 +26,8 @@ const EditOrgModal = props => { ...@@ -28,9 +26,8 @@ const EditOrgModal = props => {
const submitEditOrg = () => const submitEditOrg = () =>
editOrgInfo( editOrgInfo(
orgID.id, orgID.id,
editOrgForm.getFieldValue('OUName'), editOrgForm.getFieldsValue().OUName,
editOrgForm.getFieldValue('description') || '', editOrgForm.getFieldsValue().description,
'',
) )
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
......
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