|
@@ -34,6 +34,7 @@ import PreviewFile from '@/components/PreviewFile';
|
|
|
import FormAndFilesNode from './FormAndFilesNode';
|
|
|
import DropdownMenu from './DropdownMenu';
|
|
|
import CurrentInfo from './CurrentInfo';
|
|
|
+import moment from 'moment';
|
|
|
const LocalData = localStorage.luckysheet;
|
|
|
|
|
|
function Detail(props) {
|
|
@@ -71,6 +72,7 @@ function Detail(props) {
|
|
|
diff: 0,
|
|
|
add: 0,
|
|
|
});
|
|
|
+ const [saveTime, setSaveTime] = useState();
|
|
|
const [exportDate, setExportData] = useState([]);
|
|
|
const sheetRef = useRef();
|
|
|
const sheetRef2 = useRef();
|
|
@@ -233,9 +235,13 @@ function Detail(props) {
|
|
|
...version,
|
|
|
data: JSON.stringify(sheets),
|
|
|
};
|
|
|
+
|
|
|
dispatch({
|
|
|
type: 'detail/saveSheet',
|
|
|
payload: params,
|
|
|
+ callback: () => {
|
|
|
+ setSaveTime(moment().format('HH:mm:ss'));
|
|
|
+ },
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -367,6 +373,7 @@ function Detail(props) {
|
|
|
localStorage.excelId = id;
|
|
|
}
|
|
|
setVersion(version);
|
|
|
+ setSaveTime(null);
|
|
|
//请求历史版本
|
|
|
dispatch({
|
|
|
type: 'detail/queryVersionsTree',
|
|
@@ -493,6 +500,12 @@ function Detail(props) {
|
|
|
<CurrentInfo version={version} flowDetail={flowDetail} />
|
|
|
</div>
|
|
|
<div className={styles.btns}>
|
|
|
+ {saveTime && <span style={{ color: '#333', fontSize: 14 }}>上次保存时间 {saveTime}</span>}
|
|
|
+ {version.audit_status === 0 && (
|
|
|
+ <Button type="primary" loading={loading.effects['detail/saveSheet']} onClick={onUpdate}>
|
|
|
+ 保存
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
<Button
|
|
|
type="primary"
|
|
|
style={{ marginRight: 20 }}
|