index.jsx 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. import {
  2. Button,
  3. Drawer,
  4. Form,
  5. Input,
  6. Row,
  7. Col,
  8. Tabs,
  9. Cascader,
  10. Select,
  11. Tag,
  12. List,
  13. Typography
  14. } from 'antd'
  15. import React, { useState, useEffect } from 'react'
  16. import { connect } from 'dva'
  17. import SvgIcon from '@/components/SvgIcon'
  18. import styles from './index.less'
  19. const Popcontactform = props => {
  20. // 浏览器实际宽度
  21. const [clientWidth, setClientWidth] = useState(document.body.clientWidth * 0.75)
  22. useEffect(() => {
  23. const journallistData = () => {
  24. const { dispatch } = props
  25. dispatch({
  26. type: 'journallist/fetch'
  27. }) // 派发出这个action就会调用contact中的fetch函数,然后就会请求数据
  28. }
  29. journallistData()
  30. window.addEventListener('resize', () => {
  31. setClientWidth(document.body.clientWidth * 0.7)
  32. })
  33. return () => {
  34. window.removeEventListener('resize', () => {})
  35. }
  36. }, [])
  37. const {
  38. visible,
  39. onClose,
  40. onCreate,
  41. journalName: { list }
  42. } = props
  43. const journallist = [...list]
  44. // console.log(journallist)
  45. const [form] = Form.useForm()
  46. const { TabPane } = Tabs
  47. // function callback(key) {
  48. // console.log(key)
  49. // }
  50. const residences = [
  51. {
  52. value: '广东省',
  53. label: '广东省',
  54. children: [
  55. {
  56. value: '珠海市',
  57. label: '珠海市',
  58. children: [
  59. {
  60. value: '香洲区',
  61. label: '香洲区'
  62. }
  63. ]
  64. }
  65. ]
  66. },
  67. {
  68. value: '安徽省',
  69. label: '安徽省',
  70. children: [
  71. {
  72. value: '合肥市',
  73. label: '合肥市',
  74. children: [
  75. {
  76. value: '庐阳区',
  77. label: '庐阳区'
  78. }
  79. ]
  80. }
  81. ]
  82. }
  83. ]
  84. const servicedata = [
  85. '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。',
  86. '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。',
  87. '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。',
  88. '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
  89. // '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
  90. ]
  91. // const journallist = [
  92. // 'Racing car sprays burning fuel into crowd.',
  93. // 'Japanese princess to wed commoner.',
  94. // 'Australian walks 100km after outback crash.',
  95. // 'Man charged over missing wedding girl.',
  96. // 'Los Angeles battles huge wildfires.'
  97. // ]
  98. return (
  99. <div>
  100. <div className="sheet-box">
  101. <Drawer
  102. title="联系人"
  103. placement="right"
  104. width={clientWidth}
  105. closable
  106. onClose={onClose}
  107. visible={visible}
  108. // mask={false}
  109. >
  110. <Row>
  111. <Col span={12} className="sheet-box-left">
  112. <div className="sheet-left-panel pr-4">
  113. <Row>
  114. <Col span={12}>
  115. <h2>刘泽富</h2>
  116. </Col>
  117. <Col span={12} className={['text-right', styles.textMuted]}>
  118. 陈特 创建于 2019年5月6日 14:55
  119. </Col>
  120. </Row>
  121. <Form layout="vertical" form={form}>
  122. <Form.Item
  123. label="姓名"
  124. name="clientname"
  125. rules={[{ required: false, message: '姓名' }]}>
  126. <Input value="刘泽富" />
  127. </Form.Item>
  128. <Form.Item
  129. label="联系人地区"
  130. name="local"
  131. rules={[{ required: false, message: '地区' }]}>
  132. <Cascader options={residences} />
  133. </Form.Item>
  134. <Form.Item
  135. label="客户名称"
  136. name="companyname"
  137. rules={[{ required: false, message: '客户名称' }]}>
  138. <Input value="刘泽富" />
  139. </Form.Item>
  140. <Row gutter={16}>
  141. <Col span={12}>
  142. <Form.Item
  143. label="性别"
  144. name=""
  145. rules={[{ required: false, message: '性别' }]}>
  146. <Select>
  147. <Select.Option value="男">男</Select.Option>
  148. <Select.Option value="女">女</Select.Option>
  149. </Select>
  150. </Form.Item>
  151. </Col>
  152. <Col span={12}>
  153. <Form.Item
  154. label="昵称"
  155. name=""
  156. rules={[{ required: false, message: '昵称' }]}>
  157. <Input value="" />
  158. </Form.Item>
  159. </Col>
  160. </Row>
  161. <Row gutter={16}>
  162. <Col span={12}>
  163. <Form.Item
  164. label="手机"
  165. name=""
  166. rules={[{ required: false, message: '手机' }]}>
  167. <Input value="" />
  168. </Form.Item>
  169. </Col>
  170. <Col span={12}>
  171. <Form.Item label="QQ" name="" rules={[{ required: false, message: 'QQ' }]}>
  172. <Input value="" />
  173. </Form.Item>
  174. </Col>
  175. </Row>
  176. <Row gutter={16}>
  177. <Col span={12}>
  178. <Form.Item
  179. label="电话"
  180. name=""
  181. rules={[{ required: false, message: '电话' }]}>
  182. <Input value="" />
  183. </Form.Item>
  184. </Col>
  185. <Col span={12}>
  186. <Form.Item
  187. label="邮箱"
  188. name=""
  189. rules={[{ required: false, message: '邮箱' }]}>
  190. <Input value="" />
  191. </Form.Item>
  192. </Col>
  193. </Row>
  194. <Row gutter={16}>
  195. <Col span={12}>
  196. <Form.Item
  197. label="传真"
  198. name=""
  199. rules={[{ required: false, message: '传真' }]}>
  200. <Input value="" />
  201. </Form.Item>
  202. </Col>
  203. <Col span={12} />
  204. </Row>
  205. <Row gutter={16}>
  206. <Col span={12}>
  207. <Form.Item
  208. label="部门"
  209. name=""
  210. rules={[{ required: false, message: '部门' }]}>
  211. <Input value="" />
  212. </Form.Item>
  213. </Col>
  214. <Col span={12}>
  215. <Form.Item
  216. label="职务"
  217. name=""
  218. rules={[{ required: false, message: '职务' }]}>
  219. <Input value="" />
  220. </Form.Item>
  221. </Col>
  222. </Row>
  223. <Form.Item
  224. label="办公室"
  225. name=""
  226. rules={[{ required: false, message: '办公室' }]}>
  227. <Input value="" />
  228. </Form.Item>
  229. <Form.Item
  230. label="联系人地址"
  231. name=""
  232. rules={[{ required: false, message: '联系人地址' }]}>
  233. <Input value="" />
  234. </Form.Item>
  235. <Form.Item
  236. label="联系人乘车"
  237. name=""
  238. rules={[{ required: false, message: '联系人乘车' }]}>
  239. <Input value="" />
  240. </Form.Item>
  241. <Form.Item
  242. label="联系人地标"
  243. name=""
  244. rules={[{ required: false, message: '联系人地标' }]}>
  245. <Input value="" />
  246. </Form.Item>
  247. <Form.Item
  248. label="联系人住宿"
  249. name=""
  250. rules={[{ required: false, message: '联系人住宿' }]}>
  251. <Input value="" />
  252. </Form.Item>
  253. <Form.Item label="备注" name="" rules={[{ required: false, message: '备注' }]}>
  254. <Input value="" />
  255. </Form.Item>
  256. <Form.Item label="个人标签">
  257. <span className="ant-form-text">
  258. <Tag color="#16A085">标签</Tag>
  259. <Tag color="#2980B9">特别关注</Tag>
  260. </span>
  261. </Form.Item>
  262. <Form.Item label="协作标签">
  263. <span className="ant-form-text">
  264. <Tag color="#F8AC59">协作标签1</Tag>
  265. <Tag color="#FF69B4">协作标签2</Tag>
  266. </span>
  267. </Form.Item>
  268. </Form>
  269. <Button
  270. type="primary"
  271. className="ant-btn ant-btn-primary"
  272. onClick={() => {
  273. form
  274. .validateFields()
  275. .then(values => {
  276. onCreate(values)
  277. })
  278. .catch(err => {
  279. console.log(err)
  280. })
  281. }}>
  282. 确定
  283. </Button>
  284. </div>
  285. </Col>
  286. <Col span={12}>
  287. <div className="sheet-right-panel pl-4">
  288. {/* <Tabs onChange={callback} type="card"> */}
  289. <Tabs type="card">
  290. <TabPane tab="养护云造价" key="养护云造价">
  291. Content of Tab Pane 1
  292. </TabPane>
  293. <TabPane tab="大司空云计价" key="大司空云计价">
  294. Content of Tab Pane 2
  295. </TabPane>
  296. <TabPane tab="软件锁" key="软件锁">
  297. Content of Tab Pane 3
  298. </TabPane>
  299. <TabPane tab="通行账号" key="通行账号">
  300. Content of Tab Pane 3
  301. </TabPane>
  302. </Tabs>
  303. </div>
  304. <div className="sheet-btns pl-4 pt-4">
  305. <Button type="primary" ghost>
  306. <SvgIcon type="icon-link" /> 绑定加密锁
  307. </Button>
  308. </div>
  309. <div className="sheet-panel-record pl-4">
  310. <Tabs type="card">
  311. <TabPane tab="服务记录" key="服务记录">
  312. <List
  313. dataSource={servicedata}
  314. split={false}
  315. renderItem={item => (
  316. <List.Item>
  317. <Typography.Text mark />
  318. {item}
  319. </List.Item>
  320. )}
  321. />
  322. </TabPane>
  323. <TabPane tab="日志" key="日志">
  324. <List
  325. // dataSource={listdata}
  326. dataSource={journallist}
  327. split={false}
  328. renderItem={item => (
  329. <List.Item>
  330. <List.Item.Meta
  331. // avatar=
  332. title={item.operation}
  333. description={item.date}
  334. />
  335. </List.Item>
  336. )}
  337. />
  338. </TabPane>
  339. </Tabs>
  340. </div>
  341. </Col>
  342. </Row>
  343. </Drawer>
  344. </div>
  345. </div>
  346. )
  347. }
  348. // export default Popcontactform
  349. export default connect(({ journallist, loading }) => ({
  350. journalName: journallist,
  351. getlist: loading.effects['journallist/fetch']
  352. }))(Popcontactform)