Przeglądaj źródła

fix: 客户、单位详情的表格增加表头固定

outaozhen 4 lat temu
rodzic
commit
2d1cbb570b

+ 1 - 1
src/global.less

@@ -147,7 +147,7 @@ input:-webkit-autofill:active {
 }
 }
 .sheet-right-panel,
 .sheet-right-panel,
 .sheet-panel-record {
 .sheet-panel-record {
-  height: calc((100vh - 48px - 92px - 64px) / 2);
+  height: calc((100vh - 48px - 92px - 44px) / 2);
   overflow-x: hidden;
   overflow-x: hidden;
   overflow-y: auto;
   overflow-y: auto;
 }
 }

+ 2 - 0
src/pages/Customer/Client/components/ClientDetail/TabList.jsx

@@ -20,6 +20,7 @@ const ContanctTabList = ({ clientId, software }) => {
     params: {},
     params: {},
     visible: false
     visible: false
   })
   })
+  const [clientHeight] = useState((document.body.clientHeight - 48 - 92 - 64 - 120) / 2)
   const tRef = useRef()
   const tRef = useRef()
   // 展示软件锁drawer
   // 展示软件锁drawer
   const showLongleDrawer = id => {
   const showLongleDrawer = id => {
@@ -181,6 +182,7 @@ const ContanctTabList = ({ clientId, software }) => {
                 rowKey={record => record.id}
                 rowKey={record => record.id}
                 dataSource={software.longle}
                 dataSource={software.longle}
                 pagination={false}
                 pagination={false}
+                scroll={{ y: clientHeight }}
               />
               />
             </div>
             </div>
           </TabPane>
           </TabPane>

+ 3 - 6
src/pages/Customer/Company/components/CompanyDetail/SyncClient.jsx

@@ -88,8 +88,7 @@ const SyncClient = ({ customer, client }) => {
         size="small"
         size="small"
         ghost
         ghost
         type="primary"
         type="primary"
-        onClick={() => setState({ ...state, visible: true })}
-      >
+        onClick={() => setState({ ...state, visible: true })}>
         <Copy theme="two-tone" fill={['#333', '#886ab5']} />
         <Copy theme="two-tone" fill={['#333', '#886ab5']} />
         <span className="ml-1">同步地址信息</span>
         <span className="ml-1">同步地址信息</span>
         {/* <div className="flex items-center justify-center">
         {/* <div className="flex items-center justify-center">
@@ -102,13 +101,11 @@ const SyncClient = ({ customer, client }) => {
         getContainer={false}
         getContainer={false}
         visible={visible}
         visible={visible}
         onCancel={() => setState({ ...state, visible: false })}
         onCancel={() => setState({ ...state, visible: false })}
-        onOk={handleOnConfirm}
-      >
+        onOk={handleOnConfirm}>
         <div className="rounded-3 p-4 mb-2 pt-0">
         <div className="rounded-3 p-4 mb-2 pt-0">
           <Checkbox.Group
           <Checkbox.Group
             defaultValue={checkValues}
             defaultValue={checkValues}
-            onChange={e => setState({ ...state, checkValues: e })}
-          >
+            onChange={e => setState({ ...state, checkValues: e })}>
             <div className="flex flex-nowrap">
             <div className="flex flex-nowrap">
               <Checkbox value="district">
               <Checkbox value="district">
                 <div className="w-100px text-left">地区</div>
                 <div className="w-100px text-left">地区</div>

+ 18 - 15
src/pages/Customer/Company/components/CompanyDetail/TabList.jsx

@@ -16,7 +16,7 @@ import { longleSellStatusNum, longlePreserveStatusNum } from '@/pages/Product/Lo
 import { renderBadge } from '@/pages/Workbench/Dashboard/components/RatioPanels'
 import { renderBadge } from '@/pages/Workbench/Dashboard/components/RatioPanels'
 import { DownOutlined } from '@ant-design/icons'
 import { DownOutlined } from '@ant-design/icons'
 import { ProductLabel } from '@/pages/Product/Lock/LockStore/index'
 import { ProductLabel } from '@/pages/Product/Lock/LockStore/index'
-import VirtualTable from '@/components/Table/src/VirtualTable'
+// import VirtualTable from '@/components/Table/src/VirtualTable'
 
 
 const CompanyTabList = ({
 const CompanyTabList = ({
   initData,
   initData,
@@ -36,6 +36,11 @@ const CompanyTabList = ({
     params: {},
     params: {},
     visible: false
     visible: false
   })
   })
+  // const [tablistHeight, setTablistHeight] = useState(
+  //   (document.body.tablistHeight - 48 - 92 - 64) / 2
+  // )
+  const [clientHeight] = useState((document.body.clientHeight - 48 - 92 - 64 - 120) / 2)
+  // console.log(clientHeight)
   // 展示drawer
   // 展示drawer
   const showDrawer = id => {
   const showDrawer = id => {
     setDrawerProps({
     setDrawerProps({
@@ -102,8 +107,7 @@ const CompanyTabList = ({
         if (key !== defaultSelectedKey) {
         if (key !== defaultSelectedKey) {
           changePriority(key, id)
           changePriority(key, id)
         }
         }
-      }}
-    >
+      }}>
       <Menu.Item key="1">1</Menu.Item>
       <Menu.Item key="1">1</Menu.Item>
       <Menu.Item key="2">2</Menu.Item>
       <Menu.Item key="2">2</Menu.Item>
       <Menu.Item key="3">3</Menu.Item>
       <Menu.Item key="3">3</Menu.Item>
@@ -122,8 +126,7 @@ const CompanyTabList = ({
         <Dropdown
         <Dropdown
           overlay={priorityMenu(text, record.id)}
           overlay={priorityMenu(text, record.id)}
           trigger="click"
           trigger="click"
-          className="hover:cursor-pointer"
-        >
+          className="hover:cursor-pointer">
           <span>
           <span>
             {text} <DownOutlined />
             {text} <DownOutlined />
           </span>
           </span>
@@ -190,16 +193,14 @@ const CompanyTabList = ({
             <Text delete type="secondary">
             <Text delete type="secondary">
               <span
               <span
                 onClick={() => showLongleDrawer(record.id)}
                 onClick={() => showLongleDrawer(record.id)}
-                className="cursor-pointer hover:text-hex-967bbd"
-              >
+                className="cursor-pointer hover:text-hex-967bbd">
                 {clientName}
                 {clientName}
               </span>
               </span>
             </Text>
             </Text>
           ) : (
           ) : (
             <span
             <span
               onClick={() => showLongleDrawer(record.id)}
               onClick={() => showLongleDrawer(record.id)}
-              className="text-primary cursor-pointer hover:text-hex-967bbd"
-            >
+              className="text-primary cursor-pointer hover:text-hex-967bbd">
               {clientName}
               {clientName}
             </span>
             </span>
           )}
           )}
@@ -284,8 +285,7 @@ const CompanyTabList = ({
       render: (text, record) => (
       render: (text, record) => (
         <span
         <span
           onClick={() => showDrawerBusiness(record.id)}
           onClick={() => showDrawerBusiness(record.id)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]"
-        >
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
           {text}
           {text}
         </span>
         </span>
       )
       )
@@ -352,7 +352,7 @@ const CompanyTabList = ({
         <Tabs>
         <Tabs>
           <TabPane tab={<span>客户{renderBadge(client.total, true)}</span>} key="1">
           <TabPane tab={<span>客户{renderBadge(client.total, true)}</span>} key="1">
             <div className="sheet-right-panel" ref={tRef}>
             <div className="sheet-right-panel" ref={tRef}>
-              {/* <ProTable
+              <ProTable
                 size="small"
                 size="small"
                 columns={columns}
                 columns={columns}
                 search={false}
                 search={false}
@@ -360,14 +360,15 @@ const CompanyTabList = ({
                 toolBarRender={false}
                 toolBarRender={false}
                 rowKey={record => record.id}
                 rowKey={record => record.id}
                 pagination={false}
                 pagination={false}
-              /> */}
-              <VirtualTable
+                scroll={{ y: clientHeight }}
+              />
+              {/* <VirtualTable
                 size="small"
                 size="small"
                 columns={columns}
                 columns={columns}
                 search={false}
                 search={false}
                 dataSource={client.client}
                 dataSource={client.client}
                 rowKey={record => record.id}
                 rowKey={record => record.id}
-              />
+              /> */}
             </div>
             </div>
           </TabPane>
           </TabPane>
           <TabPane tab={<span>软件锁{renderBadge(software.total, true)}</span>} key="2">
           <TabPane tab={<span>软件锁{renderBadge(software.total, true)}</span>} key="2">
@@ -380,6 +381,7 @@ const CompanyTabList = ({
                 rowKey={record => record.id}
                 rowKey={record => record.id}
                 dataSource={software.longle}
                 dataSource={software.longle}
                 pagination={false}
                 pagination={false}
+                scroll={{ y: clientHeight }}
               />
               />
             </div>
             </div>
           </TabPane>
           </TabPane>
@@ -393,6 +395,7 @@ const CompanyTabList = ({
                 rowKey={record => record.id}
                 rowKey={record => record.id}
                 dataSource={business.business}
                 dataSource={business.business}
                 pagination={false}
                 pagination={false}
+                scroll={{ y: clientHeight }}
               />
               />
             </div>
             </div>
           </TabPane>
           </TabPane>