From 77636132162bf520e98852b9741b81ec4e713036 Mon Sep 17 00:00:00 2001 From: chenhua Date: Mon, 23 Nov 2020 00:19:55 +0800 Subject: [PATCH] #search manage keyword modify --- .../pages/SearchManage/alias/AliasManage.js | 517 +++-------- .../pages/SearchManage/alias/AliasManage.less | 49 - .../SearchManage/alias/{param.js => Param.js} | 16 +- .../SearchManage/alias/{rule.js => Rule.js} | 14 +- .../SearchManage/analyzer/AnalyzerTest.js | 548 +++-------- web/src/pages/SearchManage/analyzer/Manage.js | 14 +- web/src/pages/SearchManage/models/logstash.js | 49 + web/src/pages/SearchManage/nlp/Intention.js | 12 +- web/src/pages/SearchManage/nlp/Knowledge.js | 20 +- web/src/pages/SearchManage/nlp/Query.js | 14 +- web/src/pages/SearchManage/nlp/Text.js | 18 +- .../pages/SearchManage/template/History.js | 854 ++++++++++++------ .../pages/SearchManage/template/History.less | 210 +---- web/src/pages/SearchManage/template/Param.js | 845 ++++++++++++----- .../pages/SearchManage/template/Param.less | 210 +---- .../pages/SearchManage/template/Summary.js | 655 ++++++++------ 16 files changed, 2011 insertions(+), 2034 deletions(-) delete mode 100644 web/src/pages/SearchManage/alias/AliasManage.less rename web/src/pages/SearchManage/alias/{param.js => Param.js} (97%) rename web/src/pages/SearchManage/alias/{rule.js => Rule.js} (97%) create mode 100644 web/src/pages/SearchManage/models/logstash.js diff --git a/web/src/pages/SearchManage/alias/AliasManage.js b/web/src/pages/SearchManage/alias/AliasManage.js index ebf7a29b..c35f98e5 100644 --- a/web/src/pages/SearchManage/alias/AliasManage.js +++ b/web/src/pages/SearchManage/alias/AliasManage.js @@ -1,273 +1,104 @@ 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 './AliasManage.less'; +import styles from '../../List/TableList.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; + const { modalVisible, form, handleAdd, handleModalVisible } = props; + const okHandle = () => { form.validateFields((err, fieldsValue) => { if (err) return; - const formVals = { ...oldValue, ...fieldsValue }; - this.setState( - { - formVals, - }, - () => { - if (currentStep < 2) { - this.forward(); - } else { - handleUpdate(formVals); - } - } - ); + form.resetFields(); + handleAdd(fieldsValue); }); }; + return ( + handleModalVisible()} + > + + {form.getFieldDecorator('index', { + rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }], + })()} + + + {form.getFieldDecorator('settings', { + rules: [{ required: true }], + })(