Kaynağa Gözat

Merge branch 'dev' of http://192.168.1.41:3000/outaozhen/cldV2react into dev

outaozhen 5 yıl önce
ebeveyn
işleme
a338596298

+ 4 - 4
config/routes.js

@@ -117,22 +117,22 @@ export default [
           {
             path: '/product/cloud/building',
             name: 'build',
-            component: './Product/Cloud/Building'
+            component: './Product/Cloud'
           },
           {
             path: '/product/cloud/curing',
             name: 'curing',
-            component: './Product/Cloud/Curing'
+            component: './Product/Cloud'
           },
           {
             path: '/product/cloud/highway',
             name: 'highway',
-            component: './Product/Cloud/Highway'
+            component: './Product/Cloud'
           },
           {
             path: '/product/cloud/gs',
             name: 'gs',
-            component: './Product/Cloud/Gs'
+            component: './Product/Cloud'
           }
         ]
       }

+ 5 - 0
src/global.less

@@ -54,6 +54,11 @@ body,
   margin-bottom: 0;
 }
 
+// 修复proTable中的列设置,tree list hover效果异常
+.ant-pro-table-column-setting-list > .ant-tree .ant-tree-node-content-wrapper:hover {
+  background-color: unset;
+}
+
 .ant-pro-top-nav-header-logo h1 {
   font-weight: 600;
   font-size: 18px;

+ 0 - 13
src/pages/Product/Cloud/Curing/index.jsx

@@ -1,13 +0,0 @@
-import React from 'react'
-import { Card } from 'antd'
-
-const Curing = () => {
-  // const { modalVisible, onCancel } = props;
-  return (
-    <Card bordered={false}>
-      Curing
-    </Card>
-  )
-}
-
-export default Curing

+ 0 - 9
src/pages/Product/Cloud/Gs/index.jsx

@@ -1,9 +0,0 @@
-import React from 'react'
-import { Card } from 'antd'
-
-const Curing = () => {
-  // const { modalVisible, onCancel } = props;
-  return <Card bordered={false}>Curing</Card>
-}
-
-export default Curing

+ 0 - 9
src/pages/Product/Cloud/Highway/index.jsx

@@ -1,9 +0,0 @@
-import React from 'react'
-import { Card } from 'antd'
-
-const Curing = () => {
-  // const { modalVisible, onCancel } = props;
-  return <Card bordered={false}>Curing</Card>
-}
-
-export default Curing

+ 21 - 23
src/pages/Product/Cloud/Building/index.jsx

@@ -5,7 +5,7 @@ import { dayjsFormat, refactorSortField } from '@/utils/utils'
 import { queryRoadpricingList } from '@/services/product'
 import { Input, Tag, Tooltip } from 'antd'
 import consts from '@/consts'
-import { useSelector, useDispatch } from 'umi'
+import { useLocation, useSelector, useDispatch } from 'umi'
 
 export const roadpricingEnum = {
   CURING: 1, // 养护云
@@ -14,7 +14,9 @@ export const roadpricingEnum = {
   GS: 4 // 大司空概算
 }
 
-const CloudTable = ({ columnStateType }) => {
+const Cloud = () => {
+  const { pathname = '' } = useLocation()
+  const columnStateType = pathname?.match(/\/([^/]*)$/)[1]?.toUpperCase()
   const dispatch = useDispatch()
   const { cloud } = useSelector(state => ({
     cloud: state.cloud,
@@ -92,8 +94,8 @@ const CloudTable = ({ columnStateType }) => {
     },
     {
       title: '最近使用',
-      dataIndex: 'latestUsedName',
-      key: 'latestUsedName',
+      dataIndex: 'latestUsed',
+      key: 'latestUsed',
       valueType: 'select',
       width: 50,
       valueEnum: roadpricing.reduce((prev, curr) => {
@@ -105,12 +107,13 @@ const CloudTable = ({ columnStateType }) => {
         }
         return obj
       }, {}),
-      renderText: text => text && <Tag color="purple">{text}</Tag>
+      renderText: (_, record) =>
+        record.latestUsedName && <Tag color="purple">{record.latestUsedName}</Tag>
     },
     {
       title: '截至上一次登录时长',
-      dataIndex: 'all_online_times',
-      key: 'all_online_times',
+      dataIndex: 'onlineTimes',
+      key: 'onlineTimes',
       valueType: 'select',
       width: 70,
       valueEnum: {
@@ -120,7 +123,7 @@ const CloudTable = ({ columnStateType }) => {
         4: { text: '超过3小时' }
       },
       renderText: (t, record) => {
-        if (t && record.online_list?.length) {
+        if (record.all_online_times && record.online_list?.length) {
           return (
             <Tooltip
               title={
@@ -129,7 +132,7 @@ const CloudTable = ({ columnStateType }) => {
                   {record.online_list?.map(
                     (item, i) =>
                       i < 10 && (
-                        <div className="flex justify-between">
+                        <div className="flex justify-between" key={item.dateString}>
                           <span>{item.online_times}</span>
                           <span className="ml-4">{item.dateString}</span>
                         </div>
@@ -138,7 +141,7 @@ const CloudTable = ({ columnStateType }) => {
                 </div>
               }
             >
-              {t}
+              {record.all_online_times}
             </Tooltip>
           )
         }
@@ -157,11 +160,10 @@ const CloudTable = ({ columnStateType }) => {
     },
     {
       title: '已升级专业版',
-      dataIndex: 'upgrade_list',
-      key: 'upgrade_list',
-      search: false,
-      filters: true,
+      dataIndex: 'upGrade',
+      key: 'upGrade',
       width: 150,
+      valueType: 'select',
       valueEnum: roadpricing.reduce((prev, curr) => {
         const obj = { ...prev }
         if (curr._id) {
@@ -171,9 +173,9 @@ const CloudTable = ({ columnStateType }) => {
         }
         return obj
       }, {}),
-      renderText: text => (
-        <div>
-          {text
+      renderText: (_, record) => (
+        <div className="children:m-2px">
+          {record.upgrade_list
             .filter(item => item.isUpgrade)
             .map(item => {
               return (
@@ -231,7 +233,7 @@ const CloudTable = ({ columnStateType }) => {
       toolbar={{
         search: (
           <Input.Search
-            style={{ width: '300px' }}
+            style={{ width: '250px' }}
             allowClear={true}
             placeholder="请输入手机、QQ进行搜索"
             onSearch={handleSearch}
@@ -245,8 +247,4 @@ const CloudTable = ({ columnStateType }) => {
   )
 }
 
-const Building = () => {
-  return <CloudTable columnStateType="BUILDING" />
-}
-
-export default Building
+export default Cloud

+ 1 - 1
src/pages/Product/Cloud/model.js

@@ -1,6 +1,6 @@
 import consts from '@/consts'
 import { queryCompilationList } from '@/services/product'
-import { roadpricingEnum } from './Building'
+import { roadpricingEnum } from './index'
 
 export default {
   namespace: 'cloud',

+ 4 - 4
src/pages/Product/Lock/Lockstore/index.jsx

@@ -24,11 +24,11 @@ export const ProductLabel = ({ data }) => {
     newData = data.split('+')
   }
   return (
-    <div>
+    <div className="children:m-2px">
       {newData.map((item, index) => (
-        <span key={index} className="mr-5px">
-          <Tag color="purple">{item}</Tag>
-        </span>
+        <Tag color="purple" key={index}>
+          {item}
+        </Tag>
       ))}
     </div>
   )