fix
parent
c3a5f1f75f
commit
bb6f4595d8
|
|
@ -12,9 +12,9 @@ module.exports = {
|
||||||
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
|
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
|
||||||
//API_HOST: "http://localhost:80",
|
//API_HOST: "http://localhost:80",
|
||||||
|
|
||||||
API_HOST: "http://192.168.0.134",
|
// API_HOST: "http://192.168.0.134",
|
||||||
// API_HOST: "http://192.168.0.150", //太浅
|
// API_HOST: "http://192.168.0.150", //太浅
|
||||||
// API_HOST: "https://gbs-gateway.qhdsafety.com",
|
API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||||
//API_HOST: "http://192.168.0.103", //huwei
|
//API_HOST: "http://192.168.0.103", //huwei
|
||||||
},
|
},
|
||||||
production: {
|
production: {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@ import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import {EVAL_TYPE_OPTIONS} from '~/enumerate/constant';
|
||||||
|
import {QUALIFICATION_INDUSTRY_OPTIONS} from '~/enumerate/enterpriseOptions';
|
||||||
|
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,23 +47,7 @@ const { TextArea } = Input;
|
||||||
|
|
||||||
const UPLOAD_ACTION = `${window.process?.env?.app?.API_HOST || ""}/safetyEval/file/upload`;
|
const UPLOAD_ACTION = `${window.process?.env?.app?.API_HOST || ""}/safetyEval/file/upload`;
|
||||||
|
|
||||||
/** 评价类型(对齐原型文案;编码对齐 OpenAPI PRE/ACCEPT/STATUS) */
|
|
||||||
const REPORT_EVAL_TYPE_OPTIONS = [
|
|
||||||
{ label: "安全预评价", value: "PRE" },
|
|
||||||
{ label: "安全验收评价", value: "ACCEPT" },
|
|
||||||
{ label: "安全现状评价", value: "STATUS" },
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 所属行业(原型选项;编码仅 OpenAPI 示例给出 HAZCHEM,其余按命名约定) */
|
|
||||||
const REPORT_INDUSTRY_OPTIONS = [
|
|
||||||
{ label: "危险化学品", value: "HAZCHEM" },
|
|
||||||
{ label: "金属非金属矿山", value: "METAL_NONMETAL_MINE" },
|
|
||||||
{ label: "金属冶炼", value: "METAL_SMELTING" },
|
|
||||||
{ label: "烟花爆竹", value: "FIREWORKS" },
|
|
||||||
{ label: "城镇燃气", value: "URBAN_GAS" },
|
|
||||||
{ label: "工贸", value: "INDUSTRY_TRADE" },
|
|
||||||
{ label: "其他", value: "OTHER" },
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 保密属性(OpenAPI 仅示例 NORMAL) */
|
/** 保密属性(OpenAPI 仅示例 NORMAL) */
|
||||||
const SECRET_LEVEL_OPTIONS = [
|
const SECRET_LEVEL_OPTIONS = [
|
||||||
|
|
@ -231,7 +218,7 @@ const EvalReportLibrary = (props) => {
|
||||||
uploadForm.setFieldsValue({
|
uploadForm.setFieldsValue({
|
||||||
reportYear: dayjs().year(),
|
reportYear: dayjs().year(),
|
||||||
evalTypeCode: "PRE",
|
evalTypeCode: "PRE",
|
||||||
industryCode: "HAZCHEM",
|
|
||||||
secretLevelCode: "NORMAL",
|
secretLevelCode: "NORMAL",
|
||||||
issueDate: dayjs(),
|
issueDate: dayjs(),
|
||||||
submitToRegulator: 0,
|
submitToRegulator: 0,
|
||||||
|
|
@ -311,12 +298,12 @@ const EvalReportLibrary = (props) => {
|
||||||
reportYear: values.reportYear,
|
reportYear: values.reportYear,
|
||||||
evalTypeCode: values.evalTypeCode,
|
evalTypeCode: values.evalTypeCode,
|
||||||
evalTypeName: getOptionLabel(
|
evalTypeName: getOptionLabel(
|
||||||
REPORT_EVAL_TYPE_OPTIONS,
|
EVAL_TYPE_OPTIONS,
|
||||||
values.evalTypeCode,
|
values.evalTypeCode,
|
||||||
),
|
),
|
||||||
industryCode: values.industryCode,
|
industryCode: values.industryCode,
|
||||||
industryName: getOptionLabel(
|
industryName: getOptionLabel(
|
||||||
REPORT_INDUSTRY_OPTIONS,
|
QUALIFICATION_INDUSTRY_OPTIONS,
|
||||||
values.industryCode,
|
values.industryCode,
|
||||||
),
|
),
|
||||||
evaluatedUnitName: values.evaluatedUnitName?.trim(),
|
evaluatedUnitName: values.evaluatedUnitName?.trim(),
|
||||||
|
|
@ -609,14 +596,14 @@ const EvalReportLibrary = (props) => {
|
||||||
dataIndex: "evalTypeName",
|
dataIndex: "evalTypeName",
|
||||||
width: 120,
|
width: 120,
|
||||||
render: (val, record) =>
|
render: (val, record) =>
|
||||||
val || getOptionLabel(REPORT_EVAL_TYPE_OPTIONS, record.evalTypeCode),
|
val || getOptionLabel(EVAL_TYPE_OPTIONS, record.evalTypeCode),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "所属行业",
|
title: "所属行业",
|
||||||
dataIndex: "industryName",
|
dataIndex: "industryName",
|
||||||
width: 120,
|
width: 120,
|
||||||
render: (val, record) =>
|
render: (val, record) =>
|
||||||
val || getOptionLabel(REPORT_INDUSTRY_OPTIONS, record.industryCode),
|
val || getOptionLabel(QUALIFICATION_INDUSTRY_OPTIONS, record.industryCode),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "被评价单位",
|
title: "被评价单位",
|
||||||
|
|
@ -838,7 +825,7 @@ const EvalReportLibrary = (props) => {
|
||||||
label="评价类型"
|
label="评价类型"
|
||||||
placeholder="全部"
|
placeholder="全部"
|
||||||
allowClear
|
allowClear
|
||||||
options={REPORT_EVAL_TYPE_OPTIONS}
|
options={EVAL_TYPE_OPTIONS}
|
||||||
/>
|
/>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="industryCode" name="industryCode">
|
<Form.Item key="industryCode" name="industryCode">
|
||||||
|
|
@ -846,7 +833,7 @@ const EvalReportLibrary = (props) => {
|
||||||
label="所属行业"
|
label="所属行业"
|
||||||
placeholder="全部"
|
placeholder="全部"
|
||||||
allowClear
|
allowClear
|
||||||
options={REPORT_INDUSTRY_OPTIONS}
|
options={QUALIFICATION_INDUSTRY_OPTIONS}
|
||||||
/>
|
/>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="displayStatus" name="displayStatus">
|
<Form.Item key="displayStatus" name="displayStatus">
|
||||||
|
|
@ -1006,12 +993,12 @@ const EvalReportLibrary = (props) => {
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item name="evalTypeCode" label="评价类型">
|
<Form.Item name="evalTypeCode" label="评价类型">
|
||||||
<Select options={REPORT_EVAL_TYPE_OPTIONS} />
|
<Select options={EVAL_TYPE_OPTIONS} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item name="industryCode" label="所属行业">
|
<Form.Item name="industryCode" label="所属行业">
|
||||||
<Select options={REPORT_INDUSTRY_OPTIONS} />
|
<Select options={QUALIFICATION_INDUSTRY_OPTIONS} placeholder="请选择所属行业" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
|
|
@ -1199,7 +1186,7 @@ const EvalReportLibrary = (props) => {
|
||||||
<span>
|
<span>
|
||||||
{detailData.evalTypeName ||
|
{detailData.evalTypeName ||
|
||||||
getOptionLabel(
|
getOptionLabel(
|
||||||
REPORT_EVAL_TYPE_OPTIONS,
|
EVAL_TYPE_OPTIONS,
|
||||||
detailData.evalTypeCode,
|
detailData.evalTypeCode,
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -1211,7 +1198,7 @@ const EvalReportLibrary = (props) => {
|
||||||
<span>
|
<span>
|
||||||
{detailData.industryName ||
|
{detailData.industryName ||
|
||||||
getOptionLabel(
|
getOptionLabel(
|
||||||
REPORT_INDUSTRY_OPTIONS,
|
QUALIFICATION_INDUSTRY_OPTIONS,
|
||||||
detailData.industryCode,
|
detailData.industryCode,
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||||
import { renderDocxBlob, fillDocxTemplate } from "~/utils/fillDocxTemplate";
|
import { renderDocxBlob, fillDocxTemplate } from "~/utils/fillDocxTemplate";
|
||||||
import SpotCheckDetailModal from "./components/SpotCheckDetailModal";
|
import SpotCheckDetailModal from "./components/SpotCheckDetailModal";
|
||||||
|
import PreviewUrlButton from "~/components/PreviewUrlButton";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
|
|
@ -487,19 +488,6 @@ const EvalReportDatabase = (props) => {
|
||||||
getData(pagination);
|
getData(pagination);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 下载指定 URL 的文件 */
|
|
||||||
const handleFileDownload = (fileUrl, fileName) => {
|
|
||||||
if (!fileUrl) {
|
|
||||||
message.warning("文件地址不存在");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const hide = message.loading("正在下载...", 0);
|
|
||||||
downloadFileByUrl(fileUrl, fileName)
|
|
||||||
.then(() => message.success("下载已开始"))
|
|
||||||
.catch(() => message.error("下载失败,请稍后重试"))
|
|
||||||
.finally(() => hide());
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleViewDetail = async (record) => {
|
const handleViewDetail = async (record) => {
|
||||||
setDetailData(null);
|
setDetailData(null);
|
||||||
setDetailVisible(true);
|
setDetailVisible(true);
|
||||||
|
|
@ -955,7 +943,7 @@ const EvalReportDatabase = (props) => {
|
||||||
open={detailVisible}
|
open={detailVisible}
|
||||||
onCancel={() => setDetailVisible(false)}
|
onCancel={() => setDetailVisible(false)}
|
||||||
width={980}
|
width={980}
|
||||||
destroyOnClose
|
destroyOnHide
|
||||||
className="redb-modal"
|
className="redb-modal"
|
||||||
footer={
|
footer={
|
||||||
<Space>
|
<Space>
|
||||||
|
|
@ -1026,21 +1014,13 @@ const EvalReportDatabase = (props) => {
|
||||||
headers={["文件名称", "文件类型", "版本"]}
|
headers={["文件名称", "文件类型", "版本"]}
|
||||||
rows={[
|
rows={[
|
||||||
[
|
[
|
||||||
<span
|
<PreviewUrlButton
|
||||||
style={{ color: "#1677ff", cursor: "pointer" }}
|
url={detailData.fileUrl}
|
||||||
onClick={() =>
|
|
||||||
handleFileDownload(
|
|
||||||
detailData.fileUrl,
|
|
||||||
detailData.fileName ||
|
|
||||||
detailData.reportName ||
|
|
||||||
"正式安全评价报告.pdf",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{detailData.fileName ||
|
{detailData.fileName ||
|
||||||
detailData.reportName ||
|
detailData.reportName ||
|
||||||
"正式安全评价报告.pdf"}
|
"正式安全评价报告.pdf"}
|
||||||
</span>,
|
</PreviewUrlButton>,
|
||||||
getFileExtLabel(detailData.fileName),
|
getFileExtLabel(detailData.fileName),
|
||||||
"V1.0",
|
"V1.0",
|
||||||
],
|
],
|
||||||
|
|
@ -1051,15 +1031,9 @@ const EvalReportDatabase = (props) => {
|
||||||
<ProtoTable
|
<ProtoTable
|
||||||
headers={["文件名称", "文件类型"]}
|
headers={["文件名称", "文件类型"]}
|
||||||
rows={parseFileList(detailData.contractFileUrls).map((f) => [
|
rows={parseFileList(detailData.contractFileUrls).map((f) => [
|
||||||
<span
|
<PreviewUrlButton key={f.url} url={f.url}>
|
||||||
key={f.url}
|
|
||||||
style={{ color: "#1677ff", cursor: "pointer" }}
|
|
||||||
onClick={() =>
|
|
||||||
handleFileDownload(f.url, f.name || "未命名文件")
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{f.name || "未命名文件"}
|
{f.name || "未命名文件"}
|
||||||
</span>,
|
</PreviewUrlButton>,
|
||||||
getFileExtLabel(f.name || f.url),
|
getFileExtLabel(f.name || f.url),
|
||||||
])}
|
])}
|
||||||
/>
|
/>
|
||||||
|
|
@ -1068,15 +1042,9 @@ const EvalReportDatabase = (props) => {
|
||||||
<ProtoTable
|
<ProtoTable
|
||||||
headers={["文件名称", "文件类型"]}
|
headers={["文件名称", "文件类型"]}
|
||||||
rows={parseFileList(detailData.processDocUrls).map((f) => [
|
rows={parseFileList(detailData.processDocUrls).map((f) => [
|
||||||
<span
|
<PreviewUrlButton key={f.url} url={f.url}>
|
||||||
key={f.url}
|
|
||||||
style={{ color: "#1677ff", cursor: "pointer" }}
|
|
||||||
onClick={() =>
|
|
||||||
handleFileDownload(f.url, f.name || "未命名文件")
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{f.name || "未命名文件"}
|
{f.name || "未命名文件"}
|
||||||
</span>,
|
</PreviewUrlButton>,
|
||||||
getFileExtLabel(f.name || f.url),
|
getFileExtLabel(f.name || f.url),
|
||||||
])}
|
])}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue