Jelajahi Sumber

feat: 修复table配置scroll属性导致菜单栏展开收起卡顿的bug

lanjianrong 5 tahun lalu
induk
melakukan
a3326fd7ef
1 mengubah file dengan 38 tambahan dan 17 penghapusan
  1. 38 17
      src/pages/Customer/Contact/index.jsx

+ 38 - 17
src/pages/Customer/Contact/index.jsx

@@ -29,43 +29,52 @@ const Contact = props => {
       title: '联系人',
       dataIndex: 'clientname',
       key: 'clientname',
+      width: 100,
+      fixed: 'left',
       render: clientname => <a onClick={showDrawer}>{clientname}</a>
     },
     {
       title: '客户名称',
       dataIndex: 'companyname',
       key: 'companyname',
+      width: 300,
       render: companyname => <a>{companyname}</a>
     },
     {
       title: '部门',
       dataIndex: 'department',
-      key: 'department'
+      key: 'department',
+      width: 100
     },
     {
       title: '电话',
       dataIndex: 'telephone',
-      key: 'telephone'
+      key: 'telephone',
+      width: 150
     },
     {
       title: '手机',
       dataIndex: 'phone',
-      key: 'phone'
+      key: 'phone',
+      width: 100
     },
     {
       title: 'QQ',
       dataIndex: 'qq',
-      key: 'qq'
+      key: 'qq',
+      width: 100
     },
     {
       title: '邮箱',
       dataIndex: 'email',
-      key: 'email'
+      key: 'email',
+      width: 100
     },
     {
       title: '职务',
       dataIndex: 'position',
-      key: 'position'
+      key: 'position',
+      width: 100
     },
     {
       title: '办公室',
@@ -75,7 +84,8 @@ const Contact = props => {
     {
       title: '地区',
       dataIndex: 'local',
-      key: 'local'
+      key: 'local',
+      width: 100
     },
     {
       title: '个人标签',
@@ -83,6 +93,7 @@ const Contact = props => {
       key: 'tag',
       render: (_, record) => <Tag color="#16A085">{record.tag}</Tag>,
       filters: true,
+      width: 100,
       // onFilter: true,
       valueType: 'select',
       valueEnum: {
@@ -124,6 +135,7 @@ const Contact = props => {
       title: '协作标签',
       dataIndex: 'tooltip',
       key: 'tooltip',
+      width: 100,
       render: (_, record) => <Tag color="#F8AC59">{record.tooltip}</Tag>,
       filters: true,
       valueType: 'select',
@@ -162,48 +174,57 @@ const Contact = props => {
     {
       title: '地址',
       dataIndex: 'address',
-      key: 'address'
+      key: 'address',
+      width: 100
     },
     {
       title: '乘车',
       dataIndex: 'ride',
-      key: 'ride'
+      key: 'ride',
+      width: 100
     },
     {
       title: '地标',
       dataIndex: 'landmarks',
-      key: 'landmarks'
+      key: 'landmarks',
+      width: 100
     },
     {
       title: '住宿',
       dataIndex: 'stay',
-      key: 'stay'
+      key: 'stay',
+      width: 100
     },
     {
       title: '备注',
       dataIndex: 'mark',
-      key: 'mark'
+      key: 'mark',
+      width: 100
     },
     {
       title: '软件锁',
       dataIndex: 'keynum',
       key: 'keynum',
+      width: 100,
       render: keynum => <a>{keynum}</a>
     },
     {
       title: '大司空',
       dataIndex: 'dasikong',
-      key: 'dasikong'
+      key: 'dasikong',
+      width: 100
     },
     {
       title: '养护云',
       dataIndex: 'yanghuyun',
-      key: 'yanghuyun'
+      key: 'yanghuyun',
+      width: 100
     },
     {
       title: '创建人',
       dataIndex: 'chuanpeople',
-      key: 'chuanpeople'
+      key: 'chuanpeople',
+      width: 100
     }
   ]
   const {
@@ -263,13 +284,13 @@ const Contact = props => {
         options={{
           search: true
         }}
-        scroll={{ y:true }}
+        scroll={{ x: 1500, y: 600 }}
         columnsStateMap={columnsStateMap}
         onColumnsStateChange={map => setColumnsStateMap(map)}
         headerTitle="联系人"
         toolBarRender={() => [
           <Button key="button" type="primary">
-            <SvgIcon type="icon-plus"/>联系人
+            <SvgIcon type="icon-plus" />联系人
           </Button>
         ]}
       />