From a35a5b37dc8903477b5f975c6757ef4fb273770d Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Mon, 30 Dec 2024 11:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/battery/cellCore/cellCore.data.ts | 4 +- .../battery/cellDevice/cellDevice.data.ts | 5 +- src/views/battery/cellEnv/cellEnv.data.ts | 4 +- src/views/battery/cellPass/cellPass.data.ts | 4 +- src/views/battery/cellPlate/cellPlate.data.ts | 4 +- src/views/battery/monomer/index.vue | 128 ++++++++++++------ 6 files changed, 102 insertions(+), 47 deletions(-) diff --git a/src/views/battery/cellCore/cellCore.data.ts b/src/views/battery/cellCore/cellCore.data.ts index 1de56e6..dff619d 100644 --- a/src/views/battery/cellCore/cellCore.data.ts +++ b/src/views/battery/cellCore/cellCore.data.ts @@ -59,6 +59,7 @@ export const CellCore = useCrudSchemas(reactive([ } }, isForm: false, + isTableForm:false }, { label: '操作', @@ -67,6 +68,7 @@ export const CellCore = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isTableForm:false } ])) diff --git a/src/views/battery/cellDevice/cellDevice.data.ts b/src/views/battery/cellDevice/cellDevice.data.ts index bc475cf..221395d 100644 --- a/src/views/battery/cellDevice/cellDevice.data.ts +++ b/src/views/battery/cellDevice/cellDevice.data.ts @@ -74,7 +74,7 @@ export const CellDevice = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, - isForm: false, + isTableForm:false }, { label: '操作', @@ -83,6 +83,7 @@ export const CellDevice = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isTableForm:false } ])) diff --git a/src/views/battery/cellEnv/cellEnv.data.ts b/src/views/battery/cellEnv/cellEnv.data.ts index a8694ec..664db49 100644 --- a/src/views/battery/cellEnv/cellEnv.data.ts +++ b/src/views/battery/cellEnv/cellEnv.data.ts @@ -171,6 +171,7 @@ export const CellEnv = useCrudSchemas(reactive([ } }, isForm: false, + isTableForm:false }, { label: '操作', @@ -179,6 +180,7 @@ export const CellEnv = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isTableForm:false } ])) diff --git a/src/views/battery/cellPass/cellPass.data.ts b/src/views/battery/cellPass/cellPass.data.ts index 00f4615..d6c8f61 100644 --- a/src/views/battery/cellPass/cellPass.data.ts +++ b/src/views/battery/cellPass/cellPass.data.ts @@ -51,6 +51,7 @@ export const CellPass = useCrudSchemas(reactive([ } }, isForm: false, + isTableForm:false }, { label: '操作', @@ -59,6 +60,7 @@ export const CellPass = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isTableForm:false } ])) diff --git a/src/views/battery/cellPlate/cellPlate.data.ts b/src/views/battery/cellPlate/cellPlate.data.ts index 051efd2..b966fd7 100644 --- a/src/views/battery/cellPlate/cellPlate.data.ts +++ b/src/views/battery/cellPlate/cellPlate.data.ts @@ -117,6 +117,7 @@ export const CellPlate = useCrudSchemas(reactive([ } }, isForm: false, + isTableForm:false }, { label: '操作', @@ -125,6 +126,7 @@ export const CellPlate = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isTableForm:false } ])) diff --git a/src/views/battery/monomer/index.vue b/src/views/battery/monomer/index.vue index 2757f8f..8a2d935 100644 --- a/src/views/battery/monomer/index.vue +++ b/src/views/battery/monomer/index.vue @@ -440,61 +440,107 @@ const isStatic = ref(true) const addTableType = ref('') const handleAddTable = (type)=>{ addTableType.value = type - let allSchemas = CellDevice.allSchemas - let apiPage = CellDeviceApi.getCellDevicePage - let tableTitle = '' if(type == 'Device'){ // 设备 - tableTitle = '单体产线设备' - allSchemas = CellDevice.allSchemas - apiPage = CellDeviceApi.getCellDevicePage + let tableFormKeys = {} + CellDevice.allSchemas.tableFormColumns.forEach(item => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + tableDataDevice.value.push(JSON.parse(JSON.stringify(tableFormKeys))) }else if(type == 'Env'){ // 环境 - tableTitle = '单体产线环境' - allSchemas = CellEnv.allSchemas - apiPage = CellEnvApi.getCellEnvPage + let tableFormKeys = {} + CellEnv.allSchemas.tableFormColumns.forEach(item => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + tableDataEnv.value.push(JSON.parse(JSON.stringify(tableFormKeys))) }else if(type == 'Plate'){ // 单体极片 - tableTitle = '单体极片' - allSchemas = CellPlate.allSchemas - apiPage = CellPlateApi.getCellPlatePage + let tableFormKeys = {} + CellPlate.allSchemas.tableFormColumns.forEach(item => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + tableDataPlate.value.push(JSON.parse(JSON.stringify(tableFormKeys))) }else if(type == 'Core'){ // 单体卷芯或叠芯 - tableTitle = '单体卷芯或叠芯' - allSchemas = CellCore.allSchemas - apiPage = CellCoreApi.getCellCorePage + let tableFormKeys = {} + CellCore.allSchemas.tableFormColumns.forEach(item => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + tableDataCore.value.push(JSON.parse(JSON.stringify(tableFormKeys))) }else if(type == 'Prod'){ // 单体产品 - tableTitle = '单体产品' - allSchemas = CellProd.allSchemas - apiPage = CellProdApi.getCellProdPage + let tableFormKeys = {} + CellProd.allSchemas.tableFormColumns.forEach(item => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + tableDataProd.value.push(JSON.parse(JSON.stringify(tableFormKeys))) }else if(type == 'Pass'){ // 单体直通率 - tableTitle = '单体直通率' - allSchemas = CellPass.allSchemas - apiPage = CellPassApi.getCellPassPage + let tableFormKeys = {} + CellPass.allSchemas.tableFormColumns.forEach(item => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + tableDataPass.value.push(JSON.parse(JSON.stringify(tableFormKeys))) } - - - searchTableRef.value.open( - tableTitle, - allSchemas, - apiPage, - "hahaha", - "hahaha", - !isStatic.value, - 'tableForm', - null, - { - // 参数 - // supplierCode:formRef.value.formRef.formModel.supplierCode, - // itemCode:formRef.value.formRef.formModel.itemCode - }, - undefined, - false, - undefined - ) } +// const handleAddTable = (type)=>{ +// addTableType.value = type +// let allSchemas = CellDevice.allSchemas +// let apiPage = CellDeviceApi.getCellDevicePage +// let tableTitle = '' +// if(type == 'Device'){ +// // 设备 +// tableTitle = '单体产线设备' +// allSchemas = CellDevice.allSchemas +// apiPage = CellDeviceApi.getCellDevicePage +// }else if(type == 'Env'){ +// // 环境 +// tableTitle = '单体产线环境' +// allSchemas = CellEnv.allSchemas +// apiPage = CellEnvApi.getCellEnvPage +// }else if(type == 'Plate'){ +// // 单体极片 +// tableTitle = '单体极片' +// allSchemas = CellPlate.allSchemas +// apiPage = CellPlateApi.getCellPlatePage +// }else if(type == 'Core'){ +// // 单体卷芯或叠芯 +// tableTitle = '单体卷芯或叠芯' +// allSchemas = CellCore.allSchemas +// apiPage = CellCoreApi.getCellCorePage +// }else if(type == 'Prod'){ +// // 单体产品 +// tableTitle = '单体产品' +// allSchemas = CellProd.allSchemas +// apiPage = CellProdApi.getCellProdPage +// }else if(type == 'Pass'){ +// // 单体直通率 +// tableTitle = '单体直通率' +// allSchemas = CellPass.allSchemas +// apiPage = CellPassApi.getCellPassPage +// } + + +// searchTableRef.value.open( +// tableTitle, +// allSchemas, +// apiPage, +// "hahaha", +// "hahaha", +// !isStatic.value, +// 'tableForm', +// null, +// { +// // 参数 +// // supplierCode:formRef.value.formRef.formModel.supplierCode, +// // itemCode:formRef.value.formRef.formModel.itemCode +// }, +// undefined, +// false, +// undefined +// ) +// } // 删除明细 const handleDeleteTable = (item, index, type) => { if(type == 'Device'){