import { reactive, markRaw, defineAsyncComponent } from 'vue'; import { getAssetURL } from '/@/utils/ui'; import { useGlobSetting } from '/@/hooks/setting'; import { BasicColumn } from '/@/components/Table'; export const getMaxY = function (param) { let maxval = 0; if (param.length == 1) { maxval = Math.max(...param[0]); } else if (param.length == 2) { const max1 = Math.max(...param[0]); const max2 = Math.max(...param[1]); maxval = Math.max(max1, max2); } else if (param.length == 3) { const max1 = Math.max(...param[0]); const max2 = Math.max(...param[1]); const max3 = Math.max(...param[2]); maxval = Math.max(max1, max2, max3); } const yMax = (maxval * 1.6).toFixed(0); // const digitCount = yMax.toFixed(0).length; // console.log(digitCount,'digitCount') // let digFirst=yMax.toString().substring(0,1) // console.log(digFirst,'digFirst') // const digitCount = maxval.toFixed(0).length; // console.log(digitCount,'digitCount') // let yMax = 0; // if (digitCount < 2) { // if (yMax < 0.5) { // yMax = 1; // } else if (yMax < 0.9) { // yMax = 1.5; // } else if (yMax < 5) { // yMax = 10; // } else { // yMax = 15; // } // } else if (digitCount < 3) { // const n = Number((Number(yMax.toFixed(0)) / 10).toFixed(0)); // if (yMax < n * 10 + 5) { // yMax = (n + 1) * 10; // } else { // yMax = (n + 2) * 10; // } // } else if (digitCount < 4) { // const n = Number((Number(yMax.toFixed(0)) / 100).toFixed(0)); // if (yMax < n * 100 + 50) { // yMax = (n + 1) * 100; // } else { // yMax = (n + 2) * 100; // } // } else if (digitCount < 5) { // const n = Number((Number(yMax.toFixed(0)) / 1000).toFixed(0)); // if (yMax < n * 1000 + 500) { // yMax = (n + 1) * 1000; // } else { // yMax = (n + 1) * 1000 + 500; // } // } else if (digitCount < 6) { // const n = Number((Number(yMax.toFixed(0)) / 10000).toFixed(0)); // if (yMax < n * 10000 + 5000) { // yMax = (n + 1) * 10000; // } else { // yMax = (n + 1) * 10000 + 5000; // } // } return yMax; }; export const getMinY = function (param) { let minval = 0; if (param.length == 1) { minval = Math.min(...param[0]); } else if (param.length == 2) { const min1 = Math.min(...param[0]); const min2 = Math.min(...param[1]); minval = Math.min(min1, min2); } else if (param.length == 3) { const min1 = Math.min(...param[0]); const min2 = Math.min(...param[1]); const min3 = Math.min(...param[2]); minval = Math.min(min1, min2, min3); } const yMin = (minval * 0.7).toFixed(0); // const minDigitCount = minval.toFixed(0).length; // let yMin = 0; // if (minDigitCount < 2) { // if (yMin> 0.5) { // yMin = 0.5; // } else if (yMin > 1.5) { // yMin = 1.0; // } else if (yMin > 10) { // yMin = 5; // } else { // yMin = 15; // } // } else if (minDigitCount < 3) { // const n = Number((Number(yMin.toFixed(0)) / 10).toFixed(0)); // if (n > 1) { // yMin = (n - 1) * 10; // } else { // yMin = 10; // } // } else if (minDigitCount < 4) { // const n = Number((Number(yMin.toFixed(0)) / 100).toFixed(0)); // if (n > 1) { // yMin = (n - 1) * 100; // } else { // yMin = 100; // } // } else if (minDigitCount < 5) { // const n = Number((Number(yMin.toFixed(0)) / 1000).toFixed(0)); // if (n > 1) { // yMin = (n - 1) * 1000; // } else { // yMin = 1000; // } // } else if (minDigitCount < 6) { // const n = Number((Number(yMin.toFixed(0)) / 10000).toFixed(0)); // if (n > 1) { // yMin = (n - 1) * 10000; // } else { // yMin = 10000; // } // } return yMin; }; //中间区域数据-通风 export const centerAreaListT1 = [ { id: 0, label: '进风量(m³/min)' }, { id: 1, label: '回风量(m³/min)' }, { id: 2, label: '需风量(m³/min)' }, ]; //中间区域底部数据-通风 export const centerAreaListB1 = [ { id: 0, content: '', }, { id: 1, content: '', }, { id: 2, content: '', }, ]; //内外因火灾菜单列表 export const typeMenuList = [{ name: '内因火灾' }, { name: '外因火灾' }, { name: '火灾指标' }]; //通风选项菜单列表 export const typeMenuListTf = [{ name: '通风监测' }, { name: '巷道阻力分析' }]; //瓦斯监测菜单列表 export function getMonitorComponent() { const { sysOrgCode } = useGlobSetting(); // const sysOrgCode = 'sdmtjtbdmk'; let typeMenuListGas; switch (sysOrgCode) { case 'sdmtjtbetmk': //布尔台 typeMenuListGas = [{ name: '预警监测' }, { name: '预警指标' }, { name: '瓦斯参数' }]; return typeMenuListGas; case 'sdmtjtbdmk': //宝德 typeMenuListGas = [{ name: '预警监测' }, { name: '管道故障诊断' }, { name: '预警指标' }]; return typeMenuListGas; default: typeMenuListGas = [{ name: '预警监测' }, { name: '预警指标' }]; return typeMenuListGas; } } export function getMonitorFlag() { const { sysOrgCode } = useGlobSetting(); let typeFlag = ''; switch (sysOrgCode) { case 'sdmtjtbdmk': //宝德 typeFlag = '1'; return typeFlag; case 'sdmtjtbetmk': //布尔台 typeFlag = '2'; return typeFlag; case 'sdmtjthlgmk': //哈拉钩 typeFlag = '2'; return typeFlag; case 'sdmtjtdltmk': //大柳塔 typeFlag = '2'; return typeFlag; case 'sdmtjtdltmkhjtj': //活鸡兔 typeFlag = '2'; return typeFlag; case 'sdmtjtcctrk': //寸草塔 typeFlag = '2'; return typeFlag; case 'sdmtjtwlmlmk': //乌兰木伦 typeFlag = '2'; return typeFlag; default: typeFlag = '2'; return typeFlag; } } //当前加载组件 export const componentName = { fireWork: markRaw(defineAsyncComponent(() => import('./common/fireWork.vue'))), closeWall: markRaw(defineAsyncComponent(() => import('./common/closeWall.vue'))), mainWell: markRaw(defineAsyncComponent(() => import('./common/mainWell.vue'))), warnFireBrt: markRaw(defineAsyncComponent(() => import('./common/warnFire-brt.vue'))), warnFireBd: markRaw(defineAsyncComponent(() => import('./common/warnFire-bd.vue'))), }; //顶部区域数据 export const topList = [ { id: 0, label: '最高温度(°C)', imgSrc: true, value: '--', text: '', list: [], }, { id: 1, label: '最低温度(°C)', imgSrc: true, value: '--', text: '', list: [], }, { id: 2, label: '平均温度(°C)', imgSrc: true, value: '--', text: '', list: [], }, { id: 3, imgSrc: false, label: '', value: null, text: '--', list: [] }, { id: 4, imgSrc: false, label: '回风隅角', value: null, text: '', list: [ { id: 0, label: 'O₂', value: 0 }, { id: 1, label: 'CO', value: 0 }, ], }, ]; export const ventilateTopList = [ { id: 0, label: '进风量(m³/min)', imgSrc: true, value: '--', text: '', list: [], }, { id: 1, label: '回风量(m³/min)', imgSrc: true, value: '--', text: '', list: [], }, { id: 2, label: '需风量(m³/min)', imgSrc: true, value: '--', text: '', list: [], }, { id: 3, imgSrc: false, label: '', value: null, text: '--', list: [] }, ]; //束管监测选项列表 export const contentList = [ { id: 0, list: [ { id: '0-0', title: 'O₂', dw: '(%)', label: '浓度 : ', value: '--', label1: '时间 : ', time: '--', }, { id: '0-1', title: 'C₂H₄', dw: '(ppm)', label: '浓度 : ', value: '--', label1: '时间 : ', time: '--', }, ], }, { id: 1, list: [ { id: '1-0', title: 'CO', dw: '(ppm)', label: '浓度 : ', value: '--', label1: '时间 : ', time: '--', }, { id: '1-1', title: 'CH₄', dw: '(ppm)', label: '浓度 : ', value: '--', label1: '时间 : ', time: '--', }, ], }, { id: 2, list: [ { id: '2-0', title: 'CO₂', dw: '(%)', label: '浓度 : ', value: '--', label1: '时间 : ', time: '--', }, { id: '2-1', title: 'C₂H₂', dw: '(ppm)', label: '浓度 : ', value: '--', label1: '时间 : ', time: '--', }, ], }, ]; //外因火灾-工作面顶部区域数据 export const topOutList = [ { id: 0, imgSrc: true, label: '最高温度(°C)', value: '0', text: '', }, { id: 1, imgSrc: true, label: '最低温度(°C)', value: '0', text: '', }, { id: 2, imgSrc: true, label: '平均温度(°C)', value: '0', text: '', }, { id: 3, imgSrc: false, label: '', value: null, text: '' }, // { // id: 4, // imgSrc: false, // label: '', // value: null, // text: '井下消防材料库', // }, ]; //外因火灾-中间区域标题数据 // export const tabList = [ // { id: 0, label: '烟雾传感器监测', details: '' }, // { id: 1, label: '一氧化碳传感器监测', details: '' }, // { id: 2, label: '自动喷淋灭火装置监测', details: '' }, // ]; export const tabLists = { yw: '烟雾传感器监测', wd: '温度传感器监测', pl: '自动喷淋灭火装置监测', co: '一氧化碳传感器监测', }; //外因火灾-传感器table列 // export const columns = [ // { // title: '序号', // dataIndex: '', // key: 'rowIndex', // width: 100, // align: 'center', // customRender: ({ index }) => { // return `${index + 1}`; // }, // }, // { rowIndex: 1, dataIndex: 'strinstallpos', title: '名称', type: '1', align: 'center' }, // { rowIndex: 2, dataIndex: 'warnLevel_str', width: 80, title: '状态', type: '1', align: 'center' }, // { rowIndex: 3, dataIndex: 'readTime', title: '时间', type: '1', align: 'center' }, // ]; //外因火灾-烟雾传感器table列 // export const columnsSmoke = [ // { // title: '序号', // dataIndex: '', // key: 'rowIndex', // width: 100, // align: 'center', // customRender: ({ index }) => { // return `${index + 1}`; // }, // }, // { rowIndex: 1, dataIndex: 'strinstallpos', title: '名称', type: '1', align: 'center' }, // { rowIndex: 2, dataIndex: 'val', width: 80, title: '值', type: '1', align: 'center' }, // { rowIndex: 3, dataIndex: 'warnLevel_str', width: 80, title: '状态', type: '1', align: 'center' }, // { rowIndex: 4, dataIndex: 'readTime', title: '时间', type: '1', align: 'center' }, // ]; export const columns: BasicColumn[] = [ { title: '序号', width: 100, align: 'center', customRender: ({ index }) => { return `${index + 1}`; }, }, { title: '采空区名称', dataIndex: 'reserviorName', key: 'reserviorName', width: 100, align: 'center', }, { title: '坝体Id', dataIndex: 'damBodyId', key: 'damBodyId', width: 100, align: 'center', }, { title: '坝体名称', dataIndex: 'dambodyName', key: 'dambodyName', width: 100, align: 'center', }, { title: '测点类别', dataIndex: 'pointType', key: 'pointType', width: 100, align: 'center', }, { title: '测点名称', dataIndex: 'pointTypeName', key: 'pointTypeName', width: 100, align: 'center', }, { title: '测点Id', dataIndex: 'propertyId', key: 'propertyId', width: 100, align: 'center', }, { title: '状态', dataIndex: 's', key: 's', width: 100, align: 'center', }, { title: '当前值', dataIndex: 'v', key: 'v', width: 100, align: 'center', }, { title: '单位', dataIndex: 'pointUnit', key: 'pointUnit', width: 100, align: 'center', }, { title: '采集时间', dataIndex: 't', key: 't', width: 100, align: 'center', }, ];