From 40fa771e43aa042857c382afc062b8d9cc82945f Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 27 Mar 2017 13:18:31 +0800 Subject: [PATCH] add iostatus name show --- public/js/admin_bundle.js | 1 + route/api/modbus.js | 7 +++++-- src/components/AdminPage/Modbus/IOPanel.js | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/js/admin_bundle.js b/public/js/admin_bundle.js index dc31fad..c2c543b 100644 --- a/public/js/admin_bundle.js +++ b/public/js/admin_bundle.js @@ -84721,6 +84721,7 @@ var IOPanel = function (_React$Component) { return _react2.default.createElement( 'div', { key: idx }, + _react2.default.createElement(_semanticUiReact.Label, { basic: true, color: 'olive', content: 'SetName:' + t.name }), _react2.default.createElement(_semanticUiReact.Label, { basic: true, color: 'blue', content: 'PortNum:' + t.port }), _react2.default.createElement(_semanticUiReact.Label, { basic: true, color: 'blue', content: '\u539F\u59CB\u6578\u503C:' + t.value }), _react2.default.createElement(_semanticUiReact.Label, { basic: true, color: 'blue', content: '\u8F49\u63DB\u6578\u503C:' + t.value2 }), diff --git a/route/api/modbus.js b/route/api/modbus.js index aab8360..d4fb3f4 100644 --- a/route/api/modbus.js +++ b/route/api/modbus.js @@ -243,16 +243,19 @@ router res.db.database = config.db.db5; res.db.connect(); - let query = "select rt.* from ??.?? rt \ + let query = "select rt.*, a.`name` as name from ??.?? rt \ left join ??.?? d \ on d.`node` = rt.`node` \ left join ??.?? i \ on i.`devuid` = d.`uid` and i.`type` = ? \ + left join ??.?? a \ + on a.`iouid` = i.`uid` \ + and a.`portnum` = rt.`port`\ where \ d.`uid` = ? \ and rt.`type` = ? \ and i.`uid` is not null "; - let param = [config.db.db6, 'jcmbrt', config.db.db5, 'device', config.db.db5, 'iolist', arr.data.type, arr.data.id, arr.data.type]; + let param = [config.db.db6, 'jcmbrt', config.db.db5, 'device', config.db.db5, 'iolist', arr.data.type, config.db.db5, 'aioset', arr.data.id, arr.data.type]; res.db.query(query, param, (err, row) => { if (err) return n('ERR8000'); diff --git a/src/components/AdminPage/Modbus/IOPanel.js b/src/components/AdminPage/Modbus/IOPanel.js index 358ef80..c4c1f3d 100644 --- a/src/components/AdminPage/Modbus/IOPanel.js +++ b/src/components/AdminPage/Modbus/IOPanel.js @@ -72,6 +72,7 @@ class IOPanel extends React.Component { { ss.map((t,idx) => (
+