Unverified Commit 5b80c761 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

Support wechat custom url (#2680)

* Spotless Apply * support-wechat-custom-url * Spotless Apply --------- Co-authored-by: 's avatarZzm0809 <Zzm0809@users.noreply.github.com>
parent f1ef316e
...@@ -25,10 +25,9 @@ import org.dinky.alert.AlertBaseConstant; ...@@ -25,10 +25,9 @@ import org.dinky.alert.AlertBaseConstant;
public class WeChatConstants extends AlertBaseConstant { public class WeChatConstants extends AlertBaseConstant {
public static final String TYPE = "WeChat"; public static final String TYPE = "WeChat";
/** WeChat alert baseconstant */ /** WeChat alert baseconstant */
public static final String WECHAT_PUSH_URL = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s"; public static final String WECHAT_PUSH_URL = "%s/message/send?access_token=%s";
public static final String WECHAT_TOKEN_URL = public static final String WECHAT_TOKEN_URL = "%s/gettoken?corpid=%s&corpsecret=%s";
"https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s";
public static final String CORP_ID = "corpId"; public static final String CORP_ID = "corpId";
public static final String TEAM_SEND_MSG = "teamSendMsg"; public static final String TEAM_SEND_MSG = "teamSendMsg";
public static final String AGENT_ID = "agentId"; public static final String AGENT_ID = "agentId";
......
...@@ -65,8 +65,11 @@ public class WeChatSender { ...@@ -65,8 +65,11 @@ public class WeChatSender {
if (wechatParams.getSendType().equals(WeChatType.CHAT.getValue())) { if (wechatParams.getSendType().equals(WeChatType.CHAT.getValue())) {
requireNonNull(wechatParams.getWebhook(), WeChatConstants.WEB_HOOK + " must not null"); requireNonNull(wechatParams.getWebhook(), WeChatConstants.WEB_HOOK + " must not null");
} }
weChatTokenUrlReplace = weChatTokenUrlReplace = String.format(
String.format(WeChatConstants.WECHAT_TOKEN_URL, wechatParams.getCorpId(), wechatParams.getSecret()); WeChatConstants.WECHAT_TOKEN_URL,
wechatParams.getSendUrl(),
wechatParams.getCorpId(),
wechatParams.getSecret());
} }
/** /**
...@@ -99,7 +102,7 @@ public class WeChatSender { ...@@ -99,7 +102,7 @@ public class WeChatSender {
if (WeChatType.APP.getValue().equals(wechatParams.getSendType())) { if (WeChatType.APP.getValue().equals(wechatParams.getSendType())) {
String token = getToken(); String token = getToken();
assert token != null; assert token != null;
url = String.format(WeChatConstants.WECHAT_PUSH_URL, token); url = String.format(WeChatConstants.WECHAT_PUSH_URL, wechatParams.getSendUrl(), token);
} else { } else {
url = wechatParams.getWebhook(); url = wechatParams.getWebhook();
} }
......
...@@ -40,5 +40,6 @@ public class WechatParams { ...@@ -40,5 +40,6 @@ public class WechatParams {
private int agentId; private int agentId;
private List<String> atUsers = new ArrayList<>(); private List<String> atUsers = new ArrayList<>();
private String webhook; private String webhook;
private String sendUrl = "https://qyapi.weixin.qq.com/cgi-bin";
private String keyword; private String keyword;
} }
...@@ -17,46 +17,51 @@ ...@@ -17,46 +17,51 @@
* *
*/ */
import {TabsItemType, TaskDataType} from '@/pages/DataStudio/model'; import { TabsItemType, TaskDataType } from '@/pages/DataStudio/model';
import {Button} from 'antd'; import { Tab } from '@/pages/DataStudio/route';
import { Button } from 'antd';
import React from 'react'; import React from 'react';
import {Tab} from '@/pages/DataStudio/route';
export type CircleButtonProps = { export type CircleButtonProps = {
icon: React.ReactNode; icon: React.ReactNode;
loading?: boolean; loading?: boolean;
onClick?: () => void; onClick?: () => void;
title?: string; title?: string;
key?: string; key?: string;
}; };
export type CircleBottomButtonProps = { export type CircleBottomButtonProps = {
icon: React.ReactNode; icon: React.ReactNode;
loading?: boolean; loading?: boolean;
onClick?: (tabs: Tab[], key: string, data: TaskDataType | undefined,refresh:any) => Promise<void>; onClick?: (
title?: string; tabs: Tab[],
key?: string; key: string,
data: TaskDataType | undefined,
refresh: any
) => Promise<void>;
title?: string;
key?: string;
}; };
export type CircleDataStudioButtonProps = { export type CircleDataStudioButtonProps = {
icon: React.ReactNode; icon: React.ReactNode;
loading?: boolean; loading?: boolean;
onClick?: (panes: TabsItemType[], activeKey: string) => void; onClick?: (panes: TabsItemType[], activeKey: string) => void;
title?: string; title?: string;
key?: string; key?: string;
isShow?: boolean; isShow?: boolean;
}; };
export const CircleBtn: React.FC<CircleButtonProps> = (props) => { export const CircleBtn: React.FC<CircleButtonProps> = (props) => {
const {onClick, title, icon, loading} = props; const { onClick, title, icon, loading } = props;
return ( return (
<Button <Button
title={title} title={title}
loading={loading} loading={loading}
icon={icon} icon={icon}
block block
type={'text'} type={'text'}
shape={'circle'} shape={'circle'}
onClick={onClick} onClick={onClick}
/> />
); );
}; };
...@@ -516,6 +516,11 @@ export default { ...@@ -516,6 +516,11 @@ export default {
'rc.ai.actionPleaseHolder': 'Please enter the interface method', 'rc.ai.actionPleaseHolder': 'Please enter the interface method',
'rc.ai.agentId': 'AgentId', 'rc.ai.agentId': 'AgentId',
'rc.ai.agentIdPleaseHolder': 'Please enter AgentId', 'rc.ai.agentIdPleaseHolder': 'Please enter AgentId',
'rc.ai.sendUrl': 'QiWei Send Addr',
'rc.ai.sendUrlPleaseHolder': 'Please enter the sending address or the proxy address',
'rc.ai.sendUrlValidate': 'Please enter the correct sending address, no / is required at the end',
'rc.ai.sendUrlTooltip':
'You can enter the proxy address for the sending address, such as: http://127.0.0.1:8080/cgi-bin, the default is: https://qyapi.weixin.qq.com/cgi-bin ',
'rc.ai.apikey': 'Account unique identifier', 'rc.ai.apikey': 'Account unique identifier',
'rc.ai.apikeyPleaseHolder': 'Please enter the unique ID of the account', 'rc.ai.apikeyPleaseHolder': 'Please enter the unique ID of the account',
'rc.ai.appId': 'App ID', 'rc.ai.appId': 'App ID',
......
...@@ -495,6 +495,11 @@ export default { ...@@ -495,6 +495,11 @@ export default {
'rc.ai.actionPleaseHolder': '请输入接口方法', 'rc.ai.actionPleaseHolder': '请输入接口方法',
'rc.ai.agentId': '代理ID', 'rc.ai.agentId': '代理ID',
'rc.ai.agentIdPleaseHolder': '请输入 AgentId', 'rc.ai.agentIdPleaseHolder': '请输入 AgentId',
'rc.ai.sendUrl': '企微发送地址',
'rc.ai.sendUrlPleaseHolder': '请输入发送地址可输入代理地址',
'rc.ai.sendUrlValidate': '请输入正确的发送地址,末尾不需要带 /',
'rc.ai.sendUrlTooltip':
'发送地址可输入代理地址,如:http://127.0.0.1:8080/cgi-bin ,默认为:https://qyapi.weixin.qq.com/cgi-bin',
'rc.ai.apikey': '账号唯一标识', 'rc.ai.apikey': '账号唯一标识',
'rc.ai.apikeyPleaseHolder': '请输入账号唯一标识', 'rc.ai.apikeyPleaseHolder': '请输入账号唯一标识',
'rc.ai.appId': '应用 ID', 'rc.ai.appId': '应用 ID',
......
...@@ -17,79 +17,85 @@ ...@@ -17,79 +17,85 @@
* *
*/ */
import {SseData} from '@/models/Sse'; import { SseData } from '@/models/Sse';
import {TaskDataType} from '@/pages/DataStudio/model'; import { TaskDataType } from '@/pages/DataStudio/model';
import {SSE_TOPIC} from '@/pages/DevOps/constants'; import { SSE_TOPIC } from '@/pages/DevOps/constants';
import {postAll} from '@/services/api'; import { postAll } from '@/services/api';
import {l} from '@/utils/intl'; import { l } from '@/utils/intl';
import {useModel} from '@@/exports'; import { useModel } from '@@/exports';
import {Modal, Select} from 'antd'; import { Modal, Select } from 'antd';
import TextArea from 'antd/es/input/TextArea'; import TextArea from 'antd/es/input/TextArea';
import {Tab} from 'rc-tabs/lib/interface.d'; import { Tab } from 'rc-tabs/lib/interface.d';
import * as React from 'react'; import { useEffect, useState } from 'react';
import {useEffect, useState} from 'react';
export async function getPrintTables(statement: string) { export async function getPrintTables(statement: string) {
return postAll('api/printTable/getPrintTables', {statement}); return postAll('api/printTable/getPrintTables', { statement });
} }
/*--- Clear Console ---*/ /*--- Clear Console ---*/
export type PrintTable = { export type PrintTable = {
tableName: string; tableName: string;
fullTableName: string; fullTableName: string;
}; };
export const DataPage = (props: any) => { export const DataPage = (props: any) => {
const {style, title} = props; const { style, title } = props;
const [consoleInfo, setConsoleInfo] = useState<string>(''); const [consoleInfo, setConsoleInfo] = useState<string>('');
const {subscribeTopic} = useModel('Sse', (model: any) => ({ const { subscribeTopic } = useModel('Sse', (model: any) => ({
subscribeTopic: model.subscribeTopic subscribeTopic: model.subscribeTopic
})); }));
const [tableName, setTableName] = useState<string>(''); const [tableName, setTableName] = useState<string>('');
useEffect(() => { useEffect(() => {
if (title) { if (title) {
setTableName(title.tableName); setTableName(title.tableName);
const topic = `${SSE_TOPIC.PRINT_TABLE}/${title.fullTableName}`; const topic = `${SSE_TOPIC.PRINT_TABLE}/${title.fullTableName}`;
return subscribeTopic([topic], (data: SseData) => { return subscribeTopic([topic], (data: SseData) => {
setConsoleInfo((preConsoleInfo) => preConsoleInfo + '\n' + data.data); setConsoleInfo((preConsoleInfo) => preConsoleInfo + '\n' + data.data);
}); });
} }
}, []); }, []);
return <TextArea value={consoleInfo} style={{width: style.width, height: style.height}}/>; return <TextArea value={consoleInfo} style={{ width: style.width, height: style.height }} />;
}; };
export const onAdd = async (tabs: Tab[], key: string, data: TaskDataType | undefined, refresh: any) => { export const onAdd = async (
const statement = data?.statement; tabs: Tab[],
key: string,
data: TaskDataType | undefined,
refresh: any
) => {
const statement = data?.statement;
if (!statement) return; if (!statement) return;
const tabNames = tabs.map((tab) => tab.label); const tabNames = tabs.map((tab) => tab.label);
const result = await getPrintTables(statement); const result = await getPrintTables(statement);
const tables: PrintTable[] = result.data.filter((table: PrintTable) => !tabNames.includes(table.tableName)); const tables: PrintTable[] = result.data.filter(
(table: PrintTable) => !tabNames.includes(table.tableName)
);
let selectTable: PrintTable; let selectTable: PrintTable;
Modal.confirm({ Modal.confirm({
title: l('pages.datastudio.print.table.inputTableName'), title: l('pages.datastudio.print.table.inputTableName'),
content: ( content: (
<Select <Select
defaultValue='' defaultValue=''
style={{width: '90%'}} style={{ width: '90%' }}
onChange={(e, t: any) => { onChange={(e, t: any) => {
selectTable = {tableName: t.label, fullTableName: t.value}; selectTable = { tableName: t.label, fullTableName: t.value };
}} }}
options={tables.map((table) => ({label: table.tableName, value: table.fullTableName}))} options={tables.map((table) => ({ label: table.tableName, value: table.fullTableName }))}
/> />
), ),
onOk() { onOk() {
tabs.push({ tabs.push({
key: key + "/" + selectTable.tableName, key: key + '/' + selectTable.tableName,
label: selectTable.tableName, label: selectTable.tableName,
children: <DataPage title={selectTable} style={{width: '100%', height: '100%'}}/> children: <DataPage title={selectTable} style={{ width: '100%', height: '100%' }} />
}); });
refresh() refresh();
// onOk(selectTable); // onOk(selectTable);
}, },
zIndex: 1000 zIndex: 1000
}); });
} };
\ No newline at end of file
...@@ -17,310 +17,334 @@ ...@@ -17,310 +17,334 @@
* *
*/ */
import {CircleBtn} from '@/components/CallBackButton/CircleBtn'; import { CircleBtn } from '@/components/CallBackButton/CircleBtn';
import Title from '@/components/Front/Title'; import Title from '@/components/Front/Title';
import ContentScroll from '@/components/Scroll/ContentScroll'; import ContentScroll from '@/components/Scroll/ContentScroll';
import MovableSidebar from '@/components/Sidebar/MovableSidebar'; import MovableSidebar from '@/components/Sidebar/MovableSidebar';
import { getCurrentData } from '@/pages/DataStudio/function';
import { import {
StateType, StateType,
STUDIO_MODEL, STUDIO_MODEL,
TabsItemType, TabsItemType,
TabsPageType, TabsPageType,
VIEW VIEW
} from '@/pages/DataStudio/model'; } from '@/pages/DataStudio/model';
import {BottomBtnRoute, LeftBottomMoreTabs, LeftBottomSide, Tab} from '@/pages/DataStudio/route'; import { BottomBtnRoute, LeftBottomMoreTabs, LeftBottomSide, Tab } from '@/pages/DataStudio/route';
import {l} from '@/utils/intl'; import { BottomTabRoute } from '@/pages/DataStudio/TabRoute';
import {connect} from '@@/exports'; import { l } from '@/utils/intl';
import {ConfigProvider, Space, Tabs} from 'antd'; import { connect } from '@@/exports';
import React, {useEffect, useState} from 'react'; import { ConfigProvider, Space, Tabs } from 'antd';
import {getCurrentData} from "@/pages/DataStudio/function"; import React, { useEffect, useState } from 'react';
import {BottomTabRoute} from "@/pages/DataStudio/TabRoute";
export type BottomContainerProps = { export type BottomContainerProps = {
size: number; size: number;
height: number | string; height: number | string;
}; };
const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
const { const {
dispatch, dispatch,
size, size,
bottomContainer, bottomContainer,
height, height,
tabs: {activeKey, panes} tabs: { activeKey, panes }
} = props; } = props;
const currentData = getCurrentData(panes, activeKey); const currentData = getCurrentData(panes, activeKey);
const taskId = currentData?.id ?? 0; const taskId = currentData?.id ?? 0;
const [tabState, setTabState] = useState<Record<string, Tab[]>>(Object.keys(BottomTabRoute).map(x => ({[x]: []})).reduce((a, b) => ({...a, ...b}), {})); const [tabState, setTabState] = useState<Record<string, Tab[]>>(
const tabItems = (LeftBottomMoreTabs[bottomContainer.selectKey] ?? []).map((item: any) => { Object.keys(BottomTabRoute)
return { .map((x) => ({ [x]: [] }))
key: bottomContainer.selectKey + '/' + item.key, .reduce((a, b) => ({ ...a, ...b }), {})
label: (<span>{item.icon}{item.label}</span>) );
}; const tabItems = (LeftBottomMoreTabs[bottomContainer.selectKey] ?? []).map((item: any) => {
}) return {
useEffect(() => { key: bottomContainer.selectKey + '/' + item.key,
setTabState({...tabState, [bottomContainer.selectKey]: []}); label: (
},[taskId,bottomContainer.selectKey]) <span>
const refresh = () => { {item.icon}
const tabs = tabState?.[bottomContainer.selectKey] ?? []; {item.label}
setTabState({...tabState, [bottomContainer.selectKey]: [...tabs]}) </span>
} )
};
});
useEffect(() => {
setTabState({ ...tabState, [bottomContainer.selectKey]: [] });
}, [taskId, bottomContainer.selectKey]);
const refresh = () => {
const tabs = tabState?.[bottomContainer.selectKey] ?? [];
setTabState({ ...tabState, [bottomContainer.selectKey]: [...tabs] });
};
const width = document.documentElement.clientWidth - VIEW.sideWidth * 2; const width = document.documentElement.clientWidth - VIEW.sideWidth * 2;
/** /**
* 侧边栏最小化 * 侧边栏最小化
*/ */
const handleMinimize = () => { const handleMinimize = () => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectBottomKey, type: STUDIO_MODEL.updateSelectBottomKey,
payload: '' payload: ''
}); });
}; };
/** /**
* 更新底部高度 * 更新底部高度
* @param {number} height * @param {number} height
*/ */
const updateBottomHeight = (height: number) => { const updateBottomHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateBottomHeight, type: STUDIO_MODEL.updateBottomHeight,
payload: height payload: height
}); });
}; };
/** /**
* 更新中间内容高度 * 更新中间内容高度
* @param {number} height * @param {number} height
*/ */
const updateCenterContentHeight = (height: number) => { const updateCenterContentHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateCenterContentHeight, type: STUDIO_MODEL.updateCenterContentHeight,
payload: height payload: height
}); });
}; };
const updateSelectBottomSubKey = (key: string) => { const updateSelectBottomSubKey = (key: string) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectBottomSubKey, type: STUDIO_MODEL.updateSelectBottomSubKey,
payload: key payload: key
}); });
}; };
const updateSelectBottomKey = (key: string) => { const updateSelectBottomKey = (key: string) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectBottomKey, type: STUDIO_MODEL.updateSelectBottomKey,
payload: key payload: key
}); });
}; };
/**
* 更新工具栏内容高度
* @param {number} height
*/
const updateToolContentHeight = (height: number) => {
dispatch({
type: STUDIO_MODEL.updateToolContentHeight,
payload: height
});
};
const getSubTabs = () => {
// @ts-ignore
return Object.values(
Object.keys(LeftBottomMoreTabs).map((x) =>
LeftBottomMoreTabs[x].map((y) => {
return { ...y, key: x + '/' + y.key };
})
)
).flatMap((x) => x);
};
/** /**
* 更新工具栏内容高度 * 拖动回调
* @param {number} height * @param event
*/ * @param direction
const updateToolContentHeight = (height: number) => { * @param {{offsetHeight: any}} elementRef
dispatch({ */
type: STUDIO_MODEL.updateToolContentHeight, const resizeCallback = (
payload: height event: any,
}); direction: any,
elementRef: {
offsetHeight: any;
}
) => {
const centerContentHeight =
document.documentElement.clientHeight -
VIEW.headerHeight -
VIEW.headerNavHeight -
VIEW.footerHeight -
VIEW.otherHeight -
elementRef.offsetHeight;
updateBottomHeight(elementRef.offsetHeight);
updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
};
const renderTabPane = () => {
const onChange = (activeKey: string) => {
updateSelectBottomSubKey(activeKey.split('/')[1]);
}; };
const getSubTabs = () => { const onEdit = async (
// @ts-ignore targetKey: React.MouseEvent | React.KeyboardEvent | string,
return Object.values( action: 'add' | 'remove'
Object.keys(LeftBottomMoreTabs).map((x) => ) => {
LeftBottomMoreTabs[x].map((y) => { switch (action) {
return {...y, key: x + '/' + y.key}; case 'add':
}) await BottomTabRoute[bottomContainer.selectKey].onAdd(
) tabState?.[bottomContainer.selectKey] ?? [],
).flatMap((x) => x); bottomContainer.selectKey,
currentData,
refresh
);
break;
case 'remove':
const newPanes = tabState?.[bottomContainer.selectKey].filter(
(pane) => pane.key !== targetKey
);
setTabState({ ...tabState, [bottomContainer.selectKey]: newPanes });
break;
}
}; };
return (
<>
<Tabs
style={{ height: '32px', display: '-webkit-box' }}
items={tabItems}
type='card'
onChange={(key: string) => {
updateSelectBottomSubKey(key.split('/')[1]);
}}
activeKey={
bottomContainer.selectKey +
'/' +
bottomContainer.selectSubKey[bottomContainer.selectKey]
}
size='small'
tabPosition='top'
/>
{BottomTabRoute[bottomContainer.selectKey] && (
<Tabs
style={{ height: '32px', display: '-webkit-box' }}
items={tabState?.[bottomContainer.selectKey].map((x) => ({
key: x.key,
label: x.label
}))}
onEdit={onEdit}
activeKey={
bottomContainer.selectKey +
'/' +
bottomContainer.selectSubKey[bottomContainer.selectKey]
}
onChange={onChange}
type='editable-card'
size='small'
tabPosition='top'
/>
)}
</>
);
};
const renderItems = () => {
return [
...LeftBottomSide.filter((tab) => {
if (!tab.isShow) {
return true;
}
if (parseInt(activeKey) < 0) {
return TabsPageType.None;
}
const currentTab = (panes as TabsItemType[]).find((item) => item.key === activeKey);
const show = tab.isShow(currentTab?.type ?? TabsPageType.None, currentTab?.subType);
// 如果当前打开的菜单等于 状态存的菜单 且 菜单不显示状态下,先切换到项目key(因为项目key 不可能不显示) 在关闭这个
// if current open menu equal status menu and menu is not show status, first switch to project key(because project key is not show) and close this
// if (tab.key === bottomContainer.selectKey && !show) {
// updateSelectBottomKey(
// currentTab?.subType?.toLowerCase() === DIALECT.FLINKSQLENV
// || currentTab?.subType?.toLowerCase() === DIALECT.SCALA
// || currentTab?.subType?.toLowerCase() === DIALECT.JAVA
// || currentTab?.subType?.toLowerCase() === DIALECT.PYTHON_LONG
// ? LeftBottomKey.TOOLS_KEY // 如果当前打开的是flinksql环境,scala,java,python,切换到工具栏
// : currentTab?.subType?.toLowerCase() === DIALECT.FLINK_SQL
// || currentTab?.subType?.toLowerCase() === DIALECT.FLINKJAR
// || isSql(currentTab?.subType ?? '')
// ? LeftBottomKey.CONSOLE_KEY : LeftBottomKey.TOOLS_KEY // 如果当前打开的是flinksql,flinkjar,切换到控制台
// );
// }
return show;
}).map((x) => {
return { ...x, key: x.key + '/' };
}),
...getSubTabs(),
...(tabState?.[bottomContainer.selectKey] ?? [])
].map((item) => {
return {
...item,
children: (
<ContentScroll height={props.height - VIEW.leftMargin}>{item.children}</ContentScroll>
)
};
});
};
/** return (
* 拖动回调 <MovableSidebar
* @param event title={
* @param direction <ConfigProvider
* @param {{offsetHeight: any}} elementRef theme={{
*/ components: {
const resizeCallback = ( Tabs: {
horizontalMargin: '0',
cardPaddingSM: '6px',
horizontalItemPadding: '0'
}
}
}}
>
<Space>
<Title>{l(bottomContainer.selectKey)}</Title>
{renderTabPane()}
</Space>
</ConfigProvider>
}
visible={bottomContainer.selectKey}
style={{
zIndex: 999,
height: height,
marginTop: 0,
backgroundColor: '#fff',
position: 'fixed',
bottom: VIEW.footerHeight
}}
defaultSize={{ width: '100%', height: height }}
minHeight={VIEW.midMargin}
maxHeight={size.contentHeight - 40}
onResize={(
event: any, event: any,
direction: any, direction: any,
elementRef: { elementRef: {
offsetHeight: any; offsetHeight: any;
} }
) => { ) => resizeCallback(event, direction, elementRef)}
const centerContentHeight = btnGroup={BottomBtnRoute[bottomContainer.selectKey]?.map((x) => (
document.documentElement.clientHeight - <CircleBtn
VIEW.headerHeight - key={x.key}
VIEW.headerNavHeight - icon={x.icon}
VIEW.footerHeight - onClick={async () => {
VIEW.otherHeight - const tabs = tabState?.[bottomContainer.selectKey] ?? [];
elementRef.offsetHeight; await x.onClick?.(tabs, bottomContainer.selectKey, currentData, refresh);
updateBottomHeight(elementRef.offsetHeight); refresh();
updateCenterContentHeight(centerContentHeight); }}
updateToolContentHeight(centerContentHeight - VIEW.leftMargin); />
}; ))}
enable={{ top: true }}
const renderTabPane = () => { handlerMinimize={handleMinimize}
const onChange = (activeKey: string) => { maxWidth={width}
updateSelectBottomSubKey(activeKey.split('/')[1]); >
<Tabs
activeKey={
bottomContainer.selectKey +
'/' +
(bottomContainer.selectSubKey[bottomContainer.selectKey]
? bottomContainer.selectSubKey[bottomContainer.selectKey]
: '')
} }
const onEdit = async ( items={renderItems()}
targetKey: React.MouseEvent | React.KeyboardEvent | string, tabBarStyle={{ display: 'none' }}
action: 'add' | 'remove' />
) => { </MovableSidebar>
switch (action) { );
case 'add':
await BottomTabRoute[bottomContainer.selectKey].onAdd(tabState?.[bottomContainer.selectKey] ?? [], bottomContainer.selectKey, currentData, refresh);
break;
case 'remove':
const newPanes = tabState?.[bottomContainer.selectKey].filter(pane => pane.key !== targetKey);
setTabState({...tabState, [bottomContainer.selectKey]: newPanes});
break;
}
};
return (
<>
<Tabs
style={{height: '32px', display: '-webkit-box'}}
items={tabItems}
type='card'
onChange={(key: string) => {
updateSelectBottomSubKey(key.split('/')[1]);
}}
activeKey={
bottomContainer.selectKey +
'/' +
bottomContainer.selectSubKey[bottomContainer.selectKey]
}
size='small'
tabPosition='top'
/>
{BottomTabRoute[bottomContainer.selectKey] &&
<Tabs
style={{height: '32px', display: '-webkit-box'}}
items={tabState?.[bottomContainer.selectKey].map(x => ({key: x.key, label: x.label}))}
onEdit={onEdit}
activeKey={
bottomContainer.selectKey +
'/' +
bottomContainer.selectSubKey[bottomContainer.selectKey]
}
onChange={onChange}
type='editable-card'
size='small'
tabPosition='top'
/>
}
</>
);
};
const renderItems = () => {
return [
...LeftBottomSide.filter((tab) => {
if (!tab.isShow) {
return true;
}
if (parseInt(activeKey) < 0) {
return TabsPageType.None;
}
const currentTab = (panes as TabsItemType[]).find((item) => item.key === activeKey);
const show = tab.isShow(currentTab?.type ?? TabsPageType.None, currentTab?.subType);
// 如果当前打开的菜单等于 状态存的菜单 且 菜单不显示状态下,先切换到项目key(因为项目key 不可能不显示) 在关闭这个
// if current open menu equal status menu and menu is not show status, first switch to project key(because project key is not show) and close this
// if (tab.key === bottomContainer.selectKey && !show) {
// updateSelectBottomKey(
// currentTab?.subType?.toLowerCase() === DIALECT.FLINKSQLENV
// || currentTab?.subType?.toLowerCase() === DIALECT.SCALA
// || currentTab?.subType?.toLowerCase() === DIALECT.JAVA
// || currentTab?.subType?.toLowerCase() === DIALECT.PYTHON_LONG
// ? LeftBottomKey.TOOLS_KEY // 如果当前打开的是flinksql环境,scala,java,python,切换到工具栏
// : currentTab?.subType?.toLowerCase() === DIALECT.FLINK_SQL
// || currentTab?.subType?.toLowerCase() === DIALECT.FLINKJAR
// || isSql(currentTab?.subType ?? '')
// ? LeftBottomKey.CONSOLE_KEY : LeftBottomKey.TOOLS_KEY // 如果当前打开的是flinksql,flinkjar,切换到控制台
// );
// }
return show;
}).map((x) => {
return {...x, key: x.key + '/'};
}),
...getSubTabs(), ...tabState?.[bottomContainer.selectKey] ?? []
].map((item) => {
return {
...item,
children: (
<ContentScroll height={props.height - VIEW.leftMargin}>{item.children}</ContentScroll>
)
};
});
};
return (
<MovableSidebar
title={
<ConfigProvider
theme={{
components: {
Tabs: {
horizontalMargin: '0',
cardPaddingSM: '6px',
horizontalItemPadding: '0'
}
}
}}
>
<Space>
<Title>{l(bottomContainer.selectKey)}</Title>
{renderTabPane()}
</Space>
</ConfigProvider>
}
visible={bottomContainer.selectKey}
style={{
zIndex: 999,
height: height,
marginTop: 0,
backgroundColor: '#fff',
position: 'fixed',
bottom: VIEW.footerHeight
}}
defaultSize={{width: '100%', height: height}}
minHeight={VIEW.midMargin}
maxHeight={size.contentHeight - 40}
onResize={(
event: any,
direction: any,
elementRef: {
offsetHeight: any;
}
) => resizeCallback(event, direction, elementRef)}
btnGroup={BottomBtnRoute[bottomContainer.selectKey]?.map(x => <CircleBtn key={x.key} icon={x.icon}
onClick={async () => {
const tabs = tabState?.[bottomContainer.selectKey] ?? [];
await x.onClick?.(tabs, bottomContainer.selectKey, currentData, refresh);
refresh()
}}
/>)}
enable={{top: true}}
handlerMinimize={handleMinimize}
maxWidth={width}
>
<Tabs
activeKey={
bottomContainer.selectKey +
'/' +
(bottomContainer.selectSubKey[bottomContainer.selectKey]
? bottomContainer.selectSubKey[bottomContainer.selectKey]
: '')
}
items={renderItems()}
tabBarStyle={{display: 'none'}}
/>
</MovableSidebar>
);
}; };
export default connect(({Studio}: { Studio: StateType }) => ({ export default connect(({ Studio }: { Studio: StateType }) => ({
bottomContainer: Studio.bottomContainer, bottomContainer: Studio.bottomContainer,
tabs: Studio.tabs tabs: Studio.tabs
}))(BottomContainer); }))(BottomContainer);
...@@ -17,110 +17,97 @@ ...@@ -17,110 +17,97 @@
* *
*/ */
import {CircleDataStudioButtonProps} from "@/components/CallBackButton/CircleBtn"; import { CircleDataStudioButtonProps } from '@/components/CallBackButton/CircleBtn';
import { l } from '@/utils/intl';
import { import {
ArrowsAltOutlined, ArrowsAltOutlined,
EnvironmentOutlined, EnvironmentOutlined,
PlusCircleOutlined, PlusCircleOutlined,
PlusOutlined, PlusOutlined,
ReloadOutlined, ReloadOutlined,
ShrinkOutlined ShrinkOutlined
} from "@ant-design/icons"; } from '@ant-design/icons';
import {l} from "@/utils/intl"; import { createContext, useContext, useReducer } from 'react';
import React, {createContext, useContext, useReducer} from "react";
export const BtnRoute: { [c: string]: CircleDataStudioButtonProps[] } = { export const BtnRoute: { [c: string]: CircleDataStudioButtonProps[] } = {
'menu.datastudio.datasource': [ 'menu.datastudio.datasource': [
{ {
icon: <PlusOutlined/>, icon: <PlusOutlined />,
title: l('button.create'), title: l('button.create'),
onClick: () => { onClick: () => {}
} },
}, {
{ icon: <ReloadOutlined />,
icon: <ReloadOutlined/>, title: l('button.refresh'),
title: l('button.refresh'), onClick: () => {}
onClick: () => { }
} ],
} 'menu.datastudio.catalog': [
], {
'menu.datastudio.catalog': [ icon: <ReloadOutlined />,
{ title: l('button.refresh'),
icon: <ReloadOutlined/>, onClick: () => {}
title: l('button.refresh'), }
onClick: () => { ],
} 'menu.datastudio.project': [
} {
], icon: <PlusCircleOutlined />,
'menu.datastudio.project': [ title: l('right.menu.createRoot'),
{ key: 'right.menu.createRoot',
icon: <PlusCircleOutlined/>, onClick: () => {}
title: l('right.menu.createRoot'), },
key: 'right.menu.createRoot', {
onClick: () => { icon: <ArrowsAltOutlined />,
} title: l('button.expand-all'),
}, key: 'button.expand-all',
{ onClick: () => {}
icon: <ArrowsAltOutlined/>, },
title: l('button.expand-all'), {
key: 'button.expand-all', icon: <ShrinkOutlined />,
onClick: () => { title: l('button.collapse-all'),
} key: 'button.collapse-all',
}, onClick: () => {}
{ },
icon: <ShrinkOutlined/>, {
title: l('button.collapse-all'), icon: <EnvironmentOutlined />,
key: 'button.collapse-all', title: l('button.position'),
onClick: () => { key: 'button.position',
} onClick: () => {}
}, }
{ ]
icon: <EnvironmentOutlined/>,
title: l('button.position'),
key: 'button.position',
onClick: () => {
}
}
]
}; };
type BtnAction = { type BtnAction = {
type: 'change', type: 'change';
selectKey: string, selectKey: string;
payload: CircleDataStudioButtonProps[] payload: CircleDataStudioButtonProps[];
} };
export const BtnContext = createContext(BtnRoute); export const BtnContext = createContext(BtnRoute);
const BtnDispatchContext = createContext((params: BtnAction) => { const BtnDispatchContext = createContext((params: BtnAction) => {});
});
export function useTasksDispatch() { export function useTasksDispatch() {
return useContext(BtnDispatchContext); return useContext(BtnDispatchContext);
} }
function BtnReducer(state = BtnRoute, action: BtnAction) { function BtnReducer(state = BtnRoute, action: BtnAction) {
switch (action.type) { switch (action.type) {
case 'change': { case 'change': {
return {...state, [action.selectKey]: action.payload} return { ...state, [action.selectKey]: action.payload };
}
default:
return {...state}
} }
default:
return { ...state };
}
} }
// @ts-ignore // @ts-ignore
export function BtnProvider({children}) { export function BtnProvider({ children }) {
const [btn, dispatch] = useReducer( const [btn, dispatch] = useReducer(BtnReducer, BtnRoute);
BtnReducer,
BtnRoute
);
return ( return (
<BtnContext.Provider value={btn}> <BtnContext.Provider value={btn}>
<BtnDispatchContext.Provider value={dispatch}> <BtnDispatchContext.Provider value={dispatch}>{children}</BtnDispatchContext.Provider>
{children} </BtnContext.Provider>
</BtnDispatchContext.Provider> );
</BtnContext.Provider> }
);
}
\ No newline at end of file
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
import { getCurrentData } from '@/pages/DataStudio/function'; import { getCurrentData } from '@/pages/DataStudio/function';
import { isSql } from '@/pages/DataStudio/HeaderContainer/service'; import { isSql } from '@/pages/DataStudio/HeaderContainer/service';
import { BtnRoute, useTasksDispatch } from '@/pages/DataStudio/LeftContainer/BtnContext';
import { TableDataNode } from '@/pages/DataStudio/LeftContainer/Catalog/data'; import { TableDataNode } from '@/pages/DataStudio/LeftContainer/Catalog/data';
import { StateType } from '@/pages/DataStudio/model'; import { StateType } from '@/pages/DataStudio/model';
import ColumnInfo from '@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SchemaDesc/ColumnInfo'; import ColumnInfo from '@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SchemaDesc/ColumnInfo';
...@@ -38,9 +39,8 @@ import { Button, Col, Empty, Modal, Row, Select, Spin, Tabs } from 'antd'; ...@@ -38,9 +39,8 @@ import { Button, Col, Empty, Modal, Row, Select, Spin, Tabs } from 'antd';
import { DataNode } from 'antd/es/tree'; import { DataNode } from 'antd/es/tree';
import DirectoryTree from 'antd/es/tree/DirectoryTree'; import DirectoryTree from 'antd/es/tree/DirectoryTree';
import { DefaultOptionType } from 'rc-select/lib/Select'; import { DefaultOptionType } from 'rc-select/lib/Select';
import React, {useEffect, useState} from 'react'; import React, { useEffect, useState } from 'react';
import { getMSCatalogs, getMSColumns, getMSSchemaInfo } from './service'; import { getMSCatalogs, getMSColumns, getMSSchemaInfo } from './service';
import {BtnRoute, useTasksDispatch} from "@/pages/DataStudio/LeftContainer/BtnContext";
const Catalog: React.FC = (props: connect) => { const Catalog: React.FC = (props: connect) => {
const { tabs } = props; const { tabs } = props;
...@@ -86,7 +86,7 @@ const Catalog: React.FC = (props: connect) => { ...@@ -86,7 +86,7 @@ const Catalog: React.FC = (props: connect) => {
type: 'change', type: 'change',
selectKey: currentTabName, selectKey: currentTabName,
payload: btnEvent payload: btnEvent
}) });
useEffect(() => { useEffect(() => {
getCatalogs(); getCatalogs();
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
import { TagAlignLeft } from '@/components/StyledComponents'; import { TagAlignLeft } from '@/components/StyledComponents';
import { BtnRoute, useTasksDispatch } from '@/pages/DataStudio/LeftContainer/BtnContext';
import SchemaTree from '@/pages/RegCenter/DataSource/components/DataSourceDetail/SchemaTree'; import SchemaTree from '@/pages/RegCenter/DataSource/components/DataSourceDetail/SchemaTree';
import DataSourceModal from '@/pages/RegCenter/DataSource/components/DataSourceModal'; import DataSourceModal from '@/pages/RegCenter/DataSource/components/DataSourceModal';
import { handleTest, saveOrUpdateHandle } from '@/pages/RegCenter/DataSource/service'; import { handleTest, saveOrUpdateHandle } from '@/pages/RegCenter/DataSource/service';
...@@ -30,7 +31,6 @@ import { Spin, Tag } from 'antd'; ...@@ -30,7 +31,6 @@ import { Spin, Tag } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { StateType, STUDIO_MODEL } from '../../model'; import { StateType, STUDIO_MODEL } from '../../model';
import { clearDataSourceTable, getDataSourceList, showDataSourceTable } from './service'; import { clearDataSourceTable, getDataSourceList, showDataSourceTable } from './service';
import {BtnRoute, useTasksDispatch} from "@/pages/DataStudio/LeftContainer/BtnContext";
const DataSource = (props: any) => { const DataSource = (props: any) => {
const { const {
...@@ -106,7 +106,7 @@ const DataSource = (props: any) => { ...@@ -106,7 +106,7 @@ const DataSource = (props: any) => {
type: 'change', type: 'change',
selectKey: currentTabName, selectKey: currentTabName,
payload: btnEvent payload: btnEvent
}) });
/** /**
* 构建数据库列表 下拉框 * 构建数据库列表 下拉框
......
...@@ -31,7 +31,7 @@ import { Key } from '@ant-design/pro-components'; ...@@ -31,7 +31,7 @@ import { Key } from '@ant-design/pro-components';
import { Empty, Tree } from 'antd'; import { Empty, Tree } from 'antd';
import Search from 'antd/es/input/Search'; import Search from 'antd/es/input/Search';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import {BtnRoute, useTasksDispatch} from '../../BtnContext'; import { BtnRoute, useTasksDispatch } from '../../BtnContext';
const { DirectoryTree } = Tree; const { DirectoryTree } = Tree;
...@@ -62,7 +62,6 @@ const JobTree: React.FC<TreeProps & connect> = (props) => { ...@@ -62,7 +62,6 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
const [data, setData] = useState<any[]>(buildProjectTree(projectData, searchValue)); const [data, setData] = useState<any[]>(buildProjectTree(projectData, searchValue));
const btnDispatch = useTasksDispatch(); const btnDispatch = useTasksDispatch();
useEffect(() => { useEffect(() => {
setData(buildProjectTree(projectData, searchValue)); setData(buildProjectTree(projectData, searchValue));
}, [searchValue, projectData]); }, [searchValue, projectData]);
...@@ -138,7 +137,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => { ...@@ -138,7 +137,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
type: 'change', type: 'change',
selectKey: currentTabName, selectKey: currentTabName,
payload: btnEvent payload: btnEvent
}) });
return ( return (
<> <>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
import Title from '@/components/Front/Title'; import Title from '@/components/Front/Title';
import { BtnRoute, useTasksDispatch } from '@/pages/DataStudio/LeftContainer/BtnContext';
import FolderModal from '@/pages/DataStudio/LeftContainer/Project/FolderModal'; import FolderModal from '@/pages/DataStudio/LeftContainer/Project/FolderModal';
import { StateType, STUDIO_MODEL_ASYNC } from '@/pages/DataStudio/model'; import { StateType, STUDIO_MODEL_ASYNC } from '@/pages/DataStudio/model';
import { handleAddOrUpdate } from '@/services/BusinessCrud'; import { handleAddOrUpdate } from '@/services/BusinessCrud';
...@@ -27,7 +28,6 @@ import { l } from '@/utils/intl'; ...@@ -27,7 +28,6 @@ import { l } from '@/utils/intl';
import { connect } from '@umijs/max'; import { connect } from '@umijs/max';
import { Space } from 'antd'; import { Space } from 'antd';
import React, { useState } from 'react'; import React, { useState } from 'react';
import {BtnRoute, useTasksDispatch} from "@/pages/DataStudio/LeftContainer/BtnContext";
const ProjectTitle: React.FC<StateType & connect> = (props) => { const ProjectTitle: React.FC<StateType & connect> = (props) => {
const { const {
...@@ -72,9 +72,9 @@ const ProjectTitle: React.FC<StateType & connect> = (props) => { ...@@ -72,9 +72,9 @@ const ProjectTitle: React.FC<StateType & connect> = (props) => {
btn[0].onClick = () => handleCreateClick(); btn[0].onClick = () => handleCreateClick();
btnDispatch({ btnDispatch({
type: 'change', type: 'change',
selectKey:currentTabName, selectKey: currentTabName,
payload: btn payload: btn
}) });
/** /**
* 渲染侧边栏标题 * 渲染侧边栏标题
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
import RightContextMenu from '@/components/RightContextMenu'; import RightContextMenu from '@/components/RightContextMenu';
import { LeftBottomKey } from '@/pages/DataStudio/data.d'; import { LeftBottomKey } from '@/pages/DataStudio/data.d';
import { getTabByTaskId } from '@/pages/DataStudio/function'; import { getTabByTaskId } from '@/pages/DataStudio/function';
import { useTasksDispatch } from '@/pages/DataStudio/LeftContainer/BtnContext';
import { import {
FOLDER_RIGHT_MENU, FOLDER_RIGHT_MENU,
JOB_RIGHT_MENU JOB_RIGHT_MENU
...@@ -53,7 +54,6 @@ import { Modal, Typography } from 'antd'; ...@@ -53,7 +54,6 @@ import { Modal, Typography } from 'antd';
import { MenuInfo } from 'rc-menu/es/interface'; import { MenuInfo } from 'rc-menu/es/interface';
import React, { Key, useEffect, useState } from 'react'; import React, { Key, useEffect, useState } from 'react';
import { connect } from 'umi'; import { connect } from 'umi';
import {useTasksDispatch} from "@/pages/DataStudio/LeftContainer/BtnContext";
const { Text } = Typography; const { Text } = Typography;
...@@ -67,7 +67,6 @@ const Project: React.FC = (props: connect) => { ...@@ -67,7 +67,6 @@ const Project: React.FC = (props: connect) => {
const [projectState, setProjectState] = useState<ProjectState>(InitProjectState); const [projectState, setProjectState] = useState<ProjectState>(InitProjectState);
const btnDispatch = useTasksDispatch(); const btnDispatch = useTasksDispatch();
useEffect(() => { useEffect(() => {
setProjectState((prevState) => ({ setProjectState((prevState) => ({
...prevState, ...prevState,
......
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
import { CircleBtn, CircleDataStudioButtonProps } from '@/components/CallBackButton/CircleBtn'; import { CircleBtn, CircleDataStudioButtonProps } from '@/components/CallBackButton/CircleBtn';
import MovableSidebar, { MovableSidebarProps } from '@/components/Sidebar/MovableSidebar'; import MovableSidebar, { MovableSidebarProps } from '@/components/Sidebar/MovableSidebar';
import useThemeValue from '@/hooks/useThemeValue'; import useThemeValue from '@/hooks/useThemeValue';
import { BtnContext } from '@/pages/DataStudio/LeftContainer/BtnContext';
import ProjectTitle from '@/pages/DataStudio/LeftContainer/Project/ProjectTitle'; import ProjectTitle from '@/pages/DataStudio/LeftContainer/Project/ProjectTitle';
import { StateType, STUDIO_MODEL, VIEW } from '@/pages/DataStudio/model'; import { StateType, STUDIO_MODEL, VIEW } from '@/pages/DataStudio/model';
import { LeftSide } from '@/pages/DataStudio/route'; import { LeftSide } from '@/pages/DataStudio/route';
import { connect } from '@@/exports'; import { connect } from '@@/exports';
import { Tabs } from 'antd'; import { Tabs } from 'antd';
import React, {useContext} from 'react'; import React, { useContext } from 'react';
import {BtnContext} from "@/pages/DataStudio/LeftContainer/BtnContext";
export type LeftContainerProps = { export type LeftContainerProps = {
size: number; size: number;
......
...@@ -17,25 +17,29 @@ ...@@ -17,25 +17,29 @@
* *
*/ */
import React from "react"; import { onAdd } from '@/pages/DataStudio/BottomContainer/TableData';
import {Tab} from "@/pages/DataStudio/route"; import { LeftBottomKey } from '@/pages/DataStudio/data.d';
import {TaskDataType} from "@/pages/DataStudio/model"; import { TaskDataType } from '@/pages/DataStudio/model';
import {LeftBottomKey} from "@/pages/DataStudio/data.d"; import { Tab } from '@/pages/DataStudio/route';
import {onAdd} from "@/pages/DataStudio/BottomContainer/TableData"; import React from 'react';
export type BottomTabProps = { export type BottomTabProps = {
icon?: React.ReactNode; icon?: React.ReactNode;
onAdd: (tabs: Tab[], key: string, data: TaskDataType | undefined, operator: any) => Promise<void>; onAdd: (tabs: Tab[], key: string, data: TaskDataType | undefined, operator: any) => Promise<void>;
onRemove?: (tabs: Tab[], key: string, data: TaskDataType | undefined, tabKey: string, refresh: any) => Promise<void>; onRemove?: (
key: string; tabs: Tab[],
key: string,
data: TaskDataType | undefined,
tabKey: string,
refresh: any
) => Promise<void>;
key: string;
}; };
export const BottomTabRoute: { [c: string]: BottomTabProps } = { export const BottomTabRoute: { [c: string]: BottomTabProps } = {
[LeftBottomKey.TABLE_DATA_KEY]: [LeftBottomKey.TABLE_DATA_KEY]: {
{ key: 'add table data',
key: 'add table data', onAdd: async (tabs, key, data, operator) => {
onAdd: async (tabs, key, data, operator) => { await onAdd(tabs, key, data, operator);
await onAdd(tabs, key, data, operator); }
} }
} };
}
\ No newline at end of file
...@@ -26,6 +26,7 @@ import FooterContainer from '@/pages/DataStudio/FooterContainer'; ...@@ -26,6 +26,7 @@ import FooterContainer from '@/pages/DataStudio/FooterContainer';
import { isProjectTabs, mapDispatchToProps } from '@/pages/DataStudio/function'; import { isProjectTabs, mapDispatchToProps } from '@/pages/DataStudio/function';
import SecondHeaderContainer from '@/pages/DataStudio/HeaderContainer'; import SecondHeaderContainer from '@/pages/DataStudio/HeaderContainer';
import LeftContainer from '@/pages/DataStudio/LeftContainer'; import LeftContainer from '@/pages/DataStudio/LeftContainer';
import { BtnProvider } from '@/pages/DataStudio/LeftContainer/BtnContext';
import { getDataSourceList } from '@/pages/DataStudio/LeftContainer/DataSource/service'; import { getDataSourceList } from '@/pages/DataStudio/LeftContainer/DataSource/service';
import { getTaskData } from '@/pages/DataStudio/LeftContainer/Project/service'; import { getTaskData } from '@/pages/DataStudio/LeftContainer/Project/service';
import MiddleContainer from '@/pages/DataStudio/MiddleContainer'; import MiddleContainer from '@/pages/DataStudio/MiddleContainer';
...@@ -44,12 +45,11 @@ import { ...@@ -44,12 +45,11 @@ import {
} from '@/pages/DataStudio/RightContainer/JobConfig/service'; } from '@/pages/DataStudio/RightContainer/JobConfig/service';
import { LeftBottomMoreTabs, LeftBottomSide, LeftSide, RightSide } from '@/pages/DataStudio/route'; import { LeftBottomMoreTabs, LeftBottomSide, LeftSide, RightSide } from '@/pages/DataStudio/route';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { useAsyncEffect } from 'ahooks';
import { Layout, Menu, theme } from 'antd'; import { Layout, Menu, theme } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { PersistGate } from 'redux-persist/integration/react'; import { PersistGate } from 'redux-persist/integration/react';
import { connect, getDvaApp } from 'umi'; import { connect, getDvaApp } from 'umi';
import {BtnProvider} from "@/pages/DataStudio/LeftContainer/BtnContext";
import {useAsyncEffect} from "ahooks";
const { Sider, Content } = Layout; const { Sider, Content } = Layout;
...@@ -279,13 +279,13 @@ const DataStudio = (props: any) => { ...@@ -279,13 +279,13 @@ const DataStudio = (props: any) => {
<Content style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}> <Content style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<BtnProvider> <BtnProvider>
<LeftContainer <LeftContainer
size={size} size={size}
leftContainer={leftContainer} leftContainer={leftContainer}
rightContainer={rightContainer} rightContainer={rightContainer}
/> />
</BtnProvider> </BtnProvider>
<Content <Content
style={{ style={{
width: width:
......
...@@ -17,255 +17,253 @@ ...@@ -17,255 +17,253 @@
* *
*/ */
import { import { CircleBottomButtonProps } from '@/components/CallBackButton/CircleBtn';
CircleBottomButtonProps
} from '@/components/CallBackButton/CircleBtn';
import Console from '@/pages/DataStudio/BottomContainer/Console'; import Console from '@/pages/DataStudio/BottomContainer/Console';
import JobExecHistory from '@/pages/DataStudio/BottomContainer/JobExecHistory'; import JobExecHistory from '@/pages/DataStudio/BottomContainer/JobExecHistory';
import Lineage from '@/pages/DataStudio/BottomContainer/Lineage'; import Lineage from '@/pages/DataStudio/BottomContainer/Lineage';
import Result from '@/pages/DataStudio/BottomContainer/Result'; import Result from '@/pages/DataStudio/BottomContainer/Result';
import JsonToSql from '@/pages/DataStudio/BottomContainer/Tools/JsonToSql'; import JsonToSql from '@/pages/DataStudio/BottomContainer/Tools/JsonToSql';
import TextComparison from '@/pages/DataStudio/BottomContainer/Tools/TextComparison'; import TextComparison from '@/pages/DataStudio/BottomContainer/Tools/TextComparison';
import {LeftBottomKey, LeftMenuKey, RightMenuKey} from '@/pages/DataStudio/data.d'; import { LeftBottomKey, LeftMenuKey, RightMenuKey } from '@/pages/DataStudio/data.d';
import {isSql} from '@/pages/DataStudio/HeaderContainer/service'; import { isSql } from '@/pages/DataStudio/HeaderContainer/service';
import Catalog from '@/pages/DataStudio/LeftContainer/Catalog'; import Catalog from '@/pages/DataStudio/LeftContainer/Catalog';
import DataSource from '@/pages/DataStudio/LeftContainer/DataSource'; import DataSource from '@/pages/DataStudio/LeftContainer/DataSource';
import GlobalVariable from '@/pages/DataStudio/LeftContainer/GlobaleVar'; import GlobalVariable from '@/pages/DataStudio/LeftContainer/GlobaleVar';
import Project from '@/pages/DataStudio/LeftContainer/Project'; import Project from '@/pages/DataStudio/LeftContainer/Project';
import {TabsPageSubType, TabsPageType} from '@/pages/DataStudio/model'; import { TabsPageSubType, TabsPageType } from '@/pages/DataStudio/model';
import HistoryVersion from '@/pages/DataStudio/RightContainer/HistoryVersion'; import HistoryVersion from '@/pages/DataStudio/RightContainer/HistoryVersion';
import JobConfig from '@/pages/DataStudio/RightContainer/JobConfig'; import JobConfig from '@/pages/DataStudio/RightContainer/JobConfig';
import JobInfo from '@/pages/DataStudio/RightContainer/JobInfo'; import JobInfo from '@/pages/DataStudio/RightContainer/JobInfo';
import PreViewConfig from '@/pages/DataStudio/RightContainer/PreViewConfig'; import PreViewConfig from '@/pages/DataStudio/RightContainer/PreViewConfig';
import SavePoints from '@/pages/DataStudio/RightContainer/SavePoints'; import SavePoints from '@/pages/DataStudio/RightContainer/SavePoints';
import {DIALECT} from '@/services/constants'; import { DIALECT } from '@/services/constants';
import {l} from '@/utils/intl'; import { l } from '@/utils/intl';
import { import {
ApartmentOutlined, ApartmentOutlined,
ConsoleSqlOutlined, ConsoleSqlOutlined,
DatabaseOutlined, DatabaseOutlined,
FolderOutlined, FolderOutlined,
FunctionOutlined, FunctionOutlined,
HistoryOutlined, HistoryOutlined,
InfoCircleOutlined, InfoCircleOutlined,
InsertRowRightOutlined, InsertRowRightOutlined,
MonitorOutlined, MonitorOutlined,
RightSquareOutlined, RightSquareOutlined,
RotateRightOutlined, RotateRightOutlined,
SettingOutlined, SettingOutlined,
TableOutlined, TableOutlined,
ToolOutlined ToolOutlined
} from '@ant-design/icons'; } from '@ant-design/icons';
import React, {ReactNode} from 'react'; import { TabPaneProps } from 'antd';
import {TabPaneProps} from "antd"; import React, { ReactNode } from 'react';
export const LeftSide: TabProp[] = [ export const LeftSide: TabProp[] = [
{ {
auth: '/datastudio/left/project', auth: '/datastudio/left/project',
key: LeftMenuKey.PROJECT_KEY, key: LeftMenuKey.PROJECT_KEY,
icon: <ConsoleSqlOutlined/>, icon: <ConsoleSqlOutlined />,
label: l(LeftMenuKey.PROJECT_KEY), label: l(LeftMenuKey.PROJECT_KEY),
children: <Project/> children: <Project />
}, },
{ {
auth: '/datastudio/left/catalog', auth: '/datastudio/left/catalog',
key: LeftMenuKey.CATALOG_KEY, key: LeftMenuKey.CATALOG_KEY,
icon: <TableOutlined/>, icon: <TableOutlined />,
label: l(LeftMenuKey.CATALOG_KEY), label: l(LeftMenuKey.CATALOG_KEY),
children: <Catalog/>, children: <Catalog />,
isShow: (type, subType) => isShow: (type, subType) =>
(type === TabsPageType.project || type === TabsPageType.metadata) && (type === TabsPageType.project || type === TabsPageType.metadata) &&
subType?.toLowerCase() !== DIALECT.FLINKJAR && subType?.toLowerCase() !== DIALECT.FLINKJAR &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV && subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.SCALA && subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG && subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA && subType?.toLowerCase() !== DIALECT.JAVA &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV subType?.toLowerCase() !== DIALECT.FLINKSQLENV
}, },
{ {
auth: '/datastudio/left/datasource', auth: '/datastudio/left/datasource',
key: LeftMenuKey.DATASOURCE_KEY, key: LeftMenuKey.DATASOURCE_KEY,
icon: <DatabaseOutlined/>, icon: <DatabaseOutlined />,
label: l(LeftMenuKey.DATASOURCE_KEY), label: l(LeftMenuKey.DATASOURCE_KEY),
children: <DataSource/> children: <DataSource />
}, },
{ {
auth: '/datastudio/left/globalVariable', auth: '/datastudio/left/globalVariable',
key: LeftMenuKey.FRAGMENT_KEY, key: LeftMenuKey.FRAGMENT_KEY,
icon: <FunctionOutlined/>, icon: <FunctionOutlined />,
label: l(LeftMenuKey.FRAGMENT_KEY), label: l(LeftMenuKey.FRAGMENT_KEY),
children: <GlobalVariable/>, children: <GlobalVariable />,
isShow: (type, subType) => isShow: (type, subType) =>
type === TabsPageType.project && type === TabsPageType.project &&
!isSql(subType ?? '') && !isSql(subType ?? '') &&
subType?.toLowerCase() !== DIALECT.SCALA && subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG && subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA subType?.toLowerCase() !== DIALECT.JAVA
} }
]; ];
export const RightSide: TabProp[] = [ export const RightSide: TabProp[] = [
{ {
auth: '/datastudio/right/jobConfig', auth: '/datastudio/right/jobConfig',
key: RightMenuKey.JOB_CONFIG_KEY, key: RightMenuKey.JOB_CONFIG_KEY,
icon: <SettingOutlined/>, icon: <SettingOutlined />,
label: l(RightMenuKey.JOB_CONFIG_KEY), label: l(RightMenuKey.JOB_CONFIG_KEY),
children: <JobConfig/>, children: <JobConfig />,
isShow: (type, subType) => isShow: (type, subType) =>
type === TabsPageType.project && type === TabsPageType.project &&
(TabsPageSubType.flinkSql === subType || TabsPageSubType.flinkJar === subType) (TabsPageSubType.flinkSql === subType || TabsPageSubType.flinkJar === subType)
}, },
{ {
auth: '/datastudio/right/previewConfig', auth: '/datastudio/right/previewConfig',
key: RightMenuKey.PREVIEW_CONFIG_KEY, key: RightMenuKey.PREVIEW_CONFIG_KEY,
icon: <InsertRowRightOutlined/>, icon: <InsertRowRightOutlined />,
label: l(RightMenuKey.PREVIEW_CONFIG_KEY), label: l(RightMenuKey.PREVIEW_CONFIG_KEY),
children: <PreViewConfig/>, children: <PreViewConfig />,
isShow: (type, subType) => isShow: (type, subType) =>
(type === TabsPageType.project && TabsPageSubType.flinkSql === subType) || (type === TabsPageType.project && TabsPageSubType.flinkSql === subType) ||
isSql(subType ?? '') isSql(subType ?? '')
}, },
{ {
auth: '/datastudio/right/savePoint', auth: '/datastudio/right/savePoint',
key: RightMenuKey.SAVEPOINT_KEY, key: RightMenuKey.SAVEPOINT_KEY,
icon: <FolderOutlined/>, icon: <FolderOutlined />,
label: l(RightMenuKey.SAVEPOINT_KEY), label: l(RightMenuKey.SAVEPOINT_KEY),
children: <SavePoints/>, children: <SavePoints />,
isShow: (type, subType) => type === TabsPageType.project && TabsPageSubType.flinkSql === subType isShow: (type, subType) => type === TabsPageType.project && TabsPageSubType.flinkSql === subType
}, },
{ {
auth: '/datastudio/right/historyVision', auth: '/datastudio/right/historyVision',
key: RightMenuKey.HISTORY_VISION_KEY, key: RightMenuKey.HISTORY_VISION_KEY,
icon: <HistoryOutlined/>, icon: <HistoryOutlined />,
label: l(RightMenuKey.HISTORY_VISION_KEY), label: l(RightMenuKey.HISTORY_VISION_KEY),
children: <HistoryVersion/>, children: <HistoryVersion />,
isShow: (type, subType) => type === TabsPageType.project && TabsPageSubType.flinkSql === subType isShow: (type, subType) => type === TabsPageType.project && TabsPageSubType.flinkSql === subType
}, },
{ {
auth: '/datastudio/right/jobInfo', auth: '/datastudio/right/jobInfo',
key: RightMenuKey.JOB_INFO_KEY, key: RightMenuKey.JOB_INFO_KEY,
icon: <InfoCircleOutlined/>, icon: <InfoCircleOutlined />,
label: l(RightMenuKey.JOB_INFO_KEY), label: l(RightMenuKey.JOB_INFO_KEY),
children: <JobInfo/>, children: <JobInfo />,
isShow: (type) => type === TabsPageType.project isShow: (type) => type === TabsPageType.project
} }
]; ];
export const LeftBottomSide: TabProp[] = [ export const LeftBottomSide: TabProp[] = [
{
auth: '/datastudio/bottom/console',
key: LeftBottomKey.CONSOLE_KEY,
icon: <RightSquareOutlined />,
label: l(LeftBottomKey.CONSOLE_KEY),
children: <Console />,
isShow: (type, subType) =>
type === TabsPageType.project &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/result',
key: LeftBottomKey.RESULT_KEY,
icon: <MonitorOutlined />,
label: l(LeftBottomKey.RESULT_KEY),
children: <Result />,
isShow: (type, subType) =>
type === TabsPageType.project &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.FLINKJAR &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/lineage',
key: LeftBottomKey.LINEAGE_KEY,
icon: <ApartmentOutlined />,
label: l(LeftBottomKey.LINEAGE_KEY),
children: <Lineage />,
isShow: (type, subType) =>
type === TabsPageType.project &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.FLINKJAR &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/history',
key: LeftBottomKey.HISTORY_KEY,
icon: <HistoryOutlined />,
label: l(LeftBottomKey.HISTORY_KEY),
children: <JobExecHistory />,
isShow: (type, subType) =>
type === TabsPageType.project &&
!isSql(subType ?? '') &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.FLINKJAR &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/table-data',
key: LeftBottomKey.TABLE_DATA_KEY,
icon: <TableOutlined />,
label: l(LeftBottomKey.TABLE_DATA_KEY),
children: <></>,
isShow: (type, subType) =>
type === TabsPageType.project && subType?.toLowerCase() === DIALECT.FLINK_SQL
},
{
auth: '/datastudio/bottom/tool',
key: LeftBottomKey.TOOLS_KEY,
icon: <ToolOutlined />,
label: l(LeftBottomKey.TOOLS_KEY),
children: <></>
}
];
export const LeftBottomMoreTabs: { [c: string]: TabProp[] } = {
'menu.datastudio.tool': [
{ {
auth: '/datastudio/bottom/console', key: 'menu.datastudio.tool.text-comparison',
key: LeftBottomKey.CONSOLE_KEY, icon: <ToolOutlined />,
icon: <RightSquareOutlined/>, label: l('menu.datastudio.tool.text-comparison'),
label: l(LeftBottomKey.CONSOLE_KEY), children: <TextComparison />
children: <Console/>,
isShow: (type, subType) =>
type === TabsPageType.project &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/result',
key: LeftBottomKey.RESULT_KEY,
icon: <MonitorOutlined/>,
label: l(LeftBottomKey.RESULT_KEY),
children: <Result/>,
isShow: (type, subType) =>
type === TabsPageType.project &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.FLINKJAR &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/lineage',
key: LeftBottomKey.LINEAGE_KEY,
icon: <ApartmentOutlined/>,
label: l(LeftBottomKey.LINEAGE_KEY),
children: <Lineage/>,
isShow: (type, subType) =>
type === TabsPageType.project &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.FLINKJAR &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/history',
key: LeftBottomKey.HISTORY_KEY,
icon: <HistoryOutlined/>,
label: l(LeftBottomKey.HISTORY_KEY),
children: <JobExecHistory/>,
isShow: (type, subType) =>
type === TabsPageType.project &&
!isSql(subType ?? '') &&
subType?.toLowerCase() !== DIALECT.FLINKSQLENV &&
subType?.toLowerCase() !== DIALECT.FLINKJAR &&
subType?.toLowerCase() !== DIALECT.SCALA &&
subType?.toLowerCase() !== DIALECT.PYTHON_LONG &&
subType?.toLowerCase() !== DIALECT.JAVA
},
{
auth: '/datastudio/bottom/table-data',
key: LeftBottomKey.TABLE_DATA_KEY,
icon: <TableOutlined/>,
label: l(LeftBottomKey.TABLE_DATA_KEY),
children: <></>,
isShow: (type, subType) =>
type === TabsPageType.project && subType?.toLowerCase() === DIALECT.FLINK_SQL
}, },
{ {
auth: '/datastudio/bottom/tool', key: 'menu.datastudio.tool.jsonToSql',
key: LeftBottomKey.TOOLS_KEY, icon: <RotateRightOutlined />,
icon: <ToolOutlined/>, label: l('menu.datastudio.tool.jsonToSql'),
label: l(LeftBottomKey.TOOLS_KEY), children: <JsonToSql />
children: <></>
} }
]; ]
export const LeftBottomMoreTabs: { [c: string]: TabProp[] } = {
'menu.datastudio.tool': [
{
key: 'menu.datastudio.tool.text-comparison',
icon: <ToolOutlined/>,
label: l('menu.datastudio.tool.text-comparison'),
children: <TextComparison/>
},
{
key: 'menu.datastudio.tool.jsonToSql',
icon: <RotateRightOutlined/>,
label: l('menu.datastudio.tool.jsonToSql'),
children: <JsonToSql/>
}
]
}; };
export const BottomBtnRoute: { [c: string]: CircleBottomButtonProps[] } = { export const BottomBtnRoute: { [c: string]: CircleBottomButtonProps[] } = {
// todo 右边按钮功能有待完善 // todo 右边按钮功能有待完善
// [LeftBottomKey.TABLE_DATA_KEY]: [ // [LeftBottomKey.TABLE_DATA_KEY]: [
// { // {
// icon: <PlusOutlined/>, // icon: <PlusOutlined/>,
// title: l('test'), // title: l('test'),
// key: 'test', // key: 'test',
// onClick: async (tabs, key, data, refresh) => { // onClick: async (tabs, key, data, refresh) => {
// } // }
// } // }
// ] // ]
} };
export type TabProp = { export type TabProp = {
key: string; key: string;
icon: ReactNode; icon: ReactNode;
label: string; label: string;
children: ReactNode; children: ReactNode;
isShow?: (type: TabsPageType, subType?: TabsPageSubType) => boolean; isShow?: (type: TabsPageType, subType?: TabsPageSubType) => boolean;
auth?: string; auth?: string;
}; };
export interface Tab extends Omit<TabPaneProps, 'tab'> { export interface Tab extends Omit<TabPaneProps, 'tab'> {
key: string; key: string;
label: React.ReactNode; label: React.ReactNode;
} }
\ No newline at end of file
...@@ -61,6 +61,20 @@ const WeChat = (props: WeChatProps) => { ...@@ -61,6 +61,20 @@ const WeChat = (props: WeChatProps) => {
} }
]; ];
const validateRulesWeChatSendUrl = [
{
required: true,
validator: async (rule: Rule, value: string) => {
if (!value) {
return Promise.reject(l('rc.ai.sendUrlPleaseHolder'));
}
if (value.endsWith('/')) {
return Promise.reject(l('rc.ai.sendUrlValidate'));
}
}
}
];
/** /**
* render * render
*/ */
...@@ -120,26 +134,35 @@ const WeChat = (props: WeChatProps) => { ...@@ -120,26 +134,35 @@ const WeChat = (props: WeChatProps) => {
// if sendType is app // if sendType is app
<> <>
<ProFormText <ProFormText
width='md' width='sm'
name={['params', 'corpId']} name={['params', 'corpId']}
label={l('rc.ai.corpId')} label={l('rc.ai.corpId')}
rules={[{ required: true, message: l('rc.ai.corpIdPleaseHolder') }]} rules={[{ required: true, message: l('rc.ai.corpIdPleaseHolder') }]}
placeholder={l('rc.ai.corpIdPleaseHolder')} placeholder={l('rc.ai.corpIdPleaseHolder')}
/> />
<ProFormText.Password <ProFormText.Password
width='lg' width='xl'
name={['params', 'secret']} name={['params', 'secret']}
label={l('rc.ai.secret')} label={l('rc.ai.secret')}
rules={[{ required: true, message: l('rc.ai.secretPleaseHolder') }]} rules={[{ required: true, message: l('rc.ai.secretPleaseHolder') }]}
placeholder={l('rc.ai.secretPleaseHolder')} placeholder={l('rc.ai.secretPleaseHolder')}
/> />
<ProFormDigit <ProFormDigit
width='md' width='sm'
name={['params', 'agentId']} name={['params', 'agentId']}
label={l('rc.ai.agentId')} label={l('rc.ai.agentId')}
rules={[{ required: true, message: l('rc.ai.agentIdPleaseHolder') }]} rules={[{ required: true, message: l('rc.ai.agentIdPleaseHolder') }]}
placeholder={l('rc.ai.agentIdPleaseHolder')} placeholder={l('rc.ai.agentIdPleaseHolder')}
/> />
<ProFormText
width='xl'
name={['params', 'sendUrl']}
label={l('rc.ai.sendUrl')}
tooltip={l('rc.ai.sendUrlTooltip')}
initialValue={'https://qyapi.weixin.qq.com/cgi-bin'}
rules={validateRulesWeChatSendUrl}
placeholder={l('rc.ai.sendUrlPleaseHolder')}
/>
</> </>
) )
)} )}
......
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