DESKTOP-NE65RNK\Citrus_limon 10 months ago
parent
commit
e0ea1e06af
1 changed files with 9 additions and 4 deletions
  1. 9 4
      src/views/bot/as/detail.vue

+ 9 - 4
src/views/bot/as/detail.vue

@@ -34,12 +34,13 @@
         <span class="card-title">内部数据</span>
       </template>
       <template v-slot:extra>
-        <lay-button class="card-button" @click="handleReloadIframe()">刷新</lay-button>
+        <lay-button class="card-button" @click="handleReloadIframe()">{{ robotRunDataIsShow ? "刷新" : "获取" }} </lay-button>
         <lay-button class="card-button" @click="handleOtherOpen()">站外打开</lay-button>
       </template>
       <template v-slot:body>
-        <div class="card-body-wp">
-          <iframe class="chart" :src="robotRunData" frameborder="0"></iframe>
+        <div :class="{ 'card-body-wp': true, 'height-1200': robotRunDataIsShow }">
+          <iframe v-if="robotRunDataIsShow" :class="{ chart: true, 'height-1200': robotRunDataIsShow }" :src="robotRunData" frameborder="0"></iframe>
+          <div v-else>内部数据,数据可能较大,请勿频繁获取、刷新!</div>
         </div>
       </template>
     </lay-card>
@@ -114,6 +115,7 @@ let balanceChart = shallowRef();
 let predictorChart = shallowRef();
 let timer = ref();
 let robotRunData = ref();
+let robotRunDataIsShow = ref(false);
 
 // 获取机器人详情
 const getRobotDetail = () => {
@@ -258,6 +260,7 @@ timer.value = setInterval(() => {
 getLogsInfo();
 
 const handleReloadIframe = () => {
+  robotRunDataIsShow.value = true;
   robotRunData.value = ``;
   setTimeout(() => {
     robotRunData.value = `https://4lapi.skyfffire.com/downloadDataFile?url=http://${robotDetail.value.serverIp}:3000/downloadDataFile?id=${robotDetail.value.id}`; // 重新赋值
@@ -279,8 +282,10 @@ onUnmounted(() => {
 </script>
 
 <style lang="scss" scoped>
-.card-body-wp {
+.height-1200 {
   height: 1200px;
+}
+.card-body-wp {
   text-align: center;
   .chart {
     height: 100%;