diff --git a/public/js/admin_bundle.js b/public/js/admin_bundle.js index 8d372c9..4fd84bc 100644 --- a/public/js/admin_bundle.js +++ b/public/js/admin_bundle.js @@ -87819,7 +87819,7 @@ var ListItem = function ListItem(_ref) { _react2.default.createElement( _semanticUiReact.Table.Cell, null, - data.locname ? data.locname : data.last_locname + data.locname ), _react2.default.createElement( _semanticUiReact.Table.Cell, @@ -87974,7 +87974,7 @@ var LocStatus = function (_React$Component) { _this.getList(); }); }, _this.renderSortIcon = function (tag) { - if (_this.state.sort.field == tag) return _react2.default.createElement(_semanticUiReact.Icon, { size: 'mini', corner: true, name: sort_icon[_this.state.sort.order] }); + if (_this.state.sort.field == tag) return _react2.default.createElement(_semanticUiReact.Icon, { size: 'large', name: sort_icon[_this.state.sort.order] }); return null; }, _temp), _possibleConstructorReturn(_this, _ret); } @@ -88024,8 +88024,11 @@ var LocStatus = function (_React$Component) { ), _react2.default.createElement( _semanticUiReact.Table.HeaderCell, - null, - '\u5730\u9EDE' + { className: 'pointer', onClick: function onClick() { + _this2.handlerSort('loc'); + } }, + '\u5730\u9EDE', + this.renderSortIcon('loc') ), _react2.default.createElement( _semanticUiReact.Table.HeaderCell, diff --git a/route/api/wristband.js b/route/api/wristband.js index 4633faa..cc8b49b 100644 --- a/route/api/wristband.js +++ b/route/api/wristband.js @@ -127,7 +127,7 @@ router }) .post('/getstatus', (req, res, n) => { - let query = "select w.`name`, l.`name` as locname, l2.`name` as last_locname, ll.*\ + let query = "select w.`name`, coalesce(l.`name`, l2.`name`) as locname, ll.*\ from ??.?? w\ left join ( \ select * from ( \ @@ -141,7 +141,7 @@ router left join ??.?? l \ on \ l.`serialnumber` = tmp2.`devid` \ - left join ??.?? l2 \ + left join ??.?? l2\ on \ l2.`serialnumber` = ll.`devid` \ "; @@ -169,6 +169,9 @@ router case 'val11': query += `order by ll.${sortfield} ${sortorder}`; break; + case 'loc': + query += `order by locname ${sortorder}`; + break; default: query += 'order by w.`uid`'; break; diff --git a/src/components/AdminPage/Wristband/LocStatus/ListItem.js b/src/components/AdminPage/Wristband/LocStatus/ListItem.js index 536f77c..65368df 100644 --- a/src/components/AdminPage/Wristband/LocStatus/ListItem.js +++ b/src/components/AdminPage/Wristband/LocStatus/ListItem.js @@ -7,7 +7,7 @@ const ListItem = ({i18n, data}) => { return (