add wristband sort

This commit is contained in:
Jay 2017-04-05 16:45:58 +08:00
parent 8d8b4818ae
commit c132be1ed0
4 changed files with 18 additions and 9 deletions

View File

@ -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,

View File

@ -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 ( \
@ -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;

View File

@ -7,7 +7,7 @@ const ListItem = ({i18n, data}) => {
return (
<Table.Row>
<Table.Cell>{data.mac}</Table.Cell>
<Table.Cell>{data.locname ? data.locname : data.last_locname}</Table.Cell>
<Table.Cell>{data.locname}</Table.Cell>
<Table.Cell>{data.val3 ? parseInt(data.val3, 16) : ''}</Table.Cell>
<Table.Cell>{data.val4 ? `${parseInt(data.val4, 16)}%` : ''}</Table.Cell>
<Table.Cell>{data.val2 ? `${parseInt(data.val2, 16)}` : ''}</Table.Cell>

View File

@ -83,7 +83,7 @@ class LocStatus extends React.Component{
renderSortIcon = (tag) => {
if(this.state.sort.field == tag)
return (<Icon size="mini" corner name={sort_icon[this.state.sort.order]} />);
return (<Icon size="large" name={sort_icon[this.state.sort.order]} />);
return null;
}
@ -102,7 +102,10 @@ class LocStatus extends React.Component{
this.renderSortIcon('mac')
}
</Table.HeaderCell>
<Table.HeaderCell>地點</Table.HeaderCell>
<Table.HeaderCell className="pointer" onClick={()=>{this.handlerSort('loc')}}>
地點
{this.renderSortIcon('loc')}
</Table.HeaderCell>
<Table.HeaderCell className="pointer" onClick={()=>{this.handlerSort('val3')}}>
步數
{