index.tsx 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. import React, { useState } from 'react';
  2. import { Button, DatePicker, Input, Select, Space, Table } from 'antd';
  3. import styles from './index.less';
  4. import { ColumnsType } from 'antd/es/table';
  5. interface DataType {
  6. key: React.ReactNode;
  7. name: string;
  8. age: number;
  9. address: string;
  10. children?: DataType[];
  11. }
  12. const ConteactManager = () => {
  13. const [searchData, setSearchData] = useState({});
  14. console.log(searchData);
  15. const columns: ColumnsType<DataType> = [
  16. {
  17. title: '合同编号',
  18. dataIndex: 'name',
  19. key: 'name',
  20. },
  21. {
  22. title: '合同生效时间',
  23. dataIndex: 'age',
  24. key: 'age',
  25. },
  26. {
  27. title: '合同名称',
  28. dataIndex: 'address',
  29. key: 'address',
  30. },
  31. {
  32. title: '甲方',
  33. dataIndex: 'address',
  34. key: 'address',
  35. },
  36. {
  37. title: '丙方',
  38. dataIndex: 'address',
  39. key: 'address',
  40. },
  41. {
  42. title: '所属部门/子公司',
  43. dataIndex: 'address',
  44. key: 'address',
  45. },
  46. {
  47. title: '项目名称',
  48. dataIndex: 'address',
  49. key: 'address',
  50. },
  51. {
  52. title: '合同总价(万元)',
  53. dataIndex: 'address',
  54. key: 'address',
  55. },
  56. {
  57. title: '经办人',
  58. dataIndex: 'address',
  59. key: 'address',
  60. },
  61. {
  62. title: '状态',
  63. dataIndex: 'address',
  64. key: 'address',
  65. },
  66. {
  67. title: '操作',
  68. dataIndex: 'address',
  69. align: 'center',
  70. render: () => {
  71. return (
  72. <Space>
  73. <a>详情</a>
  74. <a>预览</a>
  75. <a>下载</a>
  76. <a>增补</a>
  77. <a>作废</a>
  78. </Space>
  79. );
  80. },
  81. },
  82. ];
  83. const data: DataType[] = [
  84. {
  85. key: 1,
  86. name: 'John Brown sr.',
  87. age: 60,
  88. address: 'New York ',
  89. children: [
  90. {
  91. key: 11,
  92. name: 'John Brown',
  93. age: 42,
  94. address: 'New York No. 2 Lake Park',
  95. },
  96. {
  97. key: 12,
  98. name: 'John Brown jr.',
  99. age: 30,
  100. address: 'New York No. 3 Lake Park',
  101. children: [
  102. {
  103. key: 121,
  104. name: 'Jimmy Brown',
  105. age: 16,
  106. address: 'New York No. 3 Lake Park',
  107. },
  108. ],
  109. },
  110. {
  111. key: 13,
  112. name: 'Jim Green sr.',
  113. age: 72,
  114. address: 'London No. 1 Lake Park',
  115. children: [
  116. {
  117. key: 131,
  118. name: 'Jim Green',
  119. age: 42,
  120. address: 'London No. 2 Lake Park',
  121. children: [
  122. {
  123. key: 1311,
  124. name: 'Jim Green jr.',
  125. age: 25,
  126. address: 'London No. 3 Lake Park',
  127. },
  128. {
  129. key: 1312,
  130. name: 'Jimmy Green sr.',
  131. age: 18,
  132. address: 'London No. 4 Lake Park',
  133. },
  134. ],
  135. },
  136. ],
  137. },
  138. ],
  139. },
  140. {
  141. key: 2,
  142. name: 'Joe Black',
  143. age: 32,
  144. address: 'Sydney No',
  145. },
  146. ];
  147. const handleChange = () => {};
  148. const handleSearch = () => {};
  149. const handleExport = () => {};
  150. return (
  151. <div className={styles.main}>
  152. <div className={styles.searchContent}>
  153. <div className={styles.itemFlex}>
  154. <div>合同生效日期:</div>
  155. <DatePicker onChange={handleChange} />
  156. </div>
  157. <div className={styles.itemFlex}>
  158. <div>项目名称:</div>
  159. <Select
  160. style={{ width: 200 }}
  161. placeholder="请选择"
  162. onChange={handleChange}
  163. options={[
  164. { value: 'jack', label: 'Jack' },
  165. { value: 'lucy', label: 'Lucy' },
  166. { value: 'Yiminghe', label: 'yiminghe' },
  167. { value: 'disabled', label: 'Disabled', disabled: true },
  168. ]}
  169. />
  170. </div>
  171. <div className={styles.itemFlex}>
  172. <div>状态:</div>
  173. <Select
  174. style={{ width: 150 }}
  175. placeholder="请选择"
  176. onChange={handleChange}
  177. options={[
  178. { value: 0, label: '已归档' },
  179. { value: 1, label: '归档审核中' },
  180. { value: 2, label: '作废审核中' },
  181. { value: 3, label: '已作废' },
  182. { value: 4, label: '归档拒绝' },
  183. { value: 5, label: '作废拒绝' },
  184. ]}
  185. />
  186. </div>
  187. <Input
  188. className={styles.inputSty}
  189. placeholder="请输入合同名称/编号"
  190. onChange={handleChange}
  191. />
  192. <Button
  193. type="primary"
  194. className={styles.searchBtnSty}
  195. onClick={handleSearch}
  196. >
  197. 查询
  198. </Button>
  199. <Button type="primary" onClick={() => {}}>
  200. 新增
  201. </Button>
  202. <Button
  203. type="primary"
  204. className={styles.exportBtnSty}
  205. onClick={handleExport}
  206. >
  207. 导出
  208. </Button>
  209. </div>
  210. <Table columns={columns} dataSource={data} />
  211. </div>
  212. );
  213. };
  214. export default ConteactManager;