|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="main-content" :style="{ width: '100%', padding: '20px 30px', fontSize: '15px' }">
|
|
|
<!-- 列表页 -->
|
|
|
- <template v-if="!addOrUpdateOrDetailFlag">
|
|
|
+ <template v-if="!analysisFlag">
|
|
|
<el-form
|
|
|
class="center-form-pv"
|
|
|
:style="{
|
|
|
@@ -46,8 +46,8 @@
|
|
|
class="item-label"
|
|
|
>变电站</label
|
|
|
>
|
|
|
- <el-select style="width: 100%" v-model="searchForm.subName" placeholder="变电站" @keydown.enter.native="search()" clearable>
|
|
|
- <el-option v-for="item in subList" :key="item.value" :label="item.label" :value="item.label" />
|
|
|
+ <el-select style="width: 100%" v-model="searchForm.subId" placeholder="变电站" @keydown.enter.native="search()" clearable>
|
|
|
+ <el-option v-for="item in subList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div
|
|
|
@@ -71,8 +71,8 @@
|
|
|
class="item-label"
|
|
|
>归属县旗</label
|
|
|
>
|
|
|
- <el-select style="width: 100%" v-model="searchForm.compNm" placeholder="归属县旗" @keydown.enter.native="search()" clearable>
|
|
|
- <el-option v-for="item in compList" :key="item.value" :label="item.label" :value="item.label" />
|
|
|
+ <el-select style="width: 100%" v-model="searchForm.compId" placeholder="归属县旗" @keydown.enter.native="search()" clearable>
|
|
|
+ <el-option v-for="item in compList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div :style="{ alignItems: 'center', margin: '0 10px 0 0', display: 'flex' }">
|
|
|
@@ -90,10 +90,7 @@
|
|
|
class="item-label"
|
|
|
>温度</label
|
|
|
>
|
|
|
- <el-input v-model="searchForm.temperaturestart" placeholder="最小温度" clearable></el-input>
|
|
|
- </div>
|
|
|
- <div :style="{ alignItems: 'center', margin: '0 10px 0 0', display: 'flex' }" :label="'至'">
|
|
|
- <el-input v-model="searchForm.temperatureend" placeholder="最大温度" clearable></el-input>
|
|
|
+ <el-input v-model="searchForm.temperature" placeholder="温度" clearable></el-input>
|
|
|
</div>
|
|
|
<div
|
|
|
:style="{
|
|
|
@@ -151,7 +148,7 @@
|
|
|
display: 'flex',
|
|
|
}"
|
|
|
>
|
|
|
- <el-button class="del" :disabled="dataListSelections.length ? false : true" type="danger" @click="deleteHandler()">
|
|
|
+ <el-button class="add" type="danger" @click="ycForecastHandler()">
|
|
|
<span
|
|
|
class="icon iconfont icon-xihuan"
|
|
|
:style="{
|
|
|
@@ -162,9 +159,9 @@
|
|
|
height: '34px',
|
|
|
}"
|
|
|
></span>
|
|
|
- 批量删除
|
|
|
+ 预测
|
|
|
</el-button>
|
|
|
- <el-button class="add" type="danger" @click="importHandler()">
|
|
|
+ <el-button class="add" type="danger" @click="analysisHandler()">
|
|
|
<span
|
|
|
class="icon iconfont icon-xihuan"
|
|
|
:style="{
|
|
|
@@ -175,7 +172,7 @@
|
|
|
height: '34px',
|
|
|
}"
|
|
|
></span>
|
|
|
- 预测
|
|
|
+ 数据分析
|
|
|
</el-button>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
@@ -205,11 +202,9 @@
|
|
|
:border="true"
|
|
|
:data="dataList"
|
|
|
v-loading="dataListLoading"
|
|
|
- @selection-change="selectionChangeHandler"
|
|
|
>
|
|
|
- <el-table-column :resizable="true" type="selection" align="center" width="50"></el-table-column>
|
|
|
<el-table-column :resizable="true" :sortable="true" label="序号" type="index" width="50" />
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="dataDate" label="日期" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="recordDate" label="日期" />
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="subNm" label="变电站">
|
|
|
<template slot-scope="scope" :resizable="true" :sortable="true">
|
|
|
{{ scope.row.subNm }}
|
|
|
@@ -235,47 +230,20 @@
|
|
|
{{ scope.row.mainCapacity }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column :resizable="true" :sortable="true" prop="temperature" label="温度">
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="temperature" label="温度(℃)" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="peakLoad" label="最大负荷(MW)" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="loadRate" label="负载率(%)">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.temperature }}℃
|
|
|
+ {{ scope.row.loadRate ? (Number(scope.row.loadRate) * 100).toFixed(2) : '--' }}
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="peakLoad" label="最大负荷(MW)" />
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="loadRate" label="负载率(%)" />
|
|
|
+ </el-table-column>
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="baseLoad" label="基础负荷(MW)" />
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="electricHeatingLoad" label="电采暖负荷(MW)" />
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="usersNum" label="用户数" />
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="pfUsersNum" label="平房用户数" />
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="joinElectricHeatingNum" label="接入电暖用户数" />
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="pingfangElectricHeatingCapacity" label="接入电采暖容量(MWA)" />
|
|
|
- <el-table-column width="120" label="操作">
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="confidence" label="置信度(%)">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button class="view" type="success" @click="addOrUpdateHandler(scope.row.id, 'view')">
|
|
|
- <span
|
|
|
- class="icon iconfont icon-xihuan"
|
|
|
- :style="{
|
|
|
- margin: '0 2px',
|
|
|
- fontSize: '14px',
|
|
|
- color: '#fff',
|
|
|
- display: 'none',
|
|
|
- height: '40px',
|
|
|
- }"
|
|
|
- ></span>
|
|
|
- 明细
|
|
|
- </el-button>
|
|
|
- <el-button class="del" type="primary" @click="deleteHandler(scope.row.id)">
|
|
|
- <span
|
|
|
- class="icon iconfont icon-xihuan"
|
|
|
- :style="{
|
|
|
- margin: '0 2px',
|
|
|
- fontSize: '14px',
|
|
|
- color: '#fff',
|
|
|
- display: 'none',
|
|
|
- height: '40px',
|
|
|
- }"
|
|
|
- ></span>
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
+ {{ scope.row.confidence ? (Number(scope.row.confidence) * 100).toFixed(2) : '--' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -306,29 +274,253 @@
|
|
|
}"
|
|
|
></el-pagination>
|
|
|
</template>
|
|
|
- <!-- 添加/修改页面 将父组件的search方法传递给子组件-->
|
|
|
- <add-or-update v-if="addOrUpdateOrDetailFlag" :parent="this" ref="addOrUpdate"></add-or-update>
|
|
|
- <!-- 上传文件弹窗 -->
|
|
|
- <upload-modal :parent="this" ref="uploadModal"></upload-modal>
|
|
|
+ <div v-if="analysisFlag">
|
|
|
+ <el-form
|
|
|
+ class="center-form-pv"
|
|
|
+ :style="{
|
|
|
+ border: '0px solid #fff',
|
|
|
+ padding: '10px',
|
|
|
+ margin: '0',
|
|
|
+ flexWrap: 'wrap',
|
|
|
+ background: '#ffffff',
|
|
|
+ display: 'flex',
|
|
|
+ width: '100%',
|
|
|
+ }"
|
|
|
+ :inline="true"
|
|
|
+ :model="searchForm"
|
|
|
+ >
|
|
|
+ <el-row
|
|
|
+ :style="{
|
|
|
+ padding: '10px',
|
|
|
+ alignItems: 'center',
|
|
|
+ flexWrap: 'wrap',
|
|
|
+ background: 'none',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-if="false"
|
|
|
+ :style="{
|
|
|
+ alignItems: 'center',
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <label
|
|
|
+ :style="{
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ color: '#666',
|
|
|
+ display: 'inline-block',
|
|
|
+ lineHeight: '40px',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ fontWeight: '500',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ class="item-label"
|
|
|
+ >变电站</label
|
|
|
+ >
|
|
|
+ <el-select style="width: 100%" v-model="searchForm.subId" placeholder="变电站" @keydown.enter.native="search()" clearable>
|
|
|
+ <el-option v-for="item in subList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ alignItems: 'center',
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <label
|
|
|
+ :style="{
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ color: '#666',
|
|
|
+ display: 'inline-block',
|
|
|
+ lineHeight: '40px',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ fontWeight: '500',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ class="item-label"
|
|
|
+ >归属县旗</label
|
|
|
+ >
|
|
|
+ <el-select style="width: 100%" v-model="searchForm.compId" placeholder="归属县旗" @keydown.enter.native="search()" clearable>
|
|
|
+ <el-option v-for="item in compList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ alignItems: 'center',
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <label
|
|
|
+ :style="{
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ color: '#666',
|
|
|
+ display: 'inline-block',
|
|
|
+ lineHeight: '40px',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ fontWeight: '500',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ class="item-label"
|
|
|
+ >时间范围</label
|
|
|
+ >
|
|
|
+ <el-radio-group size="large" v-model="searchForm.timeStatType" @change="searchForm.record_date_end = undefined">
|
|
|
+ <el-radio-button label="daily">日</el-radio-button>
|
|
|
+ <el-radio-button label="monthly">月</el-radio-button>
|
|
|
+ <el-radio-button label="yearly">年</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ alignItems: 'center',
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <label
|
|
|
+ :style="{
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ color: '#666',
|
|
|
+ display: 'inline-block',
|
|
|
+ lineHeight: '40px',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ fontWeight: '500',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ class="item-label"
|
|
|
+ >日期</label
|
|
|
+ >
|
|
|
+ <el-date-picker
|
|
|
+ size="large"
|
|
|
+ v-model="searchForm.record_date_end"
|
|
|
+ :type="timeTtpeMap[searchForm.timeStatType]"
|
|
|
+ :value-format="timeValueFormatMap[searchForm.timeStatType]"
|
|
|
+ placeholder="选择日期"
|
|
|
+ />
|
|
|
+ <!-- value-format="yyyy-MM-dd" -->
|
|
|
+ </div>
|
|
|
+ <el-button class="search" type="success" @click="initAnalysisData()">
|
|
|
+ <span
|
|
|
+ class="icon iconfont icon-fangdajing07"
|
|
|
+ :style="{
|
|
|
+ margin: '0 2px',
|
|
|
+ fontSize: '16px',
|
|
|
+ color: '#fff',
|
|
|
+ display: 'none',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ 搜索
|
|
|
+ </el-button>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row
|
|
|
+ class="actions"
|
|
|
+ :style="{
|
|
|
+ padding: '10px',
|
|
|
+ margin: '0px 0',
|
|
|
+ flexWrap: 'wrap',
|
|
|
+ background: 'none',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-button class="add" type="danger" @click="analysisFlag = false">
|
|
|
+ <span
|
|
|
+ class="icon iconfont icon-xihuan"
|
|
|
+ :style="{
|
|
|
+ margin: '0 2px',
|
|
|
+ fontSize: '14px',
|
|
|
+ color: '#fff',
|
|
|
+ display: 'none',
|
|
|
+ height: '34px',
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ 返回
|
|
|
+ </el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-row :gutter="12">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-card header="最大负荷">
|
|
|
+ <div id="chart1" style="height: 260px"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-card header="基础负荷">
|
|
|
+ <div id="chart2" style="height: 260px"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-card header="电采暖负荷">
|
|
|
+ <div id="chart3" style="height: 260px"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="12" style="margin-top: 12px">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-card header="负荷率">
|
|
|
+ <div id="chart4" style="height: 260px"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-card header="用户数">
|
|
|
+ <div id="chart5" style="height: 260px"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-card header="接入电暖用户数">
|
|
|
+ <div id="chart6" style="height: 260px"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import AddOrUpdate from './components/add-or-update.vue';
|
|
|
-import uploadModal from './components/uploadModal.vue';
|
|
|
+import * as echarts from 'echarts';
|
|
|
export default {
|
|
|
- components: {
|
|
|
- AddOrUpdate,
|
|
|
- uploadModal,
|
|
|
- },
|
|
|
+ components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
- subNm: '',
|
|
|
- compNm: '',
|
|
|
- temperaturestart: '',
|
|
|
- temperatureend: '',
|
|
|
+ subId: '',
|
|
|
+ compId: '',
|
|
|
+ temperature: '',
|
|
|
dateRange: [],
|
|
|
+ timeStatType: 'daily',
|
|
|
+ record_date_end: '',
|
|
|
+ },
|
|
|
+ timeRangeList: [
|
|
|
+ {
|
|
|
+ label: '日',
|
|
|
+ value: 'daily',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '月',
|
|
|
+ value: 'monthly',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '年',
|
|
|
+ value: 'yearly',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ timeTtpeMap: {
|
|
|
+ daily: 'date',
|
|
|
+ monthly: 'month',
|
|
|
+ yearly: 'year',
|
|
|
+ },
|
|
|
+ timeValueFormatMap: {
|
|
|
+ daily: 'yyyy-MM-DD',
|
|
|
+ monthly: 'yyyy-MM',
|
|
|
+ yearly: 'yyyy',
|
|
|
},
|
|
|
dataList: [],
|
|
|
subList: [],
|
|
|
@@ -339,7 +531,46 @@ export default {
|
|
|
dataListSelections: [],
|
|
|
layouts: ['prev', 'pager', 'next', 'sizes'],
|
|
|
compList: [],
|
|
|
- addOrUpdateOrDetailFlag: false,
|
|
|
+ analysisFlag: false,
|
|
|
+ barOption: {
|
|
|
+ grid: { top: 10, left: 15, right: 15, bottom: 20 },
|
|
|
+ color: ['#0977fd'],
|
|
|
+ tooltip: { trigger: 'item', formatter: '{b} : {c}', backgroundColor: 'transparent' },
|
|
|
+ xAxis: {
|
|
|
+ type: 'category',
|
|
|
+ data: ['-'],
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ name: 'MW',
|
|
|
+ type: 'value',
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ data: [],
|
|
|
+ type: 'bar',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ pie: {
|
|
|
+ grid: { top: 10, left: 15, right: 15, bottom: 20 },
|
|
|
+ color: ['#0977fd'],
|
|
|
+ tooltip: { trigger: 'item', formatter: '{b} : {c}', backgroundColor: 'transparent' },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['25%', '55%'],
|
|
|
+ center: ['50%', '60%'],
|
|
|
+ data: [],
|
|
|
+ emphasis: {
|
|
|
+ itemStyle: {
|
|
|
+ shadowBlur: 10,
|
|
|
+ shadowOffsetX: 0,
|
|
|
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -383,8 +614,130 @@ export default {
|
|
|
}));
|
|
|
}
|
|
|
},
|
|
|
- importHandler() {
|
|
|
- this.$refs.uploadModal.openDialog();
|
|
|
+ // 初始化分析数据
|
|
|
+ initAnalysisData(initType = 'value') {
|
|
|
+ if (initType != 'init' && !this.searchForm.compId) {
|
|
|
+ this.$message.warning('请选择归属县旗');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (initType != 'init' && !this.searchForm.record_date_end) {
|
|
|
+ this.$message.warning('请选择日期');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.getAnalysisData(initType);
|
|
|
+ },
|
|
|
+ getAnalysisData(initType = 'value') {
|
|
|
+ const columns = ['peak_load', 'base_load', 'electric_heating_load', 'load_rate ', 'users_num', 'join_electric_heating_num'];
|
|
|
+ const params = {
|
|
|
+ subId: this.searchForm.subId,
|
|
|
+ companyId: this.searchForm.compId,
|
|
|
+ recordDate: this.searchForm.record_date_end,
|
|
|
+ };
|
|
|
+ columns.forEach((item, i) => {
|
|
|
+ this.$http({
|
|
|
+ url: `/electric-heating/${initType}/${item.filed}/${this.searchForm.timeStatType}`,
|
|
|
+ method: 'get',
|
|
|
+ params: params,
|
|
|
+ }).then(({ data }) => {
|
|
|
+ const chart = echarts.init(document.getElementById(`chart${i + 1}`), 'carp');
|
|
|
+ const res = initType === 'init' ? data?.data?.result || [] : data?.data || [];
|
|
|
+ // 使用刚指定的配置项和数据显示图表。
|
|
|
+ if ([0, 1, 2].includes(i)) {
|
|
|
+ chart.setOption({
|
|
|
+ ...this.barOption,
|
|
|
+ xAxis: {
|
|
|
+ type: 'category',
|
|
|
+ data: res?.map(item => item.subName),
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ data: res?.map(item => item.total),
|
|
|
+ type: 'bar',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if ([3, 4, 5].includes(i)) {
|
|
|
+ chart.setOption({
|
|
|
+ ...this.pieOption,
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ data: res?.map(item => ({ name: item.subName, value: item.total })),
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['25%', '55%'],
|
|
|
+ center: ['50%', '60%'],
|
|
|
+ emphasis: {
|
|
|
+ itemStyle: {
|
|
|
+ shadowBlur: 10,
|
|
|
+ shadowOffsetX: 0,
|
|
|
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //根据窗口的大小变动图表
|
|
|
+ window.onresize = function () {
|
|
|
+ chart.resize();
|
|
|
+ };
|
|
|
+ console.log(data, item);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 预测
|
|
|
+ ycForecastHandler() {
|
|
|
+ if (this.searchForm.temperature == '' || this.searchForm.temperature == undefined) {
|
|
|
+ this.$message.warning('请输入温度');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.searchForm.dateRange || this.searchForm.dateRange?.length === 0) {
|
|
|
+ this.$message.warning('请选择日期范围');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.dataListLoading = true;
|
|
|
+ let params = {
|
|
|
+ page: this.pageIndex,
|
|
|
+ limit: this.pageSize,
|
|
|
+ sort: 'id',
|
|
|
+ order: 'desc',
|
|
|
+ };
|
|
|
+ if (this.searchForm.subId != '' && this.searchForm.subId != undefined) {
|
|
|
+ params['subId'] = Number(this.searchForm.subId);
|
|
|
+ }
|
|
|
+ if (this.searchForm.compId != '' && this.searchForm.compId != undefined) {
|
|
|
+ params['compId'] = Number(this.searchForm.compId);
|
|
|
+ }
|
|
|
+ if (this.searchForm.temperature != '' && this.searchForm.temperature != undefined) {
|
|
|
+ params['temperature'] = Number(this.searchForm.temperature);
|
|
|
+ }
|
|
|
+ if (this.searchForm.dateRange != '' && this.searchForm.dateRange != undefined) {
|
|
|
+ params['startDate'] = this.searchForm.dateRange[0];
|
|
|
+ params['endDate'] = this.searchForm.dateRange[1];
|
|
|
+ }
|
|
|
+ this.$http({
|
|
|
+ url: '/electric-heating/predict',
|
|
|
+ method: 'post',
|
|
|
+ data: params,
|
|
|
+ }).then(({ data }) => {
|
|
|
+ if (data && data.code === 0) {
|
|
|
+ this.$message.success(data.msg);
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg);
|
|
|
+ }
|
|
|
+ this.dataListLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 显示数据分析
|
|
|
+ analysisHandler(row) {
|
|
|
+ this.analysisFlag = true;
|
|
|
+ this.searchForm.timeStatType = 'daily';
|
|
|
+ this.searchForm.subId = undefined;
|
|
|
+ this.searchForm.compId = undefined;
|
|
|
+ this.searchForm.record_date_end = undefined;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.initAnalysisData('init');
|
|
|
+ });
|
|
|
},
|
|
|
search() {
|
|
|
this.pageIndex = 1;
|
|
|
@@ -399,14 +752,21 @@ export default {
|
|
|
sort: 'id',
|
|
|
order: 'desc',
|
|
|
};
|
|
|
- if (this.searchForm.subNm != '' && this.searchForm.subNm != undefined) {
|
|
|
- params['subNm'] = '%' + this.searchForm.subNm + '%';
|
|
|
+ if (this.searchForm.subId != '' && this.searchForm.subId != undefined) {
|
|
|
+ params['subId'] = Number(this.searchForm.subId);
|
|
|
+ }
|
|
|
+ if (this.searchForm.compId != '' && this.searchForm.compId != undefined) {
|
|
|
+ params['compId'] = Number(this.searchForm.compId);
|
|
|
}
|
|
|
- if (this.searchForm.compNm != '' && this.searchForm.compNm != undefined) {
|
|
|
- params['compNm'] = '%' + this.searchForm.compNm + '%';
|
|
|
+ if (this.searchForm.temperature != '' && this.searchForm.temperature != undefined) {
|
|
|
+ params['temperature'] = Number(this.searchForm.temperature);
|
|
|
+ }
|
|
|
+ if (this.searchForm.dateRange != '' && this.searchForm.dateRange != undefined) {
|
|
|
+ params['record_date_start'] = this.searchForm.dateRange[0];
|
|
|
+ params['record_date_end'] = this.searchForm.dateRange[1];
|
|
|
}
|
|
|
this.$http({
|
|
|
- url: '/subLoad/page',
|
|
|
+ url: '/electric-heating/page',
|
|
|
method: 'get',
|
|
|
params: params,
|
|
|
}).then(({ data }) => {
|
|
|
@@ -431,46 +791,6 @@ export default {
|
|
|
this.pageIndex = val;
|
|
|
this.getDataList();
|
|
|
},
|
|
|
- // 多选
|
|
|
- selectionChangeHandler(val) {
|
|
|
- this.dataListSelections = val;
|
|
|
- },
|
|
|
- // 添加/修改
|
|
|
- addOrUpdateHandler(id, type) {
|
|
|
- this.addOrUpdateOrDetailFlag = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.addOrUpdate.openDialog(id, type);
|
|
|
- });
|
|
|
- },
|
|
|
- // 删除
|
|
|
- async deleteHandler(id) {
|
|
|
- var ids = id
|
|
|
- ? [Number(id)]
|
|
|
- : this.dataListSelections.map(item => {
|
|
|
- return Number(item.id);
|
|
|
- });
|
|
|
- await this.$confirm(`确定进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- }).then(async () => {
|
|
|
- await this.$http({
|
|
|
- url: 'subLoad/delete',
|
|
|
- method: 'post',
|
|
|
- data: ids,
|
|
|
- }).then(async ({ data }) => {
|
|
|
- if (data && data.code === 0) {
|
|
|
- this.$message({
|
|
|
- message: '操作成功',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
- this.search();
|
|
|
- } else {
|
|
|
- this.$message.error(data.msg);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -1130,4 +1450,7 @@ export default {
|
|
|
position: relative;
|
|
|
transition: 0.3s;
|
|
|
}
|
|
|
+::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
|
|
+ background-color: #0977fd;
|
|
|
+}
|
|
|
</style>
|