Jelajahi Sumber

chore: routes and filename rename or modify

lanjianrong 5 tahun lalu
induk
melakukan
a4076f8b8c

+ 34 - 20
config/routes.js

@@ -19,26 +19,24 @@ export default [
         component: '../layouts/BasicLayout',
         authority: ['admin', 'user'],
         routes: [
-          // {
-          //   path: '/',
-          //   redirect: '/welcome',
-          // },
-          // {
-          //   path: '/welcome',
-          //   name: 'welcome',
-          // (icon: 'smile'),
-          //   component: './Welcome',
-          // },
+          {
+            path: '/',
+            redirect: '/workbench'
+          },
           {
             path: '/workbench',
             name: 'workbench',
             icon: 'table-lamp',
             routes: [
               {
-                path: '/workbench/workbench',
+                path: '/workbench',
+                redirect: '/workbench/dashboard'
+              },
+              {
+                path: '/workbench/dashboard',
                 name: 'workbench',
                 icon: 'list',
-                component: './Workbench/workbench'
+                component: './workbench/Dashboard'
               }
             ]
           },
@@ -48,28 +46,32 @@ export default [
             icon: 'address-book',
             routes: [
               {
+                path: '/customer',
+                redirect: '/customer/contact'
+              },
+              {
                 path: '/customer/contact',
                 name: 'contact',
                 icon: 'user-business',
-                component: './Customer/Contact'
+                component: './customer/Contact'
               },
               {
                 path: '/customer/company',
                 name: 'company',
                 icon: 'city',
-                component: './Customer/Company'
+                component: './customer/Company'
               },
               {
                 path: '/customer/finance',
                 name: 'finance',
                 icon: 'finance',
-                component: './Customer/Finance'
+                component: './customer/Finance'
               },
               {
                 path: '/customer/test',
                 name: 'test',
                 icon: 'alarm',
-                component: './Customer/Test'
+                component: './customer/Test'
               }
             ]
           },
@@ -79,19 +81,27 @@ export default [
             icon: 'ad-product',
             routes: [
               {
+                path: '/product',
+                redirect: '/product/lock'
+              },
+              {
                 path: '/product/lock',
                 name: 'lock',
                 icon: 'disk-one',
                 routes: [
                   {
+                    path: '/product/lock',
+                    redirect: '/product/lock/lockstore'
+                  },
+                  {
                     path: '/product/lock/lockstore',
                     name: 'lockstore',
-                    component: './Product/Lock/Lockstore'
+                    component: './product/lock/Lockstore'
                   },
                   {
                     path: '/product/lock/lockcount',
                     name: 'lockcount',
-                    component: './Product/Lock/Lockcount'
+                    component: './product/lock/Lockcount'
                   }
                 ]
               },
@@ -101,14 +111,18 @@ export default [
                 icon: 'network-drive',
                 routes: [
                   {
+                    path: '/product/cloud',
+                    redirect: '/product/cloud/building'
+                  },
+                  {
                     path: '/product/cloud/building',
                     name: 'build',
-                    component: './Product/Cloud/Building'
+                    component: './product/cloud/Building'
                   },
                   {
                     path: '/product/cloud/curing',
                     name: 'curing',
-                    component: './Product/Cloud/Curing'
+                    component: './product/cloud/Curing'
                   }
                 ]
               }

+ 1 - 1
src/components/EditableForm/src/editableFormItem.jsx

@@ -6,7 +6,7 @@ import LazyCascader from '../../LazyCascader'
 import { connect } from 'dva'
 import './index.less'
 import useOptions from './useOptions'
-import ChangeSelect from '@/pages/Customer/Company/components/ChangeSelect'
+import ChangeSelect from '@/pages/customer/Company/components/ChangeSelect'
 
 const EditableFormItem = ({
   type,

+ 1 - 1
src/layouts/BasicLayout.jsx

@@ -121,7 +121,7 @@ const BasicLayout = props => {
       {...props}
       {...settings}
       onCollapse={handleMenuCollapse}
-      onMenuHeaderClick={() => history.push('/')}
+      onMenuHeaderClick={() => history.push('/workbench/dashboard')}
       menuItemRender={(menuItemProps, defaultDom) => {
         if (menuItemProps.isUrl || !menuItemProps.path) {
           return defaultDom

+ 2 - 2
src/models/company.js

@@ -1,6 +1,6 @@
 import consts from '@/consts'
-import { TagTypeEnum } from '@/pages/Customer/Company/components/PersonLabel'
-import { LabelStatusColorMap } from '@/pages/Customer/Company/components/PersonLabel'
+import { TagTypeEnum } from '@/pages/customer/Company/components/PersonLabel'
+import { LabelStatusColorMap } from '@/pages/customer/Company/components/PersonLabel'
 import { queryTagList } from '@/services/customer'
 
 export default {

+ 2 - 2
src/models/contact.js

@@ -1,6 +1,6 @@
 import consts from '@/consts'
-import { TagTypeEnum } from '@/pages/Customer/Company/components/PersonLabel'
-import { LabelStatusColorMap } from '@/pages/Customer/Company/components/PersonLabel'
+import { TagTypeEnum } from '@/pages/customer/Company/components/PersonLabel'
+import { LabelStatusColorMap } from '@/pages/customer/Company/components/PersonLabel'
 import { queryTagList } from '@/services/customer'
 
 export default {

+ 3 - 3
src/models/login.js

@@ -26,7 +26,7 @@ const Model = {
         saveTokenId(response.data.token)
         const urlParams = new URL(window.location.href)
         const params = getPageQuery()
-        message.success('🎉 🎉 🎉  登录成功')
+        message.success('🎉 🎉 🎉  登录成功')
         let { redirect } = params
 
         if (redirect) {
@@ -39,12 +39,12 @@ const Model = {
               redirect = redirect.substr(redirect.indexOf('#') + 1)
             }
           } else {
-            window.location.href = '/'
+            window.location.href = '/workbench/dashboard'
             return
           }
         }
 
-        history.replace(redirect || '/')
+        history.replace(redirect || '/workbench/dashboard')
       }
     },
 

+ 1 - 1
src/pages/Customer/Company/components/CompanyDetail/CompanyLowerList.jsx

@@ -1,7 +1,7 @@
 import { Tabs, List } from 'antd'
 import { dayjsFormat } from '@/utils/utils'
 import { useModal } from '@/components/Modal'
-import ContactDetail from '@/pages/Customer/Contact/components/ContactDetail'
+import ContactDetail from '@/pages/customer/Contact/components/ContactDetail'
 
 const CompanyLowerList = props => {
   const { toggleModal, setModalProps } = useModal()

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

@@ -2,9 +2,9 @@ import React, { useState, useEffect } from 'react'
 import { Row, Col, Spin } from 'antd'
 import consts from '@/consts'
 import { apiCompanyDetail } from '@/services/company'
-import CompanyForm from '@/pages/Customer/Company/components/CompanyDetail/CompanyForm'
-import CompanyLowerList from '@/pages/Customer/Company/components/CompanyDetail/CompanyLowerList'
-import CompanyTabList from '@/pages/Customer/Company/components/CompanyDetail/CompanyTabList'
+import CompanyForm from '@/pages/customer/Company/components/CompanyDetail/CompanyForm'
+import CompanyLowerList from '@/pages/customer/Company/components/CompanyDetail/CompanyLowerList'
+import CompanyTabList from '@/pages/customer/Company/components/CompanyDetail/CompanyTabList'
 import { connect } from 'dva'
 
 const Index = props => {

+ 2 - 2
src/pages/Customer/Company/index.jsx

@@ -6,8 +6,8 @@ import { connect } from 'dva'
 import consts from '@/consts'
 import { queryCompany, apiAddCompany } from '@/services/company'
 import LazyCascader from '@/components/LazyCascader'
-import CompanyDetail from '@/pages/Customer/Company/components/CompanyDetail'
-import AddCompany from '@/pages/Customer/Company/components/AddCompany'
+import CompanyDetail from '@/pages/customer/Company/components/CompanyDetail'
+import AddCompany from '@/pages/customer/Company/components/AddCompany'
 import { useModal } from '@/components/Modal'
 import { formatValues } from '@/components/LazyCascader'
 import PersonLabel from './components/PersonLabel'

+ 1 - 1
src/pages/Customer/Contact/components/ChangeCompany/index.jsx

@@ -3,7 +3,7 @@ import { IconPark } from '@/components/SvgIcon'
 import { Card, Tooltip } from 'antd'
 import React from 'react'
 import styles from './index.less'
-import SearchModal from '@/pages/Customer/Contact/components/CustomerModal'
+import SearchModal from '@/pages/customer/Contact/components/CustomerModal'
 import { apiDelCustomer } from '@/services/contact'
 import { useDispatch } from 'dva'
 import consts from '@/consts'

+ 1 - 1
src/pages/Customer/Contact/components/ContactDetail/ContanctForm.jsx

@@ -1,7 +1,7 @@
 import { Row, Col } from 'antd'
 import React from 'react'
 import EditableForm from '@/components/EditableForm'
-import ChangeCompanyInput from '@/pages/Customer/Contact/components/ChangeCompany/'
+import ChangeCompanyInput from '@/pages/customer/Contact/components/ChangeCompany'
 
 const ContanctForm = props => {
   const { client } = props

+ 3 - 3
src/pages/Customer/Contact/components/ContactDetail/index.jsx

@@ -1,8 +1,8 @@
 import { Row, Col, Spin } from 'antd'
 import React, { useState, useEffect } from 'react'
-import ContanctForm from '@/pages/Customer/Contact/components/ContactDetail/ContanctForm.jsx'
-import ContanctTabList from '@/pages/Customer/Contact/components/ContactDetail/ContanctTabList.jsx'
-import ContanctLowerList from '@/pages/Customer/Contact/components/ContactDetail/ContanctLowerList.jsx'
+import ContanctForm from '@/pages/customer/Contact/components/ContactDetail/ContanctForm.jsx'
+import ContanctTabList from '@/pages/customer/Contact/components/ContactDetail/ContanctTabList.jsx'
+import ContanctLowerList from '@/pages/customer/Contact/components/ContactDetail/ContanctLowerList.jsx'
 import { apiContactDetail } from '@/services/contact'
 import consts from '@/consts'
 import { connect } from 'dva'

+ 2 - 2
src/pages/Customer/Contact/index.jsx

@@ -1,5 +1,5 @@
-import ContactDetail from '@/pages/Customer/Contact/components/ContactDetail'
-import Addcontact from '@/pages/Customer/Contact/components/AddContact'
+import ContactDetail from '@/pages/customer/Contact/components/ContactDetail'
+import Addcontact from '@/pages/customer/Contact/components/AddContact'
 import ProTable from '@ant-design/pro-table'
 import { Button, Input, message, Tag } from 'antd'
 import { connect, useParams } from 'dva'

+ 1 - 1
src/pages/Customer/Test/index.jsx

@@ -3,7 +3,7 @@ import { Button, Card, Cascader, Dropdown, Input, Menu, Select, Pagination } fro
 import EditableForm from '@/components/EditableForm'
 import { useModal } from '@/components/Modal'
 import { connect } from 'dva'
-import SearchModal from '@/pages/Customer/Contact/components/CustomerModal'
+import SearchModal from '@/pages/customer/Contact/components/CustomerModal'
 import ChangeCompanyInput from '../Contact/components/ChangeCompany'
 import PersonLabel from '../Company/components/PersonLabel'
 import { TagTypeEnum } from '../Company/components/PersonLabel'

+ 1 - 1
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockForm.jsx

@@ -1,6 +1,6 @@
 import React, { useEffect } from 'react'
 import { Row, Col, Divider } from 'antd'
-import { ProductLabel } from '@/pages/Product/Lock/Lockstore'
+import { ProductLabel } from '@/pages/product/lock/Lockstore'
 
 // import EditableForm from '@/components/EditableForm'
 

+ 1 - 1
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockTabList.jsx

@@ -3,7 +3,7 @@ import { Row, Col, List, Tabs, message, Button } from 'antd'
 import { dayjsFormat } from '@/utils/utils'
 import consts from '@/consts'
 import { apiSoftwareAddLonglelog } from '@/services/lock'
-import { ProductLabel } from '@/pages/Product/Lock/Lockstore'
+import { ProductLabel } from '@/pages/product/lock/Lockstore'
 import LockModal from './LockModal'
 import { lockTypeEnum } from './LockModal'
 import { servicelogEnum, showProductsStatus, showNewLongleStatus, showMarkStatus } from './consts'

+ 3 - 3
src/pages/Product/Lock/Lockstore/components/LocksDetail/index.jsx

@@ -2,9 +2,9 @@ import React, { useState, useEffect } from 'react'
 import { Row, Col } from 'antd'
 import consts from '@/consts'
 import { apiSoftwareDetail } from '@/services/lock'
-import LockForm from '@/pages/Product/Lock/Lockstore/components/LocksDetail/LockForm.jsx'
-import LockLowerList from '@/pages/Product/Lock/Lockstore/components/LocksDetail/LockLowerList'
-import LockTabList from '@/pages/Product/Lock/Lockstore/components/LocksDetail/LockTabList'
+import LockForm from '@/pages/product/lock/Lockstore/components/LocksDetail/LockForm.jsx'
+import LockLowerList from '@/pages/product/lock/Lockstore/components/LocksDetail/LockLowerList'
+import LockTabList from '@/pages/product/lock/Lockstore/components/LocksDetail/LockTabList'
 import { connect } from 'dva'
 
 const Index = props => {

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

@@ -4,7 +4,7 @@ import ProTable from '@ant-design/pro-table'
 import useAutoTable from '@/hooks/useAutoTable'
 import consts from '@/consts'
 import { queryLock } from '@/services/lock'
-import LocksDetail from '@/pages/Product/Lock/Lockstore/components/LocksDetail'
+import LocksDetail from '@/pages/product/lock/Lockstore/components/LocksDetail'
 import { useDebounceFn } from 'ahooks'
 import { useModal } from '@/components/Modal'
 

+ 0 - 56
src/pages/Welcome.jsx

@@ -1,56 +0,0 @@
-import React from 'react'
-import { PageContainer } from '@ant-design/pro-layout'
-import { Card, Alert, Typography } from 'antd'
-import styles from './Welcome.less'
-
-const CodePreview = ({ children }) => (
-  <pre className={styles.pre}>
-    <code>
-      <Typography.Text copyable>{children}</Typography.Text>
-    </code>
-  </pre>
-)
-
-export default () => (
-  <PageContainer>
-    <Card>
-      <Alert
-        message="更快更强的重型组件,已经发布。"
-        type="success"
-        showIcon
-        banner
-        style={{
-          margin: -12,
-          marginBottom: 24
-        }}
-      />
-      <Typography.Text strong>
-        高级表格{' '}
-        <a
-          href="https://procomponents.ant.design/components/table"
-          rel="noopener noreferrer"
-          target="__blank"
-        >
-          欢迎使用
-        </a>
-      </Typography.Text>
-      <CodePreview>yarn add @ant-design/pro-table</CodePreview>
-      <Typography.Text
-        strong
-        style={{
-          marginBottom: 12
-        }}
-      >
-        高级布局{' '}
-        <a
-          href="https://procomponents.ant.design/components/layout"
-          rel="noopener noreferrer"
-          target="__blank"
-        >
-          欢迎使用
-        </a>
-      </Typography.Text>
-      <CodePreview>yarn add @ant-design/pro-layout</CodePreview>
-    </Card>
-  </PageContainer>
-)

+ 0 - 8
src/pages/Welcome.less

@@ -1,8 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.pre {
-  margin: 12px 0;
-  padding: 12px 20px;
-  background: @input-bg;
-  box-shadow: @card-shadow;
-}

src/pages/Workbench/workbench.jsx → src/pages/workbench/Dashboard/index.jsx


+ 1 - 1
src/services/customer.js

@@ -1,6 +1,6 @@
 import request from '@/basic/utils/request'
 import consts from '@/consts'
-import { LabelChangeType } from '@/pages/Customer/Company/components/PersonLabel'
+import { LabelChangeType } from '@/pages/customer/Company/components/PersonLabel'
 
 /**
  * 获取客户列表

+ 2 - 2
windi.config.js

@@ -2,7 +2,7 @@
 import { defineConfig } from 'windicss/helpers'
 import lineClamp from 'windicss/plugin/line-clamp'
 import colors from 'windicss/colors'
-import proSettings from 'config/defaultSettings'
+import proSettings from './config/defaultSettings'
 
 export default defineConfig({
   darkMode: 'class',
@@ -29,7 +29,7 @@ export default defineConfig({
  * @param maxOutput The larger the maxOutput output, the larger the generated css volume
  */
 function createEnterPlugin(maxOutput = 10) {
-  const createCss = (index, d = 'x') => {
+  const createCss = (index: number, d = 'x') => {
     const upd = d.toUpperCase()
     return {
       [`*> .enter-${d}:nth-child(${index})`]: {