1-增加子功能栏

2-增加前端选择过滤器
3-增加图层设置
4-增加视图选择
5-增加坐标轴设置
6-增加显示模式
This commit is contained in:
JackLee 2026-03-11 21:02:14 +08:00
parent 19347be837
commit 76c8dfd86e
15 changed files with 184 additions and 6 deletions

View File

@ -45,25 +45,26 @@ export struct EventBtn {
} }
} }
//菜单目录按钮 //菜单目录按钮
//功能目录菜单,主要用于针对单一按钮多个功能形式 //功能目录菜单,主要用于针对单一按钮多个功能形式
@ComponentV2 @ComponentV2
export struct MenuBtn { export struct MenuBtn {
@Param menuBtn: Array<TitleButton>|undefined=undefined; @Param menuBtn: Array<TitleButton>|undefined=undefined;
@Local iconState:boolean=false;
@Builder @Builder
EventMenu(_btnMenus:Array<TitleButton>){ EventMenu(){
Menu() { Menu() {
ForEach(_btnMenus, (item: TitleButton, index: number) => { ForEach(this.menuBtn, (item: TitleButton, index: number) => {
MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName }) MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName })
.width('150') .width('150')
.margin({ top: 0, left: 0, bottom: 0, right: 0 .margin({ top: 0, left: 0, bottom: 0, right: 0 })
})
}) })
} }
} }
build() { build() {
if(this.menuBtn!=undefined){ if(this.menuBtn!=undefined){
EventBtn({eventBtn:this.menuBtn[0]}).bindMenu(this.EventMenu(this.menuBtn)) EventBtn({eventBtn:this.menuBtn[0]}).bindMenu(this.EventMenu)
} }
} }
} }

View File

@ -0,0 +1,59 @@
import { TitleButton } from "../LayoutInterface/Interface/TitleButtonInterface";
@ComponentV2
export struct TextComboBox {
@Param menu: Array<TitleButton> = new Array<TitleButton>;
@Local selectIndex:number=0;
@Builder
EventMenu() {
Menu() {
ForEach(this.menu, (item: TitleButton, index: number) => {
MenuItem({ content: item.eName })
.width('150')
.margin({
top: 0,
left: 0,
bottom: 0,
right: 0
}).onClick(()=>{
this.selectIndex=index;
})
})
}
}
build() {
Row() {
Text(this.menu[this.selectIndex].eName)
.bindMenu(this.EventMenu)
}
}
}
@ComponentV2
export struct TextInputComboBox {
@Param menu: Array<TitleButton> = new Array<TitleButton>;
@Local selectIndex:number=0;
@Builder
EventMenu() {
Menu() {
ForEach(this.menu, (item: TitleButton, index: number) => {
MenuItem({ content: item.eName })
.width('150')
.margin({
top: 0,
left: 0,
bottom: 0,
right: 0
}).onClick(()=>{
this.selectIndex=index;
})
})
}
}
build() {
Row() {
TextInput({placeholder:this.selectIndex.toString()})
.bindMenu(this.EventMenu)
.type(InputType.Number)
}
}
}

View File

@ -0,0 +1,25 @@
import { TitleButton } from "../LayoutInterface/Interface/TitleButtonInterface";
import {TitleViewMenu} from "../LayoutInterface/Layout/TitleViewData"
import { Popup } from "@kit.ArkUI";
//视图切换弹窗
@CustomDialog
export struct ViewDialog {
controller: CustomDialogController;
build(){
Row({ space:2 }) {
GridRow({ columns: 3 ,gutter: 5 }) {
ForEach(TitleViewMenu, (item: TitleButton, index?: number | undefined) => {
GridCol({ span: 1 }) {
Row() {
Image($r('app.media.' + item.eIcon))
.width('35vp')
.height('35vp')
.objectFit(ImageFit.Contain)
}
}
})
}
}
}
}

View File

@ -3,16 +3,25 @@ import { edgeColors } from '@kit.ArkUI';
import {TitleTab} from './TitleTabLayout/TitleTab' import {TitleTab} from './TitleTabLayout/TitleTab'
import {LeftSideTab} from './leftSideTab' import {LeftSideTab} from './leftSideTab'
import {ModelViewTab} from './modelViewTab' import {ModelViewTab} from './modelViewTab'
import {TitleColumnSub} from './TitleTabLayout/TitleColumnSub'
const DOMAIN = 0x0000; const DOMAIN = 0x0000;
@Entry @Entry
@Component @Component
struct Index { struct Index {
build() { build() {
//OpenCAX主界面整体布局,采用多行布局 //OpenCAX主界面整体布局,采用多行布局
Flex({ direction: FlexDirection.Column }) { Column({space:1}) {
//头部导航功能区 //头部导航功能区
TitleTab().height('auto').borderWidth('1vp') TitleTab().height('auto').borderWidth('1vp')
//工具栏
Row() {
TitleColumnSub();
}.height('4%')
.width('100%')
.borderWidth('1vp')
.align(Alignment.Start)
Row() { Row() {
//左侧边导航区 //左侧边导航区
LeftSideTab().borderWidth('1vp').width('20%'); LeftSideTab().borderWidth('1vp').width('20%');
@ -25,6 +34,7 @@ struct Index {
.align(Alignment.Center) .align(Alignment.Center)
}.height('80%') }.height('80%')
.padding(1) .padding(1)
.padding(1)
Column(){ Column(){
Text('状态栏').height('100%').width('100%') Text('状态栏').height('100%').width('100%')
}.height('5%').borderWidth('1vp') }.height('5%').borderWidth('1vp')

View File

@ -0,0 +1,15 @@
import { TitleButton } from "../Interface/TitleButtonInterface";
import { TitleModelType } from "./TitleModelType";
export let SelectionMode:Array<TitleButton>=[
{eModel:[TitleModelType.BASE],eName:"实体特征",eNamed:"",eIcon:"",eTips:"正三轴测图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"曲线特征",eNamed:"",eIcon:"",eTips:"前视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"加工特征",eNamed:"",eIcon:"",eTips:"前视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"基准",eNamed:"",eIcon:"",eTips:"正等测图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"边",eNamed:"",eIcon:"",eTips:"前视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"面",eNamed:"",eIcon:"",eTips:"左视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"线",eNamed:"",eIcon:"",eTips:"右视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"视图",eNamed:"",eIcon:"",eTips:"前视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"图像",eNamed:"",eIcon:"",eTips:"俯视图",eEvent:""},
]

View File

@ -0,0 +1,15 @@
import { TitleButton } from "../Interface/TitleButtonInterface";
import { TitleModelType } from "./TitleModelType";
export let TitleViewMenu:Array<TitleButton>=[
{eModel:[TitleModelType.BASE],eName:"正三轴测图",eNamed:"",eIcon:"base_view_tfr_tri",eTips:"正三轴测图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"俯视图",eNamed:"",eIcon:"base_view_top",eTips:"俯视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"正等测图",eNamed:"",eIcon:"base_view_tfr_iso",eTips:"正等测图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"左视图",eNamed:"",eIcon:"base_view_left",eTips:"左视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"前视图",eNamed:"",eIcon:"base_view_front",eTips:"前视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"右视图",eNamed:"",eIcon:"base_view_right",eTips:"右视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"后视图",eNamed:"",eIcon:"base_view_back",eTips:"后视图",eEvent:""},
{eModel:[TitleModelType.BASE],eName:"仰视图",eNamed:"",eIcon:"base_view_bottom",eTips:"仰视图",eEvent:""},
]

View File

@ -0,0 +1,53 @@
import { TextComboBox,TextInputComboBox } from "../CustomStyle/StyleComboBox";
import { TitleButton } from "../LayoutInterface/Interface/TitleButtonInterface";
import { ViewDialog } from "../CustomStyle/StyleDialog"
import { TitleViewMenu } from "../LayoutInterface/Layout/TitleViewData";
import {SelectionMode} from "../LayoutInterface/Layout/TitleSelectionMode"
@ComponentV2
export struct TitleColumnSub {
//Title下的子行的功能
@Local layerArray: Array<TitleButton> = [];
@Local dX:number=0;
@Local dY:number=0;
@Local viewDialog:CustomDialogController|undefined=undefined;
private ViewDialog(): CustomDialogController {
return new CustomDialogController({
builder: ViewDialog(), // 确保 ViewDialog 组件已正确定义
width: '130vp',
height: '118vp',
borderWidth: 1,
cornerRadius: 5,
isModal: true,
alignment: DialogAlignment.TopStart,
offset: { dx: this.dX, dy: this.dY },
});
}
build(){
Row({space:5}){
Image($r('app.media.base_seetings'))
.height(25)
.width(25)
.padding(1)
Text('拾取类型过滤器:')
TextComboBox({menu:SelectionMode})
.width('100vp')
.borderWidth(1)
.borderColor(Color.Grey)
.borderRadius(5)
Text('图层:')
TextInputComboBox({menu:this.layerArray}).width('10%')
Button('坐标轴')
Image($r('app.media.' + TitleViewMenu[0].eIcon)).onClick((event) => {
this.dX=event.windowX
this.dY=event.windowY
if(this.viewDialog==undefined){
this.viewDialog=this.ViewDialog();
}
this.viewDialog.open();
}).width('35vp')
.height('35vp')
Button('显示类型')
}.margin({ top: 1, left: 1, bottom: 1, right: 1 })
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB