docs: 注释优化

This commit is contained in:
wenbo.dong 2017-08-30 12:21:27 +08:00
parent 4b5086cd7b
commit 57f70e9ffc
2 changed files with 15 additions and 11 deletions

View File

@ -49,6 +49,7 @@ class UsernameAutoComplete extends Component {
callbackState: PropTypes.func
}
// 改变本组件 state并回调给父组件
changeState = (uid, username) => {
// 设置本组件 state
this.setState({ uid, username });
@ -56,12 +57,14 @@ class UsernameAutoComplete extends Component {
this.props.callbackState({ uid, username });
}
// 输入框中的值改变时
onChange = (userName) => {
this.setState({
changeName: userName
});
}
// 选中候选词时
onSelect = (userName) => {
this.state.dataSource.forEach((item) => {
if (item.username === userName) {
@ -70,6 +73,7 @@ class UsernameAutoComplete extends Component {
});
}
// 搜索回调
handleSearch = (value) => {
const params = { q: value}
axios.get('/api/user/search', { params })

View File

@ -114,7 +114,7 @@ var interfaceController = function (_baseController) {
(0, _createClass3.default)(interfaceController, [{
key: 'add',
value: function () {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
var _this2 = this;
var params, auth, checkRepeat, data, paths, name, i, result;
@ -300,7 +300,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'get',
value: function () {
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
var params, result;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
@ -362,7 +362,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'list',
value: function () {
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
var project_id, result;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
@ -412,7 +412,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'listByCat',
value: function () {
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
var catid, result;
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
@ -462,7 +462,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'listByMenu',
value: function () {
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
var project_id, result, newResult, i, item, list, j;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
@ -567,7 +567,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'up',
value: function () {
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
var _this3 = this;
var params, id, interfaceData, auth, checkRepeat, data, result, username, cateid;
@ -773,7 +773,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'del',
value: function () {
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
var _this4 = this;
var id, data, auth, inter, result, username;
@ -870,7 +870,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'solveConflict',
value: function () {
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
var _this5 = this;
var id, result, userInst, userinfo, data;
@ -953,7 +953,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'addCat',
value: function () {
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
var params, auth, result, username;
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
@ -1048,7 +1048,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'upCat',
value: function () {
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
var params, result, username, cate, auth;
return _regenerator2.default.wrap(function _callee10$(_context10) {
while (1) {
@ -1120,7 +1120,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'delCat',
value: function () {
var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(ctx) {
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ctx) {
var id, catData, auth, username, result, r;
return _regenerator2.default.wrap(function _callee11$(_context11) {
while (1) {