车辆违规管理、车辆黑名单管理

master
LiuJiaNan 2026-03-12 10:33:04 +08:00
parent b137834fba
commit d8af77fa14
7 changed files with 165 additions and 90 deletions

View File

@ -34,7 +34,7 @@
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-signature-canvas": "^1.1.0-alpha.2", "react-signature-canvas": "^1.1.0-alpha.2",
"zy-react-library": "^1.2.4" "zy-react-library": "^1.2.5"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^5.4.1", "@antfu/eslint-config": "^5.4.1",

View File

@ -2,17 +2,17 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
export const vehicleBlacklistList = declareRequest( export const vehicleBlacklistList = declareRequest(
"vehicleBlacklistLoading", "vehicleBlacklistLoading",
`Post > @/primeport/`, `Post > @/primeport/vehicleBlack/list`,
); );
export const vehicleBlacklistAdd = declareRequest( export const vehicleBlacklistAdd = declareRequest(
"vehicleBlacklistLoading", "vehicleBlacklistLoading",
`Post > @/primeport/`, `Post > @/primeport/vehicleBlack/save`,
); );
export const vehicleBlacklistDelete = declareRequest( export const vehicleBlacklistDelete = declareRequest(
"vehicleBlacklistLoading", "vehicleBlacklistLoading",
`Post > @/primeport/`, `Delete > @/primeport/vehicleBlack/{id}`,
); );
export const vehicleBlacklistInfo = declareRequest( export const vehicleBlacklistInfo = declareRequest(
"vehicleBlacklistLoading", "vehicleBlacklistLoading",
`Post > @/primeport/`, `Get > /primeport/vehicleBlack/{id}`,
); );

View File

@ -2,21 +2,21 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
export const vehiclesViolationList = declareRequest( export const vehiclesViolationList = declareRequest(
"vehiclesViolationLoading", "vehiclesViolationLoading",
`Post > @/primeport/`, `Post > @/primeport/vehicleViolations/list`,
); );
export const vehiclesViolationAdd = declareRequest( export const vehiclesViolationAdd = declareRequest(
"vehiclesViolationLoading", "vehiclesViolationLoading",
`Post > @/primeport/`, `Post > @/primeport/vehicleViolations/save`,
); );
export const vehiclesViolationViolationRecordsList = declareRequest( export const vehiclesViolationViolationRecordsList = declareRequest(
"vehiclesViolationLoading", "vehiclesViolationLoading",
`Post > @/primeport/`, `Post > @/primeport/vehicleViolations/detailsRecordList`,
); );
export const vehiclesViolationViolationRecordsDelete = declareRequest( export const vehiclesViolationViolationRecordsDelete = declareRequest(
"vehiclesViolationLoading", "vehiclesViolationLoading",
`Post > @/primeport/`, `Delete > @/primeport/vehicleViolations/{id}`,
); );
export const vehiclesViolationViolationRecordsInfo = declareRequest( export const vehiclesViolationViolationRecordsInfo = declareRequest(
"vehiclesViolationLoading", "vehiclesViolationLoading",
`Post > @/primeport/`, `Get > /primeport/vehicleViolations/{id}`,
); );

View File

@ -1,6 +1,6 @@
import useUrlState from "@ahooksjs/use-url-state"; import useUrlState from "@ahooksjs/use-url-state";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Descriptions, Form, message, Modal, Space, Tabs } from "antd"; import { Button, Descriptions, message, Modal, Space, Tabs } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder"; import FormBuilder from "zy-react-library/components/FormBuilder";
import AddIcon from "zy-react-library/components/Icon/AddIcon"; import AddIcon from "zy-react-library/components/Icon/AddIcon";
@ -10,6 +10,8 @@ import Search from "zy-react-library/components/Search";
import DictionarySelect from "zy-react-library/components/Select/Dictionary"; import DictionarySelect from "zy-react-library/components/Select/Dictionary";
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
import useGetFile from "zy-react-library/hooks/useGetFile";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { LICENSE_PLATE_NUMBER } from "zy-react-library/regular"; import { LICENSE_PLATE_NUMBER } from "zy-react-library/regular";
import { NS_VEHICLE_BLACKLIST } from "~/enumerate/namespace"; import { NS_VEHICLE_BLACKLIST } from "~/enumerate/namespace";
@ -25,7 +27,7 @@ function List(props) {
const [viewModalVisible, setViewModalVisible] = useState(false); const [viewModalVisible, setViewModalVisible] = useState(false);
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const [form] = Form.useForm(); const [form] = Search.useForm();
const [urlState, setUrlState] = useUrlState({ const [urlState, setUrlState] = useUrlState({
platform: props.platform || TABS_ENUM[0].key, platform: props.platform || TABS_ENUM[0].key,
}, { }, {
@ -39,7 +41,7 @@ function List(props) {
const onDelete = (record) => { const onDelete = (record) => {
Modal.confirm({ Modal.confirm({
title: "移除确认", title: "移除确认",
content: `确定要将车牌号 ${record.todo1} 从黑名单中移除吗?`, content: `确定要将车牌号 ${record.licenceNo} 从黑名单中移除吗?`,
onOk: async () => { onOk: async () => {
const { success } = await props["vehicleBlacklistDelete"]({ id: record.id }); const { success } = await props["vehicleBlacklistDelete"]({ id: record.id });
if (success) { if (success) {
@ -55,13 +57,13 @@ function List(props) {
<Search <Search
options={[ options={[
{ {
name: "todo2", name: "vehicleDepartmentId",
label: "车辆所属部门", label: "车辆所属部门",
render: (<DepartmentSelectTree searchType="inType" params={{ enterpriseType: [+urlState.platform] }} />), render: (<DepartmentSelectTree searchType="inType" params={{ enterpriseType: [+urlState.platform] }} />),
}, },
{ name: "todo3", label: "车辆所属人" }, { name: "employeeVehicleUserName", label: "车辆所属人" },
{ name: "todo4", label: "车牌号" }, { name: "licenceNo", label: "车牌号" },
{ name: "todo5", label: "车辆类型", render: (<DictionarySelect dictValue="VEHICLE_TYPE" />) }, { name: "vehicleType", label: "车辆类型", render: (<DictionarySelect dictValue="VEHICLE_TYPE" />) },
]} ]}
form={form} form={form}
onFinish={getData} onFinish={getData}
@ -74,7 +76,7 @@ function List(props) {
items={TABS_ENUM} items={TABS_ENUM}
onChange={(event) => { onChange={(event) => {
setUrlState({ platform: event }); setUrlState({ platform: event });
form.setFieldValue("todo2", ""); form.setFieldValue("vehicleDepartmentId", "");
getData(); getData();
}} }}
/> />
@ -92,12 +94,12 @@ function List(props) {
</Button> </Button>
)} )}
columns={[ columns={[
{ title: "车辆所属单位", dataIndex: "todo1" }, { title: "车辆所属单位", dataIndex: "vehicleCorpName" },
{ title: "车辆所属部门", dataIndex: "todo2" }, { title: "车辆所属部门", dataIndex: "vehicleDepartmentName" },
{ title: "车辆归属人", dataIndex: "todo3" }, { title: "车辆归属人", dataIndex: "employeeVehicleUserName" },
{ title: "车牌号", dataIndex: "todo4" }, { title: "车牌号", dataIndex: "licenceNo" },
{ title: "车牌类型", dataIndex: "todo5" }, { title: "车牌类型", dataIndex: "licenceTypeName" },
{ title: "车辆类型", dataIndex: "todo6" }, { title: "车辆类型", dataIndex: "vehicleTypeName" },
{ {
title: "操作", title: "操作",
width: 120, width: 120,
@ -153,7 +155,7 @@ function List(props) {
} }
const AddModalComponent = (props) => { const AddModalComponent = (props) => {
const [form] = Form.useForm(); const [form] = FormBuilder.useForm();
const onSubmit = async (values) => { const onSubmit = async (values) => {
const { success } = await props["vehicleBlacklistAdd"]({ ...values }); const { success } = await props["vehicleBlacklistAdd"]({ ...values });
@ -182,9 +184,29 @@ const AddModalComponent = (props) => {
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
onFinish={onSubmit} onFinish={onSubmit}
options={[ options={[
{ name: "todo2", label: "车牌号", rules: [{ pattern: LICENSE_PLATE_NUMBER, message: "请输入正确的车牌号" }] }, { name: "licenceNo", label: "车牌号", rules: [{ pattern: LICENSE_PLATE_NUMBER, message: "请输入正确的车牌号" }] },
{ name: "todo1", label: "车牌类型", render: (<DictionarySelect dictValue="LICENSE_PLATE_TYPE" />) }, {
{ name: "todo3", label: "车辆类型", render: (<DictionarySelect dictValue="VEHICLE_TYPE" />) }, name: "licenceType",
label: "车牌类型",
render: (
<DictionarySelect
dictValue="LICENSE_PLATE_TYPE"
onGetLabel={label => form.setFieldValue("licenceTypeName", label)}
/>
),
},
{ name: "licenceTypeName", label: "车牌类型名称", onlyForLabel: true },
{
name: "vehicleType",
label: "车辆类型",
render: (
<DictionarySelect
dictValue="VEHICLE_TYPE"
onGetLabel={label => form.setFieldValue("vehicleTypeName", label)}
/>
),
},
{ name: "vehicleTypeName", label: "车辆类型名称", onlyForLabel: true },
]} ]}
/> />
</Modal> </Modal>
@ -194,9 +216,17 @@ const AddModalComponent = (props) => {
const ViewModalComponent = (props) => { const ViewModalComponent = (props) => {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const { loading: getFileLoading, getFile } = useGetFile();
const getData = async () => { const getData = async () => {
const { data } = await props["vehicleBlacklistInfo"]({ id: props.id }); const { data } = await props["vehicleBlacklistInfo"]({ id: props.id });
setInfo(data); const drivingLicenseFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[601], eqForeignKey: data.drivingLicenseId });
const attachmentFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[602], eqForeignKey: data.attachmentId });
setInfo({
...data,
drivingLicenseFile,
attachmentFile,
});
}; };
useEffect(() => { useEffect(() => {
@ -213,22 +243,22 @@ const ViewModalComponent = (props) => {
footer={[ footer={[
<Button key="cancel" onClick={props.onCancel}>取消</Button>, <Button key="cancel" onClick={props.onCancel}>取消</Button>,
]} ]}
loading={props.vehicleBlacklist.vehicleBlacklistLoading} loading={props.vehicleBlacklist.vehicleBlacklistLoading || getFileLoading}
> >
<Descriptions <Descriptions
bordered bordered
column={1} column={1}
styles={{ label: { width: 200 } }} styles={{ label: { width: 200 } }}
items={[ items={[
{ label: "车辆所属企业", children: info.todo1 }, { label: "车辆所属企业", children: info.vehicleCorpName },
{ label: "车辆所属部门", children: info.todo2 }, { label: "车辆所属部门", children: info.vehicleDepartmentName },
{ label: "车辆所属人", children: info.todo3 }, { label: "车辆所属人", children: info.employeeVehicleUserName },
{ label: "车牌号", children: info.todo4 }, { label: "车牌号", children: info.licenceNo },
{ label: "车牌类型", children: info.todo5 }, { label: "车牌类型", children: info.licenceTypeName },
{ label: "车辆类型", children: info.todo6 }, { label: "车辆类型", children: info.vehicleTypeName },
{ label: "访问港区范围", children: info.todo7 }, { label: "访问港区范围", children: JSON.parse(info.gateLevelAuthArea)?.area?.map(item => item.value)?.join("、") },
{ label: "车辆照片", children: (<PreviewImg files={info.todo8} />) }, { label: "车辆照片", children: (<PreviewImg files={info.attachmentFile} />) },
{ label: "行驶证照片", children: (<PreviewImg files={info.todo9} />) }, { label: "行驶证照片", children: (<PreviewImg files={info.drivingLicenseFile} />) },
]} ]}
/> />
</Modal> </Modal>

View File

@ -1,6 +1,6 @@
import useUrlState from "@ahooksjs/use-url-state"; import useUrlState from "@ahooksjs/use-url-state";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, message, Modal, Tabs } from "antd"; import { Button, message, Modal, Tabs } from "antd";
import { useState } from "react"; import { useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder"; import FormBuilder from "zy-react-library/components/FormBuilder";
import AddIcon from "zy-react-library/components/Icon/AddIcon"; import AddIcon from "zy-react-library/components/Icon/AddIcon";
@ -11,7 +11,9 @@ import DepartmentSelectTree from "zy-react-library/components/SelectTree/Departm
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
import Upload from "zy-react-library/components/Upload"; import Upload from "zy-react-library/components/Upload";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import useUploadFile from "zy-react-library/hooks/useUploadFile";
import { LICENSE_PLATE_NUMBER } from "zy-react-library/regular"; import { LICENSE_PLATE_NUMBER } from "zy-react-library/regular";
import { NS_VEHICLES_VIOLATION } from "~/enumerate/namespace"; import { NS_VEHICLES_VIOLATION } from "~/enumerate/namespace";
@ -24,7 +26,7 @@ const TABS_ENUM = [
function List(props) { function List(props) {
const [addModalVisible, setAddModalVisible] = useState(false); const [addModalVisible, setAddModalVisible] = useState(false);
const [form] = Form.useForm(); const [form] = Search.useForm();
const [urlState, setUrlState] = useUrlState({ const [urlState, setUrlState] = useUrlState({
platform: props.platform || TABS_ENUM[0].key, platform: props.platform || TABS_ENUM[0].key,
}, { }, {
@ -40,13 +42,13 @@ function List(props) {
<Search <Search
options={[ options={[
{ {
name: "todo2", name: "vehicleDepartmentId",
label: "车辆所属部门", label: "车辆所属部门",
render: (<DepartmentSelectTree searchType="inType" params={{ enterpriseType: [+urlState.platform] }} />), render: (<DepartmentSelectTree searchType="inType" params={{ enterpriseType: [+urlState.platform] }} />),
}, },
{ name: "todo3", label: "车辆所属人" }, { name: "employeeVehicleUserName", label: "车辆所属人" },
{ name: "todo4", label: "车牌号" }, { name: "licenceNo", label: "车牌号" },
{ name: "todo5", label: "车辆类型", render: (<DictionarySelect dictValue="VEHICLE_TYPE" />) }, { name: "vehicleType", label: "车辆类型", render: (<DictionarySelect dictValue="VEHICLE_TYPE" />) },
]} ]}
form={form} form={form}
onFinish={getData} onFinish={getData}
@ -59,7 +61,7 @@ function List(props) {
items={TABS_ENUM} items={TABS_ENUM}
onChange={(event) => { onChange={(event) => {
setUrlState({ platform: event }); setUrlState({ platform: event });
form.setFieldValue("todo2", ""); form.setFieldValue("vehicleDepartmentId", "");
getData(); getData();
}} }}
/> />
@ -77,13 +79,13 @@ function List(props) {
</Button> </Button>
)} )}
columns={[ columns={[
{ title: "车辆所属单位", dataIndex: "todo1" }, { title: "车辆所属单位", dataIndex: "vehicleCorpName" },
{ title: "车辆所属部门", dataIndex: "todo2" }, { title: "车辆所属部门", dataIndex: "vehicleDepartmentName" },
{ title: "车辆归属人", dataIndex: "todo3" }, { title: "车辆归属人", dataIndex: "employeeVehicleUserName" },
{ title: "车牌号", dataIndex: "todo4" }, { title: "车牌号", dataIndex: "licenceNo" },
{ title: "车牌类型", dataIndex: "todo5" }, { title: "车牌类型", dataIndex: "licenceTypeName" },
{ title: "车辆类型", dataIndex: "todo6" }, { title: "车辆类型", dataIndex: "vehicleTypeName" },
{ title: "违规次数", dataIndex: "todo7" }, { title: "违规次数", dataIndex: "violationCount" },
{ {
title: "操作", title: "操作",
width: 120, width: 120,
@ -117,10 +119,16 @@ function List(props) {
} }
const AddModalComponent = (props) => { const AddModalComponent = (props) => {
const [form] = Form.useForm(); const [form] = FormBuilder.useForm();
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
const onSubmit = async (values) => { const onSubmit = async (values) => {
const { success } = await props["vehiclesViolationAdd"]({ ...values }); const { id: illegalImagesId } = await uploadFile({
single: false,
files: values.illegalImages,
params: { foreignKey: "", type: UPLOAD_FILE_TYPE_ENUM[607] },
});
const { success } = await props["vehiclesViolationAdd"]({ ...values, illegalImagesId });
if (success) { if (success) {
message.success("操作成功"); message.success("操作成功");
props.onCancel(); props.onCancel();
@ -136,29 +144,59 @@ const AddModalComponent = (props) => {
maskClosable={false} maskClosable={false}
onCancel={props.onCancel} onCancel={props.onCancel}
onOk={form.submit} onOk={form.submit}
confirmLoading={props.vehiclesViolation.vehiclesViolationLoading} confirmLoading={props.vehiclesViolation.vehiclesViolationLoading || uploadFileLoading}
> >
<FormBuilder <FormBuilder
loading={props.vehiclesViolation.vehiclesViolationLoading} loading={props.vehiclesViolation.vehiclesViolationLoading || uploadFileLoading}
form={form} form={form}
showActionButtons={false} showActionButtons={false}
span={24} span={24}
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
onFinish={onSubmit} onFinish={onSubmit}
options={[ options={[
{ name: "todo2", label: "车牌号", rules: [{ pattern: LICENSE_PLATE_NUMBER, message: "请输入正确的车牌号" }] }, { name: "licenceNo", label: "车牌号", rules: [{ pattern: LICENSE_PLATE_NUMBER, message: "请输入正确的车牌号" }] },
{ name: "todo1", label: "车牌类型", render: (<DictionarySelect dictValue="LICENSE_PLATE_TYPE" />) },
{ name: "todo3", label: "车辆类型", render: (<DictionarySelect dictValue="VEHICLE_TYPE" />) },
{ name: "todo4", label: "违规时间", render: FORM_ITEM_RENDER_ENUM.DATETIME },
{ name: "todo5", label: "违规类型", render: (<DictionarySelect dictValue="VEHICLE_VIOLATION_TYPE" />) },
{ {
name: "todo6", name: "licenceType",
label: "车牌类型",
render: (
<DictionarySelect
dictValue="LICENSE_PLATE_TYPE"
onGetLabel={label => form.setFieldValue("licenceTypeName", label)}
/>
),
},
{ name: "licenceTypeName", label: "车牌类型名称", onlyForLabel: true },
{
name: "vehicleType",
label: "车辆类型",
render: (
<DictionarySelect
dictValue="VEHICLE_TYPE"
onGetLabel={label => form.setFieldValue("vehicleTypeName", label)}
/>
),
},
{ name: "vehicleTypeName", label: "车辆类型名称", onlyForLabel: true },
{ name: "violationtime", label: "违规时间", render: FORM_ITEM_RENDER_ENUM.DATETIME },
{
name: "violationType",
label: "违规类型",
render: (
<DictionarySelect
dictValue="VEHICLE_VIOLATION_TYPE"
onGetLabel={label => form.setFieldValue("violationTypeName", label)}
/>
),
},
{ name: "violationTypeName", label: "违规类型名称", onlyForLabel: true },
{
name: "location",
label: "违规区域", label: "违规区域",
render: FORM_ITEM_RENDER_ENUM.TEXTAREA, render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
placeholder: "违规区域需明确车辆在港口内的具体违规位置如某一口门附近、某一码头区域、某一仓库通道等..", placeholder: "违规区域需明确车辆在港口内的具体违规位置如某一口门附近、某一码头区域、某一仓库通道等..",
}, },
{ name: "todo7", label: "违规照片", render: (<Upload />) }, { name: "illegalImages", label: "违规照片", render: (<Upload />) },
{ name: "todo8", label: " 违规说明", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false }, { name: "describeMessage", label: " 违规说明", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
]} ]}
/> />
</Modal> </Modal>

View File

@ -1,11 +1,13 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Descriptions, Form, message, Modal, Space } from "antd"; import { Button, Descriptions, message, Modal, Space } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Page from "zy-react-library/components/Page"; import Page from "zy-react-library/components/Page";
import PreviewImg from "zy-react-library/components/PreviewImg"; import PreviewImg from "zy-react-library/components/PreviewImg";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
import DictionarySelect from "zy-react-library/components/Select/Dictionary"; import DictionarySelect from "zy-react-library/components/Select/Dictionary";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
import useGetFile from "zy-react-library/hooks/useGetFile";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { NS_VEHICLES_VIOLATION } from "~/enumerate/namespace"; import { NS_VEHICLES_VIOLATION } from "~/enumerate/namespace";
@ -15,10 +17,10 @@ function ViolationRecords(props) {
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const query = useGetUrlQuery(); const query = useGetUrlQuery();
const [form] = Form.useForm(); const [form] = Search.useForm();
const { tableProps, getData } = useTable(props["vehiclesViolationViolationRecordsList"], { const { tableProps, getData } = useTable(props["vehiclesViolationViolationRecordsList"], {
form, form,
params: { id: query.id }, params: { vehicleId: query.id },
}); });
const onDelete = (id) => { const onDelete = (id) => {
@ -39,7 +41,7 @@ function ViolationRecords(props) {
<Page headerTitle="违规记录"> <Page headerTitle="违规记录">
<Search <Search
options={[ options={[
{ name: "todo5", label: "违规类型", render: (<DictionarySelect dictValue="VEHICLE_VIOLATION_TYPE" />) }, { name: "violationType", label: "违规类型", render: (<DictionarySelect dictValue="VEHICLE_VIOLATION_TYPE" />) },
]} ]}
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
form={form} form={form}
@ -47,11 +49,11 @@ function ViolationRecords(props) {
/> />
<Table <Table
columns={[ columns={[
{ title: "车牌号", dataIndex: "todo1" }, { title: "车牌号", dataIndex: "licenceNo" },
{ title: "违规类型", dataIndex: "todo2" }, { title: "违规类型", dataIndex: "violationTypeName" },
{ title: "违规区域", dataIndex: "todo3" }, { title: "违规区域", dataIndex: "location" },
{ title: "违规时间", dataIndex: "todo4" }, { title: "违规时间", dataIndex: "violationtime" },
{ title: "违规说明", dataIndex: "todo5" }, { title: "违规说明", dataIndex: "describeMessage" },
{ {
title: "操作", title: "操作",
width: 200, width: 200,
@ -99,9 +101,15 @@ function ViolationRecords(props) {
const InfoModalComponent = (props) => { const InfoModalComponent = (props) => {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const { loading: getFileLoading, getFile } = useGetFile();
const getData = async () => { const getData = async () => {
const { data } = await props["vehiclesViolationViolationRecordsInfo"]({ id: props.id }); const { data } = await props["vehiclesViolationViolationRecordsInfo"]({ id: props.id });
setInfo(data); const illegalImages = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[607], eqForeignKey: data.illegalImagesId });
setInfo({
...data,
illegalImages,
});
}; };
useEffect(() => { useEffect(() => {
@ -110,7 +118,7 @@ const InfoModalComponent = (props) => {
return ( return (
<Modal <Modal
loading={props.vehiclesViolation.vehiclesViolationLoading} loading={props.vehiclesViolation.vehiclesViolationLoading || getFileLoading}
open open
title="查看" title="查看"
maskClosable={false} maskClosable={false}
@ -125,15 +133,15 @@ const InfoModalComponent = (props) => {
column={1} column={1}
styles={{ label: { width: 200 } }} styles={{ label: { width: 200 } }}
items={[ items={[
{ label: "车辆所属单位", children: info.todo1 }, { label: "车辆所属单位", children: info.vehicleCorpName },
{ label: "车辆所属部门", children: info.todo2 }, { label: "车辆所属部门", children: info.vehicleDepartmentName },
{ label: "车辆归属人", children: info.todo3 }, { label: "车辆归属人", children: info.employeeVehicleUserName },
{ label: "车牌号", children: info.todo4 }, { label: "车牌号", children: info.licenceNo },
{ label: "违规类型", children: info.todo5 }, { label: "违规类型", children: info.violationTypeName },
{ label: "违规时间", children: info.todo6 }, { label: "违规时间", children: info.violationtime },
{ label: "违规区域", children: info.todo7 }, { label: "违规区域", children: info.location },
{ label: "违规照片", children: (<PreviewImg files={info.todo8} />) }, { label: "违规照片", children: (<PreviewImg files={info.illegalImages} />) },
{ label: "违规说明", children: info.todo9 }, { label: "违规说明", children: info.describeMessage },
]} ]}
/> />
</Modal> </Modal>

View File

@ -248,15 +248,14 @@ const InfoModalComponent = (props) => {
const getData = async () => { const getData = async () => {
const { data } = await props["vehicleAuditInfo"]({ id: props.id }); const { data } = await props["vehicleAuditInfo"]({ id: props.id });
const drivingLicenseFile = await getFile({ const drivingLicenseFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[601], eqForeignKey: data.drivingLicenseId });
eqType: UPLOAD_FILE_TYPE_ENUM[601],
eqForeignKey: data.drivingLicenseId,
});
const attachmentFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[602], eqForeignKey: data.attachmentId }); const attachmentFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[602], eqForeignKey: data.attachmentId });
const informSignFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[606], eqForeignKey: data.informSignId });
setInfo({ setInfo({
...data, ...data,
drivingLicenseFile, drivingLicenseFile,
attachmentFile, attachmentFile,
informSignFile,
}); });
}; };
@ -284,7 +283,7 @@ const InfoModalComponent = (props) => {
{ label: "审核状态", children: getLabelName({ list: VEHICLE_AUDIT_STATUS_ENUM, status: info.auditStatus }) }, { label: "审核状态", children: getLabelName({ list: VEHICLE_AUDIT_STATUS_ENUM, status: info.auditStatus }) },
{ label: "车辆照片", children: (<PreviewImg files={info.attachmentFile} />) }, { label: "车辆照片", children: (<PreviewImg files={info.attachmentFile} />) },
{ label: "车辆行驶证照片", children: (<PreviewImg files={info.drivingLicenseFile} />) }, { label: "车辆行驶证照片", children: (<PreviewImg files={info.drivingLicenseFile} />) },
{ label: "申请人签字", children: (<PreviewImg files={[info.informSignId]} />) }, // todo { label: "申请人签字", children: (<PreviewImg files={info.informSignFile} />) },
]} ]}
/> />
</div> </div>