Bläddra i källkod

Merge branch 'master' of http://maven.jgiot.com:7012/huhao/HJ_openHarmony_wms

huhao@jgai.com 1 månad sedan
förälder
incheckning
390f4a4df6

+ 5 - 5
build-profile.json5

@@ -4,13 +4,13 @@
       {
         "name": "default",
         "material": {
-          "certpath": "C:/Users/67381/.ohos/config/openharmony/default_wms_68CIINnIbxiWeEXXMiK5xFz9TtRPOiq6KrQ7DAOP0_M=.cer",
-          "storePassword": "0000001A014D271C2E057EC5C6C964A27ACED759C3345583356596F342A87481E2B2AEF1BC5D6171A3F0",
+          "certpath": "C:/Users/cjb/.ohos/config/openharmony/default_HJ_openHarmony_wms_rQnzWoksJickD8RhCnzkUZTSF3iYKXeLwF00Sm7dv6A=.cer",
+          "storePassword": "0000001B6A9A1D67F230207CCC6D4DC1E6FC79E6F33AF532691BCD716FF4197BFB5C1C2222E1F08363BA64",
           "keyAlias": "debugKey",
-          "keyPassword": "0000001AFEC40F07F84FB29D3ADF38D87A72BDAA84973BDF7658623686A0E8460B63FB39FFE6161ECB0C",
-          "profile": "C:/Users/67381/.ohos/config/openharmony/default_wms_68CIINnIbxiWeEXXMiK5xFz9TtRPOiq6KrQ7DAOP0_M=.p7b",
+          "keyPassword": "0000001B6CF76A6E79831E0D2806322FFBC883E405FF7E8FBFBCFBFF7530C88AAD01B4C6799F194997688D",
+          "profile": "C:/Users/cjb/.ohos/config/openharmony/default_HJ_openHarmony_wms_rQnzWoksJickD8RhCnzkUZTSF3iYKXeLwF00Sm7dv6A=.p7b",
           "signAlg": "SHA256withECDSA",
-          "storeFile": "C:/Users/67381/.ohos/config/openharmony/default_wms_68CIINnIbxiWeEXXMiK5xFz9TtRPOiq6KrQ7DAOP0_M=.p12"
+          "storeFile": "C:/Users/cjb/.ohos/config/openharmony/default_HJ_openHarmony_wms_rQnzWoksJickD8RhCnzkUZTSF3iYKXeLwF00Sm7dv6A=.p12"
         }
       }
     ],

+ 20 - 0
entry/oh-package-lock.json5

@@ -0,0 +1,20 @@
+{
+  "lockfileVersion": 2,
+  "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
+  "specifiers": {
+    "@ohos/axios@2.2.1-rc.0": "@ohos/axios@2.2.1-rc.0",
+    "@mcui/mccharts@^1.0.2": "@mcui/mccharts@1.0.2"
+  },
+  "packages": {
+    "@ohos/axios@2.2.1-rc.0": {
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/axios/-/axios-2.2.1-rc.0.har",
+      "integrity": "sha512-owJh8oOd1i56vZGU7opjz8EwYVsiHtuFYCwTyYCLZYLyeCdn9+laWjDpNrCSDZktySyYCu9qmK9867XQ+8QVFg==",
+      "registryType": "ohpm"
+    },
+    "@mcui/mccharts@1.0.2": {
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@mcui/mccharts/-/mccharts-1.0.2.har",
+      "integrity": "sha512-44hGTwZcsfFnny7nT/zMpWKFqXbaVmdlDbyeJIOlJwbglS/S3ypqhBdzbpj3aJrcMSd5FLFO0FrZGntph9HSIw==",
+      "registryType": "ohpm"
+    }
+  }
+}

+ 1 - 1
entry/src/main/ets/entryability/EntryAbility.ts

@@ -40,7 +40,7 @@ export default class EntryAbility extends UIAbility {
       windowClass.setWindowLayoutFullScreen(true)
     })
 
-    windowStage.loadContent('pages/menu', (err) => {
+    windowStage.loadContent('pages/Menu', (err) => {
       if (err.code) {
         hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
         return;

+ 224 - 56
entry/src/main/ets/pages/EmptyBoxStorage.ets

@@ -5,7 +5,9 @@ import router from '@ohos.router';
 @Component
 struct emptyBoxStorage {
   @State materialBoxID: string = 'LX-00010';
-
+  @State isMaterialBoxExist: Boolean = true;
+  @State isPrinterOnline: Boolean = true;
+  @State isRfidOnline: Boolean = true;
   build() {
     Row() {
       Column() {
@@ -43,98 +45,264 @@ struct emptyBoxStorage {
               Text("生成编号")
                 .fontColor($r('app.color.FFFFFF'))
                 .fontSize($r('app.float.fontSize_15_2'))
+                .margin({top:'3%'})
               Row(){
                 Stack() {
-                  Image($r('app.media.identified_material_box'))
+                  Image(this.isMaterialBoxExist? $r('app.media.identified_material_box'):$r('app.media.not_identified_material_box'))
                     .width('100%')
                     .height('100%')
+                    .borderRadius($r('app.float.virtualSize_6_4'))
                     .objectFit(ImageFit.Contain)
-                  Text("lx-0010")
-                    .fontSize(16)
+                  Text("LX-00010")
+                    .fontSize($r('app.float.fontSize_19_2'))
                     .fontColor($r('app.color.FFFFFF'))
                     .position({
-                      x: '50%', // 水平位置
-                      y: '68%', // 垂直位置
-
+                      x: '38%', // 水平位置
+                      y: '80%', // 垂直位置
+                    })
+                  Text("已生成新编号")
+                    .fontSize($r('app.float.fontSize_6'))
+                    .fontColor($r('app.color.60FFFFFF'))
+                    .position({
+                      x: '45%', // 水平位置
+                      y: '87%', // 垂直位置
                     })
                 }
               }
-              .height('60%')
+              .margin({top:'3%'})
+              .height('75%')
               .width('100%')
-              Button() {
+              Button({type:ButtonType.Normal}) {
                 Row() {
                   Image($r('app.media.material_qr_code'))
-                    .width(20)
-                    .height(20)
+                    .width('15%')
+                    .height('45%')
                     .margin({ right: 8 })
-                    .fillColor('#0A84FF')
+                    .fillColor($r('app.color.0A84FF'))
                   Text("生成料箱编号")
-                    .fontSize(16)
-                    .fontColor('#0A84FF') // 图片中的蓝色
+                    .fontSize($r('app.float.fontSize_12'))
+                    .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
                 }
                 .justifyContent(FlexAlign.Center)
               }
-              .width('50%')
-              .height('10%')
+              .margin({top:'10%'})
+              .width('35%')
+              .height('6%')
               .backgroundColor($r('app.color.20FFFFFF'))
-              .borderRadius(8)
+              .borderRadius($r('app.float.virtualSize_6_4'))
               .onClick(() => {
                 // 按钮点击事件处理
               })
             }
-            .width('50%')
-
+            .height('100%')
+            .width('45%')
+            .justifyContent(FlexAlign.Start)
             Column(){
-              Text("打印条码:")
-              Row(){}.height('20%')
-              Button("打印")
-                .width('80%')
-              Path()
-                .width('100%')
-                .strokeWidth(1)
-                .stroke(Color.Black)
-                .commands('M0 0 L600 0')
-                .margin({top:'5%',bottom:'5%'})
-              Text("写入磁卡:")
-              Row(){}.height('25%')
-              Text("当前编码:无编码").height('10%')
-              Button("写入")
-                .width('80%')
+              Text("打印条码")
+                .fontColor($r('app.color.FFFFFF'))
+                .fontSize($r('app.float.fontSize_15_2'))
+                .margin({top:'3%'})
+              Column(){
+                Image(this.isPrinterOnline? $r('app.media.printer_online'):$r('app.media.printer_offline'))
+                  .width('100%')
+                  .height('40%')
+                  .borderRadius($r('app.float.virtualSize_6_4'))
+                  .objectFit(ImageFit.Contain)
+                //.margin({top:'3%'})
+                Button({type:ButtonType.Normal}) {
+                  Row() {
+                    Image($r('app.media.material_qr_code'))
+                      .width('15%')
+                      .height('50%')
+                      .margin({ right: 8 })
+                      .fillColor($r('app.color.0A84FF'))
+                    Text("打印编号")
+                      .fontSize($r('app.float.fontSize_12'))
+                      .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+                  }
+                  .justifyContent(FlexAlign.Center)
+                }
+                .margin({top:'6%'})
+                .width('35%')
+                .height('8%')
+                .backgroundColor($r('app.color.20FFFFFF'))
+                .borderRadius($r('app.float.virtualSize_6_4'))
+                .onClick(() => {
+                  // 按钮点击事件处理
+                })
+                Divider()
+                  .margin({top:'3%'})
+                  .vertical(false)
+                  .strokeWidth(1)
+                  .color($r('app.color.10FFFFFF'))
+                  .width('100%')
+                Text("写入磁卡")
+                  .fontColor($r('app.color.FFFFFF'))
+                  .fontSize($r('app.float.fontSize_15_2'))
+                  .margin({top:'3%'})
+                Image(this.isRfidOnline? $r('app.media.rfid_online'):$r('app.media.rfid_offline'))
+                  .width('100%')
+                  .height('40%')
+                  .margin({top:'1%'})
+                  .borderRadius($r('app.float.virtualSize_6_4'))
+                  .objectFit(ImageFit.Contain)
+              }
+             // .margin({top:'3%'})
+              .height('75%')
+              .width('100%')
+              .justifyContent(FlexAlign.Start)
+              Row(){
+                Text("当前编号:")
+                  .fontColor($r('app.color.FFFFFF'))
+                  .fontSize($r('app.float.fontSize_9_6'))
+                  .margin({top:'3%'})
+                Text("LX-00010")
+                  .fontColor($r('app.color.0A84FF'))
+                  .fontSize($r('app.float.fontSize_9_6'))
+                  .margin({top:'3%'})
+              }.height('5%')
+              .margin({top:'2%'})
+              Button({type:ButtonType.Normal}) {
+                Row() {
+                  Image($r('app.media.material_qr_code'))
+                    .width('15%')
+                    .height('45%')
+                    .margin({ right: 8 })
+                    .fillColor($r('app.color.0A84FF'))
+                  Text("写入磁卡")
+                    .fontSize($r('app.float.fontSize_12'))
+                    .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+                }
+                .justifyContent(FlexAlign.Center)
+              }
+              .margin({top:'3%'})
+              .width('35%')
+              .height('6%')
+              .backgroundColor($r('app.color.20FFFFFF'))
+              .borderRadius($r('app.float.virtualSize_6_4'))
+              .onClick(() => {
+                // 按钮点击事件处理
+              })
             }
-            .justifyContent(FlexAlign.SpaceEvenly)
-            .width('50%')
+            .justifyContent(FlexAlign.Start)
+            .width('45%')
+            .height('100%')
           }
           .width('60%')
-          .height('80%')
+          .height('85%')
+          .justifyContent(FlexAlign.SpaceAround)
           .backgroundColor($r('app.color.10FFFFFF'))
-          Row(){
+
+          Column(){
             Column(){
               Text("空箱入库")
+                .fontColor($r('app.color.FFFFFF'))
+                .fontSize($r('app.float.fontSize_15_2'))
+                .margin({top:'3%'})
               Column(){
-                Text('物料:0').textAlign(TextAlign.End).width('100%')
-                Row(){}.border({width:1}).width('90%').height('50%')
-                Text("料箱重量").textAlign(TextAlign.Start).width('100%')
-                Text("12.56kg").textAlign(TextAlign.Start).width('100%')
-                Text("料箱编号").textAlign(TextAlign.Start).width('100%')
-                Text("LX-0010").textAlign(TextAlign.Start).width('100%')
+                Stack() {
+                  Image($r('app.media.drawer_in_box')) // 替换为您的电梯图片资源
+                    .width('100%')
+                    .height('100%')
+                    .borderRadius($r('app.float.virtualSize_6_4'))
+                    .objectFit(ImageFit.Contain)
+                  // 文字信息层(左下角)
+                  Column() {
+                    Row(){
+                      Image($r('app.media.material_weight'))
+                        .width('5%')
+                        .height('30%')
+                        .fillColor($r('app.color.30D158'))
+                      Text("15Kg")
+                        .margin({left:10})
+                        .fontSize($r('app.float.fontSize_15_2'))
+                        .fontColor($r('app.color.30D158')) // 绿色文字
+                    }
+                    Row(){
+                      Image($r('app.media.material_rfid'))
+                        .width('5%')
+                        .height('30%')
+                        .fillColor($r('app.color.30D158'))
+
+                      Text("LX-00010")
+                        .margin({left:10})
+                        .fontSize($r('app.float.fontSize_15_2'))
+                        .fontColor($r('app.color.30D158')) // 绿色文字
+                    }
+                  }.height('19%').alignItems(HorizontalAlign.Start).justifyContent(FlexAlign.SpaceEvenly)
+                  .position({ x: '3%', y: '78%' })
+
+                  // 右上角物料信息
+                  Text("物料: 0")
+                    .fontSize(16)
+                    .fontColor(Color.White)
+                    .position({ x: '80%', y: '5%' })
+
+                  // 右侧纵向时间信息
+                  Column({ space: 12 }) {
+                    Text("12-12-12")
+                    Text("12:12-12")
+                    Text("12:12 12")
+                  }
+                  .position({ x: '85%', y: '30%' })
+                  .alignItems(HorizontalAlign.End)
+                }
+                .width('95%')
+                .height('100%') // 根据实际需求调整
               }
-              .height('65%')
-              .width('95%')
-              .border({width:1})
-              .justifyContent(FlexAlign.SpaceAround)
+              .height('75%')
+              .width('100%')
+              .margin({top:'2%'})
+              //.justifyContent(FlexAlign.SpaceAround)
               Row(){
-                Button("伸出").width('40%')
-                Button("缩回").width('40%')
+                Button({type:ButtonType.Normal}) {
+                    Text("伸出")
+                      .fontSize($r('app.float.fontSize_12'))
+                      .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+                }
+                .margin({top:'6%'})
+                .width('35%')
+                .height('8%')
+                .backgroundColor($r('app.color.20FFFFFF'))
+                .borderRadius($r('app.float.virtualSize_6_4'))
+                .onClick(() => {
+                  // 按钮点击事件处理
+                })
+                Button({type:ButtonType.Normal}) {
+                  Text("缩回")
+                    .fontSize($r('app.float.fontSize_12'))
+                    .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+                }
+                .margin({top:'6%'})
+                .width('35%')
+                .height('8%')
+                .backgroundColor($r('app.color.20FFFFFF'))
+                .borderRadius($r('app.float.virtualSize_6_4'))
+                .onClick(() => {
+                  // 按钮点击事件处理
+                })
               }.width('100%')
               .justifyContent(FlexAlign.SpaceAround)
-              Button("空箱入库").width('90%')
+              Button({type:ButtonType.Normal}) {
+                Text("空箱入库")
+                  .fontSize($r('app.float.fontSize_12'))
+                  .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+              }
+              .margin({top:'6%'})
+              .width('35%')
+              .height('8%')
+              .backgroundColor($r('app.color.20FFFFFF'))
+              .borderRadius($r('app.float.virtualSize_6_4'))
+              .onClick(() => {
+                // 按钮点击事件处理
+              })
             }
-            .width('90%')
-            .height('90%')
-            .justifyContent(FlexAlign.SpaceEvenly)
+            .width('100%')
+            .height('100%')
+            .justifyContent(FlexAlign.Start)
           }
-          .width('35%')
-          .height('80%')
+          .width('32%')
+          .height('85%')
           .backgroundColor($r('app.color.10FFFFFF'))
           .justifyContent(FlexAlign.Center)
         }

BIN
entry/src/main/resources/base/media/drawer_in_box.png


BIN
entry/src/main/resources/base/media/drawer_in_no_box.png


BIN
entry/src/main/resources/base/media/drawer_offline.png


BIN
entry/src/main/resources/base/media/drawer_out_box.png


BIN
entry/src/main/resources/base/media/drawer_out_no_box.png


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 6 - 0
entry/src/main/resources/base/media/material_rfid.svg


+ 5 - 0
entry/src/main/resources/base/media/material_weight.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path d="M18.378 20.972H5.623a1.617 1.617 0 0 1-1.61-1.763L4.988 8.5l.255-.146c.162-.091 1.72-.89 6.753-.89 5.032 0 6.59.799 6.752.89l.255.146.975 10.71c.043.448-.107.9-.412 1.236a1.6 1.6 0 0 1-1.188.527ZM6.052 9.235l-.919 10.078a.49.49 0 0 0 .49.536h12.755a.483.483 0 0 0 .485-.532l-.919-10.082c-.595-.207-2.3-.647-5.946-.647-3.647 0-5.35.44-5.946.647Zm13.291-3.16H4.657V3.591h1.125v1.36h12.436V3.59h1.125v2.484Z"/>
+  <path d="M11.438 5.513h1.125v2.512h-1.125V5.513ZM12 18.52a4.31 4.31 0 0 1-4.303-4.304A4.31 4.31 0 0 1 12 9.914a4.31 4.31 0 0 1 4.303 4.303A4.31 4.31 0 0 1 12 18.52Zm0-7.482a3.18 3.18 0 0 0-3.178 3.178A3.18 3.18 0 0 0 12 17.395a3.18 3.18 0 0 0 3.178-3.178A3.18 3.18 0 0 0 12 11.04Z"/>
+  <path d="m11.602 13.82 1.688-1.688.795.796-1.687 1.687-.796-.796Z"/>
+</svg>

BIN
entry/src/main/resources/base/media/printer_offline.png


BIN
entry/src/main/resources/base/media/printer_online.png


BIN
entry/src/main/resources/base/media/rfid_offline.png


BIN
entry/src/main/resources/base/media/rfid_online.png


+ 10 - 1
oh-package-lock.json5

@@ -2,7 +2,8 @@
   "lockfileVersion": 2,
   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
   "specifiers": {
-    "@ohos/hypium@1.0.13": "@ohos/hypium@1.0.13"
+    "@ohos/hypium@1.0.13": "@ohos/hypium@1.0.13",
+    "@ohos/mqtt@^2.0.6": "@ohos/mqtt@2.0.21"
   },
   "packages": {
     "@ohos/hypium@1.0.13": {
@@ -10,6 +11,14 @@
       "integrity": "sha512-d0+XvDeAYk5Vgl6JQ8Q1G+NPmTyJI8qgZ1PwPfcUbx/dfyKVAAv9lz1XtVNhYypyWEKqAzu8zMAC9GuHo2Y53Q==",
       "registryType": "ohpm",
       "shasum": "88d8dda420097efb98d770bf59616faef4682f06"
+    },
+    "@ohos/mqtt@2.0.21": {
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/mqtt/-/mqtt-2.0.21.har",
+      "integrity": "sha512-Z04WQ+Z5OTL4jnDFWFwBUNgjvU42+g+z3kmiuq3/D9feMsQt0FMxaCwzyo/dl2TaDixbJ8eBh5aQTgmt+1pztw==",
+      "dependencies": {
+        "libmqttasync.so": "file:./src/main/cpp/types/libmqttasync"
+      },
+      "registryType": "ohpm"
     }
   }
 }