|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import Taro, { setStorageSync } from "@tarojs/taro";
|
|
|
|
|
import classnames from "classnames";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
@ -40,8 +41,11 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
curIndex: null,
|
|
|
|
|
clockStatistics: [],
|
|
|
|
|
statistics: [],
|
|
|
|
|
yearValue: dayjs().format("YYYY-MM-DD"),
|
|
|
|
|
year: new Date().getFullYear(),
|
|
|
|
|
today: new Date(),
|
|
|
|
|
|
|
|
|
|
startYear: "2000-01-01",
|
|
|
|
|
endYear: dayjs().format("YYYY-MM-DD"),
|
|
|
|
|
monthTime: [
|
|
|
|
|
{ month: 1, time: 0 },
|
|
|
|
|
{ month: 2, time: 0 },
|
|
|
|
|
@ -264,21 +268,31 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
ViewAddInstrument: ViewAddInstrument,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.getRecord(null);
|
|
|
|
|
this.getBindingInstrumentList();
|
|
|
|
|
this.getLatestClockRecord();
|
|
|
|
|
this.getClockStatistics();
|
|
|
|
|
this.DayTime();
|
|
|
|
|
this.setStatusBar();
|
|
|
|
|
this.initData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidShow() {}
|
|
|
|
|
|
|
|
|
|
componentDidHide() {}
|
|
|
|
|
|
|
|
|
|
async initData() {}
|
|
|
|
|
initData = async () => {
|
|
|
|
|
this.getRecord(null);
|
|
|
|
|
Taro.showLoading({
|
|
|
|
|
title: "请求中...",
|
|
|
|
|
mask: true,
|
|
|
|
|
});
|
|
|
|
|
await Promise.all([
|
|
|
|
|
this.getBindingInstrumentList(),
|
|
|
|
|
this.getLatestClockRecord(),
|
|
|
|
|
this.getClockStatistics(),
|
|
|
|
|
this.DayTime(),
|
|
|
|
|
this.setStatusBar(),
|
|
|
|
|
]);
|
|
|
|
|
Taro.hideLoading();
|
|
|
|
|
};
|
|
|
|
|
// 选择年份
|
|
|
|
|
onChangeYear(event) {
|
|
|
|
|
console.log("event", event);
|
|
|
|
|
this.setState({ year: event.detail.value });
|
|
|
|
|
this.getClockStatistics(event.detail.value);
|
|
|
|
|
}
|
|
|
|
|
@ -510,12 +524,13 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
clockStatistics,
|
|
|
|
|
statistics,
|
|
|
|
|
year,
|
|
|
|
|
today,
|
|
|
|
|
monthTime,
|
|
|
|
|
show,
|
|
|
|
|
punchInInfo,
|
|
|
|
|
navigationBarHeight,
|
|
|
|
|
statusBarHeight,
|
|
|
|
|
startYear,
|
|
|
|
|
endYear,
|
|
|
|
|
} = this.state;
|
|
|
|
|
const statusBarHeightRpx = statusBarHeight * 2;
|
|
|
|
|
const navigationBarHeightRpx = navigationBarHeight * 2;
|
|
|
|
|
@ -549,136 +564,128 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
打卡统计
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
{current === 0 && (
|
|
|
|
|
<ScrollView
|
|
|
|
|
className="products_list"
|
|
|
|
|
scroll-x="true"
|
|
|
|
|
style={{
|
|
|
|
|
top: height + 110 + "rpx",
|
|
|
|
|
position: "sticky",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("all", {
|
|
|
|
|
products_item_active: !curIndex,
|
|
|
|
|
})}
|
|
|
|
|
onClick={this.onChangeProduct.bind(this, null)}
|
|
|
|
|
>
|
|
|
|
|
全部
|
|
|
|
|
</View>
|
|
|
|
|
{bindingInstrumentList.map((item: any, index: any) => (
|
|
|
|
|
<View
|
|
|
|
|
key={item.id}
|
|
|
|
|
className={classnames("products_item", {
|
|
|
|
|
products_item_active: curIndex === item.id,
|
|
|
|
|
})}
|
|
|
|
|
onClick={this.onChangeProduct.bind(this, item.id)}
|
|
|
|
|
<View>
|
|
|
|
|
{current === 0 && (
|
|
|
|
|
<Block>
|
|
|
|
|
<ScrollView
|
|
|
|
|
className="products_list"
|
|
|
|
|
scrollX={true}
|
|
|
|
|
enhanced={true}
|
|
|
|
|
bounces={false}
|
|
|
|
|
// scrollIntoView={"products_item_" + curIndex}
|
|
|
|
|
style={{
|
|
|
|
|
top: height + 110 + "rpx",
|
|
|
|
|
position: "sticky",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
className="products_cover"
|
|
|
|
|
src={item.logo}
|
|
|
|
|
mode="aspectFill"
|
|
|
|
|
></Image>
|
|
|
|
|
<View className="products_title">{item.name}</View>
|
|
|
|
|
</View>
|
|
|
|
|
))}
|
|
|
|
|
</ScrollView>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{current === 0 && recordList.length === 0 && (
|
|
|
|
|
<View>
|
|
|
|
|
<View className="nodata">
|
|
|
|
|
<Image
|
|
|
|
|
className="nodata_img"
|
|
|
|
|
src={require("@/img/nodata.png")}
|
|
|
|
|
></Image>
|
|
|
|
|
<View className="nodata_text">暂无数据</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
{current === 0 && (
|
|
|
|
|
<View style="padding-bottom:200px">
|
|
|
|
|
{/* <View className='instrument_item' >
|
|
|
|
|
<View className='instrument_top flex sb aitems'>
|
|
|
|
|
<View className='time_box flex aitems'>
|
|
|
|
|
<View className='time'>2024.1.23</View>
|
|
|
|
|
<View className={classnames("tag", {
|
|
|
|
|
tag_active: current === 1,
|
|
|
|
|
})}
|
|
|
|
|
> 在线</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='report_btn flex'>
|
|
|
|
|
<View>回看报告</View>
|
|
|
|
|
<Image className='arrow_icon' src={require("../../img/index/right.png")} mode='aspectFill'></Image>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='instrument_middle flex'>
|
|
|
|
|
<Image className='instrument_cover' src={require("../../img/test/1706667011027.jpg")}></Image>
|
|
|
|
|
<View className='instrument_content'>
|
|
|
|
|
<View className='instrument_title'>小子弹智能射频仪</View>
|
|
|
|
|
<View className='instrument_desc_box flex fc sb'>
|
|
|
|
|
<View className='instrument_desc'>模式:基础场景版</View>
|
|
|
|
|
<View className='instrument_desc'>护理时间:15分00秒</View>
|
|
|
|
|
<View>
|
|
|
|
|
<View
|
|
|
|
|
id={"products_item_0"}
|
|
|
|
|
className={classnames("all", {
|
|
|
|
|
products_item_active: !curIndex,
|
|
|
|
|
})}
|
|
|
|
|
onClick={this.onChangeProduct.bind(this, null)}
|
|
|
|
|
>
|
|
|
|
|
全部
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View> */}
|
|
|
|
|
|
|
|
|
|
<View className="instrument_list ">
|
|
|
|
|
{recordList.map((item: any, index: any) => (
|
|
|
|
|
<View className="recording-box" key={item.id}>
|
|
|
|
|
<View className="box-top">
|
|
|
|
|
<View className="top-left">
|
|
|
|
|
<View className="date">{item.createTime}</View>
|
|
|
|
|
{bindingInstrumentList.map((item: any, index: any) => {
|
|
|
|
|
return (
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("tip", {
|
|
|
|
|
tag_active: item.online === 2,
|
|
|
|
|
key={item.id}
|
|
|
|
|
id={"products_item_" + item.id}
|
|
|
|
|
className={classnames("products_item", {
|
|
|
|
|
products_item_active: curIndex === item.id,
|
|
|
|
|
})}
|
|
|
|
|
onClick={this.onChangeProduct.bind(this, item.id)}
|
|
|
|
|
>
|
|
|
|
|
{item.online === 1 ? "在线" : "离线"}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
{item.instrumentType === 2 && (
|
|
|
|
|
<View
|
|
|
|
|
className="top-right"
|
|
|
|
|
onClick={this.toReport.bind(
|
|
|
|
|
this,
|
|
|
|
|
item.instrumentId,
|
|
|
|
|
item.id,
|
|
|
|
|
item
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
回看报告
|
|
|
|
|
<Image
|
|
|
|
|
className="arrow_icon"
|
|
|
|
|
src={require("@/img/index/right.png")}
|
|
|
|
|
className="products_cover"
|
|
|
|
|
src={item.logo}
|
|
|
|
|
mode="aspectFill"
|
|
|
|
|
></Image>
|
|
|
|
|
<View className="products_title">{item.name}</View>
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</View>
|
|
|
|
|
</ScrollView>
|
|
|
|
|
<View>
|
|
|
|
|
{recordList.length === 0 && (
|
|
|
|
|
<View>
|
|
|
|
|
<View className="nodata">
|
|
|
|
|
<Image
|
|
|
|
|
className="nodata_img"
|
|
|
|
|
src={require("@/img/nodata.png")}
|
|
|
|
|
></Image>
|
|
|
|
|
<View className="nodata_text">暂无数据</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className="box-bottom">
|
|
|
|
|
<Image
|
|
|
|
|
className="recording_img"
|
|
|
|
|
src={item.modeImage}
|
|
|
|
|
></Image>
|
|
|
|
|
<View className="bottom-right">
|
|
|
|
|
<View className="title">{item.instrumentName}</View>
|
|
|
|
|
<View className="subtitle-box">
|
|
|
|
|
<View className="subtitle">模式:{item.modeName}</View>
|
|
|
|
|
<View className="subtitle">
|
|
|
|
|
{item.instrumentType === 2 && (
|
|
|
|
|
<Text>护理时间:{item.nursingTime}</Text>
|
|
|
|
|
)}
|
|
|
|
|
)}
|
|
|
|
|
{recordList.length > 0 && (
|
|
|
|
|
<View style="padding-bottom:200px">
|
|
|
|
|
<View className="instrument_list ">
|
|
|
|
|
{recordList.map((item: any, index: any) => (
|
|
|
|
|
<View className="recording-box" key={item.id}>
|
|
|
|
|
<View className="box-top">
|
|
|
|
|
<View className="top-left">
|
|
|
|
|
<View className="date">{item.createTime}</View>
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("tip", {
|
|
|
|
|
tag_active: item.online === 2,
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
{item.online === 1 ? "在线" : "离线"}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
{item.instrumentType === 2 && (
|
|
|
|
|
<View
|
|
|
|
|
className="top-right"
|
|
|
|
|
onClick={this.toReport.bind(
|
|
|
|
|
this,
|
|
|
|
|
item.instrumentId,
|
|
|
|
|
item.id,
|
|
|
|
|
item
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
回看报告
|
|
|
|
|
<Image
|
|
|
|
|
className="arrow_icon"
|
|
|
|
|
src={require("@/img/index/right.png")}
|
|
|
|
|
mode="aspectFill"
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
<View className="box-bottom">
|
|
|
|
|
<Image
|
|
|
|
|
className="recording_img"
|
|
|
|
|
src={item.modeImage}
|
|
|
|
|
></Image>
|
|
|
|
|
<View className="bottom-right">
|
|
|
|
|
<View className="title">
|
|
|
|
|
{item.instrumentName}
|
|
|
|
|
</View>
|
|
|
|
|
<View className="subtitle-box">
|
|
|
|
|
<View className="subtitle">
|
|
|
|
|
模式:{item.modeName}
|
|
|
|
|
</View>
|
|
|
|
|
<View className="subtitle">
|
|
|
|
|
{item.instrumentType === 2 && (
|
|
|
|
|
<Text>护理时间:{item.nursingTime}</Text>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
))}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
))}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
{current === 1 && (
|
|
|
|
|
<View style="padding-bottom:200px">
|
|
|
|
|
{/* <View className='nodata'>
|
|
|
|
|
@ -693,11 +700,13 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
<View className="flex sb ab">
|
|
|
|
|
<View className="clock_in_statistics_title">年度打卡统计</View>
|
|
|
|
|
<Picker
|
|
|
|
|
style="color:#000"
|
|
|
|
|
mode="date"
|
|
|
|
|
fields="year"
|
|
|
|
|
onChange={this.onChangeYear.bind(this)}
|
|
|
|
|
value="{{year}}"
|
|
|
|
|
end="{{today}}"
|
|
|
|
|
value={this.state.yearValue}
|
|
|
|
|
start={startYear}
|
|
|
|
|
end={endYear}
|
|
|
|
|
>
|
|
|
|
|
<View className="clock_in_statistics_date flex aitems">
|
|
|
|
|
<View>{year}年</View>
|
|
|
|
|
|