Jelajahi Sumber

Merge branch 'tcld'

outaozhen 5 tahun lalu
induk
melakukan
7d137b65fd

+ 2 - 2
config/defaultSettings.js

@@ -9,7 +9,7 @@ const proSettings = {
   colorWeak: false,
   title: '产品',
   pwa: false,
-  iconfontUrl: '//at.alicdn.com/t/font_2276974_cbxec9p4wcq.js',
-  splitMenus: true,
+  iconfontUrl: '//at.alicdn.com/t/font_2276974_kpk5a8k5m2.js',
+  splitMenus: true
 }
 export default proSettings

+ 2 - 2
config/routes.js

@@ -50,13 +50,13 @@ export default [
                   path: '/customer/contact',
                   name: 'contact',
                   icon: 'icon-address-book-o',
-                  component: './Customer/contact',
+                  component: './Customer/Contact',
                 },
                 {
                   path: '/customer/company',
                   name: 'company',
                   icon: 'icon-building',
-                  component: './Customer/company',
+                  component: './Customer/Company',
                 },
               ],
             },

+ 17 - 0
mock/journallist.js

@@ -0,0 +1,17 @@
+const journal = [
+  {
+    title: 'Ant Design Title 1'
+  },
+  {
+    title: 'Ant Design Title 2'
+  },
+  {
+    title: 'Ant Design Title 3'
+  },
+  {
+    title: 'Ant Design Title 4'
+  },
+]
+export default {
+  'GET /api/journallist': journal
+}

+ 5 - 2
src/assets/css/common.less

@@ -7,6 +7,9 @@
 .pl-4{
   padding-left: 1.5rem;
 }
+.pt-4{
+  padding-bottom: 1.5rem;
+}
 .sheet-left-panel{
   height: 834px;
   overflow-x: hidden;
@@ -18,10 +21,10 @@
   overflow-y: auto;
 }
 .sheet-btns{
-  height: 24px;
+  height: 54px;
 }
 .sheet-panel-record{
-  height: 300px;
+  height: 395px;
   overflow-x: hidden;
   overflow-y: auto;
 }

+ 245 - 197
src/components/PopContactForm/index.jsx

@@ -1,11 +1,33 @@
-import { Button, Drawer, Form, Input,Row, Col, Tabs, Cascader, Select, Tag, List, Typography, Icon } from 'antd'
+import {
+  Button,
+  Drawer,
+  Form,
+  Input,
+  Row,
+  Col,
+  Tabs,
+  Cascader,
+  Select,
+  Tag,
+  List,
+  Typography
+} from 'antd'
 import React, { useState, useEffect } from 'react'
+import { connect } from 'dva'
+import SvgIcon from '@/components/SvgIcon'
 import styles from './index.less'
 
-const Popcontactform = props => {
+const Popcontactform = (props) => {
   // 浏览器实际宽度
   const [ clientWidth, setClientWidth ] = useState(document.body.clientWidth * 0.75)
   useEffect(() => {
+    const journallistData = () => {
+      const { dispatch } = props
+      dispatch({
+        type: 'journallist/fetch'
+      })// 派发出这个action就会调用contact中的fetch函数,然后就会请求数据
+    }
+    journallistData()
     window.addEventListener('resize', () => {
       setClientWidth(document.body.clientWidth * 0.7)
     })
@@ -13,12 +35,19 @@ const Popcontactform = props => {
       window.removeEventListener('resize')
     }
   }, [])
-  const { visible, onClose, onCreate } = props
+  const {
+    visible,
+    onClose,
+    onCreate,
+    journalName: { list }
+  } = props
+  const journallist = [ ...list ]
+  console.log(journallist)
   const [ form ] = Form.useForm()
   const { TabPane } = Tabs
-  function callback(key) {
-    console.log(key)
-  }
+  // function callback(key) {
+  //   console.log(key)
+  // }
   const residences = [
     {
       value: '广东省',
@@ -53,13 +82,20 @@ const Popcontactform = props => {
       ]
     }
   ]
-  const listdata = [
-    'Racing car sprays burning fuel into crowd.',
-    'Japanese princess to wed commoner.',
-    'Australian walks 100km after outback crash.',
-    'Man charged over missing wedding girl.',
-    'Los Angeles battles huge wildfires.'
+  const servicedata = [
+    '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。',
+    '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。',
+    '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。',
+    '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
+    // '1-给彭工更新了软件程序,安装演示了软。2-单位彭工要考甲乙级考试,给他带了资料过去。3-表示论文发表评职称也可以随时联系我。'
   ]
+  // const journallist = [
+  //   'Racing car sprays burning fuel into crowd.',
+  //   'Japanese princess to wed commoner.',
+  //   'Australian walks 100km after outback crash.',
+  //   'Man charged over missing wedding girl.',
+  //   'Los Angeles battles huge wildfires.'
+  // ]
   return (
     <div>
       <div className="sheet-box">
@@ -75,222 +111,230 @@ const Popcontactform = props => {
           <Row>
             <Col span={12} className="sheet-box-left">
               <div className="sheet-left-panel pr-4">
-              <Row>
-                <Col span={12}><h2>刘泽富</h2></Col>
-                <Col span={12} className={[ "text-right",styles.textMuted ]}>陈特 创建于 2019年5月6日 14:55</Col>
-              </Row>
-              <Form layout="vertical" form={form}>
-                <Form.Item
-                  label="姓名"
-                  name="clientname"
-                  rules={[ { required: false, message: '姓名' } ]}
-                  >
-                  <Input value="刘泽富" />
-                </Form.Item>
-                <Form.Item
-                  label="联系人地区"
-                  name="local"
-                  rules={[ { required: false, message: '地区' } ]}
-                  >
-                  <Cascader options={residences} />
-                </Form.Item>
-                <Form.Item
-                  label="客户名称"
-                  name="companyname"
-                  rules={[ { required: false, message: '客户名称' } ]}
-                  >
-                  <Input value="刘泽富" />
-                </Form.Item>
-                <Row gutter={16}>
+                <Row>
                   <Col span={12}>
-                    <Form.Item
-                    label="性别"
-                    name=""
-                    rules={[ { required: false, message: '性别' } ]}
-                    >
-                    <Select>
-                      <Select.Option value="男">男</Select.Option>
-                      <Select.Option value="女">女</Select.Option>
-                    </Select>
-                    </Form.Item>
+                    <h2>刘泽富</h2>
                   </Col>
-                  <Col span={12}>
-                  <Form.Item
-                    label="昵称"
-                    name=""
-                    rules={[ { required: false, message: '昵称' } ]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
+                  <Col span={12} className={[ 'text-right', styles.textMuted ]}>
+                    陈特 创建于 2019年5月6日 14:55
                   </Col>
                 </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="手机"
-                    name=""
-                    rules={[ { required: false, message: '手机' } ]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
-                  </Col>
-                  <Col span={12}>
+                <Form layout="vertical" form={form}>
                   <Form.Item
-                    label="QQ"
-                    name=""
-                    rules={[ { required: false, message: 'QQ' } ]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="电话"
+                    label="姓名"
+                    name="clientname"
+                    rules={[ { required: false, message: '姓名' } ]}>
+                    <Input value="刘泽富" />
+                  </Form.Item>
+                  <Form.Item
+                    label="联系人地区"
+                    name="local"
+                    rules={[ { required: false, message: '地区' } ]}>
+                    <Cascader options={residences} />
+                  </Form.Item>
+                  <Form.Item
+                    label="客户名称"
+                    name="companyname"
+                    rules={[ { required: false, message: '客户名称' } ]}>
+                    <Input value="刘泽富" />
+                  </Form.Item>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="性别"
+                        name=""
+                        rules={[ { required: false, message: '性别' } ]}>
+                        <Select>
+                          <Select.Option value="男">男</Select.Option>
+                          <Select.Option value="女">女</Select.Option>
+                        </Select>
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item
+                        label="昵称"
+                        name=""
+                        rules={[ { required: false, message: '昵称' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="手机"
+                        name=""
+                        rules={[ { required: false, message: '手机' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item label="QQ" name="" rules={[ { required: false, message: 'QQ' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="电话"
+                        name=""
+                        rules={[ { required: false, message: '电话' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item
+                        label="邮箱"
+                        name=""
+                        rules={[ { required: false, message: '邮箱' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="传真"
+                        name=""
+                        rules={[ { required: false, message: '传真' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12} />
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="部门"
+                        name=""
+                        rules={[ { required: false, message: '部门' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item
+                        label="职务"
+                        name=""
+                        rules={[ { required: false, message: '职务' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Form.Item
+                    label="办公室"
                     name=""
-                    rules={[ { required: false, message: '电话' } ]}
-                    >
+                    rules={[ { required: false, message: '办公室' } ]}>
                     <Input value="" />
-                    </Form.Item>
-                  </Col>
-                  <Col span={12}>
+                  </Form.Item>
                   <Form.Item
-                    label="邮箱"
+                    label="联系人地址"
                     name=""
-                    rules={[ { required: false, message: '邮箱' } ]}
-                    >
+                    rules={[ { required: false, message: '联系人地址' } ]}>
                     <Input value="" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="传真"
+                  </Form.Item>
+                  <Form.Item
+                    label="联系人乘车"
                     name=""
-                    rules={[ { required: false, message: '传真' } ]}
-                    >
+                    rules={[ { required: false, message: '联系人乘车' } ]}>
                     <Input value="" />
-                    </Form.Item>
-                  </Col>
-                  <Col span={12}/>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="部门"
+                  </Form.Item>
+                  <Form.Item
+                    label="联系人地标"
                     name=""
-                    rules={[ { required: false, message: '部门' } ]}
-                    >
+                    rules={[ { required: false, message: '联系人地标' } ]}>
                     <Input value="" />
-                    </Form.Item>
-                  </Col>
-                  <Col span={12}>
+                  </Form.Item>
                   <Form.Item
-                    label="职务"
+                    label="联系人住宿"
                     name=""
-                    rules={[ { required: false, message: '职务' } ]}
-                    >
+                    rules={[ { required: false, message: '联系人住宿' } ]}>
                     <Input value="" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Form.Item
-                  label="办公室"
-                  name=""
-                  rules={[ { required: false, message: '办公室' } ]}
-                  >
-                  <Input value="" />
-                </Form.Item>
-                <Form.Item
-                  label="联系人地址"
-                  name=""
-                  rules={[ { required: false, message: '联系人地址' } ]}
-                  >
-                  <Input value="" />
-                </Form.Item>
-                <Form.Item
-                  label="联系人乘车"
-                  name=""
-                  rules={[ { required: false, message: '联系人乘车' } ]}
-                  >
-                  <Input value="" />
-                </Form.Item>
-                <Form.Item
-                  label="联系人地标"
-                  name=""
-                  rules={[ { required: false, message: '联系人地标' } ]}
-                  >
-                  <Input value="" />
-                </Form.Item>
-                <Form.Item
-                  label="联系人住宿"
-                  name=""
-                  rules={[ { required: false, message: '联系人住宿' } ]}
-                  >
-                  <Input value="" />
-                </Form.Item>
-                <Form.Item
-                  label="备注"
-                  name=""
-                  rules={[ { required: false, message: '备注' } ]}
-                  >
-                  <Input value="" />
-                </Form.Item>
-                <Form.Item label="个人标签">
-                  <span className="ant-form-text"><Tag color="#16A085">标签</Tag><Tag color="#2980B9">特别关注</Tag></span>
-                </Form.Item>
-                <Form.Item label="协作标签">
-                  <span className="ant-form-text"><Tag color="#F8AC59">协作标签1</Tag><Tag color="#FF69B4">协作标签2</Tag></span>
-                </Form.Item>
-              </Form>
-              <Button
-                type="primary"
-                className="ant-btn ant-btn-primary"
-                onClick={() => {
-                  form
-                    .validateFields()
-                    .then(values => {
-                      onCreate(values)
-                    })
-                    .catch(err => {
-                      console.log(err)
-                    })
-                }}>
-                确定
-              </Button>
+                  </Form.Item>
+                  <Form.Item label="备注" name="" rules={[ { required: false, message: '备注' } ]}>
+                    <Input value="" />
+                  </Form.Item>
+                  <Form.Item label="个人标签">
+                    <span className="ant-form-text">
+                      <Tag color="#16A085">标签</Tag>
+                      <Tag color="#2980B9">特别关注</Tag>
+                    </span>
+                  </Form.Item>
+                  <Form.Item label="协作标签">
+                    <span className="ant-form-text">
+                      <Tag color="#F8AC59">协作标签1</Tag>
+                      <Tag color="#FF69B4">协作标签2</Tag>
+                    </span>
+                  </Form.Item>
+                </Form>
+                <Button
+                  type="primary"
+                  className="ant-btn ant-btn-primary"
+                  onClick={() => {
+                    form
+                      .validateFields()
+                      .then(values => {
+                        onCreate(values)
+                      })
+                      .catch(err => {
+                        console.log(err)
+                      })
+                  }}>
+                  确定
+                </Button>
               </div>
             </Col>
             <Col span={12}>
               <div className="sheet-right-panel pl-4">
-                <Tabs onChange={callback} type="card">
-                  <TabPane tab="养护云造价" key="1">
+                {/* <Tabs onChange={callback} type="card"> */}
+                <Tabs type="card">
+                  <TabPane tab="养护云造价" key="养护云造价">
                     Content of Tab Pane 1
                   </TabPane>
-                  <TabPane tab="大司空云计价" key="2">
+                  <TabPane tab="大司空云计价" key="大司空云计价">
                     Content of Tab Pane 2
                   </TabPane>
-                  <TabPane tab="软件锁" key="3">
+                  <TabPane tab="软件锁" key="软件锁">
                     Content of Tab Pane 3
                   </TabPane>
-                  <TabPane tab="通行账号" key="4">
+                  <TabPane tab="通行账号" key="通行账号">
                     Content of Tab Pane 3
                   </TabPane>
                 </Tabs>
               </div>
-              <div className="sheet-btns">
-                <a><Icon type="icon-plus1" /> 绑定加密锁</a>
+              <div className="sheet-btns pl-4 pt-4">
+                <Button type="primary" ghost>
+                  <SvgIcon type="icon-link" /> 绑定加密锁
+                </Button>
               </div>
-              <div className="sheet-panel-record">
-                <List
-                dataSource={listdata}
-                  renderItem={item => (
-                    <List.Item>
-                      <Typography.Text mark>[ITEM]</Typography.Text> {item}
-                    </List.Item>
-                  )}
-                />
+              <div className="sheet-panel-record pl-4">
+                <Tabs type="card">
+                  <TabPane tab="服务记录" key="服务记录">
+                    <List
+                      dataSource={servicedata}
+                      split={false}
+                      renderItem={item => (
+                        <List.Item>
+                          <Typography.Text mark />
+                          {item}
+                        </List.Item>
+                      )}
+                    />
+                  </TabPane>
+                  <TabPane tab="日志" key="日志">
+                    <List
+                      // dataSource={listdata}
+                      dataSource={journallist}
+                      split={false}
+                      renderItem={item => (
+                        <List.Item>
+                          <Typography.Text mark />
+                          {item}
+                        </List.Item>
+                      )}
+                    />
+                  </TabPane>
+                </Tabs>
               </div>
             </Col>
           </Row>
@@ -300,4 +344,8 @@ const Popcontactform = props => {
   )
 }
 
-export default Popcontactform
+// export default Popcontactform
+export default connect(({ journallist, loading }) => ({
+  journalName: journallist,
+  getlist: loading.effects['journallist/fetch']
+}))(Popcontactform)

+ 28 - 0
src/models/journallist.js

@@ -0,0 +1,28 @@
+import { queryJournal } from '@/services/journallist'
+
+export default {
+  namespace: 'journallist',
+  state: {
+    list: []
+  },
+  // 用于处理异步操作和业务逻辑,由action触发,但不能修改state
+  effects: {
+    *fetch({ payload }, { call, put }) {
+      const response = yield call(queryJournal, payload)
+      yield put({
+        type: 'show',
+        payload: response
+      })
+    }
+  },
+  // reducers:用于处理同步操作,由action触发,可修改state
+  reducers: {
+    // action:是由reducers及effects的触发器,一般是第一个对象,如:{type:'add',payload:todo}
+    show(state, action) {
+      return {
+        ...state,
+        list: action.payload
+      }
+    }
+  }
+}

+ 13 - 0
src/pages/Customer/Company/index.jsx

@@ -0,0 +1,13 @@
+import React from 'react'
+import { Card } from 'antd'
+
+const Company = () => {
+  // const { modalVisible, onCancel } = props;
+  return (
+    <Card bordered={false}>
+      dasdasddad
+    </Card>
+  )
+}
+
+export default Company

+ 3 - 3
src/pages/Customer/contact.jsx

@@ -214,9 +214,9 @@ const Contact = props => {
   const {
     contactName: { list }
   } = props // 将contact中的pros.list命名为list
-  // const dataSource = [...list];
+  const contanctlist = [ ...list ]
   // console.log(props);
-  // console.log(list);
+  // console.log(list)
   // console.log(dataSource);
   const [columnsStateMap, setColumnsStateMap] = useState({
     telephone: {
@@ -261,7 +261,7 @@ const Contact = props => {
       <ProTable
         size="middle"
         columns={columns}
-        dataSource={list}
+        dataSource={contanctlist}
         pagination={{ pageSize: 8 }}
         search={false}
         options={{

+ 0 - 146
src/pages/Customer/company.jsx

@@ -1,146 +0,0 @@
-import React from 'react'
-// import { PageHeaderWrapper } from '@ant-design/pro-layout';
-import { Card } from 'antd'
-// import { PlusOutlined, EllipsisOutlined } from '@ant-design/icons';
-// import ProTable, { TableDropdown } from '@ant-design/pro-table';
-// import request from 'umi-request';
-
-// class Lockstore extends React.Component {
-//   render() {
-//     const columns = [
-//       // {
-//       //     dataIndex: 'index',
-//       //     valueType: 'indexBorder',
-//       //     width: 48,
-//       // },
-//       {
-//         title: '标题',
-//         dataIndex: 'title',
-//         copyable: true,
-//         ellipsis: true,
-//         tip: '标题过长会自动收缩',
-//         formItemProps: {
-//           rules: [
-//             {
-//               required: true,
-//               message: '此项为必填项',
-//             },
-//           ],
-//         },
-//         width: '30%',
-//       },
-//       {
-//         title: '状态',
-//         dataIndex: 'state',
-//         initialValue: 'open',
-//         filters: true,
-//         onFilter: true,
-//         valueType: 'select',
-//         valueEnum: {
-//           all: { text: '全部', status: 'Default' },
-//           open: {
-//             text: '未解决',
-//             status: 'Error',
-//           },
-//           closed: {
-//             text: '已解决',
-//             status: 'Success',
-//             disabled: true,
-//           },
-//           processing: {
-//             text: '解决中',
-//             status: 'Processing',
-//           },
-//         },
-//       },
-//       {
-//         title: '标签',
-//         dataIndex: 'labels',
-//         renderFormItem: (_, { defaultRender }) => {
-//           return defaultRender(_);
-//         },
-//         render: (_, record) => (
-//           <Space>
-//             {record.labels.map(({ name, color }) => (
-//               <Tag color={color} key={name}>
-//                 {name}
-//               </Tag>
-//             ))}
-//           </Space>
-//         ),
-//       },
-//       {
-//         title: '创建时间',
-//         key: 'created_at',
-//         dataIndex: 'created_at',
-//         valueType: 'date',
-//       },
-//       {
-//         title: '操作',
-//         valueType: 'option',
-//         render: (text, record, _, action) => [
-//           <a
-//             key="editable"
-//             onClick={() => {
-//               var _a;
-//               (_a = action.startEditable) === null || _a === void 0
-//                 ? void 0
-//                 : _a.call(action, record.id);
-//             }}
-//           >
-//             编辑
-//           </a>,
-//           <a href={record.url} target="_blank" rel="noopener noreferrer" key="view">
-//             查看
-//           </a>,
-//           <TableDropdown
-//             key="actionGroup"
-//             onSelect={() => action.reload()}
-//             menus={[
-//               { key: 'copy', name: '复制' },
-//               { key: 'delete', name: '删除' },
-//             ]}
-//           />,
-//         ],
-//       },
-//     ];
-
-//     return (
-//       <Card bordered={false}>
-//         <ProTable
-//           columns={columns}
-//           request={async (params = {}) =>
-//             request('https://proapi.azurewebsites.net/github/issues', {
-//               params,
-//             })
-//           }
-//           // editable={{type: 'multiple',}}
-//           rowKey="id"
-//           // search={{labelWidth: 'auto',}}
-//           pagination={{ pageSize: 10 }}
-//           // dateFormatter="string"
-//           headerTitle="联系人"
-//           toolBarRender={() => [
-//             <Button key="button" icon={<PlusOutlined />} type="primary">
-//               客户
-//             </Button>,
-//           ]}
-//         />
-//       </Card>
-//     );
-//   }
-// }
-
-// export default Lockstore;
-
-
-const Company = () => {
-  // const { modalVisible, onCancel } = props;
-  return (
-    <Card bordered={false}>
-      dasdasd
-    </Card>
-  )
-}
-
-export default Company

+ 0 - 3
src/pages/Customer/customer.less

@@ -1,4 +1 @@
 @import '~antd/es/style/themes/default.less';
-.formTextmuted{
-  color: #868e96 !important;
-}

+ 5 - 0
src/services/journallist.js

@@ -0,0 +1,5 @@
+import request from '@/utils/request'
+
+export async function queryJournal(){
+    return request('/api/journallist')// 请求/api/journallist 端口数据的函数 queryJournal
+}