Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增蓝图分组功能,新增了一个选择多个节点的逻辑节点组件 #32

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0d8688c
feat: 新增基础表单输入框组件
bicitechfed Jun 17, 2024
e56bf71
Merge branch 'develop' of https://github.com/QingLianDuo/light-chaser…
QingLianDuo Jun 17, 2024
64b8b10
增加直播视频播组件
QingLianDuo Jun 21, 2024
dc0c663
修改hisplayer的bug
QingLianDuo Jun 22, 2024
c77ca84
合并代码
QingLianDuo Jun 25, 2024
2be3b77
Merge branch 'xiaopujun:develop' into develop
QingLianDuo Jun 25, 2024
e8e0f91
Merge branch 'xiaopujun:develop' into develop
QingLianDuo Jun 26, 2024
4b572f4
探索全局变量的构建
QingLianDuo Jun 26, 2024
5e0a20c
Merge branch 'develop' of https://github.com/QingLianDuo/light-chaser…
QingLianDuo Jun 26, 2024
eed8bd3
添加基础指标卡组件
QingLianDuo Jun 28, 2024
e7e5d1b
合并代码
QingLianDuo Jun 28, 2024
55d680f
合并解决循环依赖的代码
xiaopujun Jun 27, 2024
5972b9a
合并解决循环依赖的代码
QingLianDuo Jun 28, 2024
6881347
数字输入框增加了按住鼠标左键滑动改变数值大小的功能
QingLianDuo Jul 1, 2024
49efcf2
合并源分支代码
QingLianDuo Jul 22, 2024
d8b3fe4
更新合并代码
QingLianDuo Aug 15, 2024
9c0f797
增加项目管理页面,将原来的项目改为新建大屏,层级发生了变化
QingLianDuo Aug 22, 2024
d35c8e9
feat: 新增rxjs
Aug 22, 2024
1adc260
Merge branch 'develop' of https://gitee.com/majy89/light-chaser into …
Aug 22, 2024
54ff0db
feat: 移除 rxjs
Aug 23, 2024
ad469da
增加逻辑组件选择多个图层节点,并且完成输入框输入查询在蓝图中的应用
QingLianDuo Aug 28, 2024
0bdc8c1
修改选择单个组件,后面逻辑不执行的bug
QingLianDuo Aug 28, 2024
fb66e4f
增加蓝图分组功能
QingLianDuo Aug 29, 2024
96f7611
完成蓝图分组功能开发
QingLianDuo Aug 30, 2024
9186a6d
完成蓝图分组功能开发并修复缩放的bug
QingLianDuo Aug 30, 2024
1f1f354
完成蓝图分组功能开发并修复缩放的bug2
QingLianDuo Aug 30, 2024
27ab66d
增加动态面板组件的文件,功能还没有开发
QingLianDuo Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,529 changes: 2,769 additions & 3,760 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/comps/antd-common/AntdBaseDesignerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {ComponentBaseProps} from "../common-component/CommonTypes.ts";
import {Options, Plot} from "@antv/g2plot";
import ObjectUtil from "../../utils/ObjectUtil";
import BPExecutor from "../../designer/blueprint/core/BPExecutor";
import {AntdBarProps} from "./bar/AntdCommonBarController";

export abstract class AntdBaseDesignerController<I extends Plot<any> = Plot<Options>,
C extends ComponentBaseProps = ComponentBaseProps> extends AbstractDesignerController<I, C> {
Expand Down Expand Up @@ -53,7 +54,8 @@ export abstract class AntdBaseDesignerController<I extends Plot<any> = Plot<Opti
public commonUpdate(config: C, Clazz: new (...args: any[]) => I, upOp?: UpdateOptions,): void {
this.config = ObjectUtil.merge(this.config, config);
upOp = upOp || {reRender: true};
if (upOp.reRender)
if (upOp.reRender){
this.instance?.update(this.config?.style!);
}
}
}
}
4 changes: 3 additions & 1 deletion src/comps/antd-common/AntdCommonDefinition.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import AbstractController from "../../framework/core/AbstractController";
import {AbstractDefinition, ActionInfo, EventInfo} from "../../framework/core/AbstractDefinition";
import AbstractDesignerController from "../../framework/core/AbstractDesignerController";


export abstract class AntdCommonDefinition<C extends AbstractController = AbstractController, P = any> extends AbstractDefinition<C, P> {
Expand Down Expand Up @@ -36,7 +37,8 @@ export abstract class AntdCommonDefinition<C extends AbstractController = Abstra
}

getActionList(): Array<ActionInfo> {
return super.getActionList();
const defaultActionList = super.getActionList();
return defaultActionList;
}
}

8 changes: 7 additions & 1 deletion src/comps/antd-common/area/AntdCommonAreaController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {UpdateOptions} from "../../../framework/core/AbstractController";
import {AntdBaseDesignerController} from "../AntdBaseDesignerController";
import {ThemeItemType} from "../../../designer/DesignerType";
import {ShapeAttrs} from "@antv/g-base";
import {AntdBarProps} from "../bar/AntdCommonBarController";

export interface AntdAreaProps extends ComponentBaseProps {
style?: WritableAreaOptions;
Expand All @@ -31,6 +32,11 @@ export default class AntdCommonAreaController extends AntdBaseDesignerController
super.commonUpdate(config, Area, upOp);
}

updateAsync(config: AntdBarProps, upOp?: UpdateOptions): void {
this.commonUpdate(config, Area, upOp);
this.doApi(this.config.data.apiData);
}

updateTheme(newTheme: ThemeItemType): void {
const {type} = this.config?.base!;
if (!newTheme)
Expand Down Expand Up @@ -92,4 +98,4 @@ export default class AntdCommonAreaController extends AntdBaseDesignerController
//重新渲染
this.update({style: styleConfig} as AntdAreaProps, {reRender: true});
}
}
}
7 changes: 6 additions & 1 deletion src/comps/antd-common/bar/AntdCommonBarController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export default class AntdCommonBarController extends AntdBaseDesignerController<
super.commonUpdate(config, Bar, upOp);
}

updateAsync(config: AntdBarProps, upOp?: UpdateOptions): void {
this.commonUpdate(config, Bar, upOp);
this.doApi(this.config.data.apiData);
}

updateTheme(newTheme: ThemeItemType): void {
if (!newTheme) return;
const styleConfig = this.config?.style!;
Expand Down Expand Up @@ -82,4 +87,4 @@ export default class AntdCommonBarController extends AntdBaseDesignerController<
//重新渲染
this.update({style: styleConfig} as AntdBarProps, {reRender: true});
}
}
}
8 changes: 7 additions & 1 deletion src/comps/antd-common/line/AntdCommonLineController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {UpdateOptions} from "../../../framework/core/AbstractController";
import {AntdBaseDesignerController} from "../AntdBaseDesignerController";
import {ThemeItemType} from "../../../designer/DesignerType";
import {ShapeAttrs} from "@antv/g-base";
import {AntdBarProps} from "../bar/AntdCommonBarController";

export interface AntdLineProps extends ComponentBaseProps {
style?: WritableLineOptions;
Expand All @@ -31,6 +32,11 @@ export default class AntdCommonLineController extends AntdBaseDesignerController
super.commonUpdate(config, Line, upOp);
}

updateAsync(config: AntdBarProps, upOp?: UpdateOptions): void {
this.commonUpdate(config, Line, upOp);
this.doApi(this.config.data.apiData);
}

updateTheme(newTheme: ThemeItemType): void {
if (!newTheme)
return;
Expand Down Expand Up @@ -89,4 +95,4 @@ export default class AntdCommonLineController extends AntdBaseDesignerController
//重新渲染
this.update({style: styleConfig} as AntdLineProps, {reRender: true});
}
}
}
8 changes: 7 additions & 1 deletion src/comps/antd-common/rose/AntdCommonRoseController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {UpdateOptions} from "../../../framework/core/AbstractController";
import {AntdBaseDesignerController} from "../AntdBaseDesignerController";
import {ThemeItemType} from "../../../designer/DesignerType";
import {ShapeAttrs} from "@antv/g-base";
import {AntdBarProps} from "../bar/AntdCommonBarController";

export interface AntdRoseProps extends ComponentBaseProps {
style?: WritableRoseOptions;
Expand All @@ -31,6 +32,11 @@ export default class AntdCommonRoseController extends AntdBaseDesignerController
super.commonUpdate(config, Rose, upOp);
}

updateAsync(config: AntdBarProps, upOp?: UpdateOptions): void {
this.commonUpdate(config, Rose, upOp);
this.doApi(this.config.data.apiData);
}

updateTheme(newTheme: ThemeItemType): void {
if (!newTheme) return;
const styleConfig = this.config?.style!;
Expand All @@ -51,4 +57,4 @@ export default class AntdCommonRoseController extends AntdBaseDesignerController
//重新渲染
this.update({style: styleConfig} as AntdRoseProps, {reRender: true});
}
}
}
8 changes: 7 additions & 1 deletion src/comps/antd-common/scatter/AntdCommonScatterController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {UpdateOptions} from "../../../framework/core/AbstractController";
import {AntdBaseDesignerController} from "../AntdBaseDesignerController";
import {ThemeItemType} from "../../../designer/DesignerType";
import {ShapeAttrs} from "@antv/g-base";
import {AntdBarProps} from "../bar/AntdCommonBarController";

export interface AntdScatterProps extends ComponentBaseProps {
style?: WritableScatterOptions;
Expand All @@ -31,6 +32,11 @@ export default class AntdCommonScatterController extends AntdBaseDesignerControl
super.commonUpdate(config, Scatter, upOp);
}

updateAsync(config: AntdBarProps, upOp?: UpdateOptions): void {
this.commonUpdate(config, Scatter, upOp);
this.doApi(this.config.data.apiData);
}

updateTheme(newTheme: ThemeItemType): void {
if (!newTheme) return;
const styleConfig = this.config?.style!;
Expand Down Expand Up @@ -80,4 +86,4 @@ export default class AntdCommonScatterController extends AntdBaseDesignerControl
//重新渲染
this.update({style: styleConfig} as AntdScatterProps, {reRender: true});
}
}
}
12 changes: 9 additions & 3 deletions src/comps/common-component/base-info/BaseInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,23 @@ class BaseInfo extends Component<ConfigType, ILayerItem & { version?: string }>
}

buildSchema = (): Control => {
const {name, width, height, x, y} = this.state;
const {name, width, height, x, y, id} = this.state;
return {
type: 'grid',
children: [
{
id: "id",
key: "id",
label: "ID",
type: "input",
value: id,
},
{
id: "name",
key: "name",
label: "名称",
type: "input",
value: name,

},
{
id: "width",
Expand Down Expand Up @@ -238,4 +244,4 @@ class BaseInfo extends Component<ConfigType, ILayerItem & { version?: string }>
}
}

export default BaseInfo;
export default BaseInfo;
8 changes: 7 additions & 1 deletion src/comps/common-component/data-config/DataConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {DataConfigType} from "../../../designer/DesignerType.ts";
import {StaticDataConfig} from "./static/StaticDataConfig.tsx";
import {ApiDataConfig} from "./api/ApiDataConfig.tsx";
import {DatabaseDataConfig} from "./database/DatabaseConfig.tsx";
import {DynamicDataConfig} from "./dynamic/DynamicDataConfig.tsx";
import DataSetConfig from "./dataset/DataSetConfig";

type DataTypeItem = 'static' | 'api' | 'database' | 'excel';

Expand Down Expand Up @@ -48,7 +50,9 @@ const DataConfig = (props: DataConfigProps) => {
options: [
{value: 'static', label: '静态数据'},
{value: 'api', label: '接口(API)'},
{value: 'database', label: '数据库'}
{value: 'database', label: '数据库'},
{value: 'dynamic', label: '动态数据'},
{value: 'dataset', label: '数据集'},
],
containerStyle: {
marginBottom: 10
Expand All @@ -63,6 +67,8 @@ const DataConfig = (props: DataConfigProps) => {
{sourceType === 'static' && <StaticDataConfig controller={controller} data={dataSource.staticData}/>}
{sourceType === 'api' && <ApiDataConfig controller={controller} data={dataSource.apiData!}/>}
{sourceType === 'database' && <DatabaseDataConfig controller={controller} data={dataSource.database!}/>}
{sourceType === 'dynamic' && <DynamicDataConfig controller={controller} data={dataSource.dynamic!}/>}
{sourceType === 'dataset' && <DataSetConfig controller={controller} data={dataSource.dataset!}/>}
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/comps/common-component/data-config/api/ApiDataConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function ApiDataConfig(props: ApiDataConfigProps) {
type: 'code-editor',
config: {
readonly: true,
height: 160,
height: 60,
},
reRender: true,
value: apiTestResRef.current,
Expand Down Expand Up @@ -233,4 +233,4 @@ export function ApiDataConfig(props: ApiDataConfigProps) {
return (
<LCGUI schema={schema} onFieldChange={onFieldChange}/>
);
}
}
22 changes: 11 additions & 11 deletions src/comps/common-component/data-config/database/DatabaseConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ export function DatabaseDataConfig(props: DatabaseDataConfigProps) {
const [count, setCount] = useState(0);

useEffect(() => {
FetchUtil.get(`/api/datasource/list`).then(res => {
if (res.code === 200) {
const options = (res.data as Array<IDataSource>).map(item => {
return {label: item.name, value: item.id}
})
setDataSourceList(options as ISelectOption[]);
} else
globalMessage.messageApi?.error(res.msg);
})
// FetchUtil.get(`/api/datasource/list`).then(res => {
// if (res.code === 200) {
// const options = (res.data as Array<IDataSource>).map(item => {
// return {label: item.name, value: item.id}
// })
// setDataSourceList(options as ISelectOption[]);
// } else
// globalMessage.messageApi?.error(res.msg);
// })
}, []);

const validate = () => {
Expand Down Expand Up @@ -173,7 +173,7 @@ export function DatabaseDataConfig(props: DatabaseDataConfigProps) {
id: 'databaseTestRes',
type: 'code-editor',
config: {
height: 200,
height: 60,
language: 'json'
},
reRender: true,
Expand All @@ -199,4 +199,4 @@ export function DatabaseDataConfig(props: DatabaseDataConfigProps) {
return (
<LCGUI schema={schema} onFieldChange={onFieldChange}/>
);
}
}
Loading