feat(M08-B): 补联调阻断摘要
This commit is contained in:
@@ -58,6 +58,21 @@
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
<section v-if="blockedItems.length" class="handoff-blockers">
|
||||
<header>
|
||||
<div>
|
||||
<h3>阻断摘要</h3>
|
||||
<span>{{ blockedItems.length }} 个现场阻断项需要外部处理</span>
|
||||
</div>
|
||||
<el-button :icon="Copy" @click="copyBlockedSummary">复制摘要</el-button>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="item in blockedItems" :key="item.id">
|
||||
<strong>{{ item.category }} · {{ item.title }}</strong>
|
||||
<span>{{ draft[item.id].owner || '未分派' }} / {{ draft[item.id].note || item.expected }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<el-table :data="filteredChecklist" class="data-table" row-key="id">
|
||||
<el-table-column prop="category" label="类别" width="120" />
|
||||
@@ -111,7 +126,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { Check, Download, ListChecks, RotateCcw } from '@lucide/vue';
|
||||
import { Check, Copy, Download, ListChecks, RotateCcw } from '@lucide/vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
type FieldStatus = 'PENDING' | 'PASS' | 'BLOCKED' | 'SKIP';
|
||||
|
||||
@@ -206,6 +222,7 @@ const filteredChecklist = computed(() => checklist.filter((item) => {
|
||||
const passedCount = computed(() => checklist.filter((item) => draft[item.id].status === 'PASS').length);
|
||||
const blockedCount = computed(() => checklist.filter((item) => draft[item.id].status === 'BLOCKED').length);
|
||||
const pendingCount = computed(() => checklist.filter((item) => draft[item.id].status === 'PENDING').length);
|
||||
const blockedItems = computed(() => checklist.filter((item) => draft[item.id].status === 'BLOCKED'));
|
||||
|
||||
function createInitialDraft() {
|
||||
const saved = readSavedDraft();
|
||||
@@ -243,6 +260,19 @@ function applyBulkMark() {
|
||||
persistDraft();
|
||||
}
|
||||
|
||||
async function copyBlockedSummary() {
|
||||
const content = blockedItems.value.map((item) => {
|
||||
const itemDraft = draft[item.id];
|
||||
return `[${item.category}] ${item.title} - ${itemDraft.owner || '未分派'} - ${itemDraft.note || item.expected}`;
|
||||
}).join('\n');
|
||||
try {
|
||||
await navigator.clipboard.writeText(content);
|
||||
ElMessage.success('阻断摘要已复制');
|
||||
} catch {
|
||||
ElMessage.warning('当前浏览器不允许自动复制,请使用导出 CSV 留存');
|
||||
}
|
||||
}
|
||||
|
||||
function exportChecklist() {
|
||||
downloadCsv(`cleaning-field-handoff-${Date.now()}.csv`, [
|
||||
['ID', '类别', '检查项', '期望', '状态', '负责人', '结果记录', '证据'],
|
||||
|
||||
Reference in New Issue
Block a user