完善审计报告生成页面

This commit is contained in:
2026-03-29 21:05:07 +08:00
parent 65235ec961
commit 5685dab1d0
7 changed files with 2343 additions and 518 deletions

View File

@@ -170,45 +170,34 @@
<!-- </div>-->
<!-- 单内容部分 -->
<template v-if="!item.children">
<a-textarea
v-model:value="item.content"
:rows="item.rows || 8"
:placeholder="'点击(AI生成)按钮让AI为您生成该部分内容或直接填入'"
class="content-textarea"
style="margin-top: 16px; background-color: #f0fdf4"
/>
<div style="margin-top: 12px;">
<div class="question-prompt">AI小助手</div>
<div class="textarea-with-button" style="width: 600px">
<a-textarea
v-model:value="item.suggestion"
:rows="3"
placeholder="请输入您的要求并回车..."
class="suggestion-textarea-inner"
@pressEnter="generateContent(index)"
/>
<a-button
type="danger"
size="small"
@click="generateContent(index)"
:loading="item.generating"
class="send-button-inner"
>
<template #icon>
<RobotOutlined/>
</template>
发送
</a-button>
</div>
<div class="content-with-ai-button">
<a-textarea
v-model:value="item.content"
:rows="item.rows || 8"
:placeholder="'点击 (AI 生成) 按钮让 AI 为您生成该部分内容,或直接填入'"
class="content-textarea"
style="background-color: #f0fdf4"
/>
<a-button
type="primary"
size="large"
@click="generateContent(index)"
:loading="item.generating"
class="ai-generate-btn"
>
<template #icon>
<RobotOutlined/>
</template>
AI 生成
</a-button>
</div>
</template>
<!-- 多内容部分 -->
<template v-else>
<div v-for="(child, childIndex) in item.children" :key="childIndex" class="child-section" style="border-left: 3px solid #1890ff; padding-left: 16px; margin-bottom: 20px;">
<div class="child-title" style="display: flex; align-items: center; justify-content: space-between;">
<span style="font-weight: bold;">{{ child.name }}</span>
<template v-if="item.children">
<div v-for="(child, childIndex) in item.children" :key="childIndex" class="child-section">
<div class="child-header">
<span class="child-title">{{ `${childIndex + 1}${child.name}` }}</span>
<a-space>
<a-button
type="primary"
@@ -236,10 +225,10 @@
</a-button>
<a-button
type="primary"
size="small"
size="large"
@click.stop="generateContent(index, childIndex)"
:loading="child.generating"
class="child-action-button ai-generate-button"
class="ai-generate-btn"
>
<template #icon>
<RobotOutlined/>
@@ -253,34 +242,8 @@
:rows="child.rows || 6"
:placeholder="child.placeholder"
class="content-textarea"
style="margin-top: 12px; background-color: #f0fdf4"
style="background-color: #f0fdf4"
/>
<!-- AI小助手功能 -->
<div style="margin-top: 12px">
<div class="question-prompt">AI小助手</div>
<div class="textarea-with-button" style="width: 600px">
<a-textarea
v-model:value="child.suggestion"
:rows="3"
placeholder="请输入优化提示词并回车..."
class="suggestion-textarea-inner"
@pressEnter="generateContent(index, childIndex)"
/>
<a-button
type="danger"
size="small"
@click="generateContent(index, childIndex)"
:loading="child.generating"
class="send-button-inner"
>
<template #icon>
<RobotOutlined/>
</template>
发送
</a-button>
</div>
</div>
</div>
</template>
</a-card>
@@ -1807,24 +1770,68 @@ export default {
border-radius: 6px;
}
.content-with-ai-button {
position: relative;
margin-top: 16px;
.ant-textarea {
min-height: 120px;
}
.ai-generate-btn {
position: absolute;
top: 8px;
right: 8px;
z-index: 10;
background-color: #722ed1 !important;
border-color: #722ed1 !important;
&:hover {
background-color: #9254de !important;
border-color: #9254de !important;
box-shadow: 0 4px 12px rgba(114, 46, 209, 0.4) !important;
}
}
}
.child-section {
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 1px dashed #e8e8e8;
position: relative;
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
}
.child-title {
font-weight: 600;
font-size: 15px;
color: #333;
margin-bottom: 8px;
padding-left: 8px;
border-left: 3px solid #1890ff;
.child-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
padding: 12px 16px;
background: #f5f7fa;
border-radius: 6px 6px 0 0;
border-left: 3px solid #1890ff;
.child-title {
font-weight: 600;
font-size: 15px;
color: #333;
}
.ai-generate-btn {
background-color: #722ed1 !important;
border-color: #722ed1 !important;
&:hover {
background-color: #9254de !important;
border-color: #9254de !important;
box-shadow: 0 4px 12px rgba(114, 46, 209, 0.4) !important;
}
}
}
}
.content-textarea {