projects/mesxc-lb #287
@ -1,10 +1,3 @@
|
|||||||
/*
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-01-29 17:05:25
|
|
||||||
* @LastEditTime: 2024-01-29 17:05:25
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* 发起websocket请求函数
|
* 发起websocket请求函数
|
||||||
* @param {string} url ws连接地址
|
* @param {string} url ws连接地址
|
||||||
@ -49,7 +42,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
|
|||||||
this.lockReconnect = true;
|
this.lockReconnect = true;
|
||||||
this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
|
this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
|
||||||
// 关闭心跳检查
|
// 关闭心跳检查
|
||||||
// heartCheck.stop();
|
heartCheck.stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const initWsEventHandle = () => {
|
const initWsEventHandle = () => {
|
||||||
@ -57,13 +50,13 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
|
|||||||
// 连接成功
|
// 连接成功
|
||||||
this.wsObj.onopen = (event) => {
|
this.wsObj.onopen = (event) => {
|
||||||
onWsOpen(event);
|
onWsOpen(event);
|
||||||
// heartCheck.start();
|
heartCheck.start();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 监听服务器端返回的信息
|
// 监听服务器端返回的信息
|
||||||
this.wsObj.onmessage = (event) => {
|
this.wsObj.onmessage = (event) => {
|
||||||
onWsMessage(event);
|
onWsMessage(event);
|
||||||
// heartCheck.start();
|
heartCheck.start();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.wsObj.onclose = (event) => {
|
this.wsObj.onclose = (event) => {
|
||||||
@ -130,7 +123,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
|
|||||||
if (this.lockReconnect) {
|
if (this.lockReconnect) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
writeToScreen("3秒后重连");
|
writeToScreen("5秒后重连");
|
||||||
this.lockReconnect = true;
|
this.lockReconnect = true;
|
||||||
// 没连接上会一直重连,设置延迟避免请求过多
|
// 没连接上会一直重连,设置延迟避免请求过多
|
||||||
this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
|
this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
|
||||||
@ -139,10 +132,40 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
|
|||||||
this.createWebSoket();
|
this.createWebSoket();
|
||||||
this.lockReconnect = false;
|
this.lockReconnect = false;
|
||||||
writeToScreen("重连完成");
|
writeToScreen("重连完成");
|
||||||
}, 3000);
|
}, 5000);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 心跳检查(看看websocket是否还在正常连接中)
|
// 心跳检查(看看websocket是否还在正常连接中,不需要服务端返回,单向的)
|
||||||
|
let _this = this
|
||||||
|
let heartCheck = {
|
||||||
|
timeout: 55000,
|
||||||
|
timeoutObj: null,
|
||||||
|
// 重启
|
||||||
|
reset() {
|
||||||
|
clearTimeout(this.timeoutObj);
|
||||||
|
this.start();
|
||||||
|
},
|
||||||
|
// 停止
|
||||||
|
stop() {
|
||||||
|
clearTimeout(this.timeoutObj);
|
||||||
|
},
|
||||||
|
// 开启定时器
|
||||||
|
start() {
|
||||||
|
this.timeoutObj && clearTimeout(this.timeoutObj);
|
||||||
|
this.timeoutObj = setTimeout(() => {
|
||||||
|
writeToScreen("心跳检查,发送ping到后台");
|
||||||
|
try {
|
||||||
|
const datas = { ping: true };
|
||||||
|
_this.wsObj.send(JSON.stringify(datas));
|
||||||
|
} catch (err) {
|
||||||
|
writeToScreen("发送ping异常");
|
||||||
|
}
|
||||||
|
}, this.timeout);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 心跳检查(看看websocket是否还在正常连接中,和服务端通信,双向的)
|
||||||
// let heartCheck = {
|
// let heartCheck = {
|
||||||
// timeout: 15000,
|
// timeout: 15000,
|
||||||
// timeoutObj: null,
|
// timeoutObj: null,
|
||||||
@ -167,7 +190,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
|
|||||||
// writeToScreen("心跳检查,发送ping到后台");
|
// writeToScreen("心跳检查,发送ping到后台");
|
||||||
// try {
|
// try {
|
||||||
// const datas = { ping: true };
|
// const datas = { ping: true };
|
||||||
// this.wsObj.send(JSON.stringify(datas));
|
// _this.wsObj.send(JSON.stringify(datas));
|
||||||
// } catch (err) {
|
// } catch (err) {
|
||||||
// writeToScreen("发送ping异常");
|
// writeToScreen("发送ping异常");
|
||||||
// }
|
// }
|
||||||
|
@ -36,7 +36,8 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objCode',
|
||||||
label: '对象编码'
|
label: '对象编码',
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'plcTableName',
|
prop: 'plcTableName',
|
||||||
|
@ -46,7 +46,8 @@ const tableProps = [
|
|||||||
prop: 'tableName',
|
prop: 'tableName',
|
||||||
label: '能源表名',
|
label: '能源表名',
|
||||||
filter: publicFormatter('table_name'),
|
filter: publicFormatter('table_name'),
|
||||||
minWidth: 110
|
minWidth: 110,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'recordTime',
|
prop: 'recordTime',
|
||||||
|
@ -20,15 +20,18 @@ import * as XLSX from 'xlsx/xlsx.mjs'
|
|||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'objName',
|
prop: 'objName',
|
||||||
label: '统计对象'
|
label: '统计对象',
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objCode',
|
||||||
label: '对象编码'
|
label: '对象编码',
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyTypeName',
|
prop: 'energyTypeName',
|
||||||
label: '能源类型'
|
label: '能源类型',
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'startValue',
|
prop: 'startValue',
|
||||||
|
@ -2,46 +2,23 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<search-bar
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table
|
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||||
:page="queryParams.pageNo"
|
:max-height="tableH">
|
||||||
:limit="queryParams.pageSize"
|
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="160" label="操作" :method-list="tableBtn"
|
||||||
:table-props="tableProps"
|
@clickBtn="handleClick" />
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
>
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="160"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick"
|
|
||||||
/>
|
|
||||||
</base-table>
|
</base-table>
|
||||||
<pagination
|
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||||
:page.sync="queryParams.pageNo"
|
@pagination="getList" />
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<base-dialog
|
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
|
||||||
:dialogTitle="addOrEditTitle"
|
@confirm="handleConfirm" :before-close="handleCancel">
|
||||||
:dialogVisible="centervisible"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
:before-close="handleCancel"
|
|
||||||
>
|
|
||||||
<energy-statistics-add ref="energyStatistics" @successSubmit="successSubmit" />
|
<energy-statistics-add ref="energyStatistics" @successSubmit="successSubmit" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
<!-- 参数绑定/查看 -->
|
<!-- 参数绑定/查看 -->
|
||||||
<energy-statistics-det ref="plcParam" @closeDrawer="closeDrawer" :energyTypeList="energyTypeList"></energy-statistics-det>
|
<energy-statistics-det ref="plcParam" @closeDrawer="closeDrawer"
|
||||||
|
:energyTypeList="energyTypeList"></energy-statistics-det>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -63,7 +40,7 @@ const tableProps = [
|
|||||||
showOverflowtooltip: true
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
label: '统计类型',
|
label: '统计类型',
|
||||||
filter: publicFormatter('statistic_type')
|
filter: publicFormatter('statistic_type')
|
||||||
},
|
},
|
||||||
@ -81,7 +58,7 @@ const tableProps = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
name: "energyStatistics",
|
name: "EnergyStatistics",
|
||||||
components: { EnergyStatisticsAdd, EnergyStatisticsDet },
|
components: { EnergyStatisticsAdd, EnergyStatisticsDet },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -112,26 +89,26 @@ export default {
|
|||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('monitoring:energy-statistics:bind')
|
this.$auth.hasPermi('monitoring:energy-statistics:bind')
|
||||||
? {
|
? {
|
||||||
type: 'connect',
|
type: 'connect',
|
||||||
btnName: '绑定'
|
btnName: '绑定'
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
{
|
{
|
||||||
type: 'detail',
|
type: 'detail',
|
||||||
btnName: '详情'
|
btnName: '详情'
|
||||||
},
|
},
|
||||||
this.$auth.hasPermi('monitoring:energy-statistics:update')
|
this.$auth.hasPermi('monitoring:energy-statistics:update')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑'
|
btnName: '编辑'
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('monitoring:energy-statistics:delete')
|
this.$auth.hasPermi('monitoring:energy-statistics:delete')
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除'
|
btnName: '删除'
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableH: this.tableHeight(260),
|
tableH: this.tableHeight(260),
|
||||||
@ -224,13 +201,13 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除方案名称为"' + row.name + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除方案名称为"' + row.name + '"的数据项?').then(function () {
|
||||||
return deleteEnergyStatistics(row.id);
|
return deleteEnergyStatistics(row.id);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
closeDrawer() {
|
closeDrawer() {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-01-24 15:15:24
|
* @Date: 2024-01-24 15:15:24
|
||||||
* @LastEditTime: 2024-03-26 17:56:11
|
* @LastEditTime: 2024-03-27 09:27:23
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -16,9 +16,9 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-month:query')" type="primary" size="small"
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||||
@click="getDataList">查询</el-button>
|
@click="getDataList">查询</el-button>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
|
<el-button v-if="this.$auth.hasPermi('report:glass-day:export')" type="primary" size="small" plain
|
||||||
@click="handleExport">导出</el-button>
|
@click="handleExport">导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2023-12-13 14:10:04
|
* @Date: 2023-12-13 14:10:04
|
||||||
* @LastEditTime: 2024-03-22 09:45:23
|
* @LastEditTime: 2024-03-27 09:22:51
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -206,12 +206,10 @@ const cols = [
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleReturn() {
|
handleReturn() {
|
||||||
// this.disabled = true
|
|
||||||
this.edit = false
|
this.edit = false
|
||||||
|
console.log(this.$parent.getDataList());
|
||||||
},
|
},
|
||||||
handleChange(e) {
|
handleChange(e) {
|
||||||
// console.log(q)
|
|
||||||
console.log(e);
|
|
||||||
},
|
},
|
||||||
updateData() {
|
updateData() {
|
||||||
let obj = {}
|
let obj = {}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-month:query')" type="primary" size="small"
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||||
@click="getDataList">查询</el-button>
|
@click="getDataList">查询</el-button>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
|
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
|
||||||
@click="handleExport">导出</el-button>
|
@click="handleExport">导出</el-button>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:query')" type="primary" size="small"
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||||
@click="getDataList">查询</el-button>
|
@click="getDataList">查询</el-button>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:export')" type="primary" size="small" plain
|
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:export')" type="primary" size="small" plain
|
||||||
@click="handleExport">导出</el-button>
|
@click="handleExport">导出</el-button>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-year:query')" type="primary" size="small"
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||||
@click="getDataList">查询</el-button>
|
@click="getDataList">查询</el-button>
|
||||||
<el-button v-if="this.$auth.hasPermi('report:glass-year:export')" type="primary" size="small" plain
|
<el-button v-if="this.$auth.hasPermi('report:glass-year:export')" type="primary" size="small" plain
|
||||||
@click="handleExport">导出</el-button>
|
@click="handleExport">导出</el-button>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-12 13:45:25
|
* @Date: 2023-12-12 13:45:25
|
||||||
* @LastEditTime: 2024-03-26 09:41:07
|
* @LastEditTime: 2024-03-27 09:21:00
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -456,6 +456,8 @@ export default {
|
|||||||
handleReturn() {
|
handleReturn() {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
this.isSave = false
|
this.isSave = false
|
||||||
|
this.getDataList()
|
||||||
|
|
||||||
},
|
},
|
||||||
format(shijianchuo) {
|
format(shijianchuo) {
|
||||||
//shijianchuo是整数,否则要parseInt转换
|
//shijianchuo是整数,否则要parseInt转换
|
||||||
|
Loading…
Reference in New Issue
Block a user