Browse Source

fix():路外系统bug修改

tags/PMS_Frontend_v1.0.6-develop
xingjx 1 year ago
parent
commit
b0a4b449b5
  1. 39
      src/components/TableModule/index.jsx
  2. 2
      src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx
  3. 2
      src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx
  4. 20
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/index.scss
  5. 45
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx
  6. 9
      src/services/common.js

39
src/components/TableModule/index.jsx

@ -258,6 +258,39 @@ const TableModule = forwardRef((props, ref) => {
const handleChange = (newValue) => {
setValue(newValue);
};
const fetchPlateSearch = (value, callback, item) => {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
currentValue = value;
const fake = () => {
const str = {
plate: value,
};
ajax.getPlateSearch(str).then((res) => {
if (currentValue === value) {
const data = res.data.map((item) => ({
value: item.value,
text: item.label,
}));
callback(data);
}
})
};
timeout = setTimeout(fake, 1000);
};
const handlePlateSearch = (newValue, item) => {
console.log(newValue, item);
if (newValue) {
fetchPlateSearch(newValue, setData, item);
} else {
setData([]);
}
};
const handlePlateChange = (newValue) => {
setValue(newValue);
};
// useEffect(() => {
// console.log(deftime.startDateTime);
// if (deftime.startDateTime) {
@ -423,12 +456,12 @@ const TableModule = forwardRef((props, ref) => {
<Select
showSearch
value={value}
// placeholder={props.placeholder}
placeholder={props.placeholder}
defaultActiveFirstOption={false}
showArrow={false}
filterOption={false}
// onSearch={handleSearch}
// onChange={handleChange}
onSearch={(newValue) => handlePlateSearch(newValue, item)}
onChange={handlePlateChange}
notFoundContent={null}
options={(data || []).map((d) => ({
value: d.value,

2
src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx

@ -194,7 +194,7 @@ function CarInfo() {
const formSearch = [
{
name: "carId",
type: "Input",
type: "PlateSelect",
label: "车牌号",
placeholder: "请输入车牌号",
},

2
src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx

@ -216,7 +216,7 @@ function UserInfo() {
},
{
name: "carId",
type: "Input",
type: "PlateSelect",
label: "车牌号",
placeholder: "请输入车牌号",
},

20
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/index.scss

@ -248,3 +248,23 @@ $color-primary: var(--color-primary);
color: var(--color-search-list-item-value);
}
}
.tpsinput {
width: 90%;
}
.tpsinput + i {
border: 1px solid;
border-radius: 22px;
display: inline-block;
text-align: center;
font-size: 12px;
width: 22px;
cursor: pointer;
margin-top: 4px;
margin-left: 10px;
background: #fff;
color: #454d61;
font-weight: 900;
}
.tpstips {
color: red;
}

45
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx

@ -13,6 +13,7 @@ import {
Modal,
Cascader,
message,
Tooltip
} from "antd";
import { dictionary, utils } from "@/config/common";
// import moment from 'moment'
@ -37,7 +38,7 @@ function OutSegment() {
const [searchForm] = Form.useForm();
const [commentForm] = Form.useForm();
const [berthForm] = Form.useForm();
const [recordData,setRecordData] = useSetState()
const [recordData, setRecordData] = useSetState()
const [sessionTabList, setSessionTabList] = useSessionStorageState('outSegment', {
value: ''
})
@ -338,7 +339,7 @@ function OutSegment() {
let start_time = sessionTabList.start_time
let end_time = sessionTabList.end_time
searchForm.setFieldsValue({ ...sessionTabList, start_time: moment(start_time), end_time: moment(end_time) })
}else {
} else {
searchForm.setFieldsValue({ ...sessionTabList })
}
} else {
@ -385,14 +386,17 @@ function OutSegment() {
//
const configAppraise = () => {
let values = commentForm.getFieldsValue();
console.log(values);
ajax.commentSetting(values).then((res) => {
if (res.status === 20000) {
message.success("配置成功");
setAppraiseModal({ ...appraiseModal, visible: false });
commentForm.resetFields();
}
});
if (values.count.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '') == values.count || values.days.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '') == values.days) {
ajax.commentSetting(values).then((res) => {
if (res.status === 20000) {
message.success("配置成功");
setAppraiseModal({ ...appraiseModal, visible: false });
commentForm.resetFields();
}
});
} else {
message.error("输入内容必须为数字!")
}
};
//
const reset = () => {
@ -525,7 +529,7 @@ function OutSegment() {
getCommentSetting()
setAppraiseModal({ ...appraiseModal, visible: true });
}}
style={{width:'120px'}}
style={{ width: '120px' }}
>
评价批量配置
</Button>
@ -569,7 +573,7 @@ function OutSegment() {
close={checkModal.close}
itemData={checkModal.record}
setConfigModal={() => {
setConfigModal({ ...configModal, visible: true, record:recordData });
setConfigModal({ ...configModal, visible: true, record: recordData });
}}
setEditModal={(v) => {
setEditModal({
@ -617,11 +621,24 @@ function OutSegment() {
}}
>
<Form.Item label="车主历史交易次数≥" name="count">
<Input addonAfter={"次"} key="count" />
<Input className="tpsinput" addonAfter={"次"} key="count" />
<Tooltip
placement="topLeft"
title={<span>参数默认为5次n代表正常若为0表示不限制</span>}
>
<i>?</i>
</Tooltip>
</Form.Item>
<Form.Item label="车主注册时间≥" name="days">
<Input addonAfter={"天"} key="days" />
<Input className="tpsinput" addonAfter={"天"} key="days" />
<Tooltip
placement="topLeft"
title={<span>参数默认为30天n代表正常若为0表示不限制</span>}
>
<i>?</i>
</Tooltip>
</Form.Item>
<p className="tpstips">须知:修改默认参数配置会对全局车场评分有影响点击确定立即生效请谨慎修改!</p>
</Form>
</Modal>
<Modal

9
src/services/common.js

@ -113,9 +113,18 @@ const getRoadSearch = (params) => {
data: params,
});
};
//车牌搜索
const getPlateSearch = (params) => {
return ajax({
url: "/api/ope/car/plate_list",
type: "get",
data: params,
});
};
export default {
getSysConfig,
getRoadSearch,
getPlateSearch,
getUserInfo,
login,
getPubKey,

Loading…
Cancel
Save