diff --git a/web/config/router.config.js b/web/config/router.config.js index f648edbf..b82b0695 100644 --- a/web/config/router.config.js +++ b/web/config/router.config.js @@ -132,25 +132,115 @@ export default [ icon: 'search', routes: [ { - path: '/search/template', - name: 'template', - component: './SearchManage/SearchTemplate', + path: '/search/template', + name: 'template', + component: './SearchManage/template/Template', + routes: [ + { + path: '/search/template', + redirect: '/search/template/summary', + }, + { + path: '/search/template/summary', + component: './SearchManage/template/Summary', + }, + { + path: '/search/template/template', + component: './SearchManage/template/SearchTemplate', + }, + { + path: '/search/template/param', + component: './SearchManage/template/Param', + }, + { + path: '/search/template/history', + component: './SearchManage/template/History', + }, + ] }, { path: '/search/alias', name: 'alias', - component: './SearchManage/AliasManage', + component: './SearchManage/alias/Alias', + routes: [ + { + path: '/search/alias', + redirect: '/search/alias/index', + }, + { + path: '/search/alias/index', + component: './SearchManage/alias/AliasManage', + }, + { + path: '/search/alias/param', + component: './SearchManage/alias/Param', + }, + { + path: '/search/alias/rule', + component: './SearchManage/alias/Rule', + } + ] }, { path: '/search/dict', name: 'dict', - component: './SearchManage/DictManage', + component: './SearchManage/dict/Dict', + routes: [ + { + path: '/search/dict', + redirect: '/search/dict/professional', + }, + { + path: '/search/dict/professional', + component: './SearchManage/dict/Professional', + }, + { + path: '/search/dict/common', + component: './SearchManage/dict/Common', + } + ] }, { path: '/search/analyzer', name: 'analyzer', - component: './SearchManage/AnalyzerManage', + component: './SearchManage/analyzer/Analyzer', + routes: [ + { + path: '/search/analyzer', + redirect: '/search/analyzer/manage', + }, + { + path: '/search/analyzer/manage', + component: './SearchManage/analyzer/Manage', + }, + { + path: '/search/analyzer/test', + component: './SearchManage/analyzer/AnalyzerTest', + } + ] }, { path: '/search/nlp', name: 'nlp', - component: './SearchManage/NLPManage', + component: './SearchManage/nlp/NLP', + routes: [ + { + path: '/search/nlp', + redirect: '/search/nlp/query', + }, + { + path: '/search/nlp/query', + component: './SearchManage/nlp/Query', + }, + { + path: '/search/nlp/intention', + component: './SearchManage/nlp/Intention', + }, + { + path: '/search/nlp/knowledge', + component: './SearchManage/nlp/Knowledge', + }, + { + path: '/search/nlp/text', + component: './SearchManage/nlp/Text', + } + ] }, ] }, diff --git a/web/src/pages/SearchManage/AnalyzerManage.js b/web/src/pages/SearchManage/AnalyzerManage.js deleted file mode 100644 index 166a0e90..00000000 --- a/web/src/pages/SearchManage/AnalyzerManage.js +++ /dev/null @@ -1,675 +0,0 @@ -import React, { PureComponent, Fragment } from 'react'; -import { connect } from 'dva'; -import moment from 'moment'; -import { - Row, - Col, - Card, - Form, - Input, - Select, - Icon, - Button, - Dropdown, - Menu, - InputNumber, - DatePicker, - Modal, - message, - Badge, - Divider, - Steps, - Radio, -} from 'antd'; -import StandardTable from '@/components/StandardTable'; -import PageHeaderWrapper from '@/components/PageHeaderWrapper'; - -import styles from './AnalyzerManage.less'; - -const FormItem = Form.Item; -const { Step } = Steps; -const { TextArea } = Input; -const { Option } = Select; -const RadioGroup = Radio.Group; -const getValue = obj => - Object.keys(obj) - .map(key => obj[key]) - .join(','); -const statusMap = ['default', 'processing', 'success', 'error']; -const status = ['关闭', '运行中', '已上线', '异常']; - -const CreateForm = Form.create()(props => { - const { modalVisible, form, handleAdd, handleModalVisible } = props; - const okHandle = () => { - form.validateFields((err, fieldsValue) => { - if (err) return; - form.resetFields(); - handleAdd(fieldsValue); - }); - }; - return ( - handleModalVisible()} - > - - {form.getFieldDecorator('desc', { - rules: [{ required: true, message: '请输入至少五个字符的规则描述!', min: 5 }], - })()} - - - ); -}); - -@Form.create() -class UpdateForm extends PureComponent { - constructor(props) { - super(props); - - this.state = { - formVals: { - name: props.values.name, - desc: props.values.desc, - key: props.values.key, - target: '0', - template: '0', - type: '1', - time: '', - frequency: 'month', - }, - currentStep: 0, - }; - - this.formLayout = { - labelCol: { span: 7 }, - wrapperCol: { span: 13 }, - }; - } - - handleNext = currentStep => { - const { form, handleUpdate } = this.props; - const { formVals: oldValue } = this.state; - form.validateFields((err, fieldsValue) => { - if (err) return; - const formVals = { ...oldValue, ...fieldsValue }; - this.setState( - { - formVals, - }, - () => { - if (currentStep < 2) { - this.forward(); - } else { - handleUpdate(formVals); - } - } - ); - }); - }; - - backward = () => { - const { currentStep } = this.state; - this.setState({ - currentStep: currentStep - 1, - }); - }; - - forward = () => { - const { currentStep } = this.state; - this.setState({ - currentStep: currentStep + 1, - }); - }; - - renderContent = (currentStep, formVals) => { - const { form } = this.props; - if (currentStep === 1) { - return [ - - {form.getFieldDecorator('target', { - initialValue: formVals.target, - })( - - )} - , - - {form.getFieldDecorator('template', { - initialValue: formVals.template, - })( - - )} - , - - {form.getFieldDecorator('type', { - initialValue: formVals.type, - })( - - - - - )} - , - ]; - } - if (currentStep === 2) { - return [ - - {form.getFieldDecorator('time', { - rules: [{ required: true, message: '请选择开始时间!' }], - })( - - )} - , - - {form.getFieldDecorator('frequency', { - initialValue: formVals.frequency, - })( - - )} - , - ]; - } - return [ - - {form.getFieldDecorator('name', { - rules: [{ required: true, message: '请输入规则名称!' }], - initialValue: formVals.name, - })()} - , - - {form.getFieldDecorator('desc', { - rules: [{ required: true, message: '请输入至少五个字符的规则描述!', min: 5 }], - initialValue: formVals.desc, - })(