|
@@ -1,9 +1,12 @@
|
|
|
+import {componentLocation} from '../model/ComponentLocation'
|
|
|
import { TitleStateComp } from '../common/component/TitleStateComp';
|
|
|
import { BottomOperateComp } from '../common/component/BottomOperateComp';
|
|
|
import router from '@ohos.router'
|
|
|
import { TaskComp } from '../common/component/TaskComp'
|
|
|
import { Warehousing}from '../common/component/Warehousing'
|
|
|
import { SmartFactoryCard }from '../common/component/SmartFactoryCard'
|
|
|
+import CommonConstants from '../common/constants/CommonConstants'
|
|
|
+import UniversalCard from '../model/UniversalCard'
|
|
|
@CustomDialog
|
|
|
struct login {
|
|
|
@Link textValue: string
|
|
@@ -59,103 +62,65 @@ struct login {
|
|
|
}
|
|
|
@CustomDialog
|
|
|
struct confirmPopup {
|
|
|
- @Link longPressDelete:number
|
|
|
+ @Link cardServices:UniversalCard[]
|
|
|
controller: CustomDialogController
|
|
|
cancel: () => void
|
|
|
confirm: () => void
|
|
|
+ @Link x: number
|
|
|
+ @Link y: number
|
|
|
+ @Link index:number
|
|
|
build(){
|
|
|
Column(){
|
|
|
Column(){
|
|
|
- Text('卡片服务')
|
|
|
- .margin(px2vp(5))
|
|
|
- .width('100%')
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontSize(px2vp(38))
|
|
|
- .height('50%')
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .onClick(()=>{
|
|
|
- this.controller.close()
|
|
|
- this.longPressDelete=0
|
|
|
- })
|
|
|
- Divider().width('80%')
|
|
|
- Text('删除卡片')
|
|
|
- .height('50%')
|
|
|
- .margin(px2vp(5))
|
|
|
- .width('100%')
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontSize(px2vp(38))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .onClick(()=>{
|
|
|
- this.longPressDelete=1
|
|
|
- this.controller.close()
|
|
|
- })
|
|
|
+ Row(){
|
|
|
+ Image($r('app.media.card'))
|
|
|
+ .width(px2vp(50))
|
|
|
+ .height(px2vp(50))
|
|
|
+ Text('卡片服务')
|
|
|
+ .padding({left:10})
|
|
|
+ .margin(px2vp(5))
|
|
|
+ .width('100%')
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontSize(px2vp(38))
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
+ .onClick(()=>{
|
|
|
+ this.controller.close()
|
|
|
+ this.cardServices[this.index]= {
|
|
|
+ id:this.cardServices[this.index].id,
|
|
|
+ userId:this.cardServices[this.index].userId,
|
|
|
+ cardType:this.cardServices[this.index].cardType,
|
|
|
+ cardStatus:1,
|
|
|
+ cardSort:this.cardServices[this.index].cardSort,
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height('80%')
|
|
|
+ .padding({left:10})
|
|
|
+ .borderRadius(px2vp(15))
|
|
|
+ .backgroundColor($r('app.color.general_font_white_color'))
|
|
|
+ Divider()
|
|
|
+ .width('80%')
|
|
|
|
|
|
}
|
|
|
+ .margin({bottom:5})
|
|
|
.borderRadius(px2vp(15))
|
|
|
- .width('100%')
|
|
|
- .height('40%')
|
|
|
- .backgroundColor($r('app.color.process_divider_white_color'))
|
|
|
- Image($r('app.media.gongxu'))
|
|
|
- .width(px2vp(220))
|
|
|
- .height(px2vp(220))
|
|
|
- .borderRadius(15)
|
|
|
- }
|
|
|
- .alignItems(HorizontalAlign.Start)
|
|
|
- .width('10%')
|
|
|
- .height('30%')
|
|
|
+ .height('20%')
|
|
|
+ .width('120%')
|
|
|
+ .backgroundColor($r('app.color.general_font_white_color'))
|
|
|
|
|
|
- }
|
|
|
-}
|
|
|
-@CustomDialog
|
|
|
-struct smartWarehouseCard {
|
|
|
- @Link martWarehouseCardDelete:number
|
|
|
- controller: CustomDialogController
|
|
|
- cancel: () => void
|
|
|
- confirm: () => void
|
|
|
- build(){
|
|
|
- Column(){
|
|
|
- Column(){
|
|
|
- Text('卡片服务')
|
|
|
- .margin(px2vp(5))
|
|
|
- .width('100%')
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontSize(px2vp(38))
|
|
|
- .height('50%')
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .onClick(()=>{
|
|
|
- this.controller.close()
|
|
|
- this.martWarehouseCardDelete=0
|
|
|
- })
|
|
|
- Divider().width('80%')
|
|
|
- Text('删除卡片')
|
|
|
- .height('50%')
|
|
|
- .margin(px2vp(5))
|
|
|
- .width('100%')
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontSize(px2vp(38))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .onClick(()=>{
|
|
|
- this.martWarehouseCardDelete=1
|
|
|
- this.controller.close()
|
|
|
- })
|
|
|
|
|
|
- }
|
|
|
- .borderRadius(px2vp(15))
|
|
|
- .width('100%')
|
|
|
- .height('40%')
|
|
|
- .backgroundColor($r('app.color.process_divider_white_color'))
|
|
|
- Image($r('app.media.storage'))
|
|
|
+ Image(this.index===1?$r("app.media.processImages"):$r('app.media.storage'))
|
|
|
.width(px2vp(220))
|
|
|
.height(px2vp(220))
|
|
|
.borderRadius(15)
|
|
|
}
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
- .width('10%')
|
|
|
- .height('30%')
|
|
|
-
|
|
|
+ .width('350px')
|
|
|
+ .height('600px')
|
|
|
+ .offset({x:this.x+20+'px', y:this.y-340+'px'})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
@CustomDialog
|
|
|
struct shutdown {
|
|
|
@Link shutdownTransparency:number
|
|
@@ -216,11 +181,14 @@ struct shutdown {
|
|
|
@Entry
|
|
|
@Component
|
|
|
struct Index {
|
|
|
+ @State index:number=0
|
|
|
+ @State x:number=0
|
|
|
+ @State y:number=0
|
|
|
+ @State cardServices:UniversalCard[] = CommonConstants.Card_DATA
|
|
|
@State SmartFactoryCardDelete:number=0
|
|
|
@State SmartFactoryDelete:number=0
|
|
|
@State SmartFactoryCarLongPressDelete:number=0
|
|
|
@State storageCardDelete:number=0
|
|
|
- @State martWarehouseCardDelete:number=0
|
|
|
@State smartWarehouseCard:number=0
|
|
|
@State avatarFrame:boolean=false
|
|
|
@State deleteConfirmation:number=0
|
|
@@ -253,26 +221,16 @@ struct Index {
|
|
|
})
|
|
|
confirmPopupDialogController: CustomDialogController = new CustomDialogController({
|
|
|
builder: confirmPopup({
|
|
|
- longPressDelete:this.longPressDelete,
|
|
|
+ x:this.x,
|
|
|
+ y:this.y,
|
|
|
+ index:this.index,
|
|
|
+ cardServices:this.cardServices
|
|
|
}
|
|
|
),
|
|
|
- alignment: DialogAlignment.Bottom,
|
|
|
- autoCancel:true,
|
|
|
- customStyle:true,
|
|
|
- offset: { dx: -95, dy: -40 }
|
|
|
- })
|
|
|
- smartWarehouseCardDialogController: CustomDialogController = new CustomDialogController({
|
|
|
- builder:smartWarehouseCard({
|
|
|
- martWarehouseCardDelete:this.martWarehouseCardDelete
|
|
|
- }
|
|
|
- ),
|
|
|
- alignment: DialogAlignment.Bottom,
|
|
|
+ alignment: DialogAlignment.TopStart,
|
|
|
autoCancel:true,
|
|
|
customStyle:true,
|
|
|
- offset: { dx: -320, dy: -40 }
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
build() {
|
|
|
Stack(){
|
|
|
Row() {
|
|
@@ -284,7 +242,7 @@ struct Index {
|
|
|
Row() {
|
|
|
|
|
|
Flex({ wrap: FlexWrap.Wrap }) {
|
|
|
- if (this.longPressDelete===0){
|
|
|
+ if (this.cardServices[1].cardStatus===1){
|
|
|
Stack(){
|
|
|
Column(){
|
|
|
TaskComp({isHomePage: this.isHomePage})
|
|
@@ -329,7 +287,13 @@ struct Index {
|
|
|
.backgroundColor( $r('app.color.robot_set_card_blue'))
|
|
|
.onClick(()=>{
|
|
|
this.deleteConfirmation=0
|
|
|
- this.longPressDelete=1
|
|
|
+ this.cardServices[1]= {
|
|
|
+ id:this.cardServices[1].id,
|
|
|
+ userId:this.cardServices[1].userId,
|
|
|
+ cardType:this.cardServices[1].cardType,
|
|
|
+ cardStatus:2,
|
|
|
+ cardSort:this.cardServices[1].cardSort,
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
.justifyContent(FlexAlign.Center)
|
|
@@ -340,7 +304,7 @@ struct Index {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (this.martWarehouseCardDelete===0){
|
|
|
+ if (this.cardServices[0].cardStatus===1){
|
|
|
Stack(){
|
|
|
Column(){
|
|
|
Warehousing()
|
|
@@ -361,10 +325,10 @@ struct Index {
|
|
|
.gesture(
|
|
|
LongPressGesture({ repeat: false })
|
|
|
.onActionEnd(() => {
|
|
|
- this. smartWarehouseCard=1
|
|
|
+ this.smartWarehouseCard=1
|
|
|
})
|
|
|
)
|
|
|
- if (this. smartWarehouseCard===1){
|
|
|
+ if (this.smartWarehouseCard===1){
|
|
|
Row(){
|
|
|
Text('取消')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
@@ -391,7 +355,13 @@ struct Index {
|
|
|
.backgroundColor( $r('app.color.robot_set_card_blue'))
|
|
|
.onClick(()=>{
|
|
|
this.smartWarehouseCard=0
|
|
|
- this.martWarehouseCardDelete=1
|
|
|
+ this.cardServices[0]= {
|
|
|
+ id:this.cardServices[0].id,
|
|
|
+ userId:this.cardServices[0].userId,
|
|
|
+ cardType:this.cardServices[0].cardType,
|
|
|
+ cardStatus:2,
|
|
|
+ cardSort:this.cardServices[0].cardSort,
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
.justifyContent(FlexAlign.Center)
|
|
@@ -474,7 +444,7 @@ struct Index {
|
|
|
Image($r("app.media.shezhi"))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .borderRadius(15)
|
|
|
+ .margin({top:5})
|
|
|
Text('设置')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -496,7 +466,7 @@ struct Index {
|
|
|
Image($r("app.media.storage"))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .borderRadius(15)
|
|
|
+ .margin({top:5})
|
|
|
Text('智能仓储')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -508,7 +478,9 @@ struct Index {
|
|
|
.height('90%')
|
|
|
.borderRadius(15)
|
|
|
.backgroundColor('#4d000000')
|
|
|
+ .id('smartWarehousing')
|
|
|
.onClick(() => {
|
|
|
+
|
|
|
router.pushUrl({
|
|
|
url: 'pages/Storage'
|
|
|
})
|
|
@@ -516,14 +488,27 @@ struct Index {
|
|
|
.gesture(
|
|
|
LongPressGesture({ repeat: false })
|
|
|
.onActionEnd(() => {
|
|
|
- this.smartWarehouseCardDialogController.open()
|
|
|
+ let rect = componentLocation.getComponentRect('smartWarehousing')
|
|
|
+ let touchPoint: TouchObject = {
|
|
|
+ id: 1,
|
|
|
+ x: rect.left, // 组件中心点x坐标
|
|
|
+ y:rect.bottom, // 组件中心点y坐标
|
|
|
+ type: TouchType.Down,
|
|
|
+ screenX: rect.left + (rect.right - rect.left) / 2, // 组件中心点x坐标
|
|
|
+ screenY: rect.left + (rect.right - rect.left) / 2, // 组件中心点y坐标
|
|
|
+ }
|
|
|
+ this.x=touchPoint.x
|
|
|
+ this.y=touchPoint.y
|
|
|
+ this.index=0
|
|
|
+ this.confirmPopupDialogController.open()
|
|
|
+
|
|
|
})
|
|
|
)
|
|
|
Column({ space: 10 }) {
|
|
|
Image($r('app.media.jiqiren'))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .borderRadius(15)
|
|
|
+ .margin({top:5})
|
|
|
Text('机器人调试')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -542,10 +527,10 @@ struct Index {
|
|
|
})
|
|
|
|
|
|
Column({ space: 10 }) {
|
|
|
- Image($r('app.media.gongxu'))
|
|
|
+ Image($r("app.media.processImages"))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .borderRadius(15)
|
|
|
+ .margin({top:5})
|
|
|
Text('工序操作')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -557,6 +542,7 @@ struct Index {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.height('90%')
|
|
|
.borderRadius(15)
|
|
|
+ .id('workingProcedure')
|
|
|
.backgroundColor('#4d000000')
|
|
|
.onClick(() => {
|
|
|
router.pushUrl({
|
|
@@ -566,7 +552,19 @@ struct Index {
|
|
|
.gesture(
|
|
|
LongPressGesture({ repeat: false })
|
|
|
.onActionEnd(() => {
|
|
|
- this.confirmPopupDialogController.open()
|
|
|
+ let rect = componentLocation.getComponentRect('workingProcedure')
|
|
|
+ let touchPoint: TouchObject = {
|
|
|
+ id: 1,
|
|
|
+ x: rect.left, // 组件中心点x坐标
|
|
|
+ y:rect.bottom, // 组件中心点y坐标
|
|
|
+ type: TouchType.Down,
|
|
|
+ screenX: rect.left + (rect.right - rect.left) / 2, // 组件中心点x坐标
|
|
|
+ screenY: rect.left + (rect.right - rect.left) / 2, // 组件中心点y坐标
|
|
|
+ }
|
|
|
+ this.x=touchPoint.x
|
|
|
+ this.y=touchPoint.y
|
|
|
+ this.index=1
|
|
|
+ this.confirmPopupDialogController.open()
|
|
|
})
|
|
|
)
|
|
|
|
|
@@ -574,7 +572,7 @@ struct Index {
|
|
|
Image($r('app.media.baobiao'))
|
|
|
.width('60%')
|
|
|
.height('60%')
|
|
|
- .borderRadius(15)
|
|
|
+ .margin({top:5})
|
|
|
Text('统计报表')
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -590,8 +588,9 @@ struct Index {
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('16%')
|
|
|
- BottomOperateComp({ isHomePage: this.isHomePage,/*
|
|
|
- SmartFactoryCardDelete:this.SmartFactoryCardDelete*/})
|
|
|
+ BottomOperateComp({ isHomePage: this.isHomePage,
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
.backgroundImage($r('app.media.BG'))
|
|
|
.backgroundImageSize({ width: '100%', height: '100%' })
|