workJc.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <div class="workJc">
  3. <div class="echart-workJc" :style="{height:heightT}">
  4. <div class="workJc-l">
  5. <div class="echart-yh"></div>
  6. <div class="echart-line"></div>
  7. <div class="echart-boxs" ref="ring"></div>
  8. </div>
  9. <div class="workJc-r">
  10. <div class="fx-box" v-for="(item, index) in fxLenged" :key="index">
  11. <div class="fx-label">
  12. <div class="fx-label-l">
  13. <div class="bg-pie"></div>
  14. </div>
  15. <div class="fx-label-r">{{ item.label }}</div>
  16. </div>
  17. <div class="fx-val">{{ item.val }}</div>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="card-workJc" :style="{height:heightB}">
  22. <div class="scroll-card">
  23. <div class="card-box" v-for="(ite, ind) in cardList" :key="ind">
  24. <div class="card-l-label">{{ ite.title }}</div>
  25. <div class="card-l-val">{{ ite.val }}</div>
  26. <div class="card-r-label">{{ ite.label }}</div>
  27. <div class="card-r-content">
  28. <span>{{ `${ite.title1} : ` }}</span>
  29. <span>{{ `${ite.val1}°C` }}</span>
  30. </div>
  31. <div class="card-r-content1">
  32. <span>{{ `${ite.title2} : ` }}</span>
  33. <span>{{ ite.val2 }}</span>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </template>
  40. <script setup lang="ts">
  41. import { ref, reactive, onMounted, nextTick,defineProps } from 'vue'
  42. import * as echarts from 'echarts';
  43. let props=defineProps({
  44. heightT:{
  45. type:String,
  46. default:'0%',
  47. },
  48. heightB:{
  49. type:String,
  50. default:'0%'
  51. }
  52. })
  53. //获取dom节点
  54. let ring = ref()
  55. let fxLenged = reactive([
  56. {
  57. label: '低风险',
  58. val: 1,
  59. },
  60. {
  61. label: '中风险',
  62. val: 2,
  63. },
  64. {
  65. label: '高风险',
  66. val: 3
  67. },
  68. {
  69. label: '报警',
  70. val: 4
  71. },
  72. {
  73. label: '正常',
  74. val: 5
  75. }
  76. ])
  77. let cardList = reactive([
  78. {
  79. title: '风险',
  80. val: '低',
  81. label: '81202综放工作面',
  82. title1: '温度最大值',
  83. val1: '30',
  84. title2: '预测风险区域',
  85. val2: '散热带,氧化带,窒息带'
  86. },
  87. {
  88. title: '风险',
  89. val: '中',
  90. label: '81202综放工作面',
  91. title1: '温度最大值',
  92. val1: '30',
  93. title2: '预测风险区域',
  94. val2: '散热带,氧化带,窒息带'
  95. },
  96. {
  97. title: '风险',
  98. val: '低',
  99. label: '81202综放工作面',
  100. title1: '温度最大值',
  101. val1: '30',
  102. title2: '预测风险区域',
  103. val2: '散热带,氧化带,窒息带'
  104. },
  105. {
  106. title: '风险',
  107. val: '低',
  108. label: '81202综放工作面',
  109. title1: '温度最大值',
  110. val1: '30',
  111. title2: '预测风险区域',
  112. val2: '散热带,氧化带,窒息带'
  113. },
  114. {
  115. title: '风险',
  116. val: '中',
  117. label: '81202综放工作面',
  118. title1: '温度最大值',
  119. val1: '30',
  120. title2: '预测风险区域',
  121. val2: '散热带,氧化带,窒息带'
  122. },
  123. {
  124. title: '风险',
  125. val: '高',
  126. label: '81202综放工作面',
  127. title1: '温度最大值',
  128. val1: '30',
  129. title2: '预测风险区域',
  130. val2: '散热带,氧化带,窒息带'
  131. },
  132. ])
  133. function getOption() {
  134. nextTick(() => {
  135. let color = [
  136. '#0CD2E6',
  137. '#3751E6',
  138. '#FFC722',
  139. '#886EFF',
  140. '#008DEC',
  141. '#114C90',
  142. '#00BFA5',
  143. ];
  144. let seriesData = [
  145. { "name": "低风险", "value": 30 },
  146. { "name": "中风险", "value": 10 },
  147. { "name": "高风险", "value": 15 },
  148. { "name": "报警", "value": 23 },
  149. { "name": "正常", "value": 10 },
  150. ]
  151. let myChart = echarts.init(ring.value);
  152. let option = {
  153. color: color,
  154. grid: {
  155. top: '15%',
  156. left: 0,
  157. right: '1%',
  158. bottom: 5,
  159. containLabel: true,
  160. },
  161. series: [{
  162. name: '风险占比',
  163. type: 'pie',
  164. center: ['50%', '50%'],
  165. radius: ['65%', '85%'],
  166. label: {
  167. normal: {
  168. show: false,
  169. position: 'center',
  170. formatter: '{value|{c}}\n{label|{b}}',
  171. rich: {
  172. value: {
  173. padding: 5,
  174. align: 'center',
  175. verticalAlign: 'middle',
  176. fontSize: 16,
  177. },
  178. label: {
  179. align: 'center',
  180. verticalAlign: 'middle',
  181. fontSize: 14,
  182. },
  183. },
  184. },
  185. emphasis: {
  186. show: true,
  187. textStyle: {
  188. fontSize: '10',
  189. },
  190. },
  191. },
  192. labelLine: {
  193. show: false,
  194. length: 0,
  195. length2: 0,
  196. },
  197. data: seriesData,
  198. }],
  199. };
  200. myChart.setOption(option);
  201. window.onresize = function () {
  202. myChart.resize();
  203. };
  204. });
  205. }
  206. onMounted(() => {
  207. getOption()
  208. })
  209. </script>
  210. <style lang="less" scoped>
  211. @font-face {
  212. font-family: 'douyuFont';
  213. src: url('../../../../../assets/font/douyuFont.otf');
  214. }
  215. .workJc {
  216. width: 100%;
  217. height: 100%;
  218. .echart-workJc {
  219. width: 100%;
  220. // height: 45%;
  221. display: flex;
  222. justify-content: space-between;
  223. align-items: center;
  224. .workJc-l {
  225. position: relative;
  226. width: 180px;
  227. height: 100%;
  228. .echart-yh {
  229. position: absolute;
  230. top: 50%;
  231. left: 50%;
  232. transform: translate(-50%, -50%);
  233. width: 100px;
  234. height: 100px;
  235. background: url('../../../../../assets/images/fire/firehome/zu-e.png') no-repeat center;
  236. background-size: 100% 100%;
  237. }
  238. .echart-line {
  239. position: absolute;
  240. top: 8%;
  241. left: 15%;
  242. width: 125px;
  243. height: 125px;
  244. background: url('../../../../../assets/images/fire/firehome/ty-e.png') no-repeat center;
  245. background-size: 100% 100%;
  246. animation: rotationLine 10s linear infinite;
  247. }
  248. @keyframes rotationLine {
  249. 0% {
  250. transform: rotate(0deg);
  251. }
  252. 100% {
  253. transform: rotate(360deg);
  254. }
  255. }
  256. .echart-boxs {
  257. position: absolute;
  258. left: 50%;
  259. top: 50%;
  260. transform: translate(-50%, -50%);
  261. width: 90px;
  262. height: 90px;
  263. }
  264. }
  265. .workJc-r {
  266. width: calc(100% - 180px);
  267. height: 100%;
  268. display: flex;
  269. justify-content: space-around;
  270. align-items: center;
  271. .fx-box {
  272. height: 80px;
  273. display: flex;
  274. flex-direction: column;
  275. justify-content: space-around;
  276. align-items: center;
  277. color: #a1b6c2;
  278. .fx-label {
  279. height: 28px;
  280. display: flex;
  281. align-items: center;
  282. .fx-label-l {
  283. position: relative;
  284. width: 14px;
  285. height: 14px;
  286. padding: 1px;
  287. box-sizing: border-box;
  288. border: 1px solid #1fb3f7;
  289. margin-right: 5px;
  290. .bg-pie {
  291. width: 100%;
  292. height: 100%;
  293. border-radius: 50%;
  294. background-color: #1fb3f7;
  295. }
  296. }
  297. }
  298. .fx-val {
  299. font-family: 'douyuFont';
  300. font-size: 18px;
  301. }
  302. }
  303. }
  304. }
  305. .card-workJc {
  306. position: relative;
  307. // height: 55%;
  308. overflow: hidden;
  309. // overflow-y: auto;
  310. .scroll-card {
  311. width: 100%;
  312. position: absolute;
  313. animation: scrollCards 12s linear infinite;
  314. @keyframes scrollCards {
  315. 0% {
  316. left: 0;
  317. top: 0%;
  318. }
  319. 50% {
  320. left: 0;
  321. top: -50%;
  322. }
  323. 100% {
  324. left: 0;
  325. top: -100%;
  326. }
  327. }
  328. .card-box {
  329. position: relative;
  330. width: 100%;
  331. height: 100px;
  332. background: url('../../../../../assets/images/fire/firehome/work-jc.png') no-repeat center;
  333. background-size: 100% 100%;
  334. .card-l-label {
  335. position: absolute;
  336. left: 6%;
  337. top: 8%;
  338. color: #a1b6c2;
  339. letter-spacing: 2px;
  340. }
  341. .card-l-val {
  342. position: absolute;
  343. left: 7%;
  344. top: 50%;
  345. color: #a3d5e5;
  346. font-size: 18px;
  347. }
  348. .card-r-label {
  349. position: absolute;
  350. left: 20%;
  351. top: 4%;
  352. font-size: 16px;
  353. border-bottom: 1px solid #d0d2d3;
  354. color: #d0d2d3;
  355. }
  356. .card-r-content {
  357. position: absolute;
  358. left: 20%;
  359. top: 42%;
  360. color: #9da5aa;
  361. }
  362. .card-r-content1 {
  363. position: absolute;
  364. left: 20%;
  365. top: 68%;
  366. color: #9da5aa;
  367. }
  368. }
  369. }
  370. }
  371. }</style>