Merge branch 'master' of http://192.168.4.125:32792/04787/smart-power-ui
This commit is contained in:
commit
fc7e4658a4
Binary file not shown.
|
@ -20,7 +20,7 @@ export function getContract(contractId) {
|
|||
// 新增电价合同
|
||||
export function addContract(data) {
|
||||
return request({
|
||||
url: '/iot/contract',
|
||||
url: '/iot/contract/addContract',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
|
@ -23,3 +23,27 @@ export function monthOnCircleEnergy(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function exportEnergy(query) {
|
||||
return request({
|
||||
url: '/iot/stat/exportProjectEnergy',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function exportOnMonth(query) {
|
||||
return request({
|
||||
url: '/iot/stat/exportMOMEnergy',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function exportOnCircle(query) {
|
||||
return request({
|
||||
url: '/iot/stat/exportMOCEnergy',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
|
@ -41,26 +41,16 @@
|
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['iot:record:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
|
|
@ -42,26 +42,16 @@
|
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['iot:record:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
@ -211,8 +201,8 @@ export default {
|
|||
beginTime: null,
|
||||
endTime: null,
|
||||
alarmDivide: "WARNING",
|
||||
isAsc: 'desc',
|
||||
orderByColumn: 'alarmTime'
|
||||
isAsc: "desc",
|
||||
orderByColumn: "alarmTime",
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
|
|
@ -371,9 +371,6 @@ export default {
|
|||
this.stompClient.onclose = this.socket_onclose;
|
||||
},
|
||||
socket_message(data) {
|
||||
console.log("wsljcg:=", data);
|
||||
// const data = JSON.parse(evt.data);
|
||||
// this.actualEnergyCensus = data.params || {};
|
||||
console.log("socket-message:", data);
|
||||
this.handleDeviceInfo(data);
|
||||
this.$forceUpdate();
|
||||
|
|
|
@ -371,8 +371,8 @@ export default {
|
|||
},
|
||||
// 处理 socket 数据返回 赋值问题
|
||||
handleDeviceInfo(param) {
|
||||
console.log( this.list)
|
||||
if (this.list && this.list.length > 0) {
|
||||
// let result = this.list.filter(v => { if (v['deviceKey'] === param['deviceKey']) { return v }});
|
||||
this.list = this.list.map((v) => {
|
||||
if (v["deviceKey"] === param["deviceKey"]) {
|
||||
return Object.assign(v, param);
|
||||
|
|
|
@ -36,6 +36,14 @@
|
|||
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
> -->
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
@ -194,6 +202,12 @@ export default {
|
|||
this.$refs.chainTemplate[0].getChartList();
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
if (this.$refs.chainTemplate) {
|
||||
this.$refs.chainTemplate[0].handleExport();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { monthOnCircleEnergy } from "@/api/iot/staistics";
|
||||
import { monthOnCircleEnergy, exportOnCircle } from "@/api/iot/staistics";
|
||||
import EEchartsBar from "@/components/Echarts/EEchartsBar";
|
||||
export default {
|
||||
name: "ChainTemplate",
|
||||
|
@ -206,6 +206,28 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
if (this.energyType && this.params.year) {
|
||||
const queryParams = Object.assign(
|
||||
{
|
||||
energyType: this.energyType,
|
||||
},
|
||||
this.params
|
||||
);
|
||||
this.$confirm("是否确认导出数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return exportOnCircle(queryParams);
|
||||
})
|
||||
.then((response) => {
|
||||
this.download(response.msg);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -43,6 +43,14 @@
|
|||
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
> -->
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
@ -208,6 +216,12 @@ export default {
|
|||
this.$refs.comparedTemplate[0].getChartList();
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
if (this.$refs.comparedTemplate) {
|
||||
this.$refs.comparedTemplate[0].handleExport();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -25,14 +25,22 @@
|
|||
></el-table-column>
|
||||
<el-table-column label="项目名称" align="left" prop="projectName" />
|
||||
<el-table-column label="日期" align="left" prop="date" />
|
||||
<el-table-column :label="`本期用量 (${unit})`" align="center" prop="homochronousValue" >
|
||||
<el-table-column
|
||||
:label="`本期用量 (${unit})`"
|
||||
align="center"
|
||||
prop="homochronousValue"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea">{{
|
||||
Number(scope.row.homochronousValue).toFixed(2) || "--"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="`同期用量 (${unit})`" align="center" prop="currentPeriodValue">
|
||||
<el-table-column
|
||||
:label="`同期用量 (${unit})`"
|
||||
align="center"
|
||||
prop="currentPeriodValue"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea">{{
|
||||
Number(scope.row.currentPeriodValue).toFixed(2) || "--"
|
||||
|
@ -48,9 +56,9 @@
|
|||
</el-table-column>
|
||||
<el-table-column :label="`增长率`" align="center" prop="coal">
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea">{{
|
||||
Number(scope.row.increaseRate).toFixed(2) || "--"
|
||||
}} %</span>
|
||||
<span class="lay-table-textarea"
|
||||
>{{ Number(scope.row.increaseRate).toFixed(2) || "--" }} %</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -58,7 +66,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { monthOnMonthEnergy } from "@/api/iot/staistics";
|
||||
import { monthOnMonthEnergy, exportOnMonth } from "@/api/iot/staistics";
|
||||
import EEchartsBar from "@/components/Echarts/EEchartsBar";
|
||||
export default {
|
||||
name: "ComparedTemplate",
|
||||
|
@ -169,9 +177,9 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
'xAxis': xAxis,
|
||||
'seriesFast': seriesFast,
|
||||
'seriesLast': seriesLast,
|
||||
xAxis: xAxis,
|
||||
seriesFast: seriesFast,
|
||||
seriesLast: seriesLast,
|
||||
};
|
||||
},
|
||||
getChartList() {
|
||||
|
@ -197,6 +205,26 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = Object.assign(
|
||||
{
|
||||
energyType: this.energyType,
|
||||
},
|
||||
this.params
|
||||
);
|
||||
this.$confirm("是否确认导出数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return exportOnMonth(queryParams);
|
||||
})
|
||||
.then((response) => {
|
||||
this.download(response.msg);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
|
@ -31,46 +31,69 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<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
|
||||
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
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<!-- :default-sort="{prop: 'createTime', order: 'descending'}"
|
||||
@sort-change="sortChange" -->
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
align="center"
|
||||
:index="(val) => {
|
||||
return ( val + 1 + (queryParams.pageNum - 1) * queryParams.pageSize )
|
||||
}"
|
||||
:index="
|
||||
(val) => {
|
||||
return val + 1 + (queryParams.pageNum - 1) * queryParams.pageSize;
|
||||
}
|
||||
"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
<el-table-column label="项目ID" align="left" prop="projectName" />
|
||||
<el-table-column label="项目名称" align="left" prop="projectName" />
|
||||
<el-table-column label="电用量 (kwh)" align="center" prop="electric" >
|
||||
<el-table-column label="电用量 (kwh)" align="center" prop="electric">
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea">{{ Number(scope.row.electric).toFixed(2) || '--' }}</span>
|
||||
<span class="lay-table-textarea">{{
|
||||
Number(scope.row.electric).toFixed(2) || "--"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="水用量 (吨)" align="center" prop="electric" >
|
||||
<el-table-column label="水用量 (吨)" align="center" prop="water">
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea">{{ Number(0).toFixed(2) || '--' }}</span>
|
||||
<span class="lay-table-textarea">{{
|
||||
Number(scope.row.water).toFixed(2) || "--"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="气用量 (m³)" align="center" prop="electric" >
|
||||
<el-table-column label="气用量 (m³)" align="center" prop="gas">
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea">{{ Number(0).toFixed(2) || '--' }}</span>
|
||||
<span class="lay-table-textarea">{{
|
||||
Number(scope.row.gas).toFixed(2) || "--"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="碳排放 (吨)" align="center" prop="coal" >
|
||||
<el-table-column label="碳排放 (吨)" align="center" prop="coal">
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea">{{ Number(scope.row.coal).toFixed(2) || '--' }}</span>
|
||||
<span class="lay-table-textarea">{{
|
||||
Number(scope.row.coal).toFixed(2) || "--"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -82,27 +105,26 @@
|
|||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { projectEnergy } from '@/api/iot/staistics'
|
||||
import { projectEnergy, exportEnergy } from "@/api/iot/staistics";
|
||||
export default {
|
||||
name: 'EStatisticsEnergy',
|
||||
name: "EStatisticsEnergy",
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
queryParams: {
|
||||
projectName: '',
|
||||
projectName: "",
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
ed: '',
|
||||
sd: ''
|
||||
ed: "",
|
||||
sd: "",
|
||||
},
|
||||
time: [],
|
||||
loading: false,
|
||||
tableList: []
|
||||
|
||||
}
|
||||
tableList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
@ -110,8 +132,8 @@ export default {
|
|||
methods: {
|
||||
timeChange(val) {
|
||||
if (val) {
|
||||
this.queryParams.sd = this.parseTime(val[0], '{y}:{m}:{d} {h}:{i}:{s}');
|
||||
this.queryParams.ed = this.parseTime(val[1], '{y}:{m}:{d} {h}:{i}:{s}');
|
||||
this.queryParams.sd = this.parseTime(val[0], "{y}:{m}:{d} {h}:{i}:{s}");
|
||||
this.queryParams.ed = this.parseTime(val[1], "{y}:{m}:{d} {h}:{i}:{s}");
|
||||
} else {
|
||||
this.queryParams.sd = "";
|
||||
this.queryParams.ed = "";
|
||||
|
@ -121,7 +143,7 @@ export default {
|
|||
sortChange(column) {
|
||||
const sort = {
|
||||
isAsc: column.order === "descending" ? "desc" : "asc",
|
||||
orderByColumn: column.prop
|
||||
orderByColumn: column.prop,
|
||||
};
|
||||
this.queryParams = Object.assign(this.queryParams, sort);
|
||||
this.handleQuery();
|
||||
|
@ -142,12 +164,27 @@ export default {
|
|||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
projectEnergy(Object.assign(this.queryParams)).then(res => {
|
||||
projectEnergy(Object.assign(this.queryParams)).then((res) => {
|
||||
this.tableList = res.rows;
|
||||
this.total = res.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm("是否确认导出数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return exportEnergy(queryParams);
|
||||
})
|
||||
.then((response) => {
|
||||
this.download(response.msg);
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -114,35 +114,36 @@
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div class="trigger-dialog">
|
||||
<el-dialog
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
<div>
|
||||
<dialog-template
|
||||
title="触发器详情"
|
||||
width="40%"
|
||||
:visible.sync="triggerDetailsDialog"
|
||||
:visible="triggerDetailsDialog"
|
||||
@close="triggerDetailsDialog = false"
|
||||
top="5vh"
|
||||
>
|
||||
<!-- <triggerDetails v-if="triggerDetailsDialog === true" :triggerId="tempModel.triggerId"></triggerDetails> -->
|
||||
</el-dialog>
|
||||
<!-- <triggerDetails slot="dialog-center" v-if="triggerDetailsDialog === true" :triggerId="tempModel.triggerId"></triggerDetails> -->
|
||||
</dialog-template>
|
||||
|
||||
<!-- 新增触发器dialog -->
|
||||
<el-dialog
|
||||
<dialog-template
|
||||
class="trigger-d-dialog"
|
||||
:close-on-click-modal="false"
|
||||
title="新增触发器"
|
||||
width="900px"
|
||||
:visible.sync="outerVisible"
|
||||
:visible="outerVisible"
|
||||
@close="outerVisible = false"
|
||||
append-to-body
|
||||
>
|
||||
<component
|
||||
slot="dialog-center"
|
||||
v-if="outerVisible"
|
||||
:is="componectVal"
|
||||
:type="childOpt.type"
|
||||
:triggerId="childOpt.triggerId"
|
||||
@recover="dialogRecover"
|
||||
></component>
|
||||
</el-dialog>
|
||||
</dialog-template>
|
||||
</div>
|
||||
|
||||
<!-- <div
|
||||
|
@ -177,11 +178,13 @@ import { listTrigger, delTrigger } from "@/api/iot/trigger";
|
|||
// // import { openDetailsPage } from '@/util/util'
|
||||
import InsertTriggerDialog from "./profile/insertTriggerDialog";
|
||||
import { listAlarmType } from "@/api/alarm/alarmType";
|
||||
import DialogTemplate from "@/components/DialogTemplate";
|
||||
export default {
|
||||
name: "Rule",
|
||||
components: {
|
||||
// TriggerDetails,
|
||||
InsertTriggerDialog
|
||||
InsertTriggerDialog,
|
||||
DialogTemplate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -43,26 +43,16 @@
|
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['tenant:record:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
|
|
@ -42,26 +42,16 @@
|
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['tenant:record:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
|
Loading…
Reference in New Issue