|
@@ -24,7 +24,9 @@ import { range } from 'lodash';
|
|
|
import { download } from '@/utils/tools';
|
|
|
import { CloseOutlined } from '@ant-design/icons';
|
|
|
import PreviewPDF from '@/components/PreviewPDF';
|
|
|
-import { Divider, Typography, Descriptions } from 'antd';
|
|
|
+import { Divider, Typography } from 'antd';
|
|
|
+import styles from './index.css';
|
|
|
+import { Scrollbars } from 'react-custom-scrollbars';
|
|
|
import { DataType } from './type';
|
|
|
|
|
|
const { Title } = Typography;
|
|
@@ -33,38 +35,10 @@ const { Title } = Typography;
|
|
|
const BasicParam: React.FC<{ tireMessagData?: DataType }> = ({ tireMessagData }) => {
|
|
|
return (
|
|
|
<div style={{ marginBottom: '30px' }}>
|
|
|
- <Title level={4} style={{ color: 'rgb(34,147,202)' }}>
|
|
|
+ <Title level={4} style={{ color: 'white' }}>
|
|
|
轮胎基本信息
|
|
|
</Title>
|
|
|
<Divider />
|
|
|
- {/* <div>
|
|
|
- <Descriptions
|
|
|
- bordered
|
|
|
- column={6}
|
|
|
- contentStyle={{ backgroundColor: '#fff', minWidth: '200px', textAlign: 'center' }}
|
|
|
- labelStyle={{ backgroundColor: '#fafafa', textAlign: 'center' }}
|
|
|
- >
|
|
|
- <Descriptions.Item label="前轮胎品牌">前轮胎品牌</Descriptions.Item>
|
|
|
- <Descriptions.Item label="前轮胎规格">前轮胎规格</Descriptions.Item>
|
|
|
- <Descriptions.Item label="前轮胎胎压(bar)">前轮胎胎压(bar)</Descriptions.Item>
|
|
|
- <Descriptions.Item label="后轮胎品牌">后轮胎品牌</Descriptions.Item>
|
|
|
- <Descriptions.Item label="后轮胎规格">后轮胎规格</Descriptions.Item>
|
|
|
- <Descriptions.Item label="后轮胎胎压(bar)">后轮胎胎压(bar)</Descriptions.Item>
|
|
|
- </Descriptions>
|
|
|
- <Descriptions
|
|
|
- bordered
|
|
|
- column={6}
|
|
|
- contentStyle={{ backgroundColor: '#fff', minWidth: '200px', textAlign: 'center' }}
|
|
|
- labelStyle={{ backgroundColor: '#fafafa', textAlign: 'center' }}
|
|
|
- >
|
|
|
- <Descriptions.Item label="前轮胎品牌">{tireMessagData?.frontTireBrand}</Descriptions.Item>
|
|
|
- <Descriptions.Item label="前轮胎规格">{tireMessagData?.frontTireSpecifications}</Descriptions.Item>
|
|
|
- <Descriptions.Item label="前轮胎胎压(bar)">{tireMessagData?.frontTirePressure}</Descriptions.Item>
|
|
|
- <Descriptions.Item label="后轮胎品牌">{tireMessagData?.rearTireBrand}</Descriptions.Item>
|
|
|
- <Descriptions.Item label="后轮胎规格">{tireMessagData?.rearTireSpecifications}</Descriptions.Item>
|
|
|
- <Descriptions.Item label="后轮胎胎压(bar)">{tireMessagData?.rearTirePressure}</Descriptions.Item>
|
|
|
- </Descriptions>
|
|
|
- </div> */}
|
|
|
<div>
|
|
|
<Row>
|
|
|
<Col span={4} style={{ textAlign: 'center' }}>
|
|
@@ -340,133 +314,138 @@ const TestData: React.FC<{
|
|
|
}, [page, pageSize]);
|
|
|
|
|
|
return (
|
|
|
- <div>
|
|
|
- <Spin spinning={loading1}>
|
|
|
- <BasicParam tireMessagData={tireMessagData} />
|
|
|
- </Spin>
|
|
|
- <Title level={4} style={{ color: 'rgb(34,147,202)' }}>
|
|
|
- 试验数据
|
|
|
- </Title>
|
|
|
- <Divider />
|
|
|
+ <Scrollbars
|
|
|
+ // style={{ width: '80vw' }}
|
|
|
+ autoHide
|
|
|
+ autoHideTimeout={1000}
|
|
|
+ autoHideDuration={200}
|
|
|
+ autoWidth
|
|
|
+ autoWidthMin={550}
|
|
|
+ autoWidthMax={550}
|
|
|
+ autoHeight
|
|
|
+ autoHeightMin="60vh"
|
|
|
+ autoHeightMax="60vh"
|
|
|
+ >
|
|
|
<div>
|
|
|
- <Form form={form} component={false} autoComplete="off">
|
|
|
- <Row>
|
|
|
- <Col span={8}>
|
|
|
- <Form.Item label="文件名称" colon={false} name="fileName">
|
|
|
- <Input placeholder="请输入文件名称" />
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- <Row>
|
|
|
- <Col span={8} offset={16}>
|
|
|
- <Form.Item style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
|
|
- <Space>
|
|
|
- <Button htmlType="button" type="dashed" onClick={getData}>
|
|
|
- 查询
|
|
|
- </Button>
|
|
|
- <Button
|
|
|
- htmlType="button"
|
|
|
- type="dashed"
|
|
|
- onClick={() => {
|
|
|
- form.resetFields();
|
|
|
- getData();
|
|
|
- }}
|
|
|
- >
|
|
|
- 重置
|
|
|
- </Button>
|
|
|
- </Space>
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- </Form>
|
|
|
- </div>
|
|
|
- <hr />
|
|
|
- <div style={{ marginBottom: '10px' }}>
|
|
|
- <Space>
|
|
|
- <Popconfirm
|
|
|
- title="是否删除这些数据?"
|
|
|
- onConfirm={() => {
|
|
|
- delectHandle(selectedRows.map((item) => item.id as number));
|
|
|
- }}
|
|
|
- okText="是"
|
|
|
- cancelText="否"
|
|
|
- >
|
|
|
- <Button type="dashed">批量删除</Button>
|
|
|
- </Popconfirm>
|
|
|
- <Button type="dashed" onClick={opeanHandle}>
|
|
|
- 导入数据
|
|
|
- </Button>
|
|
|
- </Space>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <Spin spinning={loading}>
|
|
|
- <Table
|
|
|
- rowSelection={rowSelection}
|
|
|
- columns={columns}
|
|
|
- dataSource={dataList}
|
|
|
- rowKey="id"
|
|
|
- pagination={pagination}
|
|
|
- />
|
|
|
+ <Spin spinning={loading1}>
|
|
|
+ <BasicParam tireMessagData={tireMessagData} />
|
|
|
</Spin>
|
|
|
- </div>
|
|
|
+ <Title level={4} style={{ color: 'white' }}>
|
|
|
+ 试验数据
|
|
|
+ </Title>
|
|
|
+ <Divider />
|
|
|
+ <div>
|
|
|
+ <Form name="basic" layout="inline" autoComplete="off">
|
|
|
+ <Form.Item label="文件名称" colon={false} name="fileName" className={styles.formSelect}>
|
|
|
+ <Input placeholder="请输入文件名称" />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
|
|
+ <Space>
|
|
|
+ <Button htmlType="button" type="dashed" onClick={getData}>
|
|
|
+ 查询
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ htmlType="button"
|
|
|
+ type="dashed"
|
|
|
+ onClick={() => {
|
|
|
+ form.resetFields();
|
|
|
+ getData();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 重置
|
|
|
+ </Button>
|
|
|
+ </Space>
|
|
|
+ </Form.Item>
|
|
|
+ </Form>
|
|
|
+ </div>
|
|
|
+ <hr />
|
|
|
+ <div style={{ marginBottom: '10px' }}>
|
|
|
+ <Space>
|
|
|
+ <Popconfirm
|
|
|
+ title="是否删除这些数据?"
|
|
|
+ onConfirm={() => {
|
|
|
+ delectHandle(selectedRows.map((item) => item.id as number));
|
|
|
+ }}
|
|
|
+ okText="是"
|
|
|
+ cancelText="否"
|
|
|
+ >
|
|
|
+ <Button type="dashed">批量删除</Button>
|
|
|
+ </Popconfirm>
|
|
|
+ <Button type="dashed" onClick={opeanHandle}>
|
|
|
+ 导入数据
|
|
|
+ </Button>
|
|
|
+ </Space>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <Spin spinning={loading}>
|
|
|
+ <Table
|
|
|
+ rowSelection={rowSelection}
|
|
|
+ columns={columns}
|
|
|
+ dataSource={dataList}
|
|
|
+ rowKey="id"
|
|
|
+ pagination={pagination}
|
|
|
+ />
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
|
|
|
- <div>
|
|
|
- <UploadS
|
|
|
- isOpen={open}
|
|
|
- cancel={closeHandle}
|
|
|
- title="上传文件"
|
|
|
- url="/api/tire/uploadTyreFile"
|
|
|
- update={getData}
|
|
|
- name="multipartFile"
|
|
|
- data={{
|
|
|
- operId: currentUser?.id,
|
|
|
- carId: idNumber,
|
|
|
- }}
|
|
|
- extraFormData={[
|
|
|
- {
|
|
|
- name: 'taskStartTime',
|
|
|
- label: '开始时间',
|
|
|
- required: false,
|
|
|
- rules: [
|
|
|
- {
|
|
|
- validator(_, value) {
|
|
|
- if (value && value.isBefore(moment())) {
|
|
|
- return Promise.reject('开始时间不能早于当前时间');
|
|
|
- }
|
|
|
- return Promise.resolve();
|
|
|
+ <div>
|
|
|
+ <UploadS
|
|
|
+ isOpen={open}
|
|
|
+ cancel={closeHandle}
|
|
|
+ title="上传文件"
|
|
|
+ url="/api/tire/uploadTyreFile"
|
|
|
+ update={getData}
|
|
|
+ name="multipartFile"
|
|
|
+ data={{
|
|
|
+ operId: currentUser?.id,
|
|
|
+ carId: idNumber,
|
|
|
+ }}
|
|
|
+ extraFormData={[
|
|
|
+ {
|
|
|
+ name: 'taskStartTime',
|
|
|
+ label: '开始时间',
|
|
|
+ required: false,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ validator(_, value) {
|
|
|
+ if (value && value.isBefore(moment())) {
|
|
|
+ return Promise.reject('开始时间不能早于当前时间');
|
|
|
+ }
|
|
|
+ return Promise.resolve();
|
|
|
+ },
|
|
|
},
|
|
|
+ ],
|
|
|
+ normalize(value, prevValue, allValues) {
|
|
|
+ value?.add(10, 's');
|
|
|
+ return value;
|
|
|
},
|
|
|
- ],
|
|
|
- normalize(value, prevValue, allValues) {
|
|
|
- value?.add(10, 's');
|
|
|
- return value;
|
|
|
+ children: (
|
|
|
+ <DatePicker
|
|
|
+ style={{ width: '100%' }}
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ disabledDate={disabledDate}
|
|
|
+ disabledTime={disabledDateTime}
|
|
|
+ showTime={{ secondStep: 10 }}
|
|
|
+ />
|
|
|
+ ),
|
|
|
},
|
|
|
- children: (
|
|
|
- <DatePicker
|
|
|
- style={{ width: '100%' }}
|
|
|
- format="YYYY-MM-DD HH:mm:ss"
|
|
|
- disabledDate={disabledDate}
|
|
|
- disabledTime={disabledDateTime}
|
|
|
- showTime={{ secondStep: 10 }}
|
|
|
- />
|
|
|
- ),
|
|
|
- },
|
|
|
- ]}
|
|
|
- />
|
|
|
- </div>
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
|
|
|
- <Drawer
|
|
|
- placement="left"
|
|
|
- width={'90%'}
|
|
|
- open={openDrawer}
|
|
|
- onClose={onClose}
|
|
|
- title={preFileName}
|
|
|
- closable={false}
|
|
|
- extra={<Button type="text" onClick={onClose} icon={<CloseOutlined />} />}
|
|
|
- >
|
|
|
- <PreviewPDF url={fileurl} />
|
|
|
- </Drawer>
|
|
|
- </div>
|
|
|
+ <Drawer
|
|
|
+ placement="left"
|
|
|
+ width={'90%'}
|
|
|
+ open={openDrawer}
|
|
|
+ onClose={onClose}
|
|
|
+ title={preFileName}
|
|
|
+ closable={false}
|
|
|
+ extra={<Button type="text" onClick={onClose} icon={<CloseOutlined />} />}
|
|
|
+ >
|
|
|
+ <PreviewPDF url={fileurl} />
|
|
|
+ </Drawer>
|
|
|
+ </div>
|
|
|
+ </Scrollbars>
|
|
|
);
|
|
|
};
|
|
|
|