lanjianrong 4 anni fa
parent
commit
3a5c204e27

+ 0 - 7
package.json

@@ -95,13 +95,10 @@
     "@umijs/fabric": "^2.10.1",
     "@umijs/fabric": "^2.10.1",
     "@umijs/plugin-blocks": "^2.0.5",
     "@umijs/plugin-blocks": "^2.0.5",
     "@umijs/plugin-esbuild": "^1.0.1",
     "@umijs/plugin-esbuild": "^1.0.1",
-    "@umijs/plugin-sass": "^1.1.1",
     "@umijs/preset-ant-design-pro": "^1.2.0",
     "@umijs/preset-ant-design-pro": "^1.2.0",
     "@umijs/preset-react": "1.8.12",
     "@umijs/preset-react": "1.8.12",
     "@umijs/yorkie": "^2.0.3",
     "@umijs/yorkie": "^2.0.3",
-    "agent-base": "^6.0.2",
     "antd-dayjs-webpack-plugin": "^1.0.6",
     "antd-dayjs-webpack-plugin": "^1.0.6",
-    "babel-eslint": "^10.1.0",
     "babel-plugin-import": "^1.13.3",
     "babel-plugin-import": "^1.13.3",
     "carlo": "^0.9.46",
     "carlo": "^0.9.46",
     "compression-webpack-plugin": "4.0.1",
     "compression-webpack-plugin": "4.0.1",
@@ -112,14 +109,10 @@
     "express": "^4.17.1",
     "express": "^4.17.1",
     "gh-pages": "^3.0.0",
     "gh-pages": "^3.0.0",
     "lint-staged": "^10.0.0",
     "lint-staged": "^10.0.0",
-    "mockjs": "^1.0.1-beta3",
     "prettier": "^2.2.1",
     "prettier": "^2.2.1",
-    "pro-download": "1.0.1",
     "puppeteer-core": "^5.0.0",
     "puppeteer-core": "^5.0.0",
     "stylelint": "^13.9.0",
     "stylelint": "^13.9.0",
     "typescript": "^4.0.3",
     "typescript": "^4.0.3",
-    "upgrade": "^1.1.0",
-    "use-merge-value": "^1.0.1",
     "webpack": "^5.40.0",
     "webpack": "^5.40.0",
     "windicss": "3.1.7",
     "windicss": "3.1.7",
     "windicss-webpack-plugin": "1.4.5"
     "windicss-webpack-plugin": "1.4.5"

File diff suppressed because it is too large
+ 5 - 777
pnpm-lock.yaml


+ 0 - 1
src/e2e/__mocks__/antd-pro-merge-less.js

@@ -1 +0,0 @@
-export default undefined

+ 0 - 57
src/e2e/baseLayout.e2e.js

@@ -1,57 +0,0 @@
-const { uniq } = require('lodash')
-const RouterConfig = require('../../config/config').default.routes
-
-const BASE_URL = `http://localhost:${process.env.PORT || 8000}`
-
-function formatter(routes, parentPath = '') {
-  const fixedParentPath = parentPath.replace(/\/{1,}/g, '/')
-  let result = []
-  routes.forEach((item) => {
-    if (item.path) {
-      result.push(`${fixedParentPath}/${item.path}`.replace(/\/{1,}/g, '/'))
-    }
-    if (item.routes) {
-      result = result.concat(
-        formatter(item.routes, item.path ? `${fixedParentPath}/${item.path}` : parentPath)
-      )
-    }
-  })
-  return uniq(result.filter((item) => !!item))
-}
-
-beforeEach(async () => {
-  await page.goto(`${BASE_URL}`)
-  await page.evaluate(() => {
-    localStorage.setItem('antd-pro-authority', '["admin"]')
-  })
-})
-
-describe('Ant Design Pro E2E test', () => {
-  const testPage = (path) => async () => {
-    await page.goto(`${BASE_URL}${path}`)
-    await page.waitForSelector('footer', {
-      timeout: 2000
-    })
-    const haveFooter = await page.evaluate(
-      () => document.getElementsByTagName('footer').length > 0
-    )
-    expect(haveFooter).toBeTruthy()
-  }
-
-  const routers = formatter(RouterConfig)
-  routers.forEach((route) => {
-    it(`test pages ${route}`, testPage(route))
-  })
-
-  it('topmenu should have footer', async () => {
-    const params = '?navTheme=light&layout=topmenu'
-    await page.goto(`${BASE_URL}${params}`)
-    await page.waitForSelector('footer', {
-      timeout: 2000
-    })
-    const haveFooter = await page.evaluate(
-      () => document.getElementsByTagName('footer').length > 0
-    )
-    expect(haveFooter).toBeTruthy()
-  })
-})

+ 1 - 4
src/pages/Hr/Notification/components/MessageDetail.jsx

@@ -2,7 +2,6 @@ import MarkDown from 'react-markdown'
 import styles from '@/pages/Hr/Notification/index.less'
 import styles from '@/pages/Hr/Notification/index.less'
 import { Drawer, Tag, Typography } from 'antd'
 import { Drawer, Tag, Typography } from 'antd'
 import { useIntl } from 'umi'
 import { useIntl } from 'umi'
-import 'vditor/src/assets/scss/index.scss'
 
 
 const MessageDetail = props => {
 const MessageDetail = props => {
   const { item: { id, title, createTime, content, msgType } = {}, ...otherProps } = props
   const { item: { id, title, createTime, content, msgType } = {}, ...otherProps } = props
@@ -13,9 +12,7 @@ const MessageDetail = props => {
       <div className="px-5 vditor-reset h-full">
       <div className="px-5 vditor-reset h-full">
         <div className="max-h-20vh">
         <div className="max-h-20vh">
           <span className="pt-5 block">
           <span className="pt-5 block">
-            <Tag color="purple">
-              {intl.formatMessage({ id: `component.globalHeader.${msgType}` })}
-            </Tag>
+            <Tag color="purple">{intl.formatMessage({ id: `component.globalHeader.${msgType}` })}</Tag>
           </span>
           </span>
           <h1 className={['text-xl pr-6 mt-3', styles.NotificationCont].join(' ')}>{title}</h1>
           <h1 className={['text-xl pr-6 mt-3', styles.NotificationCont].join(' ')}>{title}</h1>
           <span className="text-hex-aaa">{createTime}</span>
           <span className="text-hex-aaa">{createTime}</span>

+ 1 - 1
src/pages/Hr/Notification/components/RighEditor.jsx

@@ -1,7 +1,7 @@
 import { Spin } from 'antd'
 import { Spin } from 'antd'
 import React, { useState, useEffect, useRef } from 'react'
 import React, { useState, useEffect, useRef } from 'react'
 import Vditor from 'vditor'
 import Vditor from 'vditor'
-import 'vditor/src/assets/scss/index.scss'
+import 'vditor/dist/index.css'
 
 
 const RighEditor = ({ value, onChange }) => {
 const RighEditor = ({ value, onChange }) => {
   const ref = useRef()
   const ref = useRef()

+ 2 - 5
src/pages/Product/Road/Enterprise/components/Detail/TabList.jsx

@@ -9,7 +9,6 @@ import consts from '@/consts'
 const EnterpriseTabList = props => {
 const EnterpriseTabList = props => {
   const { authUsers, compilationList, company, reload } = props
   const { authUsers, compilationList, company, reload } = props
   const { TabPane } = Tabs
   const { TabPane } = Tabs
-  const tRef = useRef(null)
   const dispatchModal = useModal()
   const dispatchModal = useModal()
   const isUpgradeEnum = {
   const isUpgradeEnum = {
     true: '开通',
     true: '开通',
@@ -75,9 +74,7 @@ const EnterpriseTabList = props => {
                 size="small"
                 size="small"
                 columns={columns}
                 columns={columns}
                 search={false}
                 search={false}
-                actionRef={tRef}
                 toolBarRender={false}
                 toolBarRender={false}
-                // eslint-disable-next-line no-underscore-dangle
                 rowKey={record => record._id}
                 rowKey={record => record._id}
                 dataSource={compilationList}
                 dataSource={compilationList}
                 pagination={false}
                 pagination={false}
@@ -91,7 +88,6 @@ const EnterpriseTabList = props => {
                 columns={columnOnline}
                 columns={columnOnline}
                 search={false}
                 search={false}
                 toolBarRender={false}
                 toolBarRender={false}
-                // eslint-disable-next-line no-underscore-dangle
                 rowKey={record => record.id}
                 rowKey={record => record.id}
                 dataSource={authUsers.users}
                 dataSource={authUsers.users}
                 pagination={false}
                 pagination={false}
@@ -118,7 +114,8 @@ const EnterpriseTabList = props => {
                 cptList: company.latestUsed.map(item => item.id)
                 cptList: company.latestUsed.map(item => item.id)
               }
               }
             })
             })
-          }>
+          }
+        >
           企业版管理
           企业版管理
         </Button>
         </Button>
       </div>
       </div>

+ 16 - 15
src/pages/Product/Road/Personal/components/Detail/TabList.jsx

@@ -27,7 +27,6 @@ const PersonalTabList = props => {
   }
   }
   const { TabPane } = Tabs
   const { TabPane } = Tabs
   const dispatch = useDispatch()
   const dispatch = useDispatch()
-  const tRef = useRef(null)
   const [roadPricingUpgradev2, setRoadPricingUpgradev2] = useState({
   const [roadPricingUpgradev2, setRoadPricingUpgradev2] = useState({
     type: '',
     type: '',
     compilationId: '',
     compilationId: '',
@@ -102,7 +101,8 @@ const PersonalTabList = props => {
                 lockTypeEnum: lockTypeEnum.GIVE,
                 lockTypeEnum: lockTypeEnum.GIVE,
                 upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                 upgradeTypeEnum: upgradeTypeEnum.UPGRADE
               })
               })
-            }>
+            }
+          >
             赠送
             赠送
           </Button>
           </Button>
           {record.lock === 1 ? (
           {record.lock === 1 ? (
@@ -123,7 +123,8 @@ const PersonalTabList = props => {
                     lockTypeEnum: lockTypeEnum.SALE,
                     lockTypeEnum: lockTypeEnum.SALE,
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                   })
                   })
-                }>
+                }
+              >
                 销售
                 销售
               </Button>
               </Button>
             </>
             </>
@@ -146,7 +147,8 @@ const PersonalTabList = props => {
                     compilationListName: record.name,
                     compilationListName: record.name,
                     upgradeTypeEnum: upgradeTypeEnum.DEMOTION
                     upgradeTypeEnum: upgradeTypeEnum.DEMOTION
                   })
                   })
-                }>
+                }
+              >
                 降级
                 降级
               </Button>
               </Button>
               <Button
               <Button
@@ -167,7 +169,8 @@ const PersonalTabList = props => {
                     lockTypeEnum: record.lock,
                     lockTypeEnum: record.lock,
                     upgradeTypeEnum: upgradeTypeEnum.DEADLINE
                     upgradeTypeEnum: upgradeTypeEnum.DEADLINE
                   })
                   })
-                }>
+                }
+              >
                 限期
                 限期
               </Button>
               </Button>
             </>
             </>
@@ -183,13 +186,13 @@ const PersonalTabList = props => {
                     ...setRoadPricingUpgradev2,
                     ...setRoadPricingUpgradev2,
                     visible: true,
                     visible: true,
                     type: titleType.LEND,
                     type: titleType.LEND,
-                    // eslint-disable-next-line no-underscore-dangle
                     compilationId: record._id,
                     compilationId: record._id,
                     compilationName: record.name,
                     compilationName: record.name,
                     lockTypeEnum: lockTypeEnum.LEND,
                     lockTypeEnum: lockTypeEnum.LEND,
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                   })
                   })
-                }>
+                }
+              >
                 借出
                 借出
               </Button>
               </Button>
               <Button
               <Button
@@ -202,13 +205,13 @@ const PersonalTabList = props => {
                     ...setRoadPricingUpgradev2,
                     ...setRoadPricingUpgradev2,
                     visible: true,
                     visible: true,
                     type: titleType.SALE,
                     type: titleType.SALE,
-                    // eslint-disable-next-line no-underscore-dangle
                     compilationId: record._id,
                     compilationId: record._id,
                     compilationName: record.name,
                     compilationName: record.name,
                     lockTypeEnum: lockTypeEnum.SALE,
                     lockTypeEnum: lockTypeEnum.SALE,
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                   })
                   })
-                }>
+                }
+              >
                 销售
                 销售
               </Button>
               </Button>
             </>
             </>
@@ -234,13 +237,12 @@ const PersonalTabList = props => {
       <div className="pl-15px">
       <div className="pl-15px">
         <Tabs>
         <Tabs>
           <TabPane tab="个人版" key="个人版">
           <TabPane tab="个人版" key="个人版">
-            <div className="sheet-right-panel" ref={tRef}>
+            <div className="sheet-right-panel">
               <ProTable
               <ProTable
                 size="small"
                 size="small"
                 columns={columns}
                 columns={columns}
                 search={false}
                 search={false}
                 toolBarRender={false}
                 toolBarRender={false}
-                // eslint-disable-next-line no-underscore-dangle
                 rowKey={record => record._id}
                 rowKey={record => record._id}
                 dataSource={compilationList}
                 dataSource={compilationList}
                 pagination={false}
                 pagination={false}
@@ -254,7 +256,6 @@ const PersonalTabList = props => {
                 columns={columnOnline}
                 columns={columnOnline}
                 search={false}
                 search={false}
                 toolBarRender={false}
                 toolBarRender={false}
-                // eslint-disable-next-line no-underscore-dangle
                 rowKey={record => record._id}
                 rowKey={record => record._id}
                 dataSource={online_list}
                 dataSource={online_list}
                 pagination={false}
                 pagination={false}
@@ -265,14 +266,14 @@ const PersonalTabList = props => {
       </div>
       </div>
       <UpgradeModalv2
       <UpgradeModalv2
         onConfirm={handleRoadPricingUpgradev2}
         onConfirm={handleRoadPricingUpgradev2}
-        loading={roadPricingUpgradev2.loading}
-        visible={roadPricingUpgradev2.visible}
-        type={roadPricingUpgradev2.type}
         onCancel={() => setRoadPricingUpgradev2({ ...roadPricingUpgradev2, visible: false })}
         onCancel={() => setRoadPricingUpgradev2({ ...roadPricingUpgradev2, visible: false })}
         projectType={projectType}
         projectType={projectType}
         actionPayload={actionPayload}
         actionPayload={actionPayload}
         ssoId={ssoId}
         ssoId={ssoId}
         cloudUser={{ mobile, username }}
         cloudUser={{ mobile, username }}
+        loading={roadPricingUpgradev2.loading}
+        visible={roadPricingUpgradev2.visible}
+        type={roadPricingUpgradev2.type}
         compilationId={roadPricingUpgradev2.compilationId}
         compilationId={roadPricingUpgradev2.compilationId}
         compilationName={roadPricingUpgradev2.compilationName}
         compilationName={roadPricingUpgradev2.compilationName}
         lock={roadPricingUpgradev2.lockTypeEnum}
         lock={roadPricingUpgradev2.lockTypeEnum}