物模型:调整物模型逻辑
This commit is contained in:
parent
2e6bbf3b9c
commit
59c9618471
@ -19,19 +19,13 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { watch } from 'vue'
|
import { watch } from 'vue'
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
pos: {
|
pos: {
|
||||||
type: Object,
|
x: number
|
||||||
default: {
|
y: number
|
||||||
x: 0,
|
}
|
||||||
y: 0,
|
visible: boolean
|
||||||
},
|
}>()
|
||||||
},
|
|
||||||
visible: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const emits = defineEmits(['update:visible', 'openModel'])
|
const emits = defineEmits(['update:visible', 'openModel'])
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mainHeaderRight">
|
<div class="mainHeaderRight">
|
||||||
<el-button :icon="Plus" type="primary" @click="addModelAttributeAndService">新增</el-button>
|
<el-button :icon="Plus" type="primary" @click="addModelAttributeAndService">新增</el-button>
|
||||||
<el-upload :show-file-list="false" :limit="1" :http-request="upLoadModel">
|
<el-upload ref="uploadRef" :show-file-list="false" :limit="1" :http-request="upLoadModel" :on-exceed="handleExceed">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-button :icon="Upload">导入</el-button>
|
<el-button :icon="Upload">导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -248,6 +248,10 @@ import {
|
|||||||
UploadRequestOptions,
|
UploadRequestOptions,
|
||||||
TreeNode,
|
TreeNode,
|
||||||
TreeInstance,
|
TreeInstance,
|
||||||
|
UploadInstance,
|
||||||
|
genFileId,
|
||||||
|
UploadProps,
|
||||||
|
UploadRawFile,
|
||||||
} from 'element-plus'
|
} from 'element-plus'
|
||||||
import { Reading, DocumentAdd, DocumentChecked, DocumentDelete, Search, Plus, Download, Upload } from '@element-plus/icons-vue'
|
import { Reading, DocumentAdd, DocumentChecked, DocumentDelete, Search, Plus, Download, Upload } from '@element-plus/icons-vue'
|
||||||
import {
|
import {
|
||||||
@ -765,7 +769,11 @@ const upLoadModel = (file: UploadRequestOptions) => {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
ElMessage.success('上传物模型成功')
|
ElMessage.success('上传物模型成功')
|
||||||
getModelList()
|
if (ModelTabs.value === 'attribute') {
|
||||||
|
getAttributeList()
|
||||||
|
} else {
|
||||||
|
getServiceList()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
@ -775,6 +783,15 @@ const upLoadModel = (file: UploadRequestOptions) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uploadRef = ref<UploadInstance>()
|
||||||
|
const handleExceed: UploadProps['onExceed'] = (files) => {
|
||||||
|
uploadRef.value!.clearFiles()
|
||||||
|
const file = files[0] as UploadRawFile
|
||||||
|
file.uid = genFileId()
|
||||||
|
uploadRef.value!.handleStart(file)
|
||||||
|
uploadRef.value!.submit()
|
||||||
|
}
|
||||||
|
|
||||||
const downLoadModel = () => {
|
const downLoadModel = () => {
|
||||||
downloadModelReq({ id: curContextMenuTreeData.value!.id! }).then((res: any) => {
|
downloadModelReq({ id: curContextMenuTreeData.value!.id! }).then((res: any) => {
|
||||||
const downloadUrl = window.URL.createObjectURL(res)
|
const downloadUrl = window.URL.createObjectURL(res)
|
||||||
|
Loading…
Reference in New Issue
Block a user