supplyAir.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <a-modal
  3. v-model:visible="visible"
  4. width="1200px"
  5. height="500px"
  6. class="supplyAir-modal"
  7. title="风窗自主调控风量监测"
  8. @ok="handleOk"
  9. @cancel="handleOk"
  10. >
  11. <div class="modal-box">
  12. <div class="left-box"> </div>
  13. <div class="right-box">
  14. <BarAndLine
  15. class="echarts-line"
  16. xAxisPropType="readTime"
  17. height="400px"
  18. :dataSource="echartsData"
  19. :chartsColumns="chartsColumnList"
  20. :option="echatsOption"
  21. />
  22. </div>
  23. </div>
  24. <div class="setting-box">
  25. <div class="right-inputs">
  26. <div class="vent-flex-row">
  27. <div class="input-box"
  28. >风窗目标风量(m³/min):<span>{{ props.targetVolume }}</span></div
  29. >
  30. <div class="input-box"
  31. >风窗实时供风量(m³/min):<span>{{ monitorData['fWindowM3'] }}</span></div
  32. >
  33. </div>
  34. </div>
  35. </div>
  36. </a-modal>
  37. </template>
  38. <script lang="ts" setup>
  39. import { ref, nextTick, onMounted, watch, computed, reactive } from 'vue';
  40. import BarAndLine from '/@/components/chart/BarAndLine.vue';
  41. import { useGlobSetting } from '/@/hooks/setting';
  42. const props = defineProps({
  43. modalIsShow: {
  44. type: Boolean,
  45. default: false,
  46. },
  47. modalType: {
  48. type: String,
  49. },
  50. data: {
  51. type: Object,
  52. default: () => {},
  53. },
  54. targetVolume: {
  55. type: Number,
  56. },
  57. });
  58. const emit = defineEmits(['handleOk', 'handleCancel']);
  59. const visible = computed(() => props.modalIsShow);
  60. const { sysOrgCode } = useGlobSetting();
  61. // const sysOrgCode = 'sdmtjtswmk';
  62. const echartsData = ref<{ targetVolume: string | Number; readTime: string; fWindowM3: string | Number; rearm3?: string | Number }[]>([]);
  63. const monitorData = ref({});
  64. const echatsOption = {
  65. legend: {
  66. top: 10,
  67. },
  68. grid: {
  69. top: '80',
  70. left: '30',
  71. right: '35',
  72. bottom: '10',
  73. containLabel: true,
  74. },
  75. toolbox: {
  76. feature: {
  77. saveAsImage: {
  78. show: false,
  79. },
  80. },
  81. },
  82. xAxis: {
  83. type: 'category',
  84. axisLabel: {
  85. margin: 10,
  86. color: '#f1f1f199',
  87. },
  88. name: '',
  89. },
  90. yAxis: {
  91. axisLabel: {
  92. color: '#0071A5',
  93. },
  94. },
  95. };
  96. const chartsColumnListTemp = [
  97. {
  98. legend: '目标风量',
  99. seriesName: '(m³/min)',
  100. ymax: 1100,
  101. yname: 'm³/min',
  102. linetype: 'line',
  103. yaxispos: 'left',
  104. color: '#00FFA8',
  105. sort: 1,
  106. xRotate: 0,
  107. dataIndex: 'targetVolume',
  108. },
  109. {
  110. legend: sysOrgCode == 'sdmtjtswmk' ? '窗1实时供风量' : '前窗实时供风量',
  111. seriesName: '(m³/min)',
  112. ymax: 1100,
  113. yname: 'm³/min',
  114. linetype: 'line',
  115. yaxispos: 'left',
  116. color: '#FDB146',
  117. sort: 1,
  118. xRotate: 0,
  119. dataIndex: 'fWindowM3',
  120. },
  121. {
  122. legend: sysOrgCode == 'sdmtjtswmk' ? '窗2实时供风量' : '后窗实时供风量',
  123. seriesName: '(m³/min)',
  124. ymax: 1100,
  125. yname: 'm³/min',
  126. linetype: 'line',
  127. yaxispos: 'left',
  128. color: '#AD19FE',
  129. sort: 1,
  130. xRotate: 0,
  131. dataIndex: 'rearm3',
  132. },
  133. ];
  134. const chartsColumnList = ref(chartsColumnListTemp);
  135. watch(
  136. () => props.data,
  137. (newVal) => {
  138. if (!visible.value) return;
  139. if (newVal['nwindownum'] == 1) {
  140. if (chartsColumnList.value.length != 2) chartsColumnList.value = [chartsColumnListTemp[0], chartsColumnListTemp[1]];
  141. } else {
  142. if (chartsColumnList.value.length != 3) chartsColumnList.value = [chartsColumnListTemp[0], chartsColumnListTemp[1], chartsColumnListTemp[2]];
  143. }
  144. monitorData.value = newVal;
  145. if (echartsData.value.length > 20) {
  146. echartsData.value.shift();
  147. }
  148. echartsData.value = [
  149. ...echartsData.value,
  150. { fWindowM3: newVal['fWindowM3'], targetVolume: props.targetVolume, readTime: newVal['readTime'].substring(11), rearm3: newVal['rearm3'] },
  151. ];
  152. }
  153. );
  154. function handleOk() {
  155. emit('handleCancel');
  156. echartsData.value = [];
  157. }
  158. onMounted(() => {});
  159. </script>
  160. <style scoped lang="less">
  161. .modal-box {
  162. display: flex;
  163. flex-direction: row;
  164. background-color: #ffffff05;
  165. padding: 10px 8px 0 8px;
  166. border: 1px solid #00d8ff22;
  167. position: relative;
  168. // min-height: 600px;
  169. .left-box {
  170. flex: 1; /* 占据 3/4 的空间 */
  171. background-image: url(../../../../../assets/images/window-targetm3.png);
  172. background-repeat: no-repeat;
  173. background-size: contain; /* 确保背景图片完整显示 */
  174. background-position: center; /* 确保背景图片居中 */
  175. }
  176. .right-box {
  177. flex: 1; /* 占据 3/4 的空间 */
  178. height: 400px;
  179. width: 100%;
  180. }
  181. }
  182. .setting-box {
  183. width: 1570px;
  184. height: 70px;
  185. margin: 10px 0;
  186. background-color: #ffffff05;
  187. border: 1px solid #00d8ff22;
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. .right-inputs {
  192. width: 100%;
  193. display: flex;
  194. height: 40px;
  195. margin: 0 10px;
  196. justify-content: space-between;
  197. }
  198. .left-buttons {
  199. display: flex;
  200. height: 40px;
  201. .btn {
  202. margin: 0 10px;
  203. }
  204. }
  205. .border-clip {
  206. width: 1px;
  207. height: 25px;
  208. border-right: 1px solid #8b8b8b77;
  209. }
  210. .input-box {
  211. width: 350px;
  212. span {
  213. color: aqua;
  214. padding: 0 20px;
  215. }
  216. }
  217. }
  218. @keyframes open {
  219. 0% {
  220. height: 0px;
  221. }
  222. 100% {
  223. height: fit-content;
  224. }
  225. }
  226. @keyframes close {
  227. 0% {
  228. height: fit-content;
  229. }
  230. 100% {
  231. height: 0px;
  232. }
  233. }
  234. :deep(.zxm-divider-inner-text) {
  235. color: #cacaca88 !important;
  236. }
  237. :deep(.zxm-form-item) {
  238. margin-bottom: 10px;
  239. }
  240. </style>