深度画布返回工作台base64转url
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { base64Tofile } from '../tools/tools'
|
||||
import { uploadImage } from '@/api/upload'
|
||||
import FullscreenDialog from '../components/fullscreen-dialog.vue'
|
||||
import depthCanvas from './depth-canvas.vue'
|
||||
import { ref } from 'vue'
|
||||
@@ -24,11 +26,17 @@
|
||||
dialogVisible.value = true
|
||||
}
|
||||
// 工作区
|
||||
const onWorkbench = (options) => {
|
||||
dialogVisible.value = false
|
||||
const onWorkbench = async (options) => {
|
||||
const json = options.json
|
||||
|
||||
sessionStorage.setItem('canvasJson_' + config.value.id, json)
|
||||
config.value.onWorkbench?.({ url: options.url })
|
||||
|
||||
const file = base64Tofile(options.url, 'canvas.png')
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
const url = await uploadImage(formData)
|
||||
config.value.onWorkbench?.({ url })
|
||||
dialogVisible.value = false
|
||||
}
|
||||
// 关闭
|
||||
const onClose = () => {
|
||||
|
||||
Reference in New Issue
Block a user