wangjuncheng
2025-04-20 d8a0684a057df926c788525575eecdddde977133
change
已修改9个文件
124 ■■■■■ 文件已修改
src/components/menu/TimeLine.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/monifangzhen/schemeCard.vue 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tools/Message.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/left/CitySim.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/left/KGSimOption/HistorySimulation.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/left/KGSimOption/PredictiveSimulation.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/left/KGSimOption/RealTimeSimulation.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/left/Left.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mnfz.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/menu/TimeLine.vue
@@ -1,7 +1,6 @@
<template>
  <div class="timeline-container">
    <div class="controls">
      <!-- <div @click="endSimulate">结束模拟</div> -->
      <div class="control-btn" @click="skipBackward">
        <img
          src="@/assets/img/timeline/left.png"
@@ -63,6 +62,7 @@
        </div>
      </div>
    </div>
    <el-button @click="endSimulate" style="margin-top: 26px;margin-left: 30px;margin-right: 10px;">结束模拟</el-button>
  </div>
</template>
@@ -313,7 +313,7 @@
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  width: 838px;
  width: 878px;
  height: 108px;
  /* background-color: #1a2634; */
  background: url("@/assets/img/menubar/bar.png");
src/components/monifangzhen/schemeCard.vue
@@ -2,17 +2,8 @@
  <div class="listCard">
    <!-- <div>方案数量: {{ simStore.schemCard.length }}</div> -->
    <!-- 接口版本删除该代码块 -->
    <el-card
      v-for="(item, key) in simStore.schemCard"
      :key="key"
      :class="{ selected: selectedId === item.id }"
      @click="selectScheme(item.id)"
    >
      <!-- <el-card
      v-for="(item, key) in schemeList"
      :key="key"
      @click="selectScheme(item.id)"
    > -->
    <el-card v-if="!schemeInfoShow" v-for="(item, key) in simStore.schemCard" :key="key"
      :class="{ selected: selectedId === item.id }" @click="selectScheme(item.id)">
      <div>
        <p>方案名称 : {{ item.name }}</p>
        <p>创建时间 : {{ formatTime(item.createTime) }}</p>
@@ -25,35 +16,37 @@
      </div>
      <div class="cardMenu">
        <div style="float: right; margin-top: 3px">
          <el-button size="small" @click="setSchemClick(item)"
            >方案详情</el-button
          >
          <el-button size="small" @click="setSchemClick(item)">方案详情</el-button>
          <el-button size="small" @click="startPlay(item)">进入模拟</el-button>
          <!--  :disabled="item.taskStatus !== 2" -->
        </div>
      </div>
    </el-card>
    <schemeInfo
      v-if="schemeInfoShow"
      :selectedScheme="currentScheme"
      @back="handleBack"
    />
  </div>
  <Message
    @close="close"
    class="mess"
    v-show="messageShow"
    :mesData="mesData"
  />
  <Message @close="close" class="mess" v-show="messageShow" :mesData="mesData" />
</template>
<script setup>
import { onMounted, ref, watch } from "vue";
import { onMounted, ref, watch ,defineEmits } from "vue";
import dayjs from "dayjs";
import { initeWaterPrimitiveView } from "@/utils/water";
import Message from "@/components/tools/Message.vue";
import { useSimStore } from "@/store/simulation.js";
import schemeInfo from "@/components/monifangzhen/schemeInfo.vue";
import { ElMessage, ElMessageBox } from "element-plus";
const emit = defineEmits(["start", "end", "reset","closeBtn"]);
const simStore = useSimStore();
// 选中的方案 ID
const selectedId = ref(null);
// 当前选中的方案信息
const currentScheme = ref(null);
// 选中方案
function selectScheme(id) {
  selectedId.value = id;
@@ -309,6 +302,7 @@
  return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
}
const messageShow = ref(false);
const schemeInfoShow = ref(false);
const mesData = ref(null);
function setSchemClick(item) {
  mesData.value = item;
@@ -317,19 +311,27 @@
function close() {
  messageShow.value = false;
}
function startPlay(item) {
  // if (item.taskStatus !== 2) {
  //   alert("当前方案尚未完成,无法进入模拟!");
  //   return;
  // }
  currentScheme.value = item;
  // schemeInfoShow.value = true
  // emit("closeBtn", false);
  initeWaterPrimitiveView();
  emit("start");
}
const emit = defineEmits(["start", "end", "reset"]);
function endPlay() {
  emit("end");
}
function handleBack(value) {
  if (value === false) {
    schemeInfoShow.value = false;
    emit("closeBtn", true);
  }
}
//////////////////////////////////// 暴露选中的 ID 给父组件(接口版本删除)////////////////////////////////////
defineExpose({
  getSelectedId: () => selectedId.value,
@@ -432,6 +434,7 @@
.listCard-btn:hover {
  background: url("@/assets/img/left/cardbtnac.png") no-repeat;
}
.mess {
  position: absolute;
  top: 10%;
@@ -455,7 +458,9 @@
  scale: (1.02);
  border: 1px solid #acf1dd;
}
.selected {
  border: 2px solid #acf1dd !important; /* 选中时的边框样式 */
  border: 2px solid #acf1dd !important;
  /* 选中时的边框样式 */
}
</style>
src/components/tools/Message.vue
@@ -8,7 +8,7 @@
        <div class="message-value">{{ item.value }}</div>
      </div>
    </div>
    <div class="message-btn" @click="startPlay">开始模拟</div>
    <!-- <div class="message-btn" @click="startPlay">开始模拟</div> -->
  </div>
</template>
src/views/left/CitySim.vue
@@ -101,7 +101,7 @@
          </el-input>
        </el-form-item>
        <el-form-item label="仿真参数:"></el-form-item>
        <!-- <el-form-item label="仿真参数:"></el-form-item> -->
      </el-form>
      <div style="display: flex; justify-content: flex-end">
        <el-button type="primary" @click="openSaveDialog">保存方案</el-button>
src/views/left/KGSimOption/HistorySimulation.vue
@@ -33,10 +33,10 @@
          <span>h</span>
        </div>
      </div>
      <div>
      <!-- <div>
        <label>仿真参数:</label>
        <div style="width: 100%; height: 60px; background-color: #fff"></div>
      </div>
      </div> -->
    </div>
    <div class="buttons">
      <el-button type="primary" @click="openSaveDialog">保存方案</el-button>
@@ -190,6 +190,7 @@
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: space-evenly;
}
.input-group {
src/views/left/KGSimOption/PredictiveSimulation.vue
@@ -42,10 +42,10 @@
          <el-input v-model="rainfallDuration" type="number" placeholder="请输入"></el-input>
          <span>h</span>
        </div>
        <div>
        <!-- <div>
          <label>仿真参数:</label>
          <div style="width: 100%; height: 43px; background-color: #fff;"></div>
        </div>
        </div> -->
      </div>
      <div class="buttons">
        <el-button type="primary" @click="openPlan">打开方案</el-button>
src/views/left/KGSimOption/RealTimeSimulation.vue
@@ -24,10 +24,10 @@
          <span>{{ item.name }}</span>
        </div>
      </div>
      <div style="margin-top: 10px;">
      <!-- <div style="margin-top: 10px;">
        <label>仿真参数:</label>
        <div style="width: 100%; height: 60px; background-color: #fff;"></div>
      </div>
      </div> -->
    </div>
    <div class="buttons">
      <el-button type="primary" @click="openSaveDialog">保存方案</el-button>
src/views/left/Left.vue
@@ -4,24 +4,16 @@
      <span>仿真推演方案</span>
    </div>
    <div class="left-content">
      <div
        style="
      <div style="
          display: flex;
          justify-content: space-around;
          justify-content: space-evenly;
          padding: 8px 8px 8px 0px;
        "
      >
        <el-button @click="handleClick">新建仿真方案</el-button>
        <el-button @click="deleteSelectedScheme">删除仿真方案</el-button>
        <!-- <el-button>删除仿真方案</el-button> -->
        v-if="btnShow">
        <el-button style="width: 45%;" @click="handleClick">新建仿真方案</el-button>
        <el-button style="width: 45%;" @click="deleteSelectedScheme">删除仿真方案</el-button>
      </div>
      <!-- 接口版本删除该代码块 -->
      <schemeCard
        ref="schemeCardRef"
        @start="start"
        @end="end"
        @reset="reset"
      />
      <schemeCard ref="schemeCardRef" @start="start" @end="end" @reset="reset" @closeBtn="handleBackFromParent" />
      <!-- <schemeCard
        ref="schemeCardRef"
        @start="start"
@@ -291,6 +283,7 @@
];
const simStore = useSimStore();
const showAddIns = ref(false);
const btnShow = ref(true);
let divPointList = [];
function handleClick() {
  // currentMock.value = mock.name;
@@ -298,6 +291,11 @@
}
function handleBack(value) {
  showAddIns.value = false; // 隐藏子组件
}
function handleBackFromParent(value) {
  if (value === false) {
    btnShow.value = false
  } else btnShow.value = true
}
function initDevicePoint() {
  list.forEach((item) => {
@@ -421,7 +419,7 @@
      simStore.removeSchemCardItem(selectedId);
      ElMessage.success(`方案 "${selectedScheme.name}" 删除成功!`);
    })
    .catch(() => {});
    .catch(() => { });
}
function start(form) {
src/views/mnfz.vue
@@ -49,7 +49,8 @@
  waterSimulateParams.value = form;
}
function endSimulate() {
  // showDebuffDetail.value = true
  showDebuffDetail.value = false
  clearTrailLine();
  removeDataSources();
  setTimeout(() => {
    showWaterSimulate.value = false;
@@ -67,8 +68,8 @@
      // 设置样式,将颜色改为红色
      dataSource.entities.values.forEach((entity) => {
        entity.polygon.material = new Cesium.Color(1.0, 0.0, 0.0, 0.6); // 红色,80% 不透明度
        entity.polygon.outlineColor = Cesium.Color.YELLOW; // 设置轮廓颜色为红色(如果需要)
        entity.polygon.outline = true; // 显示轮廓(如果需要)
        entity.polygon.outlineColor = Cesium.Color.YELLOW;
        entity.polygon.outline = true;
      });
      // 添加数据源到 viewer
@@ -156,6 +157,19 @@
  );
  TrailLine.push(_TrailLine);
}
// 清除轨迹线对象
function clearTrailLine() {
  TrailLine.forEach((item, index) => {
    if (item && typeof item.deleteObject === 'function') {
      item.deleteObject();
    } else if (item && typeof item.clear === 'function') {
      item.clear();
    } else if (item && earthCtrl && earthCtrl.coreMap) {
      earthCtrl.coreMap.entities.remove(item);
    }
  });
  TrailLine = [];
}
// function showLine() {
//   earthCtrl.factory.createSimpleGraphic(
//     "polyline",