Commit c12a1358 authored by 彭俊龙's avatar 彭俊龙

app发版增加上传记录

parent 2a199671
Pipeline #93531 passed with stages
import React, { useEffect, useMemo, useState } from 'react';
import styles from './index.less';
import { Form, Modal, Input, message, Button, Upload, Select } from 'antd';
import { Form, Table , Input, message, Button, Upload, Tooltip } from 'antd';
import { getAppUploadRecords, postAppVersionInfo } from '@/services/mobileConfig/api';
import { UploadOutlined } from '@ant-design/icons';
import { request } from '@wisdom-utils/utils/es';
const ApkUpload = props => {
const [loadding, setLoadding] = useState(false);
const [dataSource, setDataSource] = useState([]);
const { TextArea } = Input;
const tailLayout = {
wrapperCol: { offset: 6, span: 8 },
wrapperCol: { offset: 6, span: 12 },
};
const layout = {
labelCol: {
span: 6,
},
wrapperCol: {
span: 8,
span: 12,
},
};
const columns = [
{
title: '版本号',
dataIndex: 'Ver',
key: 'Ver',
},
{
title: '上传时间',
dataIndex: 'UploadTime',
key: 'UploadTime',
},
{
title: '发版日志',
dataIndex: 'UploadLog',
key: 'UploadLog',
render: (text, recore, index) =>
<Tooltip title= {text}>
<div style={{
width: '150px',
whiteSpace: 'nowrap', /* 不换行 */
overflow: 'hidden', /* 超出部分隐藏 */
textOverflow: 'ellipsis' /* 显示省略号 */
}}>
{text}
</div>
</Tooltip>
},
{
title: '下载',
key: 'DownUrl',
dataIndex: 'DownUrl',
render: (text, record, index) => <UploadOutlined onClick={()=> window.open(`${window.origin}${text}`, '_self') }/>
},
];
const [form] = Form.useForm();
useEffect(()=>{
getRecords();
//getAppUploadRecords().then(x=> console.log(x, '上传记录'))
}, [])
const normFile = e => {
......@@ -29,6 +66,13 @@ const ApkUpload = props => {
return e?.fileList;
};
const getRecords = async () => {
const res = await getAppUploadRecords();
if(res.code === 0){
setDataSource(res.data || []);
}
}
const postAPPUploadInfo = async () => {
await form.validateFields();
const formData = form.getFieldsValue();
......@@ -50,7 +94,14 @@ const ApkUpload = props => {
setLoadding(false);
};
return (
<Form
<div style={{
display: 'flex',
width: '100%'
}}>
<Form
style={{
width: '50%'
}}
{...layout}
initialValues={{
DownUrl: '',
......@@ -114,6 +165,18 @@ const ApkUpload = props => {
</Button>
</Form.Item>
</Form>
<Table
style={{
width: '50%'
}}
columns={columns}
pagination={{
pageSize: 10
}}
dataSource={dataSource}
/>
</div>
);
};
export default ApkUpload;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment