From 6acb936db5b8167371a1af6a6952649b4a557b94 Mon Sep 17 00:00:00 2001 From: xingjx Date: Sun, 17 Dec 2023 22:38:04 +0800 Subject: [PATCH 01/10] =?UTF-8?q?fix():=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParkingAlyPeriod/loadable.jsx | 122 --------------------- .../OutSegmentMgm/OutSegment/AddParking.jsx | 6 +- .../ConfigParking/BusinessParameterConfig.jsx | 4 +- 3 files changed, 5 insertions(+), 127 deletions(-) diff --git a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx index 8d598ab..554db83 100644 --- a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx @@ -265,128 +265,6 @@ function ParkingAlyPeriod() { console.log(Math.round(Math.random()*10)) //停车饱和趋势分析分析 折线图 hour 时间对比 const getParkOptionHour = (data) => { - data = [ - { - "date": "2023-11-20", - "hour": "00:00", - "occupancy_rate": "0.02%" - }, - { - "date": "2023-11-22", - "hour": "01:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-22", - "hour": "02:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-22", - "hour": "03:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-22", - "hour": "04:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-22", - "hour": "05:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-22", - "hour": "06:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-22", - "hour": "07:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-29", - "hour": "08:00", - "occupancy_rate": "0.07%" - }, - { - "date": "2023-11-22", - "hour": "09:00", - "occupancy_rate": "0.26%" - }, - { - "date": "2023-11-24", - "hour": "10:00", - "occupancy_rate": "0.18%" - }, - { - "date": "2023-11-22", - "hour": "11:00", - "occupancy_rate": "0.11%" - }, - { - "date": "2023-11-23", - "hour": "12:00", - "occupancy_rate": "0.06%" - }, - { - "date": "2023-11-22", - "hour": "13:00", - "occupancy_rate": "0.08%" - }, - { - "date": "2023-11-21", - "hour": "14:00", - "occupancy_rate": "0.35%" - }, - { - "date": "2023-11-29", - "hour": "15:00", - "occupancy_rate": "0.26%" - }, - { - "date": "2023-11-20", - "hour": "16:00", - "occupancy_rate": "0.32%" - }, - { - "date": "2023-11-22", - "hour": "17:00", - "occupancy_rate": "0.22%" - }, - { - "date": "2023-11-22", - "hour": "18:00", - "occupancy_rate": "0.14%" - }, - { - "date": "2023-11-21", - "hour": "19:00", - "occupancy_rate": "0.01%" - }, - { - "date": "2023-11-22", - "hour": "20:00", - "occupancy_rate": "0%" - }, - { - "date": "2023-11-22", - "hour": "21:00", - "occupancy_rate": "0.05%" - }, - { - "date": "2023-11-21", - "hour": "22:00", - "occupancy_rate": "0.02%" - }, - { - "date": "2023-11-22", - "hour": "23:00", - "occupancy_rate": "0.01%" - } - ] console.log(data) if (!data || data.length <= 0) { setHourData({}) diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx index a5222ae..451030e 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx @@ -179,7 +179,7 @@ function AddParking(props) { is_business, cooperate_type, access_type, - area_id:getAreaArr(areaList, area), + area_id: getAreaArr(areaList, area), }); setLngLat(lng_lat.split(",")); } @@ -212,11 +212,11 @@ function AddParking(props) { } //编辑配置信息接口 function editOutSegmentRoad(params) { - ajax.editOutSegmentRoad(params).then((res) => { + ajax.editOutSegmentRoad({ ...params, id: record.id }).then((res) => { if (res.status === 20000) { message.success("编辑成功"); close(); - location.reload(); + //location.reload(); } else { message.error(res.message); } diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx index c144350..6c485f4 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx @@ -16,12 +16,12 @@ function BusinessParameterConfig(props) { ajax.getRoadServiceEdit(params).then((res) => { if (res.status === 20000) { message.success(res.message); - + } }); } useEffect(() => { - ajax.getRoadAllChild().then((res) => { + ajax.getRoadAllChild({ road_id: id }).then((res) => { if (res.status === 20000) { setChildList(res.data); } From 3a23dc5fcd4c9a8135e4e4eac9201026b6d7ac1c Mon Sep 17 00:00:00 2001 From: xingjx Date: Sun, 17 Dec 2023 22:49:20 +0800 Subject: [PATCH 02/10] =?UTF-8?q?fix():bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConfigParking/BusinessParameterConfig.jsx | 20 ++++++++++++++++++++ src/services/OutRoadMgm/OutSegment.js | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx index 6c485f4..1f7a4e1 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx @@ -26,6 +26,26 @@ function BusinessParameterConfig(props) { setChildList(res.data); } }); + ajax.getRoadServiceParameters({ road_id: id }).then((res) => { + // res = { + // "status": 20000, + // "message": "success", + // "data": { + // "id": "1777413854377155803", + // "road_id": "1777413807249260948", + // "unlicensed_vehicle": 1, + // "similar_plates": 0, + // "monthly_rental_car": 1, + // "military_police_vehicles": 0, + // "free_time": 30, + // "arrearage": 0, + // "road_bias": "0" + // } + // } + if (res.status === 20000) { + form.setFieldsValue({ ...res.data }) + } + }); }, []); return (
diff --git a/src/services/OutRoadMgm/OutSegment.js b/src/services/OutRoadMgm/OutSegment.js index 7dcb26a..33f74d5 100644 --- a/src/services/OutRoadMgm/OutSegment.js +++ b/src/services/OutRoadMgm/OutSegment.js @@ -75,7 +75,7 @@ const editRoadMs = (params) => { data: params, }); }; -///api/orp/road/edit_road_ms 编辑路段MS通信账号 +///api/orp/road/edit_road_ms 添加路段MS通信账号 const addRoadMs = (params) => { return ajax({ url: "/api/orp/road/add_road_ms", From a1f43c3b677f2ee96a3b1c1c9f2464aa29c6856d Mon Sep 17 00:00:00 2001 From: guoxin Date: Sun, 17 Dec 2023 23:14:06 +0800 Subject: [PATCH 03/10] =?UTF-8?q?fix():=E4=BF=AE=E6=94=B9=E8=B7=AF?= =?UTF-8?q?=E5=86=85BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableModule/index.jsx | 2 +- .../BusinessMgm/ChargeRules/EditModal.jsx | 13 +-- .../InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx | 19 +++- .../BusinessMgm/SpecialRecord/loadable.jsx | 11 ++- .../PersonMgm/Performance/WorkerStat/index.scss | 104 ++++++++++++--------- .../PersonMgm/Performance/WorkerStat/loadable.jsx | 80 ++++++++-------- .../InRoadMgm/PersonMgm/PersonInfo/loadable.jsx | 6 ++ .../InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx | 36 +++++-- src/pages/SystemMgm/RoleMgm/loadable.jsx | 49 +++++++--- 9 files changed, 203 insertions(+), 117 deletions(-) diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 29eb5dd..3594216 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -765,7 +765,7 @@ const TableModule = forwardRef((props, ref) => { }, []); const [getRoadList, setGetRoadList] = useState([]) useEffect(() => { - ajax.getRoadSearch().then((res) => { + ajax.getNewRoadSearch().then((res) => { setGetRoadList(res.data); }) }, []) diff --git a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx index c12d887..08aa620 100644 --- a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx +++ b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx @@ -21,6 +21,7 @@ const FormModal = (props) => { const { yisaData = {}, editVisible, + setGetEditVisible=()=>{}, editModal = () => { }, getEditData = {}, getData=()=>{} @@ -195,9 +196,9 @@ const FormModal = (props) => { } // 处理日期时间 const handelDate = (data, type) => { - if (data && data?.source['rules']?.length) { - console.log(data.rules); - data.source['rules'].map(item => { + if (data && data['rules']?.length) { + // console.log(data.rules); + data['rules'].map(item => { if (item.cdate) { if (type == 1) { item["cdate"] = moment(item["cdate"]).format('YYYY-MM-DD HH:mm:ss'); @@ -221,9 +222,9 @@ const FormModal = (props) => { //校验数据 if(handleFormValidation(data,0)&&handleFormValidation(data,1)){ let newData = handelDate(data, 1) - ajax.deleteChangeRules({source:newData}).then(res => { + ajax.deleteChangeRules({source:data}).then(res => { if (res.status === 20000) { - editVisible = false + setGetEditVisible(false) getData() } }) @@ -238,7 +239,7 @@ const FormModal = (props) => { newObj = handelDate(yisaData, 2) } newObj.rules = newObj?.source?.rules - delete newObj.source + // delete newObj.source //生成初始组件 init(newObj); form.setFieldsValue(newObj); diff --git a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx index fe412a6..3925ef5 100644 --- a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx +++ b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx @@ -132,12 +132,20 @@ function ChargeRules(props) { width: '300px' }, { + title: '操作1', + render: (text, record) => { + return <> + + + }, + }, + { title: '操作', render: (text, record) => { return <> -
{ deleteApplyBtn(record) }}>编辑
+
{ deleteApplyBtn(record,text) }}>编辑
{ applyBtn(record) }}>删除
{ bindPark(record) }}>绑定车场
}> @@ -148,9 +156,11 @@ function ChargeRules(props) { },] //编辑 const [getEditData, setGetEditData] = useState({}) - const deleteApplyBtn = (record) => { + const deleteApplyBtn = (record,text) => { setGetEditVisible(true) setGetEditData(record) + console.log(record); + console.log(text); } //删除 const [getDeleteData, setGetDeleteData] = useState({}) @@ -477,7 +487,8 @@ function ChargeRules(props) { // className='yisa-table' dataSource={resultData.data} columns={ - handleColumns() + // handleColumns() + deployListColumns } pagination={false} loading={ajaxLoading} @@ -500,7 +511,7 @@ function ChargeRules(props) { getData()} closAddModal={closAddModal} /> - getData()} yisaData={getEditData} /> + getData()} yisaData={getEditData} /> { setApplyVisible(false) + } const applyBtn = (record) => { setGetCarStatus(record) @@ -431,11 +432,12 @@ function CollectorWorkStat(props) { setExamineVisible(true) setGetCheckData(record) columnList(record) - getTable(Object.assign({}, lastColumnList, {white_id:record.id})) + getTable(Object.assign({}, lastColumnList, {white_id:record.id,pn:1})) setGetTableId(record.id) } const examineModal = () => { setExamineVisible(false) + setLastColumnData({...lastColumnData,pn:1}) } const applyDeleteModal = () => { setApplyDeleteVisible(false) @@ -587,9 +589,11 @@ function CollectorWorkStat(props) { //查看白名单 const checkModal = () => { setCheckVisible(false) + setLastColumnData({...lastColumnData,pn:1}) } const specialDataModal = () => { setCheckVisible(false) + setLastColumnData({...lastColumnData,pn:1}) } const deactivateModal = () => { setDeactivateVisible(false) @@ -656,6 +660,7 @@ function CollectorWorkStat(props) { setGetOpinion({ content: '' }) + setLastColumnData({...lastColumnData,pn:1}) } // 获取列表数据 const getData = (data = formData) => { @@ -1332,6 +1337,7 @@ function CollectorWorkStat(props) { visible={checkVisible} onCancel={checkModal} footer={null} + destroyOnClose={true} className="specialModal" title='查看白名单' > @@ -2065,6 +2071,7 @@ function CollectorWorkStat(props) { visible={examineVisible} onCancel={examineModal} footer={null} + destroyOnClose={true} className="examineModal" title='查看白名单' > diff --git a/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/index.scss b/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/index.scss index 30f3168..1ab6b81 100644 --- a/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/index.scss +++ b/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/index.scss @@ -1,9 +1,8 @@ @import "@/assets/css/mixin.scss"; -$color-container-bg : var(--color-container-bg); -$color-user-list-bg : var(--color-user-list-bg); -$color-text : var(--color-text); -$color-primary : var(--color-primary); - +$color-container-bg: var(--color-container-bg); +$color-user-list-bg: var(--color-user-list-bg); +$color-text: var(--color-text); +$color-primary: var(--color-primary); .colorBtn { width: 90px; @@ -37,44 +36,46 @@ $color-primary : var(--color-primary); border-radius: 4px; } } -.paid-employees{ +.paid-employees { display: flex; padding: 15px; width: 100%; - .paid-search{ - .search{ + .paid-search { + .search { font-size: 16px; - font-family: Microsoft YaHei, Microsoft YaHei-Bold; + font-family: + Microsoft YaHei, + Microsoft YaHei-Bold; font-weight: 700; text-align: left; color: #eeeff1; } - label{ - margin:0 10px; + label { + margin: 0 10px; } - .yisa-search{ + .yisa-search { margin-top: 10px; } - .ant-select:not(.ant-select-customize-input) .ant-select-selector{ + .ant-select:not(.ant-select-customize-input) .ant-select-selector { background-color: #50586c !important; } - .ant-select-arrow .anticon{ + .ant-select-arrow .anticon { background-color: #50586c !important; } - .ant-input:placeholder-shown{ + .ant-input:placeholder-shown { background-color: #50586c !important; } - .timePicker{ + .timePicker { width: 350px; margin-top: 22px; - .btnBox{ - display:flex ; - .yisa-btn{ - margin-left: 20px; - } - .root_gfkk{ - margin-left: 20px; - .export-content{ + .btnBox { + display: flex; + .yisa-btn { + margin-left: 20px; + } + .root_gfkk { + margin-left: 20px; + .export-content { width: 78px; height: 33px; display: flex; @@ -86,60 +87,77 @@ $color-primary : var(--color-primary); color: #fff; margin-right: 10px; } - } - } + } } } - .paid-result{ + .paid-result { width: 100%; height: 800px; background: #505a6f; border-radius: 20px; margin-left: 17px; - .result{ + .result { padding: 25px; - .font{ - font-family: Microsoft YaHei, Microsoft YaHei-Regular; + .font { + font-family: + Microsoft YaHei, + Microsoft YaHei-Regular; font-weight: 400; text-align: left; color: #eeeff1; margin-bottom: 10px; display: inline-block; - - em{ + + em { color: #3aa8fe; margin: 0 5px; } } - .yisa-table .ant-table-thead .ant-table-cell{ + .cc-result-flow { + .ant-table-wrapper { + max-height: 680px; + overflow-y: scroll; + } + } + .ant-table-wrapper::-webkit-scrollbar { + width: 5px; + } + .ant-table-wrapper::-webkit-scrollbar-thumb { + background-color: #9da2ab; + border-radius: 10px; + } + .yisa-table .ant-table-thead .ant-table-cell { background-color: #616b83 !important; - color: #ffffff !important; - font-size: 14px; - font-family: Microsoft YaHei, Microsoft YaHei-Bold; - font-weight: 700; + color: #ffffff !important; + font-size: 14px; + font-family: + Microsoft YaHei, + Microsoft YaHei-Bold; + font-weight: 700; text-align: center; border-right: none !important; border-top-color: #888f9d !important; border-color: #888f9d !important; } - .ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table, .ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table{ + .ant-table.ant-table-bordered > .ant-table-container > .ant-table-content > table, + .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table { border-top: none !important; border-left: none !important; } - .ant-table-tbody .ant-table-row .ant-table-cell{ + .ant-table-tbody .ant-table-row .ant-table-cell { background-color: #3e4557 !important; color: #ffffff !important; text-align: center; font-size: 14px; - font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-family: + Microsoft YaHei, + Microsoft YaHei-Regular; font-weight: 400; border-right: none !important; border-left: none !important; border-bottom-color: #626b7e !important; } } - } - -} \ No newline at end of file +} diff --git a/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx index 3b3bbc9..666214d 100644 --- a/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx @@ -9,7 +9,7 @@ import "./index.scss"; import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; import ajax from '@/services' let array = [] - +const { Column, ColumnGroup } = Table; function WorkerStat(props) { // const configData = props.sysConfig["lib-deploy"] || {}; const [ajaxLoading, setAjaxLoading] = useState(false) @@ -74,8 +74,7 @@ function WorkerStat(props) { //列表 const deployListColumns = [{ title: '商户名称', - dataIndex: 'operator', - key: 'operator' + }, { title: '登录名', @@ -88,35 +87,29 @@ function WorkerStat(props) { key: 'name', }, { - title: '实收金额', - dataIndex: 'today_sale', - key: 'today_sale', - }, - { - title: '追缴金额', - dataIndex: 'today_rate', - key: 'today_rate', + title: '营收金额', + dataIndex: 'revenue_amount', + key: 'revenue_amount', }, { - title: '应收金额', - dataIndex: 'today_receive', - key: 'today_receive', + title: '预付金额', + dataIndex: 'prepaid_amount', + key: 'prepaid_amount', }, { - title: '收费率', - dataIndex: 'sale_rate', - key: 'sale_rate', + title: 'PDA欠费追缴金额', + dataIndex: 'recovery_amount', + key: 'recovery_amount', }, { - title: '入场操作数', - dataIndex: 'entry_operation_records_count', - key: 'entry_operation_records_count', + title: '入场操作记录数', + dataIndex: 'in_num', + key: 'in_num', }, { - title: '出场操作数', - dataIndex: 'exit_operation_records_count', - key: 'exit_operation_records_count', - width: '120px', + title: '出场操作记录数', + dataIndex: 'out_num', + key: 'out_num', }] // 获取列表数据 const getData = (data = formData) => { @@ -150,9 +143,9 @@ function WorkerStat(props) { const changePn = (pn, length) => { if (lastFormData.page_size === length) { setFormData(Object.assign({}, formData, { pn: pn, page_size: length })) - setLastFormData(Object.assign({}, lastFormData, { pn: pn , page_size: length })) - lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn , page_size: length }) - getData(Object.assign({}, formData, { pn: pn , page_size: length })) + setLastFormData(Object.assign({}, lastFormData, { pn: pn, page_size: length })) + lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn, page_size: length }) + getData(Object.assign({}, formData, { pn: pn, page_size: length })) } } //切换每页条数 @@ -185,9 +178,9 @@ function WorkerStat(props) { setGetName(res.data) }) } - //导出 - const exportData=()=>{ - let data={ + //导出 + const exportData = () => { + let data = { ...formData } ajax.statExport(data).then(res => { @@ -290,17 +283,22 @@ function WorkerStat(props) {
共检索到{resultData.total_records}条结果 - record.cap_id + "_" + record.bk_id} - pagination={false} - loading={ajaxLoading} - /> +
+ + + + + + + + + + + + + + +
{ setShowEdit(true) + setGetEdit(false) setCurrentPersonId("") setTargetKeys([]) } @@ -441,9 +442,14 @@ function PersonInfo() { useEffect(() => { getAllOperator() + return () => setGetEdit(false) + // getPersonAllRoad() }, []) + useEffect(()=>{ + console.log(getEdit); + },[getEdit]) useEffect(() => { if (!showEdit) { setCurrentPersonInfo({ diff --git a/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx b/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx index 30189de..db7ab79 100644 --- a/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx +++ b/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx @@ -47,6 +47,7 @@ import { TreeSelectGroup, } from "@/components"; import "./index.scss"; +import { getToken } from "@/config/cookie"; import { useSetState, useSessionStorageState, useUpdateEffect } from "ahooks"; const { TextArea } = Input; @@ -57,6 +58,7 @@ function ConfigRoad() { const parking_id = location.search.split("=")[1].split("&")[0]; const operator_id = location.search.split("&")[1].split("=")[1]; const region_id = location.search.split("&")[2].split("=")[1]; + const [modalBtnLoading,setModalBtnLoading] = useState(false) //泊位管理Form const [berthForm] = Form.useForm(); const [dataForm] = Form.useForm(); @@ -242,10 +244,13 @@ function ConfigRoad() { video_content: "", }, exporturl: "/api/bpm/berth/export", - downloadUrl: "", + downloadUrl: "api/bpm/berth/berth_import_template", importProps: { name: "file", action: "/PMS/api/bpm/berth/import", + headers: { + Authorization: getToken(), + }, onChange(info) { if (info.file.status !== "uploading") { console.log(info.file, info.fileList); @@ -455,6 +460,9 @@ function ConfigRoad() { importProps: { name: "file", data: { road_id: parking_id }, + headers: { + Authorization: getToken(), + }, action: "/PMS/api/bpm/device/import_device", onChange(info) { if (info.file.status !== "uploading") { @@ -618,12 +626,15 @@ function ConfigRoad() { }, ], key: "id", - exporturl: "", + exporturl: "/api/bpm/device/export_pole_position", downloadUrl: "/api/bpm/device/pole_position_import_template", importProps: { name: "file", action: "/PMS/api/bpm/device/import_pole_position", data: { road_id: parking_id }, + headers: { + Authorization: getToken(), + }, onChange(info) { if (info.file.status !== "uploading") { console.log(info.file, info.fileList); @@ -759,12 +770,14 @@ function ConfigRoad() { }); // setSelectedBerth(record.berth_ids.split(",").map(item => +item)) setRuleModal(true); + // setIsRuleEdit(true); if (record.berth_ids === '') { setShowBerthSelect(false); - setIsRuleEdit(true); - } else { - setShowBerthSelect(true); setIsRuleEdit(false); + + }else { + setShowBerthSelect(true); + setIsRuleEdit(true); } let data = { road_id: parking_id, @@ -1327,6 +1340,7 @@ function ConfigRoad() { } //数据采集设备管理提交接口 function handleDataAcquistionModal() { + setModalBtnLoading(true) function addDevice(res) { ajax .addDevice({ @@ -1336,6 +1350,7 @@ function ConfigRoad() { }) .then((res) => { if (res.status === 20000) { + setModalBtnLoading(false) message.success(res.message); setDataAcquistionModal({ ...dataAcquistionModal, @@ -1344,6 +1359,7 @@ function ConfigRoad() { formRef.current.getList(); } else { message.error(res.message); + setModalBtnLoading(false) } }); } @@ -1812,6 +1828,7 @@ function ConfigRoad() {
{ setImportGroup({ ...importGroup, visible: false }); }} @@ -2073,10 +2090,11 @@ function ConfigRoad() { {/* 计费规则添加弹窗 */} { setRuleModal(false); + setSelectedBerth([]); }} style={{ top: 2, @@ -2121,9 +2139,10 @@ function ConfigRoad() { { + console.log(e.target.value); if (e.target.value === 1) { + setShowBerthSelect(true); - } else { setShowBerthSelect(false); @@ -2141,7 +2160,7 @@ function ConfigRoad() { ]} /> - {showBerthSelect && isRuleEdit ? ( + {showBerthSelect ? ( { @@ -2335,6 +2354,7 @@ function ConfigRoad() { onCancel={() => { setDataAcquistionModal({ ...dataAcquistionModal, visible: false }); }} + confirmLoading={modalBtnLoading} destroyOnClose onOk={handleDataAcquistionModal} title={dataAcquistionModal.isEdit ? "编辑设备" : "添加设备"} diff --git a/src/pages/SystemMgm/RoleMgm/loadable.jsx b/src/pages/SystemMgm/RoleMgm/loadable.jsx index c369e41..625f48f 100644 --- a/src/pages/SystemMgm/RoleMgm/loadable.jsx +++ b/src/pages/SystemMgm/RoleMgm/loadable.jsx @@ -86,6 +86,9 @@ function RoleMgm(props) { arr.push(res.id) res.children?.map(res => { arr.push(res.id) + res.children?.map(res => { + arr.push(res.id) + }) }) }) }) @@ -112,12 +115,17 @@ function RoleMgm(props) { arr.push(res.id) res.children?.map(res => { arr.push(res.id) + res.children?.map(res => { + arr.push(res.id) + }) }) }) }) }) let string = arr.toString() setCheckedKeys(arr) + arr.sort(compareNumbers) + console.log(arr); setGetCheckVlue(true) // getCheckValue setGetImg({ ...getImg, auth: string }) @@ -125,6 +133,10 @@ function RoleMgm(props) { setCheckedKeys([]) } } + function compareNumbers(a, b) { + return a - b; + } + function calculateArrayLength(arr) { let count = 0; arr.forEach((item) => { @@ -147,17 +159,19 @@ function RoleMgm(props) { setAddManage({ ...addManage, auth: string }) setCheckedKeys(checkedKeysValue); // 将所有权限存一遍,和选中的权限长度进行对比 - + } useEffect(() => { // console.log(checkedKeys); console.log("监听"); - console.log(allGover.map(item=>item.id).toString()); + console.log(allGover.map(item => item.id).sort(compareNumbers)); // 左边的值是选中的长度是哪个变量 if ((checkedKeys.length >= allGover.length) && checkedKeys.length != 0) { setGetCheckVlue(true) - } else { + } + + else { setGetCheckVlue(false) } }, [checkedKeys]) @@ -282,8 +296,8 @@ function RoleMgm(props) { depart_id: record.depart_id })) if (strArr.length == roleLength) { - setGetCheckVlue(true); - } + setGetCheckVlue(true); + } } //所属类型 const [getPlateColor, setGetPlateColor] = useState([]) @@ -403,11 +417,15 @@ function RoleMgm(props) { const placeEditBtn = () => { let arr = checkedKeys let str = arr.toString() + let arrStr = getImg.depart_id + let lastElement = arrStr[arrStr.length - 1]; let data = { ...getImg, auth: str, - id: getAdminId.id + id: getAdminId.id, + depart_id:lastElement } + ajax.editChange(data).then(res => { if (res.status === 20000) { setEditVisible(false) @@ -435,10 +453,13 @@ function RoleMgm(props) { } )); } + // const [getKey,setGetKey]=useState([]) useEffect(() => { + let arrStr = getImg.depart_id + let lastElement = arrStr[arrStr.length - 1]; if (getGovernment != 0) { let data = { - id: getGovernment + id: lastElement } ajax.getDepartId(data).then(res => { if (res.status === 20000) { @@ -451,6 +472,12 @@ function RoleMgm(props) { let data = JSON.parse(JSON.stringify(res.data)) const arr = flatten(data) const length = calculateArrayLength(res.data); + let key = arr.filter(item => { + return item.key + }) + let arr_id = key.map(item => item.id) + console.log(arr_id); + setCheckedKeys(arr_id); setRoleLength(length) // console.log(arr); setAllGover(arr) @@ -554,7 +581,7 @@ function RoleMgm(props) { { - let arr = v - let lastElement = arr[arr.length - 1]; - setGetGovernment(lastElement) + setGetGovernment(v) setGetImg( - Object.assign({}, getImg, { depart_id: lastElement }) + Object.assign({}, getImg, { depart_id: v }) ); }} fieldNames={{ From f3baff509cbd253019ad0780d053cdac0bc13cfc Mon Sep 17 00:00:00 2001 From: xingjx Date: Mon, 18 Dec 2023 00:22:43 +0800 Subject: [PATCH 04/10] =?UTF-8?q?fix():bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx | 19 ++++++------------- .../OutSegmentMgm/OutSegment/AddParking.jsx | 11 ++++++++++- .../ConfigParking/BusinessParameterConfig.jsx | 3 ++- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx index 554db83..aead4f8 100644 --- a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx @@ -261,8 +261,7 @@ function ParkingAlyPeriod() { this.random(arr) } } - const color = ['#5470c6','#91cc75','#fac858','#ee6666','#73c0de','#fc8452','#3ba272','#9a60b4','#ee7ccc'] - console.log(Math.round(Math.random()*10)) + const color = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#fc8452', '#3ba272', '#9a60b4', '#ee7ccc'] //停车饱和趋势分析分析 折线图 hour 时间对比 const getParkOptionHour = (data) => { console.log(data) @@ -277,7 +276,7 @@ function ParkingAlyPeriod() { ); // 构建数据对象 let seriesData = areaNames.map((areaName, index) => { - let color2 = color[Math.round(Math.random()*10)] + let color2 = color[Math.round(Math.random() * 10)] // 获取数据 let areaData = data[0].date ? data.filter((item) => item.date === areaName) : data // 构建数据对象 @@ -293,8 +292,8 @@ function ParkingAlyPeriod() { }, normal: { color: color2, //改变折线点的颜色 - lineStyle:{ - color:color2, + lineStyle: { + color: color2, } //改变折线颜色 } @@ -320,13 +319,7 @@ function ParkingAlyPeriod() { }; }); - setHourData({ - ...lineChartOption(areaNames, xAxisData, "饱和度", seriesData), - // tooltip: { - // trigger: "axis", - // formatter: "{a}
{b}:{c}", - // }, - }); + setHourData({ ...lineChartOption(areaNames, xAxisData, "饱和度", seriesData) }); }; function getParkingIncome(data) { ajax @@ -346,8 +339,8 @@ function ParkingAlyPeriod() { if (res.status === 20000) { getParkOption(res.data.list?.area_list); setKeyVal(res.data.list?.hour_list.length) + setHourData({}) getParkOptionHour(res.data.list?.hour_list); - } }) .catch((err) => console.error(err)); diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx index 451030e..fdc024d 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx @@ -44,6 +44,7 @@ function AddParking(props) { } }); const [lngLatVisible, setLngLatVisible] = useState(false); + const [topBerthNum, setTopBerthNum] = useState(); const [lngLat, setLngLat] = useState(() => { if (status === "add") return []; else { @@ -167,8 +168,12 @@ function AddParking(props) { cooperate_type, access_type, lng_lat, - area + area, + total_berth_number, + berth_number//返回一级泊位数和总泊位数 } = res.data; + let num = parseInt(total_berth_number) - parseInt(berth_number) + setTopBerthNum(num) let arr = [] arr.push(area) form.setFieldsValue({ @@ -237,6 +242,10 @@ function AddParking(props) { message.error('车场泊位数必须为数字!') return } + if (topBerthNum && parseFloat(total_berth_number) < topBerthNum) { + message.error('下级车场泊位数与一级车场泊位数之和不超过泊位总数!此处总车场泊位数不超过' + topBerthNum) + //return + } const params = { ...values, img: processImgData(fileList), diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx index 1f7a4e1..aecccd6 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx @@ -16,7 +16,8 @@ function BusinessParameterConfig(props) { ajax.getRoadServiceEdit(params).then((res) => { if (res.status === 20000) { message.success(res.message); - + }else{ + message.error("请填写完整!") } }); } From 580a69bae81496a44b2dc6dd0cbac3f2066c5ab3 Mon Sep 17 00:00:00 2001 From: guoxin Date: Mon, 18 Dec 2023 00:26:21 +0800 Subject: [PATCH 05/10] =?UTF-8?q?fix():=E4=BF=AE=E6=94=B9=E8=B7=AF?= =?UTF-8?q?=E5=86=85BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx | 1 + src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx | 2 + src/pages/SystemMgm/AdminMgm/loadable.jsx | 108 ++++++++++++++------- 3 files changed, 74 insertions(+), 37 deletions(-) diff --git a/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx b/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx index db7ab79..557816e 100644 --- a/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx +++ b/src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx @@ -762,6 +762,7 @@ function ConfigRoad() { { setCurRuleRecord(record); + console.log(record); ruleForm.setFieldsValue({ vehicle_type: record.vehicle_type, rule_id: record.rule_id, diff --git a/src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx b/src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx index c6cd014..323fa13 100644 --- a/src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx +++ b/src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx @@ -198,6 +198,7 @@ function ParkList() { function onShowSizeChange(pn, page_size) { setPageData({ pn, page_size }); + } function search(params) { @@ -215,6 +216,7 @@ function ParkList() { total_records: res.data.total, data: res.data.list, }); + window.scrollTo(0, 0); } }); } diff --git a/src/pages/SystemMgm/AdminMgm/loadable.jsx b/src/pages/SystemMgm/AdminMgm/loadable.jsx index c4f6fef..7cbd258 100644 --- a/src/pages/SystemMgm/AdminMgm/loadable.jsx +++ b/src/pages/SystemMgm/AdminMgm/loadable.jsx @@ -97,12 +97,18 @@ function AdminMgm(props) { setAddManage({ ...addManage, email: e.target.value }) }; //添加所属部门 + const [governmentStatus, setGovernmentStatus] = useState(true) const [getPartName, setGetPartName] = useState([]) - const handleDeptName = (v) => { + const handleDeptName = (v, selectedOptions) => { console.log(v); setGetRoleStatus(false) setAddManage({ ...addManage, deptName: v }) setGetPartName(v) + if (selectedOptions.length === 1) { + setGovernmentStatus(false) + } else { + setGovernmentStatus(true) + } }; const [getRoleStatus, setGetRoleStatus] = useState(true) //添加角色 @@ -125,8 +131,12 @@ function AdminMgm(props) { } }, [getPartName]) //添加管辖方式 + const [getAreaStatus, setGetAreaStatus] = useState(false) const handleGovernmentType = (v) => { setGetGovernment(v) + if (v === 1) { + setGetAreaStatus(true) + } setAddManage({ ...addManage, government_style: v }) } //添加管辖区域 @@ -207,6 +217,7 @@ function AdminMgm(props) { }) getData(formData) setGetRoleStatus(true) + setGetAreaStatus(false) } }) } @@ -347,6 +358,9 @@ function AdminMgm(props) { const [getGovernment, setGetGovernment] = useState({}) const handleGovernment = (v) => { setGetGovernment(v) + if (v === 1) { + setGetAreaStatus(true) + } setGetImg({ ...getImg, government_style: v }) } const [getGovernmentArea, setGetGovernmentArea] = useState([]) @@ -444,12 +458,14 @@ function AdminMgm(props) { messageRole: 0, failure_time: '' }) + setGetAreaStatus(false) } const cancelImg = () => { setEditVisible(false) setDepartVisible(false) setPasswordVisible(false) setGetRoleStatus(true) + setGetAreaStatus(false) } const addcancelImg = () => { setImgVisible(false) @@ -465,6 +481,7 @@ function AdminMgm(props) { messageRole: 0, failure_time: '' }) + setGetAreaStatus(false) } // 获取列表数据 const getData = (data = formData) => { @@ -518,6 +535,7 @@ function AdminMgm(props) { const editModal = () => { setEditVisible(false) setGetRoleStatus(true) + setGetAreaStatus(false) } //编辑提交 const placeEditBtn = () => { @@ -530,6 +548,7 @@ function AdminMgm(props) { setEditVisible(false) getData(formData) setGetRoleStatus(true) + setGetAreaStatus(false) } }) } @@ -746,6 +765,7 @@ function AdminMgm(props) { { setGetImg( Object.assign({}, getImg, { mobile: v.target.value }) @@ -921,12 +945,17 @@ function AdminMgm(props) { value={getImg.deptName} options={getPlateColor} changeOnSelect - onChange={(v) => { + onChange={(v, selectedOptions) => { setGetImg( Object.assign({}, getImg, { deptName: v }) ); setGetRoleStatus(false) setGetPartName(v) + if (selectedOptions.length === 1) { + setGovernmentStatus(false) + } else { + setGovernmentStatus(true) + } }} fieldNames={{ label: 'name', @@ -935,7 +964,7 @@ function AdminMgm(props) { }} /> -
+