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