| | |
| | | |
| | | const response = await fetch(url); // 发起请求 |
| | | |
| | | // console.log(url,'aaaaaaaaa') |
| | | console.log(url,'aaaaaaaaa') |
| | | |
| | | if (!response.ok) { |
| | | throw new Error(`HTTP error! status: ${response.status}`); |
| | |
| | | if (selectedScheme.value.type === 2) { |
| | | try { |
| | | await ElMessageBox.confirm("方案未停止时结束模拟后,后台将停止计算", { |
| | | confirmButtonText: "结束模拟", |
| | | cancelButtonText: "返回列表", |
| | | confirmButtonText: "返回列表", |
| | | cancelButtonText: "结束模拟", |
| | | type: "warning", |
| | | }); |
| | | |
| | | const res = await stopSim(selectedScheme.value.id); |
| | | // 用户点击了确认,这里不执行任何操作,仅关闭对话框 |
| | | } catch (error) { |
| | | stopSim(selectedScheme.value.id).then((res) => { |
| | | if (res.code == 404) { |
| | | ElMessage.warning("该服务已停止"); |
| | | } else { |
| | | ElMessage.success("服务正在停止中"); |
| | | } |
| | | } catch (error) { |
| | | // 用户点击了【返回列表】或者出现错误 |
| | | }); |
| | | // return; |
| | | } |
| | | } |
| | | |
| | | // 不管 type 是不是 2,最终都执行结束模拟操作 |
| | | // 不管type是不是2,最终都执行结束模拟的操作 |
| | | endSimulation(); |
| | | } |
| | | |
| | |
| | | function handleCheckChange(data, checked) { |
| | | const label = data.label; |
| | | |
| | | // 如果是父节点(地区节点),处理所有子节点 |
| | | if (data.children && data.children.length > 0) { |
| | | data.children.forEach(child => { |
| | | handleCheckChange(child, checked); // 递归处理子节点 |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 地形数据处理 |
| | | if (label === "地形数据") { |
| | | handleTerrainLayer(checked); |
| | |
| | | function handleModelLayer(checked) { |
| | | if (checked) { |
| | | addTileset( |
| | | // "http://106.120.22.26:9103/gisserver/c3dserver/sunhugou3d/tileset.json" |
| | | "http://192.168.37.61:9004/tile/model/service/Iakp0nhx/tileset.json?labtoken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiItMSxUaHUgQXByIDE4IDE1OjMwOjU3IENTVCAyMDI0In0.j_YKsCRsIQtpgOWfFvMwAP65Rlx9uXyVte_xkE95Vdo" |
| | | "http://106.120.22.26:9103/gisserver/c3dserver/sunhugou3d/tileset.json" |
| | | // "http://192.168.37.61:9004/tile/model/service/Iakp0nhx/tileset.json?labtoken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiItMSxUaHUgQXByIDE4IDE1OjMwOjU3IENTVCAyMDI0In0.j_YKsCRsIQtpgOWfFvMwAP65Rlx9uXyVte_xkE95Vdo" |
| | | ) |
| | | .then((model) => { |
| | | treeMap.set("模型数据", model); |
| | |
| | | color: SmartEarth.Cesium.Color.fromCssColorString("#D4F2E7"), |
| | | loop: false, |
| | | callback: timeCallback, |
| | | alphaByDepth: 0.5, |
| | | alphaByDepth: 0.0, |
| | | waterHeightLevels, |
| | | colorRender, |
| | | sizeIndex: 0, |
| | |
| | | export function updateWaterColor(color, alpha) { |
| | | if (water) { |
| | | water.color = Cesium.Color.fromCssColorString(color); |
| | | water.alphaByDepth = alpha; |
| | | water.alphaByDepth = 0; |
| | | } else { |
| | | console.warn("No water simulation to pause."); |
| | | } |