diff --git a/src/views/mediaLibrary/exportDialog.vue b/src/views/mediaLibrary/exportDialog.vue index 3d142cd..649341b 100644 --- a/src/views/mediaLibrary/exportDialog.vue +++ b/src/views/mediaLibrary/exportDialog.vue @@ -1359,20 +1359,17 @@ const handleCheckedBaseFieldChange = (value) => { baseFieldIsIndeterminate.value = checkedCount > 0 && checkedCount < baseFields.value.length } // 报价字段全选操作 -const handleCheckAllPriceFieldChange = (val) => { - console.log('全选报价字段', val) +const handleCheckAllPriceFieldChange = (val) => { checkedPriceFields.value = [] if (val) { priceFields.value.forEach(element => { checkedPriceFields.value.push(element.propertyPath) }); - if (ToolOptions.value.length == 8) { - console.log('待处理报价', exportForm.value.mediaTypeExport, activeIndex.value) + if (ToolOptions.value.length == 8) { // 查找指定类型的报价字段 let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == activeIndex.value); - if (curPriceFields.length > 0) { - console.log('过滤后的数据', curPriceFields[0].exportPriceFields) + if (curPriceFields.length > 0) { curPriceFields[0].exportPriceFields = [...checkedPriceFields.value] // 使用数组索引 } } @@ -1383,16 +1380,13 @@ const handleCheckAllPriceFieldChange = (val) => { curPriceFields[0].exportPriceFields = [...checkedPriceFields.value] // 使用数组索引 } } - if (ToolOptions.value.length == 0) { - console.log('待处理报价', exportForm.value.mediaTypeExport, 0) + if (ToolOptions.value.length == 0) { // 查找指定类型的报价字段 let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == 0); - if (curPriceFields.length > 0) { - console.log('过滤后的数据', curPriceFields[0].exportPriceFields) + if (curPriceFields.length > 0) { curPriceFields[0].exportPriceFields = [...checkedPriceFields.value] // 使用数组索引 } - } - console.log('处理后的报价字段', exportForm.value.mediaTypeExport) + } } else { if (ToolOptions.value.length == 8) { // 查找指定类型的报价字段 @@ -1413,16 +1407,14 @@ const handleCheckAllPriceFieldChange = (val) => { if (curPriceFields.length > 0) { curPriceFields[0].exportPriceFields = [] } - } - console.log('处理后的报价字段', exportForm.value.mediaTypeExport) + } } priceFieldIsIndeterminate.value = false // 更新选择状态 checkPriceFieldSelectStatus() } // 单个选择报价字段 -const handleCheckedPriceFieldChange = (value) => { - console.log('单个选择报价字段', value) +const handleCheckedPriceFieldChange = (value) => { const checkedCount = value.length priceFieldCheckAll.value = checkedCount === priceFields.value.length priceFieldIsIndeterminate.value = checkedCount > 0 && checkedCount < priceFields.value.length @@ -1530,19 +1522,15 @@ const getMediaExcelPriceField = () => { // 判断报价信息是否存在指定类型数据 const handleCheckPriceField = (_mediaType) => { // 获取当前的所有要导出的报价字段 - const currentMediaTypeExport = [...exportForm.value.mediaTypeExport]; // 创建副本以避免直接修改原数组 - console.log('要导出的报价字段', currentMediaTypeExport) + const currentMediaTypeExport = [...exportForm.value.mediaTypeExport]; // 创建副本以避免直接修改原数组 // 过滤掉指定类型的旧数据 - const filteredFields = currentMediaTypeExport.filter(item => item.type !== _mediaType); - console.log('要导出的报价旧数据', filteredFields) + const filteredFields = currentMediaTypeExport.filter(item => item.type !== _mediaType); // 判断是否有指定类型数据 - const _mediaTypeArr = currentMediaTypeExport.filter(item => item.type == _mediaType); - console.log('当前类型的报价数据', _mediaTypeArr) + const _mediaTypeArr = currentMediaTypeExport.filter(item => item.type == _mediaType); // 如果数据不存在 if (_mediaTypeArr.length == 0) { filteredFields.push({ type: _mediaType, exportPriceFields: [] }); // 使用 push 追加新文件 - exportForm.value.mediaTypeExport = [...filteredFields]; // 更新 ref - console.log('更新后的数据', exportForm.value.mediaTypeExport) + exportForm.value.mediaTypeExport = [...filteredFields]; // 更新 ref } } // 类型切换 @@ -1635,8 +1623,7 @@ const handleChangeType = (_type) => { checkedPriceFields.value = currentCheckedFields break; } - let wlType = _type + 1 - console.log('网络类型', wlType) + let wlType = _type + 1 handleCheckPriceField(wlType) }