This commit is contained in:
Jay
2017-04-06 17:31:36 +08:00
parent e18fa6546b
commit b8ccbe4cd3
11 changed files with 340 additions and 32 deletions
+202 -6
View File
@@ -84787,10 +84787,10 @@ var IOPanel = function (_React$Component) {
_react2.default.createElement(
_semanticUiReact.Menu,
{ attached: 'top', tabular: true },
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'DigitOutput', name: '1', active: this.state.tabIdx == "1", onClick: this.tabItemClick }),
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'DigitInput', name: '2', active: this.state.tabIdx == "2", onClick: this.tabItemClick }),
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'AnalogyOutput', name: '3', active: this.state.tabIdx == "3", onClick: this.tabItemClick }),
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'AnalogyInput', name: '4', active: this.state.tabIdx == "4", onClick: this.tabItemClick }),
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'DigitalOutput', name: '1', active: this.state.tabIdx == "1", onClick: this.tabItemClick }),
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'DigitalInput', name: '2', active: this.state.tabIdx == "2", onClick: this.tabItemClick }),
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'AnalogOutput', name: '3', active: this.state.tabIdx == "3", onClick: this.tabItemClick }),
_react2.default.createElement(_semanticUiReact.Menu.Item, { content: 'AnalogInput', name: '4', active: this.state.tabIdx == "4", onClick: this.tabItemClick }),
_react2.default.createElement(
_semanticUiReact.Menu.Menu,
{ position: 'right' },
@@ -87814,7 +87814,7 @@ var ListItem = function ListItem(_ref) {
_react2.default.createElement(
_semanticUiReact.Table.Cell,
null,
data.mac
data.wristband
),
_react2.default.createElement(
_semanticUiReact.Table.Cell,
@@ -88143,6 +88143,10 @@ var _WristbandInfo = __webpack_require__(1141);
var _WristbandInfo2 = _interopRequireDefault(_WristbandInfo);
var _Location = __webpack_require__(1145);
var _Location2 = _interopRequireDefault(_Location);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -88179,6 +88183,8 @@ var WristbandPage = function (_React$Component) {
return _react2.default.createElement(_LocStatus2.default, null);
case 'wristband':
return _react2.default.createElement(_WristbandInfo2.default, null);
case 'location':
return _react2.default.createElement(_Location2.default, null);
default:
return null;
}
@@ -88222,6 +88228,13 @@ var WristbandPage = function (_React$Component) {
} },
'\u624B\u74B0\u540D\u7A31\u8A2D\u5B9A'
),
_react2.default.createElement(
_semanticUiReact.Menu.Item,
{ active: this.state.page == 'location', onClick: function onClick() {
_this2.changePage('location');
} },
'\u5B9A\u4F4D\u9EDE\u8A2D\u5B9A'
),
_react2.default.createElement(
_semanticUiReact.Menu.Item,
{ active: this.state.page == 'locstatus', onClick: function onClick() {
@@ -92941,10 +92954,11 @@ var WristbandInfo = function (_React$Component) {
showDialog = _this$props.showDialog,
toggleLoading = _this$props.toggleLoading;
toggleLoading(1);
fetch('/api/wristband/getwristbandlist', (0, _actions.getRequest)()).then(function (response) {
return response.json();
}).then(function (json) {
toggleLoading(0);
if (json.status != 1) return showDialog(json.message);
_this.setState({
list: json.data.record || []
@@ -93041,6 +93055,26 @@ var WristbandInfo = function (_React$Component) {
_semanticUiReact.Table.HeaderCell,
null,
'\u624B\u74B0\u540D\u7A31'
),
_react2.default.createElement(
_semanticUiReact.Table.HeaderCell,
null,
'\u8EAB\u4EFD'
),
_react2.default.createElement(
_semanticUiReact.Table.HeaderCell,
null,
'\u76E3\u63A7'
),
_react2.default.createElement(
_semanticUiReact.Table.HeaderCell,
null,
'\u901A\u77E5'
),
_react2.default.createElement(
_semanticUiReact.Table.HeaderCell,
null,
'\u555F\u7528'
)
)
),
@@ -93158,6 +93192,26 @@ var ListItem = function ListItem(_ref) {
_semanticUiReact.Table.Cell,
null,
data.name
),
_react2.default.createElement(
_semanticUiReact.Table.Cell,
null,
data.identity
),
_react2.default.createElement(
_semanticUiReact.Table.Cell,
null,
data.monitor == 1 ? '啟用' : '停用'
),
_react2.default.createElement(
_semanticUiReact.Table.Cell,
null,
data.notify == 1 ? '啟用' : '停用'
),
_react2.default.createElement(
_semanticUiReact.Table.Cell,
null,
data.switch == 1 ? '啟用' : '停用'
)
);
};
@@ -93279,5 +93333,147 @@ var WristbandModal = function WristbandModal(_ref) {
};
exports.default = WristbandModal;
/***/ }),
/* 1144 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(8);
var _actions = __webpack_require__(22);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var stateDefault = function stateDefault() {
return {
list: [],
modal: {
open: false,
type: 0,
data: {}
}
};
};
var Location = function (_React$Component) {
_inherits(Location, _React$Component);
function Location() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Location);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Location.__proto__ || Object.getPrototypeOf(Location)).call.apply(_ref, [this].concat(args))), _this), _this.state = _extends({}, stateDefault()), _this.getList = function () {
var _this$props = _this.props,
showDialog = _this$props.showDialog,
toggleLoading = _this$props.toggleLoading;
toggleLoading(1);
fetch('/api/wristband/getlocationlist', (0, _actions.getRequest)()).then(function (response) {
return response.json();
}).then(function (json) {
toggleLoading(0);
if (json.status != 1) return showDialog(json.message);
_this.setState({
list: json.data.record || []
});
});
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Location, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.getList();
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
_semanticUiReact.Container,
{ fluid: true },
_react2.default.createElement(
_semanticUiReact.Segment,
{ className: 'clearfix' },
_react2.default.createElement(_semanticUiReact.Button, { floated: 'right', basic: true, color: 'green', style: { marginBottom: '15px' }, content: '\u65B0\u589E', icon: 'plus' })
)
);
}
}]);
return Location;
}(_react2.default.Component);
exports.default = Location;
/***/ }),
/* 1145 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRedux = __webpack_require__(25);
var _actions = __webpack_require__(22);
var _Location = __webpack_require__(1144);
var _Location2 = _interopRequireDefault(_Location);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(state) {
return {
i18n: state.i18n
};
};
var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {
return {
showDialog: function showDialog(msg) {
dispatch((0, _actions.add_dialog_msg)(msg));
},
toggleLoading: function toggleLoading() {
var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
dispatch((0, _actions.toggle_loading)(flag));
}
};
};
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Location2.default);
/***/ })
/******/ ]);