jzmList.jsx 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. import React from 'react';
  2. import $ from 'jquery/src/ajax';
  3. import 'react-quill/dist/quill.bubble.css';
  4. import {Form,Icon,Button,Input,Select,Spin,Table,message,DatePicker,Modal,Upload,Popconfirm,Cascader,InputNumber,Radio,TimePicker,Tabs,Tag} from 'antd';
  5. export default class JzmList extends React.Component {
  6. constructor(props) {
  7. super(props)
  8. this.state = {
  9. confirmDirty: false,
  10. //加载状态
  11. loading: false,
  12. //搜索框内容
  13. nameSearch: undefined,
  14. //数据类型
  15. columns:[
  16. {
  17. title: '序号',
  18. dataIndex: 'key',
  19. },
  20. {
  21. title: '企业名称',
  22. dataIndex: 'title',
  23. },
  24. {
  25. title: '服务项目',
  26. dataIndex: 'stPorject',
  27. }, {
  28. title: '所在地',
  29. dataIndex: 'adree',
  30. },
  31. {
  32. title: '成立时间',
  33. dataIndex: 'time',
  34. },
  35. {
  36. title: '联系人',
  37. dataIndex: 'user',
  38. },
  39. {
  40. title: '电话',
  41. dataIndex: 'iphone',
  42. },
  43. {
  44. title: '状态',
  45. dataIndex: 'state',
  46. },
  47. {
  48. title: '排序',
  49. dataIndex: 'first',
  50. },
  51. {
  52. title: '置顶',
  53. dataIndex: 'top',
  54. render: (text)=>{
  55. return text?'是':'否'
  56. }
  57. },
  58. {
  59. title: '操作',
  60. dataIndex: 'ads',
  61. render:(text,record,index)=>{
  62. return (<div>
  63. <Button type="primary" >修改</Button>
  64. <Popconfirm okText="确定" cancelText="取消" title="是否确认删除该信息吗?" onConfirm={()=>{this.delete(index)}}>
  65. <Button type="danger" style={{marginLeft:"10px"}}>删除</Button>
  66. </Popconfirm>
  67. </div>)
  68. }
  69. },
  70. ],
  71. //数据列表
  72. dataSource:[
  73. {
  74. key:1,
  75. title:'南昌XXXXX公司',
  76. stPorject: '军工',
  77. adree: '江西南昌',
  78. time: '2019',
  79. user: '吴工',
  80. iphone: '13728469721',
  81. state: '20',
  82. first: '1',
  83. top: '1',
  84. },
  85. {
  86. key:2,
  87. title:'南昌XXXXX公司',
  88. stPorject: '军工',
  89. adree: '江西南昌',
  90. time: '2019',
  91. user: '吴工',
  92. iphone: '13728469721',
  93. state: '20',
  94. first: '1',
  95. top: '1',
  96. },
  97. {
  98. key:3,
  99. title:'南昌XXXXX公司',
  100. stPorject: '军工',
  101. adree: '江西南昌',
  102. time: '2019',
  103. user: '吴工',
  104. iphone: '13728469721',
  105. state: '20',
  106. first: '1',
  107. top: '1',
  108. },
  109. ]
  110. }
  111. }
  112. //删除按钮
  113. delete(id){
  114. this.state.dataSource.splice(id,1)
  115. this.setState({
  116. dataSource: this.state.dataSource
  117. })
  118. }
  119. render() {
  120. return (
  121. <div className="user-content">
  122. <div className="content-title">
  123. <span>页头内容</span>
  124. <div className="user-search">
  125. <Input
  126. placeholder="请输入关键字"
  127. style={{ width: '150px', marginRight: '10px', marginBottom: '10px' }}
  128. value={this.state.nameSearch}
  129. onChange={(e) => {
  130. this.setState({ nameSearch: e.target.value });
  131. }}
  132. />
  133. <Button type="primary" style={{ marginRight: '10px' }}>
  134. 搜索
  135. </Button>
  136. <Button style={{ marginRight: '10px' }}>
  137. 重置
  138. </Button>
  139. <Button type="primary" style={{}}>
  140. +新增类型
  141. </Button>
  142. </div>
  143. <div className="patent-table">
  144. <Spin spinning={this.state.loading}>
  145. <Table
  146. columns={this.state.columns}
  147. dataSource={this.state.dataSource}
  148. pagination={this.state.pagination}
  149. onRowClick={this.tableRowClick}
  150. bordered
  151. ellipsis="true"
  152. />
  153. </Spin>
  154. </div>
  155. </div>
  156. </div>)
  157. }
  158. }