|
@ -47,6 +47,7 @@ import { |
|
|
TreeSelectGroup, |
|
|
TreeSelectGroup, |
|
|
} from "@/components"; |
|
|
} from "@/components"; |
|
|
import "./index.scss"; |
|
|
import "./index.scss"; |
|
|
|
|
|
import { getToken } from "@/config/cookie"; |
|
|
import { useSetState, useSessionStorageState, useUpdateEffect } from "ahooks"; |
|
|
import { useSetState, useSessionStorageState, useUpdateEffect } from "ahooks"; |
|
|
|
|
|
|
|
|
const { TextArea } = Input; |
|
|
const { TextArea } = Input; |
|
@ -57,6 +58,7 @@ function ConfigRoad() { |
|
|
const parking_id = location.search.split("=")[1].split("&")[0]; |
|
|
const parking_id = location.search.split("=")[1].split("&")[0]; |
|
|
const operator_id = location.search.split("&")[1].split("=")[1]; |
|
|
const operator_id = location.search.split("&")[1].split("=")[1]; |
|
|
const region_id = location.search.split("&")[2].split("=")[1]; |
|
|
const region_id = location.search.split("&")[2].split("=")[1]; |
|
|
|
|
|
const [modalBtnLoading,setModalBtnLoading] = useState(false) |
|
|
//泊位管理Form |
|
|
//泊位管理Form |
|
|
const [berthForm] = Form.useForm(); |
|
|
const [berthForm] = Form.useForm(); |
|
|
const [dataForm] = Form.useForm(); |
|
|
const [dataForm] = Form.useForm(); |
|
@ -66,8 +68,8 @@ function ConfigRoad() { |
|
|
const [getIdValue, setGetIdValue] = useState({}) |
|
|
const [getIdValue, setGetIdValue] = useState({}) |
|
|
//计费规则添加弹窗的泊位选择框 |
|
|
//计费规则添加弹窗的泊位选择框 |
|
|
const [showBerthSelect, setShowBerthSelect] = useState(false); |
|
|
const [showBerthSelect, setShowBerthSelect] = useState(false); |
|
|
//编辑杆位 |
|
|
|
|
|
const [editTitle,setEditTitle]=useState(false) |
|
|
|
|
|
|
|
|
//编辑杆位 |
|
|
|
|
|
const [editTitle,setEditTitle]=useState(false) |
|
|
const berthManage = { |
|
|
const berthManage = { |
|
|
form: [ |
|
|
form: [ |
|
|
{ |
|
|
{ |
|
@ -242,10 +244,13 @@ function ConfigRoad() { |
|
|
video_content: "", |
|
|
video_content: "", |
|
|
}, |
|
|
}, |
|
|
exporturl: "/api/bpm/berth/export", |
|
|
exporturl: "/api/bpm/berth/export", |
|
|
downloadUrl: "", |
|
|
|
|
|
|
|
|
downloadUrl: "api/bpm/berth/berth_import_template", |
|
|
importProps: { |
|
|
importProps: { |
|
|
name: "file", |
|
|
name: "file", |
|
|
action: "/PMS/api/bpm/berth/import", |
|
|
action: "/PMS/api/bpm/berth/import", |
|
|
|
|
|
headers: { |
|
|
|
|
|
Authorization: getToken(), |
|
|
|
|
|
}, |
|
|
onChange(info) { |
|
|
onChange(info) { |
|
|
if (info.file.status !== "uploading") { |
|
|
if (info.file.status !== "uploading") { |
|
|
console.log(info.file, info.fileList); |
|
|
console.log(info.file, info.fileList); |
|
@ -455,6 +460,9 @@ function ConfigRoad() { |
|
|
importProps: { |
|
|
importProps: { |
|
|
name: "file", |
|
|
name: "file", |
|
|
data: { road_id: parking_id }, |
|
|
data: { road_id: parking_id }, |
|
|
|
|
|
headers: { |
|
|
|
|
|
Authorization: getToken(), |
|
|
|
|
|
}, |
|
|
action: "/PMS/api/bpm/device/import_device", |
|
|
action: "/PMS/api/bpm/device/import_device", |
|
|
onChange(info) { |
|
|
onChange(info) { |
|
|
if (info.file.status !== "uploading") { |
|
|
if (info.file.status !== "uploading") { |
|
@ -618,12 +626,15 @@ function ConfigRoad() { |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
key: "id", |
|
|
key: "id", |
|
|
exporturl: "", |
|
|
|
|
|
|
|
|
exporturl: "/api/bpm/device/export_pole_position", |
|
|
downloadUrl: "/api/bpm/device/pole_position_import_template", |
|
|
downloadUrl: "/api/bpm/device/pole_position_import_template", |
|
|
importProps: { |
|
|
importProps: { |
|
|
name: "file", |
|
|
name: "file", |
|
|
action: "/PMS/api/bpm/device/import_pole_position", |
|
|
action: "/PMS/api/bpm/device/import_pole_position", |
|
|
data: { road_id: parking_id }, |
|
|
data: { road_id: parking_id }, |
|
|
|
|
|
headers: { |
|
|
|
|
|
Authorization: getToken(), |
|
|
|
|
|
}, |
|
|
onChange(info) { |
|
|
onChange(info) { |
|
|
if (info.file.status !== "uploading") { |
|
|
if (info.file.status !== "uploading") { |
|
|
console.log(info.file, info.fileList); |
|
|
console.log(info.file, info.fileList); |
|
@ -751,6 +762,7 @@ function ConfigRoad() { |
|
|
<a |
|
|
<a |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
setCurRuleRecord(record); |
|
|
setCurRuleRecord(record); |
|
|
|
|
|
console.log(record); |
|
|
ruleForm.setFieldsValue({ |
|
|
ruleForm.setFieldsValue({ |
|
|
vehicle_type: record.vehicle_type, |
|
|
vehicle_type: record.vehicle_type, |
|
|
rule_id: record.rule_id, |
|
|
rule_id: record.rule_id, |
|
@ -759,12 +771,14 @@ function ConfigRoad() { |
|
|
}); |
|
|
}); |
|
|
// setSelectedBerth(record.berth_ids.split(",").map(item => +item)) |
|
|
// setSelectedBerth(record.berth_ids.split(",").map(item => +item)) |
|
|
setRuleModal(true); |
|
|
setRuleModal(true); |
|
|
|
|
|
// setIsRuleEdit(true); |
|
|
if (record.berth_ids === '') { |
|
|
if (record.berth_ids === '') { |
|
|
setShowBerthSelect(false); |
|
|
setShowBerthSelect(false); |
|
|
setIsRuleEdit(true); |
|
|
|
|
|
} else { |
|
|
|
|
|
setShowBerthSelect(true); |
|
|
|
|
|
setIsRuleEdit(false); |
|
|
setIsRuleEdit(false); |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
setShowBerthSelect(true); |
|
|
|
|
|
setIsRuleEdit(true); |
|
|
} |
|
|
} |
|
|
let data = { |
|
|
let data = { |
|
|
road_id: parking_id, |
|
|
road_id: parking_id, |
|
@ -1327,6 +1341,7 @@ function ConfigRoad() { |
|
|
} |
|
|
} |
|
|
//数据采集设备管理提交接口 |
|
|
//数据采集设备管理提交接口 |
|
|
function handleDataAcquistionModal() { |
|
|
function handleDataAcquistionModal() { |
|
|
|
|
|
setModalBtnLoading(true) |
|
|
function addDevice(res) { |
|
|
function addDevice(res) { |
|
|
ajax |
|
|
ajax |
|
|
.addDevice({ |
|
|
.addDevice({ |
|
@ -1336,6 +1351,7 @@ function ConfigRoad() { |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
if (res.status === 20000) { |
|
|
if (res.status === 20000) { |
|
|
|
|
|
setModalBtnLoading(false) |
|
|
message.success(res.message); |
|
|
message.success(res.message); |
|
|
setDataAcquistionModal({ |
|
|
setDataAcquistionModal({ |
|
|
...dataAcquistionModal, |
|
|
...dataAcquistionModal, |
|
@ -1344,6 +1360,7 @@ function ConfigRoad() { |
|
|
formRef.current.getList(); |
|
|
formRef.current.getList(); |
|
|
} else { |
|
|
} else { |
|
|
message.error(res.message); |
|
|
message.error(res.message); |
|
|
|
|
|
setModalBtnLoading(false) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -1812,6 +1829,7 @@ function ConfigRoad() { |
|
|
</div> |
|
|
</div> |
|
|
<Modal |
|
|
<Modal |
|
|
open={importGroup.visible} |
|
|
open={importGroup.visible} |
|
|
|
|
|
destroyOnClose={true} |
|
|
onCancel={() => { |
|
|
onCancel={() => { |
|
|
setImportGroup({ ...importGroup, visible: false }); |
|
|
setImportGroup({ ...importGroup, visible: false }); |
|
|
}} |
|
|
}} |
|
@ -2073,10 +2091,11 @@ function ConfigRoad() { |
|
|
{/* 计费规则添加弹窗 */} |
|
|
{/* 计费规则添加弹窗 */} |
|
|
<Modal |
|
|
<Modal |
|
|
open={ruleModal} |
|
|
open={ruleModal} |
|
|
// title={isRuleEdit ? '编辑' : '添加'} |
|
|
|
|
|
|
|
|
title={isRuleEdit ? '编辑' : '添加'} |
|
|
width={1000} |
|
|
width={1000} |
|
|
onCancel={() => { |
|
|
onCancel={() => { |
|
|
setRuleModal(false); |
|
|
setRuleModal(false); |
|
|
|
|
|
setSelectedBerth([]); |
|
|
}} |
|
|
}} |
|
|
style={{ |
|
|
style={{ |
|
|
top: 2, |
|
|
top: 2, |
|
@ -2121,9 +2140,10 @@ function ConfigRoad() { |
|
|
<Radio.Group |
|
|
<Radio.Group |
|
|
disabled={getCarType || isRuleEdit} |
|
|
disabled={getCarType || isRuleEdit} |
|
|
onChange={(e) => { |
|
|
onChange={(e) => { |
|
|
|
|
|
console.log(e.target.value); |
|
|
if (e.target.value === 1) { |
|
|
if (e.target.value === 1) { |
|
|
|
|
|
|
|
|
setShowBerthSelect(true); |
|
|
setShowBerthSelect(true); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
setShowBerthSelect(false); |
|
|
setShowBerthSelect(false); |
|
|
|
|
|
|
|
@ -2141,7 +2161,7 @@ function ConfigRoad() { |
|
|
]} |
|
|
]} |
|
|
/> |
|
|
/> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
{showBerthSelect && isRuleEdit ? ( |
|
|
|
|
|
|
|
|
{showBerthSelect ? ( |
|
|
<Form.Item |
|
|
<Form.Item |
|
|
label="对应的泊位号" |
|
|
label="对应的泊位号" |
|
|
shouldUpdate={(preValue, curValue) => { |
|
|
shouldUpdate={(preValue, curValue) => { |
|
@ -2214,7 +2234,7 @@ function ConfigRoad() { |
|
|
onCancel={() => { |
|
|
onCancel={() => { |
|
|
setEditPoleModal({ ...editPoleModal, visible: false }); |
|
|
setEditPoleModal({ ...editPoleModal, visible: false }); |
|
|
}} |
|
|
}} |
|
|
title="编辑杆位" |
|
|
|
|
|
|
|
|
title={editTitle?"编辑杆位":"添加杆位"} |
|
|
onOk={submitPole} |
|
|
onOk={submitPole} |
|
|
> |
|
|
> |
|
|
<Form |
|
|
<Form |
|
@ -2335,6 +2355,7 @@ function ConfigRoad() { |
|
|
onCancel={() => { |
|
|
onCancel={() => { |
|
|
setDataAcquistionModal({ ...dataAcquistionModal, visible: false }); |
|
|
setDataAcquistionModal({ ...dataAcquistionModal, visible: false }); |
|
|
}} |
|
|
}} |
|
|
|
|
|
confirmLoading={modalBtnLoading} |
|
|
destroyOnClose |
|
|
destroyOnClose |
|
|
onOk={handleDataAcquistionModal} |
|
|
onOk={handleDataAcquistionModal} |
|
|
title={dataAcquistionModal.isEdit ? "编辑设备" : "添加设备"} |
|
|
title={dataAcquistionModal.isEdit ? "编辑设备" : "添加设备"} |
|
|