|
@@ -1,5 +1,5 @@
|
|
|
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
|
-import { UnorderedListOutlined } from '@ant-design/icons';
|
|
|
|
|
|
|
+import { UnorderedListOutlined, PlusOutlined } from '@ant-design/icons';
|
|
|
import { Button, Modal, message, Alert, Avatar, Spin, Select, Menu, Dropdown } from 'antd';
|
|
import { Button, Modal, message, Alert, Avatar, Spin, Select, Menu, Dropdown } from 'antd';
|
|
|
import { connect } from 'dva';
|
|
import { connect } from 'dva';
|
|
|
import styles from './Index.less';
|
|
import styles from './Index.less';
|
|
@@ -17,6 +17,8 @@ import TimeNode from './TimeNode';
|
|
|
import FilesModal from './FilesModal';
|
|
import FilesModal from './FilesModal';
|
|
|
import VersionModal from './VersionModal';
|
|
import VersionModal from './VersionModal';
|
|
|
import CommitAuditModal from './CommitAuditModal';
|
|
import CommitAuditModal from './CommitAuditModal';
|
|
|
|
|
+import CommentContent from '@/components/CommentContent';
|
|
|
|
|
+import MergeModal from './MergeModal';
|
|
|
import { GetTokenFromUrl, getToken } from '@/utils/utils';
|
|
import { GetTokenFromUrl, getToken } from '@/utils/utils';
|
|
|
import { queryDetail } from '@/services/boom';
|
|
import { queryDetail } from '@/services/boom';
|
|
|
const LocalData = localStorage.luckysheet;
|
|
const LocalData = localStorage.luckysheet;
|
|
@@ -36,10 +38,12 @@ function Detail(props) {
|
|
|
template,
|
|
template,
|
|
|
versionList,
|
|
versionList,
|
|
|
auditList,
|
|
auditList,
|
|
|
|
|
+ flowDetail,
|
|
|
match: { params },
|
|
match: { params },
|
|
|
} = props;
|
|
} = props;
|
|
|
// const audit_status = 0
|
|
// const audit_status = 0
|
|
|
const [commentVisible, setCommentVisible] = useState(false);
|
|
const [commentVisible, setCommentVisible] = useState(false);
|
|
|
|
|
+ const [mergeVisible, setMergeVisible] = useState(false);
|
|
|
const [compareVisible, setCompareVisible] = useState(false);
|
|
const [compareVisible, setCompareVisible] = useState(false);
|
|
|
const [exportVisible, setExportVisible] = useState(false);
|
|
const [exportVisible, setExportVisible] = useState(false);
|
|
|
const [commitVisible, setCommitVisible] = useState(false);
|
|
const [commitVisible, setCommitVisible] = useState(false);
|
|
@@ -74,6 +78,7 @@ function Detail(props) {
|
|
|
// const [excelId, setExcelId] = useState(parseInt(params.excelId));
|
|
// const [excelId, setExcelId] = useState(parseInt(params.excelId));
|
|
|
// const excelId = parseInt(params.excelId);
|
|
// const excelId = parseInt(params.excelId);
|
|
|
const projectId = parseInt(params.projectId);
|
|
const projectId = parseInt(params.projectId);
|
|
|
|
|
+ const templateId = parseInt(params.templateId);
|
|
|
|
|
|
|
|
const flow = useMemo(() => {
|
|
const flow = useMemo(() => {
|
|
|
let data = {
|
|
let data = {
|
|
@@ -106,22 +111,42 @@ function Detail(props) {
|
|
|
return data;
|
|
return data;
|
|
|
}, [auditList, version]);
|
|
}, [auditList, version]);
|
|
|
const audit_status = flow.active_audit;
|
|
const audit_status = flow.active_audit;
|
|
|
|
|
+
|
|
|
|
|
+ const isAuditor = useMemo(() => {
|
|
|
|
|
+ const getUserRole = () => {
|
|
|
|
|
+ let item = flow.currentNode?.user?.find?.(item => item.ID == currentUser.ID);
|
|
|
|
|
+ if (item) return true;
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+ return audit_status == 1 && getUserRole();
|
|
|
|
|
+ }, [audit_status, flow, currentUser]);
|
|
|
// const audit_status = 1;
|
|
// const audit_status = 1;
|
|
|
|
|
|
|
|
const onSave = () => {
|
|
const onSave = () => {
|
|
|
- setEdit(false);
|
|
|
|
|
- statusRef.current.edit = false;
|
|
|
|
|
- sheetRef.current.toggleEdit(false);
|
|
|
|
|
- let jsonData = sheetRef.current.getSheetJson();
|
|
|
|
|
- console.log(jsonData);
|
|
|
|
|
- let newExcl = {
|
|
|
|
|
- ...sheet,
|
|
|
|
|
- excel_id: version.id,
|
|
|
|
|
- title: '',
|
|
|
|
|
- data: jsonData.data,
|
|
|
|
|
- };
|
|
|
|
|
- setSheet(newExcl);
|
|
|
|
|
- localStorage.luckysheet = JSON.stringify(newExcl);
|
|
|
|
|
|
|
+ let sheet1 = compareList[0];
|
|
|
|
|
+ Modal.confirm({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: `是否确认保存【${sheet1.version_name || sheet1.name}】`,
|
|
|
|
|
+ okText: '确定',
|
|
|
|
|
+ cancelText: '取消',
|
|
|
|
|
+ onOk() {
|
|
|
|
|
+ let sheetData = sheetRef3.current.getSheetJson().data;
|
|
|
|
|
+ sheetData.forEach(sheet => {
|
|
|
|
|
+ delete sheet.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ ...sheet1,
|
|
|
|
|
+ data: JSON.stringify(sheetData),
|
|
|
|
|
+ };
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'detail/commitSheet',
|
|
|
|
|
+ payload: params,
|
|
|
|
|
+ callback: () => {
|
|
|
|
|
+ onCompare(false);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const onCompare = async checkSheets => {
|
|
const onCompare = async checkSheets => {
|
|
@@ -189,7 +214,7 @@ function Detail(props) {
|
|
|
className={styles.sheet}
|
|
className={styles.sheet}
|
|
|
ref={!index ? sheetRef3 : sheetRef2}
|
|
ref={!index ? sheetRef3 : sheetRef2}
|
|
|
data={item.data || null}
|
|
data={item.data || null}
|
|
|
- onClickCell={onClickCell}
|
|
|
|
|
|
|
+ // onClickCell={onClickCell}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
@@ -211,7 +236,7 @@ function Detail(props) {
|
|
|
...payload,
|
|
...payload,
|
|
|
sheet_index: (s.seq || 0) + '',
|
|
sheet_index: (s.seq || 0) + '',
|
|
|
};
|
|
};
|
|
|
- setCommentVisible(true);
|
|
|
|
|
|
|
+ // setCommentVisible(true);
|
|
|
}
|
|
}
|
|
|
// 比对模式下双excl同步选中
|
|
// 比对模式下双excl同步选中
|
|
|
// if (statusRef.current.compare) {
|
|
// if (statusRef.current.compare) {
|
|
@@ -254,6 +279,24 @@ function Detail(props) {
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ const onUpdate = () => {
|
|
|
|
|
+ let currentData = sheetRef.current.getSheetJson().data;
|
|
|
|
|
+ let sheets = JSON.parse(JSON.stringify(currentData));
|
|
|
|
|
+ sheets.forEach(item => {
|
|
|
|
|
+ delete item.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(sheets);
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ ...version,
|
|
|
|
|
+ data: JSON.stringify(sheets),
|
|
|
|
|
+ };
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'detail/saveSheet',
|
|
|
|
|
+ payload: params,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// const onCommit = values => {
|
|
// const onCommit = values => {
|
|
|
// var flowNode = flow.currentNode;
|
|
// var flowNode = flow.currentNode;
|
|
|
|
|
|
|
@@ -356,6 +399,13 @@ function Detail(props) {
|
|
|
node_id: flowNode.seq,
|
|
node_id: flowNode.seq,
|
|
|
},
|
|
},
|
|
|
callback: newVersion => {
|
|
callback: newVersion => {
|
|
|
|
|
+ // 更新flow流程图
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'xflow/queryBoomFlowDetail',
|
|
|
|
|
+ payload: {
|
|
|
|
|
+ id: templateId,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
if (flow.current == flow.list.FlowNodes.length - 1) {
|
|
if (flow.current == flow.list.FlowNodes.length - 1) {
|
|
|
// 最后一个审核节点通过后 需要更新version id
|
|
// 最后一个审核节点通过后 需要更新version id
|
|
|
localStorage.excelId = newVersion.id;
|
|
localStorage.excelId = newVersion.id;
|
|
@@ -371,15 +421,18 @@ function Detail(props) {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const onMerge = () => {
|
|
const onMerge = () => {
|
|
|
|
|
+ const [sheet1, sheet2] = compareList;
|
|
|
Modal.confirm({
|
|
Modal.confirm({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
|
- content: '是否确认同步最新版本新增项',
|
|
|
|
|
|
|
+ content: `是否确认将【${sheet2.version_name}】改动的内容同步至【${sheet1.version_name ||
|
|
|
|
|
+ sheet1.name}】`,
|
|
|
okText: '确定',
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
cancelText: '取消',
|
|
|
onOk() {
|
|
onOk() {
|
|
|
- sheetRef.current.mergeExcl(compareList[1].data);
|
|
|
|
|
- setCompareList([...compareList]);
|
|
|
|
|
- // let currentData = sheetRef.current.getSheetJson()
|
|
|
|
|
|
|
+ // let sheet2Data = sheetRef2.current.getSheetJson()
|
|
|
|
|
+ sheetRef3.current.mergeExcl(sheetRef2.current.updateCell);
|
|
|
|
|
+ // setCompareList([...compareList]);
|
|
|
|
|
+ // let currentData = sheetRef3.current.getSheetJson()
|
|
|
// // 更新后重新比对
|
|
// // 更新后重新比对
|
|
|
// sheetRef2.current.toggleCompare(false);
|
|
// sheetRef2.current.toggleCompare(false);
|
|
|
// sheetRef2.current.toggleCompare(true, currentData);
|
|
// sheetRef2.current.toggleCompare(true, currentData);
|
|
@@ -387,76 +440,85 @@ function Detail(props) {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleClickCommit = async () => {
|
|
|
|
|
- const { list } = await queryHistory();
|
|
|
|
|
- let lastCommit = list[0];
|
|
|
|
|
- // 判断当前版本是否为最新版本
|
|
|
|
|
- if (lastCommit && sheet.guid != lastCommit.guid) {
|
|
|
|
|
- Modal.confirm({
|
|
|
|
|
- title: '提示',
|
|
|
|
|
- content: '当前版本与最新版本不匹配,将进入比对模式确认版本差异。',
|
|
|
|
|
- okText: '比对',
|
|
|
|
|
- cancelText: '返回',
|
|
|
|
|
- onOk() {
|
|
|
|
|
- dispatch({
|
|
|
|
|
- type: 'detail/queryHistoryDetail',
|
|
|
|
|
- payload: {
|
|
|
|
|
- excel_id: lastCommit.excel_id,
|
|
|
|
|
- history_id: lastCommit.id,
|
|
|
|
|
- },
|
|
|
|
|
- callback: sheets => {
|
|
|
|
|
- setIsMerge(true);
|
|
|
|
|
- let currentSheet = {
|
|
|
|
|
- ...sheet,
|
|
|
|
|
- name: '当前版本',
|
|
|
|
|
- };
|
|
|
|
|
- let lastSheet = {
|
|
|
|
|
- ...lastCommit,
|
|
|
|
|
- name: `线上最新版本(${lastCommit.version_name})`,
|
|
|
|
|
- data: sheets,
|
|
|
|
|
- };
|
|
|
|
|
- onCompare([currentSheet, lastSheet]);
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- setCommitVisible(true);
|
|
|
|
|
|
|
+ const onMergeVersion = async sheet2 => {
|
|
|
|
|
+ // const [sheet1, sheet2] = checkSheets;
|
|
|
|
|
+ const sheet1 = version;
|
|
|
|
|
+ if (!sheet1.data) {
|
|
|
|
|
+ sheet1.data = (
|
|
|
|
|
+ await queryDetail({
|
|
|
|
|
+ excel_id: sheet1.id,
|
|
|
|
|
+ })
|
|
|
|
|
+ ).data;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!sheet2.data) {
|
|
|
|
|
+ sheet2.data = (
|
|
|
|
|
+ await queryDetail({
|
|
|
|
|
+ excel_id: sheet2.id,
|
|
|
|
|
+ })
|
|
|
|
|
+ ).data;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- setCommentVisible(false);
|
|
|
|
|
|
|
+ setIsMerge(true);
|
|
|
|
|
+ setCompareList([sheet1, sheet2]);
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ // sheetRef3.current.mergeExcl(sheet.data);
|
|
|
|
|
+ // }, 400);
|
|
|
};
|
|
};
|
|
|
|
|
+ // const handleClickCommit = async () => {
|
|
|
|
|
+ // const { list } = await queryHistory();
|
|
|
|
|
+ // let lastCommit = list[0];
|
|
|
|
|
+ // // 判断当前版本是否为最新版本
|
|
|
|
|
+ // if (lastCommit && sheet.guid != lastCommit.guid) {
|
|
|
|
|
+ // Modal.confirm({
|
|
|
|
|
+ // title: '提示',
|
|
|
|
|
+ // content: '当前版本与最新版本不匹配,将进入比对模式确认版本差异。',
|
|
|
|
|
+ // okText: '比对',
|
|
|
|
|
+ // cancelText: '返回',
|
|
|
|
|
+ // onOk() {
|
|
|
|
|
+ // dispatch({
|
|
|
|
|
+ // type: 'detail/queryHistoryDetail',
|
|
|
|
|
+ // payload: {
|
|
|
|
|
+ // excel_id: lastCommit.excel_id,
|
|
|
|
|
+ // history_id: lastCommit.id,
|
|
|
|
|
+ // },
|
|
|
|
|
+ // callback: sheets => {
|
|
|
|
|
+ // setIsMerge(true);
|
|
|
|
|
+ // let currentSheet = {
|
|
|
|
|
+ // ...sheet,
|
|
|
|
|
+ // name: '当前版本',
|
|
|
|
|
+ // };
|
|
|
|
|
+ // let lastSheet = {
|
|
|
|
|
+ // ...lastCommit,
|
|
|
|
|
+ // name: `线上最新版本(${lastCommit.version_name})`,
|
|
|
|
|
+ // data: sheets,
|
|
|
|
|
+ // };
|
|
|
|
|
+ // onCompare([currentSheet, lastSheet]);
|
|
|
|
|
+ // },
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
|
|
+ // });
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // setCommitVisible(true);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- const handleEdit = status => {
|
|
|
|
|
- if (!status) {
|
|
|
|
|
- // 还原数据
|
|
|
|
|
- sheetRef.current.renderSheet(sheet.data);
|
|
|
|
|
- }
|
|
|
|
|
- setCommentVisible(false);
|
|
|
|
|
- setEdit(status);
|
|
|
|
|
- statusRef.current.edit = status;
|
|
|
|
|
- sheetRef.current.toggleEdit(status);
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // setCommentVisible(false);
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ // const handleEdit = status => {
|
|
|
|
|
+ // if (!status) {
|
|
|
|
|
+ // // 还原数据
|
|
|
|
|
+ // sheetRef.current.renderSheet(sheet.data);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // setCommentVisible(false);
|
|
|
|
|
+ // setEdit(status);
|
|
|
|
|
+ // statusRef.current.edit = status;
|
|
|
|
|
+ // sheetRef.current.toggleEdit(status);
|
|
|
|
|
+ // };
|
|
|
|
|
|
|
|
const handleClickFile = () => {
|
|
const handleClickFile = () => {
|
|
|
fileRef.current.click();
|
|
fileRef.current.click();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const getUserRole = () => {
|
|
|
|
|
- // if (currentUser.ID == flow.currentNode?.auditor) return true;
|
|
|
|
|
- let item = flow.currentNode?.user?.find?.(item => item.ID == currentUser.ID);
|
|
|
|
|
- if (item) return true;
|
|
|
|
|
- // let roleId = Number(flow.currentNode?.audit_role);
|
|
|
|
|
- // console.log(roleId);
|
|
|
|
|
- // if (roleId) {
|
|
|
|
|
- // let role = roleList.find(item => item.ID == roleId);
|
|
|
|
|
- // if (role) {
|
|
|
|
|
- // return role.User.find(item => item.ID == currentUser.ID);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- return false;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const handleMenuClick = e => {
|
|
const handleMenuClick = e => {
|
|
|
console.log('click', e);
|
|
console.log('click', e);
|
|
|
switch (e.key) {
|
|
switch (e.key) {
|
|
@@ -470,6 +532,10 @@ function Detail(props) {
|
|
|
// setCommentVisible(false);
|
|
// setCommentVisible(false);
|
|
|
// setHistoryVisible(true);
|
|
// setHistoryVisible(true);
|
|
|
// break;
|
|
// break;
|
|
|
|
|
+ case 'bomDetail':
|
|
|
|
|
+ // 版本
|
|
|
|
|
+ setCommentVisible(true);
|
|
|
|
|
+ break;
|
|
|
case 'export':
|
|
case 'export':
|
|
|
// 导出
|
|
// 导出
|
|
|
handleExportClick();
|
|
handleExportClick();
|
|
@@ -503,7 +569,7 @@ function Detail(props) {
|
|
|
// handleEdit(true);
|
|
// handleEdit(true);
|
|
|
case 'merge':
|
|
case 'merge':
|
|
|
// 同步版本
|
|
// 同步版本
|
|
|
-
|
|
|
|
|
|
|
+ setMergeVisible(true);
|
|
|
break;
|
|
break;
|
|
|
case 'commit':
|
|
case 'commit':
|
|
|
// 提交
|
|
// 提交
|
|
@@ -524,27 +590,27 @@ function Detail(props) {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const renderBtns = () => {
|
|
const renderBtns = () => {
|
|
|
- if (edit) {
|
|
|
|
|
- return (
|
|
|
|
|
- <>
|
|
|
|
|
- <Button type="primary" onClick={onSave}>
|
|
|
|
|
- 保存
|
|
|
|
|
- </Button>
|
|
|
|
|
- <Button onClick={() => handleEdit(false)}>取消</Button>
|
|
|
|
|
- </>
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (edit) {
|
|
|
|
|
+ // return (
|
|
|
|
|
+ // <>
|
|
|
|
|
+ // <Button type="primary" onClick={onSave}>
|
|
|
|
|
+ // 保存
|
|
|
|
|
+ // </Button>
|
|
|
|
|
+ // <Button onClick={() => handleEdit(false)}>取消</Button>
|
|
|
|
|
+ // </>
|
|
|
|
|
+ // );
|
|
|
|
|
+ // }
|
|
|
// 判断是否为比对模式
|
|
// 判断是否为比对模式
|
|
|
if (compareList.length == 2) {
|
|
if (compareList.length == 2) {
|
|
|
// 判断是否为同步最新版本的比对
|
|
// 判断是否为同步最新版本的比对
|
|
|
if (isMerge) {
|
|
if (isMerge) {
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- {/* <Button type="success" onClick={() => onMerge()}>
|
|
|
|
|
- 同步新增内容
|
|
|
|
|
- </Button>*/}
|
|
|
|
|
- {/* <Button onClick={() => handleEdit(true)}>编辑</Button> */}
|
|
|
|
|
- <Button onClick={() => setCommitVisible(true)}>确认提交</Button>
|
|
|
|
|
|
|
+ <Button type="primary" onClick={() => onSave()}>
|
|
|
|
|
+ 保存
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <Button onClick={() => onMerge()}>同步新增内容</Button>
|
|
|
|
|
+ {/* <Button onClick={() => setCommitVisible(true)}>确认提交</Button> */}
|
|
|
<Button onClick={() => onCompare(false)}>取消比对</Button>
|
|
<Button onClick={() => onCompare(false)}>取消比对</Button>
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
@@ -553,9 +619,9 @@ function Detail(props) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let isAuditor = audit_status == 1 && getUserRole();
|
|
|
|
|
const menuList = [
|
|
const menuList = [
|
|
|
<Menu.Item key="back">返回</Menu.Item>,
|
|
<Menu.Item key="back">返回</Menu.Item>,
|
|
|
|
|
+ <Menu.Item key="bomDetail">详情</Menu.Item>,
|
|
|
<Menu.Item key="export">导出</Menu.Item>,
|
|
<Menu.Item key="export">导出</Menu.Item>,
|
|
|
<Menu.Item key="commitAudit">提交流转</Menu.Item>,
|
|
<Menu.Item key="commitAudit">提交流转</Menu.Item>,
|
|
|
<Menu.Item key="flow">查看流程</Menu.Item>,
|
|
<Menu.Item key="flow">查看流程</Menu.Item>,
|
|
@@ -567,25 +633,15 @@ function Detail(props) {
|
|
|
// // menuList.push(<Menu.Item key="template">模板</Menu.Item>);
|
|
// // menuList.push(<Menu.Item key="template">模板</Menu.Item>);
|
|
|
// }
|
|
// }
|
|
|
if (!isAuditor && canEdit()) {
|
|
if (!isAuditor && canEdit()) {
|
|
|
- menuList.push(<Menu.Item key="edit">编辑</Menu.Item>);
|
|
|
|
|
- menuList.push(<Menu.Item key="merge">合并</Menu.Item>);
|
|
|
|
|
- menuList.push(<Menu.Item key="commit">提交</Menu.Item>);
|
|
|
|
|
- if (history.list.length > 0) {
|
|
|
|
|
- menuList.push(<Menu.Item key="approval">申请审批</Menu.Item>);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // menuList.push(<Menu.Item key="edit">编辑</Menu.Item>);
|
|
|
|
|
+ menuList.push(<Menu.Item key="merge">同步</Menu.Item>);
|
|
|
|
|
+ // menuList.push(<Menu.Item key="commit">提交</Menu.Item>);
|
|
|
|
|
+ // if (history.list.length > 0) {
|
|
|
|
|
+ // menuList.push(<Menu.Item key="approval">申请审批</Menu.Item>);
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- {isAuditor && (
|
|
|
|
|
- <>
|
|
|
|
|
- <Button type="primary" onClick={() => onApprove(true)}>
|
|
|
|
|
- 审批通过
|
|
|
|
|
- </Button>
|
|
|
|
|
- <Button onClick={() => onApprove(false)} danger>
|
|
|
|
|
- 审批拒绝
|
|
|
|
|
- </Button>
|
|
|
|
|
- </>
|
|
|
|
|
- )}
|
|
|
|
|
<Dropdown overlay={<Menu onClick={handleMenuClick}>{menuList}</Menu>}>
|
|
<Dropdown overlay={<Menu onClick={handleMenuClick}>{menuList}</Menu>}>
|
|
|
{/* <Button type="primary">
|
|
{/* <Button type="primary">
|
|
|
其他操作 <DownOutlined />
|
|
其他操作 <DownOutlined />
|
|
@@ -797,6 +853,25 @@ function Detail(props) {
|
|
|
setUser(user);
|
|
setUser(user);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const renderNode = () => {
|
|
|
|
|
+ const nodeId = version.template_node_id;
|
|
|
|
|
+ if (!flowDetail?.nodes || !nodeId) return;
|
|
|
|
|
+ const node = flowDetail.nodes.find(item => item.Id == nodeId);
|
|
|
|
|
+ return `当前节点:${node?.label || '-'}`;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleSubmitCell = (value, callback) => {
|
|
|
|
|
+ if (!value) return;
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'detail/addComment',
|
|
|
|
|
+ payload: {
|
|
|
|
|
+ ...cellPosition.current,
|
|
|
|
|
+ comment: value,
|
|
|
|
|
+ },
|
|
|
|
|
+ callback,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
dispatch({
|
|
dispatch({
|
|
|
type: 'detail/queryProjectRecord',
|
|
type: 'detail/queryProjectRecord',
|
|
@@ -807,9 +882,12 @@ function Detail(props) {
|
|
|
dispatch({
|
|
dispatch({
|
|
|
type: 'xflow/queryBoomFlowDetail',
|
|
type: 'xflow/queryBoomFlowDetail',
|
|
|
payload: {
|
|
payload: {
|
|
|
- id: 1,
|
|
|
|
|
|
|
+ id: templateId,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'user/fetchUserList',
|
|
|
|
|
+ });
|
|
|
// 审批流程
|
|
// 审批流程
|
|
|
// dispatch({
|
|
// dispatch({
|
|
|
// type: 'detail/queryAuditList',
|
|
// type: 'detail/queryAuditList',
|
|
@@ -883,13 +961,11 @@ function Detail(props) {
|
|
|
return (
|
|
return (
|
|
|
<Spin spinning={false}>
|
|
<Spin spinning={false}>
|
|
|
{/* <Spin spinning={getLoading()}> */}
|
|
{/* <Spin spinning={getLoading()}> */}
|
|
|
-
|
|
|
|
|
<div className={styles.top}>
|
|
<div className={styles.top}>
|
|
|
- <div style={{ minWidth: 700, marginTop: 20 }}>
|
|
|
|
|
|
|
+ <div>
|
|
|
{/* 当前节点: {version.template_node_id}
|
|
{/* 当前节点: {version.template_node_id}
|
|
|
<br />
|
|
<br />
|
|
|
当前状态:{version.audit_status} */}
|
|
当前状态:{version.audit_status} */}
|
|
|
- <TimeNode nodeId={version.template_node_id} flow={flow}></TimeNode>
|
|
|
|
|
<Select
|
|
<Select
|
|
|
style={{ width: 140, marginLeft: 10 }}
|
|
style={{ width: 140, marginLeft: 10 }}
|
|
|
value={version.id}
|
|
value={version.id}
|
|
@@ -901,14 +977,27 @@ function Detail(props) {
|
|
|
</Option>
|
|
</Option>
|
|
|
))}
|
|
))}
|
|
|
</Select>
|
|
</Select>
|
|
|
- <Button type="primary" onClick={() => setVersionVisible(true)}>
|
|
|
|
|
- 创建版本
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ {flow?.active == 0 && (
|
|
|
|
|
+ <Button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon={<PlusOutlined />}
|
|
|
|
|
+ onClick={() => setVersionVisible(true)}
|
|
|
|
|
+ ></Button>
|
|
|
|
|
+ )}
|
|
|
|
|
+ <span style={{ marginLeft: 20 }}>{renderNode()}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.btns}>
|
|
<div className={styles.btns}>
|
|
|
- {user.map(item => (
|
|
|
|
|
- <Avatar size="large">{item.Name}</Avatar>
|
|
|
|
|
- ))}
|
|
|
|
|
|
|
+ <Avatar.Group style={{ marginRight: 20 }}>
|
|
|
|
|
+ {user.map(item => (
|
|
|
|
|
+ <Avatar
|
|
|
|
|
+ // style={{ backgroundColor: item.id == currentUser.ID ? '#008dff' : '' }}
|
|
|
|
|
+ size="large"
|
|
|
|
|
+ >
|
|
|
|
|
+ {item.Name}
|
|
|
|
|
+ </Avatar>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ </Avatar.Group>
|
|
|
|
|
+
|
|
|
{renderBtns()}
|
|
{renderBtns()}
|
|
|
</div>
|
|
</div>
|
|
|
<input
|
|
<input
|
|
@@ -918,6 +1007,8 @@ function Detail(props) {
|
|
|
onChange={e => exportExcl(e.target.files)}
|
|
onChange={e => exportExcl(e.target.files)}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <TimeNode flow={flow} isAuditor={isAuditor} onApprove={onApprove}></TimeNode>
|
|
|
|
|
+
|
|
|
{renderAlert()}
|
|
{renderAlert()}
|
|
|
{/* 判断是否为比对模式 */}
|
|
{/* 判断是否为比对模式 */}
|
|
|
{compareList.length == 2 ? (
|
|
{compareList.length == 2 ? (
|
|
@@ -936,17 +1027,25 @@ function Detail(props) {
|
|
|
ref={sheetRef}
|
|
ref={sheetRef}
|
|
|
onClickCell={onClickCell}
|
|
onClickCell={onClickCell}
|
|
|
version={version}
|
|
version={version}
|
|
|
|
|
+ templateId={templateId}
|
|
|
getUser={getUser}
|
|
getUser={getUser}
|
|
|
|
|
+ onUpdate={onUpdate}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
|
|
+ <CommentContent
|
|
|
|
|
+ title="单元格沟通记录"
|
|
|
|
|
+ comment={comment}
|
|
|
|
|
+ onSubmit={handleSubmitCell}
|
|
|
|
|
+ loading={loading.effects['detail/queryComment'] || loading.effects['detail/addComment']}
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
<RightDrawer
|
|
<RightDrawer
|
|
|
version={version}
|
|
version={version}
|
|
|
visible={commentVisible}
|
|
visible={commentVisible}
|
|
|
onClose={() => setCommentVisible(false)}
|
|
onClose={() => setCommentVisible(false)}
|
|
|
- cellPosition={cellPosition}
|
|
|
|
|
/>
|
|
/>
|
|
|
{/* <HistoryModal
|
|
{/* <HistoryModal
|
|
|
visible={historyVisible}
|
|
visible={historyVisible}
|
|
@@ -961,19 +1060,25 @@ function Detail(props) {
|
|
|
onClose={() => setCompareVisible(false)}
|
|
onClose={() => setCompareVisible(false)}
|
|
|
onOk={onCompare}
|
|
onOk={onCompare}
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <MergeModal
|
|
|
|
|
+ visible={mergeVisible}
|
|
|
|
|
+ version={version}
|
|
|
|
|
+ onClose={() => setMergeVisible(false)}
|
|
|
|
|
+ onOk={onMergeVersion}
|
|
|
|
|
+ />
|
|
|
<ExportModal
|
|
<ExportModal
|
|
|
visible={exportVisible}
|
|
visible={exportVisible}
|
|
|
sheet={exportDate.data}
|
|
sheet={exportDate.data}
|
|
|
onClose={() => setExportVisible(false)}
|
|
onClose={() => setExportVisible(false)}
|
|
|
onOk={downloadExcel}
|
|
onOk={downloadExcel}
|
|
|
/>
|
|
/>
|
|
|
- <CommitModal
|
|
|
|
|
|
|
+ {/* <CommitModal
|
|
|
loading={getLoading()}
|
|
loading={getLoading()}
|
|
|
visible={commitVisible}
|
|
visible={commitVisible}
|
|
|
version={version}
|
|
version={version}
|
|
|
onClose={() => setCommitVisible(false)}
|
|
onClose={() => setCommitVisible(false)}
|
|
|
onOk={values => onCommit(values, version.id)}
|
|
onOk={values => onCommit(values, version.id)}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
<FlowModal
|
|
<FlowModal
|
|
|
visible={flowVisible}
|
|
visible={flowVisible}
|
|
|
onClose={() => setFlowVisible(false)}
|
|
onClose={() => setFlowVisible(false)}
|
|
@@ -1013,8 +1118,9 @@ function Detail(props) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export default connect(({ detail, user, loading }) => ({
|
|
|
|
|
|
|
+export default connect(({ detail, user, xflow, loading }) => ({
|
|
|
flow: detail.flow,
|
|
flow: detail.flow,
|
|
|
|
|
+ flowDetail: xflow.flowDetail,
|
|
|
auditList: detail.auditList,
|
|
auditList: detail.auditList,
|
|
|
fileList: detail.fileList,
|
|
fileList: detail.fileList,
|
|
|
history: detail.history,
|
|
history: detail.history,
|