result.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <!--结果对比 -->
  3. <div class="resultyem" v-show="resultyem">
  4. <div class="publicleft">
  5. <div class="resultime">
  6. <div class="text">指定时间</div>
  7. <div class="time">{{timeline}}</div>
  8. </div>
  9. <!-- 动画 -->
  10. <div class="animation_s">
  11. <el-slider
  12. :max="endtime"
  13. :min="starttime"
  14. v-model="formInline.count"
  15. @change="sliderchange"
  16. >
  17. </el-slider>
  18. <div class="tanniu">
  19. <ul>
  20. <li>
  21. <el-image :src="t1" fit="contain"></el-image>
  22. <p>后退</p>
  23. </li>
  24. <li>
  25. <el-image :src="t2" fit="contain" ></el-image>
  26. <p>播放</p>
  27. </li>
  28. <li>
  29. <el-image :src="t3" fit="contain"></el-image>
  30. <p>暂停</p>
  31. </li>
  32. <li>
  33. <el-image :src="t4" fit="contain"></el-image>
  34. <p>快进</p>
  35. </li>
  36. </ul>
  37. </div>
  38. </div>
  39. <!-- 物理量 -->
  40. <div class="heigjie">
  41. <div class="he_pading1 color1">
  42. <el-form-item label="物理量:">
  43. <el-select
  44. v-model="formInline.region"
  45. @change="regionchange($event)"
  46. placeholder="请选择"
  47. >
  48. <el-option
  49. v-for="item in strResultFormatlist"
  50. :key="item.id"
  51. :label="item.name"
  52. :value="item.value"
  53. ></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <!-- <div class="woter" v-else>
  57. <span>物理量:</span>
  58. <span>水位</span>
  59. </div> -->
  60. </div>
  61. </div>
  62. </div>
  63. <div class="result_left results">
  64. <resultLeft :formInline="formInline"/>
  65. </div>
  66. <div class="result_right results">
  67. <resultRight :formInline="formInline"/>
  68. </div>
  69. </div>
  70. </template>
  71. <script setup>
  72. import { ref, onMounted,onUnmounted, reactive, } from "vue";
  73. import {RouterView,RouterLink } from "vue-router";
  74. import { request, uploadFile } from "@/utils/request";
  75. import { ElMessage, ElButton, ElDialog, ElSelect } from "element-plus";
  76. import resultLeft from "./result/resultLeft.vue";
  77. import resultRight from "./result/resultRight.vue"
  78. import { timestampToTime } from "@/js/lindex.js";
  79. import t1 from "@/assets/img/t1.png";
  80. import t2 from "@/assets/img/t2.png";
  81. import t3 from "@/assets/img/t3.png";
  82. import t4 from "@/assets/img/t4.png";
  83. let resultyem=ref(false);
  84. let timing = ref(null);
  85. let starttime = ref(1);
  86. let endtime = ref(60);
  87. let timenum = ref(2);
  88. let aid=ref(Number);
  89. let timeline=ref("2024-03-03 14:00");
  90. const formInline = ref({
  91. region: "shanghai",
  92. count:0
  93. });
  94. const strResultFormatlist = ref([]);
  95. const accident6 = (key,id) => {
  96. aid.value=id;
  97. if (key == "5") {
  98. resultyem.value=true;
  99. } else {
  100. resultyem.value= false;
  101. }
  102. };
  103. const newtime=()=>{
  104. timing.value = setInterval(() => {
  105. const timestamp = new Date().getTime();
  106. timeline.value = timestampToTime(timestamp);
  107. }, 1000);
  108. }
  109. //滑块
  110. function sliderchange(val) {
  111. fcon.step = count.value;
  112. console.log( count.value );
  113. }
  114. // 物理量的选择
  115. function regionchange(val) {
  116. console.log(val)
  117. let newMap = new Map([['Temperature', '(℃)'], ['Pressure', '(kg/s)'],['Pressure', '(kg/s)'],['CO2', '(%)'],['CO2', '(%)'],['H2S', '(%)'],['Flow', '(Pa)'],['Height', 'm']])
  118. newMap.forEach((value, key) => {
  119. console.log(key, value);
  120. if(key==val){
  121. danwei.value=key+value;
  122. }
  123. })
  124. }
  125. onMounted(() => {
  126. newtime()
  127. });
  128. // 卸载时的操作
  129. onUnmounted(() => {
  130. // 清除定时器
  131. if ( timing.value ) {
  132. clearInterval( timing.value);
  133. }
  134. });
  135. defineExpose({accident6});
  136. </script>
  137. <style scoped lang="scss">
  138. .heigjie{
  139. width: 100%;
  140. height: 50px;
  141. line-height: 50px;
  142. background-image: url(/src/assets/img/Group10.png) !important;
  143. background-repeat: no-repeat;
  144. background-position: center;
  145. .he_pading1 {
  146. padding: 10px 9px 0 7px;
  147. }
  148. }
  149. .animation_s {
  150. padding: 25px;
  151. }
  152. .tanniu ul {
  153. margin-top: 20px;
  154. display: flex;
  155. li {
  156. flex: 1;
  157. text-align: center;
  158. p {
  159. text-align: center;
  160. font-weight: 400;
  161. font-size: 12px;
  162. color: #ffffff;
  163. line-height: 14px;
  164. font-style: normal;
  165. text-transform: none;
  166. }
  167. }
  168. }
  169. .resultyem{
  170. width: 100%;
  171. position: absolute;
  172. z-index: 12;
  173. top:70px;
  174. color:#fff;
  175. display: flex;
  176. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  177. border-radius: 0px 0px 0px 0px;
  178. }
  179. .results{
  180. flex: 1;
  181. }
  182. .result_left,.result_right{
  183. border-left: 2px solid;
  184. /* border-right: 2px solid; */
  185. /* border-image: linear-gradient(180deg, rgba(31, 107, 255, 0), rgba(255, 255, 255, 0.8)) 1 1; */
  186. border-image: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)) 1 1;
  187. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  188. }
  189. .publicleft{
  190. width: 270px;
  191. height: calc(100vh - 70px);
  192. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  193. /* border:1px solid #fff */
  194. }
  195. .resultime{
  196. height: 70px;
  197. border-bottom: 1px solid;
  198. border-image: linear-gradient(347deg, rgb(16, 92, 240), rgb(18, 48, 102)) 1 1;
  199. }
  200. .resultime .text{
  201. font-size: 14px;
  202. width: 88px;
  203. font-weight: bold;
  204. line-height: 70px;
  205. text-align: center;
  206. display: inline-block;
  207. border-right: 1px solid;
  208. border-image: linear-gradient(347deg, rgb(16, 92, 240), rgb(18, 48, 102)) 1 1;
  209. float: left;
  210. }
  211. .resultime .time{
  212. line-height: 70px;
  213. font-family: Microsoft YaHei UI, Microsoft YaHei UI;
  214. font-weight: bold;
  215. font-size: 14px;
  216. color: #FF0F0F;
  217. line-height: 70px;
  218. text-align: left;
  219. text-align: center;
  220. font-style: normal;
  221. text-transform: none;
  222. }
  223. </style>
  224. <style>
  225. .heigjie .el-form-item__label {
  226. font-weight: 400;
  227. font-size: 13px;
  228. color: #ffffff;
  229. text-align: left;
  230. font-style: normal;
  231. text-transform: none;
  232. }
  233. .heigjie .el-select .el-input__inner {
  234. color: #fff;
  235. }
  236. </style>