|
@@ -2,66 +2,75 @@
|
|
|
import { ElMessageBox } from 'element-plus';
|
|
|
import * as echarts from 'echarts';
|
|
|
import { getReportLineOptions } from './echartOptions';
|
|
|
+import { getDrawerData } from '@/api/report/lab';
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ data: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({})
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
const echartInstance = {};
|
|
|
const listRefs = [];
|
|
|
|
|
|
const drawerVisible = defineModel('show');
|
|
|
const activeName = ref('report');
|
|
|
-const queryParams = ref({});
|
|
|
-const total = ref(100);
|
|
|
+const queryParams = ref({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
+});
|
|
|
+const total = ref(0);
|
|
|
+const loading = ref(false);
|
|
|
|
|
|
-const tableData = [
|
|
|
- {name1: 1, name2: 2, name3: 3}
|
|
|
-]
|
|
|
+const tableData = ref([]);
|
|
|
|
|
|
const columns = [
|
|
|
{
|
|
|
label: '基本资料',
|
|
|
children: [
|
|
|
- { label: "化验时间", prop: 'name1', width: 180 },
|
|
|
- { label: "化验编号", prop: 'name2', width: 180 },
|
|
|
- { label: "样品名称", prop: 'name3', width: 180 }
|
|
|
+ { label: "化验时间", prop: 'assayTime', width: 180 },
|
|
|
+ { label: "样品名称", prop: 'assayTypeName', width: 180 }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
label: '高COD',
|
|
|
children: [
|
|
|
- { label: "标称值", prop: 'name', width: 100 },
|
|
|
- { label: "化验值", prop: 'name', width: 100 },
|
|
|
- { label: "偏差度", prop: 'name', width: 100 }
|
|
|
+ { label: "标称值", prop: 'highCodStandardVal', width: 100 },
|
|
|
+ { label: "化验值", prop: 'highCodResultConcentration', width: 100 },
|
|
|
+ { label: "偏差度", prop: 'highCodDeviationRate', width: 100 }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
label: '低COD',
|
|
|
children: [
|
|
|
- { label: "标称值", prop: 'name', width: 100 },
|
|
|
- { label: "化验值", prop: 'name', width: 100 },
|
|
|
- { label: "偏差度", prop: 'name', width: 100 }
|
|
|
+ { label: "标称值", prop: 'lowCodStandardVal', width: 100 },
|
|
|
+ { label: "化验值", prop: 'lowCodResultConcentration', width: 100 },
|
|
|
+ { label: "偏差度", prop: 'lowCodDeviationRate', width: 100 }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
label: '氨氮',
|
|
|
children: [
|
|
|
- { label: "标称值", prop: 'name', width: 100 },
|
|
|
- { label: "化验值", prop: 'name', width: 100 },
|
|
|
- { label: "偏差度", prop: 'name', width: 100 }
|
|
|
+ { label: "标称值", prop: 'anDanStandardVal', width: 100 },
|
|
|
+ { label: "化验值", prop: 'anDanResultConcentration', width: 100 },
|
|
|
+ { label: "偏差度", prop: 'anDanDeviationRate', width: 100 }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
label: '总氮',
|
|
|
children: [
|
|
|
- { label: "标称值", prop: 'name', width: 100 },
|
|
|
- { label: "化验值", prop: 'name', width: 100 },
|
|
|
- { label: "偏差度", prop: 'name', width: 100 }
|
|
|
+ { label: "标称值", prop: 'tnStandardVal', width: 100 },
|
|
|
+ { label: "化验值", prop: 'tnResultConcentration', width: 100 },
|
|
|
+ { label: "偏差度", prop: 'tnDeviationRate', width: 100 }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
label: '总磷',
|
|
|
children: [
|
|
|
- { label: "标称值", prop: 'name', width: 100 },
|
|
|
- { label: "化验值", prop: 'name', width: 100 },
|
|
|
- { label: "偏差度", prop: 'name', width: 100 }
|
|
|
+ { label: "标称值", prop: 'tpStandardVal', width: 100 },
|
|
|
+ { label: "化验值", prop: 'tpResultConcentration', width: 100 },
|
|
|
+ { label: "偏差度", prop: 'tpDeviationRate', width: 100 }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
@@ -75,24 +84,22 @@ const columns = [
|
|
|
{
|
|
|
label: '亚硝酸盐',
|
|
|
children: [
|
|
|
- { label: "标称值", prop: 'name', width: 100 },
|
|
|
- { label: "化验值", prop: 'name', width: 100 },
|
|
|
- { label: "偏差度", prop: 'name', width: 100 }
|
|
|
+ { label: "标称值", prop: 'xsydStandardVal', width: 100 },
|
|
|
+ { label: "化验值", prop: 'xsydResultConcentration', width: 100 },
|
|
|
+ { label: "偏差度", prop: 'xsydDeviationRate', width: 100 }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
label: '正磷酸盐',
|
|
|
children: [
|
|
|
- { label: "标称值", prop: 'name', width: 100 },
|
|
|
- { label: "化验值", prop: 'name', width: 100 },
|
|
|
- { label: "偏差度", prop: 'name', width: 100 }
|
|
|
+ { label: "标称值", prop: 'yxsyStandardVal', width: 100 },
|
|
|
+ { label: "化验值", prop: 'yxsyResultConcentration', width: 100 },
|
|
|
+ { label: "偏差度", prop: 'yxsyDeviationRate', width: 100 }
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const windowResize = () => {
|
|
|
- Object.keys(echartInstance).forEach(key => echartInstance[key].resize());
|
|
|
-}
|
|
|
+const windowResize = () => Object.keys(echartInstance).forEach(key => echartInstance[key].resize());
|
|
|
|
|
|
const handleClose = (done) => {
|
|
|
ElMessageBox.confirm('请确认是否关闭?', '提示').then(() => {
|
|
@@ -110,17 +117,49 @@ const onRadioChange = key => {
|
|
|
if ( key === 'echart' ) {
|
|
|
listRefs.forEach((item, index) => {
|
|
|
const option = getReportLineOptions();
|
|
|
- echartInstance[index] = echarts.init(item, 'light');
|
|
|
+ if (!echartInstance[index]) {
|
|
|
+ echartInstance[index] = echarts.init(item, 'light');
|
|
|
+ }
|
|
|
echartInstance[index].setOption(option);
|
|
|
});
|
|
|
window.addEventListener("resize", windowResize);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 抽屉打开后的回调
|
|
|
-const onDrawerOpened = () => {
|
|
|
+const getList = async () => {
|
|
|
|
|
|
-};
|
|
|
+ loading.value = true;
|
|
|
+
|
|
|
+ const { deviceNo, currentDate } = props.data;
|
|
|
+ const { rows, total: tableTotal } = await getDrawerData({ deviceNo, timeBegin: currentDate, timeEnd: currentDate, ...queryParams.value });
|
|
|
+ total.value = tableTotal;
|
|
|
+ tableData.value = rows;
|
|
|
+ loading.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+//
|
|
|
+const handlePageSize = size => {
|
|
|
+ queryParams.value.pageSize = size;
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const handlePageNum = size => {
|
|
|
+ queryParams.value.pageNum = size;
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 抽屉打开后的回调
|
|
|
+const onDrawerOpened = () => getList();
|
|
|
+
|
|
|
+const onDrawerClosed = () => {
|
|
|
+ queryParams.value = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
+ };
|
|
|
+ tableData.value = [];
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -132,68 +171,79 @@ const onDrawerOpened = () => {
|
|
|
:size="1100"
|
|
|
:before-close="handleClose"
|
|
|
@opened="onDrawerOpened"
|
|
|
+ @closed="onDrawerClosed"
|
|
|
>
|
|
|
- <div class="base-data-info">
|
|
|
- <h4 class="title mb-[10px]">设备日报数据</h4>
|
|
|
- <div class="board-list">
|
|
|
- <el-row :gutter="20" >
|
|
|
- <el-col :span="6">
|
|
|
- <el-card>
|
|
|
- <p class="sub-title">设备名称</p>
|
|
|
- <p>锡林浩特化验室</p>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-card>
|
|
|
- <p class="sub-title">设备编号</p>
|
|
|
- <p>A0001</p>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-card>
|
|
|
- <p class="sub-title">所属水厂</p>
|
|
|
- <p>锡林浩特化验室</p>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-card>
|
|
|
- <p class="sub-title">化验日期</p>
|
|
|
- <p>2024-08-01</p>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <main>
|
|
|
+ <div class="base-data-info">
|
|
|
+ <h4 class="title mb-[10px]">设备日报数据</h4>
|
|
|
+ <div class="board-list">
|
|
|
+ <el-row :gutter="20" >
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-card>
|
|
|
+ <p class="sub-title">设备名称</p>
|
|
|
+ <p>{{ data.deviceName }}</p>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-card>
|
|
|
+ <p class="sub-title">设备编号</p>
|
|
|
+ <p>{{ data.deviceNo }}</p>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-card>
|
|
|
+ <p class="sub-title">所属水厂</p>
|
|
|
+ <p>{{ data.worksName }}</p>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-card>
|
|
|
+ <p class="sub-title">化验日期</p>
|
|
|
+ <p>{{ data.currentDate }}</p>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <div class="mt-[50px]">
|
|
|
+ <div class="flex justify-between items-center mb-[10px]">
|
|
|
+ <h4 class="title">设备日报数据</h4>
|
|
|
+ <el-radio-group v-model="activeName" @change="onRadioChange">
|
|
|
+ <!-- <el-radio-button label="报表" value="report" /> -->
|
|
|
+ <!-- <el-radio-button label="图形" value="echart" /> -->
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="mt-[50px]">
|
|
|
- <div class="flex justify-between items-center mb-[10px]">
|
|
|
- <h4 class="title">设备日报数据</h4>
|
|
|
- <el-radio-group v-model="activeName" @change="onRadioChange">
|
|
|
- <el-radio-button label="报表" value="report" />
|
|
|
- <el-radio-button label="图形" value="echart" />
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- table 区域 -->
|
|
|
- <el-card shadow="never" v-show="activeName === 'report'">
|
|
|
- <el-table :data="tableData" style="width: 100%">
|
|
|
- <el-table-column :label="col.label" align="center" v-for="col in columns">
|
|
|
- <el-table-column :prop="child.prop" :label="child.label" :width="child.width" v-for="child in col.children"/>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <pagination
|
|
|
- :total="total"
|
|
|
- v-model:page="queryParams.pageNum"
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </el-card>
|
|
|
-
|
|
|
- <!-- ecahrts 区域 -->
|
|
|
- <div class="echart-list" v-show="activeName === 'echart'">
|
|
|
- <div v-for="_, index in 8" :ref="getRiskRef"></div>
|
|
|
+ <!-- table 区域 -->
|
|
|
+ <el-card shadow="never" v-show="activeName === 'report'">
|
|
|
+ <el-table :data="tableData" style="width: 100%" v-loading="loading">
|
|
|
+ <el-table-column :label="col.label" align="center" v-for="col in columns">
|
|
|
+ <el-table-column :prop="child.prop" :label="child.label" :width="child.width" v-for="child in col.children"/>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="flex justify-end mt-[20px]">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="sizes, prev, pager, next"
|
|
|
+ :page-sizes="[10, 20, 30, 50]"
|
|
|
+ :total="total"
|
|
|
+ v-model:current-page="queryParams.pageNum"
|
|
|
+ :page-size="queryParams.pageSize"
|
|
|
+ size="small"
|
|
|
+ v-if="total > 0"
|
|
|
+ @size-change="handlePageSize"
|
|
|
+ @current-change="handlePageNum"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <!-- ecahrts 区域 -->
|
|
|
+ <div class="echart-list" v-show="activeName === 'echart'">
|
|
|
+ <div v-for="_, index in 8" :ref="getRiskRef"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </main>
|
|
|
</el-drawer>
|
|
|
</template>
|
|
|
|
|
@@ -215,7 +265,6 @@ const onDrawerOpened = () => {
|
|
|
div {
|
|
|
border-radius: 2px;
|
|
|
border: 1px solid #ebeff4;
|
|
|
- // background: #ebeff4;
|
|
|
}
|
|
|
}
|
|
|
|