Forráskód Böngészése

feat:大司空2.0个人版调整

outaozhen 4 éve
szülő
commit
b620aa445e

+ 7 - 22
src/pages/Product/Road/Personal/components/Detail/TabList.jsx

@@ -27,7 +27,6 @@ const PersonalTabList = props => {
     ssoId,
     actionPayload = { main: 'personal' }
   } = props
-  console.log(proCptList)
   const isUpgradeEnum = {
     true: '已升级',
     undefined: ''
@@ -91,7 +90,13 @@ const PersonalTabList = props => {
       title: '限期',
       dataIndex: 'deadline',
       width: '10%',
-      render: text => dayjsFormat(text, 'YYYY-MM-DD HH:mm')
+      // renderText: text => {
+      //   if (text !== 0 && text !== null) {
+      //     return <>{dayjsFormat(text, 'YYYY-MM-DD HH:mm')}</>
+      //   }
+      //   return text
+      // }
+      renderText: text => text && dayjsFormat(text, 'YYYY-MM-DD HH:mm')
     },
     {
       title: '操作',
@@ -161,26 +166,6 @@ const PersonalTabList = props => {
               </Button>
             </>
           ) : null}
-          {/* <Button
-            type="primary"
-            ghost
-            size="small"
-            className="m-2px"
-            onClick={() =>
-              setRoadPricingUpgradev2({
-                ...setRoadPricingUpgradev2,
-                visible: true,
-                salesType: salesTypeEnum.GIFT,
-                type: titleType.GIVE,
-                // eslint-disable-next-line no-underscore-dangle
-                compilationId: record.ID,
-                compilationName: record.name,
-                lockTypeEnum: lockTypeEnum.GIVE,
-                upgradeTypeEnum: upgradeTypeEnum.UPGRADE
-              })
-            }>
-            赠送
-          </Button> */}
           {/* {record.isUpgrade ? (
             <>
               <Button

+ 58 - 58
src/pages/Product/Road/Personal/index.jsx

@@ -83,44 +83,44 @@ const Personal = props => {
       width: 150,
       renderText: (_, record) => record.cld?.customerName
     },
-    {
-      title: '最近登录',
-      dataIndex: 'onlineTimes',
-      key: 'onlineTimes',
-      filters: true,
-      filterMultiple: false,
-      width: 110,
-      valueEnum: {
-        1: { text: '超过30分钟' },
-        2: { text: '超过1小时' },
-        3: { text: '超过2小时' },
-        4: { text: '超过3小时' }
-      },
-      renderText: (t, record) => {
-        if (record.all_online_times && record.online_list?.length) {
-          return (
-            <Tooltip
-              title={
-                <div>
-                  <div>最近登陆:</div>
-                  {record.online_list?.map(
-                    (item, i) =>
-                      i < 10 && (
-                        <div className="flex justify-between" key={item.dateString}>
-                          <span>{item.online_times}</span>
-                          <span className="ml-4">{item.dateString}</span>
-                        </div>
-                      )
-                  )}
-                </div>
-              }>
-              {record.all_online_times}
-            </Tooltip>
-          )
-        }
-        return '-'
-      }
-    },
+    // {
+    //   title: '最近登录',
+    //   dataIndex: 'onlineTimes',
+    //   key: 'onlineTimes',
+    //   filters: true,
+    //   filterMultiple: false,
+    //   width: 110,
+    //   valueEnum: {
+    //     1: { text: '超过30分钟' },
+    //     2: { text: '超过1小时' },
+    //     3: { text: '超过2小时' },
+    //     4: { text: '超过3小时' }
+    //   },
+    //   renderText: (t, record) => {
+    //     if (record.all_online_times && record.online_list?.length) {
+    //       return (
+    //         <Tooltip
+    //           title={
+    //             <div>
+    //               <div>最近登陆:</div>
+    //               {record.online_list?.map(
+    //                 (item, i) =>
+    //                   i < 10 && (
+    //                     <div className="flex justify-between" key={item.dateString}>
+    //                       <span>{item.online_times}</span>
+    //                       <span className="ml-4">{item.dateString}</span>
+    //                     </div>
+    //                   )
+    //               )}
+    //             </div>
+    //           }>
+    //           {record.all_online_times}
+    //         </Tooltip>
+    //       )
+    //     }
+    //     return '-'
+    //   }
+    // },
     {
       title: '最近使用',
       dataIndex: 'usedCptList',
@@ -128,15 +128,15 @@ const Personal = props => {
       width: 120,
       filters: true,
       filterMultiple: false,
-      valueEnum: compilationv2.reduce((prev, curr) => {
-        const obj = { ...prev }
-        if (curr.ID) {
-          obj[curr.ID] = {
-            text: curr.name
-          }
-        }
-        return obj
-      }, {}),
+      // valueEnum: compilationv2.reduce((prev, curr) => {
+      //   const obj = { ...prev }
+      //   if (curr.ID) {
+      //     obj[curr.ID] = {
+      //       text: curr.name
+      //     }
+      //   }
+      //   return obj
+      // }, {}),
       renderText: (_, record) => (
         <div className="children:m-2px">
           {record.usedCptList.map(item => {
@@ -165,23 +165,23 @@ const Personal = props => {
       width: 150,
       filters: true,
       filterMultiple: false,
-      valueEnum: compilationv2.reduce((prev, curr) => {
-        const obj = { ...prev }
-        if (curr.ID) {
-          obj[curr.ID] = {
-            text: curr.name
-          }
-        }
-        return obj
-      }, {}),
+      // valueEnum: compilationv2.reduce((prev, curr) => {
+      //   const obj = { ...prev }
+      //   if (curr.ID) {
+      //     obj[curr.ID] = {
+      //       text: curr.name
+      //     }
+      //   }
+      //   return obj
+      // }, {}),
       renderText: (_, record) => (
         <div className="children:m-2px">
           {record.proCptList
             .filter(item => item.activated)
             .map(item => {
               return (
-                <Tag color="purple" key={item.compilationID}>
-                  {compilationv2?.find(i => i.ID === item.compilationID)?.name}
+                <Tag color="purple" key={item.ID}>
+                  {compilationv2?.find(i => i.ID === item.ID)?.name}
                 </Tag>
               )
             })}