import React from 'react';
import { connectAlita } from 'redux-alita';
import { withRouter } from 'react-router-dom';
import { Button, Input, List, message, Modal, Spin, Pagination } from 'antd';
import './styles/label.less';
import AddLabelForm from './widget/AddLabelForm';
class ConfigLabel extends React.Component {
constructor(props) {
super(props);
this.state = {
loading: false,
removeModalTitle: '提示',
removeLoading: false,
removeModalVisible: false,
currentLabel: null,
};
this.params = {
page: 1,
pageSize: 10,
};
}
componentDidMount() {
this._fetchLabels();
}
_fetchLabels() {
this.setState({ currentLabel: null });
let params = this.params;
this.props.setAlitaState({ funcName: 'findPLabel', params });
}
_handleSearch(value) {
this.params.keywords = value;
this._fetchLabels();
}
removeLabel(item) {
let { removeModalTitle } = this.state;
let _this = this;
Modal.confirm({
title: removeModalTitle,
content: `您确定要删除:${item.path} 标签吗?`,
onOk() {
_this.props.setAlitaState({ funcName: 'pLabelDelete', params: item.id })
.then(() => {
message.info('删除失败!');
_this._fetchLabels();
});
},
});
}
renderItem(item) {
return ({item.path}
{item.title}