lanjianrong 3 jaren geleden
bovenliggende
commit
408c6d7393

+ 2 - 4
config/config.ts

@@ -18,11 +18,11 @@ export default defineConfig({
   initialState: {},
   access: {},
   dva: {},
-  mfsu: {},
   srcTranspiler: 'esbuild',
+  mfsu: {},
   fastRefresh: true,
   unocss: {
-    watch: ['src/pages/**/*.{jsx,tsx,less}', 'src/components/**/*.{jsx,tsx,less}'] // 添加其他包含 unocss 的 classname 的文件目录
+    watch: ['src/*.{jsx,tsx,less}', 'src/pages/**/*.{jsx,tsx,less}', 'src/components/**/*.{jsx,tsx,less}'] // 添加其他包含 unocss 的 classname 的文件目录
   },
   // Fast Refresh 热更新
   theme: {},
@@ -39,8 +39,6 @@ export default defineConfig({
   proxy: proxy[REACT_APP_ENV || 'dev'],
   manifest: { basePath: '/' },
   extraBabelPlugins: [
-    '@babel/plugin-proposal-nullish-coalescing-operator',
-    '@babel/plugin-proposal-optional-chaining',
     ['import', { libraryName: '@formily/antd', libraryDirectory: 'esm', style: true }, '@formily/antd']
   ]
   // chainWebpack(config, { env }) {

+ 0 - 4
package.json

@@ -61,10 +61,6 @@
     "react-sortable-hoc": "^2.0.0"
   },
   "devDependencies": {
-    "@babel/plugin-proposal-class-properties": "^7.16.7",
-    "@babel/plugin-proposal-decorators": "^7.17.2",
-    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.17.12",
-    "@babel/plugin-proposal-optional-chaining": "^7.13.12",
     "@types/lodash": "^4.14.144",
     "@types/react": "^18.0.0",
     "@types/react-dom": "^18.0.0",

+ 0 - 28
src/global.less

@@ -56,34 +56,6 @@ ol {
   }
 }
 
-.scale-up-center {
-  -webkit-animation: scale-up-center 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
-  animation: scale-up-center 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
-}
-
-@-webkit-keyframes scale-up-center {
-  0% {
-    -webkit-transform: scale(0.5);
-    transform: scale(0.5);
-  }
-  100% {
-    -webkit-transform: scale(1);
-    transform: scale(1);
-    @apply text-white bg-primary rounded-4px;
-  }
-}
-@keyframes scale-up-center {
-  0% {
-    -webkit-transform: scale(0.5);
-    transform: scale(0.5);
-  }
-  100% {
-    -webkit-transform: scale(1);
-    transform: scale(1);
-    @apply text-white bg-primary rounded-4px;
-  }
-}
-
 .flow-popover {
   & .ant-popover-inner-content {
     padding: 12px 16px !important;

+ 16 - 6
src/pages/Permission/Role/components/RoleLeftMenu/index.less

@@ -3,20 +3,30 @@
 }
 .department-node {
   height: 32px;
-  @apply flex justify-between items-center flex-nowrap;
+  max-width: 152px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
   .title {
-    max-width: 110px;
-    @apply line-clamp-1;
+    word-wrap: break-word; /*强制换行*/
+    overflow: hidden; /*超出隐藏*/
+    text-overflow: ellipsis; /*隐藏后添加省略号*/
+    white-space: nowrap; /*强制不换行*/
   }
   .extra {
     display: none;
-    right: 0;
-    @apply mr-1 hover:cursor-pointer;
+    margin-right: 0.25rem;
+    &:hover {
+      cursor: pointer;
+    }
   }
 
   &:hover {
     .extra {
-      @apply flex justify-between items-center flex-nowrap;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      flex-wrap: nowrap;
     }
   }
 }

+ 3 - 2
src/pages/Permission/Role/components/RoleLeftMenu/index.tsx

@@ -118,7 +118,8 @@ const RoleLeftMenu: React.FC<RoleLeftMenuProps> = ({
     })
   }
 
-  const virtualHeigh = document.getElementById('role-list')?.clientHeight
+  const virtualHeight = document.getElementById('role-list')?.clientHeight
+  console.log(virtualHeight)
 
   if (!menuRoles?.length || isNullOrUnDef(defaultActiveRole)) return null
   return (
@@ -152,7 +153,7 @@ const RoleLeftMenu: React.FC<RoleLeftMenuProps> = ({
         {menuRoles.length ? (
           <DirectoryTree
             itemHeight={32}
-            height={virtualHeigh - 32}
+            height={virtualHeight - 32}
             defaultSelectedKeys={[menuRoles[0]?.key]}
             onSelect={(keys, node) => onSelect(keys[0], node.node.roleType)}
             showIcon={false}