first-left.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <!-- 底部导航栏 -->
  3. <div class="first-right l_Dialog tablebk" v-show="firstshow">
  4. <el-aside width="340px" class="L_aside L_aside1 asideg asidegbg leftbgimg1" v-show="firstshow">
  5. <div class="demo-collapse jiancedian1 asideg1 jc_header collapseeion jianstyle">
  6. <el-collapse accordion v-model="activeNames">
  7. <el-collapse-item name="1" class="imgneon">
  8. <template #title>
  9. <el-icon class="iconimg Frame3" fit="contain"></el-icon>
  10. 灾害信息展示
  11. </template>
  12. <div class="rg_content">
  13. <div class="rg-padding">
  14. <div class="zongji">
  15. <div class="zongjili img1">1<span>个</span></div>
  16. <div class="zongjili img2">12<span>个</span></div>
  17. </div>
  18. <div class="asides_content">
  19. <div class="jc_content tablecolor">
  20. <div class="jc_padding">
  21. <div class="xian2 btncolor tablefocus ">
  22. <!-- -->
  23. <el-table
  24. :data="tableData"
  25. style="width: 100%"
  26. :row-class-name="tableRowClassName"
  27. :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
  28. @row-click="handleDelete($event)"
  29. :max-height="tableHeight"
  30. >
  31. <el-table-column prop="date" label="监测点" />
  32. <el-table-column prop="name" label="水位(m)" />
  33. <el-table-column prop="name" label="流量(m³/s)" />
  34. <el-table-column prop="state" label="预警" >
  35. <template #default="scope">
  36. <el-image v-if="scope.row.state=='0'" style="height: 100%" :src="bt1" fit="contain"></el-image>
  37. <el-image v-if="scope.row.state=='1'" style="height: 100%" :src="bt2" fit="contain"></el-image>
  38. <el-image v-if="scope.row.state=='2'" style="height: 100%" :src="bt3" fit="contain"></el-image>
  39. <el-image v-if="scope.row.state=='3'" style="height: 100%" :src="bt4" fit="contain"></el-image>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <!-- 监测点 -->
  48. <div>
  49. <div class="hedse">
  50. <el-icon class="iconimg1 Frame3" fit="contain"></el-icon>监测点
  51. </div>
  52. <div class="echart">
  53. <div id="line" style="width: 1.526rem;height:1.03rem;"></div></div>
  54. <div class="zongji">
  55. <div class="zongjili img3">50<span>m</span></div>
  56. <div class="zongjili img4">2024-03-20<span>14:23:00</span></div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <!-- <div class="mgsnoe" style="height: 200px"></div> -->
  62. </el-collapse-item>
  63. </el-collapse>
  64. <el-collapse accordion v-model="activeNames" class="bganimation">
  65. <el-collapse-item name="1" class="imgneon">
  66. <template #title>
  67. <el-icon class="iconimg Frame3" fit="contain"></el-icon>
  68. 动画展示
  69. </template>
  70. <div class="rg_content">
  71. <div class="rg-padding">
  72. <div class="animation_s">
  73. <el-slider
  74. :max="100"
  75. :min="0"
  76. v-model="count"
  77. @change="sliderchange"
  78. >
  79. </el-slider>
  80. <!-- <el-progress type="line" :percentage="percentage" :color="customColor" :stroke-width="4"/> -->
  81. <div class="tanniu">
  82. <div><el-image :src="t1" fit="contain" ></el-image></div>
  83. <div><el-image :src="t2" fit="contain" ></el-image></div>
  84. <div><el-image :src="t3" fit="contain" ></el-image></div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- <div class="mgsnoe" style="height: 200px"></div> -->
  90. </el-collapse-item>
  91. </el-collapse>
  92. </div>
  93. </el-aside>
  94. <!-- 动画 -->
  95. <!-- <el-aside width="340px" class="L_aside L_aside1 asideg asidegbg leftbgimg1" v-show="firstshow">
  96. <div class="demo-collapse jiancedian1 asideg1 jc_header collapseeion jianstyle">
  97. </div>
  98. </el-aside> -->
  99. </div>
  100. </template>
  101. <script setup>
  102. import { ref, onMounted, reactive, } from "vue";
  103. import { RouterView, RouterLink } from "vue-router"
  104. import { request, uploadFile } from "@/utils/request";
  105. import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
  106. import * as echarts from 'echarts'
  107. import bt1 from "@/assets/img/Group1376.png"
  108. import bt2 from "@/assets/img/Group1377.png"
  109. import bt3 from "@/assets/img/Group1395.png"
  110. import bt4 from "@/assets/img/Group1396.png"
  111. import t1 from "@/assets/img/t1.png";
  112. import t2 from "@/assets/img/t2.png";
  113. import t3 from "@/assets/img/t3.png";
  114. import t4 from "@/assets/img/t4.png";
  115. let firstshow = ref(false);
  116. let activeNames = ref(["1"]);
  117. let tableHeight = ref(150);
  118. ;
  119. let count=ref(60)
  120. const tableData = [
  121. {
  122. date: '检测点',
  123. name: '1',
  124. state: '1',
  125. city: 'Los Angeles',
  126. address: 'No. 189, Grove St, Los Angeles',
  127. zip: 'CA 90036',
  128. tag: 'Home',
  129. },
  130. {
  131. date: '检测点',
  132. name: '1',
  133. state: '2',
  134. city: 'Los Angeles',
  135. address: 'No. 189, Grove St, Los Angeles',
  136. zip: 'CA 90036',
  137. tag: 'Office',
  138. },
  139. ]
  140. let myChart;
  141. onMounted(() => {
  142. window.onresize = function() {
  143. // 让图表自适应大小
  144. myChart.resize();
  145. };
  146. lineChart();
  147. });
  148. const tableRowClassName=()=>{
  149. }
  150. const handleDelete=()=>{
  151. }
  152. const lineChart=()=>{
  153. myChart = echarts.init(document.getElementById('line'));
  154. let option = {
  155. tooltip: {
  156. trigger: 'axis',
  157. },
  158. grid: {
  159. left: '0',
  160. right: '0',
  161. bottom: '10',
  162. top:'20',
  163. containLabel: true
  164. },
  165. xAxis: [
  166. {
  167. type: 'category',
  168. // boundaryGap: false,
  169. data: [0,10,20,30,40],
  170. splitLine: {
  171. show: false,
  172. },
  173. axisLine: {
  174. lineStyle: {
  175. type: 'solid',
  176. color: '#E6E7EC',//左边线的颜色
  177. width:'1'//坐标线的宽度
  178. }
  179. },
  180. axisLabel: {
  181. textStyle: {
  182. color: '#B8CED6',//坐标值得具体的颜色
  183. }
  184. }
  185. }
  186. ],
  187. yAxis: [
  188. {
  189. type: 'value',
  190. minInterval:1,
  191. max: 700,
  192. splitLine: {
  193. show: true,
  194. lineStyle:{
  195. type:'dashed'
  196. }
  197. },
  198. axisLine: {
  199. lineStyle: {
  200. type: 'solid',
  201. color: '#E6E7EC',//左边线的颜色
  202. width:1 //坐标线的宽度
  203. }
  204. },
  205. axisLabel: {
  206. type: 'value',
  207. // color: '#ACD6FF',
  208. textStyle: {
  209. // color: 'red',//坐标值得具体的颜色
  210. color: function (value, index) {
  211. if(value >=300){
  212. return '#CE0000 '
  213. } else{
  214. return '#ACD6FF'
  215. }
  216. // return value >= 120 ? '#CE0000 ': '#ACD6FF';
  217. }
  218. }
  219. }
  220. }
  221. ],
  222. color: 'rgba(37, 190, 171, 1)',
  223. series: [
  224. {
  225. name: '',
  226. type: 'line',
  227. showSymbol: false,
  228. smooth: true,
  229. data: [0,60,120,240,360],
  230. itemStyle:{
  231. normal:{
  232. color: {
  233. type: 'linear',
  234. x: 0,
  235. y: 0,
  236. x2: 0,
  237. y2: 1,
  238. colorStops: [
  239. {
  240. offset:1, color: '#ACD6FF ' // 0% 处的颜色
  241. },
  242. {
  243. offset:0.7, color: '#105CF0 '// 100% 处的颜色
  244. },
  245. {
  246. offset:0.66, color: '#FF7A00 '// 100% 处的颜色
  247. },
  248. {
  249. offset:0.2, color: '#FF0000 '// 100% 处的颜色
  250. },
  251. {
  252. offset:0, color: '#CE0000' // 0% 处的颜色FF7A00
  253. },
  254. ],
  255. global: false // 缺省为 false
  256. }
  257. }
  258. },
  259. lineStyle: {
  260. width: 3, // 设置线条宽度
  261. },
  262. }
  263. ]
  264. }
  265. myChart.setOption(option);
  266. window.onresize = function() {
  267. // 让图表自适应大小
  268. myChart.resize();
  269. };
  270. // // 监听窗口大小变化
  271. myChart.dispatchAction({ //设置激活第一个选项
  272. type: 'showTip',
  273. seriesIndex: 0,
  274. dataIndex: 0
  275. });
  276. }
  277. defineExpose({firstshow});
  278. </script>
  279. <style lang="scss" scoped>
  280. .el-slider {
  281. width: 100%;
  282. height: 32px;
  283. display: flex;
  284. align-items: center;
  285. }
  286. .tanniu{
  287. display: flex;
  288. justify-content:space-between;
  289. align-items: center;
  290. }
  291. </style>