diff --git a/bin/Release/D3Dcompiler_47.dll b/bin/Release/D3Dcompiler_47.dll index 56512f5..e5bf5cf 100644 Binary files a/bin/Release/D3Dcompiler_47.dll and b/bin/Release/D3Dcompiler_47.dll differ diff --git a/bin/Release/EES.exe b/bin/Release/EES.exe index c3f37ed..a68f22d 100644 Binary files a/bin/Release/EES.exe and b/bin/Release/EES.exe differ diff --git a/bin/Release/EES.pdb b/bin/Release/EES.pdb new file mode 100644 index 0000000..c383a7e Binary files /dev/null and b/bin/Release/EES.pdb differ diff --git a/bin/Release/EES_20250410.exe b/bin/Release/EES_20250410.exe deleted file mode 100644 index ef38c83..0000000 Binary files a/bin/Release/EES_20250410.exe and /dev/null differ diff --git a/bin/Release/Qt5Charts.dll b/bin/Release/Qt5Charts.dll index e74eb6b..ff40047 100644 Binary files a/bin/Release/Qt5Charts.dll and b/bin/Release/Qt5Charts.dll differ diff --git a/bin/Release/Qt5Core.dll b/bin/Release/Qt5Core.dll index 40e8de1..46cee93 100644 Binary files a/bin/Release/Qt5Core.dll and b/bin/Release/Qt5Core.dll differ diff --git a/bin/Release/Qt5Gui.dll b/bin/Release/Qt5Gui.dll index bf38dda..3931732 100644 Binary files a/bin/Release/Qt5Gui.dll and b/bin/Release/Qt5Gui.dll differ diff --git a/bin/Release/Qt5Network.dll b/bin/Release/Qt5Network.dll index d32644d..800a355 100644 Binary files a/bin/Release/Qt5Network.dll and b/bin/Release/Qt5Network.dll differ diff --git a/bin/Release/Qt5Positioning.dll b/bin/Release/Qt5Positioning.dll index ec9e17d..5ac30ab 100644 Binary files a/bin/Release/Qt5Positioning.dll and b/bin/Release/Qt5Positioning.dll differ diff --git a/bin/Release/Qt5PrintSupport.dll b/bin/Release/Qt5PrintSupport.dll index de4c30b..05f7816 100644 Binary files a/bin/Release/Qt5PrintSupport.dll and b/bin/Release/Qt5PrintSupport.dll differ diff --git a/bin/Release/Qt5Qml.dll b/bin/Release/Qt5Qml.dll index 7c2e538..599828f 100644 Binary files a/bin/Release/Qt5Qml.dll and b/bin/Release/Qt5Qml.dll differ diff --git a/bin/Release/Qt5QmlModels.dll b/bin/Release/Qt5QmlModels.dll index a0497d3..b1a17cf 100644 Binary files a/bin/Release/Qt5QmlModels.dll and b/bin/Release/Qt5QmlModels.dll differ diff --git a/bin/Release/Qt5Quick.dll b/bin/Release/Qt5Quick.dll index 4ff0bc6..3e78a2f 100644 Binary files a/bin/Release/Qt5Quick.dll and b/bin/Release/Qt5Quick.dll differ diff --git a/bin/Release/Qt5QuickWidgets.dll b/bin/Release/Qt5QuickWidgets.dll index 11214e8..43a5314 100644 Binary files a/bin/Release/Qt5QuickWidgets.dll and b/bin/Release/Qt5QuickWidgets.dll differ diff --git a/bin/Release/Qt5SerialPort.dll b/bin/Release/Qt5SerialPort.dll index b72028e..a32d7a6 100644 Binary files a/bin/Release/Qt5SerialPort.dll and b/bin/Release/Qt5SerialPort.dll differ diff --git a/bin/Release/Qt5Svg.dll b/bin/Release/Qt5Svg.dll index edfbf4a..5cc39ac 100644 Binary files a/bin/Release/Qt5Svg.dll and b/bin/Release/Qt5Svg.dll differ diff --git a/bin/Release/Qt5WebChannel.dll b/bin/Release/Qt5WebChannel.dll index a14cff6..d61eae4 100644 Binary files a/bin/Release/Qt5WebChannel.dll and b/bin/Release/Qt5WebChannel.dll differ diff --git a/bin/Release/Qt5WebEngineCore.dll b/bin/Release/Qt5WebEngineCore.dll index 7ac3371..e74a56b 100644 Binary files a/bin/Release/Qt5WebEngineCore.dll and b/bin/Release/Qt5WebEngineCore.dll differ diff --git a/bin/Release/Qt5WebEngineWidgets.dll b/bin/Release/Qt5WebEngineWidgets.dll index 6dcafb9..eb77a19 100644 Binary files a/bin/Release/Qt5WebEngineWidgets.dll and b/bin/Release/Qt5WebEngineWidgets.dll differ diff --git a/bin/Release/Qt5Widgets.dll b/bin/Release/Qt5Widgets.dll index 80ae4e3..98f4870 100644 Binary files a/bin/Release/Qt5Widgets.dll and b/bin/Release/Qt5Widgets.dll differ diff --git a/bin/Release/QtWebEngineProcess.exe b/bin/Release/QtWebEngineProcess.exe index 25a867f..024c22b 100644 Binary files a/bin/Release/QtWebEngineProcess.exe and b/bin/Release/QtWebEngineProcess.exe differ diff --git a/bin/Release/WSES.exe b/bin/Release/WSES.exe deleted file mode 100644 index f6c8d2d..0000000 Binary files a/bin/Release/WSES.exe and /dev/null differ diff --git a/bin/Release/assets/config/app.json b/bin/Release/assets/config/app.json new file mode 100644 index 0000000..9732221 --- /dev/null +++ b/bin/Release/assets/config/app.json @@ -0,0 +1,9 @@ +{ + "database": { + "host": "localhost", + "port": 3306, + "user": "root", + "passwd": "123456", + "dbname": "ees" + } +} \ No newline at end of file diff --git a/bin/Release/assets/html/css/mystyle.css b/bin/Release/assets/html/css/mystyle.css index e69de29..f336923 100644 --- a/bin/Release/assets/html/css/mystyle.css +++ b/bin/Release/assets/html/css/mystyle.css @@ -0,0 +1,454 @@ +/* 自定义滚动条样式 */ +div::-webkit-scrollbar { + width: 12px; +} + +div::-webkit-scrollbar-thumb { + background-color: #08536e60; + border-radius: 4px; +} + +div::-webkit-scrollbar-track { + background-color: #60606060; +} + +/******************************************************************************************************/ +.dt-container { + color: white; + font-size: 14px; + padding-left: 0px; +} + +/* div.dt-container .dt-paging { + margin-top: 10px; +} */ + +.dt-paging { + color: white; + margin-left: 0px; +} + +div.dt-container .dt-paging .dt-paging-button { + line-height: 28px; + /* width: 32px; */ + padding: 0 0px 0 0; + border: 1px solid white; + margin-right: 5px; + padding: 0 10px 0 10px; +} + +div.dt-container .dt-paging .dt-paging-button.disabled, +div.dt-container .dt-paging .dt-paging-button.disabled:hover, +div.dt-container .dt-paging .dt-paging-button.disabled:active { + color: white !important; + border: 1px solid gray; +} + +div.dt-container .dt-paging .dt-paging-button.current { + background: linear-gradient(to bottom, #1c797a 0%, #1c797a 100%); +} + +div.dt-container .dt-paging .dt-paging-button.current:hover { + background: linear-gradient(to bottom, #1c797a 0%, #1c797a 100%); +} + +div.dt-container .dt-paging .dt-paging-button:hover { + color: white !important; + border: 1px solid #111; + background-color: #111; + + /* Chrome,Safari4+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111)); + /* Chrome10+,Safari5.1+ */ + background: -webkit-linear-gradient(top, #585858 0%, #111 100%); + /* FF3.6+ */ + background: -moz-linear-gradient(top, #585858 0%, #111 100%); + /* IE10+ */ + background: -ms-linear-gradient(top, #585858 0%, #111 100%); + /* Opera 11.10+ */ + background: -o-linear-gradient(top, #585858 0%, #111 100%); + /* W3C */ + background: linear-gradient(to bottom, #1c797a 0%, #1c797a 100%); +} + +.mydt-ext { + display: flex; + flex-direction: row; + align-items: center; + margin-top: 10px; + /* justify-content: flex-start; */ +} + +.mydt-ext .item { + margin-right: 30px; +} + +/******************************************************************************************************/ + +/* table { + border: solid 2px #1c797a; + font-weight: bold; + color: white; + width: 100%; + text-align: center; + border-collapse: separate; + border-spacing: 0; +} + +tr, +th { + height: 60px; + border-right: solid 1px gray; + border-bottom: solid 1px gray; +} + +table thead { + background-color: #125c70; + height: 20px; +} + +table thead tr { + font-size: 14px; + height: 20px; +} + +table thead tr th { + height: 20px; + border-right: solid 1px gray; + border-bottom: solid 1px gray; +} + +table tbody tr { + height: 24px; + font-size: 13px; + font-weight: bold; +} + +table tbody tr td { + height: 24px; + border-right: solid 1px gray; + border-bottom: solid 1px gray; +} */ + +/* +td:last-child, +th:last-child { + border-right-color: transparent; +} + +td.details-control { + background: url('../assets/details_open.png') no-repeat center center; + cursor: pointer; +} + +tr.shown td.details-control { + background: url('../assets/details_close.png') no-repeat center center; +} +*/ + + + +#flex-sample { + display: flex; + /* 排列方向 flex-direction: row | row-reverse | column | column-reverse */ + flex-direction: column; + /* 换行方式 flex-wrap: nowrap(不换行) | wrap(换行,第一行在上面) | wrap-reverse(换行,第一行在下面) */ + flex-wrap: nowrap; + /* 是flex-direction属性和flex-wrap属性的简写形式,默认值为row nowrap */ + flex-flow: column nowrap; + /* 主轴上的对齐方式 justify-content: flex-start | flex-end | center | space-between | space-around */ + justify-content: center; + align-items: stretch; + /* flex-start | flex-end | center | baseline | stretch */ + align-content: flex-start; + /* flex-start | flex-end | center | space-between | space-around | stretch */ +} + +.mypanelstat { + /* width: 100%; */ + height: calc(90vh - 130px); + background-color: #052f4d; + /* margin-top: 10px; */ + /* padding: 10px 10px 10px 10px; */ + border-radius: 12px; +} + +.mask { + position: fixed; + left: 0px; + top: 0px; + width: 100%; + height: 100%; + font-size: 16px; + /* IE9以下不支持rgba模式 */ + background-color: rgba(0, 0, 0, 0.3); + /* 兼容IE8及以下 */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f000000, endColorstr=#7f000000); + /* 显示: block, 不显示:none overlay.style.display = 'block' */ + display: none; +} + +/* 弹出框主体 */ +.pop { + background-color: #e0e0e0; + min-width: 200px; + max-width: 600px; + height: 300px; + border-radius: 10px; + margin: 200px auto; + text-align: center; + /* overflow: hidden; */ +} + +/* 弹出框的标题 */ +.pop_title { + font-size: 28px; + font-weight: 1000; + height: 50px; + line-height: 50px; + background-color: #909090; + border-radius: 10px 10px 0 0; + /* border-bottom: solid 2px #8080ff; */ +} + +/* 弹出框的内容 */ +.pop_content { + height: 50px; + line-height: 50px; + padding: 15px 20px; + color: #198754; +} + +/* 弹出框的按钮栏 */ +.pop_btn { + padding-bottom: 10px; +} + +/* 弹出框的按钮 */ +.pop_btn button { + color: #778899; + width: 40%; + height: 40px; + cursor: pointer; + border: solid 1px #cccccc; + border-radius: 5px; + margin: 5px 10px; + color: #ffffff; + background-color: #337ab7; +} + +.myrow { + color: white; + display: flex; + flex-direction: row; + align-content: flex-start; +} + +.mycol { + color: white; + display: flex; + flex-direction: column; +} + +.myblock { + background-color: chocolate; + width: 50px; + height: 50px; + margin: 10px 0px 0px 10px; +} + +.mycardbtn { + background-color: #07486f; + border-radius: 10px; + margin: 0 10px 10px 10px; + padding: 10px 10px 10px 10px; +} + +.mycardbtn-active { + background-color: #1d6466; + border-radius: 10px; + margin: 0 10px 10px 10px; + padding: 10px 10px 10px 10px; + border: 2px solid #01b7d1; +} + +.mycardbtn:hover { + background-color: #1d6466; + cursor: pointer; +} + +.mycard { + background-color: #08365b; + width: 220px; + height: 340px; + border-radius: 10px; + margin: 10px 0px 0px 10px; + padding: 10px; + position: relative; +} + +.mycard-param { + display: flex; + margin-top: 3px; + font-size: 14px; + margin-left: 10px; +} + +.mycard-param-key { + font-weight: bold; + color: #a6b8dd; + width: 70px; +} + +.mycard-param-text { + font-weight: bold; + color: white; +} + +.status-ok { + background-color: green; + width: 14px; + height: 14px; + border-radius: 7px; +} + +.status-err { + background-color: red; + width: 14px; + height: 14px; + border-radius: 7px; +} + +.text-ok { + color: green; +} + +.text-err { + color: red; +} + +.mychart { + background-color: #30303030; +} + + +.mypanel { + width: 100%; + height: 200px; + background-color: #052f4d; + border-radius: 8px; + padding: 10px 10px 10px 10px; + margin: 0px 0px 10px 0px; + overflow: hidden; +} + +.mypanel-title { + height: 30px; + font-size: 16px; + font-weight: 1000; + color: #63c4d8; +} + +.myline-l { + /* 前 5px 红色, 5px 后剩余部分透明 */ + background: linear-gradient(#21ffd2, #21ffd2) left 2px / 5px 100% no-repeat; + padding-left: 16px; + height: 20px; +} + +.myline-b { + background: linear-gradient(to right, #09c8d3ff, transparent) bottom / 100% 3px no-repeat; + padding-bottom: 5px; +} + +.myline-lb { + /* 左侧 5px + 底部 3px 渐变透明 */ + background: + linear-gradient(#21ffd2, #21ffd2) left 3px / 5px calc(100% - 12px) no-repeat, + linear-gradient(to right, #09c8d3ff, transparent) bottom / 100% 3px no-repeat; + padding-bottom: 5px; + padding-left: 16px; + padding-top: 0px; +} + + +.label-bkg { + border-radius: 5px; + background-color: #a0a0a010; + float: left; + /* margin-right: 10px; */ +} + +.label-key { + /* border: solid 1px white; */ + width: 100%; + height: 50%; + font-size: 14px; + font-weight: 1000; + color: white; + text-align: center; + display: flex; + justify-content: center; + align-items: center; +} + +.label-val-lg { + /* border: solid 1px white; */ + width: 65%; + height: 50%; + font-size: 36px; + color: #4dd7f0; + float: left; + display: flex; + justify-content: flex-end; + align-items: flex-end; + text-align: right; +} + +.label-val { + /* border: solid 1px white; */ + width: 65%; + height: 50%; + font-size: 20px; + color: #4dd7f0; + float: left; + display: flex; + justify-content: flex-end; + align-items: flex-end; +} + +.label-tail { + /* border: solid 1px white; */ + padding-left: 10px; + width: 35%; + height: 45%; + font-size: 16px; + font-weight: 1000; + color: white; + display: flex; + justify-content: left; + align-items: flex-end; +} + +#maskTest { + position: absolute; + z-index: 1; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.page { + padding: 5px 8px 5px 8px; +} + + + +.btn-default { + background-color: #a5a5a5; +} + +.btn-default:hover { + background-color: #858585; +} \ No newline at end of file diff --git a/bin/Release/assets/html/font/优设标题黑.ttf b/bin/Release/assets/html/font/优设标题黑.ttf new file mode 100644 index 0000000..3729151 Binary files /dev/null and b/bin/Release/assets/html/font/优设标题黑.ttf differ diff --git a/bin/Release/assets/html/js/common.js b/bin/Release/assets/html/js/common.js new file mode 100644 index 0000000..e16becf --- /dev/null +++ b/bin/Release/assets/html/js/common.js @@ -0,0 +1,238 @@ +var G = { + user: { username: '' }, + + loadPage: function (pagename) { + while (1) { + var script = document.querySelector("script[id='mytempfile']") + if (!script) break + script.remove() + } + var file = 'assets/html/pages/' + pagename + '.html' + G.cppNative.readFile(file).then(function (text) { + // 加载 html 页面内容文件 + document.getElementById('mypage').innerHTML = text + // 加载 js 脚本文件 + var jsUrl = './pages/' + pagename + '.js' + var element = document.createElement('script') + element.src = jsUrl + '?t=' + new Date().getTime() + element.async = false // 脚本按照加载先后顺序处理 + element.setAttribute('id', 'mytempfile') + document.body.appendChild(element) + }) + }, + + switchSetStatus: function (id1, id2, checked, callback) { + document.getElementById(id2).checked = !(document.getElementById(id1).checked = checked) + if (callback) callback(checked) + }, + switchGetStatus: function (id) { return document.getElementById(id).checked }, + + initTable: function (id, info) { + if (info.table) { + info.table.ajax.reload() + return; + } + var tableOption = G.tableGetOption() + tableOption.columns = info.columns + tableOption.ajax = function (req, callback, settings) { + G.cppNative.log('lxy=== table ajax start') + if (info.query) { + info.query(1, 10).then(res => { + var result = [] + res.data.forEach(function (item, index) { + var rowData = [] + info.header.forEach(function (key, index) { rowData.push(item[key]) }) + result.push(rowData) + }) + G.cppNative.log("table ajax: " + JSON.stringify(result)) + callback({ draw: req.draw, recordsTotal: result.length, recordsFiltered: result.length, data: result }) + }) + } else { + callback({ draw: req.draw, recordsTotal: 0, recordsFiltered: 0, data: [] }) + } + } + // 初始化表格 + info.table = $('#' + id + 'Table').DataTable(tableOption) + G.cppNative.log('lxy=== table init end') + //$('div.gotopage').html('跳转至 ') + }, + + updateTableData: function (queryFunc, params) { + if (queryFunc) { + } + }, + + cppCall: function (id) { + var cppfunc = G.cppNative[id] + if (cppfunc) { + G.cppNative.log('call cpp function [' + id + ']') + cppfunc() + } else { + G.cppNative.log('call cpp function [' + id + '] error: not exist') + } + }, + + cppSignal: function (id, callback) { + var signal = G.cppNative[id] + if (signal) { + G.cppNative.log('cpp signal [' + id + '] ') + signal.connect(callback) + } else { + G.cppNative.log('cpp signal [' + id + '] error: not exist') + } + }, + + initForm: function (id, funcPopConfirm) { + var form = document.getElementById(id + 'Form') + var formBtnOk = document.getElementById(id + 'FormOk') + if (form && formBtnOk) { + // 监听表单的输入事件,检查表单的必填项是否完成输入,如果未完成,则确认按钮不可用 + form.addEventListener('input', function () { formBtnOk.disabled = !form.checkValidity() }) + // 编辑弹窗的确定按钮监听点击事件 + formBtnOk.addEventListener('click', function () { if (funcPopConfirm) { funcPopConfirm(id) } }) + } + }, + + showElement: function (id, visible) { + var elemt = document.getElementById(id) + if (elemt) { elemt.style.display = visible ? 'block' : 'none' } + }, + + popSetParams: function (id, keys, rowdata, callback) { + keys.forEach(function (key, index) { + var val = '' + if (rowdata && rowdata.length > index) { val = rowdata[index] } + + if (key == 'is_open') { + G.switchSetStatus(id + 'Form_on', id + 'Form_off', parseInt(val)) + } else { + var myval = (callback) ? callback(id, key, val) : val + // 回调函数返回 undefined 时, 不需要设置参数值 + if (myval != undefined) { + val = myval + var element = $('#' + id + 'Form_' + key) + if (element) { + if (element.prop("tagName") == "SELECT" && val == '') { + element.get(0).selectedIndex = 0; + } else { + element.val(val) + } + } + } + } + }) + }, + + popGetParams: function (id, keys, rowdata, callback) { + var params = {} + keys.forEach(function (key, index) { + var val + if (key == 'is_open') { + val = G.switchGetStatus(id + 'Form_on') ? '1' : '0' + } else { + var myval = callback ? callback(id, key) : undefined + val = myval != undefined ? myval : $('#' + id + 'Form_' + key).val() + } + if (rowdata) { + if (rowdata.length > index && val != rowdata[index]) { params[key] = val } + } else { + if (val != '') { params[key] = val } + } + }) + G.cppNative.log('POP get params: id=' + id + ', params=' + JSON.stringify(params)) + return params + }, + + popSetParamReadonly: function (id, key, isReadonly) { + $('#' + id + 'Form_' + key).attr('readonly', isReadonly) + }, + + tableGetOption: function () { + return { + data: [], + columns: [], + bSort: false, + scollY: "600px", + //aLengthMenu: [10, 20, 50, 100], //设置每页显示数据条数的下拉选项 + //displayLength: 5, //每页初始显示最大记录数量 + // 设置:表格(t)、分页数据条数(l)、搜索框(f)、表格信息(i)、分页(p)、加载信息(r) + dom: 'rt<"mydt-ext"p<"item"<"gotopage">><"item"i><"item"f>>', + language: { + emptyTable: '无数据', + lengthMenu: '每页显示 _MENU_ 条记录', + zeroRecords: '对不起,查询不到任何相关数据', + info: '共有 _TOTAL_ 条记录', // '当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录', + infoEmpty: '共 0 页', + infoFiltered: '数据表中共为 _MAX_ 条记录)', + processing: '正在加载中...', + search: '结果中搜索', + paginate: { + previous: '上一页', next: '下一页', first: '首页', last: '尾页' + }, + }, + columnDefs: [{ targets: '_all', className: 'dt-head-left' }, { targets: '_all', className: 'dt-body-left' }], + //serverSide: true, + processing: false, + ajax: function (req, callback, settings) { + // 查询服务器获取数据, 同时获取总数据条数 + callback({ draw: req.draw, recordsTotal: 0, recordsFiltered: 0, data: [] }) + }, + + createdRow: function (row, data, dataIndex) { + if (dataIndex % 2 === 0) { + //$(row).css('background-color', '#ff000010') + } else { + //$(row).css('background-color', '#00ff0010') + } + + $(row).on('mouseenter', function () { + //if (curEditRow && myTableApi.row(curEditRow).index() == myTableApi.row($(this)).index()) return + $(this).css('background-color', '#ff808050') // 高亮颜色 + }) + $(row).on('mouseleave', function () { + //if (curEditRow && myTableApi.row(curEditRow).index() == myTableApi.row($(this)).index()) return + $(this).css('background-color', '') // 恢复默认 + }) + }, + } + }, + + clickSubpageBtn: function (id) { + if (G.curSubpageId == id) return + + if (G.curSubpageId) { + var oldBtn = document.getElementById(G.curSubpageId + 'Btn') + if (oldBtn) { oldBtn.className = 'btn btn-primary' } + var oldSubpage = $('#' + G.curSubpageId) + if (oldSubpage) { oldSubpage.hide() } + } + if (id) { + var curBtn = document.getElementById(id + 'Btn') + if (curBtn) { curBtn.className = 'btn btn-success btn-lg' } + var curSubpage = $('#' + id) + if (curSubpage) { curSubpage.show() } + } + + G.curSubpageId = id + }, + + + getRandDataDay: function (a, b, n) { + var data = [] + var t0 = Date.parse('2025-03-01 00:00:00') + if (!n) { n = 24 } + var step = 86400 / n + var y = a; + for (var i = 0; i < n; ++i) { + // data[i] = { x: t0 + i * step * 1000, y: Math.sin(i * 0.1) * (n - m) } + y = Math.floor((y + RAND(0, 50) - 25) * 100) / 100 + data[i] = { x: t0 + i * step * 1000, y: y } + } + return data + } +} + + +function RAND(a, b) { + return a + Math.random() * (b - a) +} \ No newline at end of file diff --git a/bin/Release/assets/html/js/myecharts.js b/bin/Release/assets/html/js/myecharts.js index 7a9af69..dc03c39 100644 --- a/bin/Release/assets/html/js/myecharts.js +++ b/bin/Release/assets/html/js/myecharts.js @@ -204,7 +204,7 @@ function initEchartCurve(id, seriesItems) { option.legend.data = seriesItems option.series = [] seriesItems.forEach(item => { - option.series.push({ name: item, type: 'line', smooth: true, symbolSize: 0, data: [] }) + option.series.push({ name: item, type: 'line', smooth: false, symbolSize: 0, data: [] }) }) echart.setOption(option) return echart diff --git a/bin/Release/assets/html/login.html b/bin/Release/assets/html/login.html new file mode 100644 index 0000000..259a658 --- /dev/null +++ b/bin/Release/assets/html/login.html @@ -0,0 +1,13 @@ + + + + + + 光储充站控系统 + + + + + + + \ No newline at end of file diff --git a/bin/Release/assets/html/main.html b/bin/Release/assets/html/main.html index 9e83697..c28f9cc 100644 --- a/bin/Release/assets/html/main.html +++ b/bin/Release/assets/html/main.html @@ -3,680 +3,232 @@ - 光储充站控系统 - - - + + + + + + + + - - -
- -
+
+
+
+
+
+
+
+
+ +
+
+
-
- - - - - - + + + + + + +
- +
+
+ + +
+
+ +
+ \ No newline at end of file diff --git a/bin/Release/assets/html/pages/test.html b/bin/Release/assets/html/pages/test.html index 7fded5c..33ef16c 100644 --- a/bin/Release/assets/html/pages/test.html +++ b/bin/Release/assets/html/pages/test.html @@ -1,34 +1,110 @@ - - - - +
- +
+
+
+
+
+
编号111
+
名称
+
设备类型
+
+
- - +
+
工作状态:
+
运行/空闲
+
+
- - - +
+
+
+
+
编号222
+
名称
+
设备类型
+
+
+
+
+
+
+
枪: #1
+
+
+
- +
+
状态:
+
运行
+
+
+
电压:
+
220 V
+
+
+
电流:
+
10 A
+
+
+
功率:
+
2.2 kW
+
+
+
温度:
+
2.2 kW
+
+
+
SOC:
+
20.6%
+
+
+
SOH:
+
89.7%
+
+
- +
+
+
+
枪: #2
+
+
- - - - - - <> - - +
+
状态:
+
运行
+
+
+
电压:
+
220 V
+
+
+
电流:
+
10 A
+
+
+
功率:
+
2.2 kW
+
+
+
温度:
+
2.2 kW
+
+
+
SOC:
+
57.3%
+
+
+
SOH:
+
93.2%
+
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/bin/Release/assets/html/pages/test.js b/bin/Release/assets/html/pages/test.js new file mode 100644 index 0000000..099bccb --- /dev/null +++ b/bin/Release/assets/html/pages/test.js @@ -0,0 +1,149 @@ +function addCardPanel(code, name, type, subList) { + var root = document.getElementById('workspace') + + var card = document.createElement('div') + card.className = 'mycard' + card.setAttribute('id', code); + card.innerHTML = + `
+
+
+
${code}
+
${name}
+
${type}
+
+
` + + // '
' + // '
工作状态:
' + // '
运行/空闲
' + // '
' + if (subList && subList.length > 1) { + card.innerHTML += + `
+
+
+
+
#${subList[0]}
+
+
+
+
+
+
+
#${subList[1]}
+
+
+
+
` + } + + root.appendChild(card) + return card +} + +function addCardParam(cardid, subid, key, text) { + var paramid = cardid + (subid ? ("_" + subid) : "") + "_" + key + param = document.createElement('div') + param.className = 'mycard-param' + param.innerHTML = `
${key}:
+
${text}
` + + if (subid) { + $('#' + cardid + '_' + subid).append(param) + } else { + $('#' + cardid).append(param) + } +} + +function setCardParam(cardid, subid, key, text) { + var paramid = cardid + (subid ? ("_" + subid) : "") + "_" + key + $("#" + paramid).text(text); +} + +addCardPanel('编号1', '名称', '设备类型') +addCardParam('编号1', null, "电压", "220 V"); +setCardParam('编号1', null, "电压", "290 V"); + +addCardPanel('编号2', '名称', '设备类型', ['1', '2']) +addCardParam('编号2', '1', "电压", "200 V"); +addCardParam('编号2', '1', "电流", "10 V"); +addCardParam('编号2', '2', "电压", "220 V"); + +setCardParam('编号2', '1', "电压", "210 V"); + +// var dataTablesOption = { +// data: [], +// columns: [], +// scrollY: "800px", +// bSort: false, +// aLengthMenu: [10, 20, 50, 100], //设置每页显示数据条数的下拉选项 +// displayLength: 20, //每页初始显示最大记录数量 +// // 设置:表格(t)、分页数据条数(l)、搜索框(f)、表格信息(i)、分页(p)、加载信息(r) +// //dom: '<"table-ext"<"item"f><"item"l><"item"i><"item"p>>rt', +// language: { +// lengthMenu: '每页显示 _MENU_ 条记录', +// sZeroRecords: '对不起,查询不到任何相关数据', +// sInfo: '当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录', +// sInfoEmtpy: '找不到相关数据', +// sInfoFiltered: '数据表中共为 _MAX_ 条记录)', +// processing: '正在加载中...', +// search: '结果中搜索: ', +// paginate: { sPrevious: ' 上一页 ', sNext: ' 下一页 ', }, +// }, +// } + +// var htmlOptEdit = '' + +// var htmlOptHref = '编辑' + +// // '删除' + +// '采购' + +// '入库' + +// '销售' + +// '出库' + +// dataTablesOption.columns = [ +// { title: '编号', width: '50px' }, +// { title: '产品名称', width: '150px' }, +// { title: '规格型号', width: '150px' }, +// { title: '类别', width: '150px' }, +// { title: '库存量', width: '80px' }, +// { title: '采购总量', width: '80px' }, +// { title: '入库总量', width: '80px' }, +// { title: '销售总量', width: '80px' }, +// { title: '出库总量', width: '80px' }, +// { title: '异常总量', width: '80px' }, +// { title: '异常说明' }, +// { +// title: '操作', +// width: '300px', +// render: function (data, type, row) { return htmlOptEdit }, +// }, +// ] +// var table = $('#myTable').DataTable(dataTablesOption) +// var rowid = 0; +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) + +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.row.add([++rowid, '产品名称', '产品型号', '五金类库/五金制品', '', '', '', '', '', '', '']) +// table.draw() \ No newline at end of file diff --git a/bin/Release/assets/html/pages/安全管理.html b/bin/Release/assets/html/pages/安全管理.html index 030559f..4a94818 100644 --- a/bin/Release/assets/html/pages/安全管理.html +++ b/bin/Release/assets/html/pages/安全管理.html @@ -1,4 +1,4 @@ -
+
diff --git a/bin/Release/assets/html/pages/系统总览.html b/bin/Release/assets/html/pages/系统总览.html index 0d63af8..84342c0 100644 --- a/bin/Release/assets/html/pages/系统总览.html +++ b/bin/Release/assets/html/pages/系统总览.html @@ -1,177 +1,174 @@ -
- - +
-
-
-
运行状况
-
+
- +
运行状况
+
-
123
+
0
安全运行
- - +
+
风机设备
-
100
+
0
光伏设备
-
100
+
0
- - +
+
累计发电电量
-
100
+
0
kWh
累计入网电量
-
100
+
0
kWh
- - +
+
累计收益
-
100
+
0
碳减排量
-
100
+
0
- - - +
+
+
-
-
光伏设备
-
- +
光伏设备
+
日发电电量
-
100
+
0
kWh
日入网电量
-
100
+
0
kWh
日收益金额
-
100
+
0
- +
-
-
储能设备
-
- +
储能设备
+
日充电电量
-
100
+
0
kWh
日放电电量
-
100
+
0
kWh
- +
-
-
- +
+
+
-
- + + +
光照
--
- +
-
- + + +
风速
--
- +
-
- + + +
环境温度
--
- +
-
- + + +
环境湿度
--
- +
- - +
+ +
-
-
发电功率和辐照度
-
+
发电功率和辐照度
-
-
负荷设备
-
- +
负荷设备
+
日用电电量
-
100
+
0
kWh
日最大功率
-
100
+
0
kW
- +
-
-
充电设备
-
- + +
充电设备
+ +
日充电电量
-
100
+
0
kWh
@@ -181,18 +178,16 @@
日充电收益
-
100
+
0
- +
-
-
告警信息
-
- +
告警信息
+
日光伏设备告警
1
@@ -208,7 +203,7 @@
3
- +
diff --git a/bin/Release/assets/html/pages/系统总览.js b/bin/Release/assets/html/pages/系统总览.js index b8e7a5a..52d226f 100644 --- a/bin/Release/assets/html/pages/系统总览.js +++ b/bin/Release/assets/html/pages/系统总览.js @@ -1,4 +1,4 @@ -optionBar.xAxis.data = ['2025/3/1', '2025/3/2', '2025/3/3', '2025/3/4', '2025/3/5', '2025/3/6', '2025/3/7'] +optionBar.xAxis.data = ['03/01', '03/02', '03/03', '03/04', '03/05', '03/06', '03/07'] optionBar.legend.data = ['发电电量', '入网电量'] optionBar.series = [ { name: '发电电量', type: 'bar', data: [50, 28, 35, 18, 36, 27, 19] }, @@ -47,9 +47,12 @@ function getRandomCurveData(m, n) { var t0 = Date.parse('2025-03-01 00:00:00') var step = 600 var N = 86400 / step + var y = 500 for (var i = 0; i <= N; ++i) { var t = t0 + i * step * 1000 - data[i] = { name: t, value: [t, Math.sin(i * 0.1) * (n - m) + m] } + //var y = Math.sin(i * 0.1) * (n - m) + m + y = Math.floor((y + RAND(0, 50) - 25) * 100) / 100 + data[i] = { name: t, value: [t, y] } } return data } @@ -78,6 +81,13 @@ function updatePageData() { $('#envWindspeed').text('1.5 m/s') $('#envTemperture').text('27.8 ℃') $('#envHumidity').text('37.6 %') + + // 查询获取统计信息 + $('#windTurbineNum').text('8') + $('#solarNum').text('207') + $('#electricTotal').text('153.21') + $('#electricInTotal').text('120.35') + $('#carbonReduction').text('36.17') } var timerId = null diff --git a/bin/Release/assets/html/pages/系统管理.html b/bin/Release/assets/html/pages/系统管理.html index 471e50b..7575c25 100644 --- a/bin/Release/assets/html/pages/系统管理.html +++ b/bin/Release/assets/html/pages/系统管理.html @@ -1,4 +1,5 @@ -
+
+
+
@@ -35,26 +37,31 @@ @@ -196,7 +203,18 @@
类型* - +
名称* @@ -229,7 +247,23 @@
+ onclick="G.showElement('devicePop', false)">取消 +
+
+
+ +
+
+

设备属性设置

+ +
+
+ +
+ +
@@ -313,6 +347,8 @@
+ +

diff --git a/bin/Release/assets/html/pages/系统管理.js b/bin/Release/assets/html/pages/系统管理.js index d4ba3f8..52f2bd7 100644 --- a/bin/Release/assets/html/pages/系统管理.js +++ b/bin/Release/assets/html/pages/系统管理.js @@ -19,20 +19,29 @@ function renderPolicy(data, type, row) { } var deviceTypeDef = { - 101: "光伏设备", - 102: "充电设备", - 103: "储能设备", - 104: "汇流箱", - 105: "逆变器", - 106: "储能变流器", + 1: "变压器", + 2: "配电柜", + 3: "电表", + 4: "门禁", + 5: "空调", + 6: "照明", + 7: "消防", + 8: "光照监测设备", + 9: "风速监测设备", + 10: "温湿度监测设备", + 11: "烟感监测设备", + 12: "水浸传感器", + 13: "视频监控", + 101: "逆变器", + 102: "汇流箱", + 103: "光伏板", + 104: "风力发电机", + 105: "储能变流器", + 106: "储能电池", 107: "BMS", - 108: "配电柜", - 109: "电表", - 201: "光照监测设备", - 202: "风速监测设备", - 203: "温湿度监测设备", - 204: "视频监控", - 205: "照明设备" + 108: "充电桩", + 109: "充电枪", + 110: "集中器", } function renderDeviceType(data, type, row) { var text = deviceTypeDef[data] @@ -146,14 +155,13 @@ var tableDef = { { title: '是否启用', width: '120px', render: renderIsOpen }, { title: '创建时间', width: '180px' }, { title: '更新时间', width: '180px' }, - { title: '更新人', width: '180px' }, { title: '操作', width: '200px', - render: function (data, type, row) { return htmlOptEdit + htmlOptDel }, + render: function (data, type, row) { return htmlOptEdit + htmlOptAttrs }, }, ], - header: ['device_id', 'type', 'name', 'code', 'model', 'factory', 'is_open', 'create_time', 'update_time', 'update_by'], + header: ['device_id', 'type', 'name', 'code', 'model', 'factory', 'is_open', 'create_time', 'update_time', 'attrs'], query: G.cppNative.queryDeviceList, update: G.cppNative.updateDevice, insert: G.cppNative.insertDevice, @@ -225,9 +233,9 @@ var tableDef = { } } -var htmlOptEdit = '' +var htmlOptEdit = '' var htmlOptDel = '' //'' -var htmlOptAttrs = '' +var htmlOptAttrs = '' var popRowdata = null @@ -280,6 +288,11 @@ async function initSubpage(id) { var row = tableInfo.table.row($(this).closest('tr')) showPop(id, row.data()) }) + + tableInfo.table.on('click', '#btnRowAttrs', function () { + var row = tableInfo.table.row($(this).closest('tr')) + showPopDeviceAttr(row.data()) + }) } @@ -302,6 +315,46 @@ function showPop(id, rowData) { } } +var deviceAttrKeyDef = { + commType: "通讯方式", + ip: "通讯地址", + port: "通讯端口", + isclient: "客户端", +} + +// 显示设备的属性编辑弹窗,属性字段格式为JSON: attrs="{}" +function showPopDeviceAttr(rowData) { + G.showElement('deviceAttrPop', true) + var device_id = rowData[0] + var deviceType = rowData[1] + var deviceTypeStr = deviceTypeDef[deviceType] + var attrsStr = rowData[9] + + var attrs = { commType: "", ip: "", port: 0, isclient: 1 } + try { + attrs = JSON.parse(attrsStr); + } catch (error) { + } + var elemtForm = document.getElementById('deviceAttrForm') + elemtForm.innerHTML = + `
+ 编号 + +
+
+ 设备类型 + +
` + for (k in attrs) { + var title = deviceAttrKeyDef[k] + elemtForm.innerHTML += `
+ ${title} + +
` + } +} + + function showPrompt(text, status) { G.showElement('promptPop', true) var promptText = $('#promptText') @@ -358,6 +411,17 @@ function callbackPopGetParams(id, key) { return val } +function updateTableData(id) { + var info = tableDef[id] + var queryFunc = info.query + if (!queryFunc) return + + queryFunc(1, 10).then((res) => { + + }) + +} + // 用户弹窗确认 function popConfirm(id) { // 获取数据表格操作对象 @@ -398,6 +462,15 @@ function popConfirm(id) { } } +// 设置设备类型下拉列表 +var elementSelectDeviceType = document.getElementById('deviceForm_type') +elementSelectDeviceType.innerHTML = '' +for (k in deviceTypeDef) { + elementSelectDeviceType.options.add(new Option(deviceTypeDef[k], k)) +} + $(document).ready(function () { initSubpage('user') + + //G.initTable('user', tableDef['user']) }) diff --git a/bin/Release/assets/html/pages/统计分析.html b/bin/Release/assets/html/pages/统计分析.html index c13090e..d12015b 100644 --- a/bin/Release/assets/html/pages/统计分析.html +++ b/bin/Release/assets/html/pages/统计分析.html @@ -1,4 +1,4 @@ -
+
@@ -22,97 +22,75 @@
-->
- - + +
-
-
电量与收益分析
- +
电量与收益分析
-
-
运行状态分析
- +
运行状态分析
- - +
+
-
-
日电压/电流分析
- +
日电压/电流分析
-
-
日功率分析
- +
日功率分析
- +
\ No newline at end of file diff --git a/bin/Release/assets/html/pages/统计分析.js b/bin/Release/assets/html/pages/统计分析.js index b5bfed6..c64766c 100644 --- a/bin/Release/assets/html/pages/统计分析.js +++ b/bin/Release/assets/html/pages/统计分析.js @@ -39,8 +39,11 @@ function getRandomCurveData(m, n) { var t0 = Date.parse('2025-03-01 00:00:00') var step = 600 var N = 86400 / step + var y = 500; for (var i = 0; i < N; ++i) { - data[i] = { x: t0 + i * step * 1000, y: Math.sin(i * 0.1) * (n - m) } + // data[i] = { x: t0 + i * step * 1000, y: Math.sin(i * 0.1) * (n - m) } + y = Math.floor((y + RAND(0, 50) - 25) * 100) / 100 + data[i] = { x: t0 + i * step * 1000, y: y } } return data } @@ -56,7 +59,7 @@ function getCurveData(a, b, n) { } function RAND(a, b) { - return (Math.random() * (b - a) + a).toFixed(2) + return a + Math.random() * (b - a) } // 点击子页面菜单按钮,切换子页面 @@ -89,7 +92,7 @@ function initSubPage(id) { } else if (item.type == 'line') { item.echart = initEchartCurve(item.id, item.series) for (var i = 0; i < item.series.length; ++i) { - updateEchartCurve(item.echart, i, getRandomCurveData(100 * (i + 1), 200 * (i + 1))) + updateEchartCurve(item.echart, i, G.getRandDataDay(100 * (i + 1), 200 * (i + 1))) } } diff --git a/bin/Release/assets/html/pages/运行监控.html b/bin/Release/assets/html/pages/运行监控.html index ee91206..bf55315 100644 --- a/bin/Release/assets/html/pages/运行监控.html +++ b/bin/Release/assets/html/pages/运行监控.html @@ -1,65 +1,157 @@ -
- -
-
+
+
+
+
光伏系统
- -
光伏板数量: 100 个
- -
空闲: 0 个
-
离线: 0 个
-
故障: 0 个
-
-
+
+
光伏板数量: 100 个
+
+
空闲: 0 个
+
离线: 0 个
+
故障: 0 个
+
+
-
+
储能系统
- -
储能电池数量: 10 个
- -
空闲: 0 个
-
离线: 0 个
-
故障: 0 个
-
-
+
+
储能电池数量: 0 个
+
+
空闲: 0 个
+
离线: 0 个
+
故障: 0 个
+
+
-
+
充电系统
- -
充电桩数量: 50 个
- -
空闲: 0 个
-
离线: 0 个
-
故障: 0 个
-
-
+
+
充电桩数量: 0 个
+
+
空闲: 0 个
+
离线: 0 个
+
故障: 0 个
+
+
-
+
负荷系统
- -
照明设备数量: 100 个
- -
空闲: 0 个
-
离线: 0 个
-
故障: 0 个
-
-
+
+
照明设备数量: 0 个
+
+
空闲: 0 个
+
离线: 0 个
+
故障: 0 个
+
+
-
+
安防系统
- -
摄像头数量: 50 个
- +
+
摄像头数量: 0 个
+
空闲: 0 个
离线: 0 个
故障: 0 个
- - +
+
-
-
+
+ +
+ +
+
+
+
环境温湿度信息
+
+
+
+
点位
+
温度
+
湿度
+
+
+
#1
+
20℃
+
20%
+
+
+ +
消防信息
+
+
+
+
点位
+
烟感状态
+
+
+
#1
+
正常
+
+
+
#1
+
正常
+
+
+
#1
+
正常
+
+
+
#1
+
正常
+
+
+
#1
+
正常
+
+
+
#1
+
正常
+
+
+
#1
+
正常
+
+
+
+
- + + + + +
\ No newline at end of file diff --git a/bin/Release/assets/html/pages/运行监控.js b/bin/Release/assets/html/pages/运行监控.js index 03c3aad..b8e4ce1 100644 --- a/bin/Release/assets/html/pages/运行监控.js +++ b/bin/Release/assets/html/pages/运行监控.js @@ -1,64 +1,244 @@ +var mapDeviceTypeDef = new Map([ + ['1', '变压器'], + ['2', '配电柜'], + ['3', '电表'], + ['4', '门禁'], + ['5', '空调'], + ['6', '照明'], + ['7', '消防'], + ['8', '光照监测设备'], + ['9', '风速监测设备'], + ['10', '温湿度监测设备'], + ['11', '烟感监测设备'], + ['12', '水浸传感器'], + ['13', '视频监控'], + ['101', '逆变器'], + ['102', '汇流箱'], + ['103', '光伏板'], + ['104', '风力发电机'], + ['105', '储能变流器'], + ['106', '储能电池'], + ['107', 'BMS'], + ['108', '充电桩'], + ['109', '充电枪'], + ['110', '集中器'], +]) +function getDeviceTypeId(name) { + var res = '' + mapDeviceTypeDef.forEach((v, k) => { if (v == name) { res = k } }) + return res; +} +function getDeviceTypeName(id) { + var res = '' + mapDeviceTypeDef.forEach((v, k) => { if (k == id) { res = v } }) + return res; +} - - -function addCard(deviceId, type, name, code) { - var a = '
' + - '< div style = "width: 100px;height: 70px; background-color: #2991b6;border-radius: 10px;" >
' + - '< div class="mycolumn" style = "margin-left: 10px;" > ' + - '
3201001234567890
' + - '
逆变器1
' + - '
逆变器
' + - '
' + - '
' - - var elementDeviceList = document.getElementById('deviceList') - //
+function addDeviceCardPanel(root, deviceid, name, type, subList) { var card = document.createElement('div') card.className = 'mycard' - card.innerHTML = '
' + - '
' + - '
' + - '
' + code + '
' + name + '
' + - '
' + type + '
' + - '
' + card.setAttribute('id', deviceid) // 设置id + if (type == "充电桩") { card.style.width = '320px' } + card.innerHTML = + `
+
+
+
${deviceid}
+
${name}
+
${type}
+
+
` - var params = { - 工作状态: '运行', - 在线状态: '运行', - 故障状态: '运行', - 额定功率: '20 kW', - 电压: '220 V', - 电流: '30 A', - 功率: '11 kW', + // 充电桩区分1号枪和2号枪 + if (subList && subList.length > 1) { + card.innerHTML += + `
+
+
+
+
#${subList[0]}
+
+
+
+
+
+
#${subList[1]}
+
+
+
` } - - Object.keys(params).forEach((k) => { - var id = deviceId + '_' + k - card.innerHTML += ('
' + - '
' + k + '
' + '
' + params[k] + '
' + - '
') - }); - - elementDeviceList.appendChild(card) + root.appendChild(card) + return card } -function updateParam(deviceId, k, v) { - var id = deviceId + '_' + k - document.getElementById(id).innerHTML = v +/// =========================================================== +// 创建设备卡片的参数信息 +// @param deviceid: 设备 ID +// @param subid: 参数子分类 ID,如充电桩的充电枪的编号:1号枪,2号枪 +// @param key: 参数名称 +// @param key: 参数值 +// 说明: 每个参数值的 element 的 id 设置为:{deviceid}_{subid}_{key} +function addDeviceCardParam(deviceid, subid, key, text) { + var elemtid = deviceid + (subid ? ("_" + subid) : "") + "_" + key + param = document.createElement('div') + param.className = 'mycard-param' + param.innerHTML = `
${key}:
+
${text}
` + + if (subid) { + $('#' + deviceid + '_' + subid).append(param) + } else { + $('#' + deviceid).append(param) + } + if (text == '离线' | text == '故障') { + $("#" + elemtid).css("color", "red") + } } +/// =========================================================== +// 设置设备卡片的参数值 +// @param deviceid: 设备ID +// @param subid: 参数子分类ID,如充电桩的充电枪的编号:1号枪,2号枪 +// @param key: 参数名称 +// @param key: 参数值 +// 说明: 每个参数值的 element 的 id 设置为:{deviceid}_{subid}_{key} +function setDeviceCardParam(deviceid, subid, key, text) { + var elemtid = deviceid + (subid ? ("_" + subid) : "") + "_" + key + $("#" + elemtid).text(text); + // 特殊状态设置颜色区分显示 + if (text == '离线' | text == '故障') { + $("#" + elemtid).css("color", "red") + } +} var activeCardBtn = null -function clickCardBtn(btn, id) { + +function onClickCardBtn(btn, id) { if (activeCardBtn) activeCardBtn.className = 'mycardbtn' activeCardBtn = btn activeCardBtn.className = 'mycardbtn-active' + + var deviceType = id + initDeviceList(deviceType) } -function initDeviceList() { +function creatElementSwitch(id, x, y) { + var eswitch = document.createElement('div') + eswitch.className = 'btn-group' + eswitch.setAttribute('style', `margin-left: 5px; width: 60px; height: 26px; position:absolute; left: ${x}px; top: ${y}px`); + eswitch.innerHTML = ` + + + + ` + return eswitch; } +function creatElementCard() { + var card = document.createElement('div') + card.className = 'mycard' + return card; +} + +function createCardVideo(name) { + var elemt = document.createElement('div') + elemt.className = 'mycard' + elemt.style.width = '320px' + elemt.innerHTML = ` +
${name}
+
+
无信号
+
` + return elemt; +} + + +function initDeviceList(deviceType) { + var elemtDeviceList = document.getElementById('deviceList') + elemtDeviceList.innerHTML = '' + + var subList = [null] + if (deviceType === 'security') { + document.getElementById('envpanel').style.display = 'block' + + elemtDeviceList.appendChild(createCardVideo('监控点1')) + elemtDeviceList.appendChild(createCardVideo('监控点2')) + elemtDeviceList.appendChild(createCardVideo('监控点3')) + elemtDeviceList.appendChild(createCardVideo('监控点4')) + elemtDeviceList.appendChild(createCardVideo('监控点5')) + elemtDeviceList.appendChild(createCardVideo('监控点6')) + elemtDeviceList.appendChild(createCardVideo('监控点7')) + elemtDeviceList.appendChild(createCardVideo('监控点8')) + elemtDeviceList.appendChild(createCardVideo('监控点9')) + elemtDeviceList.appendChild(createCardVideo('监控点1')) + elemtDeviceList.appendChild(createCardVideo('监控点2')) + elemtDeviceList.appendChild(createCardVideo('监控点3')) + elemtDeviceList.appendChild(createCardVideo('监控点4')) + elemtDeviceList.appendChild(createCardVideo('监控点5')) + elemtDeviceList.appendChild(createCardVideo('监控点6')) + elemtDeviceList.appendChild(createCardVideo('监控点7')) + elemtDeviceList.appendChild(createCardVideo('监控点8')) + elemtDeviceList.appendChild(createCardVideo('监控点9')) + return + } + + var reqDeviceType = ['101', '102', '103'] + if (deviceType === 'storage') { + reqDeviceType = ['101', '102', '106'] + } + else if (deviceType === 'charge') { + subList = ['1', '2'] + reqDeviceType = ['108'] + } + else { + document.getElementById('envpanel').style.display = 'none' + } + + + // 查询数据库,获取设备信息 + //G.cppNative.queryDevice({ type: reqDeviceType }).then((res) => { + G.cppNative.getDeviceInfo(reqDeviceType).then((res) => { + res.forEach(function (item, index) { + var deviceType = getDeviceTypeName(item.type) + addDeviceCardPanel(elemtDeviceList, item.device_id, item.name, deviceType, subList) + + var params = { + 在线状态: (item.online == 0) ? '离线' : '在线', + 工作状态: (item.status == 0) ? '空闲' : '运行', + 故障状态: (item.err == 0) ? '正常' : '故障', + 额定功率: '-- kW', + 电压: '-- V', + 电流: '-- A', + 功率: '-- kW', + } + + if (subList) { + subList.forEach((subid) => { + Object.keys(params).forEach((k) => { + addDeviceCardParam(item.device_id, subid, k, params[k]); + }); + }) + } + var elemtPanel = document.getElementById(item.device_id) + elemtPanel.innerHTML += `` + + }) + }) +} + +function onDeviceSetting(deviceid) { + G.showElement('deviceSettingPop', true) +} + +// ==================================================================================================== // 【注意】 DOM 元素的移除不会自动清理 JavaScript 运行时创建的资源(如定时器、事件监听器等),这些都需要手动管理 // 开启定时器更新页面数据 var timerId = null @@ -69,27 +249,43 @@ document.currentScript.addEventListener('DOMNodeRemoved', () => { clearInterval(timerId); }); + $(document).ready(function () { - addCard('1', '逆变器', '逆变器1', '1111') - addCard('2', '汇流箱', '汇流箱', '2222') - addCard('3', '光伏板', '光伏板1', '3333') - addCard('4', '光伏板', '光伏板2', '4444') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') - addCard('5', '光伏板', '光伏板3', '5555') + onClickCardBtn(document.getElementById('solarCardBtn'), 'solar') + // timerId = setInterval(() => { + // updateParam('1', '电压', Math.floor(Math.random() * 220) + ' V') + // }, 2000); - clickCardBtn(document.getElementById('solarCardBtn'), 'solar') + G.cppNative.getDeviceInfo([0]).then((res) => { + var nums = { + '103': { num: 0, numIdle: 0, numOffline: 0, numFault: 0 }, + '106': { num: 0, numIdle: 0, numOffline: 0, numFault: 0 }, + '108': { num: 0, numIdle: 0, numOffline: 0, numFault: 0 }, + } + res.forEach(function (item, index) { + var deviceType = item.type + '' + if (nums[deviceType]) { + nums[deviceType].num += 1 + if (item.status == 0) nums[deviceType].numIdle += 1 + if (item.online == 0) nums[deviceType].numOffline += 1 + if (item.err != 0) nums[deviceType].numFault += 1 + } + }) + $('#solarDeviceNum').text('光伏板数量: ' + nums['103'].num + ' 个') + $('#solarIdleNum').text('空闲: ' + nums['103'].numIdle + ' 个') + $('#solarOfflineNum').text('离线: ' + nums['103'].numOffline + ' 个') + $('#solarFaultNum').text('故障: ' + nums['103'].numFault + ' 个') + + $('#storageDeviceNum').text('储能电池数量: ' + nums['106'].num + ' 个') + $('#storageIdleNum').text('空闲: ' + nums['106'].numIdle + ' 个') + $('#storageOfflineNum').text('离线: ' + nums['106'].numOffline + ' 个') + $('#storageFaultNum').text('故障: ' + nums['106'].numFault + ' 个') + + $('#chargeDeviceNum').text('充电桩数量: ' + nums['108'].num + ' 个') + $('#chargeIdleNum').text('空闲: ' + nums['108'].numIdle + ' 个') + $('#chargeOfflineNum').text('离线: ' + nums['108'].numOffline + ' 个') + $('#chargeFaultNum').text('故障: ' + nums['108'].numFault + ' 个') + + }) - timerId = setInterval(() => { - updateParam('1', '电压', Math.floor(Math.random() * 220) + ' V') - }, 2000); }) \ No newline at end of file diff --git a/bin/Release/assets/html/pages/预测管理.html b/bin/Release/assets/html/pages/预测管理.html new file mode 100644 index 0000000..0048cb2 --- /dev/null +++ b/bin/Release/assets/html/pages/预测管理.html @@ -0,0 +1,30 @@ +
+ +
+
+
+
光伏发电预测
+
+ 当天累计发电量 1520 kW/h +
+
+
+
+
+
+
+
充电负荷预测
+ +
+
+
+
用电负荷预测
+ +
+
+
+ +
+ + +
\ No newline at end of file diff --git a/bin/Release/assets/html/pages/预测管理.js b/bin/Release/assets/html/pages/预测管理.js new file mode 100644 index 0000000..5ae3186 --- /dev/null +++ b/bin/Release/assets/html/pages/预测管理.js @@ -0,0 +1,45 @@ +var chartDef = [ + { id: 'solarEchart', echart: null, type: 'bar', series: ['预测功率', '实时功率', '预测发电量', '实时发电量'] }, + { id: 'chargeEchart', echart: null, type: 'bar', series: ['预测功率', '实时功率'] }, + { id: 'loadEchart', echart: null, type: 'line', series: ['预测功率', '实时功率'] }, +] + +function RAND(a, b) { + return (a + Math.random() * (b - a)) +} + +function getRandomCurveData(m, n) { + var data = [] + var t0 = Date.parse('2025-03-01 00:00:00') + var step = 600 + var N = 86400 / step + for (var i = 0; i < N; ++i) { + //data[i] = { x: t0 + i * step * 1000, y: Math.sin(i * 0.1) * (n - m) } + data[i] = { x: t0 + i * step * 1000, y: RAND(m, n) } + } + return data +} + +function getRandomData1(m, n) { + var data = [] + var t0 = Date.parse('2025-03-01 00:00:00') + var step = 600 + var N = 86400 / step + var y = 500; + for (var i = 0; i < N; ++i) { + //data[i] = { x: t0 + i * step * 1000, y: Math.sin(i * 0.1) * (n - m) } + y = Math.floor((y + RAND(0, 50) - 25) * 100) / 100 + data[i] = { x: t0 + i * step * 1000, y: y } + } + return data +} + +chartDef.forEach((item) => { + item.echart = initEchartCurve(item.id, item.series) + + updateEchartCurve(item.echart, 1, getRandomData1(100, 200)) + + for (var i = 0; i < item.series.length; ++i) { + updateEchartCurve(item.echart, i, getRandomData1(300 * (i + 1), 400 * (i + 1))) + } +}) diff --git a/bin/Release/assets/html/res/icon-brightness.png b/bin/Release/assets/html/res/icon-brightness.png new file mode 100644 index 0000000..daecbed Binary files /dev/null and b/bin/Release/assets/html/res/icon-brightness.png differ diff --git a/bin/Release/assets/html/res/icon-humidity.png b/bin/Release/assets/html/res/icon-humidity.png new file mode 100644 index 0000000..012620e Binary files /dev/null and b/bin/Release/assets/html/res/icon-humidity.png differ diff --git a/bin/Release/assets/html/res/icon-temperature.png b/bin/Release/assets/html/res/icon-temperature.png new file mode 100644 index 0000000..5d9c12d Binary files /dev/null and b/bin/Release/assets/html/res/icon-temperature.png differ diff --git a/bin/Release/assets/html/res/icon-windspeed.png b/bin/Release/assets/html/res/icon-windspeed.png new file mode 100644 index 0000000..c5ed63a Binary files /dev/null and b/bin/Release/assets/html/res/icon-windspeed.png differ diff --git a/bin/Release/assets/html/testTable.html b/bin/Release/assets/html/testTable.html new file mode 100644 index 0000000..83ff70f --- /dev/null +++ b/bin/Release/assets/html/testTable.html @@ -0,0 +1,128 @@ + + + + + + 光储充站控系统 + + + + + + + + + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/bin/Release/assets/ui/bkg01 - 副本.png b/bin/Release/assets/ui/bkg01 - 副本.png new file mode 100644 index 0000000..dc447d3 Binary files /dev/null and b/bin/Release/assets/ui/bkg01 - 副本.png differ diff --git a/bin/Release/assets/ui/bkg01.png b/bin/Release/assets/ui/bkg01.png index dc447d3..6a88279 100644 Binary files a/bin/Release/assets/ui/bkg01.png and b/bin/Release/assets/ui/bkg01.png differ diff --git a/bin/Release/assets/ui/bkgLogin01.png b/bin/Release/assets/ui/bkgLogin01.png new file mode 100644 index 0000000..2e79add Binary files /dev/null and b/bin/Release/assets/ui/bkgLogin01.png differ diff --git a/bin/Release/assets/ui/brightness.png b/bin/Release/assets/ui/brightness1.png similarity index 100% rename from bin/Release/assets/ui/brightness.png rename to bin/Release/assets/ui/brightness1.png diff --git a/bin/Release/assets/ui/exit.png b/bin/Release/assets/ui/exit.png new file mode 100644 index 0000000..a7fb3de Binary files /dev/null and b/bin/Release/assets/ui/exit.png differ diff --git a/bin/Release/bearer/qgenericbearer.dll b/bin/Release/bearer/qgenericbearer.dll index 5630514..909b216 100644 Binary files a/bin/Release/bearer/qgenericbearer.dll and b/bin/Release/bearer/qgenericbearer.dll differ diff --git a/bin/Release/iconengines/qsvgicon.dll b/bin/Release/iconengines/qsvgicon.dll index cbca63c..3e04225 100644 Binary files a/bin/Release/iconengines/qsvgicon.dll and b/bin/Release/iconengines/qsvgicon.dll differ diff --git a/bin/Release/imageformats/qgif.dll b/bin/Release/imageformats/qgif.dll index b6e5658..7da1f08 100644 Binary files a/bin/Release/imageformats/qgif.dll and b/bin/Release/imageformats/qgif.dll differ diff --git a/bin/Release/imageformats/qicns.dll b/bin/Release/imageformats/qicns.dll index 5b4365f..fecc4ce 100644 Binary files a/bin/Release/imageformats/qicns.dll and b/bin/Release/imageformats/qicns.dll differ diff --git a/bin/Release/imageformats/qico.dll b/bin/Release/imageformats/qico.dll index d89a637..9ba89cb 100644 Binary files a/bin/Release/imageformats/qico.dll and b/bin/Release/imageformats/qico.dll differ diff --git a/bin/Release/imageformats/qjpeg.dll b/bin/Release/imageformats/qjpeg.dll index 98cdf95..74ff76b 100644 Binary files a/bin/Release/imageformats/qjpeg.dll and b/bin/Release/imageformats/qjpeg.dll differ diff --git a/bin/Release/imageformats/qsvg.dll b/bin/Release/imageformats/qsvg.dll index c6b732b..6abad7e 100644 Binary files a/bin/Release/imageformats/qsvg.dll and b/bin/Release/imageformats/qsvg.dll differ diff --git a/bin/Release/imageformats/qtga.dll b/bin/Release/imageformats/qtga.dll index d4f77f8..41145dd 100644 Binary files a/bin/Release/imageformats/qtga.dll and b/bin/Release/imageformats/qtga.dll differ diff --git a/bin/Release/imageformats/qtiff.dll b/bin/Release/imageformats/qtiff.dll index 43cbc0c..3390ee6 100644 Binary files a/bin/Release/imageformats/qtiff.dll and b/bin/Release/imageformats/qtiff.dll differ diff --git a/bin/Release/imageformats/qwbmp.dll b/bin/Release/imageformats/qwbmp.dll index e1dc12c..fe1fdc6 100644 Binary files a/bin/Release/imageformats/qwbmp.dll and b/bin/Release/imageformats/qwbmp.dll differ diff --git a/bin/Release/imageformats/qwebp.dll b/bin/Release/imageformats/qwebp.dll index 3c49ed8..b06a87e 100644 Binary files a/bin/Release/imageformats/qwebp.dll and b/bin/Release/imageformats/qwebp.dll differ diff --git a/bin/Release/libEGL.dll b/bin/Release/libEGL.dll index e910cc9..235974b 100644 Binary files a/bin/Release/libEGL.dll and b/bin/Release/libEGL.dll differ diff --git a/bin/Release/libGLESv2.dll b/bin/Release/libGLESv2.dll index d357182..b1246d7 100644 Binary files a/bin/Release/libGLESv2.dll and b/bin/Release/libGLESv2.dll differ diff --git a/bin/Release/libmysql.dll b/bin/Release/libmysql.dll index 73fed05..eea53cb 100644 Binary files a/bin/Release/libmysql.dll and b/bin/Release/libmysql.dll differ diff --git a/bin/Release/opengl32sw.dll b/bin/Release/opengl32sw.dll index 475e82a..6ebc90a 100644 Binary files a/bin/Release/opengl32sw.dll and b/bin/Release/opengl32sw.dll differ diff --git a/bin/Release/platforms/qwindows.dll b/bin/Release/platforms/qwindows.dll index e9c319d..c724999 100644 Binary files a/bin/Release/platforms/qwindows.dll and b/bin/Release/platforms/qwindows.dll differ diff --git a/bin/Release/position/qtposition_positionpoll.dll b/bin/Release/position/qtposition_positionpoll.dll index 1c5f7d4..8fbbe24 100644 Binary files a/bin/Release/position/qtposition_positionpoll.dll and b/bin/Release/position/qtposition_positionpoll.dll differ diff --git a/bin/Release/position/qtposition_serialnmea.dll b/bin/Release/position/qtposition_serialnmea.dll index 3458b8b..d64d110 100644 Binary files a/bin/Release/position/qtposition_serialnmea.dll and b/bin/Release/position/qtposition_serialnmea.dll differ diff --git a/bin/Release/position/qtposition_winrt.dll b/bin/Release/position/qtposition_winrt.dll index faf88d8..4fad9af 100644 Binary files a/bin/Release/position/qtposition_winrt.dll and b/bin/Release/position/qtposition_winrt.dll differ diff --git a/bin/Release/printsupport/windowsprintersupport.dll b/bin/Release/printsupport/windowsprintersupport.dll index 2e50171..05f8a28 100644 Binary files a/bin/Release/printsupport/windowsprintersupport.dll and b/bin/Release/printsupport/windowsprintersupport.dll differ diff --git a/bin/Release/styles/qwindowsvistastyle.dll b/bin/Release/styles/qwindowsvistastyle.dll index c97acd6..b35490b 100644 Binary files a/bin/Release/styles/qwindowsvistastyle.dll and b/bin/Release/styles/qwindowsvistastyle.dll differ diff --git a/bin/Release/windeployqt.bat b/bin/Release/windeployqt.bat new file mode 100644 index 0000000..0f7a2b8 --- /dev/null +++ b/bin/Release/windeployqt.bat @@ -0,0 +1,2 @@ +cd %~dp0 +D:\Programs\Qt5\5.15.2\msvc2019\bin\windeployqt.exe EES.exe \ No newline at end of file