Преглед на файлове

修改框架布局和养护云造价列表修改

outaozhen преди 5 години
родител
ревизия
be4f224f9e

+ 15 - 0
mock/curinglist.js

@@ -0,0 +1,15 @@
+const curinglist = [
+  {
+    key:'1',
+    productname:'重庆养护(2018)',
+    majorcont:'已升级(@刘飞 6月5日 13:32)'
+  },
+  {
+    key:'2',
+    productname:'广东养护(2018)',
+    majorcont:''
+  },
+]
+export default {
+  'GET /api/curinglist': curinglist
+}

+ 23 - 19
src/components/PopContent/Contacts/ContanctLowerList.jsx

@@ -44,29 +44,33 @@ const ContanctLowerList = props =>  {
   ]
   return (
     <div>
-      <div className="sheet-panel-record zh-pd-left-15">
+      <div className="zh-pd-left-15">
         <Tabs type="card">
           <TabPane tab="服务记录" key="服务记录">
-            <Table
-              columns={servicecolumns}
-              dataSource={servicelist}
-              pagination={false}
-            />
+            <div className="sheet-panel-record">
+              <Table
+                columns={servicecolumns}
+                dataSource={servicelist}
+                pagination={false}
+              />
+            </div>
           </TabPane>
           <TabPane tab="日志" key="日志">
-            <List
-              dataSource={journallist}
-              split={false}
-              renderItem={item => (
-                <List.Item>
-                  <List.Item.Meta
-                    // avatar=
-                    title={item.operation}
-                    description={item.date}
-                  />
-                </List.Item>
-              )}
-            />
+            <div className="sheet-panel-record">
+              <List
+                dataSource={journallist}
+                split={false}
+                renderItem={item => (
+                  <List.Item>
+                    <List.Item.Meta
+                      // avatar=
+                      title={item.operation}
+                      description={item.date}
+                    />
+                  </List.Item>
+                )}
+              />
+            </div>
           </TabPane>
         </Tabs>
       </div>

+ 51 - 13
src/components/PopContent/Contacts/ContanctTabList.jsx

@@ -1,30 +1,68 @@
 import {
   Tabs,
-  Button
+  Button,
+  Table
 } from 'antd'
 import React, { useEffect } from 'react'
 import SvgIcon from '@/components/SvgIcon'
+import { connect } from 'umi'
 
-const ContanctTabList = () =>  {
+const ContanctTabList = props =>  {
   useEffect(() => {
-  }, [])
+    const curinglisData = () => {
+      const { dispatch } = props
+      dispatch({
+        type: 'curinglist/fetch'
+      }) // 派发出这个action就会调用contact中的fetch函数,然后就会请求数据
+    }
+    curinglisData()
+  },[])
+  const {
+    curinglistName
+  } = props
+  const curinglist = [ ...curinglistName.list ]
+  // console.log(curinglist)
   const { TabPane } = Tabs
+  const curingcolumns = [
+    {
+      title: '产品',
+      dataIndex: 'productname',
+      key: 'productname'
+    },
+    {
+      title: '专业版',
+      dataIndex: 'majorcont',
+      key: 'majorcont'
+    }
+  ]
   return (
     <div>
-      <div className="sheet-right-panel zh-pd-left-15">
+      <div className="zh-pd-left-15">
         {/* <Tabs onChange={callback} type="card"> */}
         <Tabs type="card">
           <TabPane tab="养护云造价" key="养护云造价">
-            Content of Tab Pane 1
+            <div className="sheet-right-panel">
+              <Table
+                columns={curingcolumns}
+                dataSource={curinglist}
+                pagination={false}
+              />
+            </div>
           </TabPane>
           <TabPane tab="大司空云计价" key="大司空云计价">
-            Content of Tab Pane 2
+            <div className="sheet-right-panel">
+            大司空云计价
+            </div>
           </TabPane>
           <TabPane tab="软件锁" key="软件锁">
-            Content of Tab Pane 3
+            <div className="sheet-right-panel">
+            软件锁
+            </div>
           </TabPane>
           <TabPane tab="通行账号" key="通行账号">
-            Content of Tab Pane 3
+            <div className="sheet-right-panel">
+            通行账号
+            </div>
           </TabPane>
         </Tabs>
       </div>
@@ -37,9 +75,9 @@ const ContanctTabList = () =>  {
   )
 }
 
-export default ContanctTabList
+// export default ContanctTabList
 
-// export default connect(({ journallist, loading }) => ({
-//   journalName: journallist,
-//   getlist: loading.effects['journallist/fetch']
-// }))(ContanctTabList)
+export default connect(({ curinglist, loading }) => ({
+  curinglistName: curinglist,
+  getlist: loading.effects['curinglist/fetch']
+}))(ContanctTabList)

+ 2 - 2
src/components/PopContent/index.scss

@@ -5,7 +5,7 @@
   overflow-y: auto;
 }
 .sheet-right-panel {
-  height: 385px;
+  height: 340px;
   overflow-x: hidden;
   overflow-y: auto;
 }
@@ -13,7 +13,7 @@
   height: 54px;
 }
 .sheet-panel-record {
-  height: 395px;
+  height: 340px;
   overflow-x: hidden;
   overflow-y: auto;
 }

+ 28 - 0
src/models/curinglist.js

@@ -0,0 +1,28 @@
+import { queryCuringcont } from '@/services/curinglist'
+
+export default {
+  namespace: 'curinglist',
+  state: {
+    list: []
+  },
+  // 用于处理异步操作和业务逻辑,由action触发,但不能修改state
+  effects: {
+    *fetch({ payload }, { call, put }) {
+      const response = yield call(queryCuringcont, 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
+      }
+    }
+  }
+}

+ 1 - 1
src/pages/Customer/Contact/index.jsx

@@ -275,7 +275,7 @@ const Contact = props => {
 
   return (
     // <PageHeaderWrapper></PageHeaderWrapper>
-    <div className="zh-pd-24">
+    <div>
       <ProTable
         className="auto-scroll-y"
         size="middle"

+ 5 - 0
src/services/curinglist.js

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