common.data.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. import { reactive, markRaw, defineAsyncComponent } from 'vue';
  2. import { getAssetURL } from '/@/utils/ui';
  3. import { useGlobSetting } from '/@/hooks/setting';
  4. export const getMaxY = function (param) {
  5. let maxval = 0;
  6. if (param.length == 1) {
  7. maxval = Math.max(...param[0]);
  8. } else if (param.length == 2) {
  9. const max1 = Math.max(...param[0]);
  10. const max2 = Math.max(...param[1]);
  11. maxval = Math.max(max1, max2);
  12. } else if (param.length == 3) {
  13. const max1 = Math.max(...param[0]);
  14. const max2 = Math.max(...param[1]);
  15. const max3 = Math.max(...param[2]);
  16. maxval = Math.max(max1, max2, max3);
  17. }
  18. const yMax = (maxval * 1.6).toFixed(0);
  19. // const digitCount = yMax.toFixed(0).length;
  20. // console.log(digitCount,'digitCount')
  21. // let digFirst=yMax.toString().substring(0,1)
  22. // console.log(digFirst,'digFirst')
  23. // const digitCount = maxval.toFixed(0).length;
  24. // console.log(digitCount,'digitCount')
  25. // let yMax = 0;
  26. // if (digitCount < 2) {
  27. // if (yMax < 0.5) {
  28. // yMax = 1;
  29. // } else if (yMax < 0.9) {
  30. // yMax = 1.5;
  31. // } else if (yMax < 5) {
  32. // yMax = 10;
  33. // } else {
  34. // yMax = 15;
  35. // }
  36. // } else if (digitCount < 3) {
  37. // const n = Number((Number(yMax.toFixed(0)) / 10).toFixed(0));
  38. // if (yMax < n * 10 + 5) {
  39. // yMax = (n + 1) * 10;
  40. // } else {
  41. // yMax = (n + 2) * 10;
  42. // }
  43. // } else if (digitCount < 4) {
  44. // const n = Number((Number(yMax.toFixed(0)) / 100).toFixed(0));
  45. // if (yMax < n * 100 + 50) {
  46. // yMax = (n + 1) * 100;
  47. // } else {
  48. // yMax = (n + 2) * 100;
  49. // }
  50. // } else if (digitCount < 5) {
  51. // const n = Number((Number(yMax.toFixed(0)) / 1000).toFixed(0));
  52. // if (yMax < n * 1000 + 500) {
  53. // yMax = (n + 1) * 1000;
  54. // } else {
  55. // yMax = (n + 1) * 1000 + 500;
  56. // }
  57. // } else if (digitCount < 6) {
  58. // const n = Number((Number(yMax.toFixed(0)) / 10000).toFixed(0));
  59. // if (yMax < n * 10000 + 5000) {
  60. // yMax = (n + 1) * 10000;
  61. // } else {
  62. // yMax = (n + 1) * 10000 + 5000;
  63. // }
  64. // }
  65. return yMax;
  66. };
  67. export const getMinY = function (param) {
  68. let minval = 0;
  69. if (param.length == 1) {
  70. minval = Math.min(...param[0]);
  71. } else if (param.length == 2) {
  72. const min1 = Math.min(...param[0]);
  73. const min2 = Math.min(...param[1]);
  74. minval = Math.min(min1, min2);
  75. } else if (param.length == 3) {
  76. const min1 = Math.min(...param[0]);
  77. const min2 = Math.min(...param[1]);
  78. const min3 = Math.min(...param[2]);
  79. minval = Math.min(min1, min2, min3);
  80. }
  81. const yMin = (minval * 0.7).toFixed(0);
  82. // const minDigitCount = minval.toFixed(0).length;
  83. // let yMin = 0;
  84. // if (minDigitCount < 2) {
  85. // if (yMin> 0.5) {
  86. // yMin = 0.5;
  87. // } else if (yMin > 1.5) {
  88. // yMin = 1.0;
  89. // } else if (yMin > 10) {
  90. // yMin = 5;
  91. // } else {
  92. // yMin = 15;
  93. // }
  94. // } else if (minDigitCount < 3) {
  95. // const n = Number((Number(yMin.toFixed(0)) / 10).toFixed(0));
  96. // if (n > 1) {
  97. // yMin = (n - 1) * 10;
  98. // } else {
  99. // yMin = 10;
  100. // }
  101. // } else if (minDigitCount < 4) {
  102. // const n = Number((Number(yMin.toFixed(0)) / 100).toFixed(0));
  103. // if (n > 1) {
  104. // yMin = (n - 1) * 100;
  105. // } else {
  106. // yMin = 100;
  107. // }
  108. // } else if (minDigitCount < 5) {
  109. // const n = Number((Number(yMin.toFixed(0)) / 1000).toFixed(0));
  110. // if (n > 1) {
  111. // yMin = (n - 1) * 1000;
  112. // } else {
  113. // yMin = 1000;
  114. // }
  115. // } else if (minDigitCount < 6) {
  116. // const n = Number((Number(yMin.toFixed(0)) / 10000).toFixed(0));
  117. // if (n > 1) {
  118. // yMin = (n - 1) * 10000;
  119. // } else {
  120. // yMin = 10000;
  121. // }
  122. // }
  123. return yMin;
  124. };
  125. //中间区域数据-通风
  126. export const centerAreaListT1 = [
  127. { id: 0, label: '进风量(m³/min)' },
  128. { id: 1, label: '回风量(m³/min)' },
  129. { id: 2, label: '需风量(m³/min)' },
  130. ];
  131. //中间区域底部数据-通风
  132. export const centerAreaListB1 = [
  133. {
  134. id: 0,
  135. content: '',
  136. },
  137. {
  138. id: 1,
  139. content: '',
  140. },
  141. {
  142. id: 2,
  143. content: '',
  144. },
  145. ];
  146. //内外因火灾菜单列表
  147. export const typeMenuList = [{ name: '内因火灾' }, { name: '外因火灾' }, { name: '火灾指标' }];
  148. //通风选项菜单列表
  149. export const typeMenuListTf = [{ name: '通风监测' }, { name: '巷道阻力分析' }];
  150. //瓦斯监测菜单列表
  151. export function getMonitorComponent() {
  152. const { sysOrgCode } = useGlobSetting();
  153. // const sysOrgCode = 'sdmtjtbdmk';
  154. let typeMenuListGas;
  155. switch (sysOrgCode) {
  156. case 'sdmtjtbetmk': //布尔台
  157. typeMenuListGas = [{ name: '预警监测' }, { name: '预警指标' }, { name: '瓦斯参数' }];
  158. return typeMenuListGas;
  159. case 'sdmtjtbdmk': //宝德
  160. typeMenuListGas = [{ name: '预警监测' }, { name: '管道故障诊断' }, { name: '预警指标' }];
  161. return typeMenuListGas;
  162. default:
  163. typeMenuListGas = [{ name: '预警监测' }, { name: '预警指标' }];
  164. return typeMenuListGas;
  165. }
  166. }
  167. export function getMonitorFlag() {
  168. const { sysOrgCode } = useGlobSetting();
  169. let typeFlag = '';
  170. switch (sysOrgCode) {
  171. case 'sdmtjtbdmk': //宝德
  172. typeFlag = '1';
  173. return typeFlag;
  174. case 'sdmtjtbetmk': //布尔台
  175. typeFlag = '2';
  176. return typeFlag;
  177. case 'sdmtjthlgmk': //哈拉钩
  178. typeFlag = '2';
  179. return typeFlag;
  180. default:
  181. typeFlag = '';
  182. return typeFlag;
  183. }
  184. }
  185. //当前加载组件
  186. export const componentName = {
  187. fireWork: markRaw(defineAsyncComponent(() => import('./common/fireWork.vue'))),
  188. closeWall: markRaw(defineAsyncComponent(() => import('./common/closeWall.vue'))),
  189. mainWell: markRaw(defineAsyncComponent(() => import('./common/mainWell.vue'))),
  190. warnFireBrt: markRaw(defineAsyncComponent(() => import('./common/warnFire-brt.vue'))),
  191. warnFireBd: markRaw(defineAsyncComponent(() => import('./common/warnFire-bd.vue'))),
  192. };
  193. //顶部区域数据
  194. export const topList = [
  195. {
  196. id: 0,
  197. label: '最高温度(°C)',
  198. imgSrc: true,
  199. value: '--',
  200. text: '',
  201. list: [],
  202. },
  203. {
  204. id: 1,
  205. label: '最低温度(°C)',
  206. imgSrc: true,
  207. value: '--',
  208. text: '',
  209. list: [],
  210. },
  211. {
  212. id: 2,
  213. label: '平均温度(°C)',
  214. imgSrc: true,
  215. value: '--',
  216. text: '',
  217. list: [],
  218. },
  219. { id: 3, imgSrc: false, label: '', value: null, text: '--', list: [] },
  220. {
  221. id: 4,
  222. imgSrc: false,
  223. label: '回风隅角',
  224. value: null,
  225. text: '',
  226. list: [
  227. { id: 0, label: 'O₂', value: 0 },
  228. { id: 1, label: 'CO', value: 0 },
  229. ],
  230. },
  231. ];
  232. export const ventilateTopList = [
  233. {
  234. id: 0,
  235. label: '进风量(m³/min)',
  236. imgSrc: true,
  237. value: '--',
  238. text: '',
  239. list: [],
  240. },
  241. {
  242. id: 1,
  243. label: '回风量(m³/min)',
  244. imgSrc: true,
  245. value: '--',
  246. text: '',
  247. list: [],
  248. },
  249. {
  250. id: 2,
  251. label: '需风量(m³/min)',
  252. imgSrc: true,
  253. value: '--',
  254. text: '',
  255. list: [],
  256. },
  257. { id: 3, imgSrc: false, label: '', value: null, text: '--', list: [] },
  258. ];
  259. //束管监测选项列表
  260. export const contentList = [
  261. {
  262. id: 0,
  263. list: [
  264. {
  265. id: '0-0',
  266. title: 'O₂',
  267. dw: '(%)',
  268. label: '浓度 : ',
  269. value: '--',
  270. label1: '时间 : ',
  271. time: '--',
  272. },
  273. {
  274. id: '0-1',
  275. title: 'C₂H₄',
  276. dw: '(ppm)',
  277. label: '浓度 : ',
  278. value: '--',
  279. label1: '时间 : ',
  280. time: '--',
  281. },
  282. ],
  283. },
  284. {
  285. id: 1,
  286. list: [
  287. {
  288. id: '1-0',
  289. title: 'CO',
  290. dw: '(ppm)',
  291. label: '浓度 : ',
  292. value: '--',
  293. label1: '时间 : ',
  294. time: '--',
  295. },
  296. {
  297. id: '1-1',
  298. title: 'CH₄',
  299. dw: '(ppm)',
  300. label: '浓度 : ',
  301. value: '--',
  302. label1: '时间 : ',
  303. time: '--',
  304. },
  305. ],
  306. },
  307. {
  308. id: 2,
  309. list: [
  310. {
  311. id: '2-0',
  312. title: 'CO₂',
  313. dw: '(%)',
  314. label: '浓度 : ',
  315. value: '--',
  316. label1: '时间 : ',
  317. time: '--',
  318. },
  319. {
  320. id: '2-1',
  321. title: 'C₂H₂',
  322. dw: '(ppm)',
  323. label: '浓度 : ',
  324. value: '--',
  325. label1: '时间 : ',
  326. time: '--',
  327. },
  328. ],
  329. },
  330. ];
  331. //外因火灾-工作面顶部区域数据
  332. export const topOutList = [
  333. {
  334. id: 0,
  335. imgSrc: true,
  336. label: '最高温度(°C)',
  337. value: '0',
  338. text: '',
  339. },
  340. {
  341. id: 1,
  342. imgSrc: true,
  343. label: '最低温度(°C)',
  344. value: '0',
  345. text: '',
  346. },
  347. {
  348. id: 2,
  349. imgSrc: true,
  350. label: '平均温度(°C)',
  351. value: '0',
  352. text: '',
  353. },
  354. { id: 3, imgSrc: false, label: '', value: null, text: '' },
  355. // {
  356. // id: 4,
  357. // imgSrc: false,
  358. // label: '',
  359. // value: null,
  360. // text: '井下消防材料库',
  361. // },
  362. ];
  363. //外因火灾-中间区域标题数据
  364. // export const tabList = [
  365. // { id: 0, label: '烟雾传感器监测', details: '' },
  366. // { id: 1, label: '一氧化碳传感器监测', details: '' },
  367. // { id: 2, label: '自动喷淋灭火装置监测', details: '' },
  368. // ];
  369. export const tabLists = {
  370. yw: '烟雾传感器监测',
  371. wd: '温度传感器监测',
  372. pl: '自动喷淋灭火装置监测',
  373. co: '一氧化碳传感器监测',
  374. };
  375. //外因火灾-传感器table列
  376. // export const columns = [
  377. // {
  378. // title: '序号',
  379. // dataIndex: '',
  380. // key: 'rowIndex',
  381. // width: 60,
  382. // align: 'center',
  383. // customRender: ({ index }) => {
  384. // return `${index + 1}`;
  385. // },
  386. // },
  387. // { rowIndex: 1, dataIndex: 'strinstallpos', title: '名称', type: '1', align: 'center' },
  388. // { rowIndex: 2, dataIndex: 'warnLevel_str', width: 80, title: '状态', type: '1', align: 'center' },
  389. // { rowIndex: 3, dataIndex: 'readTime', title: '时间', type: '1', align: 'center' },
  390. // ];
  391. //外因火灾-烟雾传感器table列
  392. // export const columnsSmoke = [
  393. // {
  394. // title: '序号',
  395. // dataIndex: '',
  396. // key: 'rowIndex',
  397. // width: 60,
  398. // align: 'center',
  399. // customRender: ({ index }) => {
  400. // return `${index + 1}`;
  401. // },
  402. // },
  403. // { rowIndex: 1, dataIndex: 'strinstallpos', title: '名称', type: '1', align: 'center' },
  404. // { rowIndex: 2, dataIndex: 'val', width: 80, title: '值', type: '1', align: 'center' },
  405. // { rowIndex: 3, dataIndex: 'warnLevel_str', width: 80, title: '状态', type: '1', align: 'center' },
  406. // { rowIndex: 4, dataIndex: 'readTime', title: '时间', type: '1', align: 'center' },
  407. // ];