| | |
| | | # 本地环境 |
| | | ENV = 'development' |
| | | VITE_API_URL = 'http://192.168.0.27:17080' |
| | | VITE_API_URL = 'http://192.168.2.10:17080' |
| | | |
| | | #线上正式环境接口地址 |
| | | #VITE_API_URL = 'http://ftir.sinanoaq.cn/api' |
| | |
| | | "vue-grid-layout": "^3.0.0-beta1", |
| | | "vue-i18n": "^9.1.10", |
| | | "vue-router": "^4.0.15", |
| | | "vue3-json-excel": "^1.0.10-alpha", |
| | | "wangeditor": "^4.7.15", |
| | | "xlsx": "^0.18.5" |
| | | }, |
| | |
| | | "engines": { |
| | | "node": ">=12" |
| | | } |
| | | }, |
| | | "node_modules/downloadjs": { |
| | | "version": "1.4.7", |
| | | "resolved": "https://registry.npmmirror.com/downloadjs/-/downloadjs-1.4.7.tgz", |
| | | "integrity": "sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q==" |
| | | }, |
| | | "node_modules/echarts": { |
| | | "version": "5.3.3", |
| | |
| | | "vue": "^3.2.0" |
| | | } |
| | | }, |
| | | "node_modules/vue3-json-excel": { |
| | | "version": "1.0.10-alpha", |
| | | "resolved": "https://registry.npmmirror.com/vue3-json-excel/-/vue3-json-excel-1.0.10-alpha.tgz", |
| | | "integrity": "sha512-wTcHSWdGQ5hFjpYbw2KOoLNQKVMFqDPfMPKuRpisxAACMk/E483/RLP3GT6HGMxocSO61wGKrAzYymYhKjo1Ew==", |
| | | "dependencies": { |
| | | "downloadjs": "^1.4.7" |
| | | }, |
| | | "peerDependencies": { |
| | | "downloadjs": "^1.4.7", |
| | | "vue": "^3.2.25" |
| | | } |
| | | }, |
| | | "node_modules/wangeditor": { |
| | | "version": "4.7.15", |
| | | "resolved": "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.15.tgz", |
| | |
| | | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", |
| | | "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", |
| | | "dev": true |
| | | }, |
| | | "downloadjs": { |
| | | "version": "1.4.7", |
| | | "resolved": "https://registry.npmmirror.com/downloadjs/-/downloadjs-1.4.7.tgz", |
| | | "integrity": "sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q==" |
| | | }, |
| | | "echarts": { |
| | | "version": "5.3.3", |
| | |
| | | "@vue/devtools-api": "^6.0.0" |
| | | } |
| | | }, |
| | | "vue3-json-excel": { |
| | | "version": "1.0.10-alpha", |
| | | "resolved": "https://registry.npmmirror.com/vue3-json-excel/-/vue3-json-excel-1.0.10-alpha.tgz", |
| | | "integrity": "sha512-wTcHSWdGQ5hFjpYbw2KOoLNQKVMFqDPfMPKuRpisxAACMk/E483/RLP3GT6HGMxocSO61wGKrAzYymYhKjo1Ew==", |
| | | "requires": { |
| | | "downloadjs": "^1.4.7" |
| | | } |
| | | }, |
| | | "wangeditor": { |
| | | "version": "4.7.15", |
| | | "resolved": "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.15.tgz", |
| | |
| | | "vue-grid-layout": "^3.0.0-beta1", |
| | | "vue-i18n": "^9.1.10", |
| | | "vue-router": "^4.0.15", |
| | | "vue3-json-excel": "^1.0.10-alpha", |
| | | "wangeditor": "^4.7.15", |
| | | "xlsx": "^0.18.5" |
| | | }, |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | //通量监测数据-导出 |
| | | exportFlux: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/gasMonitorData/gasFlux/export`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | }; |
| | | } |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | //气体监测数据-导出 |
| | | exportGas: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/gasMonitorData/gasConcentration/export`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | }; |
| | | } |
| | |
| | | import VueGridLayout from 'vue-grid-layout'; |
| | | import zhCn from 'element-plus/lib/locale/lang/zh-cn'; |
| | | import DataVVue3 from '@kjgl77/datav-vue3' |
| | | import vue3JsonExcel from 'vue3-json-excel' |
| | | // import 'lib-flexible/flexible' |
| | | const app = createApp(App); |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | |
| | | directive(app); |
| | | other.elSvg(app); |
| | | |
| | | app.use(pinia).use(router).use(ElementPlus, { i18n: i18n.global.t, locale: zhCn }).use(i18n).use(DataVVue3).use(VueGridLayout).mount('#app'); |
| | | app.use(pinia).use(router).use(ElementPlus, { i18n: i18n.global.t, locale: zhCn }).use(i18n).use(DataVVue3).use(VueGridLayout).use(vue3JsonExcel).mount('#app'); |
| | | |
| | | app.config.globalProperties.mittBus = mitt(); |
| | |
| | | startTime: string; |
| | | endTime: string; |
| | | time: Array<any>; |
| | | gas: string; |
| | | gas: string | number; |
| | | position: number | null; |
| | | } |
| | | }; |
| | | gasList: Array<any>; |
| | | positionList: Array<any>; |
| | | excelData: Array<any>; |
| | | } |
| | | } |
| | | |
| | |
| | | pageSize: number; |
| | | searchParams: { |
| | | time: Array<any>; |
| | | gas: string; |
| | | area: string; |
| | | gas: string | number; |
| | | area: string |number; |
| | | } |
| | | }; |
| | | gasList: Array<any>; |
| | | areaList: Array<any>; |
| | | excelData: Array<any>; |
| | | }, |
| | | } |
| | | |
| | |
| | | </el-icon> |
| | | 重置 |
| | | </el-button> |
| | | <vue3-json-excel |
| | | class="ml10" |
| | | :json-data="state.tableData.excelData" |
| | | :fields="fields" |
| | | name="通量数据.xls" |
| | | > |
| | | <el-button type="primary" :icon="Download" size="default">导出</el-button> |
| | | </vue3-json-excel> |
| | | </el-form> |
| | | </div> |
| | | <div :id="fluxChart" style="height: 500px;width: auto"></div> |
| | |
| | | import { gasManageApi } from "/@/api/basicDataManage/gasManage"; |
| | | import { areaManageApi } from "/@/api/basicDataManage/areaManage"; |
| | | import { fluxDataApi } from "/@/api/monitorData/fluxData"; |
| | | import {Download} from "@element-plus/icons-vue"; |
| | | import {gasDataApi} from "/@/api/monitorData/gasData"; |
| | | |
| | | const state = reactive<TableFluxState>({ |
| | | tableData: { |
| | |
| | | }, |
| | | gasList: [], |
| | | areaList: [], |
| | | excelData: [] |
| | | }, |
| | | }); |
| | | const fields = ref({ |
| | | 'time':'dataReceivingTime', |
| | | '设备ID':'equipmentId', |
| | | '区域': 'areaId', |
| | | '风速':'windSpeed', |
| | | '风向':'windDirection', |
| | | '甲烷CH4':'gasName01', |
| | | 'gasValue01':'gasValue01', |
| | | '乙烷C2H6':'gasName02', |
| | | 'gasValue02':'gasValue02', |
| | | '丙烷C3H8':'gasName03', |
| | | 'gasValue03':'gasValue03', |
| | | '丁烷C4H10':'gasName04', |
| | | 'gasValue04':'gasValue04', |
| | | '硫化氢H2S':'gasName05', |
| | | 'gasValue05':'gasValue05', |
| | | '乙烯C2H4':'gasName06', |
| | | 'gasValue06':'gasValue06', |
| | | '异丁烷C4H10':'gasName07', |
| | | 'gasValue07':'gasValue07', |
| | | }); |
| | | |
| | | const loading = ref(false); |
| | |
| | | const yData = ref([]); |
| | | const areaChart = ref([]as any); |
| | | const initInfoData = async () => { |
| | | await exportFluxData() |
| | | //柱状图 |
| | | const chartParam = { |
| | | startTime: moment(state.tableData.listQuery.searchParams.time[0]).format('YYYY-MM-DD HH:mm:ss'), |
| | |
| | | yData.value = []; |
| | | xData.value = []; |
| | | dataZoomEnd.value = 100; |
| | | initCharts([],[]); |
| | | } |
| | | |
| | | // initCharts(); |
| | |
| | | let res = await fluxDataApi().getFluxLinePage(pageParam); |
| | | if(res.data.code == 100) { |
| | | state.tableData.data = res.data.data; |
| | | state.tableData.total = res.data.total; |
| | | state.tableData.total = res.data.total == null ? 0 :res.data.total; |
| | | state.tableData.listQuery.pageIndex = res.data.pageIndex; |
| | | state.tableData.listQuery.pageSize = res.data.pageSize; |
| | | loading.value = false; |
| | |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const exportFluxData = async () => { |
| | | const pageParam = { |
| | | startTime: moment(state.tableData.listQuery.searchParams.time[0]).format('YYYY-MM-DD HH:mm:ss'), |
| | | endTime: moment(state.tableData.listQuery.searchParams.time[1]).format('YYYY-MM-DD HH:mm:ss'), |
| | | ch4: state.tableData.listQuery.searchParams.gas == 1 ? 1 : 0, |
| | | c2h6: state.tableData.listQuery.searchParams.gas == 2 ? 1:0, |
| | | c3H8: state.tableData.listQuery.searchParams.gas == 3 ? 1:0, |
| | | c4h101: state.tableData.listQuery.searchParams.gas == 4 ? 1:0, |
| | | h2s: state.tableData.listQuery.searchParams.gas == 5 ? 1:0, |
| | | c2h4: state.tableData.listQuery.searchParams.gas == 6 ? 1:0, |
| | | c4h102: state.tableData.listQuery.searchParams.gas == 7 ? 1:0, |
| | | |
| | | // 发对应的编号,查询数据;null,不查询 |
| | | areaId1: state.tableData.listQuery.searchParams.area == 1 ? '1':null, |
| | | areaId2: state.tableData.listQuery.searchParams.area == 2 ? '2':null, |
| | | areaId3: state.tableData.listQuery.searchParams.area == 3 ? '3':null, |
| | | areaId4: state.tableData.listQuery.searchParams.area == 4 ? '4':null, |
| | | areaId5: state.tableData.listQuery.searchParams.area == 5 ? '5':null, |
| | | areaId6: state.tableData.listQuery.searchParams.area == 6 ? '6':null, |
| | | } |
| | | let res = await fluxDataApi().exportFlux(pageParam); |
| | | if(res.data.code == 200) { |
| | | state.tableData.excelData = res.data.data |
| | | console.log('excelData',state.tableData.excelData) |
| | | }else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const labelOption = { |
| | | rotate: 90, |
| | |
| | | if (myChart.value != null && myChart.value != "" && myChart.value != undefined) { |
| | | myChart.value.dispose(); |
| | | } |
| | | console.log(yData.value.length,'xxxx') |
| | | |
| | | myChart.value = echarts.init(document.getElementById(fluxChart.value)); |
| | | // 指定图表的配置项和数据 |
| | |
| | | </el-icon> |
| | | 重置 |
| | | </el-button> |
| | | <vue3-json-excel |
| | | class="ml10" |
| | | :json-data="state.tableData.excelData" |
| | | :fields="fields" |
| | | name="气体数据.xls" |
| | | > |
| | | <el-button type="primary" :icon="Download" size="default">导出</el-button> |
| | | </vue3-json-excel> |
| | | </el-form> |
| | | </div> |
| | | <div :id="gasChart" style="height: 500px;width: auto"></div> |
| | |
| | | import { gasManageApi } from "/@/api/basicDataManage/gasManage"; |
| | | import moment from "moment"; |
| | | import {gasDataApi} from "/@/api/monitorData/gasData"; |
| | | import {Download} from "@element-plus/icons-vue"; |
| | | |
| | | const state = reactive<TableGasState>({ |
| | | tableData: { |
| | |
| | | value: '方位3', |
| | | label: 3 |
| | | }, |
| | | ] |
| | | ], |
| | | excelData: [] |
| | | } |
| | | }); |
| | | const fields = ref({ |
| | | 'time':'dataReceivingTime', |
| | | '设备ID':'equipmentId', |
| | | '位置':'position', |
| | | '经度':'lng', |
| | | '纬度':'lat', |
| | | '角度': 'angle', |
| | | '温度': 'temp', |
| | | '湿度': 'humidity', |
| | | '风速':'windSpeed', |
| | | '风向':'windDirection', |
| | | '气压':'pressure', |
| | | '甲烷CH4':'gasName01', |
| | | 'gasValue01':'gasValue01', |
| | | '乙烷C2H6':'gasName02', |
| | | 'gasValue02':'gasValue02', |
| | | '丙烷C3H8':'gasName03', |
| | | 'gasValue03':'gasValue03', |
| | | '丁烷C4H10':'gasName04', |
| | | 'gasValue04':'gasValue04', |
| | | '硫化氢H2S':'gasName05', |
| | | 'gasValue05':'gasValue05', |
| | | '乙烯C2H4':'gasName06', |
| | | 'gasValue06':'gasValue06', |
| | | '异丁烷C4H10':'gasName07', |
| | | 'gasValue07':'gasValue07', |
| | | }); |
| | | const gasChart = ref("eChartgasN" + Date .now() + Math .random()) |
| | | |
| | |
| | | state.tableData.listQuery.searchParams.time = [sTime,eTime]; |
| | | } |
| | | const initInfoData = async () => { |
| | | await exportGasData(); |
| | | //折线图 |
| | | const chartParam = { |
| | | startTime: moment(state.tableData.listQuery.searchParams.time[0]).format('YYYY-MM-DD HH:mm:ss'), |
| | |
| | | let res = await gasDataApi().getGasLinePage(pageParam); |
| | | if(res.data.code == 100) { |
| | | state.tableData.data = res.data.data; |
| | | state.tableData.total = res.data.total; |
| | | state.tableData.total = res.data.total == null ? 0 :res.data.total; |
| | | state.tableData.listQuery.pageIndex = res.data.pageIndex; |
| | | state.tableData.listQuery.pageSize = res.data.pageSize; |
| | | loading.value = false; |
| | |
| | | //默认选择第一个气体 |
| | | state.tableData.listQuery.searchParams.gas = state.tableData.gasList[0].id; |
| | | markLines.value = state.tableData.gasList[0].threshold; |
| | | initInfoData(); |
| | | await initInfoData(); |
| | | |
| | | }else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | }); |
| | | } |
| | | }; |
| | | const exportGasData = async () => { |
| | | const pageParam = { |
| | | startTime: moment(state.tableData.listQuery.searchParams.time[0]).format('YYYY-MM-DD HH:mm:ss'), |
| | | endTime: moment(state.tableData.listQuery.searchParams.time[1]).format('YYYY-MM-DD HH:mm:ss'), |
| | | ch4: state.tableData.listQuery.searchParams.gas == 1 ? 1 : 0, |
| | | c2h6: state.tableData.listQuery.searchParams.gas == 2 ? 1:0, |
| | | c3H8: state.tableData.listQuery.searchParams.gas == 3 ? 1:0, |
| | | c4h101: state.tableData.listQuery.searchParams.gas == 4 ? 1:0, |
| | | h2s: state.tableData.listQuery.searchParams.gas == 5 ? 1:0, |
| | | c2h4: state.tableData.listQuery.searchParams.gas == 6 ? 1:0, |
| | | c4h102: state.tableData.listQuery.searchParams.gas == 7 ? 1:0, |
| | | |
| | | // 发对应的编号,查询数据;null,不查询 |
| | | position1: state.tableData.listQuery.searchParams.position == 1 ? '1':null, |
| | | position2: state.tableData.listQuery.searchParams.position == 2 ? '2':null, |
| | | position3: state.tableData.listQuery.searchParams.position == 3 ? '3':null, |
| | | } |
| | | let res = await gasDataApi().exportGas(pageParam); |
| | | if(res.data.code == 200) { |
| | | state.tableData.excelData = res.data.data |
| | | console.log('excelData',state.tableData.excelData) |
| | | }else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.tableData.listQuery.pageSize = val; |
| | |
| | | let res = await weatherDataApi().getWeatherLinePage(pageParam); |
| | | if(res.data.code == 100) { |
| | | state.tableData.data = res.data.data; |
| | | state.tableData.total = res.data.total; |
| | | state.tableData.total = res.data.total == null ? 0 :res.data.total; |
| | | state.tableData.listQuery.pageIndex = res.data.pageIndex; |
| | | state.tableData.listQuery.pageSize = res.data.pageSize; |
| | | loading.value = false; |
| | |
| | | "resolved" "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz" |
| | | "version" "16.0.1" |
| | | |
| | | "downloadjs@^1.4.7": |
| | | "integrity" "sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q==" |
| | | "resolved" "https://registry.npmmirror.com/downloadjs/-/downloadjs-1.4.7.tgz" |
| | | "version" "1.4.7" |
| | | |
| | | "echarts-gl@^2.0.9": |
| | | "integrity" "sha512-oKeMdkkkpJGWOzjgZUsF41DOh6cMsyrGGXimbjK2l6Xeq/dBQu4ShG2w2Dzrs/1bD27b2pLTGSaUzouY191gzA==" |
| | | "resolved" "https://registry.npmjs.org/echarts-gl/-/echarts-gl-2.0.9.tgz" |
| | |
| | | "@vue/server-renderer" "3.2.36" |
| | | "@vue/shared" "3.2.36" |
| | | |
| | | "vue3-json-excel@^1.0.10-alpha": |
| | | "integrity" "sha512-wTcHSWdGQ5hFjpYbw2KOoLNQKVMFqDPfMPKuRpisxAACMk/E483/RLP3GT6HGMxocSO61wGKrAzYymYhKjo1Ew==" |
| | | "resolved" "https://registry.npmmirror.com/vue3-json-excel/-/vue3-json-excel-1.0.10-alpha.tgz" |
| | | "version" "1.0.10-alpha" |
| | | dependencies: |
| | | "downloadjs" "^1.4.7" |
| | | |
| | | "wangeditor@^4.7.15": |
| | | "integrity" "sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==" |
| | | "resolved" "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.15.tgz" |