|
|
@@ -17,6 +17,7 @@ class DoctorScreen extends React.Component {
|
|
|
waitPat: [],
|
|
|
callPat: [],
|
|
|
reWaitPat: [],
|
|
|
+ copyReWaitPat: [],
|
|
|
};
|
|
|
}
|
|
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
|
@@ -25,7 +26,13 @@ class DoctorScreen extends React.Component {
|
|
|
patList: JSON.parse(JSON.stringify(nextProps?.patList || [])), // 防止重复渲染
|
|
|
callPat: nextProps?.callPat || [],
|
|
|
waitPat: initArray(nextProps?.waitPat || [], 7),
|
|
|
- reWaitPat: initArray(nextProps?.reWaitPat || [], 8),
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (nextProps && 'reWaitPat' in nextProps && JSON.stringify(nextProps.reWaitPat) !== JSON.stringify(prevState.copyReWaitPat)) {
|
|
|
+ let nReWaitPat = nextProps?.reWaitPat || [];
|
|
|
+ return {
|
|
|
+ copyReWaitPat: JSON.parse(JSON.stringify(nReWaitPat)), // 防止重复渲染
|
|
|
+ reWaitPat: initArray(nReWaitPat, 8),
|
|
|
};
|
|
|
}
|
|
|
return null;
|