zhaojijng %!s(int64=2) %!d(string=hai) anos
pai
achega
100b284745
Modificáronse 4 ficheiros con 23 adicións e 5 borrados
  1. 3 3
      config/config.ts
  2. 1 1
      package.json
  3. 16 0
      src/assets/css/map.less
  4. 3 1
      src/pages/Equipment/index.tsx

+ 3 - 3
config/config.ts

@@ -9,7 +9,7 @@ import routes from './routes';
 const { REACT_APP_ENV } = process.env;
 // let envValus = REACT_APP_ENV.split('-');
 // let env = envValus[0];
-// console.log('env', REACT_APP_ENV);
+console.log('env', REACT_APP_ENV);
 //debugger;
 export default defineConfig({
   hash: true,
@@ -50,8 +50,8 @@ export default defineConfig({
   title: false,
   ignoreMomentLocale: true,
   base: '/sgadmin/',
-  publicPath: '/sgadmin/',
-  outputPath: 'sgadmin',
+  publicPath: REACT_APP_ENV === 'pro' ? '/sgadmin/' : '/',
+  outputPath: 'dist',
   proxy: proxy[REACT_APP_ENV || 'dev'],
   manifest: {
     basePath: '/sgadmin',

+ 1 - 1
package.json

@@ -5,7 +5,7 @@
   "description": "An out-of-box UI solution for enterprise applications",
   "scripts": {
     "analyze": "cross-env ANALYZE=1 umi build",
-    "build": "umi build",
+    "build": "cross-env REACT_APP_ENV=pro umi build",
     "deploy": "npm run build && npm run gh-pages",
     "dev": "npm run start:dev",
     "gh-pages": "gh-pages -d dist",

+ 16 - 0
src/assets/css/map.less

@@ -33,6 +33,22 @@
     position: absolute;
     border: 2px solid #fff;
     border-radius: 6px;
+    .noDevice {
+      position: absolute;
+      top: 0;
+      left: 0;
+      box-sizing: border-box;
+      width: 100%;
+      height: 100%;
+      padding: 4px;
+      white-space: nowrap;
+      background: rgba(255, 255, 255, 0.8);
+      .noText {
+        padding: 4px 6px;
+        background-color: #ccc;
+        border-radius: 5px;
+      }
+    }
     .allDevice {
       position: absolute;
       top: 6px;

+ 3 - 1
src/pages/Equipment/index.tsx

@@ -420,7 +420,9 @@ const Environment: React.FC = () => {
                   }}
                 >
                   {selNav.id !== 'all' && item[selNav.id] == 'not' && (
-                    <div className={mapstyles.allDevice}>无设备</div>
+                    <div className={mapstyles.noDevice}>
+                      <span className={mapstyles.noText}>无设备</span>
+                    </div>
                   )}
                   {selNav.id == 'all' && (
                     <div className={mapstyles.allDevice}>