|
@@ -2,21 +2,22 @@
|
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
|
* @Date: 2024-06-25 17:01:46
|
|
* @Date: 2024-06-25 17:01:46
|
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
|
- * @LastEditTime: 2024-08-29 17:08:04
|
|
|
|
|
|
|
+ * @LastEditTime: 2025-03-14 13:52:36
|
|
|
* @FilePath: /MediScreen/src/layouts/index.tsx
|
|
* @FilePath: /MediScreen/src/layouts/index.tsx
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
|
-import { useEffect, useRef, useState } from 'react';
|
|
|
|
|
|
|
+import { useEffect, useState } from 'react';
|
|
|
import ProgressBar from '@/components/ProgressBar';
|
|
import ProgressBar from '@/components/ProgressBar';
|
|
|
import TimelineComponent from '@/components/TimeLine';
|
|
import TimelineComponent from '@/components/TimeLine';
|
|
|
import BarChartComponent from '@/components/BarChartComponent';
|
|
import BarChartComponent from '@/components/BarChartComponent';
|
|
|
import ExpiryStockProgressBar from '@/components/ExpiryStockProgressBar';
|
|
import ExpiryStockProgressBar from '@/components/ExpiryStockProgressBar';
|
|
|
import NumberAnimation from '@/components/NumberAnimation';
|
|
import NumberAnimation from '@/components/NumberAnimation';
|
|
|
-import { Link } from 'umi';
|
|
|
|
|
|
|
+import { Link, useLocation } from 'umi';
|
|
|
import request from '@/utils/request';
|
|
import request from '@/utils/request';
|
|
|
|
|
|
|
|
|
|
+// 获取当前完整时间(格式:YYYY-MM-DD HH:MM)
|
|
|
function getCurrentFormattedTime() {
|
|
function getCurrentFormattedTime() {
|
|
|
const now = new Date();
|
|
const now = new Date();
|
|
|
const year = now.getFullYear();
|
|
const year = now.getFullYear();
|
|
@@ -27,8 +28,17 @@ function getCurrentFormattedTime() {
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
|
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 获取当前日期(格式:YYYY-MM-DD)
|
|
|
|
|
+function getCurrentFormattedDate() {
|
|
|
|
|
+ const now = new Date();
|
|
|
|
|
+ const year = now.getFullYear();
|
|
|
|
|
+ const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
+ const day = String(now.getDate()).padStart(2, '0');
|
|
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 提取百分比数字并转换为数字类型的函数
|
|
// 提取百分比数字并转换为数字类型的函数
|
|
|
-const extractPercentage = (str:string) => {
|
|
|
|
|
|
|
+const extractPercentage = (str: string) => {
|
|
|
const match = str.match(/-?\d+(\.\d+)?/); // 匹配数字(包括小数和负数)
|
|
const match = str.match(/-?\d+(\.\d+)?/); // 匹配数字(包括小数和负数)
|
|
|
return match ? parseFloat(match[0]) : 0; // 将匹配到的结果转换为浮点数
|
|
return match ? parseFloat(match[0]) : 0; // 将匹配到的结果转换为浮点数
|
|
|
};
|
|
};
|
|
@@ -57,32 +67,25 @@ const useViewport = () => {
|
|
|
return viewport;
|
|
return viewport;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-const defaultDate = `${new Date().getFullYear()}-${(new Date().getMonth() + 1)
|
|
|
|
|
- .toString()
|
|
|
|
|
- .padStart(2, '0')}-${new Date().getDate().toString().padStart(2, '0')}`;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+const defaultDate = getCurrentFormattedDate();
|
|
|
|
|
|
|
|
export default function Index() {
|
|
export default function Index() {
|
|
|
-
|
|
|
|
|
const [time, setTime] = useState(getCurrentFormattedTime());
|
|
const [time, setTime] = useState(getCurrentFormattedTime());
|
|
|
const { width, height } = useViewport();
|
|
const { width, height } = useViewport();
|
|
|
- const [equipmentDepreciation,set_equipmentDepreciation] = useState<any>(undefined);
|
|
|
|
|
- const [equipmentAdvice,set_equipmentAdvice] = useState<any>(undefined);
|
|
|
|
|
- const [equipmentPrescriptionInfo,set_equipmentPrescriptionInfo] = useState<any>(undefined);
|
|
|
|
|
- const [equipmentMaintenance,set_equipmentMaintenance] = useState<any>(undefined);
|
|
|
|
|
- const [equipmentInspection,set_equipmentInspection] = useState<any>(undefined);
|
|
|
|
|
- const [equipmentDepartmentCostAllocation,set_equipmentDepartmentCostAllocation] = useState<any>(undefined);
|
|
|
|
|
- const [equipmentExpire,set_equipmentExpire] = useState<any>(undefined);
|
|
|
|
|
|
|
+ const [equipmentDepreciation, set_equipmentDepreciation] = useState<any>(undefined);
|
|
|
|
|
+ const [equipmentAdvice, set_equipmentAdvice] = useState<any>(undefined);
|
|
|
|
|
+ const [equipmentPrescriptionInfo, set_equipmentPrescriptionInfo] = useState<any>(undefined);
|
|
|
|
|
+ const [equipmentMaintenance, set_equipmentMaintenance] = useState<any>(undefined);
|
|
|
|
|
+ const [equipmentInspection, set_equipmentInspection] = useState<any>(undefined);
|
|
|
|
|
+ const [equipmentDepartmentCostAllocation, set_equipmentDepartmentCostAllocation] = useState<any>(undefined);
|
|
|
|
|
+ const [equipmentExpire, set_equipmentExpire] = useState<any>(undefined);
|
|
|
const [refreshRates, setRefreshRates] = useState<any[]>([]);
|
|
const [refreshRates, setRefreshRates] = useState<any[]>([]);
|
|
|
const [hospInfo, set_hospInfo] = useState<any>(undefined);
|
|
const [hospInfo, set_hospInfo] = useState<any>(undefined);
|
|
|
- const [date, set_date] = useState<string|undefined>(undefined);
|
|
|
|
|
|
|
+ const [date, set_date] = useState<string | undefined>(undefined);
|
|
|
|
|
+ const location = useLocation();
|
|
|
|
|
|
|
|
const getRefreshRates = async () => {
|
|
const getRefreshRates = async () => {
|
|
|
- const response:any[] = await request.get(`/dashBoard/getDict?dictCode=refresh_rate`);
|
|
|
|
|
|
|
+ const response: any[] = await request.get(`/dashBoard/getDict?dictCode=refresh_rate`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
setRefreshRates(response);
|
|
setRefreshRates(response);
|
|
|
}
|
|
}
|
|
@@ -94,49 +97,55 @@ export default function Index() {
|
|
|
set_hospInfo(response);
|
|
set_hospInfo(response);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
const getDate = async () => {
|
|
const getDate = async () => {
|
|
|
const response: any = await request.get(`/dashBoard/getSysParameter?parameterCode=DEFAULT_DATE`);
|
|
const response: any = await request.get(`/dashBoard/getSysParameter?parameterCode=DEFAULT_DATE`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
- set_date(response.value?response.value:defaultDate);
|
|
|
|
|
|
|
+ set_date(response.value ? response.value : defaultDate);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ set_date(defaultDate);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- const getEquipmentDepreciation = async () => {
|
|
|
|
|
|
|
+ const getEquipmentDepreciation = async (date: string) => {
|
|
|
const response = await request.get(`/dashBoard/equipmentDepreciation?date=${date}`);
|
|
const response = await request.get(`/dashBoard/equipmentDepreciation?date=${date}`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
set_equipmentDepreciation(response);
|
|
set_equipmentDepreciation(response);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
- const getEquipmentAdvice = async () => {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const getEquipmentAdvice = async (date: string) => {
|
|
|
const response = await request.get(`/dashBoard/equipmentAdvice?date=${date}`);
|
|
const response = await request.get(`/dashBoard/equipmentAdvice?date=${date}`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
set_equipmentAdvice(response);
|
|
set_equipmentAdvice(response);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
- const getEquipmentPrescriptionInfo = async () => {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const getEquipmentPrescriptionInfo = async (date: string) => {
|
|
|
const response = await request.get(`/dashBoard/equipmentPrescriptionInfo?dateTime=${date}`);
|
|
const response = await request.get(`/dashBoard/equipmentPrescriptionInfo?dateTime=${date}`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
set_equipmentPrescriptionInfo(response);
|
|
set_equipmentPrescriptionInfo(response);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
- const getEquipmentMaintenance = async () => {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const getEquipmentMaintenance = async (date: string) => {
|
|
|
const response = await request.get(`/dashBoard/equipmentMaintenance?date=${date}`);
|
|
const response = await request.get(`/dashBoard/equipmentMaintenance?date=${date}`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
set_equipmentMaintenance(response);
|
|
set_equipmentMaintenance(response);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
- const getEquipmentInspection = async () => {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const getEquipmentInspection = async (date: string) => {
|
|
|
const response = await request.get(`/dashBoard/equipmentInspection?date=${date}`);
|
|
const response = await request.get(`/dashBoard/equipmentInspection?date=${date}`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
set_equipmentInspection(response);
|
|
set_equipmentInspection(response);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const getEquipmentDepartmentCostAllocation = async () => {
|
|
|
|
|
- if(date){
|
|
|
|
|
|
|
+ const getEquipmentDepartmentCostAllocation = async (date: string) => {
|
|
|
|
|
+ if (date) {
|
|
|
const [year, month] = date.split('-');
|
|
const [year, month] = date.split('-');
|
|
|
- const _date =`${year}-${month}`;
|
|
|
|
|
|
|
+ const _date = `${year}-${month}`;
|
|
|
const response = await request.get(`/dashBoard/equipmentDepartmentCostAllocation?date=${_date}`);
|
|
const response = await request.get(`/dashBoard/equipmentDepartmentCostAllocation?date=${_date}`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
set_equipmentDepartmentCostAllocation(response);
|
|
set_equipmentDepartmentCostAllocation(response);
|
|
@@ -144,124 +153,91 @@ export default function Index() {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const getEquipmentExpire = async () => {
|
|
|
|
|
|
|
+ const getEquipmentExpire = async (date: string) => {
|
|
|
const response = await request.get(`/dashBoard/equipmentExpire?date=${date}`);
|
|
const response = await request.get(`/dashBoard/equipmentExpire?date=${date}`);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
set_equipmentExpire(response);
|
|
set_equipmentExpire(response);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // const getRefreshRate = async () => {
|
|
|
|
|
- // const response = await request.get(`/dashBoard/getDict?dictCode=refresh_rate`);
|
|
|
|
|
- // if (response) {
|
|
|
|
|
- // set_equipmentExpire(response);
|
|
|
|
|
- // }
|
|
|
|
|
- // };
|
|
|
|
|
-
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- // 获取刷新频率配置
|
|
|
|
|
|
|
+ // 获取刷新频率配置、医院信息及初始日期
|
|
|
getRefreshRates();
|
|
getRefreshRates();
|
|
|
getHospInfo();
|
|
getHospInfo();
|
|
|
getDate();
|
|
getDate();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 每分钟更新一次当前时间
|
|
// 每分钟更新一次当前时间
|
|
|
- const intervalId = setInterval(() => {
|
|
|
|
|
|
|
+ const timeInterval = setInterval(() => {
|
|
|
setTime(getCurrentFormattedTime());
|
|
setTime(getCurrentFormattedTime());
|
|
|
- }, 60000); // 每分钟更新一次
|
|
|
|
|
-
|
|
|
|
|
|
|
+ }, 60000);
|
|
|
return () => {
|
|
return () => {
|
|
|
- clearInterval(intervalId); // 组件卸载时清除计时器
|
|
|
|
|
|
|
+ clearInterval(timeInterval);
|
|
|
};
|
|
};
|
|
|
- }, []); // 初次加载时执行
|
|
|
|
|
|
|
+ }, []);
|
|
|
|
|
|
|
|
|
|
+ // 新增:定时检测当前日期是否发生变化,跨天后自动更新 date 状态
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ const dateInterval = setInterval(() => {
|
|
|
|
|
+ const currentDate = getCurrentFormattedDate();
|
|
|
|
|
+ if (currentDate !== date) {
|
|
|
|
|
+ set_date(currentDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 60000);
|
|
|
|
|
+ return () => clearInterval(dateInterval);
|
|
|
|
|
+ }, [date]);
|
|
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
|
|
- // 初始加载数据
|
|
|
|
|
- if(date){
|
|
|
|
|
- getEquipmentDepreciation();
|
|
|
|
|
- getEquipmentAdvice();
|
|
|
|
|
- getEquipmentPrescriptionInfo();
|
|
|
|
|
- getEquipmentMaintenance();
|
|
|
|
|
- getEquipmentInspection();
|
|
|
|
|
- getEquipmentDepartmentCostAllocation();
|
|
|
|
|
- getEquipmentExpire();
|
|
|
|
|
- }
|
|
|
|
|
- },[date])
|
|
|
|
|
-
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- // 当refreshRates获取到数据后才开始设置定时器
|
|
|
|
|
- if (Object.keys(refreshRates).length > 0) {
|
|
|
|
|
|
|
+ // 初始加载数据
|
|
|
|
|
+ if (date) {
|
|
|
|
|
+ getEquipmentDepreciation(date);
|
|
|
|
|
+ getEquipmentAdvice(date);
|
|
|
|
|
+ getEquipmentPrescriptionInfo(date);
|
|
|
|
|
+ getEquipmentMaintenance(date);
|
|
|
|
|
+ getEquipmentInspection(date);
|
|
|
|
|
+ getEquipmentDepartmentCostAllocation(date);
|
|
|
|
|
+ getEquipmentExpire(date);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [date]);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- // 明确设置为 number 类型数组
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ // 当 refreshRates 获取到数据后,设置定时刷新
|
|
|
|
|
+ if (Object.keys(refreshRates).length > 0 && date) {
|
|
|
const intervalIds: number[] = [];
|
|
const intervalIds: number[] = [];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const safeInterval = (
|
|
const safeInterval = (
|
|
|
fn: Function,
|
|
fn: Function,
|
|
|
delay: number | undefined,
|
|
delay: number | undefined,
|
|
|
defaultDelay: number
|
|
defaultDelay: number
|
|
|
): number => {
|
|
): number => {
|
|
|
if (delay && !isNaN(delay) && delay > 0) {
|
|
if (delay && !isNaN(delay) && delay > 0) {
|
|
|
- return setInterval(fn, delay * 1000) as unknown as number; // 强制转换为 number
|
|
|
|
|
|
|
+ return setInterval(fn, delay * 1000) as unknown as number;
|
|
|
} else {
|
|
} else {
|
|
|
- return setInterval(fn, defaultDelay) as unknown as number; // 强制转换为 number
|
|
|
|
|
|
|
+ return setInterval(fn, defaultDelay) as unknown as number;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
intervalIds.push(
|
|
intervalIds.push(
|
|
|
- safeInterval(
|
|
|
|
|
- getEquipmentDepreciation,
|
|
|
|
|
- Number(refreshRates.find((a: any) => a.code === '10')?.value),
|
|
|
|
|
- 600000
|
|
|
|
|
- ),
|
|
|
|
|
- safeInterval(
|
|
|
|
|
- getEquipmentAdvice,
|
|
|
|
|
- Number(refreshRates.find((a: any) => a.code === '13')?.value),
|
|
|
|
|
- 600000
|
|
|
|
|
- ),
|
|
|
|
|
- safeInterval(
|
|
|
|
|
- getEquipmentPrescriptionInfo,
|
|
|
|
|
- Number(refreshRates.find((a: any) => a.code === '11')?.value),
|
|
|
|
|
- 600000
|
|
|
|
|
- ),
|
|
|
|
|
- safeInterval(
|
|
|
|
|
- getEquipmentMaintenance,
|
|
|
|
|
- Number(refreshRates.find((a: any) => a.code === '14')?.value),
|
|
|
|
|
- 600000
|
|
|
|
|
- ),
|
|
|
|
|
- safeInterval(
|
|
|
|
|
- getEquipmentInspection,
|
|
|
|
|
- Number(refreshRates.find((a: any) => a.code === '15')?.value),
|
|
|
|
|
- 600000
|
|
|
|
|
- ),
|
|
|
|
|
- safeInterval(
|
|
|
|
|
- getEquipmentDepartmentCostAllocation,
|
|
|
|
|
- Number(refreshRates.find((a: any) => a.code === '12')?.value),
|
|
|
|
|
- 600000
|
|
|
|
|
- ),
|
|
|
|
|
- safeInterval(
|
|
|
|
|
- getEquipmentExpire,
|
|
|
|
|
- Number(refreshRates.find((a: any) => a.code === '16')?.value),
|
|
|
|
|
- 600000
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ safeInterval(() => getEquipmentDepreciation(date), Number(refreshRates.find((a: any) => a.code === '10')?.value), 600000),
|
|
|
|
|
+ safeInterval(() => getEquipmentAdvice(date), Number(refreshRates.find((a: any) => a.code === '13')?.value), 600000),
|
|
|
|
|
+ safeInterval(() => getEquipmentPrescriptionInfo(date), Number(refreshRates.find((a: any) => a.code === '11')?.value), 600000),
|
|
|
|
|
+ safeInterval(() => getEquipmentMaintenance(date), Number(refreshRates.find((a: any) => a.code === '14')?.value), 600000),
|
|
|
|
|
+ safeInterval(() => getEquipmentInspection(date), Number(refreshRates.find((a: any) => a.code === '15')?.value), 600000),
|
|
|
|
|
+ safeInterval(() => getEquipmentDepartmentCostAllocation(date), Number(refreshRates.find((a: any) => a.code === '12')?.value), 600000),
|
|
|
|
|
+ safeInterval(() => getEquipmentExpire(date), Number(refreshRates.find((a: any) => a.code === '16')?.value), 600000)
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
- // 清除定时器
|
|
|
|
|
|
|
+
|
|
|
return () => {
|
|
return () => {
|
|
|
intervalIds.forEach(clearInterval);
|
|
intervalIds.forEach(clearInterval);
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
- }, [refreshRates]); // 当refreshRates更新时执行
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ }, [refreshRates, date]);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className={styles.MediScreen}>
|
|
<div className={styles.MediScreen}>
|
|
|
<div className={styles.topbar}>
|
|
<div className={styles.topbar}>
|
|
|
<img src={require('../../images/topImg2x.png')} alt="" />
|
|
<img src={require('../../images/topImg2x.png')} alt="" />
|
|
|
<div className={styles.topbarInfo}>
|
|
<div className={styles.topbarInfo}>
|
|
|
- <div className={styles.hospName}>{hospInfo?.value??''}</div>
|
|
|
|
|
|
|
+ <div className={styles.hospName}>{hospInfo?.value ?? ''}</div>
|
|
|
<div className={styles.date}>{time}</div>
|
|
<div className={styles.date}>{time}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -270,26 +246,40 @@ export default function Index() {
|
|
|
<div className={styles.blockOne}>
|
|
<div className={styles.blockOne}>
|
|
|
<div className={styles.blockHeader}>设备折旧</div>
|
|
<div className={styles.blockHeader}>设备折旧</div>
|
|
|
<div className={styles.rowOne}>
|
|
<div className={styles.rowOne}>
|
|
|
- <div className={styles.iconWrap}><img src={require('../../images/¥icon.png')} alt="" /></div>
|
|
|
|
|
|
|
+ <div className={styles.iconWrap}>
|
|
|
|
|
+ <img src={require('../../images/¥icon.png')} alt="" />
|
|
|
|
|
+ </div>
|
|
|
<div className={styles.rowDetail}>
|
|
<div className={styles.rowDetail}>
|
|
|
- <div className={styles.name}>设备原值<span>*设备随时间变化会产生折旧</span></div>
|
|
|
|
|
- <div className={styles.value}><NumberAnimation value={equipmentDepreciation?.equipValue??0} /></div>
|
|
|
|
|
|
|
+ <div className={styles.name}>
|
|
|
|
|
+ 设备原值<span>*设备随时间变化会产生折旧</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.value}>
|
|
|
|
|
+ <NumberAnimation value={equipmentDepreciation?.equipValue ?? 0} />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.rowTwo}>
|
|
<div className={styles.rowTwo}>
|
|
|
- <div className={styles.iconWrap}><img src={require('../../images/¥icon1.png')} alt="" /></div>
|
|
|
|
|
|
|
+ <div className={styles.iconWrap}>
|
|
|
|
|
+ <img src={require('../../images/¥icon1.png')} alt="" />
|
|
|
|
|
+ </div>
|
|
|
<div className={styles.rowDetail}>
|
|
<div className={styles.rowDetail}>
|
|
|
<div className={styles.typeBlock}>
|
|
<div className={styles.typeBlock}>
|
|
|
<div className={styles.label}>设备净值</div>
|
|
<div className={styles.label}>设备净值</div>
|
|
|
- <div className={styles.value}><NumberAnimation value={equipmentDepreciation?.netValue??0} /></div>
|
|
|
|
|
|
|
+ <div className={styles.value}>
|
|
|
|
|
+ <NumberAnimation value={equipmentDepreciation?.netValue ?? 0} />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.typeBlock}>
|
|
<div className={styles.typeBlock}>
|
|
|
<div className={styles.label}>本月折旧</div>
|
|
<div className={styles.label}>本月折旧</div>
|
|
|
- <div className={styles.value}><NumberAnimation value={equipmentDepreciation?.curentMonthDepr??0} /></div>
|
|
|
|
|
|
|
+ <div className={styles.value}>
|
|
|
|
|
+ <NumberAnimation value={equipmentDepreciation?.curentMonthDepr ?? 0} />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.typeBlock}>
|
|
<div className={styles.typeBlock}>
|
|
|
<div className={styles.label}>累计折旧</div>
|
|
<div className={styles.label}>累计折旧</div>
|
|
|
- <div className={styles.value}><NumberAnimation value={equipmentDepreciation?.accumulatedDepr??0} /></div>
|
|
|
|
|
|
|
+ <div className={styles.value}>
|
|
|
|
|
+ <NumberAnimation value={equipmentDepreciation?.accumulatedDepr ?? 0} />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -297,36 +287,38 @@ export default function Index() {
|
|
|
<div className={styles.blockTwo}>
|
|
<div className={styles.blockTwo}>
|
|
|
<div className={styles.blockHeader}>建议补药</div>
|
|
<div className={styles.blockHeader}>建议补药</div>
|
|
|
<div className={styles.progressWrap}>
|
|
<div className={styles.progressWrap}>
|
|
|
- {/* <ProgressBar percentage={40} totalBoxes={40} /> */}
|
|
|
|
|
- <div className={styles.infoOne}>缺药率<i>{equipmentAdvice?.lackPercentDisplay??'0%'}</i></div>
|
|
|
|
|
- <div className={styles.infoTwo}>补药总数<i>{equipmentAdvice?.addMedCount??0}盒</i></div>
|
|
|
|
|
|
|
+ <div className={styles.infoOne}>
|
|
|
|
|
+ 缺药率<i>{equipmentAdvice?.lackPercentDisplay ?? '0%'}</i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.infoTwo}>
|
|
|
|
|
+ 补药总数<i>{equipmentAdvice?.addMedCount ?? 0}盒</i>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.listWrap}>
|
|
<div className={styles.listWrap}>
|
|
|
- {[...(equipmentAdvice?equipmentAdvice.list:[])].map((_, i) => (
|
|
|
|
|
- <div
|
|
|
|
|
- key={i}
|
|
|
|
|
- className={styles.list}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ {[
|
|
|
|
|
+ ...(equipmentAdvice ? equipmentAdvice.list : []),
|
|
|
|
|
+ ].map((item, i) => (
|
|
|
|
|
+ <div key={i} className={styles.list}>
|
|
|
<div className={styles.number}>{i + 1 >= 10 ? i + 1 : `0${i + 1}`}</div>
|
|
<div className={styles.number}>{i + 1 >= 10 ? i + 1 : `0${i + 1}`}</div>
|
|
|
<div className={styles.title}>
|
|
<div className={styles.title}>
|
|
|
- <div className={styles.name}>{_.medName}</div>
|
|
|
|
|
- <div className={styles.sub}>{_.manufacturer}</div>
|
|
|
|
|
|
|
+ <div className={styles.name}>{item.medName}</div>
|
|
|
|
|
+ <div className={styles.sub}>{item.manufacturer}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.al}>
|
|
<div className={styles.al}>
|
|
|
<div className={styles.label}>库存</div>
|
|
<div className={styles.label}>库存</div>
|
|
|
- <div className={styles.value}>{_.stock}</div>
|
|
|
|
|
|
|
+ <div className={styles.value}>{item.stock}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.al}>
|
|
<div className={styles.al}>
|
|
|
<div className={styles.label}>低限</div>
|
|
<div className={styles.label}>低限</div>
|
|
|
- <div className={styles.value}>{_.avgDay}</div>
|
|
|
|
|
|
|
+ <div className={styles.value}>{item.avgDay}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.al}>
|
|
<div className={styles.al}>
|
|
|
<div className={styles.label}>缺药率</div>
|
|
<div className={styles.label}>缺药率</div>
|
|
|
- <div className={styles.value}>{_.lackPercentDisplay}</div>
|
|
|
|
|
|
|
+ <div className={styles.value}>{item.lackPercentDisplay}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.al}>
|
|
<div className={styles.al}>
|
|
|
<div className={styles.label}>建议领药量</div>
|
|
<div className={styles.label}>建议领药量</div>
|
|
|
- <div className={styles.value}>{_.addMedCount}</div>
|
|
|
|
|
|
|
+ <div className={styles.value}>{item.addMedCount}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
))}
|
|
))}
|
|
@@ -334,54 +326,84 @@ export default function Index() {
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.middle}>
|
|
<div className={styles.middle}>
|
|
|
- <div className={styles.title}>总处方数 <NumberAnimation value={equipmentPrescriptionInfo?.totalPrescriptionCount??0} duration={2000} />张</div>
|
|
|
|
|
|
|
+ <div className={styles.title}>
|
|
|
|
|
+ 总处方数{' '}
|
|
|
|
|
+ <NumberAnimation value={equipmentPrescriptionInfo?.totalPrescriptionCount ?? 0} duration={2000} />张
|
|
|
|
|
+ </div>
|
|
|
<div className={styles.dataWrap}>
|
|
<div className={styles.dataWrap}>
|
|
|
<div className={styles.dataBox}>
|
|
<div className={styles.dataBox}>
|
|
|
<div className={styles.info}>
|
|
<div className={styles.info}>
|
|
|
<div className={styles.option}>
|
|
<div className={styles.option}>
|
|
|
<span className={styles.label}>直发率</span>
|
|
<span className={styles.label}>直发率</span>
|
|
|
- <span className={styles.value}><NumberAnimation value={extractPercentage(equipmentPrescriptionInfo?.straightPercent?.percent??'0%')} />%</span>
|
|
|
|
|
|
|
+ <span className={styles.value}>
|
|
|
|
|
+ <NumberAnimation
|
|
|
|
|
+ value={extractPercentage(equipmentPrescriptionInfo?.straightPercent?.percent ?? '0%')}
|
|
|
|
|
+ />
|
|
|
|
|
+ %
|
|
|
|
|
+ </span>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={`${styles.option}`}>
|
|
<div className={`${styles.option}`}>
|
|
|
<span className={styles.label}>较昨日</span>
|
|
<span className={styles.label}>较昨日</span>
|
|
|
- <span className={styles.value}>{equipmentPrescriptionInfo?.straightPercent?.chain??'0%'}</span>
|
|
|
|
|
|
|
+ <span className={styles.value}>{equipmentPrescriptionInfo?.straightPercent?.chain ?? '0%'}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.cardBottom}>
|
|
<div className={styles.cardBottom}>
|
|
|
- <div className={styles.a}>今日<span>{equipmentPrescriptionInfo?.straightPercent?.todayCount??0}</span></div>
|
|
|
|
|
- <div className={styles.a}>昨日<span>{equipmentPrescriptionInfo?.straightPercent?.yesterdayCount??0}</span></div>
|
|
|
|
|
|
|
+ <div className={styles.a}>
|
|
|
|
|
+ 今日<span>{equipmentPrescriptionInfo?.straightPercent?.todayCount ?? 0}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.a}>
|
|
|
|
|
+ 昨日<span>{equipmentPrescriptionInfo?.straightPercent?.yesterdayCount ?? 0}</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.dataBox}>
|
|
<div className={styles.dataBox}>
|
|
|
<div className={styles.info}>
|
|
<div className={styles.info}>
|
|
|
<div className={styles.option}>
|
|
<div className={styles.option}>
|
|
|
<span className={styles.label}>混发率</span>
|
|
<span className={styles.label}>混发率</span>
|
|
|
- <span className={styles.value}><NumberAnimation value={extractPercentage(equipmentPrescriptionInfo?.mixPercent?.percent??'0%')} />%</span>
|
|
|
|
|
|
|
+ <span className={styles.value}>
|
|
|
|
|
+ <NumberAnimation
|
|
|
|
|
+ value={extractPercentage(equipmentPrescriptionInfo?.mixPercent?.percent ?? '0%')}
|
|
|
|
|
+ />
|
|
|
|
|
+ %
|
|
|
|
|
+ </span>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={`${styles.option} ${styles.yellow}`}>
|
|
<div className={`${styles.option} ${styles.yellow}`}>
|
|
|
<span className={styles.label}>较昨日</span>
|
|
<span className={styles.label}>较昨日</span>
|
|
|
- <span className={styles.value}>{equipmentPrescriptionInfo?.mixPercent?.chain??'0%'}</span>
|
|
|
|
|
|
|
+ <span className={styles.value}>{equipmentPrescriptionInfo?.mixPercent?.chain ?? '0%'}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.cardBottom}>
|
|
<div className={styles.cardBottom}>
|
|
|
- <div className={styles.a}>今日<span>{equipmentPrescriptionInfo?.mixPercent?.todayCount??0}</span></div>
|
|
|
|
|
- <div className={styles.a}>昨日<span>{equipmentPrescriptionInfo?.mixPercent?.yesterdayCount??0}</span></div>
|
|
|
|
|
|
|
+ <div className={styles.a}>
|
|
|
|
|
+ 今日<span>{equipmentPrescriptionInfo?.mixPercent?.todayCount ?? 0}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.a}>
|
|
|
|
|
+ 昨日<span>{equipmentPrescriptionInfo?.mixPercent?.yesterdayCount ?? 0}</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.dataBox}>
|
|
<div className={styles.dataBox}>
|
|
|
<div className={styles.info}>
|
|
<div className={styles.info}>
|
|
|
<div className={styles.option}>
|
|
<div className={styles.option}>
|
|
|
<span className={styles.label}>机发率</span>
|
|
<span className={styles.label}>机发率</span>
|
|
|
- <span className={styles.value}><NumberAnimation value={extractPercentage(equipmentPrescriptionInfo?.machinePercent?.percent??'0%')} />%</span>
|
|
|
|
|
|
|
+ <span className={styles.value}>
|
|
|
|
|
+ <NumberAnimation
|
|
|
|
|
+ value={extractPercentage(equipmentPrescriptionInfo?.machinePercent?.percent ?? '0%')}
|
|
|
|
|
+ />
|
|
|
|
|
+ %
|
|
|
|
|
+ </span>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={`${styles.option} ${styles.yellow}`}>
|
|
<div className={`${styles.option} ${styles.yellow}`}>
|
|
|
<span className={styles.label}>较昨日</span>
|
|
<span className={styles.label}>较昨日</span>
|
|
|
- <span className={styles.value}>{equipmentPrescriptionInfo?.machinePercent?.chain??'0%'}</span>
|
|
|
|
|
|
|
+ <span className={styles.value}>{equipmentPrescriptionInfo?.machinePercent?.chain ?? '0%'}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.cardBottom}>
|
|
<div className={styles.cardBottom}>
|
|
|
- <div className={styles.a}>今日<span>{equipmentPrescriptionInfo?.machinePercent?.todayCount??0}</span></div>
|
|
|
|
|
- <div className={styles.a}>昨日<span>{equipmentPrescriptionInfo?.machinePercent?.yesterdayCount??0}</span></div>
|
|
|
|
|
|
|
+ <div className={styles.a}>
|
|
|
|
|
+ 今日<span>{equipmentPrescriptionInfo?.machinePercent?.todayCount ?? 0}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.a}>
|
|
|
|
|
+ 昨日<span>{equipmentPrescriptionInfo?.machinePercent?.yesterdayCount ?? 0}</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -390,47 +412,73 @@ export default function Index() {
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.titleSheb}>设备保养</div>
|
|
<div className={styles.titleSheb}>设备保养</div>
|
|
|
<div className={styles.shebeiCard}>
|
|
<div className={styles.shebeiCard}>
|
|
|
- {
|
|
|
|
|
- [...((equipmentMaintenance&&equipmentMaintenance.length>0)?equipmentMaintenance:[{}])].map((_, i) => (
|
|
|
|
|
- <div key={i} className={_.status ? `${styles.card}` : `${styles.card} ${styles.gray}`}>
|
|
|
|
|
- <div className={_.maintainFlag?`${styles.season} ${styles.completed}`:styles.season}>{_.maintainPlanName}</div>
|
|
|
|
|
- {/* <div className={styles.number}>{`${i + 1}/4`}</div> */}
|
|
|
|
|
- <div className={styles.name}>{_.maintainFlag ? '保养已完成' : '保养未完成'}</div>
|
|
|
|
|
- <div className={styles.date}>{_.maintainPlanDate}</div>
|
|
|
|
|
|
|
+ {[
|
|
|
|
|
+ ...(equipmentMaintenance && equipmentMaintenance.length > 0 ? equipmentMaintenance : [{}]),
|
|
|
|
|
+ ].map((item, i) => (
|
|
|
|
|
+ <div key={i} className={item.status ? `${styles.card}` : `${styles.card} ${styles.gray}`}>
|
|
|
|
|
+ <div className={item.maintainFlag ? `${styles.season} ${styles.completed}` : styles.season}>
|
|
|
|
|
+ {item.maintainPlanName}
|
|
|
</div>
|
|
</div>
|
|
|
- ))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ <div className={styles.name}>{item.maintainFlag ? '保养已完成' : '保养未完成'}</div>
|
|
|
|
|
+ <div className={styles.date}>{item.maintainPlanDate}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ ))}
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.titleSheb}>设备巡检</div>
|
|
<div className={styles.titleSheb}>设备巡检</div>
|
|
|
- <div><TimelineComponent data={equipmentInspection?(equipmentInspection.map((a:any)=>({
|
|
|
|
|
- date:a.inspectDate,status:a.inspectFlag,person:a.inspectUser,inspectPlanName:a.inspectPlanName
|
|
|
|
|
- }))):[]} /></div>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <TimelineComponent
|
|
|
|
|
+ data={
|
|
|
|
|
+ equipmentInspection
|
|
|
|
|
+ ? equipmentInspection.map((a: any) => ({
|
|
|
|
|
+ date: a.inspectDate,
|
|
|
|
|
+ status: a.inspectFlag,
|
|
|
|
|
+ person: a.inspectUser,
|
|
|
|
|
+ inspectPlanName: a.inspectPlanName,
|
|
|
|
|
+ }))
|
|
|
|
|
+ : []
|
|
|
|
|
+ }
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.right}>
|
|
<div className={styles.right}>
|
|
|
<div className={styles.blockHeader}>成本分摊</div>
|
|
<div className={styles.blockHeader}>成本分摊</div>
|
|
|
<div className={styles.barChartWrapper}>
|
|
<div className={styles.barChartWrapper}>
|
|
|
- <BarChartComponent data={(equipmentDepartmentCostAllocation&&equipmentDepartmentCostAllocation.length>0)?(equipmentDepartmentCostAllocation.map((a:any)=>({label:a.deptName,value:a.sum,unit:'元'}))):[{label:'无',value:0}]} />
|
|
|
|
|
|
|
+ <BarChartComponent
|
|
|
|
|
+ data={
|
|
|
|
|
+ equipmentDepartmentCostAllocation && equipmentDepartmentCostAllocation.length > 0
|
|
|
|
|
+ ? equipmentDepartmentCostAllocation.map((a: any) => ({
|
|
|
|
|
+ label: a.deptName,
|
|
|
|
|
+ value: a.sum,
|
|
|
|
|
+ unit: '元',
|
|
|
|
|
+ }))
|
|
|
|
|
+ : [{ label: '无', value: 0 }]
|
|
|
|
|
+ }
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.blockHeader}>临近效期</div>
|
|
<div className={styles.blockHeader}>临近效期</div>
|
|
|
<div className={styles.progressWrapper}>
|
|
<div className={styles.progressWrapper}>
|
|
|
- <div className={styles.allexpired}>全部临期<i>{equipmentExpire?.expireCount??0}盒</i></div>
|
|
|
|
|
- <div className={styles.expiredper}>临期占比<i>{equipmentExpire?.expirePercentDisplay??'0%'}</i></div>
|
|
|
|
|
- <div className={styles.stockCount}>当前库存<i>{equipmentExpire?.totalCount??0}盒</i></div>
|
|
|
|
|
- {/* <ProgressBar percentage={40} totalBoxes={40} filledColor="rgba(242, 255, 179, 1)" unfilledColor="rgba(242,255,179,0.2)" /> */}
|
|
|
|
|
|
|
+ <div className={styles.allexpired}>
|
|
|
|
|
+ 全部临期<i>{equipmentExpire?.expireCount ?? 0}盒</i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.expiredper}>
|
|
|
|
|
+ 临期占比<i>{equipmentExpire?.expirePercentDisplay ?? '0%'}</i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.stockCount}>
|
|
|
|
|
+ 当前库存<i>{equipmentExpire?.totalCount ?? 0}盒</i>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.listWrap}>
|
|
<div className={styles.listWrap}>
|
|
|
- {[...(equipmentExpire?.expireList??[])].map((_, i) => (
|
|
|
|
|
- <div
|
|
|
|
|
- key={i}
|
|
|
|
|
- className={styles.list}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ {[
|
|
|
|
|
+ ...(equipmentExpire?.expireList ?? []),
|
|
|
|
|
+ ].map((item, i) => (
|
|
|
|
|
+ <div key={i} className={styles.list}>
|
|
|
<div className={styles.number}>{i + 1 >= 10 ? i + 1 : `0${i + 1}`}</div>
|
|
<div className={styles.number}>{i + 1 >= 10 ? i + 1 : `0${i + 1}`}</div>
|
|
|
<div className={styles.title}>
|
|
<div className={styles.title}>
|
|
|
- <div className={styles.name}>{_.drugName}</div>
|
|
|
|
|
- <div className={styles.sub}>最短有效期至{_.nearExpire}</div>
|
|
|
|
|
|
|
+ <div className={styles.name}>{item.drugName}</div>
|
|
|
|
|
+ <div className={styles.sub}>最短有效期至{item.nearExpire}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.progress}>
|
|
<div className={styles.progress}>
|
|
|
- <ExpiryStockProgressBar expiryCount={_.expireStock} stockCount={_.totalStock} />
|
|
|
|
|
|
|
+ <ExpiryStockProgressBar expiryCount={item.expireStock} stockCount={item.totalStock} />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
))}
|
|
))}
|
|
@@ -439,8 +487,12 @@ export default function Index() {
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.bottom}>
|
|
<div className={styles.bottom}>
|
|
|
<div className={styles.btnGroup}>
|
|
<div className={styles.btnGroup}>
|
|
|
- <Link to="/"><div className={location.pathname == '/' ? `${styles.btn} ${styles.active}` : `${styles.btn}`}>药房首页</div></Link>
|
|
|
|
|
- <Link to="/fenfa"><div className={location.pathname == '/fenfa' ? `${styles.btn} ${styles.active}` : `${styles.btn}`}>设备信息</div></Link>
|
|
|
|
|
|
|
+ <Link to="/">
|
|
|
|
|
+ <div className={location.pathname === '/' ? `${styles.btn} ${styles.active}` : `${styles.btn}`}>药房首页</div>
|
|
|
|
|
+ </Link>
|
|
|
|
|
+ <Link to="/fenfa">
|
|
|
|
|
+ <div className={location.pathname === '/fenfa' ? `${styles.btn} ${styles.active}` : `${styles.btn}`}>设备信息</div>
|
|
|
|
|
+ </Link>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|