浏览代码

feat: 控制台报错信息修复

lanjianrong 4 年之前
父节点
当前提交
8c3163b5bb

+ 2 - 2
config/routes.ts

@@ -37,13 +37,13 @@
       {
         path: '/role/system',
         name: 'system',
-        component: './Role/System',
+        component: './role/System',
         access: 'authRouteFilter'
       },
       {
         path: '/role/customer',
         name: 'customer',
-        component: './Role/Customer',
+        component: './role/Customer',
         access: 'authRouteFilter'
       }
     ]

+ 2 - 2
package.json

@@ -108,8 +108,8 @@
     "puppeteer-core": "^8.0.0",
     "stylelint": "^13.0.0",
     "typescript": "^4.2.2",
-    "windicss": "3.0.12",
-    "windicss-webpack-plugin": "1.0.0"
+    "windicss": "3.1.3",
+    "windicss-webpack-plugin": "1.2.1"
   },
   "engines": {
     "node": ">=10.0.0"

+ 16 - 0
src/global.less

@@ -74,3 +74,19 @@ ol {
 .popoverList li:hover {
   color: #886ab5;
 }
+
+.group-item-card {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 1rem;
+  word-wrap: break-word;
+  background-color: #fff;
+  background-clip: border-box;
+  border: 1px solid rgba(0, 0, 0, 0.08);
+  border-radius: 4px;
+  box-shadow: 0 0 13px 0 rgba(74, 53, 107, 0.08);
+  &:not(:last-of-type) {
+    margin-bottom: 1rem;
+  }
+}

+ 3 - 3
src/pages/Business/Attendance/components/ShowTitleMenu.tsx

@@ -1,12 +1,12 @@
 import React from 'react'
-import '@/pages/Role/System/components/RoleMenu/index.less'
+// import '@/pages/Role/System/components/RoleMenu/index.less'
 
 interface ShowTitleMenuProps {
   itemTitle: string
 }
 const showTitleMenu: React.FC<ShowTitleMenuProps> = ({ itemTitle }) => {
   return (
-    <div className="h-full w-max-234px rounded-4px roleMenu">
+    <div className="h-full w-max-234px rounded-4px shadow-card">
       <div className="p-4 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] justify-around text-left">
         <span>栏目/功能</span>
       </div>
@@ -14,7 +14,7 @@ const showTitleMenu: React.FC<ShowTitleMenuProps> = ({ itemTitle }) => {
         <ul className="p-0 m-0 list-none text-primary flex flex-col flex-1">
           <li
             className={
-              'flex justify-between items-center py-2 px-5 cursor-pointer scale-up-center'
+              'flex justify-between items-center py-2 px-5 cursor-pointer scale-up-center text-white bg-primary rounded-4px'
             }>
             {itemTitle}
           </li>

+ 0 - 17
src/pages/Role/System/components/ConnectModal/index.less

@@ -1,17 +0,0 @@
-.modal-content {
-  .card {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    padding: 1rem;
-    word-wrap: break-word;
-    background-color: #fff;
-    background-clip: border-box;
-    border: 1px solid rgba(0, 0, 0, 0.08);
-    border-radius: 4px;
-    box-shadow: 0 0 13px 0 rgba(74, 53, 107, 0.08);
-    &:not(:last-of-type) {
-      margin-bottom: 1rem;
-    }
-  }
-}

+ 4 - 10
src/pages/Role/System/components/ConnectModal/index.tsx

@@ -1,10 +1,8 @@
-import { useRequest } from 'umi'
-import { Button, Input, message, Modal } from 'antd'
 import React, { useState, useRef, useEffect } from 'react'
+import { useRequest, request } from 'umi'
+import { Button, Input, message, Modal } from 'antd'
 import { fetchStaffList } from '@/services/user/api'
 import { LoadingOutlined, MoreOutlined } from '@ant-design/icons'
-import { request } from 'umi'
-import './index.less'
 
 interface ConnectModalProps {
   postUrl: string
@@ -99,10 +97,6 @@ const ConnectModal: React.FC<ConnectModalProps> = ({
       params.id = dataId
     }
     await tryConnectStaff(params)
-    // // 动态
-    // if (onReload) {
-    //   await onReload()
-    // }
     handleOnCancel()
   }
   return (
@@ -125,9 +119,9 @@ const ConnectModal: React.FC<ConnectModalProps> = ({
             style={{ width: '95%' }}
             allowClear={true}></Input.Search>
         }>
-        <div ref={containerRef} className="h-60vh overflow-y-auto overflow-x-hidden modal-content">
+        <div ref={containerRef} className="h-60vh overflow-y-auto overflow-x-hidden">
           {list.map(item => (
-            <div className="card" key={item.id}>
+            <div className="group-item-card" key={item.id}>
               <div className="w-4/3 flex justify-between">
                 <span className="w-1/5">{item.username}</span>
                 <span className="w-2/5">{item.phone}</span>

+ 6 - 6
src/pages/Role/System/components/RoleMenu/index.less

@@ -1,10 +1,10 @@
-.roleMenu {
-  box-shadow: rgba(74, 53, 107, 0.08) 0 0 13px 0;
+// .roleMenu {
+//   box-shadow: 0 0 13px 0 rgba(74, 53, 107, 0.08);
 
-  .active {
-    @apply text-white bg-primary rounded-4px;
-  }
-}
+//   .active {
+//     @apply text-white bg-primary rounded-4px;
+//   }
+// }
 
 .scale-up-center {
   -webkit-animation: scale-up-center 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;

+ 2 - 2
src/pages/Role/System/components/RoleMenu/index.tsx

@@ -1,7 +1,6 @@
 import React, { useState, useEffect } from 'react'
 import { PlusOutlined, DownOutlined } from '@ant-design/icons'
 import { Button, message, Popconfirm, Popover, Input } from 'antd'
-import './index.less'
 import { useRequest } from 'umi'
 import {
   createRoleWithMenuId,
@@ -10,6 +9,7 @@ import {
   updateStaff
 } from '@/services/user/api'
 import { ModalForm, ProFormText } from '@ant-design/pro-form'
+import './index.less'
 
 type RoleMenuProps = {
   menuId: string
@@ -85,7 +85,7 @@ const RoleMenu: React.FC<RoleMenuProps> = ({ menuId, onSelect, itemCount }) => {
   }
 
   return (
-    <div className="h-full w-max-234px rounded-4px roleMenu">
+    <div className="h-full w-max-234px rounded-4px">
       <div className="p-4 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] flex justify-around items-center">
         <span className="text-[0.9375rem]">角色列表</span>
 

+ 3 - 0
windi.config.ts

@@ -19,6 +19,9 @@ export default defineConfig({
         lg: '992px',
         xl: '1200px',
         '2xl': '1600px'
+      },
+      boxShadow: {
+        card: '0 0 13px 0 rgba(74, 53, 107, 0.08)'
       }
     }
   },