归一化部分组件复用
This commit is contained in:
parent
1f696d8a87
commit
ec59d56a27
@ -1,4 +1,7 @@
|
|||||||
import { window} from '@kit.ArkUI';
|
import { AppStorageV2, window} from '@kit.ArkUI';
|
||||||
|
|
||||||
|
//该文档主要储存屏幕信息,主窗口信息,窗口管理信息
|
||||||
|
//底部有全局信息变量,已导出,其他page只需要import该文件即可调用let变量
|
||||||
@ObservedV2
|
@ObservedV2
|
||||||
export class MainScreenDisplayInfo {
|
export class MainScreenDisplayInfo {
|
||||||
@Trace public mainScreenDisplayId: number;
|
@Trace public mainScreenDisplayId: number;
|
||||||
@ -31,4 +34,9 @@ export class MainWindowStageInfo {
|
|||||||
this.ws = _ws ?? undefined;
|
this.ws = _ws ?? undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//全局保存主窗口信息,屏幕信息.窗口管理器信息
|
||||||
|
export let mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
||||||
|
export let msdInfo: MainScreenDisplayInfo = AppStorageV2.connect<MainScreenDisplayInfo>(MainScreenDisplayInfo, () => new MainScreenDisplayInfo())!;
|
||||||
|
export let mwsInfo: MainWindowStageInfo = AppStorageV2.connect<MainWindowStageInfo>(MainWindowStageInfo, () => new MainWindowStageInfo())!;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,22 +3,36 @@ import { ExecuteCommand } from '../EventSubWindow/ExecuteCommand';
|
|||||||
import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface";
|
import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface";
|
||||||
import { TitleModel } from "../LayoutInterface/Interface/ModelInterface";
|
import { TitleModel } from "../LayoutInterface/Interface/ModelInterface";
|
||||||
import { TitleData } from '../LayoutInterface/Layout/TabContent';
|
import { TitleData } from '../LayoutInterface/Layout/TabContent';
|
||||||
import { AppStorageV2 } from '@kit.ArkUI';
|
import { mwInfo } from '../AppStorageV2Class';
|
||||||
import { MainWindowInfo } from '../AppStorageV2Class';
|
|
||||||
|
|
||||||
|
//按钮统一尺寸,该按钮为正方形,所以以主窗口宽为基准,长=高->正方形
|
||||||
|
let ebWidth=mwInfo.mainWindowWidth*0.02;
|
||||||
|
let ebHeigth=mwInfo.mainWindowWidth*0.02;
|
||||||
|
//占位符的高度
|
||||||
|
let edHeigth=mwInfo.mainWindowWidth*0.005
|
||||||
//单一功能按钮
|
//单一功能按钮
|
||||||
//图片->文本
|
//图片->文本
|
||||||
//不能用于模块切换
|
//不能用于模块切换
|
||||||
|
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
export struct EventBtn {
|
export struct EventBtn {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
//按钮动态布局类型,目前处于开发阶段两种状态.
|
||||||
|
//1-eventBtn==false为普通按钮,支持所有功能
|
||||||
|
//2-eventBtn==true为模块切换模块独立的功能
|
||||||
|
@Param eventBtnType?:boolean=false;
|
||||||
|
//普通功能按钮调用的数据
|
||||||
@Param eventBtn: TitleButton | undefined = undefined;
|
@Param eventBtn: TitleButton | undefined = undefined;
|
||||||
|
//模块切换模块按钮数据
|
||||||
|
@Consumer('curtModel') curtModel: Array<TitleModel> | undefined = TitleData.mModels.get(0)
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column({ space: 0 }) {
|
Column({ space: 2 }) {
|
||||||
|
//如果该类型是false表示为配普通事件按钮
|
||||||
|
if(!this.eventBtnType){
|
||||||
if (this.eventBtn != undefined) {
|
if (this.eventBtn != undefined) {
|
||||||
Button()
|
Button()
|
||||||
.width(this.mwInfo.mainWindowWidth*0.02)
|
.width(ebWidth)
|
||||||
.height(this.mwInfo.mainWindowWidth*0.02)
|
.height(ebHeigth)
|
||||||
.backgroundImage($r('app.media.' + this.eventBtn.eIcon))
|
.backgroundImage($r('app.media.' + this.eventBtn.eIcon))
|
||||||
.backgroundImagePosition({ x: '5%', y: '5%' })
|
.backgroundImagePosition({ x: '5%', y: '5%' })
|
||||||
.backgroundColor(Color.Transparent)
|
.backgroundColor(Color.Transparent)
|
||||||
@ -29,40 +43,21 @@ export struct EventBtn {
|
|||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
ExecuteCommand(this.eventBtn as TitleButton);
|
ExecuteCommand(this.eventBtn as TitleButton);
|
||||||
})
|
})
|
||||||
Text()
|
|
||||||
.width('auto')
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.005)
|
|
||||||
.backgroundColor(Color.Transparent)
|
|
||||||
Text(this.eventBtn.eName)
|
|
||||||
.fontSize(16)
|
|
||||||
.width('auto')
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.005)
|
|
||||||
.textAlign(TextAlign.Center)
|
|
||||||
.backgroundColor(Color.Transparent)
|
|
||||||
}
|
}
|
||||||
}.padding(1)
|
}else {
|
||||||
}
|
//判断类型为true,属于模块切换事件
|
||||||
}
|
|
||||||
|
|
||||||
//仅仅用于模块切换
|
|
||||||
@ComponentV2
|
|
||||||
export struct SwitchModelBtn {
|
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
@Param eventBtn: TitleButton | undefined = undefined;
|
|
||||||
@Consumer('curtModel') curtModel: Array<TitleModel> | undefined = TitleData.mModels.get(0)
|
|
||||||
build() {
|
|
||||||
Column({ space: 2 }) {
|
|
||||||
if (this.eventBtn != undefined) {
|
if (this.eventBtn != undefined) {
|
||||||
Button()
|
Button()
|
||||||
.width(this.mwInfo.mainWindowWidth*0.02)
|
.width(ebWidth)
|
||||||
.height(this.mwInfo.mainWindowWidth*0.02)
|
.height(ebHeigth)
|
||||||
.backgroundImage($r('app.media.' + this.eventBtn.eIcon))
|
.backgroundImage($r('app.media.' + this.eventBtn.eIcon))
|
||||||
.backgroundImagePosition({ x: '5%', y: '5%' })
|
.backgroundImagePosition({ x: '5%', y: '5%' })
|
||||||
.backgroundColor(Color.Transparent)
|
.backgroundColor(Color.Transparent)
|
||||||
.backgroundImageSize({
|
.backgroundImageSize({
|
||||||
width: '90%', // 图片宽度占满按钮
|
width: '90%', // 图片宽度占满按钮
|
||||||
height: '90%' // 图片高度占满按钮
|
height: '90%' // 图片高度占满按钮
|
||||||
}).onClick(() => {
|
})
|
||||||
|
.onClick(() => {
|
||||||
if (this.eventBtn?.eEvent == 'Switch_Model_CAD') {
|
if (this.eventBtn?.eEvent == 'Switch_Model_CAD') {
|
||||||
this.curtModel = TitleData.mModels.get(1)
|
this.curtModel = TitleData.mModels.get(1)
|
||||||
} else if (this.eventBtn?.eEvent == 'Switch_Model_CAM') {
|
} else if (this.eventBtn?.eEvent == 'Switch_Model_CAM') {
|
||||||
@ -71,17 +66,107 @@ export struct SwitchModelBtn {
|
|||||||
this.curtModel = TitleData.mModels.get(3)
|
this.curtModel = TitleData.mModels.get(3)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.eventBtn != undefined) {
|
||||||
Text()
|
Text()
|
||||||
.width('auto')
|
.width('auto')
|
||||||
.height(this.mwInfo.mainWindowWidth*0.005)
|
.height(edHeigth)
|
||||||
.backgroundColor(Color.Transparent)
|
.backgroundColor(Color.Transparent)
|
||||||
Text(this.eventBtn.eName)
|
Text(this.eventBtn.eName)
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.width('auto')
|
.width('auto')
|
||||||
.height(this.mwInfo.mainWindowWidth*0.005)
|
.height(edHeigth)
|
||||||
.textAlign(TextAlign.Center)
|
.textAlign(TextAlign.Center)
|
||||||
|
.backgroundColor(Color.Transparent)
|
||||||
}
|
}
|
||||||
}.padding(1)
|
}.padding(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//菜单目录按钮
|
||||||
|
//功能目录菜单,主要用于针对单一按钮多个功能形式
|
||||||
|
@ComponentV2
|
||||||
|
export struct MenuBtn {
|
||||||
|
@Param menuBtn: Array<TitleButton> | undefined = undefined;
|
||||||
|
@Local curtIndex:number=0;
|
||||||
|
@Builder
|
||||||
|
EventMenu() {
|
||||||
|
Menu() {
|
||||||
|
ForEach(this.menuBtn, (item: TitleButton, index: number) => {
|
||||||
|
MenuItem({ startIcon: $r('app.media.' + item.eIcon), content: item.eName })
|
||||||
|
.onClick(()=>{
|
||||||
|
this.curtIndex=index;
|
||||||
|
ExecuteCommand(item as TitleButton);
|
||||||
|
}).size({height: ebWidth})
|
||||||
|
})
|
||||||
|
}.fontSize(20)
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column({ space: 0 }) {
|
||||||
|
if (this.menuBtn != undefined) {
|
||||||
|
Button()
|
||||||
|
.bindMenu(this.EventMenu)
|
||||||
|
.width(ebWidth)
|
||||||
|
.height(ebHeigth)
|
||||||
|
.backgroundImage($r('app.media.' + this.menuBtn[this.curtIndex].eIcon))
|
||||||
|
.backgroundImagePosition({ x: '5%', y: '5%' })
|
||||||
|
.backgroundColor(Color.Transparent)
|
||||||
|
.backgroundImageSize({
|
||||||
|
width: '90%', // 图片宽度占满按钮
|
||||||
|
height: '90%' // 图片高度占满按钮
|
||||||
|
})
|
||||||
|
Button()
|
||||||
|
.type(ButtonType.Normal)
|
||||||
|
.bindMenu(this.EventMenu)
|
||||||
|
.width(ebWidth)
|
||||||
|
.height(edHeigth)
|
||||||
|
.backgroundImage($r('app.media.base_chevron_down'))
|
||||||
|
.backgroundImagePosition({ x: '35%', y: '0%' })
|
||||||
|
.backgroundColor(Color.Transparent)
|
||||||
|
|
||||||
|
Text(this.menuBtn[this.curtIndex].eName)
|
||||||
|
.fontSize(16)
|
||||||
|
.width('auto')
|
||||||
|
.height(edHeigth)
|
||||||
|
.textAlign(TextAlign.Center)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Title Sub功能目录菜单
|
||||||
|
@ComponentV2
|
||||||
|
export struct SubColumnMenu {
|
||||||
|
@Param menus: Array<TitleButton>| undefined = undefined;
|
||||||
|
@Param icon:string='';
|
||||||
|
@Builder
|
||||||
|
EventMenu() {
|
||||||
|
Menu() {
|
||||||
|
ForEach(this.menus, (item: TitleButton, index: number) => {
|
||||||
|
MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName })
|
||||||
|
.width('150')
|
||||||
|
.size({height: mwInfo.mainWindowWidth*0.02})
|
||||||
|
})
|
||||||
|
}.fontSize(20)
|
||||||
|
}
|
||||||
|
build(){
|
||||||
|
Row(){
|
||||||
|
Button()
|
||||||
|
.padding(1)
|
||||||
|
.width(mwInfo.mainWindowWidth*0.013)
|
||||||
|
.height(mwInfo.mainWindowWidth*0.013)
|
||||||
|
.backgroundColor(Color.Transparent)
|
||||||
|
.backgroundImage($r('app.media.'+this.icon))
|
||||||
|
.backgroundImagePosition({ x: '5%', y: '5%' })
|
||||||
|
.backgroundImageSize({
|
||||||
|
width: '90%', // 图片宽度占满按钮
|
||||||
|
height: '90%' // 图片高度占满按钮
|
||||||
|
})
|
||||||
|
.bindMenu(this.EventMenu())
|
||||||
|
.type(ButtonType.Normal)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { mwInfo } from "../AppStorageV2Class";
|
||||||
import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface";
|
import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface";
|
||||||
|
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
@ -9,12 +10,10 @@ export struct TextComboBox {
|
|||||||
Menu() {
|
Menu() {
|
||||||
ForEach(this.menu, (item: TitleButton, index: number) => {
|
ForEach(this.menu, (item: TitleButton, index: number) => {
|
||||||
MenuItem({ content: item.eName })
|
MenuItem({ content: item.eName })
|
||||||
.labelFont({ size: 20})
|
.size({height: mwInfo.mainWindowWidth*0.02})
|
||||||
.width('auto')
|
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
this.selectIndex=index;
|
this.selectIndex=index;
|
||||||
})
|
})
|
||||||
.backgroundColor('#f3f3f0')
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,12 +33,10 @@ export struct TextInputComboBox {
|
|||||||
Menu() {
|
Menu() {
|
||||||
ForEach(this.menu, (item: TitleButton, index: number) => {
|
ForEach(this.menu, (item: TitleButton, index: number) => {
|
||||||
MenuItem({ content: item.eName })
|
MenuItem({ content: item.eName })
|
||||||
.labelFont({ size: 20})
|
.size({height: mwInfo.mainWindowWidth*0.02})
|
||||||
.width('auto')
|
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
this.selectIndex=index;
|
this.selectIndex=index;
|
||||||
})
|
})
|
||||||
.backgroundColor('#f3f3f0')
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,28 +1,25 @@
|
|||||||
import { TitleMenu } from "../LayoutInterface/Interface/MenuInterface";
|
import { TitleMenu } from "../LayoutInterface/Interface/MenuInterface";
|
||||||
import { TitleGroup } from "../LayoutInterface/Interface/GroupInterface";
|
import { TitleGroup } from "../LayoutInterface/Interface/GroupInterface";
|
||||||
import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface";
|
import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface";
|
||||||
import { EventBtn } from "./Button";
|
|
||||||
import { ExecuteCommand } from "../EventSubWindow/ExecuteCommand";
|
import { ExecuteCommand } from "../EventSubWindow/ExecuteCommand";
|
||||||
import { AppStorageV2 } from "@kit.ArkUI";
|
import { mwInfo } from "../AppStorageV2Class";
|
||||||
import { MainWindowInfo } from "../AppStorageV2Class";
|
|
||||||
|
|
||||||
|
|
||||||
//菜单按钮
|
//菜单按钮
|
||||||
//主要用于功能组操作菜单.文件下拉菜单等.
|
//主要用于功能组操作菜单.文件下拉菜单等.
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
export struct GroupTextEventMenu {
|
export struct GroupTextEventMenu {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
@Param grpEvent: TitleGroup | undefined = undefined;
|
@Param grpEvent: TitleGroup | undefined = undefined;
|
||||||
|
|
||||||
@Builder
|
@Builder
|
||||||
GroupMenu(menus: Array<TitleMenu>) {
|
GroupMenu(menus: Array<TitleMenu>) {
|
||||||
|
Menu() {
|
||||||
ForEach(menus, (item: TitleMenu, index: number) => {
|
ForEach(menus, (item: TitleMenu, index: number) => {
|
||||||
MenuItem({ startIcon: $r('app.media.' + item.mIcon), content: item.mName })
|
MenuItem({ startIcon: $r('app.media.' + item.mIcon), content: item.mName })
|
||||||
.labelFont({ size: 20})
|
.size({height: mwInfo.mainWindowWidth*0.02})
|
||||||
.width('auto')
|
|
||||||
})
|
})
|
||||||
|
}.fontSize(20)
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Row() {
|
Row() {
|
||||||
if (this.grpEvent != undefined) {
|
if (this.grpEvent != undefined) {
|
||||||
@ -33,8 +30,8 @@ export struct GroupTextEventMenu {
|
|||||||
.fontColor(Color.Gray)
|
.fontColor(Color.Gray)
|
||||||
Blank().width('auto')
|
Blank().width('auto')
|
||||||
Button()
|
Button()
|
||||||
.height(this.mwInfo.mainWindowWidth*0.01)
|
.height(mwInfo.mainWindowWidth*0.005)
|
||||||
.width(this.mwInfo.mainWindowWidth*0.01)
|
.width(mwInfo.mainWindowWidth*0.005)
|
||||||
.padding(1)
|
.padding(1)
|
||||||
.backgroundImage($r('app.media.base_seetings'))
|
.backgroundImage($r('app.media.base_seetings'))
|
||||||
.backgroundImagePosition({ x: '5%', y: '5%' })
|
.backgroundImagePosition({ x: '5%', y: '5%' })
|
||||||
@ -49,59 +46,5 @@ export struct GroupTextEventMenu {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//菜单目录按钮
|
|
||||||
//功能目录菜单,主要用于针对单一按钮多个功能形式
|
|
||||||
@ComponentV2
|
|
||||||
export struct MenuBtn {
|
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
@Param menuBtn: Array<TitleButton> | undefined = undefined;
|
|
||||||
@Param iconState: boolean = false;
|
|
||||||
@Local curtIndex:number=0;
|
|
||||||
@Builder
|
|
||||||
EventMenu() {
|
|
||||||
Menu() {
|
|
||||||
ForEach(this.menuBtn, (item: TitleButton, index: number) => {
|
|
||||||
MenuItem({ startIcon: $r('app.media.' + item.eIcon), content: item.eName })
|
|
||||||
.labelFont({ size: 20})
|
|
||||||
.onClick(()=>{
|
|
||||||
this.curtIndex=index;
|
|
||||||
ExecuteCommand(item as TitleButton);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
|
||||||
Column({ space: 0 }) {
|
|
||||||
if (this.menuBtn != undefined) {
|
|
||||||
Button()
|
|
||||||
.bindMenu(this.EventMenu)
|
|
||||||
.width(this.mwInfo.mainWindowWidth*0.02)
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.02)
|
|
||||||
.backgroundImage($r('app.media.' + this.menuBtn[this.curtIndex].eIcon))
|
|
||||||
.backgroundImagePosition({ x: '5%', y: '5%' })
|
|
||||||
.backgroundColor(Color.Transparent)
|
|
||||||
.backgroundImageSize({
|
|
||||||
width: '90%', // 图片宽度占满按钮
|
|
||||||
height: '90%' // 图片高度占满按钮
|
|
||||||
})
|
|
||||||
Button()
|
|
||||||
.type(ButtonType.Normal)
|
|
||||||
.bindMenu(this.EventMenu)
|
|
||||||
.width(this.mwInfo.mainWindowWidth*0.02)
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.005)
|
|
||||||
.backgroundImage($r('app.media.base_chevron_down'))
|
|
||||||
.backgroundImagePosition({ x: '40%', y: '0%' })
|
|
||||||
.backgroundColor(Color.Transparent)
|
|
||||||
|
|
||||||
Text(this.menuBtn[this.curtIndex].eName)
|
|
||||||
.fontSize(16)
|
|
||||||
.width('auto')
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.005)
|
|
||||||
.textAlign(TextAlign.Center)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,12 @@
|
|||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import { window,UIContext, AppStorageV2} from '@kit.ArkUI';
|
import { window} from '@kit.ArkUI';
|
||||||
import { MainWindowInfo, MainWindowStageInfo } from '../AppStorageV2Class';
|
import { mwInfo, mwsInfo } from '../AppStorageV2Class';
|
||||||
|
|
||||||
let subWindow: window.Window | undefined = undefined;
|
let subWindow: window.Window | undefined = undefined;
|
||||||
|
|
||||||
export async function CreateAndShowSubWindow(name:string,pages:string) {
|
export async function CreateAndShowSubWindow(name:string,pages:string) {
|
||||||
try {
|
try {
|
||||||
const appws=AppStorageV2.connect<MainWindowStageInfo>(MainWindowStageInfo, () => new MainWindowStageInfo())!;
|
if(mwsInfo.ws==null){
|
||||||
const mwInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
const windowStage = appws.ws;
|
|
||||||
if(windowStage==null){
|
|
||||||
console.error('Failed to create the subwindow. Cause: windowStage is null');
|
console.error('Failed to create the subwindow. Cause: windowStage is null');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -22,7 +19,7 @@ export async function CreateAndShowSubWindow(name:string,pages:string) {
|
|||||||
outlineEnabled:true,
|
outlineEnabled:true,
|
||||||
};
|
};
|
||||||
|
|
||||||
await windowStage.createSubWindowWithOptions('subWindow', options).then((data) => {
|
await mwsInfo.ws.createSubWindowWithOptions('subWindow', options).then((data) => {
|
||||||
subWindow = data;
|
subWindow = data;
|
||||||
subWindow.setResizeByDragEnabled(true, (err: BusinessError) => {
|
subWindow.setResizeByDragEnabled(true, (err: BusinessError) => {
|
||||||
console.log("设置拖拽缩放", `报错信息:${err.code}, ${err.message}`)
|
console.log("设置拖拽缩放", `报错信息:${err.code}, ${err.message}`)
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
import { MainWindowInfo } from '../AppStorageV2Class';
|
import { mwInfo } from '../AppStorageV2Class';
|
||||||
import { Expandable } from '../CustomStyle/Expandable';
|
import { Expandable } from '../CustomStyle/Expandable';
|
||||||
import { AppStorageV2 } from '@kit.ArkUI';
|
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
struct SWExtrude {
|
struct SWExtrude {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
// 控制内容区域显示与隐藏的状态
|
// 控制内容区域显示与隐藏的状态
|
||||||
@Provider('isSubExpanded') isExpanded:boolean=true;
|
@Provider('isSubExpanded') isExpanded:boolean=true;
|
||||||
build() {
|
build() {
|
||||||
|
|||||||
@ -4,24 +4,22 @@ import { TitleTab } from './TitleLayout/TitleTab'
|
|||||||
import { LeftSideTab } from './LeftSideLayout/LeftSideTab'
|
import { LeftSideTab } from './LeftSideLayout/LeftSideTab'
|
||||||
import { ModelViewTab } from './modelViewTab'
|
import { ModelViewTab } from './modelViewTab'
|
||||||
import { TitleColumnSub } from './TitleLayout/TitleColumnSub'
|
import { TitleColumnSub } from './TitleLayout/TitleColumnSub'
|
||||||
import { MainWindowInfo } from './AppStorageV2Class'
|
import { mwInfo } from './AppStorageV2Class'
|
||||||
|
|
||||||
const DOMAIN = 0x0000;
|
const DOMAIN = 0x0000;
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
struct Index {
|
struct Index {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
@Local startX:number=0;
|
@Local startX:number=0;
|
||||||
@Local isDragging:boolean=false;
|
@Local isDragging:boolean=false;
|
||||||
@Provider('panelWidth') panelWidth:number=this.mwInfo.mainWindowWidth * 0.15;
|
@Provider('panelWidth') panelWidth:number=mwInfo.mainWindowWidth * 0.15;
|
||||||
build() {
|
build() {
|
||||||
//OpenCAX主界面整体布局,采用多行布局
|
//OpenCAX主界面整体布局,采用多行布局
|
||||||
Column({ space: 0 }) {
|
Column({ space: 0 }) {
|
||||||
//头部导航功能区
|
//头部导航功能区
|
||||||
TitleTab()
|
TitleTab()
|
||||||
.height(this.mwInfo.mainWindowHeight * 0.1)
|
.height(mwInfo.mainWindowHeight * 0.08)
|
||||||
.borderRadius(5)
|
|
||||||
//分割线
|
//分割线
|
||||||
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
||||||
//工具栏
|
//工具栏
|
||||||
@ -29,7 +27,7 @@ struct Index {
|
|||||||
TitleColumnSub();
|
TitleColumnSub();
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height(this.mwInfo.mainWindowHeight * 0.03)
|
.height(mwInfo.mainWindowHeight * 0.03)
|
||||||
.align(Alignment.Start)
|
.align(Alignment.Start)
|
||||||
//分割线
|
//分割线
|
||||||
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
||||||
@ -60,7 +58,7 @@ struct Index {
|
|||||||
}.layoutWeight(1)
|
}.layoutWeight(1)
|
||||||
.align(Alignment.Center)
|
.align(Alignment.Center)
|
||||||
}.width('100%')
|
}.width('100%')
|
||||||
.height(this.mwInfo.mainWindowHeight * 0.36)
|
.height(mwInfo.mainWindowHeight * 0.36)
|
||||||
//分割线
|
//分割线
|
||||||
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
||||||
///状态栏
|
///状态栏
|
||||||
@ -69,7 +67,7 @@ struct Index {
|
|||||||
}.width('100%')
|
}.width('100%')
|
||||||
.align(Alignment.End)
|
.align(Alignment.End)
|
||||||
.alignItems(HorizontalAlign.Start)
|
.alignItems(HorizontalAlign.Start)
|
||||||
.height(this.mwInfo.mainWindowHeight * 0.05)
|
.height(mwInfo.mainWindowHeight * 0.05)
|
||||||
}.backgroundColor('#f3f3f0')
|
}.backgroundColor('#f3f3f0')
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
|
|||||||
@ -1,15 +1,13 @@
|
|||||||
import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface';
|
import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface';
|
||||||
import {LeftSideBars} from '../LayoutInterface/Layout/LeftSideBar'
|
import {LeftSideBars} from '../LayoutInterface/Layout/LeftSideBar'
|
||||||
import { AppStorageV2 } from '@kit.ArkUI';
|
import { mwInfo } from '../AppStorageV2Class';
|
||||||
import { MainWindowInfo } from '../AppStorageV2Class';
|
|
||||||
import {LeftSideComponent} from './LeftSideComponent'
|
import {LeftSideComponent} from './LeftSideComponent'
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
export struct LeftSideTab {
|
export struct LeftSideTab {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
private leftSideBarTabs: TabsController = new TabsController();
|
private leftSideBarTabs: TabsController = new TabsController();
|
||||||
@Local leftSideBarFocusIndex: number = 0;
|
@Local leftSideBarFocusIndex: number = 0;
|
||||||
@Local isExpanded:boolean=true;
|
@Local isExpanded:boolean=true;
|
||||||
@Consumer('panelWidth') panelWidth:number=this.mwInfo.mainWindowWidth * 0.1;
|
@Consumer('panelWidth') panelWidth:number=mwInfo.mainWindowWidth * 0.1;
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Row() {
|
Row() {
|
||||||
@ -26,12 +24,12 @@ export struct LeftSideTab {
|
|||||||
})
|
})
|
||||||
.backgroundImage(this.isExpanded ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
|
.backgroundImage(this.isExpanded ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
|
||||||
.type(ButtonType.Normal)
|
.type(ButtonType.Normal)
|
||||||
.width(this.mwInfo.mainWindowWidth*0.013)
|
.width(mwInfo.mainWindowWidth*0.013)
|
||||||
.height(this.mwInfo.mainWindowWidth*0.013)
|
.height(mwInfo.mainWindowWidth*0.013)
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
this.isExpanded = !this.isExpanded;
|
this.isExpanded = !this.isExpanded;
|
||||||
if(this.isExpanded){
|
if(this.isExpanded){
|
||||||
this.panelWidth=this.mwInfo.mainWindowWidth * 0.1;
|
this.panelWidth=mwInfo.mainWindowWidth * 0.1;
|
||||||
}else{
|
}else{
|
||||||
this.panelWidth=0;
|
this.panelWidth=0;
|
||||||
}
|
}
|
||||||
@ -52,8 +50,8 @@ export struct LeftSideTab {
|
|||||||
})
|
})
|
||||||
.backgroundImage($r('app.media.'+item.eIcon))
|
.backgroundImage($r('app.media.'+item.eIcon))
|
||||||
.fontWeight(index === this.leftSideBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
|
.fontWeight(index === this.leftSideBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
|
||||||
.width(this.mwInfo.mainWindowWidth*0.013)
|
.width(mwInfo.mainWindowWidth*0.013)
|
||||||
.height(this.mwInfo.mainWindowWidth*0.013)
|
.height(mwInfo.mainWindowWidth*0.013)
|
||||||
.type(ButtonType.Normal)
|
.type(ButtonType.Normal)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.leftSideBarTabs.changeIndex(index);
|
this.leftSideBarTabs.changeIndex(index);
|
||||||
@ -67,8 +65,8 @@ export struct LeftSideTab {
|
|||||||
.align(Alignment.Start)
|
.align(Alignment.Start)
|
||||||
.scrollable(ScrollDirection.Vertical)
|
.scrollable(ScrollDirection.Vertical)
|
||||||
.scrollBar(BarState.Off)
|
.scrollBar(BarState.Off)
|
||||||
.width(this.mwInfo.mainWindowWidth*0.013)
|
.width(mwInfo.mainWindowWidth*0.013)
|
||||||
.height(this.mwInfo.mainWindowWidth*0.013)
|
.height(mwInfo.mainWindowWidth*0.013)
|
||||||
.height('100%')
|
.height('100%')
|
||||||
}.borderWidth(1)
|
}.borderWidth(1)
|
||||||
.borderColor(Color.Grey)
|
.borderColor(Color.Grey)
|
||||||
|
|||||||
@ -4,36 +4,25 @@ import { ViewDialog } from "../CustomStyle/Dialog"
|
|||||||
import { SwitchView } from "../LayoutInterface/Layout/SwitchView";
|
import { SwitchView } from "../LayoutInterface/Layout/SwitchView";
|
||||||
import {SelectionMode} from "../LayoutInterface/Layout/SelectionMode"
|
import {SelectionMode} from "../LayoutInterface/Layout/SelectionMode"
|
||||||
import {DisplayMode} from "../LayoutInterface/Layout/DisplayMode"
|
import {DisplayMode} from "../LayoutInterface/Layout/DisplayMode"
|
||||||
import { MenuBtn } from "../CustomStyle/Menu";
|
|
||||||
import { LayoutOption } from "../LayoutInterface/Layout/LayoutOption";
|
import { LayoutOption } from "../LayoutInterface/Layout/LayoutOption";
|
||||||
import { TitleData } from "../LayoutInterface/Layout/TabContent";
|
import { TitleData } from "../LayoutInterface/Layout/TabContent";
|
||||||
import { MainWindowInfo } from "../AppStorageV2Class";
|
import { mwInfo } from "../AppStorageV2Class";
|
||||||
import { AppStorageV2, font, Font } from "@kit.ArkUI";
|
import { SubColumnMenu } from "../CustomStyle/Button";
|
||||||
|
|
||||||
|
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
export struct TitleColumnSub {
|
export struct TitleColumnSub {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
|
|
||||||
@Local layerArray: Array<TitleButton> = [];
|
@Local layerArray: Array<TitleButton> = [];
|
||||||
@Local dX:number=0;
|
@Local dX:number=0;
|
||||||
@Local dY:number=0;
|
@Local dY:number=0;
|
||||||
@Local viewDialog:CustomDialogController|undefined=undefined;
|
@Local viewDialog:CustomDialogController|undefined=undefined;
|
||||||
|
|
||||||
@Builder
|
|
||||||
DisplayModeMenu(menus: Array<TitleButton>) {
|
|
||||||
Menu() {
|
|
||||||
ForEach(menus, (item: TitleButton, index: number) => {
|
|
||||||
MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName })
|
|
||||||
.width('150')
|
|
||||||
.labelFont({size: 20})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private ViewDialog(): CustomDialogController {
|
private ViewDialog(): CustomDialogController {
|
||||||
return new CustomDialogController({
|
return new CustomDialogController({
|
||||||
builder: ViewDialog(), // 确保 ViewDialog 组件已正确定义
|
builder: ViewDialog(), // 确保 ViewDialog 组件已正确定义
|
||||||
width: this.mwInfo.mainWindowWidth*0.04,
|
width: mwInfo.mainWindowWidth*0.04,
|
||||||
height: this.mwInfo.mainWindowWidth*0.04,
|
height: mwInfo.mainWindowWidth*0.04,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
cornerRadius: 5,
|
cornerRadius: 5,
|
||||||
isModal: true,
|
isModal: true,
|
||||||
@ -44,23 +33,10 @@ export struct TitleColumnSub {
|
|||||||
|
|
||||||
build(){
|
build(){
|
||||||
Row({space:5}){
|
Row({space:5}){
|
||||||
Button()
|
SubColumnMenu({menus:TitleData.mFileModel.cmEvents as Array<TitleButton>,icon:'base_shortcut_menu'})
|
||||||
.padding(1)
|
|
||||||
.width(this.mwInfo.mainWindowWidth*0.013)
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.013)
|
|
||||||
.backgroundColor(Color.Transparent)
|
|
||||||
.backgroundImage($r('app.media.base_shortcut_menu'))
|
|
||||||
.backgroundImagePosition({ x: '5%', y: '5%' })
|
|
||||||
.backgroundImageSize({
|
|
||||||
width: '90%', // 图片宽度占满按钮
|
|
||||||
height: '90%' // 图片高度占满按钮
|
|
||||||
})
|
|
||||||
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
|
|
||||||
.type(ButtonType.Normal)
|
|
||||||
.margin({ top:0, left: 5, bottom: 0, right: 0 })
|
.margin({ top:0, left: 5, bottom: 0, right: 0 })
|
||||||
Text('菜单')
|
Text('菜单')
|
||||||
.fontSize(20)
|
.fontSize(20)
|
||||||
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
|
|
||||||
Text('|')
|
Text('|')
|
||||||
Text('拾取类型:')
|
Text('拾取类型:')
|
||||||
.fontSize(20)
|
.fontSize(20)
|
||||||
@ -71,14 +47,7 @@ export struct TitleColumnSub {
|
|||||||
Text('图层:')
|
Text('图层:')
|
||||||
.fontSize(20)
|
.fontSize(20)
|
||||||
TextInputComboBox({menu:this.layerArray}).width('10%')
|
TextInputComboBox({menu:this.layerArray}).width('10%')
|
||||||
Button()
|
SubColumnMenu({menus:LayoutOption,icon:LayoutOption[0].eIcon})
|
||||||
.width(this.mwInfo.mainWindowWidth*0.013)
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.013)
|
|
||||||
.padding(1)
|
|
||||||
.backgroundColor(Color.Transparent)
|
|
||||||
.backgroundImage($r('app.media.'+LayoutOption[0].eIcon))
|
|
||||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
|
||||||
.bindMenu(this.DisplayModeMenu(LayoutOption))
|
|
||||||
//视角弹窗
|
//视角弹窗
|
||||||
Button().onClick((event) => {
|
Button().onClick((event) => {
|
||||||
this.dX=event.windowX
|
this.dX=event.windowX
|
||||||
@ -87,24 +56,15 @@ export struct TitleColumnSub {
|
|||||||
this.viewDialog=this.ViewDialog();
|
this.viewDialog=this.ViewDialog();
|
||||||
}
|
}
|
||||||
this.viewDialog.open();
|
this.viewDialog.open();
|
||||||
}).width(this.mwInfo.mainWindowWidth*0.013)
|
}).width(mwInfo.mainWindowWidth*0.013)
|
||||||
.height(this.mwInfo.mainWindowWidth*0.013)
|
.height(mwInfo.mainWindowWidth*0.013)
|
||||||
.backgroundColor(Color.Transparent)
|
.backgroundColor(Color.Transparent)
|
||||||
.backgroundImage($r('app.media.' + SwitchView[0].eIcon))
|
.backgroundImage($r('app.media.' + SwitchView[0].eIcon))
|
||||||
.backgroundImageSize({
|
.backgroundImageSize({
|
||||||
width: '100%', // 图片宽度占满按钮
|
width: '100%', // 图片宽度占满按钮
|
||||||
height: '100%' // 图片高度占满按钮
|
height: '100%' // 图片高度占满按钮
|
||||||
})
|
})
|
||||||
|
SubColumnMenu({menus:DisplayMode,icon:DisplayMode[0].eIcon})
|
||||||
Button()
|
|
||||||
.width(this.mwInfo.mainWindowWidth*0.013)
|
|
||||||
.height(this.mwInfo.mainWindowWidth*0.013)
|
|
||||||
.padding(1)
|
|
||||||
.backgroundColor(Color.Transparent)
|
|
||||||
.backgroundImage($r('app.media.'+DisplayMode[0].eIcon))
|
|
||||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
|
||||||
.bindMenu(this.DisplayModeMenu(DisplayMode))
|
|
||||||
|
|
||||||
}.margin({ top: 1, left: 1, bottom: 1, right: 1 })
|
}.margin({ top: 1, left: 1, bottom: 1, right: 1 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8,13 +8,11 @@ import {TitleData, TitleModel} from '../LayoutInterface/Layout/TabContent'
|
|||||||
import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface'
|
import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface'
|
||||||
import { TitleGroup } from '../LayoutInterface/Interface/GroupInterface'
|
import { TitleGroup } from '../LayoutInterface/Interface/GroupInterface'
|
||||||
import {TitleTabContent} from './TitleTabContent'
|
import {TitleTabContent} from './TitleTabContent'
|
||||||
import { MainWindowInfo } from '../AppStorageV2Class';
|
import { mwInfo } from '../AppStorageV2Class';
|
||||||
import { AppStorageV2, CommonModifier, TabTitleBar } from '@kit.ArkUI';
|
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
export struct TitleTab {
|
export struct TitleTab {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
//顶部导航组件
|
//顶部导航组件
|
||||||
private titleBarTabs: TabsController = new TabsController();
|
private titleBarTabs: TabsController = new TabsController();
|
||||||
//当前的顶部导航选择页
|
//当前的顶部导航选择页
|
||||||
@ -29,11 +27,9 @@ export struct TitleTab {
|
|||||||
Menu() {
|
Menu() {
|
||||||
ForEach(menus, (item: TitleButton, index: number) => {
|
ForEach(menus, (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('auto')
|
.size({height: mwInfo.mainWindowWidth*0.02})
|
||||||
.height('auto')
|
|
||||||
.labelFont({size: 20})
|
|
||||||
})
|
})
|
||||||
}
|
}.fontSize(20)
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
@ -43,8 +39,8 @@ export struct TitleTab {
|
|||||||
Button(TitleData.mFileModel.cmName)
|
Button(TitleData.mFileModel.cmName)
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.fontColor(Color.Black)
|
.fontColor(Color.Black)
|
||||||
.height(this.mwInfo.mainWindowHeight*0.025)
|
.height(mwInfo.mainWindowHeight*0.025)
|
||||||
.width(this.mwInfo.mainWindowWidth*0.035)
|
.width(mwInfo.mainWindowWidth*0.035)
|
||||||
.bindMenu(this.FileMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
|
.bindMenu(this.FileMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
|
||||||
.type(ButtonType.Normal)
|
.type(ButtonType.Normal)
|
||||||
.backgroundColor('#f3f3f0')
|
.backgroundColor('#f3f3f0')
|
||||||
@ -54,8 +50,8 @@ export struct TitleTab {
|
|||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.fontColor(Color.Black)
|
.fontColor(Color.Black)
|
||||||
.fontWeight(index === this.titleBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
|
.fontWeight(index === this.titleBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
|
||||||
.height(this.mwInfo.mainWindowHeight*0.025)
|
.height(mwInfo.mainWindowHeight*0.025)
|
||||||
.width(this.mwInfo.mainWindowWidth*0.035)
|
.width(mwInfo.mainWindowWidth*0.035)
|
||||||
.type(ButtonType.Normal)
|
.type(ButtonType.Normal)
|
||||||
.backgroundColor('#f3f3f0')
|
.backgroundColor('#f3f3f0')
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
@ -88,11 +84,11 @@ export struct TitleTab {
|
|||||||
ForEach(this.curtModel,(item:TitleModel, index: number)=>{
|
ForEach(this.curtModel,(item:TitleModel, index: number)=>{
|
||||||
TabContent() {
|
TabContent() {
|
||||||
TitleTabContent({curtLayout:item})
|
TitleTabContent({curtLayout:item})
|
||||||
}.align(Alignment.Start)
|
}
|
||||||
})
|
})
|
||||||
}.scrollable(true)
|
}.scrollable(true)
|
||||||
.barHeight(0)
|
.barHeight(0)
|
||||||
.barMode(BarMode.Fixed)
|
.barMode(BarMode.Fixed)
|
||||||
}.width(this.mwInfo.mainWindowWidth)
|
}.width(mwInfo.mainWindowWidth)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,13 @@
|
|||||||
import { hilog } from '@kit.PerformanceAnalysisKit';
|
import { hilog } from '@kit.PerformanceAnalysisKit';
|
||||||
import { TitleButton} from '../LayoutInterface/Interface/ButtonInterface';
|
import { TitleButton} from '../LayoutInterface/Interface/ButtonInterface';
|
||||||
import { TitleGroup} from '../LayoutInterface/Interface/GroupInterface';
|
import { TitleGroup} from '../LayoutInterface/Interface/GroupInterface';
|
||||||
import {GroupTextEventMenu,MenuBtn} from '../CustomStyle/Menu'
|
import {GroupTextEventMenu} from '../CustomStyle/Menu'
|
||||||
import {EventBtn,SwitchModelBtn} from '../CustomStyle/Button'
|
import {EventBtn,MenuBtn} from '../CustomStyle/Button'
|
||||||
import { TitleModel } from '../LayoutInterface/Layout/TabContent';
|
import { TitleModel } from '../LayoutInterface/Layout/TabContent';
|
||||||
import { MainWindowInfo } from '../AppStorageV2Class';
|
import { mwInfo } from '../AppStorageV2Class';
|
||||||
import { AppStorageV2 } from '@kit.ArkUI';
|
|
||||||
|
|
||||||
@ComponentV2
|
@ComponentV2
|
||||||
export struct TitleTabContent {
|
export struct TitleTabContent {
|
||||||
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
|
|
||||||
|
|
||||||
@Param curtLayout:TitleModel|undefined=undefined;
|
@Param curtLayout:TitleModel|undefined=undefined;
|
||||||
|
|
||||||
@ -27,14 +25,14 @@ export struct TitleTabContent {
|
|||||||
}else if(row_item instanceof Array<TitleGroup>){ //Array<TitleGroup>
|
}else if(row_item instanceof Array<TitleGroup>){ //Array<TitleGroup>
|
||||||
//功能组,迭代多个功能组
|
//功能组,迭代多个功能组
|
||||||
ForEach(row_item, (group_item: TitleGroup, index: number) =>{
|
ForEach(row_item, (group_item: TitleGroup, index: number) =>{
|
||||||
Column({ space: 7 }){
|
Column({ space:10 }){
|
||||||
Row({ space: 1 }){
|
Row({ space: 1 }){
|
||||||
ForEach(group_item.grpBtn, (btn_item: TitleButton|Array<TitleButton>, index: number) =>{
|
ForEach(group_item.grpBtn, (btn_item: TitleButton|Array<TitleButton>, index: number) =>{
|
||||||
if(this.curtLayout?.cmName=='应用模块'){
|
if(this.curtLayout?.cmName=='应用模块'){
|
||||||
if(Array.isArray(btn_item)){
|
if(Array.isArray(btn_item)){
|
||||||
MenuBtn({menuBtn:btn_item})
|
MenuBtn({menuBtn:btn_item})
|
||||||
}else{
|
}else{
|
||||||
SwitchModelBtn({eventBtn:btn_item})
|
EventBtn({eventBtn:btn_item,eventBtnType:true})
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(Array.isArray(btn_item)){
|
if(Array.isArray(btn_item)){
|
||||||
@ -46,8 +44,11 @@ export struct TitleTabContent {
|
|||||||
})
|
})
|
||||||
}.margin({ top: 1,left:1,bottom:1,right:1})
|
}.margin({ top: 1,left:1,bottom:1,right:1})
|
||||||
//功能组名
|
//功能组名
|
||||||
|
Row(){
|
||||||
GroupTextEventMenu({grpEvent:group_item})
|
GroupTextEventMenu({grpEvent:group_item})
|
||||||
}.height(this.mwInfo.mainWindowHeight*0.073)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Divider().vertical(true).strokeWidth(1).lineCap(LineCapStyle.Round).height('95%').backgroundColor(Color.Gray)
|
Divider().vertical(true).strokeWidth(1).lineCap(LineCapStyle.Round).height('95%').backgroundColor(Color.Gray)
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user