From a6e3db4d8b74665db76f9dce88c060cec2d55f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Fri, 31 Oct 2025 17:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/axios/index.ts | 8 +- src/views/dashboard/Analysis/index.vue | 18 +- .../history/HeatanalysisHistory.data.ts | 4 +- .../history/HeatanalysisHistoryList.vue | 71 +++---- .../history/HeatanalysisHistoryListJx.vue | 71 +++---- src/views/heating/yunwei/Heatanalysis.api.ts | 7 +- src/views/heating/yunwei/Heatanalysis.data.ts | 4 +- src/views/heating/yunwei/index.vue | 8 +- src/views/screen/Dashboard.vue | 178 +++++++++--------- src/views/staticList/GlfghsjxListHistory.vue | 5 +- src/views/staticList/GlfrlljxListHistory.vue | 6 +- 11 files changed, 202 insertions(+), 178 deletions(-) diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 2052948..e56b680 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -113,7 +113,7 @@ const transform: AxiosTransform = { config.url = `${apiUrl}${config.url}`; } //update-end---author:scott ---date::2024-02-20 for:以http开头的请求url,不拼加前缀-- - + const params = config.params || {}; const data = config.data || false; formatDate && data && !isString(data) && formatRequestDate(data); @@ -165,7 +165,7 @@ const transform: AxiosTransform = { // 请求之前处理config const token = getToken(); let tenantId: string | number = getTenantId(); - + //update-begin---author:wangshuai---date:2024-04-16---for:【QQYUN-9005】发送短信加签。解决没有token无法加签--- // 将签名和时间戳,添加在请求接口 Header config.headers[ConfigEnum.TIMESTAMP] = signMd5Utils.getTimestamp(); @@ -182,7 +182,7 @@ const transform: AxiosTransform = { // jwt token config.headers.Authorization = options.authenticationScheme ? `${options.authenticationScheme} ${token}` : token; config.headers[ConfigEnum.TOKEN] = token; - + // 将签名和时间戳,添加在请求接口 Header //config.headers[ConfigEnum.TIMESTAMP] = signMd5Utils.getTimestamp(); //config.headers[ConfigEnum.Sign] = signMd5Utils.getSign(config.url, config.params); @@ -276,7 +276,7 @@ function createAxios(opt?: Partial) { // authenticationScheme: 'Bearer', authenticationScheme: '', //接口超时设置 - timeout: 10 * 1000, + timeout: 60 * 1000, // 基础接口地址 // baseURL: globSetting.apiUrl, headers: { 'Content-Type': ContentTypeEnum.JSON }, diff --git a/src/views/dashboard/Analysis/index.vue b/src/views/dashboard/Analysis/index.vue index 007162e..3624b84 100644 --- a/src/views/dashboard/Analysis/index.vue +++ b/src/views/dashboard/Analysis/index.vue @@ -33,13 +33,13 @@ -
乡镇瞬时热量【实时】
+
乡镇累积热量【GJ】
-
乡镇瞬时流量【实时】
+
乡镇累积流量【m³】
@@ -95,7 +95,7 @@ function sortByTime(arr: any[]) { } function splitByRegion(data: any[]) { const city = data.filter(d => String(d.regionType).includes('城区')); - const county = data.filter(d => String(d.regionType).includes('乡镇')); + let county = data.filter(d => String(d.regionType).includes('乡镇')); return { city: sortByTime(city), county: sortByTime(county) }; } function buildXAxis(records: any[], key = 'view028') { @@ -142,25 +142,25 @@ function prepareOptions(records: any[]) { color: ['#D64545', '#12A0A6'] }; - const powerY = county.map((r: any) => safeNum(r.view041)); + const powerY = county.map((r: any) => safeNum(r.view044)); countyPowerOption = { title: { text: '', left: 'center', top: 8 }, tooltip: { trigger: 'axis' }, grid: { left: '6%', right: '6%', bottom: 60, top: 50, containLabel: true }, xAxis: { type: 'category', data: countyX, axisLabel: { rotate: 20 } }, - yAxis: { type: 'value', name: '瞬时热量' }, - series: [{ name: '瞬时热量', type: 'line', data: powerY, smooth: false, areaStyle: {}, showSymbol: false, lineStyle: { type: 'solid' } }], + yAxis: { type: 'value', name: '累积热量' }, + series: [{ name: '累积热量', type: 'line', data: powerY, smooth: false, areaStyle: {}, showSymbol: false, lineStyle: { type: 'solid' } }], color: ['#E89B3B'] }; - const flowY = county.map((r: any) => safeNum(r.view037)); + const flowY = county.map((r: any) => safeNum(r.view040)); countyFlowOption = { title: { text: '', left: 'center', top: 8 }, tooltip: { trigger: 'axis' }, grid: { left: '6%', right: '6%', bottom: 60, top: 50, containLabel: true }, xAxis: { type: 'category', data: countyX, axisLabel: { rotate: 20 } }, - yAxis: { type: 'value', name: '瞬时流量' }, - series: [{ name: '瞬时流量', type: 'line', data: flowY, smooth: false, showSymbol: false, lineStyle: { type: 'solid' } }], + yAxis: { type: 'value', name: '累积流量' }, + series: [{ name: '累积流量', type: 'line', data: flowY, smooth: false, showSymbol: false, lineStyle: { type: 'solid' } }], color: ['#7C55FF'] }; } diff --git a/src/views/heating/history/HeatanalysisHistory.data.ts b/src/views/heating/history/HeatanalysisHistory.data.ts index 0d6dc1c..9832acc 100644 --- a/src/views/heating/history/HeatanalysisHistory.data.ts +++ b/src/views/heating/history/HeatanalysisHistory.data.ts @@ -127,13 +127,13 @@ export const jxcolumns: BasicColumn[] = [ title: '供水温度', align: "center", width: 90, - dataIndex: 'view005', + dataIndex: 'view035', }, { title: '回水温度', align: "center", width: 90, - dataIndex: 'view006' + dataIndex: 'view036' }, { title: '供水压力', diff --git a/src/views/heating/history/HeatanalysisHistoryList.vue b/src/views/heating/history/HeatanalysisHistoryList.vue index 520dca3..c3793af 100644 --- a/src/views/heating/history/HeatanalysisHistoryList.vue +++ b/src/views/heating/history/HeatanalysisHistoryList.vue @@ -46,13 +46,13 @@ - - @@ -77,6 +77,7 @@ import { heatsourcestationlist, page } from './HeatanalysisHistory.api'; +import dayjs from "dayjs"; const queryParam = ref({}); const toggleSearchStatus = ref(false); @@ -92,6 +93,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ clickToRowSelect: false, showActionColumn: false, showIndexColumn: false, + immediate: false, tableSetting: { // 是否显示刷新按钮 redo: false, @@ -136,23 +138,26 @@ function searchQuery() { /** * 重置 */ -function searchReset() { +async function searchReset() { queryParam.value = {}; selectedRowKeys.value = []; - getHeatsource(); - getHeatsourcestation(); + await getHeatsource(); + await getHeatsourcestation(); + let list = thermalcompany.value; + queryParam.value.view001 = list[0].id; + queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss'); //刷新数据 reload(); } const thermalcompany = ref(); async function getThermalcompany() { - thermalcompany.value = await companylist(); + thermalcompany.value = await companylist({regionType: '城区'}); } const heatsource = ref(); async function getHeatsource() { - heatsource.value = await heatsourcelist(); + heatsource.value = await heatsourcelist({regionType: '城区'}); } const heatsourcestation = ref(); @@ -175,57 +180,59 @@ function handleChange3(record) { // 禁用开始日期的规则 function startDisabledDate(current) { // 结束日期未选时不做限制 - if (!queryParam.value.EDate) return false; - return !current.isSame(queryParam.value.EDate, 'month') || - current.isAfter(queryParam.value.EDate, 'day'); + if (!queryParam.value.EDateStr) return false; + return !current.isSame(queryParam.value.EDateStr, 'month') || + current.isAfter(queryParam.value.EDateStr, 'day'); } // 禁用结束日期的规则 function endDisabledDate(current) { // 开始日期未选时禁用所有 - if (!queryParam.value.SDate) return true; - return !current.isSame(queryParam.value.SDate, 'month') || - current.isBefore(queryParam.value.SDate, 'day'); + if (!queryParam.value.SDateStr) return true; + return !current.isSame(queryParam.value.SDateStr, 'month') || + current.isBefore(queryParam.value.SDateStr, 'day'); } // 开始日期变化时处理 function handleStartChange(momentObj) { - if (momentObj && queryParam.value.EDate && - !momentObj.isSame(queryParam.value.EDate, 'month')) { - queryParam.value.EDate = null; + if (momentObj && queryParam.value.EDateStr && + !momentObj.isSame(queryParam.value.EDateStr, 'month')) { + queryParam.value.EDateStr = null; } } // 结束日期变化时处理 function handleEndChange(momentObj) { - if (momentObj && queryParam.value.SDate && - !momentObj.isSame(queryParam.value.SDate, 'month')) { - queryParam.value.SDate = null; + if (momentObj && queryParam.value.SDateStr && + !momentObj.isSame(queryParam.value.SDateStr, 'month')) { + queryParam.value.SDateStr = null; } } -onMounted(() => { - getThermalcompany(); - getHeatsource(); - getHeatsourcestation(); - +onMounted(async() => { + await getThermalcompany(); + await getHeatsource(); + await getHeatsourcestation(); + let list = thermalcompany.value; + queryParam.value.view001 = list[0].id; + queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss'); watch( - () => queryParam.value.SDate, + () => queryParam.value.SDateStr, async (newVal) => { - if (newVal && queryParam.value.EDate && - (!newVal.isSame(queryParam.value.EDate, 'month') || newVal > queryParam.value.EDate)) { - queryParam.value.EDate = null; + if (newVal && queryParam.value.EDateStr && + (!newVal.isSame(queryParam.value.EDateStr, 'month') || newVal > queryParam.value.EDateStr)) { + queryParam.value.EDateStr = null; } }, { deep: true, immediate: true } ); // 更新 父部门 选项 watch( - () => queryParam.value.EDate, + () => queryParam.value.EDateStr, async (newVal) => { - if (newVal && queryParam.value.SDate && - (!newVal.isSame(queryParam.value.SDate, 'month') || newVal < queryParam.value.SDate)) { - queryParam.value.SDate = null; + if (newVal && queryParam.value.SDateStr && + (!newVal.isSame(queryParam.value.SDateStr, 'month') || newVal < queryParam.value.SDateStr)) { + queryParam.value.SDateStr = null; } }, { deep: true, immediate: true } diff --git a/src/views/heating/history/HeatanalysisHistoryListJx.vue b/src/views/heating/history/HeatanalysisHistoryListJx.vue index 14e5aaa..186072e 100644 --- a/src/views/heating/history/HeatanalysisHistoryListJx.vue +++ b/src/views/heating/history/HeatanalysisHistoryListJx.vue @@ -46,13 +46,13 @@ - - @@ -76,6 +76,7 @@ import { heatsourcestationlist, jxpage } from './HeatanalysisHistory.api'; +import dayjs from 'dayjs'; const queryParam = ref({}); const toggleSearchStatus = ref(false); @@ -91,6 +92,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ clickToRowSelect: false, showActionColumn: false, showIndexColumn: false, + immediate: false, tableSetting: { // 是否显示刷新按钮 redo: false, @@ -135,23 +137,26 @@ function searchQuery() { /** * 重置 */ -function searchReset() { +async function searchReset() { queryParam.value = {}; selectedRowKeys.value = []; - getHeatsource(); - getHeatsourcestation(); + await getHeatsource(); + await getHeatsourcestation(); + let list = thermalcompany.value; + queryParam.value.view001 = list[0].id; + queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss'); //刷新数据 reload(); } const thermalcompany = ref(); async function getThermalcompany() { - thermalcompany.value = await companylist(); + thermalcompany.value = await companylist({regionType: '乡镇'}); } const heatsource = ref(); async function getHeatsource() { - heatsource.value = await heatsourcelist(); + heatsource.value = await heatsourcelist({regionType: '乡镇'}); } const heatsourcestation = ref(); @@ -174,57 +179,59 @@ function handleChange3(record) { // 禁用开始日期的规则 function startDisabledDate(current) { // 结束日期未选时不做限制 - if (!queryParam.value.EDate) return false; - return !current.isSame(queryParam.value.EDate, 'month') || - current.isAfter(queryParam.value.EDate, 'day'); + if (!queryParam.value.EDateStr) return false; + return !current.isSame(queryParam.value.EDateStr, 'month') || + current.isAfter(queryParam.value.EDateStr, 'day'); } // 禁用结束日期的规则 function endDisabledDate(current) { // 开始日期未选时禁用所有 - if (!queryParam.value.SDate) return true; - return !current.isSame(queryParam.value.SDate, 'month') || - current.isBefore(queryParam.value.SDate, 'day'); + if (!queryParam.value.SDateStr) return true; + return !current.isSame(queryParam.value.SDateStr, 'month') || + current.isBefore(queryParam.value.SDateStr, 'day'); } // 开始日期变化时处理 function handleStartChange(momentObj) { - if (momentObj && queryParam.value.EDate && - !momentObj.isSame(queryParam.value.EDate, 'month')) { - queryParam.value.EDate = null; + if (momentObj && queryParam.value.EDateStr && + !momentObj.isSame(queryParam.value.EDateStr, 'month')) { + queryParam.value.EDateStr = null; } } // 结束日期变化时处理 function handleEndChange(momentObj) { - if (momentObj && queryParam.value.SDate && - !momentObj.isSame(queryParam.value.SDate, 'month')) { - queryParam.value.SDate = null; + if (momentObj && queryParam.value.SDateStr && + !momentObj.isSame(queryParam.value.SDateStr, 'month')) { + queryParam.value.SDateStr = null; } } -onMounted(() => { - getThermalcompany(); - getHeatsource(); - getHeatsourcestation(); - +onMounted(async() => { + await getThermalcompany(); + await getHeatsource(); + await getHeatsourcestation(); + let list = thermalcompany.value; + queryParam.value.view001 = list[0].id; + queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss'); watch( - () => queryParam.value.SDate, + () => queryParam.value.SDateStr, async (newVal) => { - if (newVal && queryParam.value.EDate && - (!newVal.isSame(queryParam.value.EDate, 'month') || newVal > queryParam.value.EDate)) { - queryParam.value.EDate = null; + if (newVal && queryParam.value.EDateStr && + (!newVal.isSame(queryParam.value.EDateStr, 'month') || newVal > queryParam.value.EDateStr)) { + queryParam.value.EDateStr = null; } }, { deep: true, immediate: true } ); // 更新 父部门 选项 watch( - () => queryParam.value.EDate, + () => queryParam.value.EDateStr, async (newVal) => { - if (newVal && queryParam.value.SDate && - (!newVal.isSame(queryParam.value.SDate, 'month') || newVal < queryParam.value.SDate)) { - queryParam.value.SDate = null; + if (newVal && queryParam.value.SDateStr && + (!newVal.isSame(queryParam.value.SDateStr, 'month') || newVal < queryParam.value.SDateStr)) { + queryParam.value.SDateStr = null; } }, { deep: true, immediate: true } diff --git a/src/views/heating/yunwei/Heatanalysis.api.ts b/src/views/heating/yunwei/Heatanalysis.api.ts index 7f1b86f..b7b5d24 100644 --- a/src/views/heating/yunwei/Heatanalysis.api.ts +++ b/src/views/heating/yunwei/Heatanalysis.api.ts @@ -9,8 +9,13 @@ enum Api { companylist = '/heating/thermalcompany/list', heatsourcelist = '/heating/heatsource/list', heatsourcestationlist = '/heating/heatsourcestation/list', + exportXls = '/heating/heatanalysis/exportYunweiXls', } - +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; /** * 列表接口 * @param params diff --git a/src/views/heating/yunwei/Heatanalysis.data.ts b/src/views/heating/yunwei/Heatanalysis.data.ts index 902f801..10bfe38 100644 --- a/src/views/heating/yunwei/Heatanalysis.data.ts +++ b/src/views/heating/yunwei/Heatanalysis.data.ts @@ -122,13 +122,13 @@ export const columns: BasicColumn[] = [ title: '热量', align:"center", width:120, - dataIndex: 'view041', + dataIndex: 'view044', }, { title: '水流量', align:"center", width:120, - dataIndex: 'view037' + dataIndex: 'view040' }, ]; diff --git a/src/views/heating/yunwei/index.vue b/src/views/heating/yunwei/index.vue index cb6b74a..d27a29c 100644 --- a/src/views/heating/yunwei/index.vue +++ b/src/views/heating/yunwei/index.vue @@ -58,6 +58,7 @@ 查询 重置 + 导出 @@ -102,7 +103,7 @@ 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 { list, companylist, heatsourcelist, heatsourcestationlist, getExportUrl } from './Heatanalysis.api'; import HeatanalysisReamrksListModal from './components/HeatanalysisReamrksListModal.vue' import ChangeLevelModal from './components/ChangeLevelModal.vue' @@ -139,6 +140,10 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ return Object.assign(params, queryParam.value); }, }, + exportConfig: { + name: '运维数据列表', + url: getExportUrl, + }, }); const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext; const labelCol = reactive({ @@ -244,7 +249,6 @@ onMounted(() => { getHeatsourcestation(); }); -