邓洁: 设备接口部分对接

This commit is contained in:
邓洁
2023-12-27 23:45:44 +08:00
parent 976c2f2bad
commit ac5327e5d8
7 changed files with 180 additions and 50 deletions

View File

@@ -41,6 +41,7 @@ import TunnelScene from "@/components/content/tunnelScene/TunnelScene.vue";
import { editTunnel, getTunnelDetail } from "@/api/tunnelManage";
import { computed } from "vue";
import { useModelSceneStore } from "@/store/modelSceneStore";
import {ElMessage} from "element-plus";
const router = useRouter();
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
@@ -68,7 +69,7 @@ const tunnelLength = computed(() => form.value.totalLength);
const handleGotoDevice = () => {
router.push('/device/' + tunnelId)
}
const handleSave = () => {
const handleSave =async () => {
const data = {
tunnelId: tunnelId,
tunnelName: form.value.tunnelName,
@@ -77,12 +78,14 @@ const handleSave = () => {
// constructionLength:form.value.constructionLength,
constructionLength: 500,
tunnelLength: form.value.totalLength,
tunnelThreeConfig: JSON.stringify(equipmentList.value),
tunnelThreeConfig: JSON.stringify(await store.getEquipmentList())
}
console.log('data', data, form.value.tunnelLength)
editTunnel(data).then((res) => {
if (res?.code === 1000) {
console.log('re---s', res)
ElMessage.success(res.msg)
router.push('/tunnel/'+tunnelId)
// form.value=res.data
}
});