| | |
| | | <el-button size="small" @click="setSchemClick(item)" |
| | | >方案详情</el-button |
| | | > |
| | | <el-button size="small" @click="startPlay(item)">进入模拟</el-button> |
| | | <el-button |
| | | size="small" |
| | | v-show="item.type !== 2" |
| | | @click="startPlay(item)" |
| | | >进入模拟</el-button |
| | | > |
| | | <!-- :disabled="item.status !== 2" --> |
| | | </div> |
| | | </div> |
| | |
| | | const realTimeSimInterval = ref(null); |
| | | |
| | | async function startPlay(item) { |
| | | console.log(item, "item"); |
| | | if (item.status === 2) { |
| | | ElMessage.warning("当前方案正在分析中,无法进入模拟!"); |
| | | return; |
| | |
| | | try { |
| | | const ress = await getSimStart(item.id); |
| | | |
| | | console.log(ress, "resssssssss"); |
| | | const res = await getSimDataById(item.id); |
| | | |
| | | item.serviceName = res.data[0]?.serviceName || null; |
| | |
| | | |
| | | if (ress.code === 200) { |
| | | simStore.layerDate = ress.data; |
| | | console.log(simStore.layerDate,'aaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbb') |
| | | initeWaterPrimitiveView(); |
| | | emit("start"); |
| | | } |
| | |
| | | (item) => |
| | | item.result == "创建仿真" || |
| | | item.result == "完成" || |
| | | item.result == "-1" |
| | | item.result == "-1" || |
| | | item.result == null |
| | | ); |
| | | simAPIStore.shouldPoll = !shouldStop; // 修改 Pinia 状态 |
| | | console.log(shouldStop, "aaaaaaaaaaaaaaaa"); |
| | | // 3. 如果需要停止 |
| | | if (shouldStop) { |
| | | if (intervalId) { |
| | |
| | | watch( |
| | | () => simAPIStore.shouldPoll, |
| | | (isStarted) => { |
| | | console.log(isStarted, "定时器"); |
| | | if (isStarted) { |
| | | getScheme(); // 首次立即获取一次 |
| | | intervalId = setInterval(getScheme, 60 * 1000); // 每隔一分钟执行 |