12-23-上传master

This commit is contained in:
xingsy
2020-12-23 11:14:35 +08:00
parent 9769f83bc8
commit b42e0c1ddd
553 changed files with 56506 additions and 0 deletions

View File

@ -0,0 +1,7 @@
//需要包含筛选里的字段 筛选才能生效
export interface TableListItem {
key?: string;
round?: string;
enclosure?: string;
time?: string;
}

View File

@ -0,0 +1,137 @@
import React, { useState } from 'react';
import { Table, Button, Space, Modal, Form, Select, Upload, Input } from 'antd';
import { TableListItem } from './data';
import '@/assets/ld_style.less'
const { Option } = Select;
const { TextArea } = Input;
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 14 },
};
const dataSource: TableListItem[] = [
{
key: '1',
round: '第一轮次谈判',
enclosure: '——',
time: '2019-09-23 101112',
},
];
const Index: React.FC<{}> = () => {
const [dateList] = useState(dataSource);
const [visible, setVisible] = useState<boolean>(false);
const columns: any[] = [ // 列表数据
{
title: '序号',
dataIndex: 'key',
key: 'key',
},
{
title: '谈判轮次',
dataIndex: 'round',
key: 'round',
},
{
title: '附件',
dataIndex: 'enclosure',
key: 'enclosure',
},
{
title: '编辑时间',
dataIndex: 'time',
key: 'time',
},
{
title: '操作',
dataIndex: 'action',
key: 'action',
render: (text: any, record: any) => (
<Space>
<Button type="link" danger></Button>
<Button onClick={() => setVisible(true)} type="link" danger></Button>
</Space>
),
},
];
const normFile = (e: any) => { // 上传附件
console.log('Upload event:', e);
if (Array.isArray(e)) {
return e;
}
return e && e.fileList;
};
const onFinish = (values: any) => { // 表单完成
console.log('Received values of form: ', values);
};
return (
<>
<div className="bidContent">
<div className="titName">
<span className="f16"></span>
<Space className="fr">
<Button type="primary" danger size="small" className="fr"></Button>
</Space>
</div>
<Table bordered pagination={false} columns={columns} dataSource={dateList} />
<Modal
title="编辑谈判纪要"
width={800}
visible={visible}
onOk={() => setVisible(false)}
onCancel={() => setVisible(false)}
>
<Form
name="validate_other"
{...formItemLayout}
onFinish={onFinish}
>
<Form.Item
name="select"
label="谈判轮次"
hasFeedback
rules={[{ required: true, message: '请选择谈判轮次!' }]}
>
<Select placeholder="请选择谈判轮次">
<Option value="1"></Option>
<Option value="2"></Option>
</Select>
</Form.Item>
<Form.Item label="谈判项目名称">
<span className="ant-form-text">0813-3-1</span>
</Form.Item>
<Form.Item label="参与供应商">
<span className="ant-form-text"></span>
</Form.Item>
<Form.Item
name="upload"
label="附件"
valuePropName="fileList"
getValueFromEvent={normFile}
// extra="longgggggggggggggggggggggggggggggggggg"
>
<Upload name="logo" action="/upload.do" listType="picture">
<Button type="primary" danger></Button>
<span className="ml5">,500MB,rar,zip,pdf,doc,docx,xls,xlsx,png,jpeg格式</span>
</Upload>
</Form.Item>
<Form.Item
name="textarea"
label="主要内容"
rules={[{ required: true, message: '请输入主要内容!' }]}
>
<TextArea rows={4} />
</Form.Item>
</Form>
</Modal>
</div>
</>
)
}
export default Index