ソースを参照

Merge branch 'develop_yh17_fencang' of jianguan-web/qpls-md-html into pre-release

李磊 2 年 前
コミット
fcb340b53f

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1684484184129
+  "version": 1686117724479
 }

+ 13 - 0
src/api/productUniversalCode.js

@@ -0,0 +1,13 @@
+import { axios } from '@/utils/request'
+
+//  通用产品 列表  有分页
+export const productUniversalCodeList = (params) => {
+  const url = `/productUniversalCode/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 25 - 0
src/config/router.config.js

@@ -3127,6 +3127,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/productManagement/productUniversal',
+            redirect: '/productManagement/productUniversal/list',
+            name: 'productUniversal',
+            component: BlankLayout,
+            meta: {
+              title: '通用产品',
+              icon: 'sketch',
+              permission: 'M_productUniversalList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'productUniversalList',
+                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productUniversal/list.vue'),
+                meta: {
+                  title: '通用产品',
+                  icon: 'sketch',
+                  hidden: true,
+                  permission: 'M_productUniversalList'
+                }
+              }
+            ]
           }
         ]
       },

+ 2 - 2
src/views/Home.vue

@@ -328,10 +328,10 @@
       v-model="openResetPwd">
       <ResetPwd />
     </a-modal>
-    <!-- 产品上线提醒 -->
+    <!-- 产品上线提醒 -->
     <a-modal
       class="newProductTips"
-      :title="'产品'+(onlineFalg=='1'?'上':'下')+'线提醒'"
+      :title="'产品'+(onlineFalg=='1'?'上':'下')+'线提醒'"
       :width="800"
       centered
       :footer="null"

+ 3 - 1
src/views/bulkManagement/bulkWarehousingOrder/chooseImportModal.vue

@@ -98,9 +98,11 @@
 
 <script>
 import { hdExportExcel } from '@/libs/exportExcel'
+import { commonMixin } from '@/utils/mixin'
 import { sparePartsPurExportErrorLine } from '@/api/sparePartsPur.js'
 export default {
   name: 'ChooseImportModal',
+  mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -121,7 +123,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'putCost', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '成本价', dataIndex: 'putCost', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '数量', dataIndex: 'putQty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库', dataIndex: 'warehouseName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 2 - 2
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -326,7 +326,6 @@ import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import Print from '@/views/common/print.vue'
 import importGuideModal from './importGuideModal.vue'
-import { toThousands } from '@/libs/tools'
 import newProduct from '@/views/productManagement/productInfo/edit.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
@@ -334,6 +333,7 @@ export default {
   components: { STable, VSelect, Print, ProductType, ProductBrand, newProduct, importGuideModal },
   mixins: [commonMixin],
   data () {
+    const _this = this
     return {
       isShowBisiceInfo: false,
       advanced: false,
@@ -410,7 +410,7 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '成本价', scopedSlots: { customRender: 'putCost' }, width: '7%', align: 'center' },
         { title: '数量', scopedSlots: { customRender: 'putQty' }, width: '7%', align: 'center' },
-        { title: '成本小计', dataIndex: 'costSubtotal', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? toThousands(text, 2) : '--') } },
+        { title: '成本小计', dataIndex: 'costSubtotal', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
         { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '13%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],

+ 5 - 5
src/views/productManagement/productInfoJg/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="productInfoList-wrap">
     <!-- 搜索条件 -->
     <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="searchForm">
+      <a-form layout="inline" @keyup.enter.native="searchForm(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品编码">
@@ -49,7 +49,7 @@
           </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="searchForm" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
+            <a-button type="primary" @click="searchForm(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin-left: 5px">
               {{ advanced ? '收起' : '展开' }}
@@ -162,7 +162,7 @@
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="resetSearchForm" />
     <!-- 自定义报价弹窗 -->
-    <editPriceModal :openModal="openEditPriceModal" :itemId="itemId" @ok="searchForm" @close="openEditPriceModal=false"></editPriceModal>
+    <editPriceModal :openModal="openEditPriceModal" :itemId="itemId" @ok="searchForm(false)" @close="openEditPriceModal=false"></editPriceModal>
   </a-card>
 </template>
 
@@ -291,9 +291,9 @@ export default {
       this.$router.push({ name: 'viewProduct', params: { sn: row.productSn } })
     },
     // 查询
-    searchForm () {
+    searchForm (flag) {
       this.$refs.table.clearSelected() // 清空表格选中项
-      this.$refs.table.refresh(true)
+      this.$refs.table.refresh(flag)
     },
     //  重置
     resetSearchForm () {

+ 184 - 0
src/views/productManagement/productUniversal/list.vue

@@ -0,0 +1,184 @@
+<template>
+  <a-card size="small" :bordered="false" class="productChangeRecordList-wrap jg-page-wrap">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="productUniversalList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="productUniversalList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="上线状态">
+              <v-select code="ONLINE_FLAG" id="productUniversalList-onlineFalg" v-model="queryParam.onlineFalg" allowClear placeholder="请选择上线状态"></v-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="通用产品编码">
+                <a-input id="productUniversalList-productCommonCode" v-model.trim="queryParam.productCommonCode" allowClear placeholder="请输入通用产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="通用产品名称">
+                <a-input id="productUniversalList-productCommonName" v-model.trim="queryParam.productCommonName" allowClear placeholder="请输入通用产品名称"/>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productUniversalList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productUniversalList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable fixPagination"
+      ref="table"
+      :style="{ height: tableHeight+84.5+'px' }"
+      size="small"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ y: tableHeight }"
+      :defaultLoadData="false"
+      bordered>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <span v-if="record.productCommon.productTypeName2 || record.productCommon.productTypeName3">{{ record.productCommon.productTypeName2 }} {{ record.productCommon.productTypeName3 ? '>' : '' }} {{ record.productCommon.productTypeName3 }}</span>
+        <span v-else>--</span>
+      </template>
+    </s-table>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { productUniversalCodeList } from '@/api/productUniversalCode'
+export default {
+  name: 'ProductUniversalList',
+  mixins: [commonMixin],
+  components: { STable, VSelect },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        productCode: '',
+        productName: '',
+        onlineFalg: undefined,
+        productCommonName: '',
+        productCommonCode: ''
+      },
+      productType: [],
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '上线状态', dataIndex: 'product.onlineFalgDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用产品编码', dataIndex: 'productCommonCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用产品名称', dataIndex: 'productCommon.name', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '通用产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
+        { title: '通用产品状态', dataIndex: 'productCommon.onlineFalgDictValue', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return productUniversalCodeList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false, //  编辑  弹框
+      itemId: '' //  当前id
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.onlineFalg = undefined
+      this.queryParam.productCommonName = ''
+      this.queryParam.productCommonCode = ''
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .productChangeRecordList-wrap{
+    .red{
+      color: #ed1c24;
+    }
+  }
+</style>

+ 5 - 4
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -55,7 +55,7 @@
             <template slot="header">
               <div style="display: flex;">
                 选择产品<span class="sub-title">①输入查询条件--->②查找到需要采购的产品--->③录入采购数量--->④点击“添加”</span>
-                <p class="tag-txt">注意:仅限采购【箭冠】产品。自建产品的采购入库请使用“散件入库”功能</p>
+                <p class="tag-txt">注意:{{!isDealerUp?'仅限采购【箭冠】产品。':''}}自建产品的采购入库请使用“散件入库”功能</p>
               </div>
             </template>
             <!-- 选择产品 -->
@@ -128,7 +128,7 @@
                   {{ record.packQty||'--' }}{{ record.packQty ? record.unit : '' }}/{{ record.packQtyUnit||'--' }}
                 </template>
                 <!-- 产品编码 -->
-                <template slot="code" slot-scope="text, record">
+                <!-- <template slot="code" slot-scope="text, record">
                   <a-tooltip placement="top" v-if="record.stockState=='NOT_ENOUGH'">
                     <template slot="title">
                       该产品暂时缺货!
@@ -136,7 +136,7 @@
                     <span class="noStock">{{ record.code || '--' }}</span>
                   </a-tooltip>
                   <span v-else>{{ record.code || '--' }}</span>
-                </template>
+                </template> -->
                 <!-- 采购数量 -->
                 <template slot="storageQuantity" slot-scope="text, record">
                   <a-input-number
@@ -369,7 +369,8 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '15%', align: 'center', sorter: true },
+        // { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '15%', align: 'center', sorter: true },
+        { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '产品名称', dataIndex: 'name', width: '23%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'origCode', width: '14%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
         { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },

+ 4 - 3
src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue

@@ -74,7 +74,7 @@
             {{ record.packQty||'--' }}{{ record.packQty ? record.unit : '' }}/{{ record.packQtyUnit||'--' }}
           </template>
           <!-- 产品编码 -->
-          <template slot="code" slot-scope="text, record">
+          <!-- <template slot="code" slot-scope="text, record">
             <a-tooltip placement="top" v-if="record.stockState=='NOT_ENOUGH'">
               <template slot="title">
                 该产品暂时缺货!
@@ -82,7 +82,7 @@
               <span class="noStock">{{ record.code || '--' }}</span>
             </a-tooltip>
             <span v-else>{{ record.code || '--' }}</span>
-          </template>
+          </template> -->
           <!-- 采购数量 -->
           <template slot="storageQuantity" slot-scope="text, record">
             <div @dblclick.stop>
@@ -228,7 +228,8 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '150px', align: 'center', fixed: 'left' },
+        // { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '150px', align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'code', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left', sorter: true },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'origCode', width: '150px', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
         { title: '在途数', dataIndex: 'transitQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 54 - 54
vue.config.js

@@ -1,14 +1,14 @@
-const fs = require('fs');
+const fs = require('fs')
 const path = require('path')
 const webpack = require('webpack')
 const createThemeColorReplacerPlugin = require('./config/plugin.config')
 // gzip 压缩
-const compressionWebpackPlugin = require('compression-webpack-plugin');
+const compressionWebpackPlugin = require('compression-webpack-plugin')
 // js,css 压缩
-const TerserPlugin = require('terser-webpack-plugin');
+const TerserPlugin = require('terser-webpack-plugin')
 // 版本自动生成
-const WebpackVersionPlugin = require('webpack-version-plugin');
-const versionConfig = require(resolve('public/version.json'));
+const WebpackVersionPlugin = require('webpack-version-plugin')
+const versionConfig = require(resolve('public/version.json'))
 
 function resolve (dir) {
   return path.join(__dirname, dir)
@@ -49,7 +49,7 @@ const prodExternals = {
   vuex: 'Vuex',
   axios: 'axios',
   echarts: 'echarts',
-  // lodash : { 
+  // lodash : {
   //   commonjs: "lodash",
   //   amd: "lodash",
   //   root: "_" // indicates global variable
@@ -63,41 +63,41 @@ const vueConfig = {
   publicPath: BASE_URL,
   configureWebpack: {
     optimization: isProd() ? {
-          minimize: true,
-          minimizer: [new TerserPlugin({
-              test: /\.js(\?.*)?$/i,    //匹配参与压缩的文件
-              parallel: true,    //使用多进程并发运行
-              terserOptions: {    //Terser 压缩配置
-                  output:{comments: false},
-                  compress: {//console删除
-                      pure_funcs: ["console.log"]
-                  }
-              },
-              extractComments: true,    //将注释剥离到单独的文件中
-          })],
-      }:{},
+      minimize: true,
+      minimizer: [new TerserPlugin({
+        test: /\.js(\?.*)?$/i, // 匹配参与压缩的文件
+        parallel: true, // 使用多进程并发运行
+        terserOptions: { // Terser 压缩配置
+          output: { comments: false },
+          compress: {// console删除
+            pure_funcs: ['console.log']
+          }
+        },
+        extractComments: true // 将注释剥离到单独的文件中
+      })]
+    } : {},
     // webpack plugins
     plugins: [
       // Ignore all locale files of moment.js
       new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
       new compressionWebpackPlugin({
-          //[file] 会被替换成原始资源。[path] 会被替换成原始资源的路径, [query] 会被替换成查询字符串。默认值是 "[path].gz[query]"。
-          filename: '[path].gz[query]', // 提示compression-webpack-plugin@3.0.0的话asset改为filename
-          //可以是 function(buf, callback) 或者字符串。对于字符串来说依照 zlib 的算法(或者 zopfli 的算法)。默认值是 "gzip"。
-          algorithm: 'gzip',
-          //所有匹配该正则的资源都会被处理。默认值是全部资源。
-          test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
-          //只有大小大于该值的资源会被处理。单位是 bytes。默认值是 0。
-          threshold: 10240,
-          //只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
-          minRatio: 0.8
-        }),
+        // [file] 会被替换成原始资源。[path] 会被替换成原始资源的路径, [query] 会被替换成查询字符串。默认值是 "[path].gz[query]"。
+        filename: '[path].gz[query]', // 提示compression-webpack-plugin@3.0.0的话asset改为filename
+        // 可以是 function(buf, callback) 或者字符串。对于字符串来说依照 zlib 的算法(或者 zopfli 的算法)。默认值是 "gzip"。
+        algorithm: 'gzip',
+        // 所有匹配该正则的资源都会被处理。默认值是全部资源。
+        test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
+        // 只有大小大于该值的资源会被处理。单位是 bytes。默认值是 0。
+        threshold: 10240,
+        // 只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
+        minRatio: 0.8
+      }),
       new WebpackVersionPlugin({
         // You must set the cb option
-        cb: function(hashMap) {
-          if(!isProd()){
-            versionConfig.version = new Date().getTime();
-            fs.writeFileSync(resolve('./public/version.json'), JSON.stringify(versionConfig, null, 2)); 
+        cb: function (hashMap) {
+          if (!isProd()) {
+            versionConfig.version = new Date().getTime()
+            fs.writeFileSync(resolve('./public/version.json'), JSON.stringify(versionConfig, null, 2))
           }
         }
       })
@@ -133,18 +133,18 @@ const vueConfig = {
         return args
       })
     }
-    
+
     config.optimization && config.optimization.splitChunks({
-        // 拆包配置 
-        chunks: 'all', //三选一:"initial" 初始化,"all"(默认就是all),"async"(动态加载) 
-        minSize: 30000, // 形成一个新代码块最小的体积,只有 >= minSize 的bundle会被拆分出来 30000
-        maxSize: 0, //拆分之前最大的数值,默认为0,即不做限制
-        minChunks: 1, //引入次数,如果为2 那么一个资源最少被引用两次才可以被拆分出来
-        maxAsyncRequests: 5, // 按需加载的最大并行请求数
-        maxInitialRequests: 4, // 一个入口最大并行请求数
-        automaticNameDelimiter: '~', // 文件名的连接符
-        name: true,
-        cacheGroups: {
+      // 拆包配置
+      chunks: 'all', // 三选一:"initial" 初始化,"all"(默认就是all),"async"(动态加载)
+      minSize: 30000, // 形成一个新代码块最小的体积,只有 >= minSize 的bundle会被拆分出来 30000
+      maxSize: 0, // 拆分之前最大的数值,默认为0,即不做限制
+      minChunks: 1, // 引入次数,如果为2 那么一个资源最少被引用两次才可以被拆分出来
+      maxAsyncRequests: 5, // 按需加载的最大并行请求数
+      maxInitialRequests: 4, // 一个入口最大并行请求数
+      automaticNameDelimiter: '~', // 文件名的连接符
+      name: true,
+      cacheGroups: {
         // node_modules模块包
         vendors: {
           test: /[\\/]node_modules[\\/]/,
@@ -154,7 +154,7 @@ const vueConfig = {
           //   return `chunk.${packageName.replace('@', '')}`;
           // },
           chunks: 'all',
-          priority: -10,
+          priority: -10
         },
         // UI库单独拆包
         antDesign: {
@@ -171,18 +171,18 @@ const vueConfig = {
         common: {
           name: 'chunk-common',
           minChunks: 2,
-          maxSize: 1024, //拆分之前最大的数值,默认为0,即不做限制
+          maxSize: 1024, // 拆分之前最大的数值,默认为0,即不做限制
           priority: -20,
           reuseExistingChunk: true
         }
-        }
-    });
-    
+      }
+    })
+
     // 分析打包大小
     if (process.env.npm_config_report) {
       config.plugin('webpack-bundle-analyzer')
-      .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
-      .end();
+        .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
+        .end()
     }
   },
 
@@ -220,7 +220,7 @@ const vueConfig = {
       }
     },
     watchOptions: {
-        ignored: [/node_modules/, /public/],
+      ignored: [/node_modules/, /public/]
     }
   },
 
@@ -239,4 +239,4 @@ if (process.env.VUE_APP_PREVIEW === 'true') {
   vueConfig.configureWebpack.plugins.push(createThemeColorReplacerPlugin())
 }
 
-module.exports = vueConfig
+module.exports = vueConfig