[fix]部署上线
This commit is contained in:
parent
db78250da2
commit
5381995c83
@ -1,10 +1,22 @@
|
||||
import { genChartByAiUsingPOST } from '@/services/answerbi/chartController';
|
||||
import { UploadOutlined } from '@ant-design/icons';
|
||||
import { Button, Card, Col, Divider, Form, Input, Row, Select, Space, Spin, Upload, message } from 'antd';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
Col,
|
||||
Divider,
|
||||
Form,
|
||||
Input,
|
||||
message,
|
||||
Row,
|
||||
Select,
|
||||
Space,
|
||||
Spin,
|
||||
Upload,
|
||||
} from 'antd';
|
||||
import TextArea from 'antd/es/input/TextArea';
|
||||
import React, { useState } from 'react';
|
||||
import ReactECharts from 'echarts-for-react';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
|
||||
const AddChart: React.FC = () => {
|
||||
//定义状态,用来接收后端返回值,让它实时展示再页面上
|
||||
@ -12,7 +24,6 @@ const AddChart: React.FC = () => {
|
||||
const [option, setOption] = useState<any>();
|
||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
||||
|
||||
|
||||
const onFinish = async (values: any) => {
|
||||
if (submitting) return;
|
||||
setSubmitting(true);
|
||||
@ -36,7 +47,7 @@ const AddChart: React.FC = () => {
|
||||
const chartOption = JSON.parse(res.data.genChart ?? '');
|
||||
console.log(chartOption);
|
||||
if (!chartOption) {
|
||||
throw new Error('图表代码解析错误')
|
||||
throw new Error('图表代码解析错误');
|
||||
} else {
|
||||
setChart(res.data);
|
||||
setOption(chartOption);
|
||||
@ -50,13 +61,13 @@ const AddChart: React.FC = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className='add-chart'>
|
||||
<div className="add-chart">
|
||||
<Row gutter={24}>
|
||||
<Col span={12}>
|
||||
<Card title="智能分析">
|
||||
<Form
|
||||
name="addChart"
|
||||
labelAlign='left'
|
||||
labelAlign="left"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
onFinish={onFinish}
|
||||
@ -67,11 +78,11 @@ const AddChart: React.FC = () => {
|
||||
label="分析目标"
|
||||
rules={[{ required: true, message: '请输入分析目标!' }]}
|
||||
>
|
||||
<TextArea placeholder='请输入你的分析需求,比如:分析网站用户的增长情况'/>
|
||||
<TextArea placeholder="请输入你的分析需求,比如:分析网站用户的增长情况" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="chartName" label="图表名称">
|
||||
<Input placeholder='请输入图表名称'/>
|
||||
<Input placeholder="请输入图表名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="chartType" label="图表类型">
|
||||
@ -88,14 +99,16 @@ const AddChart: React.FC = () => {
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="file" label="上传原始数据">
|
||||
<Upload name="file">
|
||||
<Upload name="file" action="/uploadExcel">
|
||||
<Button icon={<UploadOutlined />}>上传EXCEL文件</Button>
|
||||
</Upload>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item wrapperCol={{ span: 12, offset: 6 }}>
|
||||
<Space>
|
||||
<Button type="primary" htmlType="submit">提交</Button>
|
||||
<Button type="primary" htmlType="submit">
|
||||
提交
|
||||
</Button>
|
||||
<Button htmlType="reset">重置</Button>
|
||||
</Space>
|
||||
</Form.Item>
|
||||
|
||||
@ -1,17 +1,15 @@
|
||||
import { genChartByAiAsyncMqUsingPOST } from '@/services/answerbi/chartController';
|
||||
import { UploadOutlined } from '@ant-design/icons';
|
||||
import { Button, Card, Form, Input, Select, Space, Upload, message } from 'antd';
|
||||
import { Button, Card, Form, Input, message, Select, Space, Upload } from 'antd';
|
||||
import { useForm } from 'antd/es/form/Form';
|
||||
import TextArea from 'antd/es/input/TextArea';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
|
||||
const AddChartAsync: React.FC = () => {
|
||||
//定义状态,用来接收后端返回值,让它实时展示再页面上
|
||||
const [form] = useForm();
|
||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
||||
|
||||
|
||||
const onFinish = async (values: any) => {
|
||||
if (submitting) return;
|
||||
setSubmitting(true);
|
||||
@ -38,12 +36,12 @@ const AddChartAsync: React.FC = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className='add-chart-async'>
|
||||
<div className="add-chart-async">
|
||||
<Card title="智能分析">
|
||||
<Form
|
||||
form={form}
|
||||
name="addChart"
|
||||
labelAlign='left'
|
||||
labelAlign="left"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
onFinish={onFinish}
|
||||
@ -54,11 +52,11 @@ const AddChartAsync: React.FC = () => {
|
||||
label="分析目标"
|
||||
rules={[{ required: true, message: '请输入分析目标!' }]}
|
||||
>
|
||||
<TextArea placeholder='请输入你的分析需求,比如:分析网站用户的增长情况'/>
|
||||
<TextArea placeholder="请输入你的分析需求,比如:分析网站用户的增长情况" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="chartName" label="图表名称">
|
||||
<Input placeholder='请输入图表名称'/>
|
||||
<Input placeholder="请输入图表名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="chartType" label="图表类型">
|
||||
@ -75,14 +73,16 @@ const AddChartAsync: React.FC = () => {
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="file" label="上传原始数据">
|
||||
<Upload name="file">
|
||||
<Upload name="file" action="/uploadExcel">
|
||||
<Button icon={<UploadOutlined />}>上传EXCEL文件</Button>
|
||||
</Upload>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item wrapperCol={{ span: 12, offset: 6 }}>
|
||||
<Space>
|
||||
<Button type="primary" htmlType="submit">提交</Button>
|
||||
<Button type="primary" htmlType="submit">
|
||||
提交
|
||||
</Button>
|
||||
<Button htmlType="reset">重置</Button>
|
||||
</Space>
|
||||
</Form.Item>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user