Browse Source

fix():修改路内bug

tags/PMS_Frontend_v1.0.6-develop
guoxin 1 year ago
parent
commit
b48dbb8df1
  1. 51
      demon.json
  2. 31
      src/components/TableModule/index.jsx
  3. 1
      src/pages/InRoadMgm/BusinessMgm/FreeRule/index.scss
  4. 10
      src/pages/InRoadMgm/BusinessMgm/FreeRule/loadable.jsx
  5. 15
      src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx
  6. 7
      src/pages/InRoadMgm/PersonMgm/Attendance/Fence/index.scss
  7. 6
      src/pages/InRoadMgm/PersonMgm/Attendance/Fence/loadable.jsx
  8. 7
      src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx
  9. 4
      src/pages/InRoadMgm/RoadMgm/AddRoad/loadable.jsx
  10. 88
      src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx
  11. 3
      src/pages/InRoadMgm/RoadMgm/RoadConf/loadable.jsx
  12. 31
      src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx
  13. 10
      src/pages/OperationCenter/CustomerServieMgm/CallbackSuggestion/loadable.jsx
  14. 3
      src/pages/SystemMgm/BusinessConfig/BusinessConf/loadable.jsx
  15. 35
      src/pages/SystemMgm/RoleMgm/loadable.jsx

51
demon.json

@ -1,21 +1,34 @@
{
"status": 20000,
"message": "success",
"data": {
"list": [
{
"id": "1",
"operator_name": "公用事业集团",//
"road_name": "玉山路",//
"name": "玉山路",//
"phone": "1231241244",//
"report_type_name": "地磁故障",//
"report_time": "2022-03-12 12:21:21",//
"location": "山东",//
"notes": "山东",//
"report_pic": "",//
}
],
"total_records": 1
}
"status": 20000,
"message": "success",
"data": [
{
"id": "1",
"pid": 0,
"name": "西海岸公用事业集团",
"level": 1,
"children": [
{
"id": "1777348128749704292",
"pid": 1,
"name": "停车公司",
"level": 2,
"children": [
{
"id": "232323232",
"pid": 2,
"name": "停车公司1",
"level": 3
}
]
},
{
"id": "1777877974658410516",
"pid": 1,
"name": "运营部门",
"level": 2
}
]
}
]
}

31
src/components/TableModule/index.jsx

@ -54,6 +54,7 @@ const TableModule = forwardRef((props, ref) => {
userInfo = {},//
valueChange,
mandatory,
mandatory1,
locale = {},
limitCon,//
isQuickMenu = [],
@ -202,11 +203,21 @@ const TableModule = forwardRef((props, ref) => {
if (moment(form.end_time) - moment(form.start_time) > 180 * 3600 * 24000) {
//console.log(2222,form.end_time,form.start_time,moment(form.end_time) - moment(form.start_time))
if (mandatory) {
let cna = Object.values(searchForm.getFieldsValue([mandatory]))
//console.log(mandatory,cna[0],searchForm.getFieldsValue([mandatory]))
if (!cna[0]) {
message.error(`查询时间范围大于半年,需填写${mandatory_name}`)
return
if(Array.isArray(mandatory)){
//
let cna = Object.values(searchForm.getFieldsValue([mandatory[0]]))[0]
let cna1 = Object.values(searchForm.getFieldsValue([mandatory[1]]))[0]
if (!cna && !cna1) {
message.error(`查询时间范围大于半年,需填写${mandatory_name}`)
return
}
}else{
let cna = Object.values(searchForm.getFieldsValue([mandatory]))
//console.log(mandatory,cna[0],searchForm.getFieldsValue([mandatory]))
if (!cna[0]) {
message.error(`查询时间范围大于半年,需填写${mandatory_name}`)
return
}
}
}
}
@ -219,11 +230,13 @@ const TableModule = forwardRef((props, ref) => {
function reset() {
setAreaSelectedList([])
searchForm.resetFields();
setFormData({ ...searchForm.getFieldsValue() })
//search({ ...searchForm.getFieldsValue() })
fetch()
setFormData({ ...searchForm.getFieldsValue() })
//search({ ...searchForm.getFieldsValue() })
}
useEffect(()=>{
!areaSelectedList.length && fetch()
},[areaSelectedList])
function cascaderChange(value, options) {
let res = [];
if (options) {

1
src/pages/InRoadMgm/BusinessMgm/FreeRule/index.scss

@ -198,6 +198,7 @@ $color-primary : var(--color-primary);
display: flex;
width: 300px;
height: 30px;
padding: 0 26px;
text-align: center;
justify-content: space-between;
line-height: 30px;

10
src/pages/InRoadMgm/BusinessMgm/FreeRule/loadable.jsx

@ -108,6 +108,7 @@ function FreeRule(props) {
}
const editModal = () => {
setEditVisible(false)
setGetFreeList([])
}
const [getDeleteId, setGetDeleteId] = useState({})
const applyBtn = (record) => {
@ -190,6 +191,11 @@ function FreeRule(props) {
}
const addModal = () => {
setAddVisible(false)
setGetCheckData({
operate_name: '',
free_name: ''
})
setGetFreeList([])
}
const [getCheckData, setGetCheckData] = useState({
operate_name: '',
@ -247,6 +253,7 @@ function FreeRule(props) {
operate_name: '',
free_name: ''
})
setGetFreeList([])
} else {
message.error(res.message)
}
@ -260,6 +267,7 @@ function FreeRule(props) {
operate_name: '',
free_name: ''
})
setGetFreeList([])
}
const [sessionTabList, setSessionTabList] = useSessionStorageState('freeRule', {
value: {
@ -291,6 +299,7 @@ function FreeRule(props) {
if (res.status === 20000) {
setEditVisible(false)
getData(formData)
setGetFreeList([])
}else{
message.error(res.message)
}
@ -300,6 +309,7 @@ function FreeRule(props) {
}
const editcancel=()=>{
setEditVisible(false)
setGetFreeList([])
}
const cancel = () => {
setCheckVisible(false)

15
src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx

@ -428,7 +428,7 @@ function CollectorWorkStat(props) {
setExamineVisible(true)
setGetCheckData(record)
columnList(record)
getTable()
getTable(record)
}
const examineModal = () => {
setExamineVisible(false)
@ -593,7 +593,13 @@ function CollectorWorkStat(props) {
}
}
const beforeUpload = (file) => {
const isValidType = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isValidType) {
message.error(`请上传png,jpeg类型图片`);
}
return isValidType || Upload.LIST_IGNORE;
};
//
const checkModal = () => {
setCheckVisible(false)
@ -1656,6 +1662,7 @@ function CollectorWorkStat(props) {
fileList={fileList}
onPreview={handlePreview}
onChange={handleChange}
beforeUpload={beforeUpload}
defaultFileList={getEditData.image}
>
{fileList.length >= 2 ||getImage.length >= 2 ||fileList.length+getImage.length>=2? null : uploadButton}
@ -1681,6 +1688,7 @@ function CollectorWorkStat(props) {
fileList={fileList}
onPreview={handlePreview}
onChange={handleChange}
beforeUpload={beforeUpload}
defaultFileList={getEditData.image}
>
{fileList.length >= 2 ||getImage.length >= 2 ||fileList.length+getImage.length>=2? null : uploadButton}
@ -1823,6 +1831,7 @@ function CollectorWorkStat(props) {
action="/PMS/api/com/common/file_upload"
listType="picture-card"
fileList={fileList}
beforeUpload={beforeUpload}
onPreview={handlePreview}
onChange={handleChange}
// defaultFileList
@ -1834,6 +1843,7 @@ function CollectorWorkStat(props) {
action="/PMS/api/com/common/file_upload"
listType="picture-card"
fileList={fileList}
beforeUpload={beforeUpload}
onPreview={handlePreview}
onChange={handleChange}
defaultFileList={getEditData.image}
@ -1993,6 +2003,7 @@ function CollectorWorkStat(props) {
action="/PMS/api/com/common/file_upload"
listType="picture-card"
fileList={fileList}
beforeUpload={beforeUpload}
onPreview={handlePreview}
onChange={handleChangePic}
// defaultFileList

7
src/pages/InRoadMgm/PersonMgm/Attendance/Fence/index.scss

@ -182,6 +182,7 @@ $color-primary : var(--color-primary);
}
.attend{
display: flex;
position: relative;
.yisaSearch{
display: flex;
margin-left: 20px;
@ -194,6 +195,12 @@ $color-primary : var(--color-primary);
height: 32px;
}
}
.logoTip{
position: absolute;
left: 299px;
top: 65px;
color: #8c8c8c;
}
}
}
.fenceMap{

6
src/pages/InRoadMgm/PersonMgm/Attendance/Fence/loadable.jsx

@ -234,6 +234,9 @@ function Fence(props) {
attendDistance: '1',
effective: '1'
})
setGetScopeValue(1)
setTargetKeys([])
setGetStatus('1')
}
const getCascaderList = () => {
let data = {
@ -301,6 +304,7 @@ function Fence(props) {
})
setGetScopeValue(1)
setTargetKeys([])
setGetStatus('1')
}
})
} else {
@ -318,6 +322,7 @@ function Fence(props) {
})
setGetScopeValue(1)
setTargetKeys([])
setGetStatus('1')
}
})
}
@ -335,6 +340,7 @@ function Fence(props) {
})
setGetScopeValue(1)
setTargetKeys([])
setGetStatus('1')
}
//
const attendanceModal = () => {

7
src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx

@ -272,6 +272,7 @@ function ParkRecordTotal() {
type: "Select",
label: "商户名称",
defaultValue: '0',
// options: sysConfig.roadType,
placeholder: "请选择商户名称",
},
{
@ -379,7 +380,7 @@ function ParkRecordTotal() {
];
const initFormData = {
region: [],
operator: null,
operator: 0,
road: "",
road_type: 0,
phone: "",
@ -725,8 +726,8 @@ function ParkRecordTotal() {
tableData={tableData}
formSearch={formSearch}
pagename="停车记录查询"
mandatory={'plate'}
mandatory_name={'车牌号'}
mandatory={['plate','berth_id']}
mandatory_name={['车牌号或泊位号']}
pageName={'parkRecordTotal'}
initFormData={initFormData}
total={total}

4
src/pages/InRoadMgm/RoadMgm/AddRoad/loadable.jsx

@ -98,13 +98,13 @@ function AddRoad() {
);
const handleChange = ({ fileList: newFileList }) => {
setFileList(newFileList);
setImgList(newFileList.map((item) => item.response?.data));
setImgList(newFileList.map((item) => item.url));
};
//
const addForm = () => {
let res = {};
console.log(imgList);
form1
.validateFields()
.then((res1) => {

88
src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx

@ -64,10 +64,10 @@ function ConfigRoad() {
const [ruleForm] = Form.useForm(); //-Form
const [getEditData, setGetEditData] = useState({})
const [getIdValue, setGetIdValue] = useState({})
//
//
const [showBerthSelect, setShowBerthSelect] = useState(false);
//
const [editTitle,setEditTitle]=useState(false)
const [editTitle, setEditTitle] = useState(false)
const berthManage = {
form: [
{
@ -215,7 +215,7 @@ function ConfigRoad() {
ajax.editStatus({
ids: ids,
status,
}),
})
});
}}
>
@ -753,17 +753,17 @@ function ConfigRoad() {
});
// setSelectedBerth(record.berth_ids.split(",").map(item => +item))
setRuleModal(true);
if(record.berth_ids ===''){
if (record.berth_ids === '') {
setShowBerthSelect(false);
setIsRuleEdit(true);
}else{
} else {
setShowBerthSelect(true);
setIsRuleEdit(false);
}
let data = {
road_id: parking_id,
vehicle_type: record.vehicle_type,
id:record.id
id: record.id
}
ajax
.getRuleBerth(data)
@ -804,7 +804,7 @@ function ConfigRoad() {
},
},
],
exporturl: "",
downloadUrl: "",
importProps: {
@ -1002,7 +1002,7 @@ function ConfigRoad() {
visible: false,
type: 1, //1线 2线 3
ids: [],
func: () => {},
func: () => { },
});
//
const [allBerthList, setAllBerthList] = useState([]);
@ -1124,9 +1124,9 @@ function ConfigRoad() {
let newArr = arr.slice(1)
setGetDeviceType(newArr)
}
useEffect(()=>{
useEffect(() => {
deviceType()
},[])
}, [])
//1线2线3
function changeBerthManage(status) {
console.log(selectedRowKeys);
@ -1213,10 +1213,32 @@ function ConfigRoad() {
//-
function handleCarTypeChange(value) {
setGetCarTypeValue(value)
if (value != '') {
if (value === '') {
setGetCarType(true)
} else {
setGetCarType(false)
let data = {
road_id: parking_id,
vehicle_type: value
}
ajax
.getRuleBerth(data)
.then((res) => {
if (res.status === 20000) {
res.data.left.map(item => {
item.key = item.value
return item
})
setAllBerthList(res.data.left);
} else {
message.error(res.message)
}
})
.catch((err) => console.error(err));
}
if (value === void 0) {
return;
}
}
@ -1550,6 +1572,11 @@ function ConfigRoad() {
ajax.editStatus({
ids: ids,
status,
}).then(res => {
if (res.status === 20000) {
message.success(res.message)
}
}),
});
break;
@ -1708,9 +1735,9 @@ function ConfigRoad() {
type === 4 || type === 5
? false
: {
type: "checkbox",
...rowSelection,
}
type: "checkbox",
...rowSelection,
}
}
// className="yisa-table"
columns={currentObj.columns}
@ -1859,7 +1886,7 @@ function ConfigRoad() {
message.error('请填写泊位号')
} else if (berthForm.getFieldsValue().etc_status === null) {
message.error('请选择ETC是开开启')
} else if (berthForm.getFieldsValue().berth_type === null) {
} else if (berthForm.getFieldsValue().berth_type === null) {
message.error('请选择泊位类型')
} else if ((!reg.test(berthForm.getFieldsValue().berth_count)&&berthForm.getFieldsValue().berth_count)) {
message.error('添加泊位数为大于1的整数')
@ -2033,7 +2060,7 @@ function ConfigRoad() {
{/* 计费规则添加弹窗 */}
<Modal
open={ruleModal}
title={isRuleEdit ? '编辑' : '添加'}
// title={isRuleEdit ? '' : ''}
width={1000}
onCancel={() => {
setRuleModal(false);
@ -2083,24 +2110,7 @@ function ConfigRoad() {
onChange={(e) => {
if (e.target.value === 1) {
setShowBerthSelect(true);
let data = {
road_id: parking_id,
vehicle_type: getCarTypeValue
}
ajax
.getRuleBerth(data)
.then((res) => {
if (res.status === 20000) {
res.data.left.map(item => {
item.key = item.value
return item
})
setAllBerthList(res.data.left);
} else {
message.error(res.message)
}
})
.catch((err) => console.error(err));
} else {
setShowBerthSelect(false);
@ -2191,7 +2201,7 @@ function ConfigRoad() {
onCancel={() => {
setEditPoleModal({ ...editPoleModal, visible: false });
}}
title={editTitle?"编辑杆位":"添加杆位"}
title={editTitle ? "编辑杆位" : "添加杆位"}
onOk={submitPole}
>
<Form
@ -2425,8 +2435,8 @@ function ConfigRoad() {
{dataStatusChangeModal.type === 1
? "上线"
: dataStatusChangeModal.type === 2
? "下线"
: "删除"}
? "下线"
: "删除"}
{" "}
</p>
</Modal>
@ -2468,13 +2478,13 @@ function ConfigRoad() {
const SearchPart = forwardRef((props, ref) => {
const {
formData = [],
search = () => {},
search = () => { },
initialValues = {},
pageData,
exporturl,
total = 0,
road_id,
closeConfirmModal = () => {},
closeConfirmModal = () => { },
confirmModalData = {},
delTollModal = {},
isShowExportBtn = true,

3
src/pages/InRoadMgm/RoadMgm/RoadConf/loadable.jsx

@ -283,11 +283,12 @@ function RoadConf() {
if (last.children) {
addChild(last, res);
}
res.push(last.id);
// res.push(last.id);
setArea(res);
}
const addChild = (child, res) => {
if (child.children) {
res.push(child.id)
child.children.forEach((item) => {
addChild(item, res);
});

31
src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx

@ -63,13 +63,13 @@ function StuffMgm(props) {
}
//
const onChangeList = (value) => {
// console.log(value);
let arr = value
let arrStr = []
let newArr = arr[arr.length - 1]
arrStr.push(newArr)
console.log(arrStr);
setFormData({ ...formData, region_id: arrStr })
// // console.log(value);
// let arr = value
// let arrStr = []
// let newArr = arr[arr.length - 1]
// arrStr.push(newArr)
// console.log(arrStr);
setFormData({ ...formData, region_id: value })
}
//
@ -316,7 +316,9 @@ function StuffMgm(props) {
//
const getData = (data = formData) => {
setAjaxLoading(true)
ajax.assetsList(data).then(res => {
let arr =data.region_id
let newArr=arr[arr.length-1];
ajax.assetsList({...data,region_id:newArr}).then(res => {
setAjaxLoading(false)
if (res.status === 20000) {
let resDataArr = res.data.list.map((item) => {
@ -404,12 +406,12 @@ function StuffMgm(props) {
uid: ''
})
const onChange = (newValue) => {
let arr = newValue
let arrStr = []
let newArr = arr[arr.length - 1]
arrStr.push(newArr)
// let arr = newValue
// let arrStr = []
// let newArr = arr[arr.length - 1]
// arrStr.push(newArr)
setCheckData(
Object.assign({}, checkData, { region_id: newArr })
Object.assign({}, checkData, { region_id: newValue })
);
};
//
@ -458,8 +460,11 @@ function StuffMgm(props) {
setGetUid({ ...getUid, uid: v })
}
const placeSaveBtn = () => {
let arr =checkData.region_id
let newArr=arr[arr.length-1];
let data = {
...checkData,
region_id:newArr
}
if (checkData.region_id == null) {
message.error('请选择区域')

10
src/pages/OperationCenter/CustomerServieMgm/CallbackSuggestion/loadable.jsx

@ -265,7 +265,9 @@ function CallbackSuggestion(props) {
}
//
const getSearchData = (data = formData) => {
getData(data)
// getData(data)
setFormData({...formData,pn:1})
getData(Object.assign({}, formData, { pn: 1 }))
}
//
const getResetData = () => {
@ -455,7 +457,7 @@ function CallbackSuggestion(props) {
const submitBtn = () => {
let data = {
...submitDeploy,
id: getImg.parkRecordId
id: [getImg.parkRecordId]
}
if(submitDeploy.deal_reason===''){
message.error('请输入处理理由')
@ -620,8 +622,8 @@ function CallbackSuggestion(props) {
showQuickJumper
showTotal={() => `${resultData.total_records}`}
total={resultData.total_records}
current={lastFormData.pn}
pageSize={lastFormData.page_size}
current={formData.pn}
pageSize={formData.page_size}
pageSizeOptions={pageSizeOptions}
onChange={changePn}
onShowSizeChange={changeLength}

3
src/pages/SystemMgm/BusinessConfig/BusinessConf/loadable.jsx

@ -134,7 +134,6 @@ function BusinessConf(props) {
}
//
const placeSaveBtn = () => {
console.log(addManage.parameter);
let data = {
...addManage
}
@ -144,7 +143,7 @@ function BusinessConf(props) {
message.error('请选择商户名称')
} else if (addManage.item_name === '') {
message.error('请选择配置项')
} else if (addManage.parameter === '' ||addManage.parameterValue==='') {
} else if (addManage.parameter === '' ) {
message.error('请输入参数项')
} else {
ajax.addBusiness(data).then(res => {

35
src/pages/SystemMgm/RoleMgm/loadable.jsx

@ -28,6 +28,7 @@ function RoleMgm(props) {
const [imgVisible, setImgVisible] = useState(false)
const [editVisible, setEditVisible] = useState(false)
const [passwordVisible, setPasswordVisible] = useState(false)
const [roleLength, setRoleLength] = useState(0)
//
const handleCarAppealId = (v) => {
setFormData({ ...formData, roleName: v.target.value })
@ -120,6 +121,17 @@ function RoleMgm(props) {
setCheckedKeys([])
}
}
function calculateArrayLength(arr) {
let count = 0;
arr.forEach((item) => {
count++;
if (item.children) {
count += calculateArrayLength(item.children);
}
});
return count;
}
const [getCheckValue, setGetCheckVlue] = useState(false)
const onCheckAdd = (checkedKeysValue, info) => {
let arr = []
let parentArr = []
@ -130,12 +142,14 @@ function RoleMgm(props) {
let string = checkedKeysValue.toString()
setAddManage({ ...addManage, auth: string })
setCheckedKeys(checkedKeysValue);
//
}
const [getCheckValue, setGetCheckVlue] = useState(false)
useEffect(() => {
// console.log(checkedKeys);
//
if (checkedKeys.length >= allGover.length) {
if ((checkedKeys.length >= allGover.length) && checkedKeys.length != 0) {
setGetCheckVlue(true)
} else {
setGetCheckVlue(false)
@ -146,7 +160,9 @@ function RoleMgm(props) {
let data = {
...addManage
}
if (addManage.name === '') {
let reg = /^ [\s]*$/;
if (addManage.name === '' || reg.test(addManage.name)) {
message.error('请输入角色名称')
} else if (addManage.depart_id === '') {
message.error('请选择所属部门')
@ -164,6 +180,7 @@ function RoleMgm(props) {
})
getData(formData)
setGetGovernment(0)
setCheckedKeys([])
} else {
message.error(res.message)
}
@ -193,7 +210,7 @@ function RoleMgm(props) {
title: '备注',
render: (text, record) => {
return <>
{record.remark||'-'}
{record.remark || '-'}
</>
}
},
@ -257,7 +274,9 @@ function RoleMgm(props) {
remark: record.remark,
depart_id: record.depart_id
}))
if (strArr.length == roleLength) {
setGetCheckVlue(true);
}
}
//
const [getPlateColor, setGetPlateColor] = useState([])
@ -393,7 +412,7 @@ function RoleMgm(props) {
depart_id: '',
auth: ''
})
}else{
} else {
message.error(res.message)
setGetGovernment(0)
}
@ -424,6 +443,8 @@ function RoleMgm(props) {
// console.log(digui(res.data))
let data = JSON.parse(JSON.stringify(res.data))
const arr = flatten(data)
const length = calculateArrayLength(res.data);
setRoleLength(length)
// console.log(arr);
setAllGover(arr)
}
@ -539,7 +560,7 @@ function RoleMgm(props) {
</div>
{
getGovernment == 0 ? '' : <div className="yisa-search">
<label>权限分配</label><span style={{ marginLeft: 20 }}><Checkbox onChange={onCheckbox}>全选</Checkbox></span>
<label>权限分配</label><span style={{ marginLeft: 20 }}><Checkbox checked={getCheckValue} onChange={onCheckbox}>全选</Checkbox></span>
<Tree
checkable
style={{ width: 260, marginLeft: 14 }}

Loading…
Cancel
Save