|
@@ -54,75 +54,10 @@
|
|
|
@change="getSubList"
|
|
@change="getSubList"
|
|
|
clearable
|
|
clearable
|
|
|
>
|
|
>
|
|
|
- <el-option label="全部" value="">全部</el-option>
|
|
|
|
|
|
|
+ <el-option label="全部" :value="null">全部</el-option>
|
|
|
<el-option v-for="item in regionList" :key="item.value" :label="item.label" :value="item.value" />
|
|
<el-option v-for="item in regionList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</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.regionId"
|
|
|
|
|
- placeholder="变电站"
|
|
|
|
|
- @keydown.enter.native="search()"
|
|
|
|
|
- clearable
|
|
|
|
|
- >
|
|
|
|
|
- <el-option label="全部" value="">全部</el-option>
|
|
|
|
|
- <el-option v-for="item in substationList" :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.dimension"
|
|
|
|
|
- placeholder="时间维度"
|
|
|
|
|
- @keydown.enter.native="search()"
|
|
|
|
|
- clearable
|
|
|
|
|
- >
|
|
|
|
|
- <el-option label="日" value="daily">日</el-option>
|
|
|
|
|
- <el-option label="月" value="monthly">月</el-option>
|
|
|
|
|
- <el-option label="年" value="yearly">年</el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </div>
|
|
|
|
|
<div
|
|
<div
|
|
|
:style="{
|
|
:style="{
|
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
@@ -130,7 +65,7 @@
|
|
|
display: 'flex',
|
|
display: 'flex',
|
|
|
}"
|
|
}"
|
|
|
>
|
|
>
|
|
|
- <!-- <label
|
|
|
|
|
|
|
+ <label
|
|
|
:style="{
|
|
:style="{
|
|
|
margin: '0 10px 0 0',
|
|
margin: '0 10px 0 0',
|
|
|
whiteSpace: 'nowrap',
|
|
whiteSpace: 'nowrap',
|
|
@@ -144,9 +79,43 @@
|
|
|
class="item-label"
|
|
class="item-label"
|
|
|
>变电站</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> -->
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ v-model="searchForm.substationId"
|
|
|
|
|
+ placeholder="变电站"
|
|
|
|
|
+ @keydown.enter.native="search()"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label="全部" :value="null">全部</el-option>
|
|
|
|
|
+ <el-option v-for="item in substationList" :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.dimension" placeholder="时间维度" @keydown.enter.native="search()" clearable>
|
|
|
|
|
+ <el-option label="日" value="daily">日</el-option>
|
|
|
|
|
+ <el-option label="月" value="monthly">月</el-option>
|
|
|
|
|
+ <el-option label="年" value="yearly">年</el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</div>
|
|
</div>
|
|
|
<div
|
|
<div
|
|
|
:style="{
|
|
:style="{
|
|
@@ -154,6 +123,13 @@
|
|
|
margin: '0 10px 0 0',
|
|
margin: '0 10px 0 0',
|
|
|
display: 'flex',
|
|
display: 'flex',
|
|
|
}"
|
|
}"
|
|
|
|
|
+ ></div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ alignItems: 'center',
|
|
|
|
|
+ margin: '0 10px 0 0',
|
|
|
|
|
+ display: 'flex',
|
|
|
|
|
+ }"
|
|
|
>
|
|
>
|
|
|
<label
|
|
<label
|
|
|
:style="{
|
|
:style="{
|
|
@@ -248,34 +224,40 @@
|
|
|
>
|
|
>
|
|
|
<el-table-column :resizable="true" :sortable="true" label="序号" type="index" width="50" />
|
|
<el-table-column :resizable="true" :sortable="true" label="序号" type="index" width="50" />
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="region" label="所属地区" />
|
|
<el-table-column :resizable="true" :sortable="true" prop="region" label="所属地区" />
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="substation" label="变电站" />
|
|
|
|
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="substation" label="变电站" />
|
|
|
<!-- <el-table-column :resizable="true" :sortable="true" prop="recordDate" label="预测方法" /> -->
|
|
<!-- <el-table-column :resizable="true" :sortable="true" prop="recordDate" label="预测方法" /> -->
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="temperatures" label="预测参数" >
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- {{ "温度"+scope.row.temperatures +"℃"}}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="temperatures" label="预测参数">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ '温度' + scope.row.temperatures + '℃' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="dimension" label="时间维度">
|
|
<el-table-column :resizable="true" :sortable="true" prop="dimension" label="时间维度">
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- {{ scope.row.dimension=='daily'?'按日':(scope.row.dimension=='monthly'?'按月':'按年')}}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ scope.row.dimension == 'daily' ? '按日' : scope.row.dimension == 'monthly' ? '按月' : '按年' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="startTime" label="开始时间" />
|
|
<el-table-column :resizable="true" :sortable="true" prop="startTime" label="开始时间" />
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="endTime" label="结束时间" />
|
|
<el-table-column :resizable="true" :sortable="true" prop="endTime" label="结束时间" />
|
|
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="userGrowthRate" label="用户增长率">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ scope.row.userGrowthRate + '%' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="userCount" label="当前用户数量" />
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="result" label="预测结果">
|
|
<el-table-column :resizable="true" :sortable="true" prop="result" label="预测结果">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.result=='0'?'待预测':(scope.row.result=='1'?'成功':'失败')}}
|
|
|
|
|
|
|
+ {{ scope.row.result == '0' ? '待预测' : scope.row.result == '1' ? '成功' : '失败' }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column :resizable="true" :sortable="true" prop="execTime" label="执行时间">
|
|
<el-table-column :resizable="true" :sortable="true" prop="execTime" label="执行时间">
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- {{ scope.row.execTime==null?'---': scope.row.execTime}}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :resizable="true" :sortable="true" prop="createTime" label="添加时间" />
|
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ scope.row.execTime == null ? '---' : scope.row.execTime }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="createTime" label="添加时间" />
|
|
|
<el-table-column width="300" label="操作">
|
|
<el-table-column width="300" label="操作">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-button class="view" type="success" @click="handleForecastingDetail(scope.row.id)">
|
|
|
|
|
|
|
+ <el-button class="view" type="success" @click="handleForecastingDetail(scope.row)">
|
|
|
<span
|
|
<span
|
|
|
class="icon iconfont icon-xihuan"
|
|
class="icon iconfont icon-xihuan"
|
|
|
:style="{ margin: '0 2px', fontSize: '14px', color: '#fff', display: 'none', height: '40px' }"
|
|
:style="{ margin: '0 2px', fontSize: '14px', color: '#fff', display: 'none', height: '40px' }"
|
|
@@ -343,77 +325,36 @@
|
|
|
<script>
|
|
<script>
|
|
|
import addOrUpdate from './components/add-or-update.vue';
|
|
import addOrUpdate from './components/add-or-update.vue';
|
|
|
import forecastingDetail from './components/forecasting-detail.vue';
|
|
import forecastingDetail from './components/forecasting-detail.vue';
|
|
|
|
|
+import publicMixins from './publicMixins';
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
addOrUpdate,
|
|
addOrUpdate,
|
|
|
forecastingDetail,
|
|
forecastingDetail,
|
|
|
},
|
|
},
|
|
|
|
|
+ mixins: [publicMixins],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
showFlag: false,
|
|
showFlag: false,
|
|
|
showForecastingFlag: false,
|
|
showForecastingFlag: false,
|
|
|
searchForm: {
|
|
searchForm: {
|
|
|
- subId: '',
|
|
|
|
|
- regionId: '',
|
|
|
|
|
|
|
+ substationId: null,
|
|
|
|
|
+ regionId: null,
|
|
|
dateRange: [],
|
|
dateRange: [],
|
|
|
},
|
|
},
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
- subList: [],
|
|
|
|
|
pageIndex: 1,
|
|
pageIndex: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
totalPage: 0,
|
|
totalPage: 0,
|
|
|
dataListLoading: false,
|
|
dataListLoading: false,
|
|
|
dataListSelections: [],
|
|
dataListSelections: [],
|
|
|
layouts: ['prev', 'pager', 'next', 'sizes'],
|
|
layouts: ['prev', 'pager', 'next', 'sizes'],
|
|
|
- compList: [],
|
|
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
- this.getCompList();
|
|
|
|
|
|
|
+ async created() {
|
|
|
|
|
+ await this.getRegionList();
|
|
|
this.getDataList();
|
|
this.getDataList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- // 获取变电站列表
|
|
|
|
|
- async getSubList() {
|
|
|
|
|
- this.subList = [];
|
|
|
|
|
- let params = {
|
|
|
|
|
- page: this.pageIndex,
|
|
|
|
|
- limit: this.pageSize,
|
|
|
|
|
- sort: 'id',
|
|
|
|
|
- order: 'desc',
|
|
|
|
|
- compId: this.searchForm.compId,
|
|
|
|
|
- };
|
|
|
|
|
- const { data } = await this.$http({
|
|
|
|
|
- url: '/sub/page',
|
|
|
|
|
- method: 'get',
|
|
|
|
|
- params: params,
|
|
|
|
|
- });
|
|
|
|
|
- if (data && data.code === 0) {
|
|
|
|
|
- this.subList = data.data.list.map(item => ({
|
|
|
|
|
- label: item.subName,
|
|
|
|
|
- value: String(item.id),
|
|
|
|
|
- }));
|
|
|
|
|
- this.searchForm.subId = undefined;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 获取公司列表
|
|
|
|
|
- async getCompList() {
|
|
|
|
|
- this.regionList = [];
|
|
|
|
|
- const { data } = await this.$http({
|
|
|
|
|
- url: `/company/lists`,
|
|
|
|
|
- method: 'get',
|
|
|
|
|
- });
|
|
|
|
|
- if (data && data.code === 0) {
|
|
|
|
|
- this.regionList = data.data.map(item => ({
|
|
|
|
|
- label: item.compName,
|
|
|
|
|
- value: String(item.id),
|
|
|
|
|
- }));
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- search() {
|
|
|
|
|
- this.pageIndex = 1;
|
|
|
|
|
- this.getDataList();
|
|
|
|
|
- },
|
|
|
|
|
// 获取数据列表
|
|
// 获取数据列表
|
|
|
getDataList() {
|
|
getDataList() {
|
|
|
this.dataListLoading = true;
|
|
this.dataListLoading = true;
|
|
@@ -441,6 +382,10 @@ export default {
|
|
|
this.dataListLoading = false;
|
|
this.dataListLoading = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ search() {
|
|
|
|
|
+ this.pageIndex = 1;
|
|
|
|
|
+ this.getDataList();
|
|
|
|
|
+ },
|
|
|
// 每页数
|
|
// 每页数
|
|
|
sizeChangeHandle(val) {
|
|
sizeChangeHandle(val) {
|
|
|
this.pageSize = val;
|
|
this.pageSize = val;
|
|
@@ -460,10 +405,41 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 详情页
|
|
// 详情页
|
|
|
- handleForecastingDetail(id) {
|
|
|
|
|
|
|
+ handleForecastingDetail(row) {
|
|
|
|
|
+ if (row.result != '1') {
|
|
|
|
|
+ this.$message.error('该条数据未完成预测,不能查看详情');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.showForecastingFlag = true;
|
|
this.showForecastingFlag = true;
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.forecastingDetail.init(id);
|
|
|
|
|
|
|
+ this.$refs.forecastingDetail.init(row.id);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 预测
|
|
|
|
|
+ predictHandler(id) {
|
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '预测中...',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)',
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$http({
|
|
|
|
|
+ url: `/voltageLoad/predict/${id}`,
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ }).then(({ data }) => {
|
|
|
|
|
+ if (data && data.code === 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: '预测成功',
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ });
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ this.getDataList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: data.msg || '预测失败',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ });
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
/// 删除
|
|
/// 删除
|