修改兼容性

master
suixy 3 months ago
parent 993785ba89
commit 4ed24230d0

@ -60,9 +60,10 @@
"swiper": "^11.2.8", "swiper": "^11.2.8",
"uuid": "^11.0.5", "uuid": "^11.0.5",
"vform3-builds": "^3.0.10", "vform3-builds": "^3.0.10",
"vue": "3.4.34", "vue": "3.5.21",
"vue-barcode": "^1.3.0", "vue-barcode": "^1.3.0",
"vue-cropper": "1.1.1", "vue-cropper": "1.1.1",
"vue-datepicker-next": "1.0.3",
"vue-draggable-resizable": "^3.0.0", "vue-draggable-resizable": "^3.0.0",
"vue-i18n": "9.10.2", "vue-i18n": "9.10.2",
"vue-json-pretty": "2.4.0", "vue-json-pretty": "2.4.0",

@ -50,9 +50,9 @@ import { countTaskWaitByCurrentUser } from '@/api/workflow/task';
const badge = ref(0); const badge = ref(0);
const getBadge = () => { const getBadge = () => {
if (onlyOneChild.value.meta?.title === '我的待办' || props.item?.meta?.title === '我的任务') { if (onlyOneChild.value.meta?.title === '我的待办' || props.item?.meta?.title === '我的任务') {
countTaskWaitByCurrentUser().then(e => { // countTaskWaitByCurrentUser().then(e => {
badge.value = e.data; // badge.value = e.data;
}); // });
} }
}; };
onMounted(() => { onMounted(() => {

@ -0,0 +1,63 @@
export function getHoursBetween(startHourStr, endHourStr) {
const startHour = new Date(startHourStr)
let endHour = new Date(endHourStr)
let nowDate = new Date()
nowDate.setHours(nowDate.getHours() - 1);
if (endHour.getTime() > nowDate.getTime()) {
endHour = nowDate
}
const hours = []
while (startHour <= endHour) {
const hourString = `${startHour.getFullYear()}-${String(startHour.getMonth() + 1).padStart(2, '0')}-${String(startHour.getDate()).padStart(2, '0')} ${String(startHour.getHours()).padStart(2, '0')}:00:00`
hours.push(hourString)
startHour.setTime(startHour.getTime() + 60 * 60 * 1000)
}
// return hours;
return hours.sort((a, b) => new Date(b) - new Date(a))
}
export function getDatesBetween(startDateStr, endDateStr) {
const startDate = new Date(startDateStr)
let endDate = new Date(endDateStr)
let nowDate = new Date()
nowDate.setHours(nowDate.getHours() - 1);
if (endDate.getTime() > nowDate.getTime()) {
endDate = nowDate
}
const dates = []
while (startDate <= endDate) {
dates.push(`${startDate.getFullYear()}-${String(startDate.getMonth() + 1).padStart(2, '0')}-${String(startDate.getDate()).padStart(2, '0')}`)
startDate.setDate(startDate.getDate() + 1)
}
// return dates;
return dates.sort((a, b) => new Date(b) - new Date(a))
}
export function getMonthsBetween(startMonthStr, endMonthStr) {
const result = []
const startDate = new Date(startMonthStr + '-01')
let endDate = new Date(endMonthStr + '-01')
const currentDate = new Date(startDate)
let nowDate = new Date()
nowDate.setHours(nowDate.getHours() - 1);
if (endDate.getTime() > nowDate.getTime()) {
endDate = nowDate
}
while (currentDate <= endDate) {
const year = currentDate.getFullYear()
const month = String(currentDate.getMonth() + 1).padStart(2, '0')
result.push(`${year}-${month}`)
currentDate.setMonth(currentDate.getMonth() + 1)
}
return result.sort((a, b) => new Date(b) - new Date(a))
}
export function getYearsBetween(startYearStr, endYearStr) {
const result = []
const startYear = Number(startYearStr.substring(0, 4))
const endYear = Number(endYearStr.substring(0, 4))
for (let i = startYear; i <= endYear; i++) {
result.push(`${i}`)
}
return result.sort((a, b) => new Date(b) - new Date(a))
}

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入统计单元名称" placeholder="请输入统计单元名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -100,7 +100,7 @@
type="primary" type="primary"
plain plain
icon="Plus" icon="Plus"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['ems/base:baseMonitorWorkUnit:add']" v-hasPermi="['ems/base:baseMonitorWorkUnit:add']"
>新增 >新增
@ -111,7 +111,7 @@
type="success" type="success"
plain plain
icon="Edit" icon="Edit"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ems/base:baseMonitorWorkUnit:edit']" v-hasPermi="['ems/base:baseMonitorWorkUnit:edit']"
@ -123,7 +123,7 @@
type="danger" type="danger"
plain plain
icon="Delete" icon="Delete"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ems/base:baseMonitorWorkUnit:remove']" v-hasPermi="['ems/base:baseMonitorWorkUnit:remove']"
@ -135,7 +135,7 @@
type="warning" type="warning"
plain plain
icon="Download" icon="Download"
@click="handleExport" @click="handleExport"
v-hasPermi="['ems/base:baseMonitorWorkUnit:export']" v-hasPermi="['ems/base:baseMonitorWorkUnit:export']"
>导出 >导出
@ -188,7 +188,7 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
icon="Edit" icon="Edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
@ -196,7 +196,7 @@
>修改 >修改
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
icon="Delete" icon="Delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
@ -280,8 +280,8 @@ import {
addBaseMonitorWorkUnit, addBaseMonitorWorkUnit,
updateBaseMonitorWorkUnit updateBaseMonitorWorkUnit
} from '@/api/ems/base/baseMonitorWorkUnit' } from '@/api/ems/base/baseMonitorWorkUnit'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit' import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit'

@ -280,8 +280,8 @@ import {
addBaseMonitorWorkUnit, addBaseMonitorWorkUnit,
updateBaseMonitorWorkUnit updateBaseMonitorWorkUnit
} from '@/api/ems/base/baseMonitorWorkUnit' } from '@/api/ems/base/baseMonitorWorkUnit'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit' import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit'

@ -39,7 +39,7 @@
type="primary" type="primary"
plain plain
icon="Plus" icon="Plus"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['ems/base:baseWorkUnit:add']" v-hasPermi="['ems/base:baseWorkUnit:add']"
>新增 >新增
@ -50,7 +50,7 @@
type="info" type="info"
plain plain
icon="Sort" icon="Sort"
@click="toggleExpandAll" @click="toggleExpandAll"
>展开/折叠 >展开/折叠
</el-button> </el-button>
@ -94,7 +94,7 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
icon="Edit" icon="Edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
@ -102,7 +102,7 @@
>修改 >修改
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
icon="Plus" icon="Plus"
@click="handleAdd(scope.row)" @click="handleAdd(scope.row)"
@ -110,7 +110,7 @@
>新增 >新增
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
icon="Delete" icon="Delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
@ -168,8 +168,8 @@ import {
addBaseWorkUnit, addBaseWorkUnit,
updateBaseWorkUnit updateBaseWorkUnit
} from '@/api/ems/base/baseWorkUnit' } from '@/api/ems/base/baseWorkUnit'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
export default { export default {
name: 'BaseWorkUnit', name: 'BaseWorkUnit',

@ -168,8 +168,8 @@ import {
addBaseWorkUnit, addBaseWorkUnit,
updateBaseWorkUnit updateBaseWorkUnit
} from '@/api/ems/base/baseWorkUnit' } from '@/api/ems/base/baseWorkUnit'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
export default { export default {
name: 'BaseWorkUnit', name: 'BaseWorkUnit',

@ -272,8 +272,8 @@ import {
updateRecordDnbInstant updateRecordDnbInstant
} from '@/api/ems/record/recordDnbInstant' } from '@/api/ems/record/recordDnbInstant'
import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
export default { export default {

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入计量设备名称" placeholder="请输入计量设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -74,7 +74,7 @@
type="primary" type="primary"
plain plain
icon="Plus" icon="Plus"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['ems/record:recordSteamInstant:add']" v-hasPermi="['ems/record:recordSteamInstant:add']"
>新增 >新增
@ -85,7 +85,7 @@
type="success" type="success"
plain plain
icon="Edit" icon="Edit"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ems/record:recordSteamInstant:edit']" v-hasPermi="['ems/record:recordSteamInstant:edit']"
@ -97,7 +97,7 @@
type="danger" type="danger"
plain plain
icon="Delete" icon="Delete"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ems/record:recordSteamInstant:remove']" v-hasPermi="['ems/record:recordSteamInstant:remove']"
@ -109,7 +109,7 @@
type="warning" type="warning"
plain plain
icon="Download" icon="Download"
@click="handleExport" @click="handleExport"
v-hasPermi="['ems/record:recordSteamInstant:export']" v-hasPermi="['ems/record:recordSteamInstant:export']"
>导出 >导出
@ -244,8 +244,8 @@ import {
updateRecordSteamInstant, latestSteamInstantList updateRecordSteamInstant, latestSteamInstantList
} from '@/api/ems/record/recordSteamInstant' } from '@/api/ems/record/recordSteamInstant'
import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
export default { export default {

@ -244,8 +244,8 @@ import {
updateRecordSteamInstant, latestSteamInstantList updateRecordSteamInstant, latestSteamInstantList
} from '@/api/ems/record/recordSteamInstant' } from '@/api/ems/record/recordSteamInstant'
import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
export default { export default {

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入计量设备名称" placeholder="请输入计量设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -97,7 +97,7 @@
type="primary" type="primary"
plain plain
icon="Plus" icon="Plus"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['ems/record:recordSteamInstant:add']" v-hasPermi="['ems/record:recordSteamInstant:add']"
>新增 >新增
@ -108,7 +108,7 @@
type="success" type="success"
plain plain
icon="Edit" icon="Edit"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ems/record:recordSteamInstant:edit']" v-hasPermi="['ems/record:recordSteamInstant:edit']"
@ -120,7 +120,7 @@
type="danger" type="danger"
plain plain
icon="Delete" icon="Delete"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ems/record:recordSteamInstant:remove']" v-hasPermi="['ems/record:recordSteamInstant:remove']"
@ -132,7 +132,7 @@
type="warning" type="warning"
plain plain
icon="Download" icon="Download"
@click="handleExport" @click="handleExport"
v-hasPermi="['ems/record:recordSteamInstant:export']" v-hasPermi="['ems/record:recordSteamInstant:export']"
>导出 >导出
@ -269,12 +269,11 @@ import {
updateRecordSteamInstant, getExpendSum updateRecordSteamInstant, getExpendSum
} from '@/api/ems/record/recordSteamInstant' } from '@/api/ems/record/recordSteamInstant'
import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import DatePicker from 'vue2-datepicker'; import DatePicker from 'vue-datepicker-next';
import 'vue2-datepicker/index.css'; import 'vue-datepicker-next/index.css';
import 'vue2-datepicker/locale/zh-cn';
export default { export default {
name: 'RecordSteamInstant', name: 'RecordSteamInstant',

@ -269,8 +269,8 @@ import {
updateRecordSteamInstant, getExpendSum updateRecordSteamInstant, getExpendSum
} from '@/api/ems/record/recordSteamInstant' } from '@/api/ems/record/recordSteamInstant'
import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import DatePicker from 'vue2-datepicker'; import DatePicker from 'vue2-datepicker';
import 'vue2-datepicker/index.css'; import 'vue2-datepicker/index.css';

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入计量设备名称" placeholder="请输入计量设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -75,7 +75,7 @@
type="primary" type="primary"
plain plain
icon="Plus" icon="Plus"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['ems/record:recordWaterInstant:add']" v-hasPermi="['ems/record:recordWaterInstant:add']"
>新增 >新增
@ -86,7 +86,7 @@
type="success" type="success"
plain plain
icon="Edit" icon="Edit"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ems/record:recordWaterInstant:edit']" v-hasPermi="['ems/record:recordWaterInstant:edit']"
@ -98,7 +98,7 @@
type="danger" type="danger"
plain plain
icon="Delete" icon="Delete"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ems/record:recordWaterInstant:remove']" v-hasPermi="['ems/record:recordWaterInstant:remove']"
@ -110,7 +110,7 @@
type="warning" type="warning"
plain plain
icon="Download" icon="Download"
@click="handleExport" @click="handleExport"
v-hasPermi="['ems/record:recordWaterInstant:export']" v-hasPermi="['ems/record:recordWaterInstant:export']"
>导出 >导出
@ -231,8 +231,8 @@ import {
updateRecordWaterInstant updateRecordWaterInstant
} from '@/api/ems/record/recordWaterInstant' } from '@/api/ems/record/recordWaterInstant'
import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
export default { export default {

@ -231,8 +231,8 @@ import {
updateRecordWaterInstant updateRecordWaterInstant
} from '@/api/ems/record/recordWaterInstant' } from '@/api/ems/record/recordWaterInstant'
import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree, listBaseMonitorInfo } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
export default { export default {

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入物联网设备名称" placeholder="请输入物联网设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -75,7 +75,7 @@ import {
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'; import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo';
import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring'; import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import Chart from '@/components/Charts/Chart'; import Chart from '@/components/chart.vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import type { ElTree } from 'element-plus'; import type { ElTree } from 'element-plus';

@ -73,8 +73,8 @@ import {
} from '@/api/ems/record/recordIOTInstant' } from '@/api/ems/record/recordIOTInstant'
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring' import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入物联网设备名称" placeholder="请输入物联网设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -74,7 +74,7 @@ import { ref, reactive, watch, onMounted, getCurrentInstance } from 'vue';
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'; import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo';
import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring'; import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import Chart from '@/components/Charts/Chart'; import Chart from '@/components/chart.vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import type { ElTree } from 'element-plus'; import type { ElTree } from 'element-plus';

@ -76,8 +76,8 @@ import {
} from '@/api/ems/record/recordIOTInstant' } from '@/api/ems/record/recordIOTInstant'
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring' import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入物联网设备名称" placeholder="请输入物联网设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -74,7 +74,7 @@ import { ref, reactive, watch, onMounted, getCurrentInstance } from 'vue';
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'; import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo';
import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring'; import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import Chart from '@/components/Charts/Chart'; import Chart from '@/components/chart.vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import type { ElTree } from 'element-plus'; import type { ElTree } from 'element-plus';

@ -76,8 +76,8 @@ import {
} from '@/api/ems/record/recordIOTInstant' } from '@/api/ems/record/recordIOTInstant'
import {getMonitorInfoTree} from '@/api/ems/base/baseMonitorInfo' import {getMonitorInfoTree} from '@/api/ems/base/baseMonitorInfo'
import {iotInstantMonitoring} from '@/api/ems/report/TemperatureHumidityMonitoring' import {iotInstantMonitoring} from '@/api/ems/report/TemperatureHumidityMonitoring'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import {parseTime} from '@/utils/ruoyi' import {parseTime} from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -76,8 +76,8 @@ import {
} from '@/api/ems/record/recordIOTInstant' } from '@/api/ems/record/recordIOTInstant'
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring' import { iotInstantMonitoring } from '@/api/ems/report/TemperatureHumidityMonitoring'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入物联网设备名称" placeholder="请输入物联网设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -69,7 +69,7 @@ import { ref, reactive, watch, onMounted, getCurrentInstance, ComponentInternalI
import { iotInstantList } from '@/api/ems/record/recordIOTInstant'; import { iotInstantList } from '@/api/ems/record/recordIOTInstant';
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'; import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import Chart from '@/components/Charts/Chart'; import Chart from '@/components/chart.vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

@ -70,8 +70,8 @@ import {
getRecordIOTInstant, iotInstantList getRecordIOTInstant, iotInstantList
} from '@/api/ems/record/recordIOTInstant' } from '@/api/ems/record/recordIOTInstant'
import {getMonitorInfoTree} from '@/api/ems/base/baseMonitorInfo' import {getMonitorInfoTree} from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import {parseTime} from '@/utils/ruoyi' import {parseTime} from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -26,7 +26,7 @@
/> />
</div> </div>
</el-col> </el-col>
<el-col :span="19" :xs="24"> <el-col :span="19" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="100px" label-width="100px"
@ -51,7 +51,7 @@
style="width: 340px" style="width: 340px"
></date-picker> ></date-picker>
</el-form-item> </el-form-item>
<!-- <el-form-item label="采集日期范围"> <!-- <el-form-item label="采集日期范围">
<el-date-picker <el-date-picker
v-model="daterangeCollectTime" v-model="daterangeCollectTime"
@ -74,7 +74,7 @@
end-placeholder="结束时间" end-placeholder="结束时间"
></el-time-picker> ></el-time-picker>
</el-form-item>--> </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -87,9 +87,9 @@
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -98,10 +98,9 @@
import * as echarts from 'echarts' import * as echarts from 'echarts'
import {pointSteamInstantList} from "@/api/ems/report/reportPointSteam"; import {pointSteamInstantList} from "@/api/ems/report/reportPointSteam";
import {listRecordSteamInstant, steamInstantAvg, steamInstantList} from "@/api/ems/record/recordSteamInstant"; import {listRecordSteamInstant, steamInstantAvg, steamInstantList} from "@/api/ems/record/recordSteamInstant";
import DatePicker from 'vue2-datepicker'; import DatePicker from 'vue-datepicker-next';
import 'vue2-datepicker/index.css'; import 'vue-datepicker-next/index.css';
import 'vue2-datepicker/locale/zh-cn';
export default { export default {
name: 'currentSteamCurve', name: 'currentSteamCurve',
dicts: ['collect_type'], dicts: ['collect_type'],
@ -198,24 +197,24 @@
} }
}, },
created() { created() {
const nowDate = new Date(); const nowDate = new Date();
const today = parseTime(new Date(), '{y}-{m}-{d}') const today = parseTime(new Date(), '{y}-{m}-{d}')
const lastDate = new Date(); const lastDate = new Date();
lastDate.setDate(nowDate.getDate() - 1) lastDate.setDate(nowDate.getDate() - 1)
const yesterday = parseTime(lastDate, '{y}-{m}-{d}') const yesterday = parseTime(lastDate, '{y}-{m}-{d}')
console.log(today,yesterday) console.log(today,yesterday)
this.daterangeRecordTime[0] = yesterday+ ' 08:00:00' this.daterangeRecordTime[0] = yesterday+ ' 08:00:00'
this.daterangeRecordTime[1] = today + ' 08:00:00' this.daterangeRecordTime[1] = today + ' 08:00:00'
/* this.daterangeCollectTime[0] = parseTime(yesterday, '{y}-{m}-{d}') ; /* this.daterangeCollectTime[0] = parseTime(yesterday, '{y}-{m}-{d}') ;
this.daterangeCollectTime[1] = parseTime(today, '{y}-{m}-{d}') ; this.daterangeCollectTime[1] = parseTime(today, '{y}-{m}-{d}') ;
//8 //8
this.timerangeRecordTime[0] = '08:00:00'; this.timerangeRecordTime[0] = '08:00:00';
this.timerangeRecordTime[1] = '08:00:00';*/ this.timerangeRecordTime[1] = '08:00:00';*/
this.getTreeselect() this.getTreeselect()
this.getTreeMonitorInfo() this.getTreeMonitorInfo()
this.getList() this.getList()
@ -250,16 +249,16 @@
this.queryParams.params['beginRecordTime'] =this.daterangeRecordTime[0]; this.queryParams.params['beginRecordTime'] =this.daterangeRecordTime[0];
this.queryParams.params['endRecordTime'] =this.daterangeRecordTime[1]; this.queryParams.params['endRecordTime'] =this.daterangeRecordTime[1];
} }
this.getChart() this.getChart()
}, },
// //
cancel() { cancel() {
this.open = false this.open = false
this.reset() this.reset()
}, },
// //
reset() { reset() {
this.form = { this.form = {
@ -278,51 +277,51 @@
} }
this.resetForm('form') this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams.monitorCode = null this.queryParams.monitorCode = null
this.resetForm('queryForm') this.resetForm('queryForm')
this.handleQuery() this.handleQuery()
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('ems/record/recordSteamInstant/export', { this.download('ems/record/recordSteamInstant/export', {
...this.queryParams ...this.queryParams
}, `recordSteamInstant_${new Date().getTime()}.xlsx`) }, `recordSteamInstant_${new Date().getTime()}.xlsx`)
}, },
/** 查询计量设备信息下拉树结构 */ /** 查询计量设备信息下拉树结构 */
getTreeselect() { getTreeselect() {
getMonitorInfoTree({ monitorType: 4 }).then(response => { getMonitorInfoTree({ monitorType: 4 }).then(response => {
this.monitorInfoOptions = response.data this.monitorInfoOptions = response.data
}) })
}, },
/** 筛选节点 */ /** 筛选节点 */
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
/** 节点单击事件 */ /** 节点单击事件 */
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.monitorCode = data.code this.queryParams.monitorCode = data.code
this.selectMonitorName = data.label this.selectMonitorName = data.label
this.handleQuery() this.handleQuery()
}, },
/** 曲线 */ /** 曲线 */
async getChart() { async getChart() {
let query = JSON.parse(JSON.stringify(this.queryParams)) let query = JSON.parse(JSON.stringify(this.queryParams))
const {data} = await steamInstantList(query) const {data} = await steamInstantList(query)
let option1 = { let option1 = {
title: { title: {
text: this.selectMonitorName + ' 瞬时流量' + ' (平均值:'+ text: this.selectMonitorName + ' 瞬时流量' + ' (平均值:'+
@ -420,8 +419,8 @@
data.filter(e => e.temperature !== undefined && e.temperature !== null).length).toFixed(2) + ")", data.filter(e => e.temperature !== undefined && e.temperature !== null).length).toFixed(2) + ")",
x: 'center' x: 'center'
},*/ },*/
title: { title: {
text: this.selectMonitorName + ' 温度' + ' (平均值:'+ text: this.selectMonitorName + ' 温度' + ' (平均值:'+
((data.map(e=>parseFloat(e.temperature)).reduce((a,b)=>a+b,0))/data.length).toFixed(2)+")", ((data.map(e=>parseFloat(e.temperature)).reduce((a,b)=>a+b,0))/data.length).toFixed(2)+")",
@ -436,7 +435,7 @@
left: '10%', left: '10%',
right: '3%' right: '3%'
}, },
dataZoom: [{ dataZoom: [{
type: 'slider' type: 'slider'
}], }],
@ -596,19 +595,19 @@
}, },
] ]
} }
this.$refs.Chart1.setData(option1) this.$refs.Chart1.setData(option1)
this.$refs.Chart2.setData(option2) this.$refs.Chart2.setData(option2)
this.$refs.Chart3.setData(option3) this.$refs.Chart3.setData(option3)
echarts.connect(this.$refs.Chart1.chart, this.$refs.Chart2.chart, this.$refs.Chart3.chart) echarts.connect(this.$refs.Chart1.chart, this.$refs.Chart2.chart, this.$refs.Chart3.chart)
/* this.$refs.Chart1.chart.on('datazoom', (e) => { /* this.$refs.Chart1.chart.on('datazoom', (e) => {
option.dataZoom[0].start = e.start; option.dataZoom[0].start = e.start;
option.dataZoom[0].end = e.end; option.dataZoom[0].end = e.end;
this.$refs.Chart1.setData(option); this.$refs.Chart1.setData(option);
});*/ });*/
this.$refs.Chart1.chart.on('datazoom', (e) => { this.$refs.Chart1.chart.on('datazoom', (e) => {
option2.dataZoom[0].start = e.start option2.dataZoom[0].start = e.start
option2.dataZoom[0].end = e.end option2.dataZoom[0].end = e.end
@ -616,7 +615,7 @@
option3.dataZoom[0].start = e.start option3.dataZoom[0].start = e.start
option3.dataZoom[0].end = e.end option3.dataZoom[0].end = e.end
this.$refs.Chart3.setData(option3) this.$refs.Chart3.setData(option3)
}) })
this.$refs.Chart2.chart.on('datazoom', (e) => { this.$refs.Chart2.chart.on('datazoom', (e) => {
option1.dataZoom[0].start = e.start option1.dataZoom[0].start = e.start
@ -634,19 +633,19 @@
option1.dataZoom[0].end = e.end option1.dataZoom[0].end = e.end
this.$refs.Chart1.setData(option1) this.$refs.Chart1.setData(option1)
}) })
} }
} }
} }
</script> </script>
<style scoped > <style scoped >
.chart1 { .chart1 {
width: 50%; width: 50%;
height: 40vh; height: 40vh;
display: inline-block; display: inline-block;
} }
.chart2 { .chart2 {
width: 50%; width: 50%;
height: 40vh; height: 40vh;
@ -657,7 +656,7 @@
height: 40vh; height: 40vh;
display: inline-block; display: inline-block;
} }
/* 选中节点的样式 */ /* 选中节点的样式 */
/deep/ .el-tree .el-tree-node.is-current > .el-tree-node__content { /deep/ .el-tree .el-tree-node.is-current > .el-tree-node__content {
background-color: #67C23A !important; /* 选中节点的背景色 */ background-color: #67C23A !important; /* 选中节点的背景色 */
@ -666,11 +665,10 @@
margin: 0; /* 清除外边距 */ margin: 0; /* 清除外边距 */
z-index: 1; /* 确保在其他元素之上 */ z-index: 1; /* 确保在其他元素之上 */
} }
/* 鼠标悬停时的样式 */ /* 鼠标悬停时的样式 */
.el-tree .el-tree-node__content:hover { .el-tree .el-tree-node__content:hover {
background-color: #e6f7ff; /* 鼠标悬停时的背景色 */ background-color: #e6f7ff; /* 鼠标悬停时的背景色 */
} }
</style> </style>

@ -26,7 +26,7 @@
/> />
</div> </div>
</el-col> </el-col>
<el-col :span="19" :xs="24"> <el-col :span="19" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="100px" label-width="100px"
@ -43,13 +43,13 @@
style="width: 340px" style="width: 340px"
></date-picker> ></date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 图表联动提示 --> <!-- 图表联动提示 -->
<el-alert <el-alert
v-if="powerOutageSummary.count > 0" v-if="powerOutageSummary.count > 0"
@ -59,7 +59,7 @@
show-icon show-icon
style="margin-bottom: 10px" style="margin-bottom: 10px"
/> />
<!-- 停电统计信息 --> <!-- 停电统计信息 -->
<el-card v-if="powerOutageSummary.count > 0" class="power-outage-summary" shadow="hover"> <el-card v-if="powerOutageSummary.count > 0" class="power-outage-summary" shadow="hover">
<div slot="header"> <div slot="header">
@ -74,7 +74,7 @@
<p><strong>总停电时长:</strong> {{ powerOutageSummary.totalDuration }} 小时</p> <p><strong>总停电时长:</strong> {{ powerOutageSummary.totalDuration }} 小时</p>
</div> </div>
</el-card> </el-card>
<!-- 图表区域 --> <!-- 图表区域 -->
<div class="charts-container"> <div class="charts-container">
<Chart ref="Chart1" class="chart1"/> <Chart ref="Chart1" class="chart1"/>
@ -85,9 +85,9 @@
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -96,10 +96,9 @@
import * as echarts from 'echarts' import * as echarts from 'echarts'
import {pointSteamInstantList} from "@/api/ems/report/reportPointSteam"; import {pointSteamInstantList} from "@/api/ems/report/reportPointSteam";
import {listRecordSteamInstant, steamInstantAvg, steamInstantList} from "@/api/ems/record/recordSteamInstant"; import {listRecordSteamInstant, steamInstantAvg, steamInstantList} from "@/api/ems/record/recordSteamInstant";
import DatePicker from 'vue2-datepicker'; import DatePicker from 'vue-datepicker-next';
import 'vue2-datepicker/index.css'; import 'vue-datepicker-next/index.css';
import 'vue2-datepicker/locale/zh-cn';
export default { export default {
name: 'currentSteamCurve', name: 'currentSteamCurve',
dicts: ['collect_type'], dicts: ['collect_type'],
@ -213,11 +212,11 @@
const lastDate = new Date(); const lastDate = new Date();
lastDate.setDate(nowDate.getDate() - 1) lastDate.setDate(nowDate.getDate() - 1)
const yesterday = parseTime(lastDate, '{y}-{m}-{d}') const yesterday = parseTime(lastDate, '{y}-{m}-{d}')
console.log(today,yesterday) console.log(today,yesterday)
this.daterangeRecordTime[0] = yesterday+ ' 08:00:00' this.daterangeRecordTime[0] = yesterday+ ' 08:00:00'
this.daterangeRecordTime[1] = today + ' 08:00:00' this.daterangeRecordTime[1] = today + ' 08:00:00'
// //
this.initBaseChartOptions() this.initBaseChartOptions()
this.getTreeselect() this.getTreeselect()
@ -296,7 +295,7 @@
} }
} }
}, },
/** 转换计量设备信息数据结构 */ /** 转换计量设备信息数据结构 */
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
@ -308,7 +307,7 @@
children: node.children children: node.children
} }
}, },
/** 查询电实时数据列表 */ /** 查询电实时数据列表 */
getList() { getList() {
this.loading = true this.loading = true
@ -319,13 +318,13 @@
} }
this.getChart() this.getChart()
}, },
// //
cancel() { cancel() {
this.open = false this.open = false
this.reset() this.reset()
}, },
// //
reset() { reset() {
this.form = { this.form = {
@ -344,33 +343,33 @@
} }
this.resetForm('form') this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams.monitorCode = null this.queryParams.monitorCode = null
this.resetForm('queryForm') this.resetForm('queryForm')
this.handleQuery() this.handleQuery()
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('ems/record/recordSteamInstant/export', { this.download('ems/record/recordSteamInstant/export', {
...this.queryParams ...this.queryParams
}, `recordSteamInstant_${new Date().getTime()}.xlsx`) }, `recordSteamInstant_${new Date().getTime()}.xlsx`)
}, },
/** 导出停电数据 */ /** 导出停电数据 */
exportPowerOutageData() { exportPowerOutageData() {
if (this.powerOutageList.length === 0) { if (this.powerOutageList.length === 0) {
this.$message.warning('没有停电数据可导出'); this.$message.warning('没有停电数据可导出');
return; return;
} }
// //
const columns = [ const columns = [
{label: '序号', prop: 'index'}, {label: '序号', prop: 'index'},
@ -378,7 +377,7 @@
{label: '结束时间', prop: 'endTime'}, {label: '结束时间', prop: 'endTime'},
{label: '持续时间(小时)', prop: 'duration'} {label: '持续时间(小时)', prop: 'duration'}
]; ];
let table = '<table border="1" cellspacing="0" cellpadding="5">'; let table = '<table border="1" cellspacing="0" cellpadding="5">';
// //
table += '<tr>'; table += '<tr>';
@ -386,7 +385,7 @@
table += `<th>${col.label}</th>`; table += `<th>${col.label}</th>`;
}); });
table += '</tr>'; table += '</tr>';
// //
this.powerOutageList.forEach(item => { this.powerOutageList.forEach(item => {
table += '<tr>'; table += '<tr>';
@ -396,7 +395,7 @@
table += '</tr>'; table += '</tr>';
}); });
table += '</table>'; table += '</table>';
// HTML // HTML
const deviceName = this.selectMonitorName || '设备'; const deviceName = this.selectMonitorName || '设备';
const fileName = `${deviceName}停电记录_${new Date().getTime()}.xls`; const fileName = `${deviceName}停电记录_${new Date().getTime()}.xls`;
@ -407,27 +406,27 @@
link.click(); link.click();
URL.revokeObjectURL(link.href); URL.revokeObjectURL(link.href);
}, },
/** 查询计量设备信息下拉树结构 */ /** 查询计量设备信息下拉树结构 */
getTreeselect() { getTreeselect() {
getMonitorInfoTree({ monitorType: 4 }).then(response => { getMonitorInfoTree({ monitorType: 4 }).then(response => {
this.monitorInfoOptions = response.data this.monitorInfoOptions = response.data
}) })
}, },
/** 筛选节点 */ /** 筛选节点 */
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
/** 节点单击事件 */ /** 节点单击事件 */
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.monitorCode = data.code this.queryParams.monitorCode = data.code
this.selectMonitorName = data.label this.selectMonitorName = data.label
this.handleQuery() this.handleQuery()
}, },
/** /**
* 数据抽样处理当数据量大时进行抽样 * 数据抽样处理当数据量大时进行抽样
* @param {Array} dataArray 原始数据数组 * @param {Array} dataArray 原始数据数组
@ -437,24 +436,24 @@
if (!dataArray || dataArray.length <= this.samplingThreshold) { if (!dataArray || dataArray.length <= this.samplingThreshold) {
return dataArray; return dataArray;
} }
// //
const interval = Math.ceil(dataArray.length / this.samplingThreshold); const interval = Math.ceil(dataArray.length / this.samplingThreshold);
const sampledData = []; const sampledData = [];
// //
for (let i = 0; i < dataArray.length; i += interval) { for (let i = 0; i < dataArray.length; i += interval) {
sampledData.push(dataArray[i]); sampledData.push(dataArray[i]);
} }
// //
if (sampledData[sampledData.length - 1] !== dataArray[dataArray.length - 1]) { if (sampledData[sampledData.length - 1] !== dataArray[dataArray.length - 1]) {
sampledData.push(dataArray[dataArray.length - 1]); sampledData.push(dataArray[dataArray.length - 1]);
} }
return sampledData; return sampledData;
}, },
/** /**
* 处理时间间隔大于1小时的数据插入标红的0值点 * 处理时间间隔大于1小时的数据插入标红的0值点
* @param {Array} originalData 原始数据数组 * @param {Array} originalData 原始数据数组
@ -464,7 +463,7 @@
processDataBreaks(originalData, valueField) { processDataBreaks(originalData, valueField) {
// //
const sampledData = this.sampleData(originalData); const sampledData = this.sampleData(originalData);
if (!sampledData || sampledData.length < 2) { if (!sampledData || sampledData.length < 2) {
return { return {
processedData: sampledData || [], processedData: sampledData || [],
@ -474,28 +473,28 @@
markAreas: [] markAreas: []
} }
} }
// //
const sortedData = [...sampledData].sort((a, b) => { const sortedData = [...sampledData].sort((a, b) => {
return new Date(a.recordTime) - new Date(b.recordTime) return new Date(a.recordTime) - new Date(b.recordTime)
}) })
const processedData = [] const processedData = []
const markPoints = [] const markPoints = []
const markAreas = [] const markAreas = []
const powerOutages = [] const powerOutages = []
const oneHourMs = 60 * 60 * 1000 // 1 const oneHourMs = 60 * 60 * 1000 // 1
// //
for (let i = 0; i < sortedData.length; i++) { for (let i = 0; i < sortedData.length; i++) {
processedData.push(sortedData[i]) processedData.push(sortedData[i])
// //
if (i < sortedData.length - 1) { if (i < sortedData.length - 1) {
const currentTime = new Date(sortedData[i].recordTime).getTime() const currentTime = new Date(sortedData[i].recordTime).getTime()
const nextTime = new Date(sortedData[i + 1].recordTime).getTime() const nextTime = new Date(sortedData[i + 1].recordTime).getTime()
const timeDiff = nextTime - currentTime const timeDiff = nextTime - currentTime
// 1 // 1
if (timeDiff > oneHourMs) { if (timeDiff > oneHourMs) {
// 1 // 1
@ -503,15 +502,15 @@
const breakTimeStr = parseTime(breakTime, '{y}-{m}-{d} {h}:{i}:{s}') const breakTimeStr = parseTime(breakTime, '{y}-{m}-{d} {h}:{i}:{s}')
const endBreakTime = new Date(nextTime - 60000) const endBreakTime = new Date(nextTime - 60000)
const endBreakTimeStr = parseTime(endBreakTime, '{y}-{m}-{d} {h}:{i}:{s}') const endBreakTimeStr = parseTime(endBreakTime, '{y}-{m}-{d} {h}:{i}:{s}')
// //
const breakPoint = { ...sortedData[i] } const breakPoint = { ...sortedData[i] }
breakPoint.recordTime = breakTimeStr breakPoint.recordTime = breakTimeStr
breakPoint[valueField] = 0 breakPoint[valueField] = 0
breakPoint.isBreakPoint = true // breakPoint.isBreakPoint = true //
processedData.push(breakPoint) processedData.push(breakPoint)
// //
markPoints.push({ markPoints.push({
value: '停电', value: '停电',
@ -524,7 +523,7 @@
color: 'red' color: 'red'
} }
}) })
// //
markAreas.push([ markAreas.push([
{ {
@ -535,7 +534,7 @@
xAxis: endBreakTimeStr, xAxis: endBreakTimeStr,
} }
]) ])
// //
const durationHours = (timeDiff / (1000 * 60 * 60)).toFixed(2); const durationHours = (timeDiff / (1000 * 60 * 60)).toFixed(2);
powerOutages.push({ powerOutages.push({
@ -546,20 +545,20 @@
} }
} }
} }
// //
this.updatePowerOutageSummary(powerOutages); this.updatePowerOutageSummary(powerOutages);
// //
const timeData = processedData.map(e => e.recordTime) const timeData = processedData.map(e => e.recordTime)
const valueData = processedData.map(e => e[valueField]) const valueData = processedData.map(e => e[valueField])
// //
const validData = processedData.filter(item => !item.isBreakPoint) const validData = processedData.filter(item => !item.isBreakPoint)
const validValues = validData.map(e => parseFloat(e[valueField])) const validValues = validData.map(e => parseFloat(e[valueField]))
const average = validValues.length > 0 ? const average = validValues.length > 0 ?
(validValues.reduce((a, b) => a + b, 0) / validValues.length).toFixed(2) : 0 (validValues.reduce((a, b) => a + b, 0) / validValues.length).toFixed(2) : 0
return { return {
processedData, processedData,
timeData, timeData,
@ -569,7 +568,7 @@
average average
} }
}, },
/** /**
* 更新停电统计信息 * 更新停电统计信息
* @param {Array} powerOutages 停电记录数组 * @param {Array} powerOutages 停电记录数组
@ -584,24 +583,24 @@
this.powerOutageList = []; this.powerOutageList = [];
return; return;
} }
// //
let totalDuration = 0; let totalDuration = 0;
let longestDuration = 0; let longestDuration = 0;
powerOutages.forEach((outage, index) => { powerOutages.forEach((outage, index) => {
const duration = parseFloat(outage.duration); const duration = parseFloat(outage.duration);
totalDuration += duration; totalDuration += duration;
longestDuration = Math.max(longestDuration, duration); longestDuration = Math.max(longestDuration, duration);
}); });
// //
this.powerOutageSummary = { this.powerOutageSummary = {
count: powerOutages.length, count: powerOutages.length,
totalDuration: totalDuration.toFixed(2), totalDuration: totalDuration.toFixed(2),
longestDuration: longestDuration.toFixed(2) longestDuration: longestDuration.toFixed(2)
}; };
// //
this.powerOutageList = powerOutages.map((outage, index) => ({ this.powerOutageList = powerOutages.map((outage, index) => ({
index: index + 1, index: index + 1,
@ -610,7 +609,7 @@
duration: outage.duration duration: outage.duration
})); }));
}, },
/** /**
* 创建图表配置 * 创建图表配置
* @param {String} title 图表标题 * @param {String} title 图表标题
@ -623,7 +622,7 @@
*/ */
createChartOption(title, dataResult, name, yAxisName, color, tooltipFormatter) { createChartOption(title, dataResult, name, yAxisName, color, tooltipFormatter) {
const option = JSON.parse(JSON.stringify(this.baseChartOptions)); const option = JSON.parse(JSON.stringify(this.baseChartOptions));
// //
option.title = { option.title = {
text: this.selectMonitorName + ' ' + title + ' (平均值:' + dataResult.average + ")", text: this.selectMonitorName + ' ' + title + ' (平均值:' + dataResult.average + ")",
@ -632,16 +631,16 @@
fontSize: 15 fontSize: 15
} }
}; };
// X // X
option.xAxis.data = dataResult.timeData; option.xAxis.data = dataResult.timeData;
// Y // Y
option.yAxis.name = yAxisName; option.yAxis.name = yAxisName;
option.yAxis.nameTextStyle = { option.yAxis.nameTextStyle = {
color: '#000000' color: '#000000'
}; };
// //
option.tooltip.formatter = tooltipFormatter || function(params) { option.tooltip.formatter = tooltipFormatter || function(params) {
const dataIndex = params[0].dataIndex; const dataIndex = params[0].dataIndex;
@ -651,7 +650,7 @@
} }
return params[0].seriesName + ': ' + params[0].value + '<br/>时间: ' + params[0].axisValue; return params[0].seriesName + ': ' + params[0].value + '<br/>时间: ' + params[0].axisValue;
}; };
// //
option.series = [{ option.series = [{
name: name, name: name,
@ -687,55 +686,55 @@
silent: true silent: true
} }
}]; }];
return option; return option;
}, },
/** 曲线 */ /** 曲线 */
async getChart() { async getChart() {
this.loading = true; this.loading = true;
let query = JSON.parse(JSON.stringify(this.queryParams)) let query = JSON.parse(JSON.stringify(this.queryParams))
try { try {
const {data} = await steamInstantList(query) const {data} = await steamInstantList(query)
// //
const fluxFlowResult = this.processDataBreaks(data, 'fluxFlow') const fluxFlowResult = this.processDataBreaks(data, 'fluxFlow')
// //
const temperatureResult = this.processDataBreaks(data, 'temperature') const temperatureResult = this.processDataBreaks(data, 'temperature')
// //
const pressResult = this.processDataBreaks(data, 'press') const pressResult = this.processDataBreaks(data, 'press')
// //
const option1 = this.createChartOption( const option1 = this.createChartOption(
'瞬时流量', '瞬时流量',
fluxFlowResult, fluxFlowResult,
'瞬时流量', '瞬时流量',
'瞬时流量y', '瞬时流量y',
'#5470c6' '#5470c6'
); );
const option2 = this.createChartOption( const option2 = this.createChartOption(
'温度', '温度',
temperatureResult, temperatureResult,
'温度', '温度',
'温度y', '温度y',
'#91cc75' '#91cc75'
); );
const option3 = this.createChartOption( const option3 = this.createChartOption(
'压力', '压力',
pressResult, pressResult,
'压力', '压力',
'压力y', '压力y',
'#fac858' '#fac858'
); );
this.$refs.Chart1.setData(option1) this.$refs.Chart1.setData(option1)
this.$refs.Chart2.setData(option2) this.$refs.Chart2.setData(option2)
this.$refs.Chart3.setData(option3) this.$refs.Chart3.setData(option3)
echarts.connect(this.$refs.Chart1.chart, this.$refs.Chart2.chart, this.$refs.Chart3.chart) echarts.connect(this.$refs.Chart1.chart, this.$refs.Chart2.chart, this.$refs.Chart3.chart)
// //
this.$refs.Chart1.chart.on('datazoom', (e) => { this.$refs.Chart1.chart.on('datazoom', (e) => {
option2.dataZoom[0].start = e.start option2.dataZoom[0].start = e.start
@ -745,7 +744,7 @@
option3.dataZoom[0].end = e.end option3.dataZoom[0].end = e.end
this.$refs.Chart3.setData(option3) this.$refs.Chart3.setData(option3)
}) })
this.$refs.Chart2.chart.on('datazoom', (e) => { this.$refs.Chart2.chart.on('datazoom', (e) => {
option1.dataZoom[0].start = e.start option1.dataZoom[0].start = e.start
option1.dataZoom[0].end = e.end option1.dataZoom[0].end = e.end
@ -754,7 +753,7 @@
option3.dataZoom[0].end = e.end option3.dataZoom[0].end = e.end
this.$refs.Chart3.setData(option3) this.$refs.Chart3.setData(option3)
}) })
this.$refs.Chart3.chart.on('datazoom', (e) => { this.$refs.Chart3.chart.on('datazoom', (e) => {
option2.dataZoom[0].start = e.start option2.dataZoom[0].start = e.start
option2.dataZoom[0].end = e.end option2.dataZoom[0].end = e.end
@ -770,7 +769,7 @@
this.loading = false this.loading = false
} }
}, },
/** 查询树形结构 */ /** 查询树形结构 */
getTreeMonitorInfo() { getTreeMonitorInfo() {
getMonitorInfoTree({ monitorType: 4 }).then(response => { getMonitorInfoTree({ monitorType: 4 }).then(response => {
@ -784,43 +783,43 @@
.app-container { .app-container {
padding: 10px; padding: 10px;
} }
.charts-container { .charts-container {
margin-top: 10px; margin-top: 10px;
} }
.chart1 { .chart1 {
width: 50%; width: 50%;
height: 40vh; height: 40vh;
display: inline-block; display: inline-block;
} }
.chart2 { .chart2 {
width: 50%; width: 50%;
height: 40vh; height: 40vh;
display: inline-block; display: inline-block;
} }
.chart3 { .chart3 {
width: 50%; width: 50%;
height: 40vh; height: 40vh;
display: inline-block; display: inline-block;
} }
.power-outage-summary { .power-outage-summary {
margin-bottom: 10px; margin-bottom: 10px;
} }
.power-outage-info { .power-outage-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
} }
.power-outage-info p { .power-outage-info p {
margin: 5px 10px; margin: 5px 10px;
} }
/* 选中节点的样式 */ /* 选中节点的样式 */
::v-deep .el-tree .el-tree-node.is-current > .el-tree-node__content { ::v-deep .el-tree .el-tree-node.is-current > .el-tree-node__content {
background-color: #67C23A !important; /* 选中节点的背景色 */ background-color: #67C23A !important; /* 选中节点的背景色 */
@ -829,15 +828,14 @@
margin: 0; /* 清除外边距 */ margin: 0; /* 清除外边距 */
z-index: 1; /* 确保在其他元素之上 */ z-index: 1; /* 确保在其他元素之上 */
} }
/* 鼠标悬停时的样式 */ /* 鼠标悬停时的样式 */
.el-tree .el-tree-node__content:hover { .el-tree .el-tree-node__content:hover {
background-color: #e6f7ff; /* 鼠标悬停时的背景色 */ background-color: #e6f7ff; /* 鼠标悬停时的背景色 */
} }
/* 闪电图标 */ /* 闪电图标 */
.el-icon-lightning:before { .el-icon-lightning:before {
content: "\e6a8"; /* 使用现有的element-ui图标字体 */ content: "\e6a8"; /* 使用现有的element-ui图标字体 */
} }
</style> </style>

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入计量设备名称" placeholder="请输入计量设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -89,8 +89,8 @@
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -89,8 +89,8 @@
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入计量设备名称" placeholder="请输入计量设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -69,8 +69,8 @@
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -69,8 +69,8 @@
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入计量设备名称" placeholder="请输入计量设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -68,7 +68,7 @@ import { useRoute } from 'vue-router';
import { dnbInstantList } from '@/api/ems/record/recordDnbInstant'; import { dnbInstantList } from '@/api/ems/record/recordDnbInstant';
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'; import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import Chart from '@/components/Charts/Chart'; import Chart from '@/components/chart.vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import type { ElTree } from 'element-plus'; import type { ElTree } from 'element-plus';
import type { EChartsOption } from 'echarts'; import type { EChartsOption } from 'echarts';

@ -70,8 +70,8 @@ import {
getRecordDnbInstant, dnbInstantList getRecordDnbInstant, dnbInstantList
} from '@/api/ems/record/recordDnbInstant' } from '@/api/ems/record/recordDnbInstant'
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -6,7 +6,7 @@
<el-form <el-form
:model="queryParams" :model="queryParams"
ref="queryForm" ref="queryForm"
:inline="true" :inline="true"
v-show="showSearch" v-show="showSearch"
label-width="68px" label-width="68px"
@ -55,7 +55,7 @@
<el-button <el-button
type="primary" type="primary"
icon="Search" icon="Search"
@click="handleQuery" @click="handleQuery"
>搜索 >搜索
</el-button> </el-button>
@ -99,7 +99,7 @@
type="warning" type="warning"
plain plain
icon="Download" icon="Download"
@click="handleExport" @click="handleExport"
>导出 >导出
</el-button> </el-button>
@ -148,8 +148,8 @@
import { import {
energyPreviewReportList energyPreviewReportList
} from '@/api/ems/report/reportPort.js' } from '@/api/ems/report/reportPort.js'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { import {
getHoursBetween, getHoursBetween,

@ -148,8 +148,8 @@
import { import {
energyPreviewReportList energyPreviewReportList
} from '@/api/ems/report/reportPort.js' } from '@/api/ems/report/reportPort.js'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { import {
getHoursBetween, getHoursBetween,

@ -8,7 +8,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入统计单元名称" placeholder="请输入统计单元名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -77,7 +77,7 @@
type="warning" type="warning"
plain plain
icon="Download" icon="Download"
@click="handleExport" @click="handleExport"
>导出 >导出
</el-button> </el-button>
@ -111,8 +111,8 @@
<script> <script>
import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit' import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { energyStatisticalReportList } from '@//api/ems/report/reportPort.js' import { energyStatisticalReportList } from '@//api/ems/report/reportPort.js'
import { parseTime } from '@//utils/ruoyi' import { parseTime } from '@//utils/ruoyi'

@ -111,8 +111,8 @@
<script> <script>
import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit' import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { energyStatisticalReportList } from '@//api/ems/report/reportPort.js' import { energyStatisticalReportList } from '@//api/ems/report/reportPort.js'
import { parseTime } from '@//utils/ruoyi' import { parseTime } from '@//utils/ruoyi'

@ -7,7 +7,7 @@
v-model="workUnitName" v-model="workUnitName"
placeholder="请输入计量设备名称" placeholder="请输入计量设备名称"
clearable clearable
prefix-icon="Search" prefix-icon="Search"
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
@ -91,8 +91,8 @@
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -91,8 +91,8 @@
<script> <script>
import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo' import { getMonitorInfoTree } from '@/api/ems/base/baseMonitorInfo'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from 'vue3-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import 'vue3-treeselect/dist/vue3-treeselect.css';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'

@ -1,9 +1,14 @@
import { UserConfig, ConfigEnv, loadEnv, defineConfig } from 'vite'; import { ConfigEnv, defineConfig, loadEnv, UserConfig } from 'vite';
import basicSsl from '@vitejs/plugin-basic-ssl';
import Icons from 'unplugin-icons/vite';
import IconsResolver from 'unplugin-icons/resolver';
import Components from 'unplugin-vue-components/vite';
import createPlugins from './vite/plugins'; import createPlugins from './vite/plugins';
import path from 'path'; import path from 'path';
export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => { export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
const env = loadEnv(mode, process.cwd()); const env = loadEnv(mode, process.cwd());
return { return {
@ -19,17 +24,30 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
}, },
// https://cn.vitejs.dev/config/#resolve-extensions // https://cn.vitejs.dev/config/#resolve-extensions
plugins: createPlugins(env, command === 'build'), plugins: [createPlugins(env, command === 'build'), basicSsl(),
Components({
resolvers: [
IconsResolver({
compiler: 'vue3'
})
]
}),
Icons({
compiler: 'vue3'
})],
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
port: Number(env.VITE_APP_PORT), port: Number(env.VITE_APP_PORT),
// https: true,
open: true, open: true,
proxy: { proxy: {
[env.VITE_APP_BASE_API]: { [env.VITE_APP_BASE_API]: {
target: 'http://localhost:6080', // target: 'http://localhost:6080',
// target: 'https://frp-off.com:47543',
// target: 'http://192.168.100.102:6080',
// target: 'http://192.168.100.100:6080', // target: 'http://192.168.100.100:6080',
// target: 'http://192.168.137.1:6080', // target: 'http://1.13.177.47:6080',
// target: 'http://175.27.215.92:6080/prod-api', target: 'http://192.168.0.15:6080',
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
@ -44,6 +62,7 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
target: 'http://localhost:6083', target: 'http://localhost:6083',
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
secure: false,
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
}, },
'/deva-api': { '/deva-api': {

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save