From a770e2b74d3cdfdae4ebd4aa898d8f4409abd291 Mon Sep 17 00:00:00 2001 From: lq <121091329@qq.com> Date: Sat, 20 Sep 2025 15:39:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/draw-popup.vue | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/views/property-marketing/assignment-management/components/draw-popup.vue b/src/views/property-marketing/assignment-management/components/draw-popup.vue index e83d11e..f3e18d7 100644 --- a/src/views/property-marketing/assignment-management/components/draw-popup.vue +++ b/src/views/property-marketing/assignment-management/components/draw-popup.vue @@ -187,6 +187,18 @@ @page-size-change="onPageSizeChange" /> + @@ -200,7 +212,7 @@ import dayjs from 'dayjs'; import { getRawMaterialsPage } from '@/api/all/generationWorkshop'; // 工具引入 import { useTableSelectionWithPagination } from '@/hooks/useTableSelectionWithPagination'; - +const choseText = ref(''); const columns = ref([ { title: '文件名称', @@ -239,6 +251,18 @@ const { pageInfo, onPageChange, onPageSizeChange, rowSelection, selectedRowKeys watch(selectedRowKeys, (newVal) => { console.log(newVal); query.ids = newVal; + const filteredData = materialData.value.filter((item) => newVal.includes(item.id)); + choseText.value = ''; + const typeCount = filteredData.reduce((acc, item) => { + acc[item.type] = (acc[item.type] || 0) + 1; + return acc; + }, {}); + console.log('+++++', typeCount); + Object.entries(typeCount).forEach(([type, count]) => { + console.log('++++tyype', type, getType(type)); + console.log(`${getType(type)}: ${count}个`); + choseText.value += `${getType(type)}: ${count}个 `; + }); }); // 定义props和emit @@ -276,12 +300,19 @@ const publishOptions = ref([ const publishType = ref('immediate'); const getType = (type) => { + // 处理字符串和数字类型的type值 switch (type) { case RawMaterialType.Image: + case '0': + case 0: return '图片'; case RawMaterialType.Video: + case '1': + case 1: return '视频'; case RawMaterialType.Text: + case '2': + case 2: return '文本'; default: return '未知';