Commit 1a3391ad authored by wenmo's avatar wenmo

Studio其他配置

parent 88d7d176
......@@ -129,6 +129,8 @@ const StudioMenu = (props: any) => {
const saveSqlAndSettingToTask = async () => {
const fieldsValue = await form.validateFields();
// console.log(fieldsValue);
// return;
if (current.task) {
let task = {
...current.task,
......
import {connect} from "umi";
import {StateType} from "@/pages/FlinkSqlStudio/model";
import {Form, InputNumber, Input, Switch, Select, Tag, Row, Col, Badge, Tooltip, Button, Typography} from "antd";
import {InfoCircleOutlined,PlusOutlined,MinusSquareOutlined} from "@ant-design/icons";
import {Form, InputNumber, Input, Switch, Select, Tag, Row, Col, Badge, Tooltip, Button, Typography,Space} from "antd";
import {InfoCircleOutlined,PlusOutlined,MinusSquareOutlined,MinusCircleOutlined} from "@ant-design/icons";
import styles from "./index.less";
import {useEffect, useState} from "react";
import {showCluster, showTables} from "@/components/Studio/StudioEvent/DDL";
import { showTables} from "@/components/Studio/StudioEvent/DDL";
const { Option } = Select;
const { Text } = Typography;
......@@ -39,7 +39,7 @@ const StudioSetting = (props: any) => {
break;
}
}
// console.log(change);
dispatch&&dispatch({
type: "Studio/saveTabs",
payload: newTabs,
......@@ -131,6 +131,45 @@ const StudioSetting = (props: any) => {
</Form.Item>
</Col>
</Row>
<Form.Item
label="其他配置" className={styles.form_item}
tooltip={{ title: '其他配置项,将被应用于执行环境,如 pipeline.name', icon: <InfoCircleOutlined /> }}
>
<Form.List name="config"
>
{(fields, { add, remove }) => (
<>
{fields.map(({ key, name, fieldKey, ...restField }) => (
<Space key={key} style={{ display: 'flex' }} align="baseline">
<Form.Item
{...restField}
name={[name, 'key']}
// fieldKey={[fieldKey, 'key']}
style={{ marginBottom: '5px' }}
>
<Input placeholder="参数" />
</Form.Item>
<Form.Item
{...restField}
name={[name, 'value']}
// fieldKey={[fieldKey, 'value']}
style={{ marginBottom: '5px' }}
>
<Input placeholder="值" />
</Form.Item>
<MinusCircleOutlined onClick={() => remove(name)} />
</Space>
))}
<Form.Item>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
添加配置项
</Button>
</Form.Item>
</>
)}
</Form.List>
</Form.Item>
</Form>
</>
);
......
......@@ -12,7 +12,8 @@ const { TabPane } = Tabs;
const StudioRightTool = (props:any) => {
const [form] = Form.useForm();
// const [form] = Form.useForm();
const {form} = props;
return (
<Tabs defaultActiveKey="1" size="small" tabPosition="right" style={{ height: "100%",border: "1px solid #f0f0f0"}}>
<TabPane tab={<span><SettingOutlined /> 作业配置</span>} key="StudioSetting" >
......
......@@ -139,6 +139,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
session:'',
maxRowNum: 100,
jobName:node.name,
config: [],
useResult:false,
useSession:false,
useRemote:true,
......
......@@ -49,7 +49,7 @@ const Studio: React.FC<StudioProps> = (props) => {
{/*<StudioConsole/>*/}
</Col>
<Col span={4} className={styles["vertical-tabs"]}>
<StudioRightTool/>
<StudioRightTool form={form}/>
</Col>
</Row>
<Row>
......
......@@ -46,6 +46,7 @@ export type TaskType = {
savePointPath?: string,
parallelism?: number,
fragment?: boolean,
config?: [],
clusterId?: any,
clusterName?: string,
note?: string,
......@@ -162,6 +163,7 @@ const Model: ModelType = {
clusterId: 0,
clusterName: "本地环境",
maxRowNum: 100,
config: [],
session: '',
alias: '草稿',
useResult:true,
......@@ -193,6 +195,7 @@ const Model: ModelType = {
clusterId: 0,
clusterName: "本地环境",
session: '',
config: [],
maxRowNum: 100,
alias: '草稿',
useResult:true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment