common.data.ts 12 KB

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