nitrogen.data.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. import { ref, reactive } from 'vue';
  2. import echarts from '/@/utils/lib/echarts';
  3. export const navList = ref([
  4. {
  5. title: '监控界面',
  6. pathName: 'nitrogen_page',
  7. isHover: false,
  8. },
  9. {
  10. title: '历史监测记录',
  11. pathName: 'yfj_history',
  12. isHover: false,
  13. },
  14. {
  15. title: '操作历史记录',
  16. pathName: 'yfj_handler_history',
  17. isHover: false,
  18. },
  19. {
  20. title: '故障诊断历史记录',
  21. pathName: 'yfj_faultRecord',
  22. isHover: false,
  23. },
  24. ]);
  25. export const groupParameterData = [
  26. {
  27. FluxTotal1: '累计流量(m³)',
  28. InputFlux: '瞬时流量(m³/h)',
  29. },
  30. {
  31. PreMembraneTemperature: '膜前温度(­°C)',
  32. NitrogenPurity: '氮气纯度(%)',
  33. },
  34. ];
  35. export const deviceParameterData = [
  36. {
  37. AirCompressor_ExhaustPre: '排气压力(KPa)',
  38. AirCompressor_ExhaustTemp: '排气温度(­°C)',
  39. },
  40. {
  41. AirCompressor_RunTime: '运行时间(h)',
  42. AirCompressor_LoadTime: '加载时间(h)',
  43. },
  44. ];
  45. export const downWindData = [
  46. {
  47. o2Val: '下风侧氧气(%)',
  48. temperature: '下风侧温度(℃)',
  49. },
  50. {
  51. fumes: '下风侧烟雾(­%)',
  52. },
  53. ];
  54. export const zhudanOption = reactive({
  55. tooltip: { trigger: 'axis', axisPointer: { lineStyle: { color: '#fff' } } },
  56. legend: {
  57. top: '0',
  58. icon: 'rect',
  59. data: ['瞬时流量'],
  60. right: '10px',
  61. textStyle: { fontSize: 12, color: '#fff' },
  62. },
  63. grid: { x: 45, y: 60, x2: 45, y2: 60 },
  64. xAxis: {
  65. type: 'category',
  66. boundaryGap: false,
  67. axisLine: { lineStyle: { color: '#57617B' } },
  68. axisLabel: {
  69. color: '#ffffffcc',
  70. formatter: function (params) {
  71. const newParamsName = ref(''); // 最终拼接成的字符串
  72. const paramsNameNumber = ref(params.length); // 实际标签的个数
  73. const provideNumber = ref(10); // 每行能显示的字的个数
  74. const rowNumber = Math.ceil(paramsNameNumber.value / provideNumber.value); // 换行的话,需要显示几行,向上取整
  75. /**
  76. * 判断标签的个数是否大于规定的个数, 如果大于,则进行换行处理 如果不大于,即等于或小于,就返回原标签
  77. */
  78. // 条件等同于rowNumber>1
  79. if (paramsNameNumber.value > provideNumber.value) {
  80. /** 循环每一行,p表示行 */
  81. for (let p = 0; p < rowNumber; p++) {
  82. let tempStr = ''; // 表示每一次截取的字符串
  83. const start = p * provideNumber.value; // 开始截取的位置
  84. const end = start + provideNumber.value; // 结束截取的位置
  85. // 此处特殊处理最后一行的索引值
  86. if (p == rowNumber - 1) {
  87. // 最后一次不换行
  88. tempStr = params.substring(start, paramsNameNumber.value);
  89. } else {
  90. // 每一次拼接字符串并换行
  91. tempStr = params.substring(start, end) + '\n';
  92. }
  93. newParamsName.value += tempStr; // 最终拼成的字符串
  94. }
  95. } else {
  96. // 将旧标签的值赋给新标签
  97. newParamsName.value = params;
  98. }
  99. //将最终的字符串返回
  100. return newParamsName.value;
  101. },
  102. },
  103. splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
  104. data: [],
  105. },
  106. yAxis: [
  107. // {
  108. // type: 'value',
  109. // name: 'm³/h',
  110. // max: 6000,
  111. // axisTick: {
  112. // show: false,
  113. // },
  114. // position: 'left',
  115. // axisLine: { lineStyle: { show: true, color: '#57617B' } },
  116. // axisLabel: { margin: 10, fontSize: 12, color: '#ffffffcc' },
  117. // splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
  118. // },
  119. {
  120. type: 'value',
  121. name: 'm³/h',
  122. max: 2000,
  123. axisTick: {
  124. show: false,
  125. },
  126. position: 'right',
  127. axisLine: { lineStyle: { show: true, color: '#57617B' } },
  128. axisLabel: { margin: 10, fontSize: 12, color: '#ffffffcc' },
  129. splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
  130. },
  131. ],
  132. series: [
  133. // {
  134. // name: '累计流量',
  135. // type: 'line',
  136. // smooth: true,
  137. // lineStyle: { width: 2 },
  138. // yAxisIndex: 0,
  139. // areaStyle: {
  140. // color: new echarts.graphic.LinearGradient(
  141. // 0,
  142. // 0,
  143. // 0,
  144. // 1,
  145. // [
  146. // {
  147. // offset: 0,
  148. // color: 'rgba(185,150,248,0.3)',
  149. // },
  150. // {
  151. // offset: 0.8,
  152. // color: 'rgba(185,150,248,0)',
  153. // },
  154. // ],
  155. // false
  156. // ),
  157. // shadowColor: 'rgba(0, 0, 0, 0.1)',
  158. // shadowBlur: 10,
  159. // },
  160. // itemStyle: { color: '#B996F8' },
  161. // data: [],
  162. // },
  163. {
  164. name: '瞬时流量',
  165. type: 'line',
  166. smooth: true,
  167. lineStyle: { width: 2 },
  168. yAxisIndex: 0,
  169. areaStyle: {
  170. color: new echarts.graphic.LinearGradient(
  171. 0,
  172. 0,
  173. 0,
  174. 1,
  175. [
  176. {
  177. offset: 0,
  178. color: 'rgba(3, 194, 236, 0.3)',
  179. },
  180. {
  181. offset: 0.8,
  182. color: 'rgba(3, 194, 236, 0)',
  183. },
  184. ],
  185. false
  186. ),
  187. shadowColor: 'rgba(0, 0, 0, 0.1)',
  188. shadowBlur: 10,
  189. },
  190. itemStyle: { color: '#03C2EC' },
  191. data: [],
  192. },
  193. ],
  194. });