Browse Source

fix():公共组件修改

tags/PMS_Frontend_v1.0.6-develop
xingjx 1 year ago
parent
commit
172ce588e0
  1. 109
      src/components/TableModule/index.jsx

109
src/components/TableModule/index.jsx

@ -745,5 +745,114 @@ const TableModule = forwardRef((props, ref) => {
</div>
);
});
function InputSelectGroup(params) {
const {
onChange = () => { },
getValue = () => { },
pageName = "",
} = params;
const [searchForm] = Form.useForm();
const [sessionTabList, setSessionTabList] = useSessionStorageState(pageName, {
value: ''
})
const [timeType, setTimeType] = useState(1);
const [deftime, setDeftime] = useState([])
const [timeGroup, setTimeGroup] = useState({
start_time: moment().subtract(1, "day").format(),
end_time: moment().format(),
});
console.log();
useEffect(() => {
if (deftime.startDateTime) {
setTimeGroup({
start_time: moment(deftime.startDateTime),
end_time: moment(deftime.endDateTime)
})
console.log(timeGroup);
setSessionTabList({
...sessionTabList, start_time: moment(deftime.startDateTime),
end_time: moment(deftime.endDateTime)
})
} else {
// searchForm.setFieldsValue({
// start_time: moment().subtract(1, "month"),
// end_time: moment()
// })
}
}, [deftime])
useEffect(() => {
onChange(timeGroup, timeType);
}, [timeGroup, timeType]);
return (
<>
<Row>
<Col span={8}>
<Select
style={{ width: "100%" }}
onChange={(timeType) => {
setTimeType(timeType);
}}
defaultValue={1}
options={[
{
label: "支付时间",
value: 1,
},
{
label: "计费时间",
value: 2,
},
{
label: "入场时间",
value: 3,
}
]}
/>
</Col>
<Col span={16}>
<DatePicker
placeholder="请选择开始日期"
onChange={(val, string) => {
setTimeGroup({ ...timeGroup, start_time: string });
}}
format={"YYYY-MM-DD HH:mm:ss"}
defaultValue={deftime.length ? deftime.startDateTime : moment().subtract(1, "day")}
showTime
/>
</Col>
</Row>
<Row>
<Col offset={8} span={16}>
<DatePicker
placeholder="请选择结束日期"
defaultValue={moment()}
onChange={(val, string) => {
setTimeGroup({ ...timeGroup, end_time: string });
}}
format={"YYYY-MM-DD HH:mm:ss"}
showTime
/>
</Col>
</Row>
<div style={{ margin: "0px 0 10px 0" }}>
<QuickMenu
dropdownData={[
{ text: '昨日', value: 1 },
{ text: '今日', value: 0 },
{ text: '近三日', value: 2 },
{ text: '近一周', value: 6 },
{ text: '近一月', value: 29 },
{ text: '近一年', value: 365 },
{ text: '近两年', value: 730 },
]}
onChange={(v) => {
// setTimeGroup({ ...timeGroup, start_time: v.startDateTime, end_time: v.endDateTime })
getValue(v)
setDeftime(v);
}} />
</div>
</>
);
}
export default TableModule;
Loading…
Cancel
Save