From 11c0c969f05fd3c546b44898a0020eed9ba65fbe Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 22 一月 2026 13:15:24 +0800
Subject: [PATCH] 业务管理:IFS域字段显示
---
src/views/business/outsourcingFinishProduct/index.vue | 83 ++++++++++
vue.config.js | 52 ++---
src/views/business/inspectionReview/index.vue | 26 +++
src/views/business/rawMaterialInspection/index.vue | 53 ++++++
src/views/business/reportPreparation/index.vue | 27 +++
src/views/statisticalCharts/qualificationRateStatistics/index.vue | 65 ++++++--
src/views/business/inspectionTask/inspection.vue | 1
src/views/business/inspectionTask/index.vue | 25 +++
src/views/business/materialOrder/index.vue | 103 ++++++++++++
9 files changed, 386 insertions(+), 49 deletions(-)
diff --git a/src/views/business/inspectionReview/index.vue b/src/views/business/inspectionReview/index.vue
index 4d63e12..4c9b2a9 100644
--- a/src/views/business/inspectionReview/index.vue
+++ b/src/views/business/inspectionReview/index.vue
@@ -2,6 +2,12 @@
<div class="app-container">
<div>
<el-form :model="entity" ref="entity" size="small" :inline="true">
+ <el-form-item label="IFS鍩�" prop="contract">
+ <el-select @keyup.enter.native="refreshTable" v-model="entity.contract" clearable placeholder="璇烽�夋嫨" size="small">
+ <el-option label="ZTNS" value="ZTNS"/>
+ <el-option label="KJNS" value="KJNS"/>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎵瑰彿" prop="updateBatchNo">
<el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="refreshTable()">
@@ -87,6 +93,7 @@
active: 1,
tabIndex: 0,
entity: {
+ contract: null,
sonLaboratory: null,
insState: '3',
userId: 0,
@@ -96,6 +103,25 @@
tableData: [],
column: [
{
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
+ {
label: "鎵瑰彿",
prop: "updateBatchNo",
width: "120px",
diff --git a/src/views/business/inspectionTask/index.vue b/src/views/business/inspectionTask/index.vue
index 9bd39e8..36e2b5a 100644
--- a/src/views/business/inspectionTask/index.vue
+++ b/src/views/business/inspectionTask/index.vue
@@ -3,6 +3,12 @@
<div style="height: 100%">
<div class="search">
<el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
+ <el-form-item label="IFS鍩�" prop="contract">
+ <el-select @keyup.enter.native="refreshTable" v-model="queryParams.contract" clearable placeholder="璇烽�夋嫨" size="small">
+ <el-option label="ZTNS" value="ZTNS"/>
+ <el-option label="KJNS" value="KJNS"/>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎵瑰彿" prop="updateBatchNo" v-if="tabIndex !== 0">
<el-input v-model="queryParams.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="refreshTable()">
@@ -363,6 +369,25 @@
tableData: [],
column: [
{
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
+ {
label: "鎵瑰彿",
prop: "updateBatchNo",
width: "120px",
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index 35e1996..3a80c21 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -1066,6 +1066,7 @@
...this.ifsMaterialPropsForm,
partNo: this.insOrder.partNo,
lotBatchNo: this.insOrder.lotBatchNo,
+ contract: this.insOrder.contract
}).then((res)=>{
if(res.code==200){
this.$message.success("淇濆瓨鎴愬姛");
diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue
index 95a9483..294a69c 100644
--- a/src/views/business/materialOrder/index.vue
+++ b/src/views/business/materialOrder/index.vue
@@ -3,7 +3,12 @@
<div>
<div class="search">
<el-form :model="entity" ref="entity" size="small" :inline="true">
-
+ <el-form-item label="IFS鍩�" prop="contract">
+ <el-select @keyup.enter.native="refreshTable" v-model="entity.contract" clearable placeholder="璇烽�夋嫨" size="small">
+ <el-option label="ZTNS" value="ZTNS"/>
+ <el-option label="KJNS" value="KJNS"/>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎵瑰彿" prop="updateBatchNo">
<el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="goSearch">
@@ -241,6 +246,25 @@
tableData: [],
tableLoading: false,
column: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '鎵瑰彿', prop: 'updateBatchNo' },
{ label: '闆朵欢鍙�', prop: 'partNo' },
{ label: '闆朵欢鎻忚堪', prop: 'partDesc' },
@@ -319,6 +343,25 @@
tableData1: [],
tableLoading1: false,
column1: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '鎵瑰彿', prop: 'updateBatchNo' },
{
label: '濮旀墭缂栧彿',
@@ -415,6 +458,25 @@
tableData2: [],
tableLoading2: false,
column2: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{
label: '濮旀墭缂栧彿',
prop: 'entrustCode',
@@ -622,6 +684,25 @@
tableData3: [],
tableLoading3: false,
column3: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '濮旀墭缂栧彿', prop: 'entrustCode', width: "160px", },
{
dataType: 'tag',
@@ -761,6 +842,25 @@
tableData4: [],
tableLoading4: false,
column4: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '濮旀墭缂栧彿', prop: 'entrustCode', width: "160px", },
{
dataType: 'tag',
@@ -915,6 +1015,7 @@
current: 1
},
entity: {
+ contract: null,
updateBatchNo: null,
entrustCode: null,
partDesc: null,
diff --git a/src/views/business/outsourcingFinishProduct/index.vue b/src/views/business/outsourcingFinishProduct/index.vue
index b5a862f..35bd105 100644
--- a/src/views/business/outsourcingFinishProduct/index.vue
+++ b/src/views/business/outsourcingFinishProduct/index.vue
@@ -3,6 +3,12 @@
<div>
<div class="search">
<el-form :model="entity" ref="entity" size="small" :inline="true">
+ <el-form-item label="IFS鍩�" prop="contract">
+ <el-select @keyup.enter.native="refreshTable" v-model="entity.contract" clearable placeholder="璇烽�夋嫨" size="small">
+ <el-option label="ZTNS" value="ZTNS"/>
+ <el-option label="KJNS" value="KJNS"/>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎵瑰彿" prop="updateBatchNo">
<el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="goSearch">
@@ -217,6 +223,25 @@
tableData: [],
tableLoading: false,
column: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '鎵瑰彿', prop: 'updateBatchNo' },
{ label: '闆朵欢鍙�', prop: 'partNo' },
{ label: '闆朵欢鎻忚堪', prop: 'partDesc' },
@@ -295,6 +320,25 @@
tableData1: [],
tableLoading1: false,
column1: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '鎵瑰彿', prop: 'updateBatchNo' },
{
label: '濮旀墭缂栧彿',
@@ -391,6 +435,25 @@
tableData2: [],
tableLoading2: false,
column2: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{
label: '濮旀墭缂栧彿',
prop: 'entrustCode',
@@ -564,6 +627,25 @@
tableData3: [],
tableLoading3: false,
column3: [
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '濮旀墭缂栧彿', prop: 'entrustCode', width: "160px", },
{
dataType: 'tag',
@@ -701,6 +783,7 @@
current: 1
},
entity: {
+ contract: null,
updateBatchNo: null,
entrustCode: null,
partDesc: null,
diff --git a/src/views/business/rawMaterialInspection/index.vue b/src/views/business/rawMaterialInspection/index.vue
index 2333ca1..be19b63 100644
--- a/src/views/business/rawMaterialInspection/index.vue
+++ b/src/views/business/rawMaterialInspection/index.vue
@@ -3,6 +3,12 @@
<div class="search">
<el-form :model="componentData" ref="componentData" size="small" :inline="true">
<el-row>
+ <el-form-item label="IFS鍩�" prop="contract">
+ <el-select @keyup.enter.native="refreshTable" v-model="componentData.contract" clearable placeholder="璇烽�夋嫨" size="small">
+ <el-option label="ZTNS" value="ZTNS"/>
+ <el-option label="KJNS" value="KJNS"/>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎵瑰彿" prop="updateBatchNo">
<el-input v-model="componentData.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="refreshTable"></el-input>
@@ -115,6 +121,9 @@
:visible.sync="declareDialogVisible" width="800px" @close="resetFormData">
<el-form ref="declareObj" :inline="true" :model="declareObj" :rules="declareObjRules" label-width="130px"
label-position="right">
+ <el-form-item class="declareObj-form-item" label="IFS鍩�:" prop="contract" style="width: calc(50% - 54px)">
+ <el-tag :type="declareObj.contract==='ZTNS'?'':'success'">{{declareObj.contract}}</el-tag>
+ </el-form-item>
<el-form-item class="declareObj-form-item" label="璁㈠崟鍙�:" prop="orderNo">
<el-input v-model="declareObj.orderNo" :disabled="declareType !== 'add'" class="addObj-info" clearable
placeholder="" size="small"></el-input>
@@ -217,6 +226,11 @@
:header-cell-style="{textAlign:'center'}"
:cell-style="{textAlign:'center'}"
>
+ <el-table-column label="IFS鍩�" prop="contract" :min-width="100" width="100">
+ <template slot-scope="scope">
+ <el-tag :type="scope.row.contract==='ZTNS'?'':'success'">{{scope.row.contract}}</el-tag>
+ </template>
+ </el-table-column>
<el-table-column label="璁㈠崟缂栧彿" prop="orderNo" :min-width="100" width="100"></el-table-column>
<el-table-column label="闆朵欢缂栧彿" prop="partNo" :min-width="150" width="150" show-overflow-tooltip></el-table-column>
<el-table-column label="闆朵欢鎻忚堪" prop="partDesc" :min-width="150" show-overflow-tooltip></el-table-column>
@@ -380,6 +394,25 @@
}
}
},
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
+ },
{ label: '璁㈠崟鍙�', prop: 'orderNo' },
{ label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'purQtyInStore', width: '140px', },
{ label: '鎵瑰彿', prop: 'updateBatchNo' },
@@ -488,6 +521,25 @@
return null
}
}
+ },
+ {
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+
},
{ label: '璁㈠崟鍙�', prop: 'orderNo' },
{ label: '璁㈠崟鍒嗙被', prop: 'orderTypeName' },
@@ -610,6 +662,7 @@
materialProp: null, // 鐗╂枡灞炴��
},
componentData: { // 琛ㄦ牸鏁版嵁
+ contract:null,
updateBatchNo: null,
partNo: null,
partDesc: null,
diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue
index c3cfb82..21956b9 100644
--- a/src/views/business/reportPreparation/index.vue
+++ b/src/views/business/reportPreparation/index.vue
@@ -2,6 +2,12 @@
<div class="app-container">
<div>
<el-form :model="entity" ref="entity" size="small" :inline="true">
+ <el-form-item label="IFS鍩�" prop="contract">
+ <el-select @keyup.enter.native="refreshTable" v-model="entity.contract" clearable placeholder="璇烽�夋嫨" size="small">
+ <el-option label="ZTNS" value="ZTNS"/>
+ <el-option label="KJNS" value="KJNS"/>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎵瑰彿" prop="updateBatchNo">
<el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="refreshTable()">
@@ -29,7 +35,7 @@
</el-option>
</el-select>
</el-form-item>
-
+
<el-form-item label=" 妫�楠岀被鍒�" prop="orderType">
<el-select v-model="entity.orderType" clearable size="small" @change="refreshTable()">
<el-option v-for="(a, i) in orderTypeList" :key="i" :label="a.label" :value="a.value"></el-option>
@@ -241,6 +247,7 @@
data() {
return {
entity: {
+ contract:null,
queryStatus: null,
code: null,
typeSource: null,
@@ -367,6 +374,24 @@
valueTableData: [],
column: [
{
+ label: 'IFS鍩�',
+ prop: 'contract',
+ width: '120px',
+ dataType: 'tag',
+ formatData: (params) => {
+ return params
+ },
+ formatType: (params) => {
+ if (params === 'ZTNS') {
+ return ''
+ } else if (params === 'KJNS') {
+ return 'success'
+ }else {
+ return null
+ }
+ }
+ },
+ {
label: "鎵瑰彿",
prop: "updateBatchNo",
width: "120px",
diff --git a/src/views/statisticalCharts/qualificationRateStatistics/index.vue b/src/views/statisticalCharts/qualificationRateStatistics/index.vue
index 3456973..a1e8649 100644
--- a/src/views/statisticalCharts/qualificationRateStatistics/index.vue
+++ b/src/views/statisticalCharts/qualificationRateStatistics/index.vue
@@ -180,7 +180,7 @@
data: [],
label: {
show: true,
- formatter: (v) => v.value + '%'
+ formatter: (v) => v.value + '%'
}
}
],
@@ -203,7 +203,7 @@
}
},
lineColors: ['#91A0FC'],
- barColors: ['#13ce66', '#F56C6C'], // 鍚堟牸缁� / 涓嶅悎鏍肩孩
+ barColors: ['#9fe080', '#ff994d'], // 鍚堟牸缁� / 涓嶅悎鏍肩孩
barColors2: ['#A4EEDA'],
pieTooltip: {
trigger: 'item'
@@ -214,7 +214,7 @@
},
rawPieSeries: [
{
- name: 'Access From',
+ name: '',
type: 'pie',
radius: '70%',
center: ['50%', '50%'],
@@ -224,7 +224,7 @@
borderWidth: 2
},
label: {
- alignTo: 'edge',
+ alignTo: 'labelLine',
formatter: '{name|{b}}\n{time|{c}}',
edgeDistance: 10,
lineHeight: 15,
@@ -240,14 +240,14 @@
length2: 40
},
data: [
- { value: 0, name: '涓嶅悎鏍兼暟閲�', itemStyle: { color: '#F56C6C' } },
- { value: 0, name: '鍚堟牸鏁伴噺', itemStyle: { color: '#67C23A' } }
+ { value: 0, name: '涓嶅悎鏍兼暟閲�', itemStyle: {color: '#ff994d'} },
+ { value: 0, name: '鍚堟牸鏁伴噺', itemStyle: { color: '#9fe080' } }
]
}
],
conductorPieSeries: [
{
- name: 'Access From',
+ name: '',
type: 'pie',
radius: '70%',
center: ['50%', '50%'],
@@ -257,7 +257,7 @@
borderWidth: 2
},
label: {
- alignTo: 'edge',
+ alignTo: 'labelLine',
formatter: '{name|{b}}\n{time|{c}}',
edgeDistance: 10,
lineHeight: 15,
@@ -273,14 +273,14 @@
length2: 40,
},
data: [
- { value: 0, name: '涓嶅悎鏍兼暟閲�', itemStyle: { color: '#F56C6C' } },
- { value: 0, name: '鍚堟牸鏁伴噺', itemStyle: { color: '#67C23A' } },
+ { value: 0, name: '涓嶅悎鏍兼暟閲�', itemStyle: { color: '#ff994d' } },
+ { value: 0, name: '鍚堟牸鏁伴噺', itemStyle: { color: '#9fe080' } },
]
}
],
dlanPieSeries: [
{
- name: 'Access From',
+ name: '',
type: 'pie',
radius: '70%',
center: ['50%', '50%'],
@@ -290,7 +290,7 @@
borderWidth: 2
},
label: {
- alignTo: 'edge',
+ alignTo: 'labelLine',
formatter: '{name|{b}}\n{time|{c}}',
edgeDistance: 10,
lineHeight: 15,
@@ -306,8 +306,8 @@
length2: 40,
},
data: [
- { value: 0, name: '涓嶅悎鏍兼暟閲�', itemStyle: { color: '#F56C6C' } },
- { value: 0, name: '鍚堟牸鏁伴噺', itemStyle: { color: '#67C23A' } },
+ { value: 0, name: '涓嶅悎鏍兼暟閲�', itemStyle: { color: '#ff994d' } },
+ { value: 0, name: '鍚堟牸鏁伴噺', itemStyle: { color: '#9fe080' } },
]
}
],
@@ -418,11 +418,9 @@
// 鏂规硶闆嗗悎
methods: {
// 鑾峰彇鍚堟牸鐜囧浘琛ㄦ暟鎹�
-
setBarChartTitle() {
this.echartsOptions.title.text = `${this.inspectionTitle}鍚堟牸鐜囪秼鍔縛;
},
-
getBar() {
const types = this.currentMaterialProp.split(',');
const requests = types.map(t => {
@@ -454,12 +452,44 @@
}
});
- const sortedDates = Object.keys(dateMap).sort();
+ const weekOrderMap = {
+ "鏄熸湡涓�": 0,
+ "鏄熸湡浜�": 1,
+ "鏄熸湡涓�": 2,
+ "鏄熸湡鍥�": 3,
+ "鏄熸湡浜�": 4,
+ "鏄熸湡鍏�": 5,
+ "鏄熸湡鏃�": 6
+ };
+ const yearOrderMap = {
+ "1鏈�": 0,
+ "2鏈�": 1,
+ "3鏈�": 2,
+ "4鏈�": 3,
+ "5鏈�": 4,
+ "6鏈�": 5,
+ "7鏈�": 6,
+ "8鏈�": 7,
+ "9鏈�": 8,
+ "10鏈�": 9,
+ "11鏈�": 10,
+ "12鏈�": 11
+ };
+ const sortedDates = Object.keys(dateMap).sort((a, b) => {
+ if(a.includes("鏄熸湡") && b.includes("鏄熸湡")) {
+ return weekOrderMap[a] - weekOrderMap[b];
+ } else if(a.includes("鏈�") && b.includes("鏈�")) {
+ return yearOrderMap[a] - yearOrderMap[b];
+ } else {
+ return new Date(a) - new Date(b);
+ }
+ });
let qualifiedData = [];
let unQualifiedData = [];
let lineData = [];
let xAxis = [];
+ console.log(sortedDates)
sortedDates.forEach(date => {
const { qualified, unQualified } = dateMap[date];
const total = qualified + unQualified;
@@ -475,6 +505,7 @@
this.echartsSeries[1].data = unQualifiedData;
this.echartsSeries[2].data = lineData;
this.xAxis[0].data = xAxis;
+ console.log(xAxis)
});
},
diff --git a/vue.config.js b/vue.config.js
index b86dc03..dc08f77 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -59,36 +59,6 @@
"@": resolve("src"),
},
},
- module: {
- rules: [
- // JS 涓讳綋鏂囦欢澶勭悊锛堝惈 Babel銆乀hread Loader锛�
- {
- test: /\.js$/,
- use: [
- {
- loader: 'thread-loader',
- options: { workers: 4 }
- },
- 'babel-loader'
- ],
- exclude: /\.worker\.js$/, // 馃憟 鎺掗櫎 worker 鏂囦欢
- include: path.resolve(__dirname, 'src')
- },
-
- // 鍗曠嫭澶勭悊 Worker 鏂囦欢
- {
- test: /\.worker\.js$/,
- use: {
- loader: 'worker-loader',
- options: {
- filename: '[name].[contenthash].worker.js',
- inline: 'fallback'
- }
- },
- type: 'javascript/auto' // 馃憟 寮哄埗 Webpack 涓嶈鎸夋ā鍧楄В鏋�
- }
- ]
- },
plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#浣跨敤gzip瑙e帇缂╅潤鎬佹枃浠�
new CompressionPlugin({
@@ -119,6 +89,28 @@
})
.end();
+ // 淇敼babel-loader閰嶇疆锛屾帓闄orker鏂囦欢
+ config.module
+ .rule('js')
+ .exclude
+ .add(/\.worker\.js$/)
+ .end();
+
+ // 澶勭悊worker鏂囦欢
+ config.module
+ .rule('worker')
+ .test(/\.worker\.js$/)
+ .use('worker-loader')
+ .loader('worker-loader')
+ .options({
+ filename: '[name].[contenthash].worker.js',
+ inline: 'fallback'
+ })
+ .end()
+ .type('javascript/auto')
+ .exclude.add(resolve('node_modules'))
+ .end();
+
config.when(process.env.NODE_ENV !== "development", (config) => {
config
.plugin("ScriptExtHtmlWebpackPlugin")
--
Gitblit v1.9.3