|
|
@@ -32,12 +32,17 @@ export default function Component(props: any) {
|
|
|
|
|
|
const [showErrorPage, setErrorPage] = useState(false)
|
|
|
|
|
|
+ const [setupTime,setSetupTime] = useState(0)
|
|
|
+
|
|
|
+
|
|
|
//未登录<->已登录 状态切换时,执行一次授权检查
|
|
|
useEffect(() => {
|
|
|
getCards();
|
|
|
}, [user.isLogin])
|
|
|
|
|
|
const openModal = () => {
|
|
|
+ setSetupTime(new Date().getTime())
|
|
|
+ debugger
|
|
|
setIsModalOpen(true);
|
|
|
};
|
|
|
|
|
|
@@ -198,7 +203,14 @@ export default function Component(props: any) {
|
|
|
}
|
|
|
|
|
|
uploadMetric(params).then(res => {
|
|
|
- getCards();
|
|
|
+ list.map((item, index) => {
|
|
|
+ if ((item as any).code == (res as any).code) {
|
|
|
+ (item as any).latest_record = (res as any).latest_record
|
|
|
+ }
|
|
|
+ })
|
|
|
+ debugger
|
|
|
+ setList(list)
|
|
|
+ // getCards();
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -235,14 +247,25 @@ export default function Component(props: any) {
|
|
|
code: (metricItem as any).code,
|
|
|
timestamp: time,
|
|
|
date: strDate,
|
|
|
- items: array
|
|
|
+ items: array,
|
|
|
+ extra:{
|
|
|
+ set_time: setupTime,
|
|
|
+ confirm_time: new Date().getTime()
|
|
|
+ }
|
|
|
}
|
|
|
uploadMetric(params).then(res => {
|
|
|
- getCards();
|
|
|
+ // getCards();
|
|
|
(metricItem as any).schemas.map((item, index) => {
|
|
|
item.tempValue = ''
|
|
|
})
|
|
|
|
|
|
+ list.map((item, index) => {
|
|
|
+ if ((item as any).code == (res as any).code) {
|
|
|
+ (item as any).latest_record = (res as any).latest_record
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setList(JSON.parse(JSON.stringify(list)))
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
|