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

事件工单全局排序

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