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