wenhongquan 3 سال پیش
والد
کامیت
a3be63dc81

BIN
ruoyi-ui/src/assets/images/login-background.jpg


+ 3 - 3
ruoyi-ui/src/layout/components/Navbar.vue

@@ -8,7 +8,7 @@
     <div class="right-menu">
       <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
-        
+
         <el-tooltip content="源码地址" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
         </el-tooltip>
@@ -26,10 +26,10 @@
       </template>
 
       <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
-        <div class="avatar-wrapper">
+        <!-- <div class="avatar-wrapper">
           <img :src="avatar" class="user-avatar">
           <i class="el-icon-caret-bottom" />
-        </div>
+        </div> -->
         <el-dropdown-menu slot="dropdown">
           <router-link to="/user/profile">
             <el-dropdown-item>个人中心</el-dropdown-item>

+ 170 - 172
ruoyi-ui/src/router/index.js

@@ -29,186 +29,184 @@ import Layout from '@/layout'
  */
 
 // 公共路由
-export const constantRoutes = [
-  {
-    path: '/redirect',
-    component: Layout,
-    hidden: true,
-    children: [
-      {
-        path: '/redirect/:path(.*)',
-        component: () => import('@/views/redirect')
-      }
-    ]
-  },
-  {
-    path: '/login',
-    component: () => import('@/views/login'),
-    hidden: true
-  },
-  {
-    path: '/register',
-    component: () => import('@/views/register'),
-    hidden: true
-  },
-  {
-    path: '/home',
-    component: () => import('@/views/home'),
-    hidden: true,
-    children: [
-      {
-        path: "/plan",
-        name: "plan",
-        component: () => import("@/views/plan/index.vue")
-      },
-      {
-        path: "/addPlan",
-        name: "addPlan",
-        component: () => import("@/views/plan/add.vue")
-      },
-      {
-        path: "/report",
-        name: "report",
-        component: () => import("@/views/report/index.vue")
-      },
-      {
-        path: "/addReport",
-        name: "addReport",
-        component: () => import("@/views/report/add.vue")
-      },
-    ]
-  },
-  // {
-  //   path: '/plan',
-  //   component: () => import('@/views/plan'),
-  //   hidden: true
-  // },
-  {
-    path: '/404',
-    component: () => import('@/views/error/404'),
-    hidden: true
-  },
-  {
-    path: '/401',
-    component: () => import('@/views/error/401'),
-    hidden: true
-  },
-  {
-    path: '/home',
-    component: () => import('@/views/home'),
-    hidden: true
-  },
-  {
-    path: '',
-    component: Layout,
-    redirect: 'index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/index'),
-        name: 'Index',
-        meta: { title: '首页', icon: 'dashboard', affix: true }
-      }
-    ]
-  },
-  {
-    path: '/user',
-    component: Layout,
-    hidden: true,
-    redirect: 'noredirect',
-    children: [
-      {
-        path: 'profile',
-        component: () => import('@/views/system/user/profile/index'),
-        name: 'Profile',
-        meta: { title: '个人中心', icon: 'user' }
-      }
-    ]
-  }
+export const constantRoutes = [{
+        path: '/redirect',
+        component: Layout,
+        hidden: true,
+        children: [{
+            path: '/redirect/:path(.*)',
+            component: () =>
+                import ('@/views/redirect')
+        }]
+    },
+    {
+        path: '/login',
+        component: () =>
+            import ('@/views/login'),
+        hidden: true
+    },
+    {
+        path: '/register',
+        component: () =>
+            import ('@/views/register'),
+        hidden: true
+    },
+    {
+        path: '/home',
+        component: () =>
+            import ('@/views/home'),
+        hidden: false,
+        children: [{
+                path: "/plan",
+                name: "plan",
+                component: () =>
+                    import ("@/views/plan/index.vue")
+            },
+            {
+                path: "/addPlan",
+                name: "addPlan",
+                component: () =>
+                    import ("@/views/plan/add.vue")
+            },
+            {
+                path: "/report",
+                name: "report",
+                component: () =>
+                    import ("@/views/report/index.vue")
+            },
+            {
+                path: "/addReport",
+                name: "addReport",
+                component: () =>
+                    import ("@/views/report/add.vue")
+            },
+        ]
+    },
+    // {
+    //   path: '/plan',
+    //   component: () => import('@/views/plan'),
+    //   hidden: true
+    // },
+    {
+        path: '/404',
+        component: () =>
+            import ('@/views/error/404'),
+        hidden: true
+    },
+    {
+        path: '/401',
+        component: () =>
+            import ('@/views/error/401'),
+        hidden: true
+    },
+    // {
+    //   path: '/home',
+    //   component: () => import('@/views/home'),
+    //   hidden: true
+    // },
+    {
+        path: '',
+        component: Layout,
+        redirect: 'plan',
+        children: [{
+            path: 'index',
+            component: () =>
+                import ('@/views/index'),
+            name: 'Index',
+            meta: { title: '首页', icon: 'dashboard', affix: true }
+        }]
+    },
+    {
+        path: '/user',
+        component: Layout,
+        hidden: true,
+        redirect: 'noredirect',
+        children: [{
+            path: 'profile',
+            component: () =>
+                import ('@/views/system/user/profile/index'),
+            name: 'Profile',
+            meta: { title: '个人中心', icon: 'user' }
+        }]
+    }
 ]
 
 // 动态路由,基于用户权限动态去加载
-export const dynamicRoutes = [
-  {
-    path: '/system/user-auth',
-    component: Layout,
-    hidden: true,
-    permissions: ['system:user:edit'],
-    children: [
-      {
-        path: 'role/:userId(\\d+)',
-        component: () => import('@/views/system/user/authRole'),
-        name: 'AuthRole',
-        meta: { title: '分配角色', activeMenu: '/system/user' }
-      }
-    ]
-  },
-  {
-    path: '/system/role-auth',
-    component: Layout,
-    hidden: true,
-    permissions: ['system:role:edit'],
-    children: [
-      {
-        path: 'user/:roleId(\\d+)',
-        component: () => import('@/views/system/role/authUser'),
-        name: 'AuthUser',
-        meta: { title: '分配用户', activeMenu: '/system/role' }
-      }
-    ]
-  },
-  {
-    path: '/system/dict-data',
-    component: Layout,
-    hidden: true,
-    permissions: ['system:dict:list'],
-    children: [
-      {
-        path: 'index/:dictId(\\d+)',
-        component: () => import('@/views/system/dict/data'),
-        name: 'Data',
-        meta: { title: '字典数据', activeMenu: '/system/dict' }
-      }
-    ]
-  },
-  {
-    path: '/monitor/job-log',
-    component: Layout,
-    hidden: true,
-    permissions: ['monitor:job:list'],
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/monitor/job/log'),
-        name: 'JobLog',
-        meta: { title: '调度日志', activeMenu: '/monitor/job' }
-      }
-    ]
-  },
-  {
-    path: '/tool/gen-edit',
-    component: Layout,
-    hidden: true,
-    permissions: ['tool:gen:edit'],
-    children: [
-      {
-        path: 'index/:tableId(\\d+)',
-        component: () => import('@/views/tool/gen/editTable'),
-        name: 'GenEdit',
-        meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
-      }
-    ]
-  }
+export const dynamicRoutes = [{
+        path: '/system/user-auth',
+        component: Layout,
+        hidden: true,
+        permissions: ['system:user:edit'],
+        children: [{
+            path: 'role/:userId(\\d+)',
+            component: () =>
+                import ('@/views/system/user/authRole'),
+            name: 'AuthRole',
+            meta: { title: '分配角色', activeMenu: '/system/user' }
+        }]
+    },
+    {
+        path: '/system/role-auth',
+        component: Layout,
+        hidden: true,
+        permissions: ['system:role:edit'],
+        children: [{
+            path: 'user/:roleId(\\d+)',
+            component: () =>
+                import ('@/views/system/role/authUser'),
+            name: 'AuthUser',
+            meta: { title: '分配用户', activeMenu: '/system/role' }
+        }]
+    },
+    {
+        path: '/system/dict-data',
+        component: Layout,
+        hidden: true,
+        permissions: ['system:dict:list'],
+        children: [{
+            path: 'index/:dictId(\\d+)',
+            component: () =>
+                import ('@/views/system/dict/data'),
+            name: 'Data',
+            meta: { title: '字典数据', activeMenu: '/system/dict' }
+        }]
+    },
+    {
+        path: '/monitor/job-log',
+        component: Layout,
+        hidden: true,
+        permissions: ['monitor:job:list'],
+        children: [{
+            path: 'index',
+            component: () =>
+                import ('@/views/monitor/job/log'),
+            name: 'JobLog',
+            meta: { title: '调度日志', activeMenu: '/monitor/job' }
+        }]
+    },
+    {
+        path: '/tool/gen-edit',
+        component: Layout,
+        hidden: true,
+        permissions: ['tool:gen:edit'],
+        children: [{
+            path: 'index/:tableId(\\d+)',
+            component: () =>
+                import ('@/views/tool/gen/editTable'),
+            name: 'GenEdit',
+            meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
+        }]
+    }
 ]
 
 // 防止连续点击多次路由报错
 let routerPush = Router.prototype.push;
 Router.prototype.push = function push(location) {
-  return routerPush.call(this, location).catch(err => err)
+    return routerPush.call(this, location).catch(err => err)
 }
 
 export default new Router({
-  mode: 'history', // 去掉url中的#
-  scrollBehavior: () => ({ y: 0 }),
-  routes: constantRoutes
-})
+    mode: 'history', // 去掉url中的#
+    scrollBehavior: () => ({ y: 0 }),
+    routes: constantRoutes
+})

+ 12 - 9
ruoyi-ui/src/views/home/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container home" >
-              <div class="title_top">
+              <div class="title_top" style="position:fixed">
                   <el-menu
                             :default-active="activeIndex"
                             class="el-menu-demo"
@@ -16,8 +16,8 @@
                             <el-menu-item index="4">档案管理</el-menu-item>
                             </el-menu>
 
-                               <div class="avatar-wrapper" style="padding-top:10rem;margin-left:800rem;display:inline-flex">
-                                      <div> <img :src="user.photo" class="user-avatar">  </div>
+                               <div class="avatar-wrapper" style="float:right;padding-top:10rem;position: absolute;right: 10px;display:inline-flex">
+                                      <!-- <div> <img :src="user.photo" class="user-avatar">  </div> -->
                                       <div style="font-size: 16rem;
                                                   font-family: PingFangSC, PingFangSC-Regular;
                                                   font-weight: 400;
@@ -28,9 +28,9 @@
                                       <div style="margin-left:5rem" > <img src="@/assets/images/images/exit.png" @click="logout"/>  </div>
                                 </div>
               </div>
-              <div style="display:inline-flex;width:100%;height:93vh">
+              <div style="display:inline-flex;width:100%;height:93vh;top:7vh;position:fixed">
                    <div class='left_menu'>
-                             <div style="text-align:center;margin-top:13rem" @click='handleMsg("/plan",1)'>
+                             <div style="text-align:center;margin-top:33rem" @click='handleMsg("/plan",1)'>
                                 <!-- <router-link key="collapse" class="sidebar-logo-link" to="/system/plan"> -->
                                         <img src='@/assets/images/images/plan_entry.png' style="width:40rem;height:40rem"/>
                                         <div :class='divSelect == 1?"icon_fontSelect":"icon_font"'>
@@ -57,7 +57,7 @@
                          <div style="height:89vh">
                             <router-view style="width:100%;height:100%"></router-view>
                          </div>
-                   </div>                
+                   </div>
               </div>
   </div>
 </template>
@@ -74,7 +74,7 @@ export default {
     return {
       // 版本号
       version: "3.8.2",
-      activeIndex:1,
+      activeIndex:"1",
       divSelect:1,
       user:{}
     };
@@ -83,7 +83,10 @@ export default {
          this.getUserProfile()
   },
   methods: {
-    
+    handleSelect() {
+
+    },
+
     goTarget(href) {
       window.open(href, "_blank");
     },
@@ -105,7 +108,7 @@ export default {
         type: 'warning'
       }).then(() => {
         this.$store.dispatch('LogOut').then(() => {
-          location.href = '/index';
+          location.href = '/home';
         })
       }).catch(() => {});
     }

+ 4 - 4
ruoyi-ui/src/views/login.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="login">
     <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
-      <h3 class="title">若依后台管理系统</h3>
+      <h3 class="title">天王养排工区智慧管理系统</h3>
       <el-form-item prop="username">
         <el-input
           v-model="loginForm.username"
@@ -55,9 +55,9 @@
       </el-form-item>
     </el-form>
     <!--  底部  -->
-    <div class="el-login-footer">
+    <!-- <div class="el-login-footer">
       <span>Copyright © 2018-2022 ruoyi.vip All Rights Reserved.</span>
-    </div>
+    </div> -->
   </div>
 </template>
 
@@ -141,7 +141,7 @@ export default {
             Cookies.remove('rememberMe');
           }
           this.$store.dispatch("Login", this.loginForm).then(() => {
-            this.$router.push("/home").catch(()=>{});
+            this.$router.push("/plan").catch(()=>{});
           }).catch(() => {
             this.loading = false;
             if (this.captchaOnOff) {

+ 15 - 19
ruoyi-ui/src/views/report/add.vue

@@ -128,7 +128,7 @@
                                                 />
                                               </el-select>
                           <!-- <el-input v-model="form.lane" placeholder="请输入占用车道" style="width:300rem"/> -->
-                        </el-form-item>                     
+                        </el-form-item>
                         <el-row :gutter="20">
                                         <el-col :span="7">
                                               <el-form-item label="现场负责人" prop="manageUser">
@@ -153,7 +153,7 @@
                                     </el-form-item>
                                     </el-col>
                         </el-row>
-                     
+
                     </el-form>
 
 
@@ -170,21 +170,10 @@
                         style="margin-top:20vh">
                        <div>
                            <el-row>
-                                     <el-col span="12">
-                                                <el-radio v-model="audioDept" label="103">天王养排中心</el-radio>
-                                     </el-col>
-                                     <el-col span="12">
-                                                <el-radio v-model="audioDept" label="104">扬溧养排中心</el-radio>
-                                     </el-col>
-                           </el-row>
-                                      <br/>
-                           <el-row>
-                                     <el-col span="12">
-                                                <el-radio v-model="audioDept" label="105">工程科</el-radio>
-                                     </el-col>
-                                     <el-col span="12">
-                                                <el-radio v-model="audioDept" label="106">营运科</el-radio>
+                                     <el-col span="12" v-for="item in deptlist"  style="margin-bottom:10px">
+                                           <el-radio v-model="audioDept" :label="item.deptId">{{item.deptName}}</el-radio>
                                      </el-col>
+
                            </el-row>
 
                        </div>
@@ -199,6 +188,7 @@
 <script>
 import { listReport, getReport, delReport, addReport, updateReport } from "@/api/system/report";
 import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/system/plan";
+import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
 // import { AppMain } from '@/layout/components'
 export default {
   name: "Index",
@@ -218,7 +208,8 @@ export default {
       status:'',
       name:'',
       dialogVisible:false,
-      audioDept:'103'
+      audioDept: '103',
+      deptlist:[]
     };
   },
    mounted:function(){
@@ -226,7 +217,12 @@ export default {
           console.log(this.$route.query);
           this.$route.query.params = null;
           this.form = this.$route.query
-          this.name = this.$route.query.routerName
+     this.name = this.$route.query.routerName
+
+     listDept({parentId: 101}).then(res => {
+      //  console.log(res)
+       this.deptlist = res.data;
+     })
           // console.log(this.$route.query.status);
   },
   methods: {
@@ -243,7 +239,7 @@ export default {
                                    this.form.contentOne = this.planList[index].contentOne
                                    this.form.contentTwo = this.planList[index].contentTwo
                        }
-              
+
         }
     },
      getList() {

+ 113 - 114
ruoyi-ui/vue.config.js

@@ -2,7 +2,7 @@
 const path = require('path')
 
 function resolve(dir) {
-  return path.join(__dirname, dir)
+    return path.join(__dirname, dir)
 }
 
 const CompressionPlugin = require('compression-webpack-plugin')
@@ -15,122 +15,121 @@ const port = process.env.port || process.env.npm_config_port || 80 // 端口
 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
 // 这里只列一部分,具体配置参考文档
 module.exports = {
-  // 部署生产环境和开发环境下的URL。
-  // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
-  // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
-  publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
-  // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
-  outputDir: 'dist',
-  // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
-  assetsDir: 'static',
-  // 是否开启eslint保存检测,有效值:ture | false | 'error'
-  lintOnSave: process.env.NODE_ENV === 'development',
-  // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
-  productionSourceMap: false,
-  // webpack-dev-server 相关配置
-  devServer: {
-    host: '0.0.0.0',
-    port: port,
-    open: true,
-    proxy: {
-      // detail: https://cli.vuejs.org/config/#devserver-proxy
-      [process.env.VUE_APP_BASE_API]: {
-        // target: `http://localhost:8080`,
-        target:'http://192.168.0.29:8080/',
-        changeOrigin: true,
-        pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
+    // 部署生产环境和开发环境下的URL。
+    // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
+    // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
+    publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
+    // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
+    outputDir: 'dist',
+    // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
+    assetsDir: 'static',
+    // 是否开启eslint保存检测,有效值:ture | false | 'error'
+    lintOnSave: process.env.NODE_ENV === 'development',
+    // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
+    productionSourceMap: false,
+    // webpack-dev-server 相关配置
+    devServer: {
+        host: '0.0.0.0',
+        port: port,
+        open: true,
+        proxy: {
+            // detail: https://cli.vuejs.org/config/#devserver-proxy
+            [process.env.VUE_APP_BASE_API]: {
+                // target: `http://localhost:8080`,
+                target: 'http://nhxm.xt.wenhq.top:8083/api',
+                changeOrigin: true,
+                pathRewrite: {
+                    ['^' + process.env.VUE_APP_BASE_API]: ''
+                }
+            }
+        },
+        disableHostCheck: true
+    },
+    css: {
+        loaderOptions: {
+            sass: {
+                sassOptions: { outputStyle: "expanded" }
+            }
         }
-      }
     },
-    disableHostCheck: true
-  },
-  css: {
-    loaderOptions: {
-      sass: {
-        sassOptions: { outputStyle: "expanded" }
-      }
-    }
-  },
-  configureWebpack: {
-    name: name,
-    resolve: {
-      alias: {
-        '@': resolve('src')
-      }
+    configureWebpack: {
+        name: name,
+        resolve: {
+            alias: {
+                '@': resolve('src')
+            }
+        },
+        plugins: [
+            // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
+            new CompressionPlugin({
+                test: /\.(js|css|html)?$/i, // 压缩文件格式
+                filename: '[path].gz[query]', // 压缩后的文件名
+                algorithm: 'gzip', // 使用gzip压缩
+                minRatio: 0.8 // 压缩率小于1才会压缩
+            })
+        ],
     },
-    plugins: [
-      // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
-      new CompressionPlugin({
-        test: /\.(js|css|html)?$/i,     // 压缩文件格式
-        filename: '[path].gz[query]',   // 压缩后的文件名
-        algorithm: 'gzip',              // 使用gzip压缩
-        minRatio: 0.8                   // 压缩率小于1才会压缩
-      })
-    ],
-  },
-  chainWebpack(config) {
-    config.plugins.delete('preload') // TODO: need test
-    config.plugins.delete('prefetch') // TODO: need test
+    chainWebpack(config) {
+        config.plugins.delete('preload') // TODO: need test
+        config.plugins.delete('prefetch') // TODO: need test
 
-    // set svg-sprite-loader
-    config.module
-      .rule('svg')
-      .exclude.add(resolve('src/assets/icons'))
-      .end()
-    config.module
-      .rule('icons')
-      .test(/\.svg$/)
-      .include.add(resolve('src/assets/icons'))
-      .end()
-      .use('svg-sprite-loader')
-      .loader('svg-sprite-loader')
-      .options({
-        symbolId: 'icon-[name]'
-      })
-      .end()
-
-    config
-      .when(process.env.NODE_ENV !== 'development',
-        config => {
-          config
-            .plugin('ScriptExtHtmlWebpackPlugin')
-            .after('html')
-            .use('script-ext-html-webpack-plugin', [{
-            // `runtime` must same as runtimeChunk name. default is `runtime`
-              inline: /runtime\..*\.js$/
-            }])
+        // set svg-sprite-loader
+        config.module
+            .rule('svg')
+            .exclude.add(resolve('src/assets/icons'))
             .end()
-          config
-            .optimization.splitChunks({
-              chunks: 'all',
-              cacheGroups: {
-                libs: {
-                  name: 'chunk-libs',
-                  test: /[\\/]node_modules[\\/]/,
-                  priority: 10,
-                  chunks: 'initial' // only package third parties that are initially dependent
-                },
-                elementUI: {
-                  name: 'chunk-elementUI', // split elementUI into a single package
-                  priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
-                  test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
-                },
-                commons: {
-                  name: 'chunk-commons',
-                  test: resolve('src/components'), // can customize your rules
-                  minChunks: 3, //  minimum common number
-                  priority: 5,
-                  reuseExistingChunk: true
-                }
-              }
+        config.module
+            .rule('icons')
+            .test(/\.svg$/)
+            .include.add(resolve('src/assets/icons'))
+            .end()
+            .use('svg-sprite-loader')
+            .loader('svg-sprite-loader')
+            .options({
+                symbolId: 'icon-[name]'
             })
-          config.optimization.runtimeChunk('single'),
-          {
-             from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
-             to: './' //到根目录下
-          }
-        }
-      )
-  }
-}
+            .end()
+
+        config
+            .when(process.env.NODE_ENV !== 'development',
+                config => {
+                    config
+                        .plugin('ScriptExtHtmlWebpackPlugin')
+                        .after('html')
+                        .use('script-ext-html-webpack-plugin', [{
+                            // `runtime` must same as runtimeChunk name. default is `runtime`
+                            inline: /runtime\..*\.js$/
+                        }])
+                        .end()
+                    config
+                        .optimization.splitChunks({
+                            chunks: 'all',
+                            cacheGroups: {
+                                libs: {
+                                    name: 'chunk-libs',
+                                    test: /[\\/]node_modules[\\/]/,
+                                    priority: 10,
+                                    chunks: 'initial' // only package third parties that are initially dependent
+                                },
+                                elementUI: {
+                                    name: 'chunk-elementUI', // split elementUI into a single package
+                                    priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+                                    test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
+                                },
+                                commons: {
+                                    name: 'chunk-commons',
+                                    test: resolve('src/components'), // can customize your rules
+                                    minChunks: 3, //  minimum common number
+                                    priority: 5,
+                                    reuseExistingChunk: true
+                                }
+                            }
+                        })
+                    config.optimization.runtimeChunk('single'), {
+                        from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
+                        to: './' //到根目录下
+                    }
+                }
+            )
+    }
+}