From f6005b27997ce1755ae6542787f7ec1ac55c74b7 Mon Sep 17 00:00:00 2001 From: wsm <2746563060@qq.com> Date: Tue, 18 Aug 2026 11:16:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(bgpartymatter):=20=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=A0=A1=E9=AA=8C=E5=AF=BC=E5=85=A5=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=B8=BA=E5=AF=BC=E5=85=A5=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bg/bgpartymatter/BgPartymatterList.vue | 118 ++++++++++++++++-- 1 file changed, 109 insertions(+), 9 deletions(-) diff --git a/src/views/bg/bgpartymatter/BgPartymatterList.vue b/src/views/bg/bgpartymatter/BgPartymatterList.vue index 2be7ce6..5d9e647 100644 --- a/src/views/bg/bgpartymatter/BgPartymatterList.vue +++ b/src/views/bg/bgpartymatter/BgPartymatterList.vue @@ -68,15 +68,7 @@ @@ -723,6 +742,43 @@ sm: 20, }); + // ================= 导入弹窗(下载模板 / 模板校验 / 模板导入) ================= + const importModalVisible = ref(false); + const fileInputRef = ref(); + const pendingAction = ref<'check' | 'import' | null>(null); + + function openImportModal() { + importModalVisible.value = true; + } + + function handleDownloadTemplateFromModal() { + importModalVisible.value = false; + handleDownloadTemplate(); + } + + /** 触发隐藏文件选择框,记录当前动作(校验 or 导入) */ + function chooseFile(action: 'check' | 'import') { + pendingAction.value = action; + fileInputRef.value?.click(); + } + + /** 文件选择后按动作分发到原校验/导入逻辑 */ + function onFileSelected(e) { + const file = e.target.files?.[0]; + e.target.value = ''; + if (!file) { + return; + } + const action = pendingAction.value; + pendingAction.value = null; + importModalVisible.value = false; + if (action === 'check') { + void handleCheckExcel({ file }); + } else if (action === 'import') { + void handleImportByTemplate({ file }); + } + } + async function handleDownloadTemplate() { const data = await defHttp.get({ url: getExportXlsHeadersUrl, params: { meetingType: props.meetingType }, responseType: 'blob', timeout: 60000 }, { isTransformResponse: false }); if (!data) { @@ -961,4 +1017,48 @@ .status-row-3 td { background: #f6ffed !important; } + /* 导入弹窗操作卡片 */ + .import-action-list { + display: flex; + flex-direction: column; + gap: 12px; + padding: 4px 8px 8px; + } + .import-action-card { + display: flex; + align-items: center; + gap: 14px; + padding: 14px 16px; + border: 1px solid #e5e6eb; + border-radius: 8px; + background: #fff; + cursor: pointer; + transition: all 0.2s ease; + } + .import-action-card:hover { + border-color: #1677ff; + background: #f0f7ff; + box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15); + transform: translateY(-1px); + } + .import-action-icon { + font-size: 26px; + color: #1677ff; + flex-shrink: 0; + } + .import-action-body { + min-width: 0; + } + .import-action-title { + font-size: 15px; + font-weight: 600; + color: #1f2329; + line-height: 1.4; + } + .import-action-desc { + margin-top: 4px; + font-size: 12px; + color: #8a919f; + line-height: 1.5; + }