|
@@ -1,64 +1,166 @@
|
|
|
<template>
|
|
|
<div class="compositeWarn">
|
|
|
<div class="composite-left-box">
|
|
|
- <basicTree :treeData="treeData"></basicTree>
|
|
|
+ <basicTree :treeData="treeData" @selectChange="selectChange"></basicTree>
|
|
|
</div>
|
|
|
<div class="composite-right-box">
|
|
|
<div class="composite-top-box">
|
|
|
- <basicCard3 :card3List="card3List"></basicCard3>
|
|
|
+ <basicCard3 :card3List="card3List" :warningLevel="warningLevel" @toggleChange="toggleChange"></basicCard3>
|
|
|
</div>
|
|
|
<div class="composite-bot-box">
|
|
|
- <basicEchartLine :gridV="gridV" :echartData="echartData"></basicEchartLine>
|
|
|
+ <div class="search-area">
|
|
|
+ <!-- <RangePicker v-model="TimeRange" size="small" style="width: 260px" :show-time="{ format: 'HH:mm:ss' }"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ :placeholder="['开始时间', '结束时间']" @change="onDataChange" /> -->
|
|
|
+ </div>
|
|
|
+ <div class="content-area">
|
|
|
+ <basicEchartLine :gridV="gridV" :echartData="echartData"></basicEchartLine>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive } from 'vue'
|
|
|
+import { ref, reactive, onMounted } from 'vue'
|
|
|
import basicCard3 from '../../common/basicCard3.vue';
|
|
|
import basicEchartLine from '../../common/basicEchartLine.vue';
|
|
|
import basicTree from '../../common/basicTree.vue'
|
|
|
+// import { Select, RangePicker,} from 'ant-design-vue';
|
|
|
+import moment from 'moment'
|
|
|
+import { getFireAreaInfo, getSgjcPointInfo, getSgjcRealDataByPointCode, getSgjcHistoryData } from './composite.api'
|
|
|
|
|
|
-let card3List = reactive([
|
|
|
- { title: 'O2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'N2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'CO(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'CO2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'CH4(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'C2H4(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'C2H2(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'H2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
- { title: 'NO2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+let warningLevel = ref('')//风险等级
|
|
|
+let card3List = reactive<any[]>([
|
|
|
+ // { title: 'O2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'N2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'CO(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'CO2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'CH4(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'C2H4(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'C2H2(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'H2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
+ // { title: 'NO2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
|
|
|
])
|
|
|
|
|
|
//数据随便写的,不符合实际情况,因为懒得改
|
|
|
-const treeData = reactive([
|
|
|
- { name: "81203综放工作面", value: "111", id: '1', pid: null },
|
|
|
- { name: "束管监测系统", value: "222", id: '1-2', pid: '1' },
|
|
|
- { name: "81203综放工作面", value: "458", id: '2', pid: null },
|
|
|
- { name: "束管监测系统", value: "445", id: '2-1', pid: '2' },
|
|
|
- { name: "束管监测系统", value: "456", id: '2-2', pid: '2' },
|
|
|
- { name: "束管监测系统", value: "647", id: '2-3', pid: '2' },
|
|
|
- { name: "81203综放工作面", value: "189", id: '3', pid: null },
|
|
|
- { name: "束管监测系统", value: "664", id: '3-1', pid: '3' },
|
|
|
- { name: "束管监测系统", value: "652", id: '3-2', pid: '3' },
|
|
|
- { name: "束管监测系统", value: "732", id: '3-3', pid: '3' },
|
|
|
- { name: "束管监测系统", value: "852", id: '3-3-1', pid: '3-3' },
|
|
|
+const treeData = reactive<any[]>([
|
|
|
+ // { name: "81203综放工作面", value: "111", id: '1', pid: null },
|
|
|
+ // { name: "束管监测系统", value: "222", id: '1-2', pid: '1' },
|
|
|
+ // { name: "81203综放工作面", value: "458", id: '2', pid: null },
|
|
|
+ // { name: "束管监测系统", value: "445", id: '2-1', pid: '2' },
|
|
|
+ // { name: "束管监测系统", value: "456", id: '2-2', pid: '2' },
|
|
|
+ // { name: "束管监测系统", value: "647", id: '2-3', pid: '2' },
|
|
|
+ // { name: "81203综放工作面", value: "189", id: '3', pid: null },
|
|
|
+ // { name: "束管监测系统", value: "664", id: '3-1', pid: '3' },
|
|
|
+ // { name: "束管监测系统", value: "652", id: '3-2', pid: '3' },
|
|
|
+ // { name: "束管监测系统", value: "732", id: '3-3', pid: '3' },
|
|
|
+ // { name: "束管监测系统", value: "852", id: '3-3-1', pid: '3-3' },
|
|
|
])
|
|
|
+let areaCode = ref('')
|
|
|
+let gasType = ref('')
|
|
|
+let pointCode = ref('')
|
|
|
+let TimeRange=ref([moment('2024/01/01 00:00:00', 'YYYY-MM-DD HH:mm:ss'), moment('2024/01/02 00:00:00', 'YYYY-MM-DD HH:mm:ss')]) //查询时间
|
|
|
+//[moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')]
|
|
|
|
|
|
-let gridV=reactive({
|
|
|
+let gridV = reactive({
|
|
|
top: '8%',
|
|
|
- left: '3%',
|
|
|
- right: '3%',
|
|
|
- bottom: '10%',
|
|
|
+ left: '3%',
|
|
|
+ right: '3%',
|
|
|
+ bottom: '10%',
|
|
|
})
|
|
|
|
|
|
-let echartData=reactive({
|
|
|
- xData:['12.1', '12.2', '12.3', '12.4', '12.5', '12.6', '12.7'],
|
|
|
- yData:[90, 105, 84, 125, 110, 92, 98],
|
|
|
- yData1:[140, 165, 134, 175, 160, 152, 158],
|
|
|
- legendName:['实时值','预测值']
|
|
|
+let echartData = reactive(
|
|
|
+ {
|
|
|
+ xData: [],
|
|
|
+ yData: [],
|
|
|
+ yData1: [],
|
|
|
+ legendName: ['实时值', '预测值']
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
+ //时间选项切换
|
|
|
+ function onDataChange(value, dateString) {
|
|
|
+ TimeRange = [dateString[0], dateString[1]]
|
|
|
+ console.log(TimeRange, 'TimeRange')
|
|
|
+ }
|
|
|
+//获取左侧菜单树
|
|
|
+async function getFireAreaInfos() {
|
|
|
+ const res = await getFireAreaInfo({ fireCauseType: 2 })
|
|
|
+ // treeData.length = 0
|
|
|
+ if (res.success) {
|
|
|
+ res.data.forEach((el, ind) => {
|
|
|
+ if (el.areaType == 2) {
|
|
|
+ treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ areaCode.value = treeData[0]['areaCode']
|
|
|
+ warningLevel.value = treeData[0].warningLevel == 0 ? '正常' : treeData[0].warningLevel == 101 ? '较低风险' : treeData[0].warningLevel == 102 ? '低风险' : treeData[0].warningLevel == 103 ? '中风险' : treeData[0].warningLevel == 104 ? '高风险' : treeData[0].warningLevel == 105 ? '高风险' : '--'
|
|
|
+ console.log(treeData, 'treeData-------')
|
|
|
+ getSgjcPointInfoList()
|
|
|
+ }
|
|
|
+}
|
|
|
+//点击左侧树节点
|
|
|
+function selectChange(treeNode) {
|
|
|
+ console.log(treeNode, 'treeNode---')
|
|
|
+ areaCode.value = treeData.filter((v) => v.name == treeNode.node.dataRef.title)[0]['areaCode']
|
|
|
+ let level = treeData.filter((m) => m.name == treeNode.node.dataRef.title)[0]['warningLevel']
|
|
|
+ warningLevel.value = level == 0 ? '正常' : level == 101 ? '较低风险' : level == 102 ? '低风险' : level == 103 ? '中风险' : level == 104 ? '高风险' : level == 105 ? '高风险' : '--'
|
|
|
+ card3List.length = 0
|
|
|
+ echartData.xData.length = 0
|
|
|
+ echartData.yData.length = 0
|
|
|
+ echartData.yData1.length = 0
|
|
|
+ getSgjcPointInfoList()
|
|
|
+}
|
|
|
+
|
|
|
+//获取工作面束管测点编号列表
|
|
|
+async function getSgjcPointInfoList() {
|
|
|
+ let res = await getSgjcPointInfo({ areaCode: areaCode.value })
|
|
|
+ console.log(res, '工作面束管测点编号列表')
|
|
|
+ if (res.success) {
|
|
|
+ pointCode.value = res.data[0]['pointCode']
|
|
|
+ //获取工作面束管测点实时数据
|
|
|
+ getSgjcRealDataByPointCodeList()
|
|
|
+ }
|
|
|
+}
|
|
|
+//获取工作面束管测点实时数据
|
|
|
+async function getSgjcRealDataByPointCodeList() {
|
|
|
+ let res = await getSgjcRealDataByPointCode({ pointCode: pointCode.value })
|
|
|
+ console.log(res, '工作面束管测点实时数据======')
|
|
|
+ if (res.success) {
|
|
|
+ res.data.forEach(el => {
|
|
|
+ card3List.push({ title: el.type, ndLabel: '浓度', ndVal: el.currentValue, tLabel: '时间', tVal: el.time, aLabel: '位置', aVal: el.position })
|
|
|
+ })
|
|
|
+ gasType.value = card3List[0]['title']
|
|
|
+ //获取束管曲线数据
|
|
|
+ getSgjcHistoryDataList()
|
|
|
+ }
|
|
|
+}
|
|
|
+//工作面束管选项切换
|
|
|
+function toggleChange(title) {
|
|
|
+ gasType.value = title
|
|
|
+ echartData.xData.length = 0
|
|
|
+ echartData.yData.length = 0
|
|
|
+ echartData.yData1.length = 0
|
|
|
+ getSgjcHistoryDataList()
|
|
|
+}
|
|
|
+//获取束管曲线数据
|
|
|
+async function getSgjcHistoryDataList() {
|
|
|
+ let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value })
|
|
|
+ console.log(res, '束管曲线数据-------')
|
|
|
+ if (res.success) {
|
|
|
+ res.data.time.forEach(el => {
|
|
|
+ echartData.xData.push(el)
|
|
|
+ })
|
|
|
+ res.data.value.forEach(el => {
|
|
|
+ echartData.yData.push(el)
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getFireAreaInfos()
|
|
|
})
|
|
|
|
|
|
</script>
|
|
@@ -100,9 +202,45 @@ let echartData=reactive({
|
|
|
border: 1px solid #1e96cd;
|
|
|
background-color: rgb(41 49 53 / 80%);
|
|
|
|
|
|
+ .search-area{
|
|
|
+ display: flex;
|
|
|
+ box-sizing: border-box;
|
|
|
+ align-items: center;
|
|
|
+ height: 40px;
|
|
|
+ padding: 0 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content-area{
|
|
|
+ height: calc(100% - 40px);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
+:deep(.vMonitor-picker) {
|
|
|
+ border: none !important;
|
|
|
+ background-color: rgb(15 64 88) !important;
|
|
|
+ box-shadow: none;
|
|
|
+ color: #a1dff8 !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.vMonitor-picker-input >input) {
|
|
|
+ color: #a1dff8 !important;
|
|
|
+ text-align: center !important;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+:deep(.vMonitor-picker-separator) {
|
|
|
+ color: #a1dff8 !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.vMonitor-picker-active-bar) {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
|
|
|
+:deep(.vMonitor-picker-suffix) {
|
|
|
+ color: #a1dff8 !important;
|
|
|
}
|
|
|
</style>
|