From 028e8dbe2018b00784432a95aaed550bfe098a02 Mon Sep 17 00:00:00 2001
From: lideqin <694785430@qq.com>
Date: Mon, 2 Sep 2024 10:00:16 +0800
Subject: [PATCH] =?UTF-8?q?[update]=20=E5=B8=82=E5=9C=BA=E6=B3=95=E8=A7=84?=
=?UTF-8?q?=E6=B8=85=E5=8D=95=E6=9F=A5=E7=9C=8B=E7=9B=B8=E5=90=8C=E6=A0=87?=
=?UTF-8?q?=E5=87=86=E7=BC=96=E5=8F=B7=E4=B8=8B=E7=9A=84=E5=85=B6=E4=BB=96?=
=?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9B=B8=E5=90=8C=E5=88=99=E5=90=88=E5=B9=B6?=
=?UTF-8?q?=E8=A1=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MarketRegulationsDetailPage.vue | 306 ++++++++++++++++--
1 file changed, 286 insertions(+), 20 deletions(-)
diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue
index ff3d69c..a42a05f 100644
--- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue
+++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue
@@ -226,119 +226,323 @@ export default {
align: 'center',
width: 180,
dataIndex: 'newProductImplDate',
- scopedSlots: { customRender: 'text' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.newProductImplDateCol ? row.newProductImplDateCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'text' }
},
{ // 新认证车实施日期
title: this.$t('standardRegulationLibrary.marketListField.newCertifiedVehicleImplementationDate'),
align: 'center',
width: 180,
dataIndex: 'newAuthImplDate',
- scopedSlots: { customRender: 'text' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.newAuthImplDateCol ? row.newAuthImplDateCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'text' }
},
{ // 注册日期
title: this.$t('standardRegulationLibrary.marketListField.dateOfRegistration'),
align: 'center',
width: 180,
dataIndex: 'registrationDate',
- scopedSlots: { customRender: 'text' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.registrationDateCol ? row.registrationDateCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'text' }
},
{ // 适用国家/地区
title: this.$t('standardRegulationLibrary.marketListField.applicableCountryRegion'),
align: 'center',
width: 180,
dataIndex: 'country_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.countryCol ? row.countryCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 适用车型
title: this.$t('standardRegulationLibrary.marketListField.applicableVehicleType'),
align: 'center',
width: 180,
dataIndex: 'applicableVehicle_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.applicableVehicleCol ? row.applicableVehicleCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 认证对象
title: this.$t('standardRegulationLibrary.marketListField.authenticationObject'),
align: 'center',
width: 180,
dataIndex: 'authenticationObject_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.authenticationObjectCol ? row.authenticationObjectCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 认证交付物
title: this.$t('standardRegulationLibrary.marketListField.certifiedDeliverables'),
align: 'center',
width: 180,
dataIndex: 'certifyTheDeliverables',
- scopedSlots: { customRender: 'text' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.certifyTheDeliverablesCol ? row.certifyTheDeliverablesCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'text' }
},
{ // 类型
title: this.$t('standardRegulationLibrary.marketListField.type'),
align: 'center',
width: 180,
dataIndex: 'type_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.typeCol ? row.typeCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 动力类型
title: this.$t('standardRegulationLibrary.marketListField.dynamicType'),
align: 'center',
width: 180,
dataIndex: 'dynamicType_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.dynamicTypeCol ? row.dynamicTypeCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 主控部门
title: this.$t('standardRegulationLibrary.marketListField.mainControlDepartment'),
align: 'center',
width: 180,
dataIndex: 'mainDept_dictText',
- scopedSlots: { customRender: 'text' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.mainDeptCol ? row.mainDeptCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'text' }
},
{ // 主控部门专业模块
title: this.$t('standardRegulationLibrary.marketListField.masterControlDepartmentProfessionalModule'),
align: 'center',
width: 180,
dataIndex: 'mainDeptProfMode_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.mainDeptProfModeCol ? row.mainDeptProfModeCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 关联部门
title: this.$t('standardRegulationLibrary.marketListField.relatedDepartment'),
align: 'center',
width: 180,
dataIndex: 'associateDept_dictText',
- scopedSlots: { customRender: 'text' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.associateDeptCol ? row.associateDeptCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'text' }
},
{ // 关联部门专业模块
title: this.$t('standardRegulationLibrary.marketListField.associateDepartmentSpecializedModules'),
align: 'center',
width: 180,
dataIndex: 'associateDeptProfMode_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.associateDeptProfModeCol ? row.associateDeptProfModeCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 批量限制
title: this.$t('standardRegulationLibrary.marketListField.batchRestriction'),
align: 'center',
width: 180,
dataIndex: 'batchLimit_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.batchLimitCol ? row.batchLimitCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 自动驾驶等级
title: this.$t('standardRegulationLibrary.marketListField.automaticDrivingLevel'),
align: 'center',
width: 180,
dataIndex: 'autopilotLevel_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.autopilotLevelCol ? row.autopilotLevelCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 要求类型
title: this.$t('standardRegulationLibrary.marketListField.requirementType'),
align: 'center',
width: 180,
dataIndex: 'requireType_dictText',
- scopedSlots: { customRender: 'dictText' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.requireTypeCol ? row.requireTypeCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'dictText' }
},
{ // 备注
title: this.$t('standardRegulationLibrary.marketListField.remarks'),
align: 'center',
width: 180,
dataIndex: 'remark',
- scopedSlots: { customRender: 'text' }
+ customRender: (text, row, index) => {
+ return {
+ children:
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ {text || text === 0 ? text : Vue.prototype.global.emptyLine}
+ ,
+ attrs: {
+ // 合并行 含col字段则合并,其他的必须设置为0!!
+ rowSpan: row.remarkCol ? row.remarkCol : 0
+ }
+ }
+ }
+ // scopedSlots: { customRender: 'text' }
}
],
dataSource: [],
@@ -421,9 +625,61 @@ export default {
const result = res.result.records || res.result
this.dataSource = result.map(item => {
const arr = this.indexcount(result, item.standardNumber)
+ const newProductImplDateArr = this.indexCountOther(arr, item.newProductImplDate, 'newProductImplDate')
+ const newAuthImplDateArr = this.indexCountOther(arr, item.newAuthImplDate, 'newAuthImplDate')
+ const registrationDateArr = this.indexCountOther(arr, item.registrationDate, 'registrationDate')
+ const countryArr = this.indexCountOther(arr, item.country, 'country')
+ const applicableVehicleArr = this.indexCountOther(arr, item.applicableVehicle, 'applicableVehicle')
+ const authenticationObjectArr = this.indexCountOther(arr, item.authenticationObject, 'authenticationObject')
+ const certifyTheDeliverablesArr = this.indexCountOther(arr, item.certifyTheDeliverables, 'certifyTheDeliverables')
+ const typeArr = this.indexCountOther(arr, item.type, 'type')
+ const dynamicTypeArr = this.indexCountOther(arr, item.dynamicType, 'dynamicType')
+ const mainDeptArr = this.indexCountOther(arr, item.mainDept, 'mainDept')
+ const mainDeptProfModeArr = this.indexCountOther(arr, item.mainDeptProfMode, 'mainDeptProfMode')
+ const associateDeptArr = this.indexCountOther(arr, item.associateDept, 'associateDept')
+ const associateDeptProfModeArr = this.indexCountOther(arr, item.associateDeptProfMode, 'associateDeptProfMode')
+ const batchLimitArr = this.indexCountOther(arr, item.batchLimit, 'batchLimit')
+ const autopilotLevelArr = this.indexCountOther(arr, item.autopilotLevel, 'autopilotLevel')
+ const requireTypeArr = this.indexCountOther(arr, item.requireType, 'requireType')
+ const remarkArr = this.indexCountOther(arr, item.remark, 'remark')
return {
...item,
- col: item.id === arr[0] ? arr.length : 0
+ // 标准编号、标准名称、标准英文名称行合并
+ col: item.id === arr[0].id ? arr.length : 0,
+ // 新生产车实施日期行合并
+ newProductImplDateCol: item.id === newProductImplDateArr[0].id ? newProductImplDateArr.length : 0,
+ // 新认证车实施日期行合并
+ newAuthImplDateCol: item.id === newAuthImplDateArr[0].id ? newAuthImplDateArr.length : 0,
+ // 注册日期行合并
+ registrationDateCol: item.id === registrationDateArr[0].id ? registrationDateArr.length : 0,
+ // 适用国家/地区行合并
+ countryCol: item.id === countryArr[0].id ? countryArr.length : 0,
+ // 适用车型行合并
+ applicableVehicleCol: item.id === applicableVehicleArr[0].id ? applicableVehicleArr.length : 0,
+ // 认证对象行合并
+ authenticationObjectCol: item.id === authenticationObjectArr[0].id ? authenticationObjectArr.length : 0,
+ // 认证交付物行合并
+ certifyTheDeliverablesCol: item.id === certifyTheDeliverablesArr[0].id ? certifyTheDeliverablesArr.length : 0,
+ // 类型
+ typeCol: item.id === typeArr[0].id ? typeArr.length : 0,
+ // 动力类型
+ dynamicTypeCol: item.id === dynamicTypeArr[0].id ? dynamicTypeArr.length : 0,
+ // 主控部门
+ mainDeptCol: item.id === mainDeptArr[0].id ? mainDeptArr.length : 0,
+ // 主控部门专业模块
+ mainDeptProfModeCol: item.id === mainDeptProfModeArr[0].id ? mainDeptProfModeArr.length : 0,
+ // 关联部门
+ associateDeptCol: item.id === associateDeptArr[0].id ? associateDeptArr.length : 0,
+ // 关联部门专业模块
+ associateDeptProfModeCol: item.id === associateDeptProfModeArr[0].id ? associateDeptProfModeArr.length : 0,
+ // 批量限制
+ batchLimitCol: item.id === batchLimitArr[0].id ? batchLimitArr.length : 0,
+ // 自动驾驶等级
+ autopilotLevelCol: item.id === autopilotLevelArr[0].id ? autopilotLevelArr.length : 0,
+ // 要求类型
+ requireTypeCol: item.id === requireTypeArr[0].id ? requireTypeArr.length : 0,
+ // 备注
+ remarkCol: item.id === remarkArr[0].id ? remarkArr.length : 0
}
})
if (res.result.total) {
@@ -439,12 +695,22 @@ export default {
this.loading = false
})
},
- // 出现次数
+ // 标准编号出现次数
indexcount (arr, item) {
const arr1 = []
for (var i = 0; i < arr.length; i++) {
if (arr[i].standardNumber === item) {
- arr1.push(arr[i].id)
+ arr1.push(arr[i])
+ }
+ }
+ return arr1
+ },
+ // 其他出现次数
+ indexCountOther (arr, item, fieldName) {
+ const arr1 = []
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i][fieldName] === item) {
+ arr1.push(arr[i])
}
}
return arr1