|
@@ -12,41 +12,38 @@ import NoticeInfo from '../../model/NoticeInfo'
|
|
|
* */
|
|
|
@Component
|
|
|
export struct TitleStateComp {
|
|
|
- @State shutdownTransparency:number=0
|
|
|
- @State bugNum:number | undefined=0
|
|
|
- @State completeNum:number | undefined=0
|
|
|
- @State kittingNum:number | undefined=0
|
|
|
- @State planNum:number | undefined=0
|
|
|
+ @State shutdownTransparency: number = 0
|
|
|
+ @State bugNum: number | undefined = 0
|
|
|
+ @State completeNum: number | undefined = 0
|
|
|
+ @State kittingNum: number | undefined = 0
|
|
|
+ @State planNum: number | undefined = 0
|
|
|
private isHomePage?: boolean = false
|
|
|
- @State isClick:boolean = false
|
|
|
-
|
|
|
- RfidController:CustomDialogController = new CustomDialogController({
|
|
|
+ @State isClick: boolean = false
|
|
|
+ RfidController: CustomDialogController = new CustomDialogController({
|
|
|
builder: RfidAllocation({}),
|
|
|
alignment: DialogAlignment.Center,
|
|
|
- customStyle:true,
|
|
|
- cancel:()=>{
|
|
|
- this.isClick =! this.isClick
|
|
|
+ customStyle: true,
|
|
|
+ cancel: () => {
|
|
|
+ this.isClick = !this.isClick
|
|
|
}
|
|
|
})
|
|
|
controller: TextClockController = new TextClockController()
|
|
|
-
|
|
|
AvatarController: CustomDialogController = new CustomDialogController({
|
|
|
builder: AvatarClick({}),
|
|
|
alignment: DialogAlignment.TopEnd,
|
|
|
- customStyle:true,
|
|
|
+ customStyle: true,
|
|
|
offset: { dx: 0, dy: -25 },
|
|
|
- cancel:()=>{
|
|
|
- this.isClick =! this.isClick
|
|
|
+ cancel: () => {
|
|
|
+ this.isClick = !this.isClick
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
// 消息弹窗控制器
|
|
|
- noticeDialogController: CustomDialogController= new CustomDialogController({
|
|
|
+ noticeDialogController: CustomDialogController = new CustomDialogController({
|
|
|
builder: NoticeDialog({}),
|
|
|
alignment: DialogAlignment.Center,
|
|
|
- customStyle:true,
|
|
|
- cancel:()=>{
|
|
|
- this.isClick =! this.isClick
|
|
|
+ customStyle: true,
|
|
|
+ cancel: () => {
|
|
|
+ this.isClick = !this.isClick
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -85,7 +82,7 @@ export struct TitleStateComp {
|
|
|
.height('90%')
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
- .padding({ left:px2vp(24)})
|
|
|
+ .padding({ left: px2vp(24) })
|
|
|
|
|
|
Column() {
|
|
|
Text(TimeUtil.getCurrentDate())
|
|
@@ -103,21 +100,21 @@ export struct TitleStateComp {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
Row() {
|
|
|
- Row(){
|
|
|
+ Row() {
|
|
|
Image($r("app.media.hongDa_black"))
|
|
|
.height(px2vp(48))
|
|
|
- .width(px2vp(48))
|
|
|
- // .backgroundColor(Color.Green)
|
|
|
+ .width(px2vp(48))// .backgroundColor(Color.Green)
|
|
|
.onClick(() => {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/SmartFactory'
|
|
|
+ url: 'pages/SmartFactory'
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
.height('100%')
|
|
|
.width('7.2%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
- Row(){
|
|
|
+
|
|
|
+ Row() {
|
|
|
Image($r('app.media.notice'))
|
|
|
.height(px2vp(48))
|
|
|
.width(px2vp(48))
|
|
@@ -125,13 +122,14 @@ export struct TitleStateComp {
|
|
|
.height('100%')
|
|
|
.width('7.2%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
// router.pushUrl({
|
|
|
// // url:"pages/OutboundStation"
|
|
|
// })
|
|
|
this.noticeDialogController.open()
|
|
|
})
|
|
|
- Row(){
|
|
|
+
|
|
|
+ Row() {
|
|
|
Image($r('app.media.box_edit'))
|
|
|
.height(px2vp(48))
|
|
|
.width(px2vp(48))
|
|
@@ -139,14 +137,15 @@ export struct TitleStateComp {
|
|
|
.height('100%')
|
|
|
.width('7.2%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
router.pushUrl({
|
|
|
- // url:'pages/Storage'
|
|
|
- url:'pages/RfidAllocation'
|
|
|
+ // url:'pages/Storage'
|
|
|
+ url: 'pages/RfidAllocation'
|
|
|
})
|
|
|
})
|
|
|
- Row({space: 2}) {
|
|
|
- Column(){
|
|
|
+
|
|
|
+ Row({ space: 2 }) {
|
|
|
+ Column() {
|
|
|
Text(CommonConstants.USER_NAME)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
@@ -154,11 +153,11 @@ export struct TitleStateComp {
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.width('95%')
|
|
|
.maxLines(1)
|
|
|
- Progress({value:this.completeNum!, total:this.planNum!, type: ProgressType.Linear})
|
|
|
+ Progress({ value: this.completeNum!, total: this.planNum!, type: ProgressType.Linear })
|
|
|
.width('95%')
|
|
|
.backgroundColor($r('app.color.grey_100'))
|
|
|
- .style({strokeWidth:5})
|
|
|
- Text('任务进度:'+ ((this.completeNum!) / (this.planNum!)) * 100 + '%')
|
|
|
+ .style({ strokeWidth: 5 })
|
|
|
+ Text('任务进度:' + ((this.completeNum!) / (this.planNum!)) * 100 + '%')
|
|
|
.fontSize($r('app.float.fontSize_14'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.card_font_default_opacity'))
|
|
@@ -174,7 +173,7 @@ export struct TitleStateComp {
|
|
|
.width(px2vp(48))
|
|
|
.height(px2vp(48))
|
|
|
.borderRadius(px2vp(100))
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.AvatarController.open()
|
|
|
})
|
|
|
}
|
|
@@ -184,7 +183,7 @@ export struct TitleStateComp {
|
|
|
.height('90%')
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
.justifyContent(FlexAlign.SpaceEvenly)
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.AvatarController.open()
|
|
|
})
|
|
|
}
|
|
@@ -202,10 +201,10 @@ export struct TitleStateComp {
|
|
|
.height('8%')
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//登录退出
|
|
|
@CustomDialog
|
|
|
struct login {
|
|
|
-
|
|
|
@Link textValue: string
|
|
|
@Link inputValue: string
|
|
|
controller: CustomDialogController
|
|
@@ -223,7 +222,7 @@ struct login {
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.width('100%')
|
|
|
.height('30%')
|
|
|
- Row({space:10}){
|
|
|
+ Row({ space: 10 }) {
|
|
|
Text('取消')
|
|
|
.width('40%')
|
|
|
.borderRadius(21)
|
|
@@ -231,7 +230,7 @@ struct login {
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.backgroundColor('#0f000000')
|
|
|
.fontColor('#0A59F7')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.controller.close()
|
|
|
})
|
|
|
Text('确认')
|
|
@@ -241,11 +240,11 @@ struct login {
|
|
|
.backgroundColor('#0A59F7')
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.fontColor('#ffff')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.controller.close()
|
|
|
CommonConstants.LOGIN_OUT = true
|
|
|
- router.pushUrl({
|
|
|
- url:'pages/LoginPage'
|
|
|
+ router.replaceUrl({
|
|
|
+ url: 'pages/LoginPage'
|
|
|
})
|
|
|
|
|
|
})
|
|
@@ -254,7 +253,6 @@ struct login {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.height('30%')
|
|
|
|
|
|
-
|
|
|
}.width('25%')
|
|
|
.height('20%')
|
|
|
.borderRadius(15)
|
|
@@ -265,43 +263,44 @@ struct login {
|
|
|
//头像点击弹窗
|
|
|
@CustomDialog
|
|
|
struct AvatarClick {
|
|
|
- @State shutdownTransparency:number=0
|
|
|
- private cardType:number=0
|
|
|
- @State cardSorting:number=0
|
|
|
- @State cardServices: UniversalCard[]=[{}]
|
|
|
- @State x:number=0
|
|
|
- @State y:number=0
|
|
|
+ @State shutdownTransparency: number = 0
|
|
|
+ private cardType: number = 0
|
|
|
+ @State cardSorting: number = 0
|
|
|
+ @State cardServices: UniversalCard[] = [{}]
|
|
|
+ @State x: number = 0
|
|
|
+ @State y: number = 0
|
|
|
@State textValue: string = ''
|
|
|
@State inputValue: string = ''
|
|
|
- @State avatarFrame:boolean=false
|
|
|
+ @State avatarFrame: boolean = false
|
|
|
loginDialogController: CustomDialogController = new CustomDialogController({
|
|
|
- builder:login({
|
|
|
+ builder: login({
|
|
|
textValue: $textValue,
|
|
|
inputValue: $inputValue,
|
|
|
}),
|
|
|
alignment: DialogAlignment.Center,
|
|
|
- autoCancel:false,
|
|
|
- customStyle:true
|
|
|
+ autoCancel: false,
|
|
|
+ customStyle: true
|
|
|
})
|
|
|
shutdownDialogController: CustomDialogController = new CustomDialogController({
|
|
|
- builder:shutdown({
|
|
|
+ builder: shutdown({
|
|
|
textValue: $textValue,
|
|
|
inputValue: $inputValue,
|
|
|
- shutdownTransparency:this.shutdownTransparency
|
|
|
+ shutdownTransparency: this.shutdownTransparency
|
|
|
}),
|
|
|
alignment: DialogAlignment.Center,
|
|
|
- autoCancel:false,
|
|
|
- customStyle:true
|
|
|
+ autoCancel: false,
|
|
|
+ customStyle: true
|
|
|
})
|
|
|
controller: CustomDialogController
|
|
|
+
|
|
|
build() {
|
|
|
- Column(){
|
|
|
+ Column() {
|
|
|
Text('个人设置')
|
|
|
.height('33%')
|
|
|
.fontSize(px2vp(32))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor('#e6000000')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
router.pushUrl({
|
|
|
url: 'pages/SetPage'
|
|
|
})
|
|
@@ -312,7 +311,7 @@ struct AvatarClick {
|
|
|
.fontSize(px2vp(32))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor('#e6000000')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.loginDialogController.open()
|
|
|
this.controller.close()
|
|
|
})
|
|
@@ -322,52 +321,56 @@ struct AvatarClick {
|
|
|
.fontSize(px2vp(32))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor('#e6000000')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.controller.close()
|
|
|
- this.shutdownTransparency=1
|
|
|
+ this.shutdownTransparency = 1
|
|
|
this.shutdownDialogController.open()
|
|
|
- this.avatarFrame=!this.avatarFrame
|
|
|
+ this.avatarFrame = !this.avatarFrame
|
|
|
})
|
|
|
|
|
|
- }.width('15%')
|
|
|
+ }
|
|
|
+ .width('15%')
|
|
|
.height('25%')
|
|
|
.backgroundColor('#ffff')
|
|
|
- .margin({top:'4%',right:'1%'})
|
|
|
+ .margin({ top: '4%', right: '1%' })
|
|
|
.borderRadius(21)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//开关重启
|
|
|
@CustomDialog
|
|
|
struct shutdown {
|
|
|
- @Link shutdownTransparency:number
|
|
|
+ @Link shutdownTransparency: number
|
|
|
@Link textValue: string
|
|
|
@Link inputValue: string
|
|
|
controller: CustomDialogController
|
|
|
+
|
|
|
build() {
|
|
|
Column() {
|
|
|
- Row(){
|
|
|
+ Row() {
|
|
|
Image($r('app.media.restart'))
|
|
|
.width(px2vp(107))
|
|
|
.height(px2vp(107))
|
|
|
- .onClick(()=>{
|
|
|
- this.shutdownTransparency=0
|
|
|
+ .onClick(() => {
|
|
|
+ this.shutdownTransparency = 0
|
|
|
this.controller.close()
|
|
|
})
|
|
|
Blank()
|
|
|
Image($r('app.media.shutdown'))
|
|
|
.width(px2vp(107))
|
|
|
.height(px2vp(107))
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
let pro = new process.ProcessManager();
|
|
|
pro.exit(0);
|
|
|
- this.shutdownTransparency=0
|
|
|
+ this.shutdownTransparency = 0
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
}.width('30%')
|
|
|
.height('20%')
|
|
|
- Row(){
|
|
|
+
|
|
|
+ Row() {
|
|
|
Text('重启')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontSize(px2vp(27))
|
|
@@ -393,7 +396,8 @@ struct shutdown {
|
|
|
|
|
|
}.width('30%')
|
|
|
.height('20%')
|
|
|
- }.width('100%')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
.height('100%')
|
|
|
.borderRadius(15)
|
|
|
.backgroundColor('#cc000000')
|
|
@@ -408,8 +412,9 @@ struct shutdown {
|
|
|
struct NoticeDialog {
|
|
|
controller: CustomDialogController
|
|
|
Notices: NoticeInfo[] = []
|
|
|
+
|
|
|
build() {
|
|
|
- Column({space: 10}) {
|
|
|
+ Column({ space: 10 }) {
|
|
|
Row() {
|
|
|
Text('通知')
|
|
|
.fontSize($r('app.float.fontSize_38'))
|
|
@@ -417,11 +422,12 @@ struct NoticeDialog {
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.general_font_opacity'))
|
|
|
}
|
|
|
- Row(){
|
|
|
- List(){
|
|
|
- ForEach(this.Notices, (item:NoticeInfo) => {
|
|
|
- ListItem(){
|
|
|
- Row(){
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ List() {
|
|
|
+ ForEach(this.Notices, (item: NoticeInfo) => {
|
|
|
+ ListItem() {
|
|
|
+ Row() {
|
|
|
Text(item.Notice)
|
|
|
.fontSize($r('app.float.fontSize_38'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|