dischargeGas.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <BasicModal
  3. @register="register"
  4. title="智能排放瓦斯"
  5. :maskStyle="{ backgroundColor: '#000000aa', backdropFilter: 'blur(3px)' }"
  6. width="1600px"
  7. style="height: 60%"
  8. v-bind="$attrs"
  9. @ok="onSubmit"
  10. :canFullscreen="false"
  11. :destroyOnClose="true"
  12. :footer="null"
  13. :maskClosable="false"
  14. >
  15. <div class="modal-box">
  16. <div class="left-box" style="width: 900px; height: 400px"> </div>
  17. <div class="right-box">
  18. <div ref="ChartRef" class="line-chart" style="height: 400px; width: 100%"></div>
  19. </div>
  20. </div>
  21. <div class="setting-box">
  22. <div class="right-inputs">
  23. <div class="vent-flex-row">
  24. <div class="input-title">出风口风量(m³/min):</div>
  25. <!-- <InputNumber class="input-box" size="large" v-model:value="ductOutletAirVolume_merge" /> -->
  26. <div class="input-title">局扇供风量(m³/min):</div>
  27. <!-- <InputNumber class="input-box" size="large" v-model:value="inletAirVolume_merge" /> -->
  28. </div>
  29. </div>
  30. </div>
  31. </BasicModal>
  32. </template>
  33. <script lang="ts" setup>
  34. import { BasicModal, useModalInner } from '/@/components/Modal';
  35. import { ref, nextTick, onMounted, computed } from 'vue';
  36. import * as echarts from 'echarts';
  37. const props = defineProps({
  38. data: {
  39. type: Object,
  40. default: () => {},
  41. },
  42. });
  43. const emit = defineEmits(['close', 'register', 'openModal']);
  44. // 注册 modal
  45. const [register, { closeModal }] = useModalInner((data) => {
  46. nextTick(() => {
  47. updateChart();
  48. });
  49. });
  50. const ChartRef = ref(null);
  51. const categories = ref(['2025-01-01', '2025-01-02', '2025-01-03']);
  52. const gasT1 = ref([0.1, 0.2, 0.1]);
  53. const gasT2 = ref([0.2, 0.2, 0.1]);
  54. function updateChart() {
  55. const myChart = echarts.init(ChartRef.value);
  56. const option = {
  57. title: {
  58. text: '',
  59. textStyle: {
  60. color: '#ffffff', // 设置标题颜色
  61. },
  62. left: 'center', // 水平居中
  63. top: '0', // 设置标题距离顶部的距离
  64. },
  65. legend: {
  66. top: '9%',
  67. textStyle: {
  68. color: '#ffffffff',
  69. },
  70. width: '80%', // 设置图例的宽度
  71. orient: 'horizontal', // 水平布局
  72. pageIconColor: '#ffffff', // 设置翻页图标颜色
  73. pageTextStyle: {
  74. color: '#ffffff', // 设置翻页文字颜色
  75. },
  76. },
  77. xAxis: {
  78. type: 'category',
  79. data: categories.value,
  80. splitLine: { show: true, lineStyle: { color: 'rgba(28, 72, 105, 0.5)' } },
  81. axisLabel: {
  82. interval: 0, // 显示所有标签
  83. color: '#ffffff', // 设置 x 轴字体颜色
  84. },
  85. },
  86. yAxis: [
  87. {
  88. type: 'value',
  89. name: '浓度',
  90. max: 1,
  91. splitLine: { show: true, lineStyle: { color: 'rgba(21,80,126,.5)' } },
  92. axisLabel: {
  93. color: '#ffffff',
  94. },
  95. },
  96. ],
  97. grid: {
  98. top: '21%', // 设置 grid 距离顶部的距离,增加间隔
  99. left: '3%',
  100. right: '4%',
  101. bottom: '3%',
  102. containLabel: true,
  103. },
  104. series: [
  105. {
  106. name: '目标风量',
  107. data: gasT1.value,
  108. type: 'line',
  109. yAxisIndex: 1,
  110. },
  111. {
  112. name: '供风量',
  113. data: gasT2.value,
  114. type: 'line',
  115. yAxisIndex: 1,
  116. },
  117. ],
  118. };
  119. myChart.setOption(option);
  120. window.onresize = function () {
  121. myChart.resize();
  122. };
  123. }
  124. onMounted(() => {});
  125. function onSubmit() {
  126. emit('close');
  127. closeModal();
  128. }
  129. </script>
  130. <style scoped lang="less">
  131. .modal-box {
  132. display: flex;
  133. flex-direction: row;
  134. background-color: #ffffff05;
  135. padding: 10px 8px 0 8px;
  136. border: 1px solid #00d8ff22;
  137. position: relative;
  138. // min-height: 600px;
  139. .left-box {
  140. flex: 1; /* 占据 3/4 的空间 */
  141. background-image: url(../../../../../assets/images/dischargeGas.svg);
  142. background-repeat: no-repeat;
  143. background-size: contain; /* 确保背景图片完整显示 */
  144. background-position: center; /* 确保背景图片居中 */
  145. }
  146. .right-box {
  147. flex: 1; /* 占据 3/4 的空间 */
  148. height: 400px;
  149. width: 100%;
  150. }
  151. }
  152. .setting-box {
  153. width: 1570px;
  154. height: 70px;
  155. margin: 10px 0;
  156. background-color: #ffffff05;
  157. border: 1px solid #00d8ff22;
  158. display: flex;
  159. align-items: center;
  160. justify-content: space-between;
  161. .right-inputs {
  162. width: 100%;
  163. display: flex;
  164. height: 40px;
  165. margin: 0 10px;
  166. justify-content: space-between;
  167. }
  168. .left-buttons {
  169. display: flex;
  170. height: 40px;
  171. .btn {
  172. margin: 0 10px;
  173. }
  174. }
  175. .border-clip {
  176. width: 1px;
  177. height: 25px;
  178. border-right: 1px solid #8b8b8b77;
  179. }
  180. .input-title {
  181. max-width: 150px;
  182. }
  183. .input-box {
  184. width: 220px !important;
  185. background: transparent !important;
  186. border-color: #00d8ff44 !important;
  187. margin-right: 20px;
  188. color: #fff !important;
  189. }
  190. .btn {
  191. padding: 8px 20px;
  192. position: relative;
  193. border-radius: 2px;
  194. color: #fff;
  195. width: fit-content;
  196. cursor: pointer;
  197. &::before {
  198. position: absolute;
  199. display: block;
  200. content: '';
  201. width: calc(100% - 4px);
  202. height: calc(100% - 4px);
  203. top: 2px;
  204. left: 2px;
  205. border-radius: 2px;
  206. z-index: -1;
  207. }
  208. }
  209. .btn1 {
  210. border: 1px solid #5cfaff;
  211. &::before {
  212. background-image: linear-gradient(#2effee92, #0cb1d592);
  213. }
  214. &:hover {
  215. border: 1px solid #5cfaffaa;
  216. &::before {
  217. background-image: linear-gradient(#2effee72, #0cb1d572);
  218. }
  219. }
  220. }
  221. }
  222. @keyframes open {
  223. 0% {
  224. height: 0px;
  225. }
  226. 100% {
  227. height: fit-content;
  228. }
  229. }
  230. @keyframes close {
  231. 0% {
  232. height: fit-content;
  233. }
  234. 100% {
  235. height: 0px;
  236. }
  237. }
  238. :deep(.zxm-divider-inner-text) {
  239. color: #cacaca88 !important;
  240. }
  241. :deep(.zxm-form-item) {
  242. margin-bottom: 10px;
  243. }
  244. </style>