feat
parent
bbfb21730c
commit
a42e658686
|
|
@ -8,6 +8,7 @@ import {
|
|||
Spin,
|
||||
Empty,
|
||||
Typography,
|
||||
Image,
|
||||
} from "antd";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
|
|
@ -42,6 +43,35 @@ const parseFileList = (raw) => {
|
|||
}
|
||||
};
|
||||
|
||||
/** 判断 URL 是否为图片 */
|
||||
const isImageUrl = (url) =>
|
||||
/\.(jpg|jpeg|png|gif|webp|bmp)(\?.*)?$/i.test(url || "");
|
||||
|
||||
/** 渲染单个文件:图片用 Image 预览,其他用链接 */
|
||||
const renderFile = (file, idx) => {
|
||||
if (isImageUrl(file.url)) {
|
||||
return (
|
||||
<Image
|
||||
key={file.uid || idx}
|
||||
src={file.url}
|
||||
width={80}
|
||||
height={80}
|
||||
className="epm-detail-file"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Typography.Link
|
||||
key={file.uid || idx}
|
||||
href={file.url}
|
||||
target="_blank"
|
||||
className="epm-detail-file"
|
||||
>
|
||||
{file.name || `附件${idx + 1}`}
|
||||
</Typography.Link>
|
||||
);
|
||||
};
|
||||
|
||||
// ===== 合同面板 =====
|
||||
const ContractPanel = ({ data, loading }) => {
|
||||
if (!data?.id) return <Spin><Empty description="暂无合同数据" /></Spin>;
|
||||
|
|
@ -115,16 +145,7 @@ const ContractPanel = ({ data, loading }) => {
|
|||
title="合同扫描件"
|
||||
className="epm-detail-section"
|
||||
>
|
||||
{scanFiles.map((file, idx) => (
|
||||
<Typography.Link
|
||||
key={file.uid || idx}
|
||||
href={file.url}
|
||||
target="_blank"
|
||||
className="epm-detail-file"
|
||||
>
|
||||
{file.name || `附件${idx + 1}`}
|
||||
</Typography.Link>
|
||||
))}
|
||||
{scanFiles.map((file, idx) => renderFile(file, idx))}
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -297,16 +318,7 @@ const SurveyPanel = ({ personnel, attachments, loading, detailData }) => {
|
|||
title={ATTACH_TYPE_LABELS[typeCode]}
|
||||
className="epm-detail-section"
|
||||
>
|
||||
{files.map((file, idx) => (
|
||||
<Typography.Link
|
||||
key={file.uid || idx}
|
||||
href={file.url}
|
||||
target="_blank"
|
||||
className="epm-detail-file"
|
||||
>
|
||||
{file.name || `附件${idx + 1}`}
|
||||
</Typography.Link>
|
||||
))}
|
||||
{files.map((file, idx) => renderFile(file, idx))}
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
Row,
|
||||
Col,
|
||||
|
|
@ -95,7 +96,7 @@ const SurveyMonitor = (props) => {
|
|||
...router.query,
|
||||
dateRange:
|
||||
router.query.startTime && router.query.endTime
|
||||
? [router.query.startTime, router.query.endTime]
|
||||
? [dayjs(router.query.startTime), dayjs(router.query.endTime)]
|
||||
: undefined,
|
||||
});
|
||||
getStat();
|
||||
|
|
@ -116,7 +117,7 @@ const SurveyMonitor = (props) => {
|
|||
|
||||
const handleReset = (values) => {
|
||||
searchForm.resetFields();
|
||||
router.query = { ...values, current: 1, size: 10 };
|
||||
router.query = { ...values, current: 1, size: 10, startTime: undefined, endTime: undefined };
|
||||
getData();
|
||||
};
|
||||
|
||||
|
|
@ -218,14 +219,14 @@ const SurveyMonitor = (props) => {
|
|||
},
|
||||
},
|
||||
{
|
||||
title: "应到/实到",
|
||||
title: "实到/应到",
|
||||
width: 100,
|
||||
render: (_, r) => `${r.expectedCount} / ${r.actualCount}`,
|
||||
render: (_, r) => `${r.actualCount || 0} / ${r.expectedCount || 0}`,
|
||||
},
|
||||
{
|
||||
title: "签到/签退",
|
||||
width: 100,
|
||||
render: (_, r) => `${r.signInCount} / ${r.signOutCount}`,
|
||||
render: (_, r) => `${r.signInCount || 0} / ${r.signOutCount || 0}`,
|
||||
},
|
||||
{
|
||||
title: "现场照片",
|
||||
|
|
|
|||
|
|
@ -13,10 +13,13 @@ import {
|
|||
import { ArrowLeftOutlined } from "@ant-design/icons";
|
||||
import WebOfficeSDK from "~/web-office-sdk-solution-v2.0.7/web-office-sdk-solution-v2.0.7.es.js";
|
||||
import { createPortal } from "react-dom";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
|
||||
import "./index.less";
|
||||
|
||||
const { router } = tools;
|
||||
|
||||
const App = (props) => {
|
||||
const { onCancel, safetyEvalBusiness } = props;
|
||||
const { createDocLoading } = safetyEvalBusiness;
|
||||
|
|
@ -247,7 +250,7 @@ const App = (props) => {
|
|||
size="small"
|
||||
onClick={() => {
|
||||
props
|
||||
.createWpsDoc({ docxUrl: url })
|
||||
.createWpsDoc({ docxUrl: url, projectId: router.query.id})
|
||||
.then((res) => {
|
||||
const fileId = res?.data?.fileId;
|
||||
if (!fileId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue