This commit is contained in:
X1627315083@163.com
2026-03-19 17:14:57 +08:00
parent 4648416f13
commit 59a9c7c80f
3 changed files with 12 additions and 21 deletions

View File

@@ -23,7 +23,6 @@
</button>
</div>
<img
v-loadimg="false"
class="image"
v-if="item.status == 'RETURNED'"
:src="item?.url"
@@ -59,11 +58,10 @@
<script setup lang="ts">
import myEvent from '@/utils/myEvent'
import { downloadImage, base64Tofile } from '../../../tools/tools'
import { downloadImage } from '../../../tools/tools'
import { reactive, ref, onBeforeUnmount, useAttrs, inject, watch, computed, onMounted } from 'vue'
import HighlightAdmin from '@/components/highlightAdmin.vue'
import { NODE_DATATYPE } from '../../tools/index.d'
import { uploadImage } from '@/api/upload'
const openImagePreview = inject('openImagePreview') as (url: string) => void
const openThreeModelPreview = inject('openThreeModelPreview') as (url: string) => void
const props = defineProps({
@@ -205,25 +203,19 @@
eventManager.registerEvents()
}
const depthCanvasWorkbench = (options)=>{
console.log(options)
// 1. 提取 MIME 类型和 Base64 数据
const file = base64Tofile(options.url,'image.png')
const formData = new FormData()
formData.append('file', file)
uploadImage(formData).then((res) => {
data.imageProcessTasks.forEach((item) => {
if(item.taskId == options.taskId){
item.url = res
item.url = options.url
item.canvasId = options.canvasId || null
}
})
})
}
const onEdit = (item: any) => {
const data = {
url:item.url,
id: item.taskId,
canvasId: item?.canvasId || null,
sketchId: stateManager.sketchId.value,
onWorkbench:(options)=>{
let workbenchData = {
...item,

View File

@@ -8,7 +8,7 @@
import FullscreenDialog from '../components/fullscreen-dialog.vue'
import flowCanvas from './flow-canvas.vue'
import { ref } from 'vue'
import { getSketchFlowCanvas, putSketchFlowCanvas } from '@/api/flow-canvas'
import { getSketchFlowCanvas } from '@/api/flow-canvas'
import { useI18n } from 'vue-i18n'
const dialogVisible = ref(false)

View File

@@ -63,8 +63,7 @@ export class StateManager {
this.mxHistory = ref(50)
this.historyList = ref([])
this.historyIndex = ref(0)
this.sketchId = options.sketchId
this.sketchId = ref(options.sketchId)
this.saveCanvasTimeInterval = 6000
this.saveCanvasTime = null
@@ -188,12 +187,12 @@ export class StateManager {
}
/** 画布数据存储 */
async exportFlow (time:number = 0){
if(!this.sketchId)return
if(!this.sketchId.value)return
clearTimeout(this.saveCanvasTime)
await new Promise((resolve) => {
this.saveCanvasTime = setTimeout(()=>{
putSketchFlowCanvas({
id: this.sketchId,
id: this.sketchId.value,
canvasData: JSON.stringify(this.nodes.value) }).then(() => {
resolve(true)
}).catch(() => {