From 8792be67cf5791a4a3afc2f72fd8d7cfc3cff353 Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期二, 15 四月 2025 15:20:28 +0800 Subject: [PATCH] change --- src/components/monifangzhen/schemeCard.vue | 51 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/components/monifangzhen/schemeCard.vue b/src/components/monifangzhen/schemeCard.vue index 083673c..9e1adde 100644 --- a/src/components/monifangzhen/schemeCard.vue +++ b/src/components/monifangzhen/schemeCard.vue @@ -1,20 +1,20 @@ <template> <div class="listCard"> - <el-card v-for="(item, key) in schemCard" :key="key"> + <!-- <div>鏂规鏁伴噺: {{ simStore.schemCard.length }}</div> --> + <el-card v-for="(item, key) in simStore.schemCard" :key="key"> <div> <p>鏂规鍚嶇О : {{ item.name }}</p> - <p>鍒涘缓鏃堕棿 : {{ item.createTime }}</p> + <p>鍒涘缓鏃堕棿 : {{ formatTime(item.createTime) }}</p> <p> 鏂规鐘舵�� : - <span style="color: aquamarine">{{ item.status || "宸插畬鎴�" }}</span> + <span style="color: aquamarine">{{ statusText[item.taskStatus] || "鏈煡" }}</span> </p> </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="startPlay"> 杩涘叆妯℃嫙 </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> @@ -29,13 +29,14 @@ <script setup> import { ref } from "vue"; +import dayjs from "dayjs"; import { initeWaterPrimitiveView } from "@/utils/water"; import Message from "@/components/tools/Message.vue"; -// import { useSimStore } from "@/store/simulation"; +import { useSimStore } from "@/store/simulation.js"; -// const simStore = useSimStore(); +const simStore = useSimStore(); -const schemCard = ref([ +simStore.setSchemCard([ { area: "瀛欒儭娌�", areaId: "0", @@ -277,9 +278,14 @@ userId: "0", }, ]); -// function setSchemClick(res) { -// simStore.messageShow = true; -// } +const statusText = { + 0: "鏈紑濮�", + 1: "杩涜涓�", + 2: "宸插畬鎴�", +}; +function formatTime(time) { + return dayjs(time).format("YYYY-MM-DD HH:mm:ss"); +} const messageShow = ref(false); const mesData = ref(null); function setSchemClick(item) { @@ -289,14 +295,17 @@ function close() { messageShow.value = false; } +function startPlay(item) { + // if (item.taskStatus !== 2) { + // alert("褰撳墠鏂规灏氭湭瀹屾垚锛屾棤娉曡繘鍏ユā鎷燂紒"); + // return; + // } + initeWaterPrimitiveView(); + emit("start"); +} const emit = defineEmits(["start", "end"]); function endPlay() { emit("end"); -} - -function startPlay() { - initeWaterPrimitiveView(); - emit("start"); } </script> @@ -343,8 +352,10 @@ } .mess { position: absolute; - top: 160px; - left: 460px; + top: 10%; + left: 100%; + // top: 160px; + // left: 460px; } /deep/.el-card__body { -- Gitblit v1.9.3