From 307db148645230afc780a3d5d16ffb97aa32c189 Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期四, 03 七月 2025 16:38:58 +0800 Subject: [PATCH] 模型 && 设备相关 --- src/views/system/model/components/modelDialog.vue | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/views/system/model/components/modelDialog.vue b/src/views/system/model/components/modelDialog.vue index 0ed2cac..fda976d 100644 --- a/src/views/system/model/components/modelDialog.vue +++ b/src/views/system/model/components/modelDialog.vue @@ -14,7 +14,7 @@ </el-select> </el-form-item> <el-form-item label="鏂囦欢涓婁紶" prop="modelRoute"> - <el-upload class="upload-demo" action="" :auto-upload="false" accept="" + <el-upload class="upload-demo" action="" :auto-upload="false" accept=".glb" :on-change="getFile" :limit="1"> <div class="icon-bg-box icon-bg-box1"> <el-icon ><PictureFilled /> </el-icon> @@ -42,6 +42,7 @@ <script> import cesiumMapNoSelect from "@/components/common/cesiumMapNoSelect.vue"; +import { uploadFile} from "@/api/system/device" export default { name: 'modelManage', components: { cesiumMapNoSelect }, @@ -106,7 +107,7 @@ // formData.append("type", 'pic'); //涓婁紶鍥剧墖鐨勬帴鍙� uploadFile(formData).then(res => { - this.$set(this.form, 'modelRoute', res.data.url) + this.$set(this.form, 'modelRoute', res.url) }) }, handleSelectAddress(data) { @@ -123,13 +124,14 @@ submitForm() { this.$refs["form"].validate(valid => { console.log(this.form) - // if (valid) { - // this.$api.save('work/tower/', 'id', Object.assign({}, this.form)).then(res => { - // this.form = {} - // this.$emit('on-submit') - // this.open = false - // }) - // } + + if (valid) { + this.$api.save('tower/model/', 'id', Object.assign({}, this.form)).then(res => { + this.form = {} + this.$emit('on-submit') + this.open = false + }) + } }); }, addModel(){ -- Gitblit v1.9.3