Преглед изворни кода

feat: 仪表盘卡片详情报错

lanjianrong пре 5 година
родитељ
комит
24e31d3502
1 измењених фајлова са 71 додато и 71 уклоњено
  1. 71 71
      src/pages/workbench/Dashboard/components/RatioPanels.jsx

+ 71 - 71
src/pages/workbench/Dashboard/components/RatioPanels.jsx

@@ -4,8 +4,8 @@ import CustomModal from '@/components/Modal/src/components/CustomModal'
 import { queryRatioPanelsList, queryServiceRatioPanelsList } from '@/services/dashboard'
 import consts from '@/consts'
 import { servicelogEnum } from '@/pages/Customer/Company/components/CompanyDetail/LowerList'
-import ClientDetail from '@/pages/Customer/Client/components/ClientDetail'
-import CompanyDetail from '@/pages/Customer/Company/components/CompanyDetail'
+// import ClientDetail from '@/pages/Customer/Client/components/ClientDetail'
+// import CompanyDetail from '@/pages/Customer/Company/components/CompanyDetail'
 import { Badge } from 'antd'
 import { cardTypeMap } from '../consts'
 // import { useModal } from '@/components/Modal'
@@ -45,7 +45,7 @@ const renderBadge = (count, active = false) => {
 
 /** 服务环比数据Tab切换表格 */
 const ServiceRatioPanels = ({ staffIds, cyclical, dataPermission }) => {
-  const { toggleDrawer, setDrawerProps } = useModal()
+  // const { toggleDrawer, setDrawerProps } = useModal()
   const activeKeyMap = {
     0: { key: 'clientName', title: '客户', id: 'clientId' },
     1: { key: 'customerName', title: '单位', id: 'customerId' },
@@ -56,38 +56,38 @@ const ServiceRatioPanels = ({ staffIds, cyclical, dataPermission }) => {
     activeKey: '0',
     total: 0
   })
-  const showDrawer = id => {
-    let children = null
-    if (state.activeKey === '0') {
-      children = <ClientDetail dataId={id} orderIds={state.orderIds} />
-    }
-    if (state.activeKey === '1') {
-      children = <CompanyDetail dataId={id} orderIds={state.orderIds} />
-    }
-    setDrawerProps({
-      zIndex: '1200',
-      closable: true,
-      onClose: () => toggleDrawer(),
-      bodyStyle: {
-        height: '100vh',
-        overflowY: 'hidden'
-      },
-      children
-    })
-    toggleDrawer()
-  }
+  // const showDrawer = id => {
+  //   let children = null
+  //   if (state.activeKey === '0') {
+  //     children = <ClientDetail dataId={id} orderIds={state.orderIds} />
+  //   }
+  //   if (state.activeKey === '1') {
+  //     children = <CompanyDetail dataId={id} orderIds={state.orderIds} />
+  //   }
+  //   setDrawerProps({
+  //     zIndex: '1200',
+  //     closable: true,
+  //     onClose: () => toggleDrawer(),
+  //     bodyStyle: {
+  //       height: '100vh',
+  //       overflowY: 'hidden'
+  //     },
+  //     children
+  //   })
+  //   toggleDrawer()
+  // }
   const columns = [
     {
       dataIndex: activeKeyMap[state.activeKey].key,
       title: `${activeKeyMap[state.activeKey].title}名称`,
-      width: '20%',
-      render: (text, record) => (
-        <span
-          onClick={() => showDrawer(record[activeKeyMap[state.activeKey].id])}
-          className="text-primary cursor-pointer hover:text-[#967bbd]">
-          {text}
-        </span>
-      )
+      width: '20%'
+      // render: (text, record) => (
+      //   <span
+      //     onClick={() => showDrawer(record[activeKeyMap[state.activeKey].id])}
+      //     className="text-primary cursor-pointer hover:text-[#967bbd]">
+      //     {text}
+      //   </span>
+      // )
     },
     {
       dataIndex: 'status',
@@ -177,42 +177,42 @@ const ServiceRatioPanels = ({ staffIds, cyclical, dataPermission }) => {
 }
 
 const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
-  const { toggleDrawer, setDrawerProps } = useModal()
-  const state = {
-    orderIds: []
-  }
-  const showDrawer = id => {
-    setDrawerProps({
-      zIndex: '1200',
-      closable: true,
-      onClose: () => toggleDrawer(),
-      bodyStyle: {
-        height: '100vh',
-        overflowY: 'hidden'
-      },
-      children: <ClientDetail dataId={id} orderIds={state.orderIds} />
-    })
-    toggleDrawer()
-  }
+  // const { toggleDrawer, setDrawerProps } = useModal()
+  // const state = {
+  //   orderIds: []
+  // }
+  // const showDrawer = id => {
+  //   setDrawerProps({
+  //     zIndex: '1200',
+  //     closable: true,
+  //     onClose: () => toggleDrawer(),
+  //     bodyStyle: {
+  //       height: '100vh',
+  //       overflowY: 'hidden'
+  //     },
+  //     children: <ClientDetail dataId={id} orderIds={state.orderIds} />
+  //   })
+  //   toggleDrawer()
+  // }
   // 展示单位
-  const showDrawerComapny = id => {
-    setDrawerProps({
-      zIndex: '1200',
-      closable: true,
-      onClose: () => toggleDrawer(),
-      bodyStyle: {
-        height: '100vh',
-        overflowY: 'hidden'
-      },
-      children: <CompanyDetail dataId={id} orderIds={state.orderIds} />
-    })
-    toggleDrawer()
-  }
+  // const showDrawerComapny = id => {
+  //   setDrawerProps({
+  //     zIndex: '1200',
+  //     closable: true,
+  //     onClose: () => toggleDrawer(),
+  //     bodyStyle: {
+  //       height: '100vh',
+  //       overflowY: 'hidden'
+  //     },
+  //     children: <CompanyDetail dataId={id} orderIds={state.orderIds} />
+  //   })
+  //   toggleDrawer()
+  // }
   const columnsMap = {
     0: [
       {
         dataIndex: 'clientName',
-        title: '联系人名称',
+        title: '客户名称',
         width: '10%'
         // render: (clientName, record) => (
         //   <span
@@ -262,14 +262,14 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
       {
         dataIndex: 'companyName',
         title: '单位名称',
-        width: '16%',
-        render: (companyName, record) => (
-          <span
-            onClick={() => showDrawerComapny(record.id)}
-            className="text-primary cursor-pointer hover:text-[#967bbd]">
-            {companyName}
-          </span>
-        )
+        width: '16%'
+        // render: (companyName, record) => (
+        //   <span
+        //     onClick={() => showDrawerComapny(record.id)}
+        //     className="text-primary cursor-pointer hover:text-[#967bbd]">
+        //     {companyName}
+        //   </span>
+        // )
       },
       {
         dataIndex: 'districtName',
@@ -345,7 +345,7 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
           <div className="mx-4">
             <ProTable
               size="small"
-              border={true}
+              bordered={true}
               pagination={{ defaultPageSize: 10 }}
               rowKey={record => record.id}
               scroll={{ y: 400 }}