From 7669b0483d0285f07c75086a0168c6a422b6aee8 Mon Sep 17 00:00:00 2001 From: xingyongchun Date: Thu, 28 Jul 2022 15:24:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fillion/components/bridgeTable.js | 57 ++-- .../components/highways/highwaysdata.js | 2 +- .../fillion/components/infor/details.js | 4 +- .../sections/fillion/components/inforTable.js | 27 +- .../fillion/components/operationalTable.js | 176 +++++++------ .../fillion/components/project/project.js | 2 +- .../fillion/components/publicTable.js | 245 +++++++++--------- .../fillion/components/transportationTable.js | 88 ++++--- 8 files changed, 310 insertions(+), 291 deletions(-) diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index d8101bda..2f46b175 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -4,7 +4,7 @@ import { Spin, Button, Popconfirm, Badge } from 'antd'; import ProTable from '@ant-design/pro-table'; import './protable.less' import moment from 'moment'; -import { getBridge, getProject,delBridge,delProject } from "../actions/infor" +import { getBridge, getProject, delBridge, delProject } from "../actions/infor" import UserModal from './infor/details'; import ProjectModal from './project/project'; @@ -26,7 +26,23 @@ const BrideTable = (props) => { const [delet, setDelet] = useState() const ref = useRef() - useEffect(() => { ref.current.reload() }, [whichofits,delet]) + useEffect(() => { ref.current.reload() }, [whichofits, delet]) + const deldata = (id) => { // 桥梁 + const query = { + bridgeId: id + } + dispatch(delBridge(query)).then((res) => { + setDelet(res) + }) + } + const deldatas = (id) => { // 工程 + const query = { + projectId: id + } + dispatch(delProject(query)).then((res) => { + setDelet(res) + }) + } const columns = { tab1: [ { @@ -1493,16 +1509,10 @@ const BrideTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 + { deldata(record.id) }}> + + } }, @@ -1683,16 +1693,9 @@ const BrideTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldatas(record.id) }}> + + } }, @@ -1809,20 +1812,20 @@ const BrideTable = (props) => { dataSource={counts || []} request={async (params) => { - if(whichofits=='qiaoliang'){ + if (whichofits == 'qiaoliang') { const query = { - bridgeName:sitename + bridgeName: sitename } setRowSelected([]); const res = await dispatch(getBridge(query)); // console.log(res) - + setCounts(res.payload.data) return { ...res, total: res.payload.data ? res.payload.data.count : 0 } - }if(whichofits=='gongcheng'){ + } if (whichofits == 'gongcheng') { const query = { type: 'bridge', // type:sitename @@ -1835,7 +1838,7 @@ const BrideTable = (props) => { total: res.payload.data ? res.payload.data.count : 0 } } - + }} search={{ defaultCollapsed: false, diff --git a/web/client/src/sections/fillion/components/highways/highwaysdata.js b/web/client/src/sections/fillion/components/highways/highwaysdata.js index 0ced59c2..854781da 100644 --- a/web/client/src/sections/fillion/components/highways/highwaysdata.js +++ b/web/client/src/sections/fillion/components/highways/highwaysdata.js @@ -3,7 +3,7 @@ import { connect } from 'react-redux'; import { Form, Spin, Table } from 'antd'; import { ModalForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form'; import { putOperaTional,putHighways } from "../../actions/infor" -import { _ } from 'lodash' +import _ from 'lodash' const HightModal = (props) => { const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd,setDelet } = props diff --git a/web/client/src/sections/fillion/components/infor/details.js b/web/client/src/sections/fillion/components/infor/details.js index 26e32560..fedabe4e 100644 --- a/web/client/src/sections/fillion/components/infor/details.js +++ b/web/client/src/sections/fillion/components/infor/details.js @@ -189,14 +189,14 @@ const UserModal = (props) => { if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { if (typecard == '111') { setDelet(values) - const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys === 'chuzu' ? '出租车' : '危货' } + const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys == 'chuzu' ? '出租车' : '危货' } dispatch(putSpecificVehicle(query)).then((res) => { setSuccess(res.success) }) return true } else { setDelet(values) - const query = { ...values, type: rewkeys } + const query = { ...values, type: rewkeys == 'chuzu' ? '出租车' : '危货' } dispatch(putSpecificVehicle(query)).then((res) => { setSuccess(res.success) }) diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index 00ceafb7..11b05946 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/web/client/src/sections/fillion/components/inforTable.js @@ -51,6 +51,14 @@ const InForTable = (props) => { `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) }) } + const deldata = (id) => { // 治超删除 + const query = { + overspeedId: id + } + dispatch(delPurchase(query)).then((res) => { + setDelet(res) + }) + } const columns = [ { @@ -364,16 +372,11 @@ const InForTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 + + { deldata(record.id) }}> + + } }, @@ -438,8 +441,8 @@ const InForTable = (props) => { request={async (params) => { console.log(params) const query = { - limit:params.pageSize, - page:params.current-1, + limit: params.pageSize, + page: params.current - 1, nameOfInspectionPoint: nameOfInspectionPoint, licensePlate: licensePlate, numberOfAxles: numberOfAxles, diff --git a/web/client/src/sections/fillion/components/operationalTable.js b/web/client/src/sections/fillion/components/operationalTable.js index 5df036be..119e1629 100644 --- a/web/client/src/sections/fillion/components/operationalTable.js +++ b/web/client/src/sections/fillion/components/operationalTable.js @@ -1,9 +1,9 @@ -import React, { useEffect, useState,useRef } from 'react'; +import React, { useEffect, useState, useRef } from 'react'; import { connect } from 'react-redux'; import { Spin, Button, Popconfirm, Badge } from 'antd'; import ProTable from '@ant-design/pro-table'; import './protable.less' -import { getOperaTional, getSpecificVehicle, getHouseholds,delSpecificVehicle,delHouseholds } from "../actions/infor" +import { getOperaTional, getSpecificVehicle, getHouseholds, delSpecificVehicle, delHouseholds } from "../actions/infor" import UserModal from './infor/details'; import HightModal from './highways/highwaysdata'; @@ -24,7 +24,7 @@ const OperaTionalTable = (props) => { const [delet, setDelet] = useState() const ref = useRef() - useEffect(() => { ref.current.reload() }, [rewkeys,activeKey,delet]) + useEffect(() => { ref.current.reload() }, [rewkeys, activeKey, delet]) //打开弹窗 const openModal = (type, record) => { setModalVisible(true); @@ -35,6 +35,23 @@ const OperaTionalTable = (props) => { setModalRecord(null); } } + const deldata = (id) => { // 出租危货 + const query = { + vehicleId: id + } + dispatch(delSpecificVehicle(query)).then((res) => { + setDelet(res) + }) + } + + const deldatas = (id) => { // 业户 + const query = { + businessId: id + } + dispatch(delHouseholds(query)).then((res) => { + setDelet(res) + }) + } //打开弹窗 const hightModal = (type, record) => { setModalVisibleyilan(true); @@ -73,7 +90,7 @@ const OperaTionalTable = (props) => { search: false, fieldProps: { - + placeholder: '请输入道路名称进行搜索', getPopupContainer: (triggerNode) => triggerNode.parentNode, }, @@ -132,7 +149,7 @@ const OperaTionalTable = (props) => { render: (dom, record) => { return record.nameOfBusinessOwner }, - }, + }, { title: '车籍地', search: false, @@ -696,16 +713,9 @@ const OperaTionalTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldata(record.id) }}> + + } }, @@ -759,7 +769,7 @@ const OperaTionalTable = (props) => { render: (dom, record) => { return record.nameOfBusinessOwner }, - }, { + }, { title: '品名', search: false, dataIndex: 'containers', @@ -1336,16 +1346,9 @@ const OperaTionalTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldata(record.id) }}> + + } }, @@ -1813,16 +1816,9 @@ const OperaTionalTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldatas(record.id) }}> + + } }, @@ -1881,16 +1877,20 @@ const OperaTionalTable = (props) => { }, { key: 'tab2', - label: { { - setRewkeys('chuzu') - } }}>出租车{activeKey === 'tab2'}, + label: { + { + setRewkeys('chuzu') + } + }}>出租车{activeKey === 'tab2'}, }, { key: 'tab3', - label: { { - setRewkeys('weihuo') - } }}>危险货运{activeKey === 'tab3'}, + label: { + { + setRewkeys('weihuo') + } + }}>危险货运{activeKey === 'tab3'}, }, { key: 'tab4', @@ -1918,58 +1918,62 @@ const OperaTionalTable = (props) => { }} columns={columns[activeKey]} - dataSource={counts || []} + dataSource={counts || []} request={async (params, sort, filter) => { - if(rewkeys=='keyun'){ + if (rewkeys == 'keyun') { const query = {} - setRowSelected([]); - const res = await dispatch(getOperaTional(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} - if(rewkeys=='chuzu'){ + setRowSelected([]); + const res = await dispatch(getOperaTional(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } + if (rewkeys == 'chuzu') { const query = { - type:'出租车', - nameOfBusinessOwner:sitename + type: '出租车', + nameOfBusinessOwner: sitename } - setRowSelected([]); - const res = await dispatch(getSpecificVehicle(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} - if(rewkeys=='weihuo'){ + setRowSelected([]); + const res = await dispatch(getSpecificVehicle(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } + if (rewkeys == 'weihuo') { const query = { - type:'危货', - nameOfBusinessOwner:sitename + type: '危货', + nameOfBusinessOwner: sitename } - setRowSelected([]); - const res = await dispatch(getSpecificVehicle(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} - if(rewkeys=='yehu'){ + setRowSelected([]); + const res = await dispatch(getSpecificVehicle(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } + if (rewkeys == 'yehu') { const query = { - nameOfBusinessOwner:sitename + nameOfBusinessOwner: sitename } - setRowSelected([]); - const res = await dispatch(getHouseholds(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} + setRowSelected([]); + const res = await dispatch(getHouseholds(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } }} search={{ defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - ['tab2','tab3','tab4'].includes(activeKey) ? { props.exports(rowSelected, counts) }}> + ['tab2', 'tab3', 'tab4'].includes(activeKey) ? { props.exports(rowSelected, counts) }}> + >编辑 { deldata(record.id) }}> + + } }, @@ -1113,16 +1122,9 @@ const requestcheliang = (name) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldatas(record.id) }}> + + } }, @@ -1173,16 +1175,20 @@ const requestcheliang = (name) => { items: [ { key: 'tab1', - label: { { - setRewkeys('xianlu') - } }}>运营线路{activeKey === 'tab1'}, + label: { + { + setRewkeys('xianlu') + } + }}>运营线路{activeKey === 'tab1'}, }, { key: 'tab2', - label: { { - setRewkeys('cheliang') - } }}>车辆信息{activeKey === 'tab2'}, + label: { + { + setRewkeys('cheliang') + } + }}>车辆信息{activeKey === 'tab2'}, } ], @@ -1211,31 +1217,31 @@ const requestcheliang = (name) => { dataSource={counts || []} request={async (params) => { - if(rewkeys=='xianlu'){ + if (rewkeys == 'xianlu') { const query = { - fleet:sitename + fleet: sitename + } + setRowSelected([]); + const res = await dispatch(getCircuit(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } } - setRowSelected([]); - const res = await dispatch(getCircuit(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - } - } - if(rewkeys=='cheliang'){ + if (rewkeys == 'cheliang') { const query = { - fleet:sitename - } - setRowSelected([]); - const res = await dispatch(getVehicle(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 + fleet: sitename + } + setRowSelected([]); + const res = await dispatch(getVehicle(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } } - } - + }} search={{ defaultCollapsed: false, @@ -1252,13 +1258,13 @@ const requestcheliang = (name) => { > - {modalVisible ? { const [whichofits, setWhichofits] = useState('县') const [delet, setDelet] = useState() const ref = useRef() - useEffect(() => { ref.current.reload() }, [ whichofits, delet]) + useEffect(() => { ref.current.reload() }, [whichofits, delet]) //打开弹窗 const openModal = (type, record) => { setModalVisible(true); @@ -42,7 +42,24 @@ const TransporTationTable = (props) => { setModalRecord(null); } } - // console.log(counts) + //删除daolu + const deldata = (id) => { + const query = { + roadId: id + } + dispatch(delRoadway(query)).then((res) => { + setDelet(res) + }) + } + //删除工程 + const deldatas = (id) => { + const query = { + projectId: id + } + dispatch(delProject(query)).then((res) => { + setDelet(res) + }) + } //批量导出 const exports = (ids, counts) => { // console.log(user); @@ -1170,22 +1187,20 @@ const TransporTationTable = (props) => { width: 120, fixed: 'right', render: (dom, record) => { + // node = renderRemoveUser('移除'); return
+ >编辑 + { deldata(record.id) }}> + } }, @@ -2337,14 +2352,11 @@ const TransporTationTable = (props) => { setRecortd(record) }} - >编辑 + >编辑 + { deldata(record.id) }}> + + + } }, @@ -3497,15 +3509,10 @@ const TransporTationTable = (props) => { setRecortd(record) }} - >编辑 + >编辑 + { deldata(record.id) }}> + + } }, @@ -3688,16 +3695,11 @@ const TransporTationTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 + { deldatas(record.id) }}> + + + } }, @@ -3747,19 +3749,19 @@ const TransporTationTable = (props) => { { key: 'tab1', label: { - setWhichofits('xian') + setWhichofits('县') }}>县道{activeKey === 'tab1'}, }, { key: 'tab2', label: { - setWhichofits('xiang') + setWhichofits('乡') }}>乡道{activeKey === 'tab2'}, }, { key: 'tab3', label: { - setWhichofits('cun') + setWhichofits('村') }}>村道{activeKey === 'tab3'}, }, { key: 'tab4',