添加报表功能
This commit is contained in:
parent
576f987f37
commit
9bd916876f
|
|
@ -8,7 +8,6 @@ export const columns: BasicColumn[] = [
|
||||||
title: '供热公司',
|
title: '供热公司',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'view001Name',
|
dataIndex: 'view001Name',
|
||||||
width:140,
|
|
||||||
ellipsis: false
|
ellipsis: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -31,59 +30,57 @@ export const columns: BasicColumn[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'一次网',
|
title:'一次网',
|
||||||
width:100,
|
|
||||||
children:[
|
children:[
|
||||||
{
|
{
|
||||||
title: '供水温度',
|
title: '供水温度',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view005',
|
dataIndex: 'view005',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '回水温度',
|
title: '回水温度',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view006'
|
dataIndex: 'view006'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '供水压力',
|
title: '供水压力',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view007'
|
dataIndex: 'view007'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '回水压力',
|
title: '回水压力',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view008'
|
dataIndex: 'view008'
|
||||||
}
|
}
|
||||||
]},
|
]},
|
||||||
{
|
{
|
||||||
title:'二次网',
|
title:'二次网',
|
||||||
width:100,
|
|
||||||
children:[
|
children:[
|
||||||
{
|
{
|
||||||
title: '供水温度',
|
title: '供水温度',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view009'
|
dataIndex: 'view009'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '回水温度',
|
title: '回水温度',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view010'
|
dataIndex: 'view010'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '供水压力',
|
title: '供水压力',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view011'
|
dataIndex: 'view011'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '回水压力',
|
title: '回水压力',
|
||||||
align:"center",
|
align:"center",
|
||||||
width:120,
|
width:100,
|
||||||
dataIndex: 'view012'
|
dataIndex: 'view012'
|
||||||
}
|
}
|
||||||
]},
|
]},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,256 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<!--查询区域-->
|
||||||
|
<div class="jeecg-basic-table-form-container">
|
||||||
|
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="5">
|
||||||
|
<a-form-item label="供热公司">
|
||||||
|
<a-select ref="select" placeholder="请选择供热公司" v-model:value="queryParam.view001" style="width: 150px"
|
||||||
|
@focus="focus" @change="handleChange1">
|
||||||
|
<a-select-option :value="item.id" v-for="item in thermalcompany" :key="item.id">{{ item.companyName
|
||||||
|
}}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="5">
|
||||||
|
<a-form-item label="锅炉房">
|
||||||
|
<a-select ref="select" placeholder="请选择锅炉房" v-model:value="queryParam.view002" style="width: 150px"
|
||||||
|
@focus="focus">
|
||||||
|
<a-select-option :value="item.id" v-for="item in heatsource" :key="item.id">{{ item.sourceName
|
||||||
|
}}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="5">
|
||||||
|
<a-form-item label="一次网供水温度小于" :label-col="labelCol2" :wrapper-col="wrapperCol2">
|
||||||
|
<a-input-number v-model:value="queryParam.ycwgswd" placeholder="一次网供水温度小于" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="5">
|
||||||
|
<a-form-item label="一次网回水温度小于" :label-col="labelCol2" :wrapper-col="wrapperCol2">
|
||||||
|
<a-input-number v-model:value="queryParam.ycwhswd" placeholder="一次网回水温度小于" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="4">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<!-- <a-button preIcon="ant-design:sync-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button> -->
|
||||||
|
</a-col>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :lg="5">
|
||||||
|
<a-form-item label="一次供水温度">
|
||||||
|
<a-input placeholder="请输入一次供水温度" v-model:value="queryParam.view005"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="5">
|
||||||
|
<a-form-item label="一次回水温度">
|
||||||
|
<a-input placeholder="请输入一次回水温度" v-model:value="queryParam.view006"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="5">
|
||||||
|
<a-form-item label="二次供水温度">
|
||||||
|
<a-input placeholder="请输入二次供水温度" v-model:value="queryParam.view009"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="5">
|
||||||
|
<a-form-item label="二次回水温度">
|
||||||
|
<a-input placeholder="请输入二次回水温度" v-model:value="queryParam.view010"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>-->
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable">
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
<template v-if="column.dataIndex === 'view005'">
|
||||||
|
<span v-if="record.fromFlow == 0">{{ record.view005 }}</span>
|
||||||
|
<span v-else-if="record.fromFlow == 1">{{ record.view035 }}</span>
|
||||||
|
<span v-else>{{ record.view005 || record.view035 || 0 }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'view006'">
|
||||||
|
<span v-if="record.fromFlow == 0">{{ record.view006 }}</span>
|
||||||
|
<span v-else-if="record.fromFlow == 1">{{ record.view036 }}</span>
|
||||||
|
<span v-else>{{ record.view005 || record.view035 || 0 }}</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
|
||||||
|
<HeatanalysisModal ref="registerModal"></HeatanalysisModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="heatanalysis-heatanalysis" setup>
|
||||||
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { columns } from './Heatanalysis.data';
|
||||||
|
import { list, companylist, heatsourcelist, heatsourcestationlist } from './Heatanalysis.api';
|
||||||
|
import HeatanalysisModal from './components/HeatanalysisModal.vue'
|
||||||
|
|
||||||
|
const queryParam = ref<any>({ycwhswd:'30'});
|
||||||
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
const registerModal = ref();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
tableProps: {
|
||||||
|
title: '',
|
||||||
|
api: list,
|
||||||
|
columns,
|
||||||
|
canResize: false,
|
||||||
|
useSearchForm: false,
|
||||||
|
clickToRowSelect: false,
|
||||||
|
showIndexColumn: false,
|
||||||
|
tableSetting: {
|
||||||
|
// 是否显示刷新按钮
|
||||||
|
redo: false,
|
||||||
|
// 是否显示尺寸调整按钮
|
||||||
|
size: false,
|
||||||
|
// 是否显示字段调整按钮
|
||||||
|
setting: false,
|
||||||
|
// 是否显示全屏按钮
|
||||||
|
fullScreen: false,
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
params.column = '', params.order = '';//新生成的默认不带排序
|
||||||
|
return Object.assign(params, queryParam.value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
|
const labelCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 8 },
|
||||||
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 },
|
||||||
|
});
|
||||||
|
const labelCol2 = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 12 },
|
||||||
|
});
|
||||||
|
const wrapperCol2 = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 12 },
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
function searchQuery() {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置
|
||||||
|
*/
|
||||||
|
function searchReset() {
|
||||||
|
queryParam.value = {};
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
getHeatsource();
|
||||||
|
getHeatsourcestation();
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
const thermalcompany = ref();
|
||||||
|
async function getThermalcompany() {
|
||||||
|
let params = { };
|
||||||
|
thermalcompany.value = await companylist(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
const heatsource = ref();
|
||||||
|
async function getHeatsource() {
|
||||||
|
let params = { };
|
||||||
|
heatsource.value = await heatsourcelist(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
const heatsourcestation = ref();
|
||||||
|
async function getHeatsourcestation() {
|
||||||
|
heatsourcestation.value = await heatsourcestationlist();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleChange1(record) {
|
||||||
|
var params = { companyId: record };
|
||||||
|
heatsource.value = await heatsourcelist(params);
|
||||||
|
heatsourcestation.value = [];
|
||||||
|
}
|
||||||
|
async function handleChange2(record) {
|
||||||
|
var params = { sourceId: record };
|
||||||
|
heatsourcestation.value = await heatsourcestationlist(params);
|
||||||
|
}
|
||||||
|
function handleChange3(record) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDetail(record) {
|
||||||
|
registerModal.value.cqDetail(record)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getThermalcompany();
|
||||||
|
getHeatsource();
|
||||||
|
getHeatsourcestation();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-cust {
|
||||||
|
width: calc(50% - 15px);
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-split-cust {
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-title) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.jeecg-basic-table-form-container) {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-form-item) {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue