2026-02-11 17:27:51 +08:00
|
|
|
<template>
|
|
|
|
|
<div
|
|
|
|
|
class="preview-container flex"
|
|
|
|
|
:class="type === 'sketch' ? 'sketch-preview' : 'report-preview'"
|
|
|
|
|
>
|
|
|
|
|
<template v-if="type === 'sketch'">
|
2026-02-25 15:10:03 +08:00
|
|
|
<div
|
|
|
|
|
class="sketch-item"
|
|
|
|
|
v-for="(item, index) in sketchList"
|
|
|
|
|
:key="'sketch-item-' + index"
|
|
|
|
|
>
|
2026-02-11 17:27:51 +08:00
|
|
|
<Menu class="menu-btn" @click="handleClickMenu" />
|
2026-03-10 16:57:04 +08:00
|
|
|
<div
|
|
|
|
|
class="edit-btn flex align-center space-between"
|
|
|
|
|
@click="handleClickEdit(item)"
|
|
|
|
|
>
|
2026-02-11 17:27:51 +08:00
|
|
|
<div>Edit</div>
|
2026-02-25 15:10:03 +08:00
|
|
|
<img src="@/assets/images/arrow-top-right.png" />
|
2026-02-11 17:27:51 +08:00
|
|
|
</div>
|
2026-02-25 15:10:03 +08:00
|
|
|
<img
|
|
|
|
|
:src="getImageSrc(item, index)"
|
|
|
|
|
:alt="'sketch-' + index"
|
|
|
|
|
@load="handleImageLoad(index)"
|
|
|
|
|
/>
|
2026-02-11 17:27:51 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
2026-02-23 13:28:43 +08:00
|
|
|
<div v-else class="reportBorder">
|
|
|
|
|
<div class="report">
|
|
|
|
|
<div v-if="false" class="report-content-null">
|
|
|
|
|
<img :src="reportNull" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else class="report-content">
|
|
|
|
|
<div class="downBtnBox">
|
|
|
|
|
<div class="downBtn">
|
|
|
|
|
<div class="icon">
|
|
|
|
|
<SvgIcon name="reportDown" size="16"></SvgIcon>
|
|
|
|
|
</div>
|
|
|
|
|
<span>{{ $t('agent.Download') }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content">
|
2026-02-25 15:10:03 +08:00
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题 <br />
|
|
|
|
|
# 一级标题
|
|
|
|
|
<br />
|
|
|
|
|
# 一级标题
|
2026-02-23 13:28:43 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-11 17:27:51 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-02-25 15:10:03 +08:00
|
|
|
import { ref, reactive } from 'vue'
|
2026-02-11 17:27:51 +08:00
|
|
|
import Menu from './Menu.vue'
|
2026-02-25 15:10:03 +08:00
|
|
|
import LoadingImg from '@/assets/images/sketch-loading.gif'
|
|
|
|
|
import reportNull from '@/assets/images/reportNull.png'
|
2026-03-10 16:57:04 +08:00
|
|
|
import myEvent from '@/utils/myEvent'
|
|
|
|
|
import { useProjectStore } from '@/stores'
|
|
|
|
|
const projectStore = useProjectStore()
|
2026-02-25 15:10:03 +08:00
|
|
|
|
|
|
|
|
// 存储每个图片的加载状态
|
|
|
|
|
const loadedStatus = reactive<Record<number, boolean>>({})
|
2026-02-11 17:27:51 +08:00
|
|
|
|
|
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
type: 'sketch' | 'report'
|
2026-02-25 15:10:03 +08:00
|
|
|
sketchList: Array<string>
|
2026-02-11 17:27:51 +08:00
|
|
|
}>(),
|
|
|
|
|
{
|
2026-02-25 15:10:03 +08:00
|
|
|
type: 'sketch',
|
|
|
|
|
sketchList: []
|
2026-02-11 17:27:51 +08:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2026-02-25 15:10:03 +08:00
|
|
|
// 图片加载完成时触发
|
|
|
|
|
const handleImageLoad = (index: number) => {
|
|
|
|
|
loadedStatus[index] = true
|
|
|
|
|
}
|
2026-02-11 17:27:51 +08:00
|
|
|
|
2026-02-25 15:10:03 +08:00
|
|
|
// 获取当前显示的图片源
|
|
|
|
|
const getImageSrc = (item: string, index: number) => {
|
2026-03-10 16:57:04 +08:00
|
|
|
if (typeof item === 'string') {
|
|
|
|
|
return loadedStatus[index] ? item : LoadingImg
|
|
|
|
|
}
|
|
|
|
|
if (typeof item === 'object') {
|
|
|
|
|
return Object.values(item)[0]
|
|
|
|
|
}
|
2026-02-25 15:10:03 +08:00
|
|
|
}
|
2026-02-11 17:27:51 +08:00
|
|
|
|
2026-03-10 16:57:04 +08:00
|
|
|
const handleClickEdit = (item: string) => {
|
|
|
|
|
const url = Object.values(item)[0]
|
|
|
|
|
const imgId = Object.keys(item)[0]
|
|
|
|
|
const nodeId = projectStore.state.nodeId
|
|
|
|
|
myEvent.emit('openFlowCanvas', { url, imgId, nodeId })
|
2026-02-25 15:10:03 +08:00
|
|
|
}
|
|
|
|
|
const handleClickMenu = () => {
|
|
|
|
|
// 菜单按钮点击逻辑
|
|
|
|
|
console.log('Menu button clicked')
|
|
|
|
|
}
|
2026-02-11 17:27:51 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.preview-container {
|
2026-02-23 13:28:43 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
2026-02-11 17:27:51 +08:00
|
|
|
gap: 1.2rem;
|
|
|
|
|
flex-wrap: wrap;
|
2026-03-03 17:29:11 +08:00
|
|
|
overflow-y: auto;
|
|
|
|
|
align-content: flex-start;
|
2026-02-11 17:27:51 +08:00
|
|
|
.sketch-item {
|
|
|
|
|
position: relative;
|
2026-03-03 17:29:11 +08:00
|
|
|
width: calc((100% - 1.2rem * 3) / 4);
|
|
|
|
|
//设置比例
|
|
|
|
|
aspect-ratio: 1 / 1;
|
|
|
|
|
border-radius: 1.6rem;
|
2026-02-11 17:27:51 +08:00
|
|
|
img {
|
2026-03-03 17:29:11 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
2026-02-11 17:27:51 +08:00
|
|
|
border-radius: 1.6rem;
|
|
|
|
|
}
|
|
|
|
|
.menu-btn {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 2.1rem;
|
|
|
|
|
right: 1.5rem;
|
|
|
|
|
}
|
|
|
|
|
.edit-btn {
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 1rem;
|
|
|
|
|
bottom: 1.1rem;
|
|
|
|
|
width: 7.8rem;
|
|
|
|
|
height: 3.59rem;
|
|
|
|
|
border-radius: 2rem;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border: 0.2rem solid #e5e5e5;
|
|
|
|
|
font-size: 1.4rem;
|
2026-02-23 13:28:43 +08:00
|
|
|
padding: 0 0.9rem 0 1.4rem;
|
|
|
|
|
cursor: pointer;
|
2026-02-25 15:10:03 +08:00
|
|
|
img {
|
2026-02-23 13:28:43 +08:00
|
|
|
width: 1.8rem;
|
|
|
|
|
height: 1.8rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-25 15:10:03 +08:00
|
|
|
.reportBorder {
|
2026-02-23 13:28:43 +08:00
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
--border-width: 3px;
|
|
|
|
|
flex: 1;
|
2026-02-24 13:20:05 +08:00
|
|
|
overflow: hidden;
|
|
|
|
|
height: 100%;
|
2026-02-23 13:28:43 +08:00
|
|
|
&::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
2026-02-25 15:10:03 +08:00
|
|
|
background: linear-gradient(
|
|
|
|
|
119.03deg,
|
|
|
|
|
rgba(233, 121, 60, 0.3) 1.61%,
|
|
|
|
|
rgba(255, 207, 144, 0.3) 101.01%
|
|
|
|
|
);
|
2026-02-23 13:28:43 +08:00
|
|
|
border-radius: 2.3rem;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
left: -50%;
|
|
|
|
|
top: -50%;
|
|
|
|
|
transform: translate(50%, 50%);
|
|
|
|
|
}
|
|
|
|
|
.report {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
width: calc(100% - var(--border-width) * 2);
|
|
|
|
|
height: calc(100% - var(--border-width) * 2);
|
|
|
|
|
border-radius: 2rem;
|
|
|
|
|
display: flex;
|
2026-02-25 15:10:03 +08:00
|
|
|
.report-content-null {
|
2026-02-23 13:28:43 +08:00
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
2026-02-25 15:10:03 +08:00
|
|
|
.report-content {
|
2026-02-23 13:28:43 +08:00
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-02-24 13:20:05 +08:00
|
|
|
overflow: hidden;
|
2026-02-25 15:10:03 +08:00
|
|
|
.downBtnBox {
|
2026-02-23 13:28:43 +08:00
|
|
|
padding: 2.2rem 5.2rem 0;
|
2026-02-25 15:10:03 +08:00
|
|
|
.downBtn {
|
2026-02-23 13:28:43 +08:00
|
|
|
display: flex;
|
|
|
|
|
width: 11.2rem;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
line-height: 3.2rem;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
background-color: #ff7a51;
|
|
|
|
|
color: #fff;
|
|
|
|
|
cursor: pointer;
|
2026-02-25 15:10:03 +08:00
|
|
|
.icon {
|
|
|
|
|
margin-right: 0.02rem;
|
2026-02-23 13:28:43 +08:00
|
|
|
}
|
2026-02-25 15:10:03 +08:00
|
|
|
span {
|
2026-02-23 13:28:43 +08:00
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: 1.2rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-25 15:10:03 +08:00
|
|
|
.content {
|
2026-02-23 13:28:43 +08:00
|
|
|
word-break: break-word;
|
|
|
|
|
white-space: pre-wrap;
|
2026-02-24 13:20:05 +08:00
|
|
|
overflow-y: auto;
|
|
|
|
|
margin: 2rem;
|
2026-02-23 13:28:43 +08:00
|
|
|
}
|
|
|
|
|
}
|
2026-02-11 17:27:51 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|