Browse Source

初始化。

jiaxiaoqiang 11 months ago
commit
7c46eb9bcf
100 changed files with 14972 additions and 0 deletions
  1. 11 0
      .gitignore
  2. 10 0
      AppScope/app.json5
  3. 8 0
      AppScope/resources/base/element/string.json
  4. BIN
      AppScope/resources/base/media/app_icon.png
  5. 49 0
      build-profile.json5
  6. 6 0
      entry/.gitignore
  7. 31 0
      entry/build-profile.json5
  8. 6 0
      entry/hvigorfile.ts
  9. 18 0
      entry/obfuscation-rules.txt
  10. 10 0
      entry/oh-package.json5
  11. 10 0
      entry/src/main/ets/Application/MyAbilityStage.ts
  12. 84 0
      entry/src/main/ets/common/DeviceDialog.ets
  13. 98 0
      entry/src/main/ets/common/bean/Camera.ets
  14. 9 0
      entry/src/main/ets/common/bean/Log.ets
  15. 22 0
      entry/src/main/ets/common/bean/MediaBean.ets
  16. 183 0
      entry/src/main/ets/common/bean/MediaHelper.ets
  17. 10 0
      entry/src/main/ets/common/bean/StringUtils.ets
  18. 137 0
      entry/src/main/ets/common/component/AddAndSubtractComp.ets
  19. 318 0
      entry/src/main/ets/common/component/BottomOperateComp.ets
  20. 148 0
      entry/src/main/ets/common/component/OrderStatisticsComp.ets
  21. 422 0
      entry/src/main/ets/common/component/OutboundList.ets
  22. 184 0
      entry/src/main/ets/common/component/OutboundTask.ets
  23. 72 0
      entry/src/main/ets/common/component/ProcessTitleComp.ets
  24. 74 0
      entry/src/main/ets/common/component/RobotLogComp.ets
  25. 94 0
      entry/src/main/ets/common/component/RobotPreviewComp.ets
  26. 63 0
      entry/src/main/ets/common/component/SmartFactoryCard.ets
  27. 126 0
      entry/src/main/ets/common/component/StorageSpaceGrid.ets
  28. 256 0
      entry/src/main/ets/common/component/TaskComp.ets
  29. 453 0
      entry/src/main/ets/common/component/TitleStateComp.ets
  30. 267 0
      entry/src/main/ets/common/component/Warehousing.ets
  31. 763 0
      entry/src/main/ets/common/component/Workbin.ets
  32. 99 0
      entry/src/main/ets/common/constants/CommonConstants.ets
  33. 53 0
      entry/src/main/ets/common/util/PreferencesUtil.ts
  34. 221 0
      entry/src/main/ets/common/util/RobotControlUtil.js
  35. 24 0
      entry/src/main/ets/common/util/TimeUtil.ets
  36. 68 0
      entry/src/main/ets/common/util/request/EquipmentRequest.ets
  37. 85 0
      entry/src/main/ets/common/util/request/Request.ets
  38. 37 0
      entry/src/main/ets/common/util/request/RequestInstance.ets
  39. 63 0
      entry/src/main/ets/common/util/request/StorageRequest.ets
  40. 489 0
      entry/src/main/ets/common/util/request/StorageRequestInstance.ets
  41. 107 0
      entry/src/main/ets/common/util/request/helps.ets
  42. 121 0
      entry/src/main/ets/entryability/EntryAbility.ets
  43. 19 0
      entry/src/main/ets/model/AssistantSet.ets
  44. 27 0
      entry/src/main/ets/model/CallList.ets
  45. 48 0
      entry/src/main/ets/model/ComponentLocation.ets
  46. 29 0
      entry/src/main/ets/model/DetailsList.ets
  47. 8 0
      entry/src/main/ets/model/DictInfo.ets
  48. 8 0
      entry/src/main/ets/model/DictValue.ets
  49. 104 0
      entry/src/main/ets/model/KvStoreModel.ets
  50. 19 0
      entry/src/main/ets/model/MaterialInfo.ets
  51. 65 0
      entry/src/main/ets/model/MaterialInformation.ets
  52. 13 0
      entry/src/main/ets/model/NoticeInfo.ets
  53. 83 0
      entry/src/main/ets/model/NumberDataSource.ets
  54. 52 0
      entry/src/main/ets/model/OrderInfo.ets
  55. 58 0
      entry/src/main/ets/model/OutboundDats.ets
  56. 262 0
      entry/src/main/ets/model/RemoteDeviceModel.ets
  57. 36 0
      entry/src/main/ets/model/RobotInfo.ets
  58. 15 0
      entry/src/main/ets/model/RobotSelfCheck.ets
  59. 5 0
      entry/src/main/ets/model/SpaceStateList.ets
  60. 15 0
      entry/src/main/ets/model/StorageInfo.ets
  61. 27 0
      entry/src/main/ets/model/StorageSpace.ets
  62. 30 0
      entry/src/main/ets/model/TaskSheetInformation.ets
  63. 15 0
      entry/src/main/ets/model/UniversalCard.ets
  64. 25 0
      entry/src/main/ets/model/UserAuthInfo.ets
  65. 21 0
      entry/src/main/ets/model/UserInfo.ets
  66. 59 0
      entry/src/main/ets/model/WorkBinInfo.ets
  67. 151 0
      entry/src/main/ets/model/database/AssistantSetModel.ets
  68. 117 0
      entry/src/main/ets/model/database/RobotSelfCheckModel.ets
  69. 121 0
      entry/src/main/ets/model/database/StorageModel.ets
  70. 161 0
      entry/src/main/ets/model/database/StorageSpaceModel.ets
  71. 144 0
      entry/src/main/ets/model/database/UniversalCardModel.ets
  72. 158 0
      entry/src/main/ets/model/database/UserAuthModel.ets
  73. 19 0
      entry/src/main/ets/model/processmodel/MaterialInfo.ets
  74. 18 0
      entry/src/main/ets/model/processmodel/OrderInfo.ets
  75. 17 0
      entry/src/main/ets/model/processmodel/ProcessAlarmData.ets
  76. 18 0
      entry/src/main/ets/model/processmodel/ProcessHandleData.ets
  77. 20 0
      entry/src/main/ets/model/processmodel/ProcessNoticeInfo.ets
  78. 29 0
      entry/src/main/ets/model/processmodel/ProcessStandardData.ets
  79. 10 0
      entry/src/main/ets/model/processmodel/ProductInfo.ets
  80. 132 0
      entry/src/main/ets/pages/Distribute.ets
  81. 124 0
      entry/src/main/ets/pages/DistributedControl.ets
  82. 177 0
      entry/src/main/ets/pages/DistributedPage.ets
  83. 834 0
      entry/src/main/ets/pages/Index.ets
  84. 746 0
      entry/src/main/ets/pages/LoginPage.ets
  85. 357 0
      entry/src/main/ets/pages/MaintenanceStation.ets
  86. 522 0
      entry/src/main/ets/pages/MaintenanceStationOperations.ets
  87. 120 0
      entry/src/main/ets/pages/Outbound.ets
  88. 170 0
      entry/src/main/ets/pages/OutboundStation.ets
  89. 483 0
      entry/src/main/ets/pages/RfidAllocation.ets
  90. 753 0
      entry/src/main/ets/pages/RobotDebug.ets
  91. 135 0
      entry/src/main/ets/pages/SetPage.ets
  92. 1610 0
      entry/src/main/ets/pages/SmartFactory.ets
  93. 391 0
      entry/src/main/ets/pages/Storage.ets
  94. 31 0
      entry/src/main/ets/pages/TestComponentPage.ets
  95. 51 0
      entry/src/main/ets/pages/TestComponentPage1.ets
  96. 584 0
      entry/src/main/ets/pages/WarehouseMap.ets
  97. 309 0
      entry/src/main/ets/pages/Warehousing.ets
  98. BIN
      entry/src/main/ets/pages/car.png
  99. 108 0
      entry/src/main/ets/pages/chart.ets
  100. 0 0
      entry/src/main/ets/pages/process/CallMaterialPage.ets

+ 11 - 0
.gitignore

@@ -0,0 +1,11 @@
+/node_modules
+/oh_modules
+/local.properties
+/.idea
+**/build
+/.hvigor
+.cxx
+/.clangd
+/.clang-format
+/.clang-tidy
+**/.test

+ 10 - 0
AppScope/app.json5

@@ -0,0 +1,10 @@
+{
+  "app": {
+    "bundleName": "com.example.wonderfuldemo",
+    "vendor": "example",
+    "versionCode": 1000000,
+    "versionName": "1.0.0",
+    "icon": "$media:app_icon",
+    "label": "$string:app_name"
+  }
+}

+ 8 - 0
AppScope/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "app_name",
+      "value": "WonderfulDemo"
+    }
+  ]
+}

BIN
AppScope/resources/base/media/app_icon.png


+ 49 - 0
build-profile.json5

@@ -0,0 +1,49 @@
+{
+  "app": {
+    "signingConfigs": [
+      {
+        "name": "default",
+        "material": {
+          "certpath": "C:/Users/yxj23/.ohos/config/openharmony/default_WonderfulDemo_3JWYbRA4ZxFMBLXu9F5cviZdXQBbUdfZI2dBvywH_HY=.cer",
+          "storePassword": "0000001985DAEE775409F0585B0D1CB16D1AD725F49360BA7DE9322B6F7760182079C469F9D989A3F3",
+          "keyAlias": "debugKey",
+          "keyPassword": "00000019AFF1DD4A7DC2CB4EAACD8BE00754186DE42583C30E17F5547417CC895FAD42A5C240DAD23E",
+          "profile": "C:/Users/yxj23/.ohos/config/openharmony/default_WonderfulDemo_3JWYbRA4ZxFMBLXu9F5cviZdXQBbUdfZI2dBvywH_HY=.p7b",
+          "signAlg": "SHA256withECDSA",
+          "storeFile": "C:/Users/yxj23/.ohos/config/openharmony/default_WonderfulDemo_3JWYbRA4ZxFMBLXu9F5cviZdXQBbUdfZI2dBvywH_HY=.p12"
+        }
+      }
+    ],
+    "products": [
+      {
+        "name": "default",
+        "signingConfig": "default",
+        "compileSdkVersion": 10,
+        "compatibleSdkVersion": 10,
+        "runtimeOS": "OpenHarmony",
+      }
+    ],
+    "buildModeSet": [
+      {
+        "name": "debug",
+      },
+      {
+        "name": "release"
+      }
+    ]
+  },
+  "modules": [
+    {
+      "name": "entry",
+      "srcPath": "./entry",
+      "targets": [
+        {
+          "name": "default",
+          "applyToProducts": [
+            "default"
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 6 - 0
entry/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 31 - 0
entry/build-profile.json5

@@ -0,0 +1,31 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+    "arkOptions": {
+      // "apPath": "./modules.ap"  /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */
+    }
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": true,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          }
+        }
+      }
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest",
+    }
+  ]
+}

+ 6 - 0
entry/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { hapTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+    system: hapTasks,  /* Built-in plugin of Hvigor. It cannot be modified. */
+    plugins:[]         /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 18 - 0
entry/obfuscation-rules.txt

@@ -0,0 +1,18 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope

+ 10 - 0
entry/oh-package.json5

@@ -0,0 +1,10 @@
+{
+  "license": "",
+  "devDependencies": {},
+  "author": "",
+  "name": "entry",
+  "description": "Please describe the basic information.",
+  "main": "",
+  "version": "1.0.0",
+  "dependencies": {}
+}

+ 10 - 0
entry/src/main/ets/Application/MyAbilityStage.ts

@@ -0,0 +1,10 @@
+
+import AbilityStage from '@ohos.app.ability.AbilityStage'
+
+const TAG: string = 'testTag'
+
+export default class MyAbilityStage extends AbilityStage {
+  onCreate() {
+    console.info(TAG, `MyAbilityStage onCreate`)
+  }
+}

+ 84 - 0
entry/src/main/ets/common/DeviceDialog.ets

@@ -0,0 +1,84 @@
+
+import deviceManager from '@ohos.distributedDeviceManager';
+import router from '@ohos.router';
+
+const TAG: string = 'testTag'
+
+@CustomDialog
+export struct DeviceDialog {
+  controller?: CustomDialogController;
+  @StorageLink('deviceList') deviceList: Array<deviceManager.DeviceBasicInfo> = AppStorage.get('deviceList')!;
+  private selectedIndex: number | undefined = 0;
+  private onSelectedIndexChange: (selectedIndex: number | undefined) => void = () => {
+  }
+  @State deviceDialogWidth: number = 0
+
+  build() {
+    Column() {
+      Text('选择设备')
+        .fontSize(px2vp(30))
+        .width('100%')
+        .height('20%')
+        .fontColor(Color.Black)
+        .textAlign(TextAlign.Start)
+      List() {
+        ForEach(this.deviceList, (item: deviceManager.DeviceBasicInfo, index: number | undefined) => {
+          ListItem() {
+            Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
+              Text(item.deviceName)
+                .fontSize(px2vp(30))
+                .width('80%')
+                .fontColor(Color.Black)
+              Radio({ value: '', group: 'radioGroup' })
+                .radioStyle({
+                  checkedBackgroundColor: '#ff0d64fb'
+                })
+                .align(Alignment.Top)
+                .width('3%')
+                .checked(index === this.selectedIndex ? true : false)
+            }
+            .margin({ top: 17 })
+            .onClick(() => {
+              if (this.selectedIndex !== undefined) {
+                this.selectedIndex = index
+                this.onSelectedIndexChange(this.selectedIndex)
+              }
+            })
+          }
+          .width('100%')
+          .height('40%')
+        }, (item: deviceManager.DeviceBasicInfo) => item.deviceName)
+      }
+      .height('60%')
+      .width('100%')
+      .layoutWeight(1)
+
+      Button() {
+        Text('取消')
+          .width('90%')
+          .fontSize(21)
+          .fontColor('#ff0d64fb')
+          .textAlign(TextAlign.Center)
+      }
+      .type(ButtonType.Capsule)
+      .backgroundColor(Color.White)
+      .onClick(() => {
+        if (this.controller !== undefined) {
+          this.controller.close()
+          router.pushUrl({
+            url:'pages/Index'
+          })
+        }
+      })
+    }
+    .margin({ bottom: 15 })
+    .onAreaChange((oldArea: Area, newArea: Area) => {
+      this.deviceDialogWidth = (newArea.width > newArea.height ? newArea.height : newArea.width) as number * 0.1 //percentage
+    })
+    .width('80%')
+    .height(px2vp(240))
+    .padding({ left: 18, right: 32 })
+    .backgroundColor(Color.White)
+    .border({ color: Color.White, radius: 20 })
+  }
+}

+ 98 - 0
entry/src/main/ets/common/bean/Camera.ets

@@ -0,0 +1,98 @@
+// import common from '@ohos.app.ability.common';
+// import { MediaBean } from './MediaBean';
+// import { MediaHelper } from '../Bean/MediaHelper';
+// import router from '@ohos.router';
+//
+// @Entry
+// @Component
+// struct Index {
+//   @State mediaBean: MediaBean = new MediaBean();
+//   private mediaHelper: MediaHelper = new MediaHelper(getContext());
+//   @State luru:number=0
+//
+//   build() {
+//     Column({space:10}) {
+//       Text('面部采集')
+//         .textAlign(TextAlign.Center)
+//         .width('100%')
+//         .fontSize('52px')
+//       Column() {
+//         if (this.luru===0){
+//           Image($r('app.media.log_on_user'))
+//             .width('516px')
+//             .height('516px')
+//             .borderRadius(400)
+//             .backgroundColor(Color.Grey)
+//           Text('开始录入')
+//             .textAlign(TextAlign.Center)
+//             .width(200)
+//             .fontSize(16)
+//             .padding(10)
+//             .margin(20)
+//             .borderRadius(15)
+//             .backgroundColor('#0f000000')
+//             .onClick(() => {
+//               this.handleClick(MediaOption.TakePhoto)
+//               this.luru=1
+//             })
+//         }else if (this.luru===1){
+//           Image(this.mediaBean.localUrl)
+//             .width('516px')
+//             .height('516px')
+//             .borderRadius(400)
+//             .backgroundColor(Color.Grey)
+//           Text('录入成功')
+//             .textAlign(TextAlign.Center)
+//             .width(200)
+//             .fontSize(16)
+//             .padding(10)
+//             .margin(20)
+//             .fontColor('#ffff')
+//             .backgroundColor('#0A59F7')
+//             .border({ width: 0.5, radius: 15 })
+//             .onClick(() => {
+//               this.handleClick(MediaOption.TakePhoto)
+//               this.luru=1
+//             })
+//         }
+//
+//
+//       }
+//       .width('50%')
+//       .height('60%')
+//     }
+//     .justifyContent(FlexAlign.Center)
+//     .width('100%')
+//     .height('100%')
+//   }
+//
+//   async handleClick(option: MediaOption) {
+//     let mediaBean: MediaBean;
+//     switch (option) {
+//       case MediaOption.Picture:
+//         mediaBean = await this.mediaHelper.selectPicture();
+//         break;
+//       case MediaOption.File:
+//         mediaBean = await this.mediaHelper.selectFile();
+//         break;
+//       case MediaOption.TakePhoto:
+//         mediaBean = await this.mediaHelper.takePhoto(getContext() as common.UIAbilityContext);
+//         break;
+//       default:
+//         break;
+//     }
+//
+//     if (mediaBean) {
+//
+//       this.mediaBean = mediaBean;
+//
+//     }
+//
+//   }
+// }
+//
+// enum MediaOption {
+//   Picture = 0,
+//   File = 1,
+//   TakePhoto = 2
+// }

+ 9 - 0
entry/src/main/ets/common/bean/Log.ets

@@ -0,0 +1,9 @@
+export class Log {
+  public static info(tag: string, msg: string) {
+    console.info(`${tag} ${msg}`);
+  }
+
+  public static error(tag: string, msg: string) {
+    console.error(`${tag} ${msg}`);
+  }
+}

+ 22 - 0
entry/src/main/ets/common/bean/MediaBean.ets

@@ -0,0 +1,22 @@
+/**
+ * 多媒体数据类
+ */
+export class MediaBean {
+  /**
+   * 文件名称
+   */
+  public fileName?: string;
+  /**
+   * 文件大小
+   */
+  public fileSize?: number;
+  /**
+   * 文件类型
+   */
+  public fileType?: string;
+  /**
+   * 本地存储地址
+   */
+  public localUrl?: string;
+}
+

+ 183 - 0
entry/src/main/ets/common/bean/MediaHelper.ets

@@ -0,0 +1,183 @@
+// /**
+//  * 多媒体辅助类
+//  */
+// import common from '@ohos.app.ability.common';
+// import picker from '@ohos.file.picker';
+// import mediaLibrary from '@ohos.multimedia.mediaLibrary';
+// import wantConstant from '@ohos.ability.wantConstant';
+// import { MediaBean } from './MediaBean';
+// import { StringUtils } from './StringUtils';
+// import { Log } from './Log';
+//
+// /**
+//  * 多媒体辅助类
+//  */
+// export class MediaHelper {
+//   private readonly TAG: string = 'MediaHelper';
+//
+//   private mContext: common.Context;
+//
+//   constructor(context: common.Context) {
+//     this.mContext = context;
+//   }
+//
+//   /**
+//    * 选择图片
+//    */
+//   public selectPicture(): Promise<MediaBean> {
+//
+//     try {
+//       let photoSelectOptions  = new picker.PhotoSelectOptions();
+//       photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE;
+//       photoSelectOptions.maxSelectNumber = 1;
+//       let photoPicker = new picker.PhotoViewPicker();
+//       return photoPicker.select(photoSelectOptions)
+//         .then((photoSelectResult) => {
+//           Log.info(this.TAG, 'PhotoViewPicker.select successfully, PhotoSelectResult uri: ' + JSON.stringify(photoSelectResult));
+//
+//           if (photoSelectResult && photoSelectResult.photoUris && photoSelectResult.photoUris.length > 0) {
+//             let filePath = photoSelectResult.photoUris[0];
+//             Log.info(this.TAG, 'PhotoViewPicker.select successfully, PhotoSelectResult uri: ' + filePath);
+//             return filePath;
+//           }
+//           return
+//         }).catch((err) => {
+//           Log.error(this.TAG, 'PhotoViewPicker.select failed with err: ' + err);
+//           return err;
+//         }).then(async (filePath) => {
+//           const mediaBean = await this.buildMediaBean(filePath);
+//           return mediaBean
+//         });
+//     } catch (err) {
+//       Log.error(this.TAG, 'PhotoViewPicker failed with err: ' + err);
+//       return Promise.reject(err);
+//     }
+//   }
+//
+//   /**
+//    * 选择文件
+//    */
+//   public selectFile(): Promise<MediaBean> {
+//     try {
+//       let documentSelectOptions = new picker.DocumentSelectOptions();
+//       let documentPicker = new picker.DocumentViewPicker();
+//       return documentPicker.select(documentSelectOptions)
+//         .then((documentSelectResult) => {
+//           Log.info(this.TAG, 'DocumentViewPicker.select successfully, DocumentSelectResult uri: ' + JSON.stringify(documentSelectResult));
+//
+//           if (documentSelectResult && documentSelectResult.length > 0) {
+//             let filePath = documentSelectResult[0];
+//             Log.info(this.TAG, 'DocumentViewPicker.select successfully, DocumentSelectResult uri: ' + filePath);
+//             return filePath;
+//           }
+//
+//         }).catch((err) => {
+//           Log.error(this.TAG, 'PhotoViewPicker.select failed with err: ' + err);
+//           return err;
+//         }).then(async (filePath) => {
+//
+//           const mediaBean = await this.buildMediaBean(filePath);
+//           return mediaBean;
+//
+//         });
+//     } catch (err) {
+//       Log.error(this.TAG, 'PhotoViewPicker failed with err: ' + err);
+//       return Promise.reject(err);
+//     }
+//   }
+//
+//
+//   /**
+//    * 拍照
+//    */
+//   public async takePhoto(context: common.UIAbilityContext): Promise<MediaBean> {
+//
+//
+//     let want = {
+//       'uri': '',
+//       'action': wantConstant.Action.ACTION_IMAGE_CAPTURE,
+//       'parameters': {},
+//     };
+//     return context.startAbilityForResult(want)
+//       .then((result) => {
+//         Log.info(this.TAG, `startAbility call back , ${JSON.stringify(result)}`);
+//         if (result.resultCode === 0 && result.want && StringUtils.isNotNullOrEmpty(result.want.uri)) {
+//           //拍照成功
+//           Log.info(this.TAG, 'takePhoto successfully, takePhotoResult uri: ' + result.want.uri);
+//           return result.want.uri;
+//         }
+//       }).catch((error) => {
+//         Log.info(this.TAG, `startAbility error , ${JSON.stringify(error)}`);
+//         return error;
+//       }).then(async (uri: string) => {
+//         const mediaBean = await this.buildMediaBean(uri);
+//         return mediaBean;
+//       });
+//   }
+//
+//
+//   /**
+//    * 封装多媒体实体类
+//    *
+//    * @param uri 文件路径
+//    */
+//   private async buildMediaBean(uri: string): Promise<MediaBean> {
+//
+//     if (StringUtils.isNullOrEmpty(uri)) {
+//       return null;
+//     }
+//
+//     const mediaBean: MediaBean = new MediaBean();
+//     mediaBean.localUrl = uri;
+//     await this.appendFileInfoToMediaBean(mediaBean, uri);
+//     return mediaBean;
+//   }
+//
+//   /**
+//    * 通过Uri查找所选文件信息,插入到MediaBean中
+//    * @param mediaBean
+//    * @param uri
+//    */
+//   private async appendFileInfoToMediaBean(mediaBean: MediaBean, uri: string) {
+//
+//     if (StringUtils.isNullOrEmpty(uri)) {
+//       return;
+//     }
+//     let fileList: Array<mediaLibrary.FileAsset> = [];
+//
+//     const parts: string[] = uri.split('/');
+//     const id: string = parts.length > 0 ? parts[parts.length - 1] : '-1';
+//
+//     try {
+//
+//       let media = mediaLibrary.getMediaLibrary(this.mContext);
+//       let mediaFetchOptions: mediaLibrary.MediaFetchOptions = {
+//         selections: mediaLibrary.FileKey.ID + '= ?',
+//         selectionArgs: [id],
+//         uri: uri
+//       };
+//
+//       let fetchFileResult = await media.getFileAssets(mediaFetchOptions);
+//       Log.info(this.TAG, `fileList getFileAssetsFromType fetchFileResult.count = ${fetchFileResult.getCount()}`);
+//       fileList = await fetchFileResult.getAllObject();
+//       fetchFileResult.close();
+//       await media.release();
+//
+//     } catch (e) {
+//       Log.error(this.TAG, "query: file data  exception ");
+//     }
+//
+//     if (fileList && fileList.length > 0) {
+//
+//       let fileInfoObj = fileList[0];
+//       Log.info(this.TAG, `file id = ${JSON.stringify(fileInfoObj.id)} , uri = ${JSON.stringify(fileInfoObj.uri)}`);
+//       Log.info(this.TAG, `file fileList displayName = ${fileInfoObj.displayName} ,size = ${fileInfoObj.size} ,mimeType = ${fileInfoObj.mimeType}`);
+//
+//       mediaBean.fileName = fileInfoObj.displayName;
+//       mediaBean.fileSize = fileInfoObj.size;
+//       mediaBean.fileType = fileInfoObj.mimeType;
+//
+//     }
+//   }
+// }
+//

+ 10 - 0
entry/src/main/ets/common/bean/StringUtils.ets

@@ -0,0 +1,10 @@
+export class StringUtils {
+
+  static isNullOrEmpty(value: string | null | undefined): boolean {
+    return value === null || value === undefined || value === '' || value === 'null' || value === "null";
+  }
+
+  static isNotNullOrEmpty(value: string | null | undefined): boolean {
+    return !StringUtils.isNullOrEmpty(value);
+  }
+}

+ 137 - 0
entry/src/main/ets/common/component/AddAndSubtractComp.ets

@@ -0,0 +1,137 @@
+import { ScanStorageclass } from '../../view/IntelligentWarehousingOutbound'
+import MaterialCollectInfo from '../../view/processview/MaterialCollectView'
+import RecordItem from '../../view/processview/RecordItemView'
+
+@Component
+export struct AddAndSubtractComp {
+  // 输入值
+  @State inputNum: number = 0
+  // 输入值所在的对象用于修改(不存在则不传)
+  obj: ScanStorageclass | MaterialCollectInfo | RecordItem | undefined
+  // 需要修改的对象的属性名
+  editPropertyName: string=''
+  // 输入值上限、下限
+  upperLimit: number=0
+  lowerLimit: number=0
+  // 点击加、减事件调用的方法,及输入修改调用的方法
+  addFunction: Function | undefined = undefined
+  subFunction: Function | undefined = undefined
+  editFunction: Function | undefined = undefined
+  //输入值增加或减少值
+
+
+
+  build() {
+    Row() {
+      Row() {
+        Image(this.lowerLimit && this.inputNum <= this.lowerLimit ? $r('app.media.subtract_disabled') : $r('app.media.subtract'))
+          .width($r('app.float.title_icon_size'))
+          .height($r('app.float.title_icon_size'))
+      }
+      .width('25%')
+      .height('100%')
+      .justifyContent(FlexAlign.Center)
+      .onClick(()=>{
+        if (this.inputNum <= this.lowerLimit) {
+          return
+        }
+        if (this.subFunction) {
+          this.subFunction()
+        }
+        this.inputNum --
+      })
+      Row() {
+        TextInput({text: this.inputNum.toString()})
+          .fontSize($r('app.float.title_font_size'))
+          .fontWeight(FontWeight.Bold)
+          .fontColor($r('app.color.general_font_color'))
+          // .opacity($r('app.float.general_font_opacity'))
+          .height('100%')
+          .width('100%')
+          .type(InputType.Number)
+          .textAlign(TextAlign.Center)
+          .backgroundColor($r('app.color.general_card_background_color'))
+          .onChange((value: string)=>{
+            if (!value || value.length === 0) {
+              this.inputNum = 0
+              return
+            }
+            let num: number = Number.parseInt(value)
+            let exchangeNumber:number=Number.parseInt(value)
+            // 校验数据有效性
+            if (this.lowerLimit && num && exchangeNumber < this.lowerLimit) {
+              this.inputNum = this.lowerLimit
+              if (this.obj) {
+                if((this.obj as ScanStorageclass).num !== undefined) {
+                  (this.obj as ScanStorageclass).num = this.inputNum
+                } else if ((this.obj as MaterialCollectInfo).realNum !== undefined) {
+                  (this.obj as MaterialCollectInfo).realNum = this.inputNum
+                } else if ((this.obj as RecordItem).realValue !== undefined) {
+                  (this.obj as RecordItem).realValue = this.inputNum
+                }else  if((this.obj as ScanStorageclass).exchangeNumber !== undefined) {
+                  (this.obj as ScanStorageclass).exchangeNumber = this.inputNum
+                }
+              }
+            } else if (this.upperLimit && num && exchangeNumber> this.upperLimit) {
+              this.inputNum = this.upperLimit
+              if (this.obj) {
+                if((this.obj as ScanStorageclass).num !== undefined) {
+                  (this.obj as ScanStorageclass).num = this.inputNum
+                } else if ((this.obj as MaterialCollectInfo).realNum !== undefined) {
+                  (this.obj as MaterialCollectInfo).realNum = this.inputNum
+                } else if ((this.obj as RecordItem).realValue !== undefined) {
+                  (this.obj as RecordItem).realValue = this.inputNum
+                }else  if((this.obj as ScanStorageclass).exchangeNumber !== undefined) {
+                  (this.obj as ScanStorageclass).exchangeNumber = this.inputNum
+                }
+              }
+            } else {
+              this.inputNum = num
+              this.inputNum=exchangeNumber
+              if (this.obj) {
+                if((this.obj as ScanStorageclass).num !== undefined) {
+                  (this.obj as ScanStorageclass).num = this.inputNum
+                } else if ((this.obj as MaterialCollectInfo).realNum !== undefined) {
+                  (this.obj as MaterialCollectInfo).realNum = this.inputNum
+                } else if ((this.obj as RecordItem).realValue !== undefined) {
+                  (this.obj as RecordItem).realValue = this.inputNum
+                }else  if((this.obj as ScanStorageclass).exchangeNumber !== undefined) {
+                  (this.obj as ScanStorageclass).exchangeNumber = this.inputNum
+                }
+              }
+            }
+            if (this.editFunction) {
+              this.editFunction()
+            }
+          })
+      }
+      .width('50%')
+      .height('100%')
+      .border({width:{left: 1, right: 1}})
+      .borderColor($r('app.color.general_border_black_color'))
+      Row() {
+        Image(this.upperLimit && this.upperLimit >= this.lowerLimit ? $r('app.media.add_disabled') : $r('app.media.add'))
+          .width($r('app.float.title_icon_size'))
+          .height($r('app.float.title_icon_size'))
+      }
+      .width('25%')
+      .height('100%')
+      .justifyContent(FlexAlign.Center)
+      .onClick(()=>{
+        if (this.inputNum >= this.upperLimit) {
+          return
+        }
+        if (this.addFunction) {
+          this.addFunction()
+        }
+        this.inputNum ++
+      })
+    }
+    .width('100%')
+    .height('100%')
+    .backgroundColor($r('app.color.general_card_background_color'))
+    .borderWidth(1)
+    .borderColor($r('app.color.general_border_black_color'))
+    .borderRadius($r('app.float.general_border_radius'))
+  }
+}

+ 318 - 0
entry/src/main/ets/common/component/BottomOperateComp.ets

@@ -0,0 +1,318 @@
+import router from '@ohos.router'
+import NoticeInfo from '../../model/NoticeInfo'
+import common from '@ohos.app.ability.common';
+import { KvStoreModel } from '../../model/KvStoreModel';
+import deviceManager from '@ohos.distributedDeviceManager';
+import { RemoteDeviceModel, BUNDLE_NAME } from '../../model/RemoteDeviceModel'
+import { DeviceDialog } from '../../common/DeviceDialog';
+import Want from '@ohos.app.ability.Want';
+import { class1 } from '../../pages/Storage';
+
+const TAG: string = 'testTag'
+const DATA_CHANGE: string = 'dataChange'
+const DATA_CHANGE1: number = 0
+const EXIT: string = 'exit'
+
+/*
+ * 底部操作栏
+ * */
+@Component
+export struct BottomOperateComp {
+  // @Link SmartFactoryCardDelete:number
+  private isHomePage?: boolean = false
+  @State isClick:boolean = false
+  //弹窗
+  dialogController1: CustomDialogController= new CustomDialogController({
+    builder: NoticeDialog({}),
+    alignment: DialogAlignment.Center,
+    customStyle:true,
+    cancel:()=>{
+      this.isClick =! this.isClick
+    }
+  })
+  @State Page:number=1
+  @State deviceDialogWidth: number = 0
+  @State @Watch('dataChange')  click: number = 0;
+  @State  click1: number = 0;
+  @State @Watch('dataChange')  message: string = 'Hello World';
+  @State inputMsg: string = '';
+  @State isDistributed: boolean = false
+  @StorageLink('deviceList') deviceList: Array<deviceManager.DeviceBasicInfo> = []
+  @State selectedIndex: number | undefined = -1
+
+  private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel()
+  private kvStoreModel: KvStoreModel = new KvStoreModel()
+  private dialogController: CustomDialogController | null = null
+
+  onSelectedIndexChange = async (index: number | undefined) => {
+    console.info(TAG, `selectedIndexChange`)
+    this.selectedIndex = index
+    this.selectDevice()
+  }
+
+
+  // aboutToAppear(){
+  //   this.showDeviceDialog()
+  // }
+  aboutToDisappear() {
+    console.info(TAG, `index disappear`)
+    this.kvStoreModel.deleteKvStore()
+  }
+
+  startAbilityCallBack = (key: string) => {
+    console.info(TAG, `startAbilityCallBack ${key}`)
+    if (DATA_CHANGE === key) {
+      this.kvStoreModel.put(DATA_CHANGE, this.message)
+    }
+    if (EXIT === key) {
+      this.kvStoreModel.put(DATA_CHANGE, EXIT)
+    }
+  }
+
+  selectDevice() {
+    console.info(TAG, `start ability ......`)
+    this.isDistributed = true
+    if (this.selectedIndex !== undefined && (this.remoteDeviceModel === null || this.remoteDeviceModel.discoverList.length <= 0)) {
+      console.info(TAG, `continue unauthed device: ${JSON.stringify(this.deviceList)}`)
+      this.startAbility(this.deviceList[this.selectedIndex].networkId as string)
+      this.clearSelectState()
+      return
+    }
+    console.info(TAG, `start ability1, needAuth:`)
+    if (this.selectedIndex !== undefined) {
+      console.log(TAG, '------------' + JSON.stringify(this.deviceList[this.selectedIndex]));
+      this.remoteDeviceModel.authenticateDevice(this.deviceList[this.selectedIndex], () => {
+        console.info(TAG, `auth and online finished`);
+        if (this.remoteDeviceModel !== null && this.remoteDeviceModel.deviceList !== null && this.selectedIndex !== undefined) {
+          for (let i = 0; i < this.remoteDeviceModel.deviceList!.length; i++) {
+            if (this.remoteDeviceModel.deviceList![i].deviceName === this.deviceList[this.selectedIndex].deviceName) {
+              this.startAbility(this.remoteDeviceModel.deviceList![i].networkId);
+            }
+          }
+        }
+      })
+    }
+    console.info(TAG, `start ability2 ......`)
+    this.clearSelectState()
+  }
+
+  clearSelectState() {
+    this.deviceList = []
+    if (this.dialogController !== null) {
+      this.dialogController.close()
+    }
+    console.info(TAG, `cancelDialog`)
+    if (this.remoteDeviceModel === undefined) {
+      return
+    }
+    this.remoteDeviceModel.unregisterDeviceListCallback()
+  }
+
+  async startAbility(deviceId: string | undefined) {
+    console.debug(TAG, `startAbility deviceId: ${deviceId}`)
+    let context = getContext(this) as common.UIAbilityContext
+    let choicePages:class1={}
+    // console.log("获取当前页面"+choicePages.choicePages?.toString())
+    let want: Want = {
+      bundleName: BUNDLE_NAME,
+      abilityName: 'EntryAbility',
+      //  abilityName: choicePages.choicePages===2?'':'firstAbility',
+      deviceId: deviceId,
+      parameters: {
+        isRemote: 'isRemote'
+      }
+    }
+    context.startAbility(want).then((data) => {
+      console.info(TAG, `start ability finished: ${JSON.stringify(data)}`)
+      this.startAbilityCallBack(DATA_CHANGE)
+    })
+  }
+
+  dataChange() {
+    console.info(TAG, `dataChange, message = ${this.message},`)
+    this.kvStoreModel.put(DATA_CHANGE1.toString(), this.click.toString())
+    this.kvStoreModel.put(DATA_CHANGE, this.message,)
+  }
+
+  showDeviceDialog() {
+    this.deviceList = []
+    // 注册监听回调,发现设备或查找到已认证设备会弹窗显示
+    this.remoteDeviceModel.registerDeviceListCallback(() => {
+      this.deviceList = []
+      let deviceTempList = this.remoteDeviceModel.discoverList.length > 0 ? this.remoteDeviceModel.discoverList : this.remoteDeviceModel.deviceList;
+      if (deviceTempList !== null) {
+        for (let i = 0; i < deviceTempList!.length; i++) {
+          console.debug(TAG, `device ${i}/${deviceTempList!.length} deviceId= ${deviceTempList![i].deviceId},
+        deviceName= ${deviceTempList![i].deviceName}, deviceType= ${deviceTempList![i].deviceType}`);
+          if (deviceTempList !== null) {
+            this.deviceList.push({
+              deviceId: deviceTempList![i].deviceId,
+              deviceName: deviceTempList![i].deviceName,
+              deviceType: deviceTempList![i].deviceType,
+              networkId: deviceTempList![i].networkId,
+            })
+            AppStorage.set('deviceList', this.deviceList)
+          }
+        }
+      }
+    })
+    if (this.dialogController === null) {
+      this.dialogController = new CustomDialogController({
+        builder: DeviceDialog({
+          selectedIndex: this.selectedIndex,
+          onSelectedIndexChange: this.onSelectedIndexChange
+        }),
+        cancel: () => {
+          this.clearSelectState()
+        },
+        autoCancel: true,
+        alignment: DialogAlignment.Center,
+        customStyle: false
+      })
+    }
+    if (this.dialogController !== null) {
+      this.dialogController.open()
+    }
+  }
+
+  build() {
+    Stack() {
+      Text()
+        .width('100%')
+        .height('100%')
+        .backgroundColor($r('app.color.bottom_bar_background'))
+        .opacity(this.isHomePage ? $r('app.float.bottom_bar_home_page_opacity') : $r('app.float.bottom_bar_general_opacity'))
+        .backdropBlur(this.isHomePage ? 13 : 0)
+
+      Row() {
+        Row () {
+          Image($r('app.media.home_page'))
+            .height($r('app.float.robot_image_select_size'))
+            .width($r('app.float.robot_image_select_size'))
+        }
+        .height('100%')
+        .width('7%')
+        .justifyContent(FlexAlign.Center)
+        .onClick(()=>{
+            router.pushUrl({
+              url:'pages/Index'
+            })
+
+          })
+        Row(){
+          Image($r('app.media.notice'))
+            .height($r('app.float.robot_image_select_size'))
+            .width($r('app.float.robot_image_select_size'))
+        }
+        .height('100%')
+        .width('7%')
+        .justifyContent(FlexAlign.Center)
+        .onClick(()=>{
+          this.dialogController1.open()
+        })
+
+        Row(){
+          Image($r('app.media.jg_circular_icon'))
+            .height($r('app.float.storage_space_set_size'))
+            .width($r('app.float.storage_space_set_size'))
+        }
+        .height('100%')
+        .width('7%')
+        .justifyContent(FlexAlign.Center)
+        .onClick(()=>{
+          router.pushUrl({
+            url:'pages/SmartFactory'
+          })
+        })
+        .gesture(
+          LongPressGesture({ repeat: false })
+            .onActionEnd(() => {
+            })
+        )
+
+        Row(){
+          Image($r('app.media.page_flow'))
+            .height($r('app.float.robot_image_select_size'))
+            .width($r('app.float.robot_image_select_size'))
+          .onClick(() => {
+            this.showDeviceDialog()
+          //   router.pushUrl({
+          //     url:'pages/DistributedPage'
+          //   })
+           })
+        }
+        .height('100%')
+        .width('7%')
+        .justifyContent(FlexAlign.Center)
+        Row(){
+          Image($r('app.media.camera'))
+            .height($r('app.float.robot_image_select_size'))
+            .width($r('app.float.robot_image_select_size'))
+        }
+        .height('100%')
+        .width('7%')
+        .justifyContent(FlexAlign.Center)
+
+
+
+        // Image($r('app.media.volume'))
+        //   .height($r('app.float.general_icon_size'))
+        //   .width($r('app.float.general_icon_size'))
+      }
+      .width('100%')
+      .height('100%')
+      .justifyContent(FlexAlign.Center)
+    }
+    .width('100%')
+    .height('8%')
+  }
+}
+
+//弹窗组件
+@CustomDialog
+struct NoticeDialog {
+  controller: CustomDialogController
+  Notices: NoticeInfo[]=[]
+  build() {
+    Column({space: 10}) {
+      Row() {
+        Text('通知')
+          .fontSize($r('app.float.fontSize_24'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.general_font_opacity'))
+      }
+      Row(){
+        List(){
+          ForEach(this.Notices, (item:NoticeInfo) => {
+            ListItem(){
+              Row(){
+                Text(item.Notice)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .fontColor($r('app.color.general_font_color'))
+                  .opacity($r('app.float.general_font_opacity'))
+                Text(item.NoticeDate)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .fontColor($r('app.color.general_font_color'))
+                  .opacity($r('app.float.card_font_default_opacity'))
+              }
+              .justifyContent(FlexAlign.SpaceBetween)
+              .width('100%')
+            }
+          })
+        }
+      }
+      .width('90%')
+      .height('80%')
+      .alignItems(VerticalAlign.Top)
+      .borderRadius($r('app.float.notice_size'))
+      .borderWidth($r('app.float.general_border_width'))
+      .borderColor($r('app.color.general_border_color'))
+    }
+    .width('45%')
+    .height('70%')
+    .justifyContent(FlexAlign.Center)
+    .backgroundColor($r('app.color.page_general_background'))
+    .borderRadius($r('app.float.notice_size'))
+  }
+}

+ 148 - 0
entry/src/main/ets/common/component/OrderStatisticsComp.ets

@@ -0,0 +1,148 @@
+@Component
+export struct OrderStatisticsComp {
+
+  // 计划数量
+  @Link private planNum: number
+  // 完成数量
+  @Link private completeNum: number
+  // 报故数量
+  @Link private bugNum: number
+
+  aboutToAppear() {
+    console.log('testTag', '==p' + this.planNum + '==c' + this.completeNum + '==b' + this.bugNum )
+  }
+
+  build(){
+    //中间框
+    Row(){
+      //左右column
+      Column(){
+        //左边
+        Column(){
+          Row(){
+            Blank()
+            Image($r('app.media.today_plan'))
+              .width('38px')
+              .height('38px')
+            Text().width('5%')
+            Text('产品数量').width('40%')
+              .height('100%')
+              .fontColor($r('app.color.black_60'))
+              .fontWeight(FontWeight.Bold)
+              .fontSize($r('app.float.fontSize_20'))
+            Blank()
+
+          }.width('100%')
+
+          .height('30%')
+          Text(this.planNum.toString()).width('80%')
+            .height('70%')
+            .textAlign(TextAlign.Center)
+            .fontSize($r('app.float.fontSize_38'))
+            .fontWeight(FontWeight.Bold)
+
+        }.width('100%')
+        .height('50%')
+        Divider().vertical(false)
+          .width('80%')
+        Blank()
+        Column(){
+          Blank()
+          Row(){
+            Blank()
+            Image($r('app.media.main_material_kitting'))
+              .width('38px')
+              .height('38px')
+            Text().width('5%')
+            Text('主料齐套').width('40%')
+              .height('100%')
+              .fontColor($r('app.color.black_60'))
+              .fontWeight(FontWeight.Bold)
+              .fontSize($r('app.float.fontSize_20'))
+            Blank()
+          }.width('100%')
+          .height('30%')
+          Text(this.planNum.toString()).width('80%')
+            .height('60%')
+            .textAlign(TextAlign.Center)
+            .fontSize($r('app.float.fontSize_38'))
+            .fontWeight(FontWeight.Bold)
+        }.width('100%')
+        .height('50%')
+      }.width('50%')
+      .height('70%')
+      .borderRadius(15)
+      .alignItems(HorizontalAlign.End)
+      Divider().vertical(true)
+        .height('60%')
+      Column(){
+        //右边
+        Column(){
+          Row(){
+            Image($r('app.media.today_complete'))
+              .width('38px')
+              .height('38px')
+            Text().width('5%')
+            Text('完成数量').width('40%')
+              .height('100%')
+              .fontColor($r('app.color.black_60'))
+              .fontWeight(FontWeight.Bold)
+              .fontSize($r('app.float.fontSize_20'))
+          }.width('100%')
+
+          .height('30%')
+          Text(this.completeNum.toString())
+            .width('70%')
+            .height('70%')
+            .textAlign(TextAlign.Start)
+            .fontSize($r('app.float.fontSize_38'))
+            .fontWeight(FontWeight.Bold)
+
+        }.width('100%')
+        .height('50%')
+        .padding({left: 10})
+        Divider().vertical(false)
+          .width('80%')
+        Column(){
+          Blank()
+          Column() {
+            Row(){
+              Image($r('app.media.today_report_fault'))
+                .width('38px')
+                .height('38px')
+              Text().width('5%')
+              Text('报故历史')
+                .height('100%')
+                .fontColor($r('app.color.black_60'))
+                .fontWeight(FontWeight.Bold)
+                .fontSize($r('app.float.fontSize_20'))
+            }
+            .justifyContent(FlexAlign.Start)
+            .width('100%')
+            .height('30%')
+            Text(this.bugNum.toString())
+              .width('60%')
+              .height('60%')
+              .textAlign(TextAlign.Start)
+              .fontSize($r('app.float.fontSize_38'))
+              .fontWeight(FontWeight.Bold)
+          }
+          .padding({left: 5})
+          .backgroundColor($r('app.color.general_card_background_color'))
+          .borderRadius($r('app.float.general_border_radius'))
+        }
+        .padding({left: 5})
+        .width('80%')
+        .height('50%')
+
+      }.width('50%')
+      .height('70%')
+      .borderRadius(15)
+      .alignItems(HorizontalAlign.Start)
+
+    }
+    .width('100%')
+    .height('100%')
+    .backgroundColor($r('app.color.page_general_background'))
+  }
+}

+ 422 - 0
entry/src/main/ets/common/component/OutboundList.ets

@@ -0,0 +1,422 @@
+class Item{
+  name:string
+  id:string
+  text:string
+  type:string
+  constructor(  name:string,id:string,text:string,type:string) {
+    this.name=name
+    this.type=type
+    this.id=id
+    this.text=text
+  }
+}
+
+@CustomDialog
+  ///无批次号物料详情弹窗
+struct Outbound {
+  @Link value:number
+  @Link CunQuHuo:number
+  scroller: Scroller = new Scroller()
+  @State navigation:number=0
+  @Link textValue: string
+  @Link inputValue: string
+  controller: CustomDialogController
+  // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
+  cancel: () => void
+  confirm: () => void
+  build() {
+    Column() {
+      Column(){
+
+      }.width('100%')
+      .height('20%')
+      .onClick(()=>{
+        this.controller.close()
+      })
+      Row(){
+        Row(){
+
+        }.width('25%')
+          .height('100%')
+        .onClick(()=>{
+          this.controller.close()
+        })
+        Column({space:20}){
+          Text('物料详情')
+            .textAlign(TextAlign.Center)
+            .width('100%')
+            .height('20%')
+            .fontSize('51px')
+            Column({space:10}){
+              Text('PCBA-ASSSD电路板')
+                .fontSize('32px')
+                .width('100%')
+              Text('100*200')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('批次号:'+'1223341232123124121')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('计划编号:'+'1231231231233')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('订单编号:'+'1231231231233')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('出库单号:'+'1231231231233')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+
+            }.width('40%')
+            .height('30%')
+
+          Divider().vertical(false)
+            .width('60%')
+          Column(){
+            Text('录入数量')
+              .fontSize($r('app.float.robot_state_font_size'))
+              .textAlign(TextAlign.Start)
+              .fontColor('#99000000')
+              .width('40%')
+            Counter() {
+              Text(this.value.toString())
+
+            }
+            .width('417px')
+            .height('107px')
+            .onInc(() => {
+              this.value++
+            })
+            .onDec(() => {
+              this.value--
+            })
+          }
+
+        }.width('50%')
+        .height('100%')
+        .backgroundColor('#F1F3F5')
+        .borderRadius(20)
+        Row(){
+
+        }.width('25%')
+        .height('100%')
+        .onClick(()=>{
+          this.controller.close()
+        })
+      }.width('100%')
+        .height('60%')
+
+      Column(){
+
+      }.width('100%')
+      .height('20%')
+      .onClick(()=>{
+        this.controller.close()
+      })
+
+    }.width('100%')
+    .backgroundColor('#4d000000')
+    .height('100%')
+    .justifyContent(FlexAlign.Center)
+
+    // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。
+  }
+}
+@CustomDialog
+  ///物料详情弹窗
+struct Outboundtwo {
+  private items:Array<Item>=[
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('大号螺丝','100*200','50','1'),
+  ]
+  @Link CunQuHuo:number
+  scroller: Scroller = new Scroller()
+  @State navigation:number=0
+  @Link textValue: string
+  @Link inputValue: string
+  controller: CustomDialogController
+  // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
+  cancel: () => void
+  confirm: () => void
+  build() {
+    Column() {
+      Column(){
+
+      }.width('100%')
+      .height('15%')
+      .onClick(()=>{
+        this.controller.close()
+      })
+      Row(){
+        Row(){
+
+        }.width('25%')
+        .height('100%')
+        .onClick(()=>{
+          this.controller.close()
+        })
+        Column(){
+          Text('物料详情')
+            .textAlign(TextAlign.Center)
+            .width('100%')
+            .height('10%')
+            .fontSize('51px')
+          Row(){
+            Column({space:5}){
+              Text('PCBA-ASSSD电路板')
+                .fontSize('32px')
+                .width('100%')
+              Text('100*200')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('批次号:'+'1223341232123124121')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('计划编号:'+'1231231231233')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('订单编号:'+'1231231231233')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('出库单号:'+'1231231231233')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+
+            }.width('60%')
+            .height('100%')
+            Column(){
+              Text('录入数量')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+                .width('100%')
+              Text('20')
+                .fontSize('51px')
+                .width('100%')
+                .textAlign(TextAlign.Start)
+                .fontWeight(FontWeight.Bold)
+
+            }.width('40%')
+            .height('100%')
+            .justifyContent(FlexAlign.Center)
+
+          }.width('60%')
+          .height('20%')
+          Column(){
+            Grid(this.scroller) {
+              ForEach(this.items, (item:Item) => {
+                //    ForEach(this.Number, (day: string) => {
+                GridItem() {
+                  Row(){
+                    Column(){
+                      Text('126342394609')
+                    }.width('100%')
+                    .padding(10)
+                    .borderRadius(10)
+                    .alignItems(HorizontalAlign.Start)
+                    .justifyContent(FlexAlign.Center)
+                    .height('100%')
+                    .backgroundColor('#fff')
+                  }.width('100%')
+                  .height('20%')
+                  .padding({ left:10 })
+                  .borderRadius(10)
+                  .backgroundColor('#fff')
+                }
+              })
+            }
+
+            .columnsTemplate('1fr')
+            .columnsGap(10)
+            .rowsGap(10)
+            .onScrollIndex((first: number) => {
+              console.info(first.toString())
+            })
+            .width('100%')
+            .height('100%')
+
+
+
+          }.width('60%')
+          .height('60%')
+          .borderRadius(15)
+          Blank()
+        }.width('50%')
+        .height('100%')
+        .backgroundColor('#F1F3F5')
+        .borderRadius(20)
+        Row(){
+
+        }.width('25%')
+        .height('100%')
+        .onClick(()=>{
+          this.controller.close()
+        })
+      }.width('100%')
+      .height('70%')
+
+      Column(){
+
+      }.width('100%')
+      .height('15%')
+      .onClick(()=>{
+        this.controller.close()
+      })
+
+    }.width('100%')
+    .backgroundColor('#4d000000')
+    .height('100%')
+    .justifyContent(FlexAlign.Center)
+
+    // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。
+  }
+}
+@Entry
+@Component
+export struct OutboundList{
+  @State textValue: string = ''
+  @State inputValue: string = ''
+  onCancel() {
+    console.info('onCancel')
+  }
+  onAccept() {
+    console.info(' onAccept')
+  }
+  existApp() {
+    console.info(' existApp')
+  }
+  @State value:number=0
+  @State ZhuangTai:number=0
+  @State CunQuHuo:number=0
+  OutboundControllertwo: CustomDialogController = new CustomDialogController({
+    builder:Outboundtwo({
+      CunQuHuo:this.CunQuHuo,
+      cancel: this.onCancel,
+      confirm: this.onAccept,
+      textValue: $textValue,
+      inputValue: $inputValue,
+    }),
+    // gridCount: 3,
+    cancel: this.existApp,
+    //autoCancel: true,
+    alignment: DialogAlignment.Center,
+    //offset: { dx: 0, dy: -20 },
+    gridCount: 4,
+    customStyle: true,
+  })
+  //////物料详情弹窗控制器
+  OutboundController: CustomDialogController = new CustomDialogController({
+    builder:Outbound({
+      value:this.value,
+      CunQuHuo:this.CunQuHuo,
+      cancel: this.onCancel,
+      confirm: this.onAccept,
+      textValue: $textValue,
+      inputValue: $inputValue,
+    }),
+    // gridCount: 3,
+    cancel: this.existApp,
+    //autoCancel: true,
+    alignment: DialogAlignment.Center,
+    //offset: { dx: 0, dy: -20 },
+    gridCount: 4,
+    customStyle: true,
+  })
+  private itemslist:Array<Item>=[
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('PCPA板','PCPA-ADSA-2344','5',''),
+    new Item('大号螺丝','100*200','50','1'),
+    new Item('大号螺丝','100*200','50','1'),
+  ]
+  scroller: Scroller = new Scroller()
+  build(){
+    Column({ space: 5 }) {
+      Grid(this.scroller) {
+        ForEach(this.itemslist, (item:Item) => {
+          //    ForEach(this.Number, (day: string) => {
+          GridItem() {
+            Row(){
+              Column(){
+                Text(item.type)
+                Text(item.name)
+                  .fontSize('32px')
+                Text(item.id)
+                  .fontSize('27px')
+                Row(){
+                  Text(item.text)
+                    . fontSize('51px')
+                  Text('个')
+                    .fontSize('32px')
+                }
+              }.width('90%')
+              .padding(10)
+              .borderRadius(10)
+              .alignItems(HorizontalAlign.Start)
+              .justifyContent(FlexAlign.Center)
+              .height('100%')
+              .backgroundColor('#fff')
+              Column(){
+                Image($r('app.media.jiaobiao'))
+                  .width('27px')
+                  .height('27px')
+
+              }.width('10%')
+              .justifyContent(FlexAlign.End)
+              .alignItems(HorizontalAlign.End)
+              .height('100%')
+            }.width('100%')
+            .height('50%')
+            .borderRadius(10)
+            .backgroundColor('#fff')
+            .onClick(()=>{
+             item.type===''?this.OutboundControllertwo.open():this.OutboundController.open()
+            })
+          }
+        })
+      }
+      .padding(10)
+      .columnsTemplate('1fr 1fr ')
+      .columnsGap(10)
+      .rowsGap(10)
+      .onScrollIndex((first: number) => {
+        console.info(first.toString())
+      })
+      .width('100%')
+      .height('100%')
+    }
+    .width('95%').margin({ top: 5 })
+    .height('100%')
+  }
+}

+ 184 - 0
entry/src/main/ets/common/component/OutboundTask.ets

@@ -0,0 +1,184 @@
+// import StorageRequest from '../util/request/StorageRequest';
+// export interface  Tasklist {
+//
+//   //批次号
+//   batchCode?: string;
+//   ///完成数量
+//   completedNum?:number
+//
+//   //已经占用箱数
+//   useNum?:number
+//   //空箱数
+//   emptyBoxNum?:string
+//   //可用箱数
+//   canUsedNum?:string
+//   //总容量箱数
+//   allNum?:number
+//   //仓储类型
+//   type?:string
+//   //批次号
+//
+//   coordinate?: string
+//   //创建时间
+//   created?: string
+//   //
+//   creator?: string
+//   //仓库编码
+//   houseNo?:string
+//   deptId?: string
+//   houseType?:string
+//   //主键
+//   id?:string
+//   locationNo?: string
+//   //	物料名称
+//   materialName?:string
+//   //物料编码
+//   materialNo?: string
+//   //出入库数量
+//   num?: number
+//   orgId?: string
+//   relPlanNo?:string
+//   relOrderNo?:string
+//   relOutOrderNo?:string
+//   progress?:string
+//   planNo?: string
+//   position?: string
+//   //	序列号
+//   seqNo?: string
+//   // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+//   state?:number
+//   //	库存数量
+//   stockNum?:string
+//   //出入库任务单号
+//   taskNo?: string
+//   unit?:string
+//   updated?: string
+//   //任务名称
+//   taskName?:string
+//   updator?: string
+//   vehicleNo?: string
+//
+// }
+// @Entry
+// @Component
+// export struct OutboundTask{
+//   @State SelectableMarker:number=0
+//   scroller: Scroller = new Scroller()
+//   @State taskNo:string=''
+//   @State private TasklistoutboundData:Array<Tasklist>=[]
+//   Tasklistoutbound = async() : Promise<Tasklist[]> => {
+//     let obj: Tasklist[] = []
+//     let res = await StorageRequest.post("/api/v3/task/list", {
+//       type: 2
+//     })
+//     console.log('testTag', 'Tasklist成功' + JSON.stringify(res))
+//     obj = JSON.parse(JSON.stringify(res))
+//     console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+//     return obj
+//   }
+//   aboutToAppear(){
+//     this.Tasklistoutbound().then((res : Tasklist[]) => {
+//       console.log('testTag', 'result cccccc'+JSON.stringify(res))
+//       if (res && res.length > 0) {
+//         this.TasklistoutboundData = res
+//         this.taskNo=this.TasklistoutboundData[0].taskNo
+//       }
+//     })
+//   }
+// build(){
+//   Column(){
+//     Grid(this.scroller) {
+//       ForEach(this.TasklistoutboundData, (item:Tasklist ,index:number) => {
+//         GridItem() {
+//           Row(){
+//             Column(){
+//               Text(item.taskName)
+//                 .fontSize('32px')
+//                 .width('100%')
+//                 .height('20%')
+//               Row(){
+//                 Column(){
+//                   Text('产品型号:'+item.taskNo)
+//                     .fontSize($r('app.float.robot_state_font_size'))
+//                     .textAlign(TextAlign.Start)
+//                     .fontColor('#99000000')
+//                     .width('100%')
+//                     .height('20%')
+//                   Text('计划编号:'+item.relPlanNo)
+//                     .fontSize($r('app.float.robot_state_font_size'))
+//                     .textAlign(TextAlign.Start)
+//                     .fontColor('#99000000')
+//                     .width('100%')
+//                     .height('20%')
+//                   Text('订单编号:'+item.relOrderNo)
+//                     .fontSize($r('app.float.robot_state_font_size'))
+//                     .textAlign(TextAlign.Start)
+//                     .fontColor('#99000000')
+//                     .width('100%')
+//                     .height('20%')
+//                   Text('出库单号:'+item.relOutOrderNo)
+//                     .fontSize($r('app.float.robot_state_font_size'))
+//                     .textAlign(TextAlign.Start)
+//                     .fontColor('#99000000')
+//                     .width('100%')
+//                     .height('20%')
+//                   Row(){
+//                     Text('取料进度:'+item.progress)
+//                       .fontSize($r('app.float.robot_state_font_size'))
+//                       .textAlign(TextAlign.Start)
+//                       .fontColor('#99000000')
+//                       .width('50%')
+//                       .height('100%')
+//                     Text(item.updated)
+//                       .fontSize($r('app.float.robot_state_font_size'))
+//                       .textAlign(TextAlign.End)
+//                       .fontColor('#99000000')
+//                       .width('50%')
+//                       .height('100%')
+//                   }.width('100%')
+//                   .height('20%')
+//
+//
+//                 }
+//                 .justifyContent(FlexAlign.Center)
+//                 .width('100%')
+//                 .height('100%')
+//               } .width('100%')
+//               .height('80%')
+//             }.width('100%')
+//             .padding({left:20,right:20})
+//             .borderRadius(10)
+//             .alignItems(HorizontalAlign.Start)
+//             .justifyContent(FlexAlign.Center)
+//             .height('100%')
+//             .onClick(()=>{
+//               this.SelectableMarker=index
+//               this.taskNo=item.taskNo
+//
+//             })
+//           }
+//           .padding(10)
+//           .borderRadius(10)
+//           .height('30%')
+//           .backgroundColor(this.SelectableMarker===index?
+//           $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
+//
+//         }
+//         .onClick(()=>{
+//           this.SelectableMarker=index
+//         })
+//       })
+//     }
+//     .padding(10)
+//     .columnsTemplate('1fr')
+//     .columnsGap(10)
+//     .rowsGap(10)
+//     .onScrollIndex((first: number) => {
+//       console.info(first.toString())
+//     })
+//     .width('100%')
+//     .height('100%')
+//   }.width('100%')
+//   .height('100%')
+// }
+// }

+ 72 - 0
entry/src/main/ets/common/component/ProcessTitleComp.ets

@@ -0,0 +1,72 @@
+import router from '@ohos.router'
+
+@Component
+export struct ProcessTitleComp {
+
+  private titleName: string =''
+
+  build() {
+    Stack() {
+      Text()
+        .width('100%')
+        .height('100%')
+        .backgroundColor($r('app.color.title_bar_background'))
+
+      Row() {
+        Row() {
+          Image($r('app.media.return'))
+            .height($r('app.float.general_icon_size'))
+            .width($r('app.float.general_icon_size'))
+        }
+        .width('12%')
+        .height('90%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.Start)
+        .margin({left: '1.25%'})
+        .onClick(()=>{
+          router.back()
+        })
+        Blank()
+        Column() {
+          Text(this.titleName)
+            .fontColor($r('app.color.general_font_color'))
+            .fontSize($r('app.float.title_font_size'))
+            .fontWeight(FontWeight.Medium)
+            .opacity($r('app.float.general_font_opacity'))
+        }
+        .height('100%')
+        .width('18%')
+        .alignItems(HorizontalAlign.Center)
+        .justifyContent(FlexAlign.Center)
+        Blank()
+        Row() {
+          Image($r('app.media.bluetooth_open'))
+            .width($r('app.float.title_icon_size'))
+            .height($r('app.float.title_icon_size'))
+
+          Image($r('app.media.battery_level'))
+            .width($r('app.float.title_icon_size'))
+            .height($r('app.float.title_icon_size'))
+
+          Image($r('app.media.wlan_open'))
+            .width($r('app.float.title_icon_size'))
+            .height($r('app.float.title_icon_size'))
+
+          Image($r('app.media.log_on_user'))
+            .width($r('app.float.title_icon_size'))
+            .height($r('app.float.title_icon_size'))
+        }
+        .width('16%')
+        .height('90%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.SpaceEvenly)
+      }
+      .width('100%')
+      .height('100%')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+    }
+    .width('100%')
+    .height('8%')
+  }
+}

+ 74 - 0
entry/src/main/ets/common/component/RobotLogComp.ets

@@ -0,0 +1,74 @@
+class Item{
+  name:string
+  time:string
+
+
+  constructor(  name:string,time:string) {
+    this.name=name
+    this.time=time
+
+
+  }
+}
+@Entry
+@Component
+export struct RobotLogComp {
+  controller: TextClockController = new TextClockController()
+  private items:Array<Item>=[
+    new Item('JGR001231调试模式设置成功','12:23'),
+    new Item('终点中标X:1 Y:1发送成功','12:23'),
+    new Item('车轮状态置中成功','12:23'),
+    new Item('吊篮提起动作发送成功','12:24'),
+    new Item('吊篮放下动作发送成功','12:24'),
+    new Item('JGR001231调试模式设置成功','12:44'),
+    new Item('终点中标X:1 Y:1发送成功','12:44'),
+    new Item('车轮状态置中成功','12:44'),
+    new Item('吊篮提起动作发送成功','12:44'),
+    new Item('吊篮放下动作发送成功','12:44'),
+    new Item('JGR001231调试模式设置成功','12:48'),
+    new Item('终点中标X:1 Y:1发送成功','12:48'),
+    new Item('车轮状态置中成功','12:48'),
+    new Item('吊篮提起动作发送成功','12:48'),
+    new Item('吊篮放下动作发送成功','12:48'),
+    new Item('JGR001231调试模式设置成功','12:55'),
+    new Item('终点中标X:1 Y:1发送成功','12:55'),
+    new Item('车轮状态置中成功','12:55'),
+    new Item('吊篮提起动作发送成功','12:55'),
+    new Item('吊篮放下动作发送成功','12:55'),
+  ]
+  scroller: Scroller = new Scroller()
+  build(){
+
+    Column({ space: 5 }) {
+      Grid(this.scroller) {
+        ForEach(this.items, (item:Item) => {
+          GridItem() {
+            Row(){
+              Text(item.name)
+                .fontSize('19px')
+              Blank()
+               Text(item.time)
+                 .fontSize('19px')
+                 .fontColor($r('app.color.general_font_color'))
+                 .opacity($r('app.float.general_font_opacity'))
+
+            }.width('100%')
+            .height('10%')
+
+          }
+        })
+      }
+      .padding(10)
+      .columnsTemplate('1fr')
+      .columnsGap(10)
+      .rowsGap(10)
+      .onScrollIndex((first: number) => {
+        console.info(first.toString())
+      })
+      .width('100%')
+      .height('100%')
+    }
+    .width('100%')
+    .height('100%')
+  }
+}

+ 94 - 0
entry/src/main/ets/common/component/RobotPreviewComp.ets

@@ -0,0 +1,94 @@
+import RobotInfo from '../../model/RobotInfo'
+import StorageInfo from '../../model/StorageInfo'
+
+@Component
+export struct RobotPreviewComp {
+  @Link list: Resource[]
+  @Link selectRobot: number
+  @Link robots: RobotInfo[]
+  @Link robotX: number | undefined
+  @Link robotY: number | undefined
+  @Link  robotStorage: StorageInfo
+  @Link storages: StorageInfo[]
+  private scrollTimes: number = 0
+  private panLeftOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Left })
+  private panRightOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Right })
+
+  build() {
+    Row() {
+      List({space:5}) {
+        ForEach(this.list, (item: Resource, index: number) => {
+          ListItem() {
+            Image(item)
+              .width(this.selectRobot === index ? $r('app.float.robot_image_select_size') : $r('app.float.robot_image_default_size'))
+              .height(this.selectRobot === index ? $r('app.float.robot_image_select_size') : $r('app.float.robot_image_default_size'))
+              .opacity(this.selectRobot === index ? $r('app.float.robot_image_select_opacity') : $r('app.float.robot_image_default_opacity'))
+              .borderRadius($r('app.float.general_border_radius'))
+              .onClick(()=>{
+                this.selectRobot = index
+                this.updateViewData()
+                console.log('testTag', '--------------点击事件' + this.selectRobot)
+              })
+          }
+        })
+      }
+      .listDirection(Axis.Horizontal)
+      .onReachStart(() => {
+        if (this.scrollTimes > 1) {
+          this.selectRobot = 0
+          this.updateViewData()
+        }
+        console.log('testTag', '--------------onReachStart' + this.selectRobot)
+      })
+      .onReachEnd(() => {
+        if (this.scrollTimes > 1) {
+          this.selectRobot = this.list.length - 1
+          this.updateViewData()
+        }
+        console.log('testTag', '--------------onReachEnd' + this.selectRobot)
+      })
+      .onScrollIndex((start: number, end: number) => {
+        if (this.scrollTimes < 5) {
+          this.scrollTimes++
+        }
+        this.selectRobot = Math.ceil((start + end) / 2)
+        this.updateViewData()
+        console.log('testTag', '--------------onScrollIndex' + this.selectRobot)
+      })
+      // 左拖动触发该手势事件
+      .gesture(
+        PanGesture(this.panLeftOption)
+          .onActionEnd(() => {
+            if (this.robots && this.robots.length < 4 && this.selectRobot < this.robots.length - 1) {
+              this.selectRobot++
+              this.updateViewData()
+              console.info('testTag', 'Pan end')
+            }
+          })
+      )
+      // 右拖动触发该手势事件
+      .gesture(
+        PanGesture(this.panRightOption)
+          .onActionEnd(() => {
+            if (this.robots && this.robots.length < 4 && this.selectRobot > 0){
+              this.selectRobot--
+              this.updateViewData()
+              console.info('testTag', 'Pan end')
+            }
+          })
+      )
+    }
+  }
+
+  updateViewData(){
+    if (this.robots && this.robots[this.selectRobot]) {
+      this.robotX = this.robots[this.selectRobot].x ? this.robots[this.selectRobot].x : 0
+      this.robotY = this.robots[this.selectRobot].y ? this.robots[this.selectRobot].y : 0
+    }
+    for (const storage of this.storages) {
+      if (this.robots && this.robots[this.selectRobot] && this.robots[this.selectRobot].storageId && this.robots[this.selectRobot].storageId === storage.id) {
+        this.robotStorage = storage
+      }
+    }
+  }
+}

+ 63 - 0
entry/src/main/ets/common/component/SmartFactoryCard.ets

@@ -0,0 +1,63 @@
+import CommonConstants from '../constants/CommonConstants'
+@Component
+export struct SmartFactoryCard{
+  build(){
+    Column(){
+      Text(CommonConstants.STATION_NANE)
+        .fontSize(px2vp(27))
+        .fontWeight(FontWeight.Medium)
+        .opacity(0.6)
+        .width('100%')
+        .padding({left:10,top:10})
+        .fontColor($r('app.color.start_window_background'))
+      Blank()
+      Row(){
+        Column(){
+          Text('16')
+
+            .fontColor('#ffff')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(64))
+            .fontWeight(FontWeight.Bold)
+          Text('设备')
+            .opacity(0.6)
+            .fontColor('#FFFFFF')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(19))
+            .fontWeight(FontWeight.Bold)
+
+        }.height('100%')
+        .width('20%')
+        Divider().vertical(true)
+          .color('#ffff')
+        Column(){
+          Text('8')
+
+            .fontColor('#ffff')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(64))
+            .fontWeight(FontWeight.Bold)
+          Text('在线设备')
+            .opacity(0.6)
+            .fontColor('#FFFFFF')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(19))
+            .fontWeight(FontWeight.Bold)
+
+        }.height('100%')
+        .width('20%')
+
+      }.width('100%')
+      .height('30%')
+
+
+    }
+    .padding(10)
+    .width('100%')
+    .height('90%')
+    .margin({left:10})
+    .borderRadius(15)
+    .backgroundImage($r('app.media.smartFactoryCard'))
+    .backgroundImageSize({width:'100%',height:'100%'})
+  }
+}

+ 126 - 0
entry/src/main/ets/common/component/StorageSpaceGrid.ets

@@ -0,0 +1,126 @@
+
+import StorageSpace from '../../model/StorageSpace'
+import SpaceStateList from '../../model/SpaceStateList'
+import CommonConstants from '../constants/CommonConstants'
+
+let storageTypeArray: string[] = CommonConstants.STORAGE_TYPE
+let parkTypeArray: string[] = CommonConstants.PARK_TYPE
+
+@Component
+export default struct StorageSpaceGrid {
+  @Link stateArray: Array<SpaceStateList>
+  @Link spaceArray: StorageSpace[][]
+  @Link yNum: number[]
+  @Link selectSpace: StorageSpace
+  @Link storageTypeStr: string
+  @Link parkTypeStr: string
+
+  scroller: Scroller = new Scroller()
+
+  build() {
+    Column() {
+      Scroll(this.scroller) {
+        Scroll(this.scroller) {
+          List() {
+            ForEach(this.yNum, (y: number) => {
+              ListItem() {
+                List() {
+                  ForEach(this.spaceArray[y], (item: StorageSpace) => {
+                    ListItem() {
+                      SpaceCell({
+                        stateList: this.stateArray[y],
+                        selectSpace: $selectSpace,
+                        storageTypeStr: $storageTypeStr,
+                        parkTypeStr: $parkTypeStr,
+                        currentSpace: item,
+                        stateArray: $stateArray
+                      })
+                    }
+                  })
+                }
+                .listDirection(Axis.Horizontal)
+              }
+            })
+          }
+          .alignListItem(ListItemAlign.Center)
+        }
+      }
+      .scrollable(ScrollDirection.Horizontal)
+    }
+    .width('100%')
+    .justifyContent(FlexAlign.Center)
+    .layoutWeight(1)
+  }
+}
+
+@Component
+struct SpaceCell {
+
+  @ObjectLink stateList: SpaceStateList
+  @Link stateArray: Array<SpaceStateList>
+  @Link selectSpace: StorageSpace
+  @Link storageTypeStr: string
+  @Link parkTypeStr: string
+  currentSpace: StorageSpace = {}
+
+  build() {
+    Stack() {
+      Image((!this.stateList || !this.currentSpace || !this.stateList[this.currentSpace?.x! - 1] || (this.stateList[this.currentSpace?.x! - 1] === 1 || this.stateList[this.currentSpace?.x! - 1] === 4)) ? $r("app.media.storage_space_disable") :
+        (this.stateList[this.currentSpace?.x! - 1] === 2 || this.stateList[this.currentSpace?.x! - 1] === 5 ? $r('app.media.storage_space_no_type') : $r("app.media.storage_space")))
+        .objectFit(ImageFit.Fill)
+
+      if (this.stateList && this.currentSpace && this.stateList[this.currentSpace?.x! - 1] && this.stateList[this.currentSpace?.x! - 1] > 3) {
+        Image($r('app.media.storage_space_select'))
+          .objectFit(ImageFit.Auto)
+      }
+
+      if (this.selectSpace && this.selectSpace.id === this.currentSpace.id) {
+        Text(this.currentSpace.x + ':' + this.currentSpace.y)
+          .fontSize($r('app.float.robot_set_font_size'))
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.card_font_default_opacity'))
+      } else {
+        Text(this.currentSpace.x + ':' + this.currentSpace.y)
+          .fontSize($r('app.float.robot_set_font_size'))
+          .fontColor(this.currentSpace.enableState === 2 ? $r('app.color.robot_set_card_white') : $r('app.color.general_font_color'))
+          .opacity(this.currentSpace.enableState === 2 ? 1 : $r('app.float.card_font_default_opacity'))
+      }
+    }
+    .width($r('app.float.storage_space_set_size'))
+    .height($r('app.float.storage_space_set_size'))
+    .onClick(() => {
+      if (this.selectSpace && JSON.stringify(this.selectSpace) != '{}') {
+        this.stateArray[this.selectSpace?.y! - 1][this.selectSpace?.x! - 1] -= 3
+      }
+      this.stateList[this.currentSpace?.x! - 1] += 3
+      this.selectSpace = this.currentSpace
+      this.storageTypeStr = getStorageTypeStr(this.currentSpace.storageType!, storageTypeArray)
+      this.parkTypeStr = getParkTypeStr(this.currentSpace.parkType!, parkTypeArray)
+    })
+  }
+}
+
+// 获取当前储位的仓储类型字符串
+function getStorageTypeStr(storageType: string, typeArray: string[]): string {
+  if (!storageType || storageType.length === 0) {
+    return ''
+  }
+  let typeStr: string = ''
+  let types : string[] = storageType.split(',')
+
+  for (const type of types) {
+    typeStr += typeArray[Number.parseInt(type)-1] + ','
+  }
+  if (typeStr.length > 0) {
+    typeStr = typeStr.slice(0, -1);
+  }
+  return typeStr
+}
+
+// 获取当前储位的停靠点类型字符串
+function getParkTypeStr(parkType: number, typeArray: string[]): string {
+  if (!parkType || parkType === 0) {
+    return ''
+  }
+  return typeArray[parkType - 1]
+}

+ 256 - 0
entry/src/main/ets/common/component/TaskComp.ets

@@ -0,0 +1,256 @@
+import router from '@ohos.router'
+import OrderInfo from '../../model/OrderInfo'
+import PageModel from '../../viewmodel/PageModel'
+import ProcessData from '../../viewmodel/ProcessData'
+import RequestParamModel from '../../viewmodel/RequestParamModel'
+import JGRequest from '../util/request/Request'
+import StorageRequest from '../util/request/StorageRequest'
+import { Plan, task, taskclass,PlanClass} from '../util/request/StorageRequestInstance'
+
+@Component
+export struct TaskComp {
+  static planNum:number=0
+  static completeNum:number=0
+  private orderPageNo: number = 1
+  private orderPageSize: number = 10
+  @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 orderArray: OrderInfo[] = [];
+  @State orderTotalCount?: number = 0
+  private orderTotalPages: number = 0
+  @State selectOrder: number = -1
+  @State processes: ProcessData[] = [];
+  @State selectProcess: number = 0
+  @State unCompletePlan:number| undefined=0
+  @State productTypeNum:number| undefined=0
+  // 扫描到的序列号
+  @State seqNo: string = '6030100001261-20240428-3'
+
+  outboundData = async() : Promise<OrderInfo[]> => {
+    let res: OrderInfo[]  = await JGRequest.post("/api/v1/plan/workOrder/taskPage", {
+      pageNo: this.orderPageNo,
+      pageSize: this.orderPageSize
+    } as RequestParamModel)
+    return res
+  }
+
+  async aboutToAppear() {
+
+    Plan().then((res: PlanClass) => {
+      console.log("on page show11", res.productTypeNum,res.unCompletePlan,
+      )
+      this.productTypeNum = res.productTypeNum
+      this.unCompletePlan=res.unCompletePlan
+
+    })
+
+    ////生产操作
+    task().then((res: taskclass) => {
+      console.log("on page show11", res.bugNum, res.completeNum, res.kittingNum, res.planNum
+      )
+      this.bugNum = res.bugNum
+      TaskComp.completeNum = res.completeNum!
+      this.kittingNum = res.kittingNum
+      TaskComp.planNum = res.planNum!
+    })
+  }
+
+  build(){
+    //中间框
+    Row(){
+      Column(){
+        Text('未完成计划')
+          .fontSize(px2vp(27))
+          .opacity(0.6)
+          .fontColor('#FFFFFF')
+          .width('100%')
+          .fontWeight(FontWeight.Bold)
+          .padding({left:10,top:10})
+        Text(this.unCompletePlan?.toString())
+          .fontSize(px2vp(64))
+          .fontColor('#FFFFFF')
+          .width('100%')
+          .fontWeight(FontWeight.Bold)
+          .padding({left:10,top:10})
+        Blank()
+        Text('产品种类:'+(this.productTypeNum?.toString()))
+          .fontSize(px2vp(27))
+          .opacity(0.6)
+          .fontColor('#FFFFFF')
+          .width('100%')
+          .fontWeight(FontWeight.Bold)
+          .padding({left:10,top:10,bottom:10})
+
+      }.width('40%')
+      .backgroundImage($r('app.media.Unfinished_Plan'))
+      .backgroundImageSize({width:'100%',height:'100%'})
+      .height('100%')
+      .borderRadius(15)
+      .onClick(()=>{
+        router.pushUrl({
+          url: 'pages/process/ProcessHome'
+        })
+      })
+
+
+      //左右column
+      Column(){
+        //左边
+        Column(){
+          Row(){
+            Blank()
+            Image($r("app.media.Unfinished_orders"))
+              .width('38px')
+              .height('38px')
+            Text().width('5%')
+            Text('未完成订单').width('45%')
+              .height('100%')
+              .fontColor('#99000000')
+              .fontSize(px2vp(19))
+              .fontWeight(FontWeight.Regular)
+            Blank()
+
+          }.width('100%')
+          .height('30%')
+          Text(((TaskComp.planNum?TaskComp.planNum:0)-(TaskComp.completeNum?TaskComp.completeNum:0))?.toString()).width('80%')
+            .height('70%')
+            .fontColor('#e6000000')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(64))
+            .fontWeight(FontWeight.Bold)
+
+        }.width('100%')
+        .height('50%')
+        Divider().vertical(false)
+          .width('80%')
+        Blank()
+        Column(){
+          Blank()
+          Row(){
+            Blank()
+            Image($r("app.media.completeMaterials"))
+              .width('38px')
+              .height('38px')
+            Text().width('5%')
+            Text('主料齐套').width('40%')
+              .height('100%')
+              .fontColor('#99000000')
+              .fontSize(px2vp(19))
+              .fontWeight(FontWeight.Regular)
+            Blank()
+
+          }.width('100%')
+          .height('30%')
+          Text(this.kittingNum?.toString()).width('80%')
+            .height('60%')
+            .fontColor('#e6000000')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(64))
+            .fontWeight(FontWeight.Bold)
+
+
+        }.width('100%')
+        .height('50%')
+
+
+      }.width('30%')
+      .height('70%')
+      .borderRadius(15)
+      .alignItems(HorizontalAlign.End)
+      .onClick(()=>{
+        router.pushUrl({
+          url: 'pages/process/ProcessHome'
+        })
+      })
+      Divider().vertical(true)
+        .height('60%')
+      Column(){
+        //右边
+        Column(){
+          Row(){
+            Blank()
+            Image($r("app.media.completedToday"))
+              .width('38px')
+              .height('38px')
+            Text().width('5%')
+            Text('今日完成').width('40%')
+              .height('100%')
+              .fontColor('#99000000')
+              .fontSize(px2vp(19))
+              .fontWeight(FontWeight.Regular)
+
+            Blank()
+
+          }.width('100%')
+
+          .height('30%')
+          Text(TaskComp.completeNum?.toString()).width('80%')
+            .height('70%')
+            .fontColor('#e6000000')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(64))
+            .fontWeight(FontWeight.Bold)
+
+        }.width('100%')
+        .height('50%')
+        .onClick(()=>{
+          router.pushUrl({
+            url: 'pages/process/ProcessHome'
+          })
+        })
+        Divider().vertical(false)
+          .width('80%')
+        Column(){
+          Blank()
+          Row(){
+            Blank()
+            Image($r("app.media.todayReport"))
+              .width('38px')
+              .height('38px')
+            Text().width('5%')
+            Text('我的报故').width('40%')
+              .height('100%')
+              .fontColor('#99000000')
+              .fontSize(px2vp(19))
+              .fontWeight(FontWeight.Regular)
+            Blank()
+
+          }.width('100%')
+
+          .height('30%')
+          Text(this.bugNum?.toString()).width('80%')
+            .height('60%')
+            .fontColor('#e6000000')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(64))
+            .fontWeight(FontWeight.Bold)
+
+        }.width('100%')
+        .height('50%')
+        .backgroundColor($r('app.color.robot_set_card_white'))
+        .borderRadius(px2vp(21))
+        .onClick(()=>{
+          router.pushUrl({
+            url:''
+          }
+          )
+        })
+
+
+      }.width('30%')
+      .height('70%')
+      .borderRadius(15)
+      .alignItems(HorizontalAlign.Start)
+
+    }
+    .padding(10)
+    .width('100%')
+    .height('90%')
+    .backgroundColor('#F1F3F5')
+    .borderRadius(15)
+    .margin({left:10})
+  }
+}

+ 453 - 0
entry/src/main/ets/common/component/TitleStateComp.ets

@@ -0,0 +1,453 @@
+import TimeUtil from '../util/TimeUtil'
+import CommonConstants from '../constants/CommonConstants'
+import { task, taskclass } from '../util/request/StorageRequestInstance'
+import router from '@ohos.router'
+import UniversalCard from '../../model/UniversalCard'
+import process from '@ohos.process'
+import { RfidAllocation } from '../../pages/RfidAllocation'
+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
+  private isHomePage?: boolean = false
+  @State isClick:boolean = false
+
+  RfidController:CustomDialogController = new CustomDialogController({
+    builder: RfidAllocation({}),
+    alignment: DialogAlignment.Center,
+    customStyle:true,
+    cancel:()=>{
+      this.isClick =! this.isClick
+    }
+  })
+  controller: TextClockController = new TextClockController()
+
+  AvatarController: CustomDialogController = new CustomDialogController({
+    builder: AvatarClick({}),
+    alignment: DialogAlignment.TopEnd,
+    customStyle:true,
+    offset: { dx: 0, dy: -25 },
+    cancel:()=>{
+      this.isClick =! this.isClick
+    }
+  })
+
+  // 消息弹窗控制器
+  noticeDialogController: CustomDialogController= new CustomDialogController({
+    builder: NoticeDialog({}),
+    alignment: DialogAlignment.Center,
+    customStyle:true,
+    cancel:()=>{
+      this.isClick =! this.isClick
+    }
+  })
+
+  aboutToAppear(): void {
+    ////生产操作
+    task().then((res: taskclass) => {
+      console.log("on page show11", res.bugNum, res.completeNum, res.kittingNum, res.planNum
+      )
+      this.bugNum = res.bugNum
+      this.completeNum = res.completeNum
+      this.kittingNum = res.kittingNum
+      this.planNum = res.planNum
+    })
+  }
+
+  build() {
+    Stack() {
+      Text()
+        .width('100%')
+        .height('100%')
+        .backgroundColor($r('app.color.title_bar_background'))
+        .opacity(this.isHomePage ? $r('app.float.title_bar_home_page_opacity') : $r('app.float.title_bar_general_opacity'))
+
+      Row() {
+        Row() {
+          // Image($r('app.media.hongdalogo'))
+          //   .width(px2vp(190))
+          //   .height(px2vp(32))
+          //   .objectFit(ImageFit.Contain)
+          Image($r('app.media.jing_zhi_yuan'))
+            .width(px2vp(190))
+            .height(px2vp(32))
+            .objectFit(ImageFit.Contain)
+        }
+        .width('47%')
+        .height('90%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.Start)
+        .padding({ left:px2vp(24)})
+
+        Column() {
+          Text(TimeUtil.getCurrentDate())
+            .fontColor($r('app.color.general_font_color'))
+            .fontSize($r('app.float.fontSize_14'))
+            .fontWeight(FontWeight.Regular)
+          TextClock({ timeZoneOffset: -8, controller: this.controller })
+            .format('HH:mm:ss')
+            .fontSize($r('app.float.fontSize_20'))
+            .fontWeight(FontWeight.Bold)
+        }
+        .height('100%')
+        .width('6%')
+        .alignItems(HorizontalAlign.Center)
+        .justifyContent(FlexAlign.Center)
+
+        Row() {
+          Row(){
+            Image($r("app.media.hongDa_black"))
+              .height(px2vp(48))
+              .width(px2vp(48))
+             // .backgroundColor(Color.Green)
+              .onClick(() => {
+                router.pushUrl({
+                  url:'pages/SmartFactory'
+                })
+              })
+          }
+          .height('100%')
+          .width('7.2%')
+          .justifyContent(FlexAlign.Center)
+          Row(){
+            Image($r('app.media.notice'))
+              .height(px2vp(48))
+              .width(px2vp(48))
+          }
+          .height('100%')
+          .width('7.2%')
+          .justifyContent(FlexAlign.Center)
+          .onClick(()=>{
+            // router.pushUrl({
+            //  // url:"pages/OutboundStation"
+            // })
+            this.noticeDialogController.open()
+          })
+          Row(){
+            Image($r('app.media.box_edit'))
+              .height(px2vp(48))
+              .width(px2vp(48))
+          }
+          .height('100%')
+          .width('7.2%')
+          .justifyContent(FlexAlign.Center)
+          .onClick(()=>{
+            router.pushUrl({
+             // url:'pages/Storage'
+              url:'pages/RfidAllocation'
+            })
+          })
+          Row({space: 2}) {
+            Column(){
+              Text(CommonConstants.USER_NAME)
+                .fontSize($r('app.float.fontSize_20'))
+                .fontColor($r('app.color.general_font_color'))
+                .opacity($r('app.float.general_font_opacity'))
+                .fontWeight(FontWeight.Medium)
+                .width('95%')
+                .maxLines(1)
+              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 + '%')
+                .fontSize($r('app.float.fontSize_14'))
+                .fontColor($r('app.color.general_font_color'))
+                .opacity($r('app.float.card_font_default_opacity'))
+                .fontWeight(FontWeight.Medium)
+                .maxLines(1)
+            }
+            .justifyContent(FlexAlign.Center)
+            .height(px2vp(105))
+            .width('58%')
+
+            Row() {
+              Image(CommonConstants.USER_AVATAR && CommonConstants.USER_AVATAR.length > 0 ? CommonConstants.FILE_URL_PREFIX + CommonConstants.USER_AVATAR : $r('app.media.user_white'))
+                .width(px2vp(48))
+                .height(px2vp(48))
+                .borderRadius(px2vp(100))
+                .onClick(()=>{
+                  this.AvatarController.open()
+                })
+            }
+            .layoutWeight(1)
+          }
+          .width('22%')
+          .height('90%')
+          .alignItems(VerticalAlign.Center)
+          .justifyContent(FlexAlign.SpaceEvenly)
+          .onClick(()=>{
+            this.AvatarController.open()
+          })
+        }
+        .width('47%')
+        .height('90%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.End)
+      }
+      .width('100%')
+      .height('100%')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+    }
+    .width('100%')
+    .height('8%')
+  }
+}
+//登录退出
+@CustomDialog
+struct login {
+
+  @Link textValue: string
+  @Link inputValue: string
+  controller: CustomDialogController
+
+  build() {
+    Column() {
+      Text('退出登录')
+        .textAlign(TextAlign.Center)
+        .fontColor('#e6000000')
+        .fontSize($r('app.float.fontSize_38'))
+        .fontWeight(FontWeight.Medium)
+        .width('100%')
+        .height('30%')
+      Text('是否返回登录页?')
+        .textAlign(TextAlign.Center)
+        .width('100%')
+        .height('30%')
+      Row({space:10}){
+        Text('取消')
+          .width('40%')
+          .borderRadius(21)
+          .height('70%')
+          .textAlign(TextAlign.Center)
+          .backgroundColor('#0f000000')
+          .fontColor('#0A59F7')
+          .onClick(()=>{
+            this.controller.close()
+          })
+        Text('确认')
+          .width('40%')
+          .height('70%')
+          .borderRadius(21)
+          .backgroundColor('#0A59F7')
+          .textAlign(TextAlign.Center)
+          .fontColor('#ffff')
+          .onClick(()=>{
+            this.controller.close()
+            CommonConstants.LOGIN_OUT = true
+            router.pushUrl({
+              url:'pages/LoginPage'
+            })
+
+          })
+      }
+      .width('100%')
+      .justifyContent(FlexAlign.Center)
+      .height('30%')
+
+
+    }.width('25%')
+    .height('20%')
+    .borderRadius(15)
+    .backgroundColor('#ffff')
+  }
+}
+
+//头像点击弹窗
+@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 textValue: string = ''
+  @State inputValue: string = ''
+  @State avatarFrame:boolean=false
+  loginDialogController: CustomDialogController = new CustomDialogController({
+    builder:login({
+      textValue: $textValue,
+      inputValue: $inputValue,
+    }),
+    alignment: DialogAlignment.Center,
+    autoCancel:false,
+    customStyle:true
+  })
+  shutdownDialogController: CustomDialogController = new CustomDialogController({
+    builder:shutdown({
+      textValue: $textValue,
+      inputValue: $inputValue,
+      shutdownTransparency:this.shutdownTransparency
+    }),
+    alignment: DialogAlignment.Center,
+    autoCancel:false,
+    customStyle:true
+  })
+  controller: CustomDialogController
+  build() {
+    Column(){
+      Text('个人设置')
+        .height('33%')
+        .fontSize(px2vp(32))
+        .fontWeight(FontWeight.Medium)
+        .fontColor('#e6000000')
+        .onClick(()=>{
+          router.pushUrl({
+            url: 'pages/SetPage'
+          })
+        })
+      Divider()
+      Text('退出登录')
+        .height('33%')
+        .fontSize(px2vp(32))
+        .fontWeight(FontWeight.Medium)
+        .fontColor('#e6000000')
+        .onClick(()=>{
+          this.loginDialogController.open()
+          this.controller.close()
+        })
+      Divider()
+      Text('开关/重启')
+        .height('33%')
+        .fontSize(px2vp(32))
+        .fontWeight(FontWeight.Medium)
+        .fontColor('#e6000000')
+        .onClick(()=>{
+          this.controller.close()
+          this.shutdownTransparency=1
+          this.shutdownDialogController.open()
+          this.avatarFrame=!this.avatarFrame
+        })
+
+    }.width('15%')
+    .height('25%')
+    .backgroundColor('#ffff')
+    .margin({top:'4%',right:'1%'})
+    .borderRadius(21)
+  }
+}
+//开关重启
+@CustomDialog
+struct shutdown {
+  @Link shutdownTransparency:number
+  @Link textValue: string
+  @Link inputValue: string
+  controller: CustomDialogController
+  build() {
+    Column() {
+      Row(){
+        Image($r('app.media.restart'))
+          .width(px2vp(107))
+          .height(px2vp(107))
+          .onClick(()=>{
+            this.shutdownTransparency=0
+            this.controller.close()
+          })
+        Blank()
+        Image($r('app.media.shutdown'))
+          .width(px2vp(107))
+          .height(px2vp(107))
+          .onClick(()=>{
+            let pro = new process.ProcessManager();
+            pro.exit(0);
+            this.shutdownTransparency=0
+
+
+          })
+
+      }.width('30%')
+      .height('20%')
+      Row(){
+        Text('重启')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(27))
+          .width(px2vp(107))
+          .height(px2vp(107))
+          .textAlign(TextAlign.Center)
+          .fontColor('#FFFFFF')
+        Blank()
+        Text('关机')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(27))
+          .width(px2vp(107))
+          .textAlign(TextAlign.Center)
+          .height(px2vp(107))
+          .fontColor('#FFFFFF')
+        // .onClick(()=>{
+        //   try {
+        //     power.('shutdown_test');
+        //   } catch(err) {
+        //     console.error('shutdown failed, err: ' + err);
+        //   }
+        // })
+
+      }.width('30%')
+      .height('20%')
+    }.width('100%')
+    .height('100%')
+    .borderRadius(15)
+    .backgroundColor('#cc000000')
+    .justifyContent(FlexAlign.Center)
+    .alignItems(HorizontalAlign.Center)
+
+  }
+}
+
+//消息弹窗组件
+@CustomDialog
+struct NoticeDialog {
+  controller: CustomDialogController
+  Notices: NoticeInfo[] = []
+  build() {
+    Column({space: 10}) {
+      Row() {
+        Text('通知')
+          .fontSize($r('app.float.fontSize_38'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.general_font_opacity'))
+      }
+      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'))
+                  .opacity($r('app.float.general_font_opacity'))
+                Text(item.NoticeDate)
+                  .fontSize($r('app.float.fontSize_38'))
+                  .fontColor($r('app.color.general_font_color'))
+                  .opacity($r('app.float.card_font_default_opacity'))
+              }
+              .justifyContent(FlexAlign.SpaceBetween)
+              .width('100%')
+            }
+          })
+        }
+      }
+      .width('90%')
+      .height('80%')
+      .alignItems(VerticalAlign.Top)
+      .borderRadius($r('app.float.notice_size'))
+      .borderWidth($r('app.float.general_border_width'))
+      .borderColor($r('app.color.general_border_color'))
+    }
+    .width('45%')
+    .height('70%')
+    .justifyContent(FlexAlign.Center)
+    .backgroundColor($r('app.color.page_general_background'))
+    .borderRadius($r('app.float.notice_size'))
+  }
+}

+ 267 - 0
entry/src/main/ets/common/component/Warehousing.ets

@@ -0,0 +1,267 @@
+import {testGet1, StorageStatus} from '../util/request/StorageRequestInstance'
+@Component
+export struct Warehousing {
+  @State allNum:number | undefined=0
+  @State useNum:number | undefined=0
+  @State emptyBoxNum:string | undefined=''
+  @State canUsedNum:string | undefined=''
+  @State taskName:string=''
+  @State materialName:string=''
+  @State bugNum:number=0
+  @State completeNum:number=0
+  @State kittingNum:number=0
+  @State planNum:number=0
+  @State Monday:string='30%'
+  @State Tuesday:string='40%'
+  @State Thursday:string='50%'
+  @State Wednesday:string="100%"
+  @State Friday:string="60%"
+  @State Saturday:string="20%"
+  @State Sunday:string="10%"
+
+
+  private isHomePage?: boolean = false
+  aboutToAppear() {
+
+    ////获取仓储占有率
+    testGet1().then((res : StorageStatus) => {
+      console.log("on page show11",res.allNum,res.useNum,res.emptyBoxNum,res.useNum
+      )
+      this.allNum=res.allNum
+      this.useNum=res.useNum
+      this.emptyBoxNum=res.emptyBoxNum
+      this.canUsedNum=res.canUsedNum
+    })
+  }
+  build(){
+    //中间框
+    Row() {
+      Column() {
+        Text('智能仓储')
+          .fontSize(px2vp(27))
+          .fontWeight(FontWeight.Medium)
+          .opacity(0.6)
+          .width('100%')
+          .padding({left:10,top:10})
+          .fontColor($r('app.color.start_window_background'))
+
+        Stack() {
+          Progress({ value:(this.useNum?this.useNum:0), total:this.allNum, type: ProgressType.Ring })
+            .color('#0A59F7').value(40).width(80)
+            .backgroundColor('')
+            .style({ strokeWidth: 8, scaleCount: 30, scaleWidth: 10 })
+
+          Row() {
+            Text(this.useNum?((this.useNum?this.useNum:0)/(this.allNum?this.allNum:0))
+              .toFixed(2)+'':'')
+              .fontSize(px2vp(40))
+              .fontColor($r('app.color.start_window_background'))
+            Text('%').fontSize(20)
+              .fontColor($r('app.color.start_window_background'))
+          }
+        }.width('100%')
+        .height('40%')
+        .margin(5)
+        Text('库存占用')
+          .fontSize(px2vp(19))
+          .fontColor($r('app.color.start_window_background'))
+          .fontWeight(FontWeight.Medium)
+          .opacity(0.6)
+        Row(){
+          Column(){
+            Text(this.useNum?.toString())
+              .fontWeight(FontWeight.Bold)
+              .fontColor($r('app.color.start_window_background'))
+              .fontSize(px2vp(32))
+            Text('已载料箱')
+              .fontSize(px2vp(19))
+              .fontColor($r('app.color.start_window_background'))
+              .fontWeight(FontWeight.Medium)
+              .opacity(0.6)
+
+          }.width('49%')
+          .height('100%')
+          .justifyContent(FlexAlign.Center)
+          Divider().vertical(true)
+            .color($r('app.color.start_window_background'))
+            .height('100%')
+          Column(){
+            Text(this.emptyBoxNum?.toString())
+              .fontWeight(FontWeight.Bold)
+              .fontColor($r('app.color.start_window_background'))
+              .fontSize(px2vp(32))
+            Text('空料箱')
+              .fontSize(px2vp(19))
+              .fontColor($r('app.color.start_window_background'))
+              .fontWeight(FontWeight.Medium)
+              .opacity(0.6)
+
+          }.width('49%')
+          .height('100%')
+          .justifyContent(FlexAlign.Center)
+
+
+        }.width('100%')
+        .height('30%')
+        .padding({left:10,top:10})
+
+
+
+      }.width('40%')
+      .height('100%')
+      .backgroundImage($r('app.media.warehousing'))
+      .borderRadius(15)
+      .backgroundImageSize({width:'100%',height:'100%'})
+      Column() {
+        Row(){
+          Text('存取频率')
+            .fontSize(px2vp(27))
+            .fontWeight(FontWeight.Bold)
+            .fontColor('#e6000000')
+
+          Text('一周内')
+            .fontColor('#99000000')
+            .fontSize(px2vp(19))
+            .fontWeight(FontWeight.Regular)
+            .padding({left:5})
+        }
+        .margin({top:5})
+        .height('10%')
+        .width('100%')
+        Row({space:20}){
+          Text()
+            .width(px2vp(19))
+            .linearGradient({
+              angle:180,
+              colors: [["#1050FF", 0.0],['#73C3FF', 1.0]]
+            })
+            .height(this.Monday)
+            .borderRadius(10)
+          Text()
+            .width(px2vp(19))
+            .height(this.Tuesday)
+            .linearGradient({
+              angle:180,
+              colors: [["#1050FF", 0.0],['#73C3FF', 1.0]]
+            })
+            .borderRadius(10)
+          Text()
+            .width(px2vp(19))
+            .linearGradient({
+              angle:180,
+              colors: [["#1050FF", 0.0],['#73C3FF', 1.0]]
+            })
+            .height(this.Wednesday)
+            .borderRadius(10)
+          Text()
+            .width(px2vp(19))
+            .linearGradient({
+              angle:180,
+              colors: [["#1050FF", 0.0],['#73C3FF', 1.0]]
+            })
+            .height(this.Thursday)
+            .borderRadius(10)
+          Text()
+            .width(px2vp(19))
+            .linearGradient({
+              angle:180,
+              colors: [["#1050FF", 0.0],['#73C3FF', 1.0]]
+            })
+            .height(this.Friday)
+            .borderRadius(10)
+          Text()
+            .width(px2vp(19))
+            .linearGradient({
+              angle:180,
+              colors: [["#1050FF", 0.0],['#73C3FF', 1.0]]
+            })
+            .height(this.Saturday)
+            .borderRadius(10)
+          Text()
+            .width(px2vp(19))
+            .linearGradient({
+              angle:180,
+              colors: [["#1050FF", 0.0],['#73C3FF', 1.0]]
+            })
+            .height(this.Sunday)
+            .borderRadius(10)
+
+        }.width('100%')
+        .height('45%')
+        .alignItems(VerticalAlign.Bottom)
+        .justifyContent(FlexAlign.Center)
+        Row({space:20}){
+          Text('一')
+            .fontWeight(FontWeight.Regular)
+            .fontSize(px2vp(19))
+            .fontColor('#99000000')
+          Text('二')
+            .fontWeight(FontWeight.Regular)
+            .fontSize(px2vp(19))
+            .fontColor('#99000000')
+          Text('三')
+            .fontWeight(FontWeight.Regular)
+            .fontSize(px2vp(19))
+            .fontColor('#99000000')
+          Text('四')
+            .fontWeight(FontWeight.Regular)
+            .fontSize(px2vp(19))
+            .fontColor('#99000000')
+          Text('五')
+            .fontWeight(FontWeight.Regular)
+            .fontSize(px2vp(19))
+            .fontColor('#99000000')
+          Text('六')
+            .fontWeight(FontWeight.Regular)
+            .fontSize(px2vp(19))
+            .fontColor('#99000000')
+          Text('日')
+            .fontWeight(FontWeight.Regular)
+            .fontSize(px2vp(19))
+            .fontColor('#99000000')
+
+        }.width('100%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.Center)
+        .height('6%')
+        Column(){
+          Row(){
+            Image($r('app.media.Material_Call_Task'))
+              .width(px2vp(40))
+              .height(px2vp(40))
+            Text('叫料任务')
+              .height('100%')
+              .fontColor('#99000000')
+              .fontSize(px2vp(19))
+              .fontWeight(FontWeight.Regular)
+          }.width('100%')
+          .height('20%')
+          .justifyContent(FlexAlign.Center)
+          Text(this.planNum.toString())
+            .height('60%')
+            .fontColor('#e6000000')
+            .textAlign(TextAlign.Center)
+            .fontSize(px2vp(64))
+            .fontWeight(FontWeight.Bold)
+
+
+
+        }.height('39%')
+        .width('100%')
+
+
+      }
+      .width('60%')
+
+      .height('100%')
+
+    }.padding(10)
+    .width('100%')
+    .height('90%')
+    .margin({left:10})
+    .borderRadius(15)
+    .border({ width: 1, color: '#ffeae6e6' })
+    .backgroundColor('#F5F5F5 ')
+
+  }
+}

+ 763 - 0
entry/src/main/ets/common/component/Workbin.ets

@@ -0,0 +1,763 @@
+// import StorageRequest from '../util/request/StorageRequest';
+// import {SelectMaterialslist} from '../util/request/StorageRequestInstance'
+// import detailsList from '../../model/DetailsList';
+// import RequestParamModel from '../../viewmodel/RequestParamModel';
+//
+// /////物料位置
+// ////出库取料箱出库
+// export interface  Tasklist {
+//
+//   //批次号
+//   batchCode?: string;
+//   ///完成数量
+//   completedNum?:number
+//
+//   //已经占用箱数
+//   useNum?:number
+//   //空箱数
+//   emptyBoxNum?:string
+//   //可用箱数
+//   canUsedNum?:string
+//   //总容量箱数
+//   allNum?:number
+//   //仓储类型
+//   type?:string
+//   //批次号
+//
+//   coordinate?: string
+//   //创建时间
+//   created?: string
+//   //
+//   creator?: string
+//   //仓库编码
+//   houseNo?:string
+//   deptId?: string
+//   houseType?:string
+//   //主键
+//   id?:string
+//   locationNo?: string
+//   //	物料名称
+//   materialName?:string
+//   //物料编码
+//   materialNo?: string
+//   //出入库数量
+//   num?: number
+//   orgId?: string
+//   relPlanNo?:string
+//   relOrderNo?:string
+//   relOutOrderNo?:string
+//   progress?:string
+//   planNo?: string
+//   position?: string
+//   //	序列号
+//   seqNo?: string
+//   // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+//   state?:number
+//   //	库存数量
+//   stockNum?:string
+//   //出入库任务单号
+//   taskNo?: string
+//   unit?:string
+//   updated?: string
+//   //任务名称
+//   taskName?:string
+//   updator?: string
+//   vehicleNo?: string
+//
+// }
+// export interface Materialpositionclass {
+//   //产品规格
+//   spec?:string
+//   //批次号
+//   batchCode?: string;
+//   ///完成数量
+//   completedNum?:number
+//
+//   //已经占用箱数
+//   useNum?:number
+//   //空箱数
+//   emptyBoxNum?:string
+//   //可用箱数
+//   canUsedNum?:string
+//   //总容量箱数
+//   allNum?:number
+//   //仓储类型
+//   type?:string
+//   //批次号
+//
+//   coordinate?: string
+//   //创建时间
+//   created?: string
+//   //
+//   creator?: string
+//   //仓库编码
+//   houseNo?:string
+//   deptId?: string
+//   houseType?:string
+//   //主键
+//   id?:string
+//   locationNo?: string
+//   //	物料名称
+//   materialName?:string
+//   //物料编码
+//   materialNo?: string
+//   //出入库数量
+//   num?: number
+//   orgId?: string
+//   planNo?: string
+//   position?: string
+//   //	序列号
+//   seqNo?: string
+//   // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+//   state?:number
+//   //	库存数量
+//   stockNum?:string
+//   //出入库任务单号
+//   taskNo?: string
+//   unit?:string
+//   updated?: string
+//   //任务名称
+//   taskName?:string
+//   updator?: string
+//   vehicleNo?: string
+//   pageNo?:number
+//   pageSize?:number
+// }
+// export interface  outboundDataclass {
+//   detailsList?:detailsList[]
+//   taskId?:number
+//   index?:number
+//   //产品规格
+//   spec?:string
+//   //	物料名称
+//   materialName?:string
+//   //物料编码
+//   materialNo?: string
+//   //	序列号
+//   seqNo?: string
+//   //储位坐标
+//   coordinate?:string
+//   //仓库编号
+//   houseNo?:string
+//   //储位编号
+//   locationNo?:string
+//   //单位
+//   unit?:string
+//   //数量
+//   num?:number
+//   //批次号
+//   batchCode?:string
+//
+//
+// }
+// export interface  outboundRequestData {
+//   index?:number
+//   //产品规格
+//   spec?:string
+//   //	物料名称
+//   materialName?:string
+//   //物料编码
+//   materialNo?: string
+//   //	序列号
+//   seqNo?: string
+//   //储位坐标
+//   coordinate?:string
+//   //仓库编号
+//   houseNo?:string
+//   //储位编号
+//   locationNo?:string
+//   //单位
+//   unit?:string
+//   //数量
+//   num?:number
+//   //批次号
+//   batchCode?:string
+//   //载具编号
+//   vehicleCode?:string
+//   position?:string
+//   housetype?:string
+//
+//
+//
+//
+//
+// }
+// @CustomDialog
+// struct positionok {
+//   // outboundData = async() : Promise<outboundDataclass[]> => {
+//   //   let obj:outboundDataclass[] = []
+//   //   let res = await StorageRequest.post("/api/v3/wmsOrder/outBox", {
+//   //     detailsList:this.outboundRequest,
+//   //     taskId:'1'
+//   //   })
+//   //   console.log('testTag', '********' + JSON.stringify(res))
+//   //   obj = JSON.parse(JSON.stringify(res))
+//   //   return obj
+//   // }
+//   //传进来
+//   // aboutToAppear(){
+//   //   for (let index = 0; index < this.Mposition.length; index++) {
+//   //     let details: outboundRequestData = {}
+//   //     details.materialName = this.Mposition[index].materialName
+//   //     details.num=this.Mposition[index].num
+//   //     details.materialNo=this.Mposition[index].materialNo
+//   //     details.spec=this.Mposition[index].spec
+//   //     details.batchCode=this.Mposition[index].batchCode
+//   //     details.housetype='1'
+//   //     details.locationNo='1-3-2'
+//   //     details.houseNo='1'
+//   //     details.coordinate= '3-2'
+//   //     details.unit='个'
+//   //     details.vehicleCode='XL'+new Date().getTime()
+//   //     details.position='1'
+//   //     this.Mposition.push(details)
+//   //   }
+//   // }
+//   @State private outboundRequest:Array<outboundRequestData>=[]
+//   @Link private Mposition:Array< Materialpositionclass>
+//   @Link code:string
+//   @Link textValue: string
+//   @Link inputValue: string
+//   controller: CustomDialogController
+//   // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
+//   cancel: () => void
+//   confirm: () => void
+//   build(){
+//     Column(){
+//       Column({space:10}){
+//         Text('取出确认')
+//           .width('100%')
+//           .fontSize('51px')
+//           .textAlign(TextAlign.Center)
+//         Row(){
+//           Text('是否取出'+this.code+'?')
+//             .width('100%')
+//             .fontSize('32px')
+//         }.width('80%')
+//         .height('60%')
+//         Row({space:5}){
+//           Text('取消')
+//             .fontWeight(FontWeight.Medium)
+//             .fontSize('32px')
+//             .width('48%')
+//             .textAlign(TextAlign.Center)
+//             .height('100%')
+//             .fontColor('#0A59F7')
+//             .backgroundColor('#F1F3F5')
+//             .borderRadius(21)
+//             .onClick(()=>{
+//               this.controller.close()
+//             })
+//           Text('确认')
+//             .fontWeight(FontWeight.Medium)
+//             .fontSize('32px')
+//             .borderRadius(21)
+//             .textAlign(TextAlign.Center)
+//             .height('100%')
+//             .width('48%')
+//             .fontColor('#0A59F7')
+//             .backgroundColor('#F1F3F5')
+//             .onClick(()=>{
+//               // this. outboundData ().then((res : outboundRequestData[]) => {
+//               //   console.log('testTag', '入库数据成功'+JSON.stringify(res))
+//               //   if (res && res.length > 0) {
+//               //     //
+//               //     for (let index = 0; index < res.length; index++) {
+//               //       console.log('testTag', '-----------index' + index +'-----vehicleNo'+JSON.stringify(res))
+//               //       console.log('testTag', '-----------index' + index +'-----list'+JSON.stringify(res))
+//               //     }
+//               //     this. outboundRequest = res
+//               //   }
+//               // })
+//               // console.log("4632957"+JSON.stringify(this.outboundRequest))
+//               // this.controller.close()
+//             })
+//         }
+//         .justifyContent(FlexAlign.Center)
+//         .borderRadius(15)
+//         .width('80%')
+//
+//         .height('20%')
+//
+//
+//       }.width('100%')
+//       .padding(10)
+//       .height('100%')
+//       .borderRadius(15)
+//       .backgroundColor('#FFFF')
+//     }.width("50%")
+//     .height("40%")
+//     .backgroundColor('#4d000000')
+//   }
+//
+// }
+// @CustomDialog
+// struct ChuKUA {
+//   @State private Mposition:Array<Materialpositionclass>=[]
+//   @State private SelectMaterial:Array<SelectMaterialslist>=[]
+//   @State material:string=''
+//   @State taskNo:string=''
+//   ////确认弹窗
+//   @State code:string=''
+//   dialogController: CustomDialogController = new CustomDialogController({
+//     builder: positionok({
+//       Mposition:this.Mposition,
+//       code:this.code,
+//       textValue: $textValue,
+//       inputValue: $inputValue
+//     }),
+//     autoCancel: true,
+//     alignment: DialogAlignment.Center,
+//     customStyle: true
+//   })
+//   Tasklistoutbound = async() : Promise<Tasklist[]> => {
+//     let obj: Tasklist[] = []
+//     let res : Tasklist[]= await StorageRequest.post("/api/v1/task/list", {
+//       type: 2
+//     }as  RequestParamModel)
+//     console.log('testTag', 'Tasklist成功' + JSON.stringify(res))
+//     obj = JSON.parse(JSON.stringify(res))
+//     console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+//     return obj
+//   }
+//   // SelectMaterials = async() : Promise<SelectMaterialslist[]> => {
+//   //   let res:SelectMaterialslist[] = await StorageRequest.post("/api/v1/task/page", {
+//   //     pageNo: 1,
+//   //     taskNo:this.taskNo
+//   //   }as  RequestParamModel)
+//   //   console.log('testTag', '********' + JSON.stringify(res))
+//   //   let obj :SelectMaterialslist[]= JSON.parse(JSON.stringify(res))
+//   //   console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj.records));
+//   //   this.SelectMaterial=obj
+//   //   return obj.records
+//   // }
+//   ///位置请求
+//   Materialposition = async() : Promise< Materialpositionclass[]> => {
+//     let obj: Materialpositionclass[] = []
+//     let res:Materialpositionclass = await StorageRequest.post("/api/v1/stock/list", {
+//       materialName:this.material as string
+//     } as  RequestParamModel)
+//     console.log('testTag', '111111成功' + JSON.stringify(res))
+//     obj = JSON.parse(JSON.stringify(res))
+//     console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+//     this.Mposition=obj
+//     return obj
+//   }
+//   aboutToAppear(){
+//
+//     this.Tasklistoutbound().then((res : Tasklist[]) => {
+//       console.log('testTag', 'result cccccc'+JSON.stringify(res))
+//       if (res && res.length > 0) {
+//         this.TasklistoutboundData = res
+//         this.taskNo=this.TasklistoutboundData[0].taskNo
+//         this.SelectMaterials().then((res : SelectMaterialslist[]) => {
+//           console.log('testTag', 'result cccccc'+JSON.stringify(res))
+//           if (res && res.length > 0) {
+//             this.SelectMaterial = res
+//             this.material= this.SelectMaterial[0].materialName
+//             this.Materialposition().then((res :Materialpositionclass[]) => {
+//               console.log('testTag', 'result cccccc'+JSON.stringify(res))
+//               if (res && res.length > 0) {
+//                 this.Mposition = res
+//               }
+//             })
+//           }
+//         })
+//       }
+//     })
+//
+//
+//   }
+//
+//
+//   @State private TasklistoutboundData:Array<Tasklist>=[]
+//   @Link CunQuHuo:number
+//   scroller: Scroller = new Scroller()
+//   @State SelectableMarker:number=0
+//   @State SelectableMarkerOne:number=0
+//   @State SelectableMarkertwo:number=0
+//   @Link textValue: string
+//   @Link inputValue: string
+//   controller: CustomDialogController
+//   // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
+//   cancel: () => void
+//   confirm: () => void
+//   build() {
+//     Column() {
+//       Column(){
+//         Text('取物料')
+//           .fontWeight(FontWeight.Medium)
+//           .textAlign(TextAlign.Center)
+//           .fontColor('#ffff')
+//           .fontSize('51px')
+//       }.width('100%')
+//       .justifyContent(FlexAlign.Center)
+//       .height('10%')
+//       .padding(10)
+//       Row(){
+//         Text('出库')
+//           .fontSize('40px')
+//           .width('30%')
+//           .padding(10)
+//           .fontColor('#ffff')
+//         Text('选择物料')
+//           .fontSize('40px')
+//           .width('30%')
+//           .padding(10)
+//           .fontColor('#ffff')
+//         Text('取出位置')
+//           .fontSize('40px')
+//           .width('30%')
+//           .padding(10)
+//           .fontColor('#ffff')
+//       }.width('100%')
+//       .height('5%')
+//       .padding({left:10})
+//       Row({space:20}){
+//         Column(){
+//           Grid(this.scroller) {
+//             ForEach(this.TasklistoutboundData, (item:Tasklist ,index:number) => {
+//               //    ForEach(this.Number, (day: string) => {
+//               GridItem() {
+//                 Row(){
+//                   Column(){
+//                     Text(item.taskName)
+//                       .fontSize('32px')
+//                       .width('100%')
+//                       .height('20%')
+//                     Row(){
+//                       Column({space:10}){
+//                         Text('产品型号:'+item.taskNo)
+//                           .fontSize($r('app.float.robot_state_font_size'))
+//                           .textAlign(TextAlign.Start)
+//                           .fontColor('#99000000')
+//                           .width('100%')
+//                         Text('计划编号:'+item.relPlanNo)
+//                           .fontSize($r('app.float.robot_state_font_size'))
+//                           .textAlign(TextAlign.Start)
+//                           .fontColor('#99000000')
+//                           .width('100%')
+//                         Text('订单编号:'+item.relOrderNo)
+//                           .fontSize($r('app.float.robot_state_font_size'))
+//                           .textAlign(TextAlign.Start)
+//                           .fontColor('#99000000')
+//                           .width('100%')
+//                         Text('出库单号:'+item.relOutOrderNo)
+//                           .fontSize($r('app.float.robot_state_font_size'))
+//                           .textAlign(TextAlign.Start)
+//                           .fontColor('#99000000')
+//                           .width('100%')
+//
+//                         Text('取料进度:'+item.progress)
+//                           .fontSize($r('app.float.robot_state_font_size'))
+//                           .textAlign(TextAlign.Start)
+//                           .fontColor('#99000000')
+//                           .width('100%')
+//
+//                       }
+//                       .justifyContent(FlexAlign.Center)
+//                       .width('100%')
+//                       .height('100%')
+//                     } .width('100%')
+//                     .height('80%')
+//                   }.width('100%')
+//                   .padding({left:20,right:20})
+//                   .borderRadius(10)
+//                   .alignItems(HorizontalAlign.Start)
+//                   .justifyContent(FlexAlign.Center)
+//                   .height('100%')
+//                   .onClick(()=>{
+//                     this.taskNo=item.taskNo
+//                   })
+//
+//                 }
+//                 .padding(10)
+//                 .borderRadius(10)
+//                 .height('30%')
+//                 .backgroundColor(this.SelectableMarker===index?
+//                 $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
+//
+//               }
+//               .onClick(()=>{
+//                 this.SelectableMarker=index
+//               })
+//             })
+//           }
+//           .onClick(()=>{
+//             this.CunQuHuo=1
+//           })
+//           .padding(10)
+//           .columnsTemplate('1fr')
+//           .columnsGap(10)
+//           .rowsGap(10)
+//           .onScrollIndex((first: number) => {
+//             console.info(first.toString())
+//           })
+//           .width('100%')
+//           .height('100%')
+//         }.width('25%')
+//         .height('100%')
+//         Divider().vertical(true)
+//           .color('#ffff')
+//           .width('1%')
+//           .height('100%')
+//         ////选择物料
+//         Column(){
+//           Grid(this.scroller) {
+//             ForEach(this.SelectMaterial, (item:SelectMaterialslist,index:number) => {
+//               //    ForEach(this.Number, (day: string) => {
+//               GridItem() {
+//                 Row(){
+//                   Column(){
+//                     Blank()
+//                     Text(item.materialName)
+//                       .fontSize('32px')
+//                       .fontWeight(FontWeight.Medium)
+//                     Text(item.materialNo)
+//                       .fontSize('27px')
+//                     Blank()
+//
+//                     Text(item.completedNum.toString()+'/'+item.num.toString())
+//                       .fontWeight(FontWeight.Bold)
+//                       . fontSize('32px')
+//                       .fontColor('#e6000000')
+//                     Text(item.state===0||1?"待处理":item.state===2?"处理中":item.state===3?"处理异常":"已完成")
+//                       .fontSize('32px')
+//                     Blank()
+//
+//                   }.width('100%')
+//                   .padding(10)
+//                   .borderRadius(10)
+//                   .alignItems(HorizontalAlign.Start)
+//                   .justifyContent(FlexAlign.Center)
+//                   .height('100%')
+//                 }
+//                 .padding(10)
+//                 .borderRadius(10)
+//                 .height('30%')
+//                 .backgroundColor(this.SelectableMarkerOne===index?
+//                 $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
+//               }
+//               .onClick(()=>{
+//                 this.material= item.materialName
+//                 console.log('好了111111'+item.materialName)
+//                 // this.Materialposition()
+//                 this.SelectableMarkerOne=index
+//               })
+//             })
+//           }
+//           .onClick(()=>{
+//             this.CunQuHuo=1
+//           })
+//           .padding(10)
+//           .columnsTemplate('1fr')
+//           .columnsGap(10)
+//           .rowsGap(10)
+//           .onScrollIndex((first: number) => {
+//             console.info(first.toString())
+//           })
+//           .width('100%')
+//
+//           .height('100%')
+//
+//         }.width('25%')
+//         .height('100%')
+//         Divider().vertical(true)
+//           .color('#ffff')
+//           .width('1%')
+//           .height('100%')
+//         //物料位置
+//         Column(){
+//           Grid(this.scroller) {
+//             ForEach(this.Mposition, (item:Materialpositionclass,index:number) => {
+//               GridItem() {
+//                 Row(){
+//                   Column(){
+//                     Text(item.locationNo)
+//                       .fontSize('32px')
+//                       .fontWeight(FontWeight.Medium)
+//                     Text(item.batchCode)
+//                       .fontSize('32px')
+//                       .fontWeight(FontWeight.Medium)
+//                     Blank()
+//                     Row(){
+//                       Text(item.num.toString())
+//                         .fontSize('51px')
+//                         .fontWeight(FontWeight.Bold)
+//                       Text('个')
+//                         .fontSize('32px')
+//                         .fontWeight(FontWeight.Medium)
+//                     }
+//
+//                   }.width('100%')
+//                   .padding(10)
+//                   .borderRadius(10)
+//                   .alignItems(HorizontalAlign.Start)
+//                   .justifyContent(FlexAlign.Center)
+//                   .height('100%')
+//
+//                 }
+//                 .padding(10)
+//                 .borderRadius(10)
+//                 .height('30%')
+//                 .backgroundColor(this.SelectableMarkertwo===index?
+//                 $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
+//                 .onClick(()=>{
+//                   this.dialogController.open()
+//                   this.SelectableMarkertwo=index
+//                   this.code= item.batchCode
+//                 })
+//
+//               }
+//               .padding({left:20})
+//
+//             })
+//           }
+//           .onClick(()=>{
+//             this.CunQuHuo=1
+//           })
+//           .padding(10)
+//           .columnsTemplate('1fr 1fr')
+//           .columnsGap(10)
+//           .rowsGap(10)
+//           .onScrollIndex((first: number) => {
+//             console.info(first.toString())
+//           })
+//           .width('100%')
+//           .height('100%')
+//         }.width('37%')
+//         .height('100%')
+//       }.width('100%')
+//       .height('75%')
+//       .padding(10)
+//       Row(){
+//         Image($r('app.media.close'))
+//
+//           .width('115px')
+//           .height('115px')
+//           .onClick(()=>{
+//             this.controller.close()
+//           })
+//       }.width('100%')
+//       .justifyContent(FlexAlign.Center)
+//       .height('10%')
+//
+//     }.width('100%')
+//     .backgroundColor('#99000000')
+//     .height('100%')
+//
+//     // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。
+//   }
+// }
+// @CustomDialog
+//
+// @Entry
+// @Component
+// export struct Workbin{
+//   @State textValue: string = ''
+//   @State inputValue: string = ''
+//   scroller: Scroller = new Scroller()
+//   onCancel() {
+//     console.info('onCancel')
+//   }
+//   onAccept() {
+//     console.info(' onAccept')
+//   }
+//   existApp() {
+//     console.info(' existApp')
+//   }
+//   @State ZhuangTai:number=0
+//   @State CunQuHuo:number=0
+//   MaterialRetrievalController: CustomDialogController = new CustomDialogController({
+//     builder: ChuKUA({
+//       CunQuHuo:this.CunQuHuo,
+//       cancel: this.onCancel,
+//       confirm: this.onAccept,
+//       textValue: $textValue,
+//       inputValue: $inputValue,
+//
+//
+//     }),
+//
+//     // gridCount: 3,
+//     cancel: this.existApp,
+//     //autoCancel: true,
+//     alignment: DialogAlignment.Bottom,
+//     //offset: { dx: 0, dy: -20 },
+//     gridCount: 4,
+//     customStyle: true,
+//   })
+//
+//   build(){
+//     Row({space:15}){
+//       Row(){
+//         Column(){
+//           Text('取物料')
+//             .fontSize('32px')
+//             .fontWeight(FontWeight.Medium)
+//           Text('查找物料')
+//             .fontSize('27px')
+//
+//         }.width('90%')
+//         .borderRadius(15)
+//         .backgroundColor('#ffff')
+//         .alignItems(HorizontalAlign.Start)
+//         .justifyContent(FlexAlign.Center)
+//         .height('100%')
+//         .onClick(()=>{
+//           this. MaterialRetrievalController.open()
+//         })
+//         Column(){
+//           Image($r('app.media.jiaobiao'))
+//             .width('27px')
+//             .height('27px')
+//         }.width('10%')
+//         .justifyContent(FlexAlign.End)
+//         .height('100%')
+//         .backgroundColor('#ffff')
+//
+//       }
+//       .backgroundColor('#ffff')
+//       .padding(10)
+//       .width('45%')
+//       .borderRadius(15)
+//       .height('100%')
+//
+//
+//       Row(){
+//         Column(){
+//           Text('返回料箱')
+//             .fontSize('32px')
+//             .fontWeight(FontWeight.Medium)
+//           Text('LX1524742389')
+//             .fontSize('27px')
+//
+//         }.width('90%')
+//         .borderRadius(15)
+//         .backgroundColor('#ffff')
+//         .alignItems(HorizontalAlign.Start)
+//         .justifyContent(FlexAlign.Center)
+//         .height('100%')
+//         Column(){
+//           Image($r('app.media.jiaobiao'))
+//             .width('27px')
+//             .height('27px')
+//         }.width('10%')
+//         .justifyContent(FlexAlign.End)
+//         .height('100%')
+//
+//       }
+//       .padding(10)
+//       // .onClick(()=>{
+//       //   this.bufferhopperController.open()
+//       // })
+//       .backgroundColor('#ffff')
+//       .width('45%')
+//       .borderRadius(15)
+//       .height('100%')
+//
+//     }.width('100%')
+//     .padding({left:10})
+//     .height('100%')
+//   }
+// }

+ 99 - 0
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -0,0 +1,99 @@
+import StorageInfo from '../../model/StorageInfo'
+import MaterialInfo from '../../model/MaterialInfo'
+import ProcessAlarmData from '../../model/processmodel/ProcessAlarmData'
+import ProcessHandleData from '../../model/processmodel/ProcessHandleData'
+import ProcessStandardData from '../../model/processmodel/ProcessStandardData'
+import ProductInfo from '../../model/processmodel/ProductInfo'
+import RobotInfo from '../../model/RobotInfo'
+import HashMap from '@ohos.util.HashMap'
+import DictValue from '../../model/DictValue'
+
+export default class CommonConstants {
+  static readonly RDB_NAME : string = 'Presentation.db'
+  static readonly PRE_NAME : string = 'MyPreferences'
+  static AUTH_TOKEN : string = ''
+  // 附件地址前缀
+  static FILE_URL_PREFIX : string = 'http://192.168.101.4:9000'
+
+  static DICT_DATA: HashMap<string, DictValue[]> = new HashMap<string, DictValue[]>()
+
+  // 当前登录用户相关信息
+  static USER_ID? : number = 1
+  static USER_NAME: string = ''
+  static USER_AVATAR: string = ''
+  static STATION_NANE: string = ''
+  static STATION_ID: number
+  static stationDictValue: string=''
+  // 是否是退出登陆
+  static LOGIN_OUT: boolean = false
+
+  static readonly STORAGE_TYPE: string[] =  ['电子元器件', '电路板', '结构件', '辅助材料']
+  static readonly PARK_TYPE: string[] =  ['出入库位置', '充电位置', '工作台', '其他']
+
+  static readonly ROBOTS: RobotInfo[] = [
+    {id:1, robotCode:'JGRR1135554213', storageId:1, robotType:2, robotToward: 2, x:3, y:2, lastSelfCheck: '2024/02/16 11:11:34'}as RobotInfo,
+    {id:2, robotCode:'JGRR1123554233', storageId:1, robotType:2, robotToward: 1, x:1, y:2, lastSelfCheck: '2024/02/16 10:56:34'}as RobotInfo,
+    {id:3, robotCode:'JGRR1147006978', storageId:1, robotType:2, robotToward: 3, x:6, y:2, lastSelfCheck: '2024/02/16 14:23:34'}as RobotInfo,
+  ]
+
+  // 工步展示图
+  static readonly STEP_IMAGES: Resource[] = [
+    $r('app.media.material_collect_black'), $r('app.media.record_item_black'), $r('app.media.multimedia_collect_black'),
+    $r('app.media.esop_black'), $r('app.media.spot_check_black'), $r('app.media.equip_record_black'),
+    $r('app.media.fixture_black'), $r('app.media.debug_pair_black'), $r('app.media.nameplate_bind_black'),
+  ]
+
+  // 工步选中展示图
+  static readonly STEP_SELECT_IMAGES: Resource[] = [
+    $r('app.media.material_collect_white'), $r('app.media.record_item_white'), $r('app.media.multimedia_collect_white'),
+    $r('app.media.esop_white'), $r('app.media.spot_check_white'), $r('app.media.equip_record_white'),
+    $r('app.media.fixture_white'), $r('app.media.debug_pair_white'), $r('app.media.nameplate_bind_white'),
+  ]
+
+  // 物料列表
+  static readonly MATERIAL_ARRAY: MaterialInfo[] = [
+    {id:1, materialNo:'111', materialName: 'PACA-ASSSD电路板', needNum: 5, storeNum: 100},
+    {id:2, batchCode:'222', materialName: '小号螺丝', needNum: 100, storeNum: 100},
+    {id:3, materialNo:'333', materialName: '中号螺丝', needNum: 5, storeNum: 100},
+    {id:4, batchCode:'444', materialName: '中号螺帽', needNum: 5, storeNum: 100},
+    {id:5, batchCode:'555', materialName: '大号螺帽', needNum: 5, storeNum: 100},
+  ]
+
+  // 辅料类型
+  static readonly AUX_MATERIAL_TYPES: string[] = [
+    '粘胶', '药剂', '酒精', '隔热垫板', '防尘罩'
+  ]
+  // 辅料小类
+  static readonly AUX_MATERIAL_SUBCLASSES: string[][] = [
+    ['双面胶', '热熔胶', '绝缘胶布', '防震胶', 'AB胶'],
+    ['A药剂', 'B药剂'],
+    ['30%酒精', '50%酒精', '70%酒精', '90%酒精'],
+    ['石棉隔热垫板', '蜂窝隔热垫板'],
+    ['塑料防尘罩', '金属防尘罩'],
+  ]
+
+  // 加工工艺数据
+  static readonly HANDLE_DATA: Array<ProcessHandleData> = [
+    {step: 1, moment: 1.1121, momentUnit: 'N.m', rotate: 3610, rotateUnit: '°', handleState: 1},
+    {step: 2, moment: 1.4547, momentUnit: 'N.m', rotate: 6194.4, rotateUnit: '°', handleState: 2},
+    {step: 3, moment: 1.2356, momentUnit: 'N.m', rotate: 2800, rotateUnit: '°', handleState: 2}
+  ];
+
+  // 标准施工工艺告警数据
+  static readonly ALARM_DATA: Array<ProcessAlarmData> = [
+    {alarmType: 1, alarmTypeCode: 'NG', alarmStr: '圈数过多'},
+    {alarmType: 2, alarmTypeCode: 'NG', alarmStr: '圈数不足'},
+    {alarmType: 3, alarmTypeCode: 'NM', alarmStr: '力矩过大'},
+    {alarmType: 4, alarmTypeCode: 'NM', alarmStr: '力矩不足'},
+  ];
+
+  // 标准施工工艺数据
+  static readonly STANDARD_DATA: Array<ProcessStandardData> = [
+    {step: 1, momentMin: 1.1, momentMax: 1.2, momentUnit: 'N.m', rotateMin: 3600, rotateMax: 3650, rotateUnit: '°'},
+    {step: 2, momentMin: 1.4, momentMax: 1.5, momentUnit: 'N.m', rotateMin: 4500, rotateMax: 5500, rotateUnit: '°'},
+    {step: 3, momentMin: 1.2, momentMax: 1.3, momentUnit: 'N.m', rotateMin: 2600, rotateMax: 3500, rotateUnit: '°'},
+  ];
+
+  //万能卡片
+  static readonly CARD_TYPE_DATA: number[] = [3,1,5];
+}

+ 53 - 0
entry/src/main/ets/common/util/PreferencesUtil.ts

@@ -0,0 +1,53 @@
+import preferences from '@ohos.data.preferences';
+
+class PreferencesUtil{
+
+  prefMap: Map<string, preferences.Preferences> = new Map()
+
+  async loadPreference(context, name: string){
+    try { // 加载preferences
+      let pref = await preferences.getPreferences(context, name)
+      this.prefMap.set(name, pref)
+      console.log('testTag', `加载Preferences[${name}]成功`)
+    } catch (e) {
+      console.log('testTag', `加载Preferences[${name}]失败`, JSON.stringify(e))
+    }
+  }
+
+  async putPreferenceValue(name: string, key: string, value: preferences.ValueType){
+    if (!this.prefMap.has(name)) {
+      console.log('testTag', `Preferences[${name}]尚未初始化!`)
+      return
+    }
+    try {
+      let pref = this.prefMap.get(name)
+      // 写入数据
+      await pref.put(key, value)
+      // 刷盘
+      await pref.flush()
+      console.log('testTag', `保存Preferences[${name}.${key} = ${value}]成功`)
+    } catch (e) {
+      console.log('testTag', `保存Preferences[${name}.${key} = ${value}]失败`, JSON.stringify(e))
+    }
+  }
+
+  async getPreferenceValue(name: string, key: string, defaultValue: preferences.ValueType){
+    if (!this.prefMap.has(name)) {
+      console.log('testTag', `Preferences[${name}]尚未初始化!`)
+      return
+    }
+    try {
+      let pref = this.prefMap.get(name)
+      // 读数据
+      let value = await pref.get(key, defaultValue)
+      console.log('testTag', `读取Preferences[${name}.${key} = ${value}]成功`)
+      return value
+    } catch (e) {
+      console.log('testTag', `读取Preferences[${name}.${key} ]失败`, JSON.stringify(e))
+    }
+  }
+}
+
+const preferencesUtil = new PreferencesUtil()
+
+export default preferencesUtil as PreferencesUtil

+ 221 - 0
entry/src/main/ets/common/util/RobotControlUtil.js

@@ -0,0 +1,221 @@
+class RobotControlUtil {
+
+    /**
+     * 查询机器人当前模式
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果(1:成功 2:失败)
+     * 		    Array[1]: 失败原因
+     * 		    Array[2]: 机器人模式(???? 1:调试模式 2:自动模式)
+     */
+    static queryMode (robotId){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 查询机器人当前坐标
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果(1:成功 2:失败)
+     * 		    Array[1]: 失败原因
+     * 		    Array[2]: x坐标
+     * 		    Array[3]: y坐标
+     * 		    Array[4]: 仓储机器人的朝向(1:+x 2:-x 3:+y 4:-y)
+     */
+    static queryCoordinate (robotId){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 查询机器人当前状态
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果(1:成功 2:失败)
+     * 		    Array[1]: 失败原因
+     * 		    Array[2]: 状态(????? 1:充电中 2:未充电)
+     */
+    static queryState (robotId){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 查询机器人电量
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果(1:成功 2:失败)
+     * 		    Array[1]: 失败原因
+     * 		    Array[2]: 电量(?????百分比 80/80%)
+     */
+    static queryBatteryLevel (robotId){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 查询机器人电压
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果(1:成功 2:失败)
+     * 		    Array[1]: 失败原因
+     * 		    Array[2]: 电压值
+     * 		    Array[3]: 电压值
+     */
+    static queryVoltage (robotId){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 查询机器人电流
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果(1:成功 2:失败)
+     * 		    Array[1]: 失败原因
+     * 		    Array[2]: 电流值
+     * 		    Array[3]: 电流值
+     */
+    static queryCurrent (robotId){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 移动指定坐标
+     * @param   robotId: 机器人id
+     *          x: x坐标
+     *          y: y坐标
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static moveTo (robotId, x, y){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 修改模式
+     * @param   robotId: 机器人id
+     *          modeType: 机器人模式(???? 1:调试模式 2:自动模式)
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static editMode (robotId, modeType){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 电机控制(通电/断电)
+     * @param   robotId: 机器人id
+     *          motorSet: 电机控制(1:通电 2:断电)
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static motorControl (robotId, motorSet){
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 修改机器人坐标
+     * @param   robotId: 机器人id
+     *          x: x坐标
+     *          y: y坐标
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static editCoordinate (robotId, x, y) {
+        var array = new Array();
+        array.push("1");
+        array.push("2");
+        return array;
+    }
+
+    /**
+     * 机器人移动一格
+     * @param   robotId: 机器人id
+     *          direction:(1:+x 2:-x 3:+y 4:-y)
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static moveOneGrid (robotId, direction) { }
+
+    /**
+     * 机器人中止
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static breakOff (robotId) { }
+
+    /**
+     * 机器人急停
+     * @param   robotId: 机器人id
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static emergencyStop (robotId) { }
+
+    /**
+     * 车轮控制
+     * @param   robotId: 机器人id
+     *          wheelSet: 设置车轮(1:置顶 2:置中 3:置底)
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static wheelControl (robotId, wheelSet) { }
+
+    /**
+     * 吊篮控制
+     * @param   robotId: 机器人id
+     *          basketSet: 吊篮设置(1:提起 2:放下 3:急停)
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static basketControl (robotId, basketSet) { }
+
+    /**
+     * 爪夹控制
+     * @param   robotId: 机器人id
+     *          clawSet: 爪夹控制(1:张开 2:闭合)
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static clawControl (robotId, clawSet) { }
+
+    /**
+     * 充电控制
+     * @param   robotId: 机器人id
+     *          chargeSet: 充电控制(1:张开 2:闭合)
+     * @return  Array[0]: 执行结果
+     * 		    Array[1]: 失败信息
+     * 		    Array[2]: …………
+     */
+    static chargeControl (robotId, chargeSet) { }
+}

+ 24 - 0
entry/src/main/ets/common/util/TimeUtil.ets

@@ -0,0 +1,24 @@
+class TimeUtil {
+
+  getCurrentDate(): string {
+    let dateTime = new Date()
+    let month: string = JSON.stringify(dateTime.getMonth() + 1)
+    let time = dateTime.getFullYear() + '-' + (dateTime.getMonth() + 1).toString().padStart(2, '0')
+      + '-' + (dateTime.getDate().toString().padStart(2, '0'))
+    return time
+  }
+
+  getCurrentTime(): string {
+    let dateTime = new Date()
+    let time = dateTime.getFullYear() + '-' + (dateTime.getMonth() + 1).toString().padStart(2, '0')
+      + '-' + (dateTime.getDate().toString().padStart(2, '0')) + ' ' +
+      (dateTime.getHours().toString().length == 1 ? '0' + dateTime.getHours() : dateTime.getHours()) + ':'
+      + (dateTime.getMinutes().toString().length == 1 ? '0' + dateTime.getMinutes() : dateTime.getMinutes()) + ':'
+      + (dateTime.getSeconds().toString().length == 1 ? '0'+ dateTime.getSeconds(): dateTime.getSeconds())
+    return time
+  }
+}
+
+let timeUtil = new TimeUtil();
+
+export default timeUtil as TimeUtil;

+ 68 - 0
entry/src/main/ets/common/util/request/EquipmentRequest.ets

@@ -0,0 +1,68 @@
+import axios, { AxiosError, AxiosResponse, AxiosRequestHeaders,AxiosRequestConfig, CreateAxiosDefaults,InternalAxiosRequestConfig } from '@ohos/axios';
+import CommonConstants from '../../constants/CommonConstants';
+//import PreferencesUtil from '../PreferencesUtil';
+import { printError, printRequest, printResponse, handleRes } from './Helps';
+
+//const baseUrl = "http://192.168.137.5:8000/"
+//const baseUrl = "http://0.0.0.0:8000/"
+const baseUrl = "http://10.88.19.120:8000/"
+const DEBUG = true //
+
+// 创建实例
+const JGRequest = axios.create(
+  {
+    baseURL: baseUrl,
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    timeout: 60 * 1000,
+  }
+)
+
+// 添加请求拦截器
+JGRequest.interceptors.request.use((config: InternalAxiosRequestConfig) => {
+
+  // 以后登录之后可以在这里传
+  //config.headers.Authorization = CommonConstants.AUTH_TOKEN
+  //  config.headers.Authorization="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOnsiaWQiOjM3LCJsb2dpblR5cGUiOiJhaW8ifSwiZGV2aWNlIjoiYWlvIiwiZWZmIjoxNzE3NTExMjYwODI4LCJyblN0ciI6InRSenNBTGdlZ3lqS0FHeDZTSkdYZTNLbFY3eWh1OG1PIn0.FVAeESiz_PH1NtBFDmGZr0IwtXzubV2d8JTQdGdJnxc"
+  printRequest(config)
+
+  return config;
+}, (error:AxiosError) => {
+  // 对请求错误做些什么
+  printError(error)
+  return Promise.reject(error);
+});
+// 添加响应拦截器
+JGRequest.interceptors.response.use((response: AxiosResponse)=> {
+  // 对响应数据做点什么
+  printResponse(response)
+
+  let res = handleRes(response)
+  let success = res[0] as boolean
+  let msg = res[1] as string
+  // console.log('textTag'+"handleRes的返回结果 ", success, msg)
+
+  if (success) {
+  //  console.log('textTag'+"handleRes的返回结果 ", JSON.stringify(response.data))
+   // return response.data.data;
+    return response.data;
+  }
+  else {
+    return Promise.reject<string>(msg)
+
+  }
+
+}, (error:AxiosError)=> {
+  // 对响应错误做点什么
+  printError(error)
+
+  return Promise.reject(error);
+});
+
+
+export default JGRequest;
+
+
+
+

+ 85 - 0
entry/src/main/ets/common/util/request/Request.ets

@@ -0,0 +1,85 @@
+import axios, { AxiosError, AxiosResponse, AxiosRequestHeaders,AxiosRequestConfig, CreateAxiosDefaults,InternalAxiosRequestConfig } from '@ohos/axios';
+import CommonConstants from '../../constants/CommonConstants';
+//import PreferencesUtil from '../PreferencesUtil';
+import { printError, printRequest, printResponse, handleRes } from './Helps';
+
+ const baseUrl = "http://121.41.179.41:8079/"
+//const baseUrl = "http://10.88.19.200:8079/"
+const DEBUG = true //
+
+// 创建实例
+const JGRequest = axios.create(
+  {
+    baseURL: baseUrl,
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8',
+    },
+    timeout: 60 * 1000,
+  }
+)
+
+// 添加请求拦截器
+JGRequest.interceptors.request.use((config: InternalAxiosRequestConfig) => {
+
+  // 以后登录之后可以在这里传
+  config.headers.Authorization = CommonConstants.AUTH_TOKEN
+  //  config.headers.Authorization="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOnsiaWQiOjM3LCJsb2dpblR5cGUiOiJhaW8ifSwiZGV2aWNlIjoiYWlvIiwiZWZmIjoxNzE3NTExMjYwODI4LCJyblN0ciI6InRSenNBTGdlZ3lqS0FHeDZTSkdYZTNLbFY3eWh1OG1PIn0.FVAeESiz_PH1NtBFDmGZr0IwtXzubV2d8JTQdGdJnxc"
+  printRequest(config)
+
+  return config;
+}, (error:AxiosError) => {
+  // 对请求错误做些什么
+  printError(error)
+  return Promise.reject(error);
+});
+// 添加响应拦截器
+JGRequest.interceptors.response.use((response: AxiosResponse)=> {
+  // 对响应数据做点什么
+  printResponse(response)
+
+  let res = handleRes(response)
+  let success = res[0] as boolean
+  let msg = res[1] as string
+  // console.debug("handleRes的返回结果 ", success, msg)
+
+  if (success) {
+    return response.data.data;
+  }
+  else {
+    return Promise.reject<string>(msg)
+  }
+
+}, (error:AxiosError)=> {
+  // 对响应错误做点什么
+  printError(error)
+
+  return Promise.reject(error);
+});
+// // 添加响应拦截器
+// JGRequest.interceptors.response.use((response: AxiosResponse)=> {
+//   // 对响应数据做点什么
+//   printResponse(response)
+//
+//   let [success, msg] = handleRes(response)
+//   // console.debug("handleRes的返回结果 ", success, msg)
+//
+//   if (success) {
+//     return response.data.data;
+//   }
+//   else {
+//     return Promise.reject(msg)
+//   }
+//
+// }, (error:AxiosError)=> {
+//   // 对响应错误做点什么
+//   printError(error)
+//
+//   return Promise.reject(error);
+// });
+
+
+export default JGRequest;
+
+
+
+

+ 37 - 0
entry/src/main/ets/common/util/request/RequestInstance.ets

@@ -0,0 +1,37 @@
+// import UserInfo from '../../../model/UserInfo'
+// import RequestParamModel from '../../../viewmodel/RequestParamModel'
+// import JGRequest from './Request'
+//
+// const getToken = async (loginName: string, password: string, orgId: number, stationId: number): Promise<string> => {
+//   return await JGRequest.post("/api/auth/aioLogin", {
+//     userName: loginName,
+//     password: password,
+//     orgId: orgId,
+//     stationId: stationId,
+//   }as RequestParamModel)
+// }
+//
+// const getUserInfo = async (): Promise<UserInfo> => {
+//   return await JGRequest.get("/api/auth", {})
+// }
+//
+// export{getToken, getUserInfo}
+import UserInfo from '../../../model/UserInfo'
+import RequestParamModel2 from '../../../viewmodel/RequestParamModel2'
+import JGRequest from './Request'
+
+const getToken = async (loginName: string, password: string, orgId: number, stationId: string): Promise<string> => {
+  return await JGRequest.post("/api/auth/aioLogin", {
+    userName: loginName,
+    password: password,
+    orgId: orgId,
+    stationId: stationId,
+  }as RequestParamModel2)
+}
+
+const getUserInfo = async (): Promise<UserInfo> => {
+  return await JGRequest.get("/api/auth", {})
+}
+
+export{getToken, getUserInfo}
+

+ 63 - 0
entry/src/main/ets/common/util/request/StorageRequest.ets

@@ -0,0 +1,63 @@
+import axios, { AxiosError, AxiosResponse, AxiosRequestHeaders,AxiosRequestConfig, CreateAxiosDefaults,InternalAxiosRequestConfig } from '@ohos/axios';
+import CommonConstants from '../../constants/CommonConstants';
+import { printError, printRequest, printResponse, handleRes } from './Helps';
+
+ const baseUrl = "http://121.41.179.41:8079/"
+//const baseUrl = "http://10.88.19.200:8079/"
+const DEBUG = true //
+
+// 创建实例
+const StorageRequest = axios.create(
+
+  {
+    baseURL: baseUrl,
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8',
+    },
+    timeout: 60 * 1000,
+  }
+)
+
+// 添加请求拦截器
+StorageRequest.interceptors.request.use((config: InternalAxiosRequestConfig) => {
+
+  // 以后登录之后可以在这里传
+  config.headers.Authorization = CommonConstants.AUTH_TOKEN
+ // config.headers.Authorization ="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOnsiaWQiOjM3LCJsb2dpblR5cGUiOiJhaW8ifSwiZGV2aWNlIjoiYWlvIiwiZWZmIjoxNzE3NTExMjYwODI4LCJyblN0ciI6InRSenNBTGdlZ3lqS0FHeDZTSkdYZTNLbFY3eWh1OG1PIn0.FVAeESiz_PH1NtBFDmGZr0IwtXzubV2d8JTQdGdJnxc"
+  printRequest(config)
+  return config;
+}, (error:AxiosError) => {
+  // 对请求错误做些什么
+  printError(error)
+  return Promise.reject(error);
+});
+
+
+// 添加响应拦截器
+StorageRequest.interceptors.response.use((response: AxiosResponse)=> {
+  console.log("testTag", "---------------------------")
+  // 对响应数据做点什么
+  printResponse(response)
+    let res = handleRes(response)
+    let success = res[0] as boolean
+    let msg = res[1] as string
+  console.debug("handleRes的返回结果 ", success, msg)
+
+  if (success) {
+    return response.data.data;
+  }
+  else {
+    return Promise.reject<string>(msg)
+  }
+
+}, (error:AxiosError)=> {
+  // 对响应错误做点什么
+  printError(error)
+
+  return Promise.reject(error);
+});
+export default StorageRequest;
+
+
+
+

+ 489 - 0
entry/src/main/ets/common/util/request/StorageRequestInstance.ets

@@ -0,0 +1,489 @@
+import StorageRequest from './StorageRequest';
+import List from '@ohos.util.List';
+import { formToJSON } from '@ohos/axios';
+import WorkBinInfo from '../../../model/WorkBinInfo';
+import OutboundData from '../../../model/OutboundDats';
+import RequestParamModel from '../../../viewmodel/RequestParamModel';
+import { records } from '../../../view/Statistics';
+
+// 定义数据类型最好用xxxModel, 所有属性都是可选来适用 as。  在swagger或者控制台 复制返回的json到  https://xiets.gitee.io/json-to-any-web/ 即可获得所有TS类型。
+export interface StorageStatus {
+  //批次号
+  batchCode?: string;
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: string
+  orgId?: string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:string
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+}
+export interface  StorageStatusList {
+  //载具编号
+  vehicleCode?:string
+  //产品规格
+  spec?:string
+  //批次号
+  batchCode?: string;
+  ///完成数量
+  completedNum?:number
+
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //储位坐标
+  coordinate?: string
+  //储位位置
+  position?:string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  planNo?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+
+  vehicleNo?: string
+  pageNo?:number
+  pageSize?:number
+}
+
+export interface taskclass {
+  created?:string
+  creator?: string
+  deptId?: string
+  id?: string
+  //今日报告
+  bugNum?:number
+  //今日完成
+  completeNum?:number
+  //齐套数量
+  kittingNum?:number
+  //今日任务
+  planNum?:number
+  orgId?:string
+  outType?: string
+  progress?: string
+  relOrderNo?: string
+  relOutOrderNo?:string
+  relPlanNo?: string
+  taskName?: string
+  state?:string
+  taskNo?:string
+  type?:string
+  updated?:string
+  materialName?:string
+  updator?:string
+  num?:number
+}
+export interface  StorageStatusList1 {
+  created?:string
+  creator?: string
+  deptId?: string
+  id?: string
+  orgId?:string
+  outType?: string
+  progress?: string
+  relOrderNo?: string
+  relOutOrderNo?:string
+  relPlanNo?: string
+  taskName?: string
+  state?:string
+  taskNo?:string
+  type?:string
+  updated?:string
+  materialName?:string
+  updator?:string
+  num?:number
+  max?:number
+  min?:number
+}
+// 统计占用率请求
+const testGet1 = async () : Promise<StorageStatus> => {
+  let obj: StorageStatus = { } //尽量用{}来定义空对象,如果用null在get属性的时候可能会出错
+  let res:StorageStatus = await StorageRequest.get("/api/v1/position/lineStockState1")
+  obj = res as StorageStatus
+  console.info("testTag", ' -----------------'+JSON.stringify(obj));
+  console.debug('await StorageRequest.get 如果是Promise.reject 就不会执行await后面的代码', obj.batchCode, )
+  return Promise.resolve(obj)
+}
+//任务统计
+const task = async () : Promise<taskclass> => {
+  let obj: taskclass = { } //尽量用{}来定义空对象,如果用null在get属性的时候可能会出错
+  let res:taskclass = await StorageRequest.get("/api/v1/statistics/todayInfo")
+  obj = res as taskclass
+  console.info("testTag", ' -----------------'+JSON.stringify(obj));
+  console.debug('await StorageRequest.get 如果是Promise.reject 就不会执行await后面的代码', obj )
+  return Promise.resolve(obj)
+}
+export interface  PlanClass{
+  productTypeNum?:number
+  unCompletePlan?:number
+
+}
+const Plan = async () : Promise<PlanClass> => {
+  let obj: PlanClass = { } //尽量用{}来定义空对象,如果用null在get属性的时候可能会出错
+  let res:PlanClass = await StorageRequest.get("/api/v1/plan/task/planTaskStatistics")
+  obj = res as PlanClass
+  console.info("testTag", ' -----------------'+JSON.stringify(obj));
+  console.debug('await StorageRequest.get 如果是Promise.reject 就不会执行await后面的代码', obj )
+  return Promise.resolve(obj)
+}
+
+
+// 入库取料箱数据
+export interface  WarehousingBufferHopperList {
+  houseNo?:string;
+  //料箱已存物料信息
+
+  list?: WorkBinInfo[];
+  ///料箱编号-*+9
+  vehicleNo?:string
+}
+const Warehousing = async() : Promise<WarehousingBufferHopperList[]> => {
+  let obj:WarehousingBufferHopperList[] = []
+  let res:WarehousingBufferHopperList = await StorageRequest.post("/api/v1/stock/queryVehicleList", {
+   housetype:1
+  }as RequestParamModel)
+  console.log('testTag', '********' + JSON.stringify(res))
+  obj = JSON.parse(JSON.stringify(res))
+  return obj
+}
+// 入库存料箱
+export interface  BufferHopperclass {
+  // 料箱存入物料信息
+  detailsList?: OutboundData[];
+  // 料箱编号
+  vehicleNo?:string
+}
+const BufferHopper= async() : Promise<BufferHopperclass[]> => {
+  let obj:BufferHopperclass[] = []
+  let res:BufferHopperclass = await StorageRequest.post("/api/v1/wmsOrder/inBox", {
+    detailsList: [],
+    taskId:''
+  }as RequestParamModel)
+  console.log('testTag', '发送成功' + JSON.stringify(res))
+  obj = JSON.parse(JSON.stringify(res))
+  return obj
+}
+///当前库存请求
+const testPost = async() : Promise<StorageStatusList[]> => {
+  let obj: StorageStatusList[] = []
+   let res:StorageStatusList = await StorageRequest.post("/api/v1/stock/list", {
+     houseType:1
+     }as RequestParamModel)
+  console.log('testTag', '&&&&&&&&&&&&' + JSON.stringify(res))
+  obj = JSON.parse(JSON.stringify(res))
+  return obj
+
+  //  StorageRequest.post("/api/v3/task/list", {
+  //   type:1
+  // })
+  //   .then((response)=> {
+  //     let obj = JSON.parse(JSON.stringify(response))
+  //     // obj =
+  //     // JSON.parse(response, StorageStatusList)
+  //     console.log('testTag', '%%%%%%%%%%%%%%' + JSON.stringify(obj))
+  //     return obj
+  //   })
+  //   .catch((error)=> {
+  //     console.info("处理post错误情况",JSON.stringify(error));
+  //   })
+  // return Promise.resolve(obj)
+}
+////出库取料箱出库
+export interface  Tasklist {
+
+  //批次号
+  batchCode?: string;
+  ///完成数量
+  completedNum?:number
+
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  relPlanNo?:string
+  relOrderNo?:string
+  relOutOrderNo?:string
+  progress?:string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+
+}
+const Tasklistoutbound = async() : Promise<Tasklist[]> => {
+  let obj: Tasklist[] = []
+  let res:Tasklist = await StorageRequest.post("/api/v1/task/list", {
+    type: 2
+  }as RequestParamModel)
+  console.log('testTag', 'Tasklist成功' + JSON.stringify(res))
+  obj = JSON.parse(JSON.stringify(res))
+  console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+  return obj
+}
+/////物料位置
+export interface Materialpositionclass {
+  vehicleCode?:string
+  //批次号
+  batchCode?: string;
+  ///完成数量
+  completedNum?:number
+
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+  pageNo?:number
+  pageSize?:number
+}
+// const Materialposition = async() : Promise< Materialpositionclass[]> => {
+//   let obj: Materialpositionclass[] = []
+//   let res:Materialpositionclass = await StorageRequest.post("/api/v3/stock/list", {
+//     materialNo:"WL-0001"
+//   }as RequestParamModel)
+//   console.log('testTag', 'Tasklist成功' + JSON.stringify(res))
+//   obj = JSON.parse(JSON.stringify(res))
+//   console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+//   return obj
+// }
+///出库选择物料
+export interface SelectMaterialslist {
+  //批次号
+  batchCode?: string;
+  ///完成数量
+  completedNum?:number
+
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+  pageNo?:number
+  pageSize?:number
+}
+// const SelectMaterials = async() : Promise<SelectMaterialslist[]> => {
+//   let res = await StorageRequest.post("/api/v3/task/page", {
+//     pageNo: 1
+//   }Materialpositionclass.log('testTag', '********' + JSON.stringify(res))
+//   let obj = JSON.parse(JSON.stringify(res))
+//   console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj.records));
+//   return obj.records
+// }
+////库存预警
+const stockWarning = async() : Promise<StorageStatusList1[]> => {
+  let obj: StorageStatusList1[] = []
+  let res:StorageStatusList1 = await StorageRequest.get("/api/v1/stock/stockWarning/1")
+  console.log('testTag', 'yyyyyyy' + JSON.stringify(res))
+  obj = JSON.parse(JSON.stringify(res))
+  return obj
+}
+
+// const testDelete = async () => {
+//   let res = await StorageRequest.delete("/api/v3/common/testDelete/1")
+//   console.log("执行了StorageRequest.delete, 输出的结果", res)
+// }
+// const testPut = async () => {
+//   let res = await StorageRequest.put("/api/v3/common/testPut/", {
+//     ids: []
+//   })
+//   console.log("执行了StorageRequest.testPut, 输出的结果", res)
+// }
+ export  {Plan,testGet1, testPost,  BufferHopper,task,stockWarning,Warehousing,Tasklistoutbound, }

+ 107 - 0
entry/src/main/ets/common/util/request/helps.ets

@@ -0,0 +1,107 @@
+import  {InternalAxiosRequestConfig, AxiosResponse, AxiosError} from "@ohos/axios"
+import promptAction from '@ohos.promptAction'
+
+// 是否在控制台打印某项log
+const pConfig = false
+const pHeaders = false
+const pUrl = true
+const pParams = false
+const pBody = true
+const pResponse = true
+const pData = true
+const pError = true
+
+// @CustomDialog
+// struct CustomDialogExample {
+//   controller: CustomDialogController
+//   build() {
+//     Column() {
+//       Text('我是内容')
+//         .fontSize(20)
+//         .margin({ top: 10, bottom: 10 })
+//     }
+//   }
+// }
+
+const printRequest = (config: InternalAxiosRequestConfig) => {
+  if (pConfig) {
+    console.debug("printRequest config", JSON.stringify(config))
+  }
+
+  if (pHeaders) {
+    console.debug("printRequest headers", JSON.stringify(config.headers))
+  }
+
+  if (pUrl) {
+    console.debug("printRequest url", `Method:${config.method} ${config.baseURL}${config.url}`)
+  }
+
+  if (pBody) {
+    console.debug("printRequest 请求参数data", JSON.stringify(config.data))
+  }
+
+  if (pParams) {
+    console.debug("printRequest 请求参数params", JSON.stringify(config.params))
+  }
+
+}
+
+const printResponse = (response: AxiosResponse) => {
+  if (pResponse) {
+    console.debug('handleRes response: ', JSON.stringify(response))
+  }
+  if (pData) {
+    console.debug("printResponse data", JSON.stringify(response.data))
+  }
+}
+
+const printError = (error: AxiosError) => {
+  if (pError) {
+    console.debug("printError error", error.message)
+  }
+  promptAction.showToast({
+    message: error.message ?? "请求出错",
+    duration: 1300,
+    bottom: 100
+  })
+}
+
+
+// 处理返回数据
+const handleRes = (response: AxiosResponse) : [boolean, string] =>  {
+  let isSuccess = true
+  let msg = ""
+
+  if (response.status === 200) { //判断返回状态是否为200
+    if (String( response.data?.code) === "200") { //判断数据的code是否为200,有可能是500的服务器错误
+      isSuccess = true
+      msg = `请求数据成功`
+    }
+    else {
+      isSuccess = false
+      msg = `${response.data?.code}: ${response.data?.msg ?? "服务器错误"}`
+    }
+  }
+  else {
+    isSuccess = false
+    msg = `状态码非200 status: ${response.status}}`
+  }
+
+  if (!isSuccess) {
+    promptAction.showToast({
+      message: msg,
+      duration: 1300,
+      bottom: 100
+    })
+
+    // const dialogController: CustomDialogController = new CustomDialogController({
+    //   builder: CustomDialogExample({}),
+    // })
+    // dialogController.open()
+  }
+
+  return [isSuccess, msg]
+}
+
+
+export {printRequest, printResponse, printError, handleRes}

+ 121 - 0
entry/src/main/ets/entryability/EntryAbility.ets

@@ -0,0 +1,121 @@
+import AbilityConstant from '@ohos.app.ability.AbilityConstant';
+import hilog from '@ohos.hilog';
+import UIAbility from '@ohos.app.ability.UIAbility';
+import Want from '@ohos.app.ability.Want';
+import window from '@ohos.window';
+import RobotSelfCheckModel from '../model/database/RobotSelfCheckModel';
+import StorageModel from '../model/database/StorageModel';
+import StorageSpaceModel from '../model/database/StorageSpaceModel';
+import UserAuthModel from '../model/database/UserAuthModel';
+import AssistantSetModel from '../model/database/AssistantSetModel';
+import UniversalCardModel from '../model/database/UniversalCardModel';
+import { RemoteDeviceModel } from '../model/RemoteDeviceModel'
+import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
+import { class1 } from '../pages/Storage'
+import { WorkstationInfo ,DeptInfo } from '../pages/LoginPage';
+import JGRequest from '../common/util/request/Request';
+import CommonConstants from '../common/constants/CommonConstants';
+import { getToken, getUserInfo } from '../common/util/request/RequestInstance';
+import UserInfo from '../model/UserInfo';
+import router from '@ohos.router';
+
+const TAG: string = 'testTag'
+
+export default class EntryAbility extends UIAbility {
+  deptArray: DeptInfo[] = []
+  workstationArray: WorkstationInfo[] = []
+  dept: DeptInfo = {}
+  workstation: WorkstationInfo = {}
+
+  private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel()
+  async onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
+   // hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
+    // 初始化表
+    RobotSelfCheckModel.initTaskDB(this.context)
+    StorageSpaceModel.initTaskDB(this.context)
+    StorageModel.initTaskDB(this.context)
+    UserAuthModel.initTaskDB(this.context)
+    AssistantSetModel.initTaskDB(this.context)
+    UniversalCardModel.initTaskDB(this.context)
+    AppStorage.setOrCreate('UIAbilityContext', this.context)
+    console.info(TAG, `EntryAbility onCreate`)
+
+    let isRemote: Object | undefined = want.parameters?.isRemote;
+    if (isRemote) {
+      AppStorage.setOrCreate('isRemote', isRemote)
+    }
+    let atManager = abilityAccessCtrl.createAtManager()
+    try {
+      await atManager.requestPermissionsFromUser(this.context, ['ohos.permission.DISTRIBUTED_DATASYNC']).then((data) => {
+        console.info(TAG, `data: ${JSON.stringify(data)}`)
+      }).catch((err: object) => {
+        console.info(TAG, `err: ${JSON.stringify(err)}`)
+      })
+    } catch (err) {
+      console.info(TAG, `catch err->${JSON.stringify(err)}`)
+    }
+  }
+
+  onDestroy(): void {
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
+    console.info(TAG, `EntryAbility onDestroy`)
+  }
+  onWindowStageCreate(windowStage: window.WindowStage): void {
+    // Main window is created, set main page for this ability
+    console.info(TAG, `EntryAbility onWindowStageCreate`)
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
+   //
+    // 1.获取应用主窗口。
+    let windowClass: window.Window
+    windowStage.getMainWindow((err, data) => {
+
+      if (err.code) {
+        console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err));
+        return;
+      }
+      windowClass = data;
+      console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data));
+      // 2.实现沉浸式效果:设置导航栏、状态栏不显示。
+      let names:[] = [];
+      windowClass.setWindowSystemBarEnable(names, (err) => {
+        if (err.code) {
+          console.error('Failed to set the system bar to be visible. Cause:' + JSON.stringify(err));
+          return;
+        }
+        console.info('Succeeded in setting the system bar to be visible.');
+      });
+
+      windowClass.setWindowLayoutFullScreen(true)
+    })
+    // let choicePages:class1={}
+    // console.log("获取当前页面"+choicePages.choicePages?.toString())
+    windowStage.loadContent("pages/LoginPage", (err, data) => {
+   // windowStage.loadContent("pages/OutboundStation", (err, data) => {
+      if (err.code) {
+        console.info(TAG, `Failed to load the content. Cause: ${JSON.stringify(err)}`)
+        return
+      }
+      console.info(TAG, `Succeeded in loading the content. Data: ${JSON.stringify(data)}`)
+    }
+    )
+  }
+
+  onWindowStageDestroy(): void {
+    // Main window is destroyed, release UI related resources
+    console.info(TAG, `EntryAbility onWindowStageDestroy`)
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
+
+  }
+
+  onForeground(): void {
+    // Ability has brought to foreground
+    console.info(TAG, `EntryAbility onForeground`)
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
+  }
+
+  onBackground(): void {
+    // Ability has back to background
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
+    console.info(TAG, `EntryAbility onBackground`)
+  }
+}

+ 19 - 0
entry/src/main/ets/model/AssistantSet.ets

@@ -0,0 +1,19 @@
+/*
+ * 智汇助手
+ * */
+export default class AssistantSet {
+  // 主键id
+  id?: number
+  // 用户id
+  userId?: number
+  // 语音唤醒(1:是 2:否)
+  voiceWakeUp?: number
+  // 音色(1:男 2:女)
+  timbre?: number
+  // 免唤醒(1:是 2:否)
+  wakeFree?: number
+  // 提示播报(1:是 2:否)
+  promptBroadcast?: number
+  // 语音音量(1:是 2:否)
+  voiceVolume?: number
+}

+ 27 - 0
entry/src/main/ets/model/CallList.ets

@@ -0,0 +1,27 @@
+export default class CallList{
+  index?:number
+  //产品规格
+  spec?:string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //	序列号
+  seqNo?: string
+  //储位坐标
+  coordinate?:string
+  //仓库编号
+  houseNo?:string
+  //储位编号
+  locationNo?:string
+  //单位
+  unit?:string
+  //数量
+  num?:number
+  //批次号
+  batchCode?:string
+  //载具编号
+  vehicleCode?:string
+  position?:string
+
+}

+ 48 - 0
entry/src/main/ets/model/ComponentLocation.ets

@@ -0,0 +1,48 @@
+//
+// export class componentLocation{
+//
+//   static rect_left
+//   static rect_top
+//   static rect_right
+//   static rect_bottom
+//   static rect_value
+//
+//   //获取组件所占矩形区域坐标
+//   static getComponentRect(key) {
+//     let strJson = getInspectorByKey(key)
+//     let obj = JSON.parse(strJson)
+//     console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj))
+//     let rectInfo = JSON.parse('[' + obj.$rect + ']')
+//     console.info("[getInspectorByKey] rectInfo is: " + rectInfo)
+//     this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
+//     this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
+//     this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
+//     this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
+//     return this.rect_value = {
+//       "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
+//     }
+//   }
+// }
+export class componentLocation{
+  static rect_left: number
+  static rect_top: number
+  static rect_right: number
+  static rect_bottom: number
+  static rect_value: Record<string, number>
+
+  //获取组件所占矩形区域坐标
+  static getComponentRect(key:string):Record<string, number> {
+    let strJson = getInspectorByKey(key)
+    let obj:Record<string, string> = JSON.parse(strJson)
+    console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj))
+    let rectInfo:string[] = JSON.parse('[' + obj.$rect + ']')
+    console.info("[getInspectorByKey] rectInfo is: " + rectInfo)
+    componentLocation.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
+    componentLocation.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
+    componentLocation.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
+    componentLocation.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
+    return componentLocation.rect_value = {
+      "left": componentLocation.rect_left, "top": componentLocation.rect_top, "right": componentLocation.rect_right, "bottom": componentLocation.rect_bottom
+    }
+  }
+}

+ 29 - 0
entry/src/main/ets/model/DetailsList.ets

@@ -0,0 +1,29 @@
+export default class DetailsList {
+  state?:number
+  completedNum?:number
+  index?:number
+  //产品规格
+  spec?:string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //	序列号
+  seqNo?: string
+  //储位坐标
+  coordinate?:string
+  //仓库编号
+  houseNo?:string
+  //储位编号
+  locationNo?:string
+  //单位
+  unit?:string
+  //数量
+  num?:number
+  //批次号
+  batchCode?:string
+  //载具编号
+  vehicleCode?:string
+  position?:string
+
+}

+ 8 - 0
entry/src/main/ets/model/DictInfo.ets

@@ -0,0 +1,8 @@
+import DictValue from './DictValue'
+
+export default class DictInfo {
+  // 字典编码
+  dictCode?: string
+  // 字典值
+  list?: DictValue[]
+}

+ 8 - 0
entry/src/main/ets/model/DictValue.ets

@@ -0,0 +1,8 @@
+export default class DictValue {
+  // 字典标签
+  dictLabel?: string
+  // 字典排序
+  dictSort?: number
+  // 字典值
+  dictValue?: string
+}

+ 104 - 0
entry/src/main/ets/model/KvStoreModel.ets

@@ -0,0 +1,104 @@
+
+import distributedData from '@ohos.data.distributedKVStore';
+import { BUNDLE_NAME } from './RemoteDeviceModel'
+import common from '@ohos.app.ability.common';
+import { Callback } from '@ohos.base';
+import { BusinessError } from '@ohos.base';
+
+const TAG: string = 'KvStoreModel'
+const STORE_ID: string = 'textTest'
+
+export class KvStoreModel {
+  public kvManager: distributedData.KVManager | undefined = undefined
+  public kvStore: distributedData.SingleKVStore | undefined = undefined
+
+  async createKvStore(context: common.BaseContext, callback: Callback<void>) {
+    if ((typeof (this.kvStore) !== 'undefined')) {
+      callback()
+      return
+    }
+    let config: distributedData.KVManagerConfig = {
+      bundleName: BUNDLE_NAME,
+      context: context
+    };
+    try {
+      console.info(TAG, `ecreateKVManager success`);
+      this.kvManager = distributedData.createKVManager(config);
+    } catch (err) {
+      console.info(TAG, `ecreateKVManager err:${JSON.stringify(err)}`);
+    }
+    console.info(TAG, `createKVManager begin`);
+    let options: distributedData.Options = {
+      createIfMissing: true,
+      encrypt: false,
+      backup: false,
+      autoSync: true,
+      kvStoreType: distributedData.KVStoreType.DEVICE_COLLABORATION,
+      securityLevel: distributedData.SecurityLevel.S1
+    };
+    console.info(TAG, `kvManager.getKVStore begin`);
+    if (this.kvManager !== undefined) {
+      this.kvManager.getKVStore(STORE_ID, options, (err, store: distributedData.SingleKVStore) => {
+        console.info(TAG, `getKVStore success, kvStore= ${store}`);
+        this.kvStore = store;
+        callback();
+      })
+    }
+    console.info(TAG, `createKVManager end`)
+  }
+
+  deleteKvStore() {
+    if (this.kvStore !== undefined && this.kvStore !== null) {
+      return;
+    }
+    try {
+      if (this.kvManager !== undefined) {
+        console.info(TAG, 'deleteKvStore success')
+        this.kvManager.deleteKVStore(BUNDLE_NAME, STORE_ID)
+      }
+    } catch (err) {
+      console.error(TAG, 'deleteKvStore error error is:' + JSON.stringify(err))
+    }
+  }
+
+
+  put(key: string, value: string) {
+    if (this.kvStore) {
+      console.debug(TAG, `kvStore.put ${key} = ${value}`)
+      this.kvStore.put(
+        key,
+        value
+      ).then((data) => {
+        console.debug(TAG, `kvStore.put ${key} finished, data= ${JSON.stringify(data)}`)
+      }).catch((err: object) => {
+        console.debug(TAG, `kvStore.put ${key} failed, ${JSON.stringify(err)}`)
+      })
+    }
+  }
+
+  setOnMessageReceivedListener(context: common.UIAbilityContext, msg: string, callback: Callback<string>) {
+    console.info(TAG, `setOnMessageReceivedListener: ${msg}`);
+    this.createKvStore(context, () => {
+      console.info(TAG, `kvStore.on(dataChange) begin`);
+      if (this.kvStore !== undefined && this.kvStore !== null) {
+        try {
+          this.kvStore!.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => {
+            console.debug(TAG, `dataChange, ${JSON.stringify(data)}`);
+            let entries = data.insertEntries.length > 0 ? data.insertEntries : data.updateEntries;
+            for (let i = 0; i < entries.length; i++) {
+              if (entries[i].key === msg) {
+                let value = entries[i].value.value.toString();
+                console.debug(TAG, `Entries receive msg :${msg}, value:${value}`);
+                callback(value);
+                return;
+              }
+            }
+          })
+        } catch (err) {
+          console.error(TAG, `kvStore.on(dataChange) err :` + err);
+        }
+      }
+      console.info(TAG, `kvStore.on(dataChange) end`);
+    })
+  }
+}

+ 19 - 0
entry/src/main/ets/model/MaterialInfo.ets

@@ -0,0 +1,19 @@
+/*
+ * 物料信息
+ * */
+export default class MaterialInfo {
+  // id
+  id?: number;
+  // 物料名称
+  materialName?:string
+  // 物料号
+  materialNo?: string
+  // 批次号
+  batchCode?: string
+  //需求数量
+  needNum?: number
+  // 采集数量
+  collectNum?: number
+  // 库存数量
+  storeNum?: number
+}

+ 65 - 0
entry/src/main/ets/model/MaterialInformation.ets

@@ -0,0 +1,65 @@
+export interface MaterialInformationList{
+  //物料类型(等级)
+  vehicleLevel?:string
+  //更改的数量
+  exchangeNumber?:number
+  //物料编码
+  materialCode?:string
+  label?:string
+  //订单编号
+  taskId?:string
+  //批次号
+  spec?:string
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:string
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+  batchCode?:string
+  code?:string
+
+
+
+
+}

+ 13 - 0
entry/src/main/ets/model/NoticeInfo.ets

@@ -0,0 +1,13 @@
+/*
+ * 通知信息表
+ * */
+export default class NoticeInfo {
+  // id
+  id?: number;
+  // 通知
+  Notice?: string ;
+  // 通知日期
+  NoticeDate?: string ;
+  //默认层数
+  defaultLayer?: number
+}

+ 83 - 0
entry/src/main/ets/model/NumberDataSource.ets

@@ -0,0 +1,83 @@
+class BasicDataSource implements IDataSource {
+  private listeners: DataChangeListener[] = [];
+  private originDataArray: number[] = [];
+
+  public totalCount(): number {
+    return 0;
+  }
+
+  public getData(index: number): number {
+    return this.originDataArray[index];
+  }
+
+  // 该方法为框架侧调用,为LazyForEach组件向其数据源处添加listener监听
+  registerDataChangeListener(listener: DataChangeListener): void {
+    if (this.listeners.indexOf(listener) < 0) {
+      console.info('add listener');
+      this.listeners.push(listener);
+    }
+  }
+
+  // 该方法为框架侧调用,为对应的LazyForEach组件在数据源处去除listener监听
+  unregisterDataChangeListener(listener: DataChangeListener): void {
+    const pos = this.listeners.indexOf(listener);
+    if (pos >= 0) {
+      console.info('remove listener');
+      this.listeners.splice(pos, 1);
+    }
+  }
+
+  // 通知LazyForEach组件需要重载所有子组件
+  notifyDataReload(): void {
+    this.listeners.forEach(listener => {
+      listener.onDataReloaded();
+    })
+  }
+
+  // 通知LazyForEach组件需要在index对应索引处添加子组件
+  notifyDataAdd(index: number): void {
+    this.listeners.forEach(listener => {
+      listener.onDataAdd(index);
+    })
+  }
+
+  // 通知LazyForEach组件在index对应索引处数据有变化,需要重建该子组件
+  notifyDataChange(index: number): void {
+    this.listeners.forEach(listener => {
+      listener.onDataChange(index);
+    })
+  }
+
+  // 通知LazyForEach组件需要在index对应索引处删除该子组件
+  notifyDataDelete(index: number): void {
+    this.listeners.forEach(listener => {
+      listener.onDataDelete(index);
+    })
+  }
+}
+
+export default class NumberDataSource extends BasicDataSource {
+  private dataArray: number[] = [];
+
+  public totalCount(): number {
+    return this.dataArray.length;
+  }
+
+  public getData(index: number): number {
+    return this.dataArray[index];
+  }
+
+  public addData(index: number, data: number): void {
+    this.dataArray.splice(index, 0, data);
+    this.notifyDataAdd(index);
+  }
+
+  public pushData(data: number): void {
+    this.dataArray.push(data);
+    this.notifyDataAdd(this.dataArray.length - 1);
+  }
+  public pop(): void {
+    this.dataArray.pop();
+    this.notifyDataAdd(this.dataArray.length - 1);
+  }
+}

+ 52 - 0
entry/src/main/ets/model/OrderInfo.ets

@@ -0,0 +1,52 @@
+import ProcessData from '../viewmodel/ProcessData'
+
+export default class OrderInfo {
+  // todo delete 订单状态(1:未开始 2:生产中 3:已完成)
+  orderState?: number = 1
+  // 订单id
+  taskId?: string
+  // 报故数量
+  bugNum?: number
+  // 完成数量
+  completeNum?: number
+  // 入库数量
+  inventoryNum?: number
+  // 物料编号
+  materialCode?: string
+  // 物料型号
+  materialModel?: string
+  // 物料名称
+  materialName?: string
+  // 订单编码
+  orderCode?: string
+  // 订单名称
+  orderName?: string
+  // 计划数量
+  planNum?: number
+  // 计划结束时间
+  planStartEnd?: string
+  // 计划开始时间
+  planStartWhen?: string
+  // 工艺路线编码
+  processRouteCode?: string
+  // 工艺路线id
+  processRouteId?: number
+  // 工艺路线名称
+  processRouteName?: string
+  // 产线id
+  productLineId?: number
+  // 产线名称
+  productLineName?: string
+  // 报废数量
+  scrapNum?: number
+  // 工单编码
+  workOrderCode?: string
+  // 工单状态-字典 plan_work_order_state
+  workOrderState?: number
+  // 生产车间id
+  workshopId?: number
+  // 生产车间
+  workshopName?: string
+  // 工序列表
+  ops?: ProcessData[]
+}

+ 58 - 0
entry/src/main/ets/model/OutboundDats.ets

@@ -0,0 +1,58 @@
+export default class OutboundData{
+  //批次号
+  batchCode?: string;
+  ///完成数量
+  completedNum?:number
+
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  relPlanNo?:string
+  relOrderNo?:string
+  relOutOrderNo?:string
+  progress?:string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+}

+ 262 - 0
entry/src/main/ets/model/RemoteDeviceModel.ets

@@ -0,0 +1,262 @@
+import deviceManager from '@ohos.distributedDeviceManager';
+import { Callback } from '@ohos.base'
+
+interface deviceData {
+  device: deviceManager.DeviceBasicInfo
+}
+
+interface extraInfo {
+  bindType: number
+  targetPkgName: string
+  appName: string
+}
+interface FilterOptions {
+  availableStatus: number;
+  discoverDistance: number;
+  authenticationStatus: number;
+  authorizationType: number;
+}
+const TAG: string = 'testTag'
+let SUBSCRIBE_ID: number = 100
+
+export const BUNDLE_NAME: string = 'com.example.wonderfuldemo'
+
+export class RemoteDeviceModel {
+  public deviceList: Array<deviceManager.DeviceBasicInfo> | null = []
+  public discoverList: Array<deviceManager.DeviceBasicInfo> = []
+  private callback: () => void = () => {
+  }
+  private authCallback: () => void = () => {
+  }
+  private deviceManager: deviceManager.DeviceManager | undefined = undefined
+
+  registerDeviceListCallback(callback: Callback<void>) {
+    console.info(TAG, `deviceManager type =${typeof (this.deviceManager)} ,${JSON.stringify(this.deviceManager)} ,${JSON.stringify(this.deviceManager) === '{}'}`)
+    if (typeof (this.deviceManager) !== 'undefined') {
+      this.registerDeviceListCallbackImplement(callback)
+      return
+    }
+    console.info(TAG, 'deviceManager.createDeviceManager begin')
+    try {
+      let dmInstance = deviceManager.createDeviceManager(BUNDLE_NAME);
+      this.deviceManager = dmInstance
+      this.registerDeviceListCallbackImplement(callback)
+      console.info(TAG, `createDeviceManager callback returned, value= ${JSON.stringify(this.deviceManager)}`)
+    } catch (error) {
+      console.error(TAG, `createDeviceManager throw code:${error.code} message:${error.message}`)
+    }
+    console.info(TAG, 'deviceManager.createDeviceManager end')
+  }
+
+  changeStateOnline(device: deviceManager.DeviceBasicInfo) {
+    if (this.deviceList !== null) {
+      this.deviceList![this.deviceList!.length] = device;
+    }
+    console.debug(TAG, `online, device list= ${JSON.stringify(this.deviceList)}`);
+    this.callback();
+    if (this.authCallback !== null) {
+      this.authCallback();
+      this.authCallback = () => {
+      }
+    }
+  }
+
+  changeStateOffline(device: deviceManager.DeviceBasicInfo) {
+    if (this.deviceList !== null && this.deviceList!.length > 0) {
+      let list: Array<deviceManager.DeviceBasicInfo> = [];
+      for (let j = 0; j < this.deviceList!.length; j++) {
+        if (this.deviceList![j].deviceId !== device.deviceId) {
+          list[j] = device;
+        }
+      }
+      this.deviceList = list;
+    }
+    console.info(TAG, `offline, updated device list=${JSON.stringify(device)}`);
+    this.callback();
+  }
+
+  changeState(device: deviceManager.DeviceBasicInfo, state: number) {
+    if (this.deviceList !== null && this.deviceList!.length <= 0) {
+      this.callback();
+      return;
+    }
+    if (this.deviceList !== null && state === deviceManager.DeviceStateChange.AVAILABLE) {
+      let list: Array<deviceManager.DeviceBasicInfo> = new Array();
+      for (let i = 0; i < this.deviceList!.length; i++) {
+        if (this.deviceList![i].deviceId !== device.deviceId) {
+          list[i] = device;
+        }
+      }
+      this.deviceList = list;
+      console.debug(TAG, `ready, device list= ${JSON.stringify(device)}`);
+      this.callback();
+    } else {
+      if (this.deviceList !== null) {
+        for (let j = 0; j < this.deviceList!.length; j++) {
+          if (this.deviceList![j].deviceId === device.deviceId) {
+            this.deviceList![j] = device;
+            break;
+          }
+        }
+        console.debug(TAG, `offline, device list= ${JSON.stringify(this.deviceList)}`);
+        this.callback();
+      }
+    }
+  }
+
+  registerDeviceListCallbackImplement(callback: Callback<void>) {
+    console.info(TAG, 'registerDeviceListCallback')
+    this.callback = callback
+    if (this.deviceManager === undefined) {
+      console.error(TAG, 'deviceManager has not initialized')
+      this.callback()
+      return
+    }
+    console.info(TAG, 'getTrustedDeviceListSync begin')
+    try {
+      let list = this.deviceManager !== undefined ? this.deviceManager.getAvailableDeviceListSync() : null;
+      console.debug(TAG, `getTrustedDeviceListSync end, deviceList= ${JSON.stringify(list)}`);
+      if (typeof (list) !== 'undefined' && JSON.stringify(list) !== '[]') {
+        this.deviceList = list!;
+      }
+      console.info(TAG, `getTrustedDeviceListSync end, deviceList=${JSON.stringify(list)}`);
+    } catch (error) {
+      console.error(TAG, `getTrustedDeviceListSync throw code:${error.code} message:${error.message}`);
+    }
+    this.callback();
+    console.info(TAG, 'callback finished');
+    try {
+      if (this.deviceManager !== undefined) {
+        this.deviceManager.on('deviceStateChange', (data) => {
+          if (data === null) {
+            return
+          }
+          console.debug(TAG, `deviceStateChange data= ${JSON.stringify(data)}`)
+          switch (data.action) {
+            case deviceManager.DeviceStateChange.AVAILABLE:
+              this.changeState(data.device, deviceManager.DeviceStateChange.AVAILABLE)
+              break
+            case deviceManager.DeviceStateChange.UNKNOWN:
+              this.changeStateOnline(data.device)
+              break
+            case deviceManager.DeviceStateChange.UNAVAILABLE:
+              this.changeStateOffline(data.device)
+              break
+            default:
+              break
+          }
+        })
+      }
+      if (this.deviceManager !== undefined) {
+        this.deviceManager.on('discoverSuccess', (data) => {
+          if (data === null) {
+            return
+          }
+          this.discoverList = []
+          console.info(TAG, `discoverSuccess data=${JSON.stringify(data)}`)
+          this.deviceFound(data.device)
+        })
+        this.deviceManager.on('discoverFailure', (data) => {
+          console.info(TAG, `discoverFailure data= ${JSON.stringify(data)}`)
+        })
+        this.deviceManager.on('serviceDie', () => {
+          console.error(TAG, 'serviceDie')
+        })
+      }
+    } catch (error) {
+      console.error(TAG, `on throw code:${error.code} message:${error.message}`)
+    }
+    this.startDeviceDiscovery()
+  }
+
+  deviceFound(data: deviceManager.DeviceBasicInfo) {
+    for (let i = 0;i < this.discoverList.length; i++) {
+      if (this.discoverList[i].deviceId === data.deviceId) {
+        console.info(TAG, 'device founded ignored')
+        return
+      }
+    }
+    this.discoverList[this.discoverList.length] = data
+    console.debug(TAG, `deviceFound self.discoverList= ${this.discoverList}`)
+    this.callback()
+  }
+
+  /**
+   * 通过SUBSCRIBE_ID搜索分布式组网内的设备
+   */
+  startDeviceDiscovery() {
+    let discoverParam: Record<string, number> = {
+      'discoverTargetType': 1
+    };
+
+    let filterOptions: Record<string, number> = {
+      'availableStatus': 0,
+    };
+
+    console.info(TAG, `startDeviceDiscovery${SUBSCRIBE_ID}`);
+    try {
+      if (this.deviceManager !== undefined) {
+        this.deviceManager.startDiscovering(discoverParam, filterOptions)
+      }
+    } catch (error) {
+      console.error(TAG, `startDeviceDiscovery throw code:${error.code} message:${error.message}`)
+    }
+  }
+
+  unregisterDeviceListCallback() {
+    console.debug(TAG, `stopDeviceDiscovery ${SUBSCRIBE_ID}`)
+    if (this.deviceManager === undefined) {
+      return
+    }
+    if (this.deviceManager !== undefined) {
+      try {
+        console.info(TAG, `stopDiscovering`)
+        this.deviceManager.stopDiscovering();
+      } catch (error) {
+        console.error(TAG, `stopDeviceDiscovery throw code:${JSON.stringify(error.code)} message:${error.message}`)
+      }
+      try {
+        this.deviceManager.off('deviceStateChange')
+        this.deviceManager.off('discoverSuccess')
+        this.deviceManager.off('discoverFailure')
+        this.deviceManager.off('serviceDie')
+      } catch (error) {
+        console.error(TAG, `off throw code:${error.code} message:${error.message}`)
+      }
+    }
+    this.deviceList = []
+    this.discoverList = []
+  }
+
+  authenticateDevice(device: deviceManager.DeviceBasicInfo, callBack: Callback<void>) {
+    console.info(TAG, `authenticateDevice ${JSON.stringify(device)}`)
+    for (let i = 0; i < this.discoverList.length; i++) {
+      if (this.discoverList[i].deviceId !== device.deviceId) {
+        continue
+      }
+      if (this.deviceManager === undefined) {
+        return
+      }
+      try {
+        if (this.deviceManager !== undefined) {
+          this.deviceManager.bindTarget(device.deviceId, {
+            bindType: 1,
+            targetPkgName: BUNDLE_NAME,
+            appName: 'Distributed distributecalc',
+          }, (err, data) => {
+            if (err) {
+              console.error(TAG, `authenticateDevice error: ${JSON.stringify(err)}`)
+              this.authCallback = () => {
+              }
+              return
+            }
+            console.debug(TAG, `authenticateDevice succeed: ${JSON.stringify(data)}`)
+            this.authCallback = callBack
+          })
+        }
+      } catch (error) {
+        console.error(TAG, `authenticateDevice throw throw code:${error.code} message:${error.message}`)
+      }
+    }
+  }
+}

+ 36 - 0
entry/src/main/ets/model/RobotInfo.ets

@@ -0,0 +1,36 @@
+export default class RobotInfo {
+  // id
+  id?: number;
+  // 机器人编码
+  robotCode?:string;
+  // 所属仓库id
+  storageId?: number;
+  // 机器人位置x坐标
+  x?: number = 0
+  // 机器人位置y坐标
+  y?: number = 0
+  // 车类型(1:轨道 2:仓储)
+  robotType?:number
+  //机器人的朝向(1:x+ 2:x- 3:y+ 4:y-)
+  robotToward?: number = 0
+  // 上次自检日期
+  lastSelfCheck? : string
+  robotId?:number
+  checkName?:string
+  checkTime?:string
+  checkStatus?:number
+
+
+
+  //车类型(1:轨道 2:仓储)
+  // carType: number = 2
+  // //车状态(1:异常 2:空闲 3:运行)
+  // carState: number = 0
+  // // 仓储车悬臂x坐标
+  // armX: number
+  // // 仓储车悬臂y坐标
+  // armY: number
+  //
+  // //异常信息
+  // errorMsg?: string
+}

+ 15 - 0
entry/src/main/ets/model/RobotSelfCheck.ets

@@ -0,0 +1,15 @@
+@Observed
+export default class RobotSelfCheck {
+  // id
+  id?: number
+  // 机器人id
+  robotId? : number
+  // 检查项名称
+  checkName?: string
+  // 检查时间
+  checkTime?: string
+  // 检查状态(1:正常 2:故障)
+  checkStatus?: number
+  // 故障原因
+  faultCause?: string
+}

+ 5 - 0
entry/src/main/ets/model/SpaceStateList.ets

@@ -0,0 +1,5 @@
+// 用于储位格子渲染
+@Observed
+export default class SpaceStateList extends Array<number> {
+  //1:禁用 2:未设置类型 3:正常 4:禁用+选中 5:未设置类型+选中 6:正常+选中
+}

+ 15 - 0
entry/src/main/ets/model/StorageInfo.ets

@@ -0,0 +1,15 @@
+/*
+ * 仓储信息表
+ * */
+export default class StorageInfo {
+  // id
+  id?: number | undefined;
+  // 仓库名称
+  storageName?: string = '';
+  // x大小
+  xSize?: number;
+  // y大小
+  ySize?: number;
+  //默认层数
+  defaultLayer?: number
+}

+ 27 - 0
entry/src/main/ets/model/StorageSpace.ets

@@ -0,0 +1,27 @@
+/*
+ * 仓储储位表
+ * */
+export default class StorageSpace {
+  // id
+  id?: number;
+  // 仓储id
+  storageId?: number;
+  // x坐标
+  x?: number;
+  // y坐标
+  y?: number;
+  // 启用状态(1:启用 2:禁用)
+  enableState?: number
+  // 仓储类型(多个用逗号隔开)(1:电子元器件 2:电路板 3:结构件 4:辅助材料)
+  storageType?: string|undefined
+  // 容量(单位:层)
+  capacity?: number
+  // 能否途经(1:启用 2:禁用)
+  canWay?: number
+  // 是否为停靠点(1:是 2:否)
+  canPark?: number
+  // 停靠点类型(1:出入库位置 2:充电位置 3:工作台 4:其他)
+  parkType?: number
+  // 已用容量(单位:层)
+  usedCapacity?: number
+}

+ 30 - 0
entry/src/main/ets/model/TaskSheetInformation.ets

@@ -0,0 +1,30 @@
+export default class TaskSheetInformation{
+  completedNum?:number
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  index?:number
+  //产品规格
+  spec?:string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //	序列号
+  seqNo?: string
+  //储位坐标
+  coordinate?:string
+  //仓库编号
+  houseNo?:string
+  //储位编号
+  locationNo?:string
+  //单位
+  unit?:string
+  //数量
+  num?:number
+  //批次号
+  batchCode?:string
+  //载具编号
+  vehicleCode?:string
+  position?:string
+
+}

+ 15 - 0
entry/src/main/ets/model/UniversalCard.ets

@@ -0,0 +1,15 @@
+/*
+ * 万能卡片
+ * */
+export default class UniversalCard {
+  // id
+  id?: number;
+  // 用户id
+  userId?: number
+  // 卡片类型(1:智能仓储 3:工序(生产)操作 5:(设备)智汇工厂)
+  cardType?: number
+  // 卡片状态(1:打开 2:关闭)
+  cardStatus?: number
+  // 卡片排序号(取数组索引)
+  cardSort?: number
+}

+ 25 - 0
entry/src/main/ets/model/UserAuthInfo.ets

@@ -0,0 +1,25 @@
+// 用户登陆信息
+export default class UserAuthInfo {
+  // id
+  id?: number;
+  // 仓储id
+  userId?: number;
+  // 用户名
+  userName?: string;
+  // 登录密码
+  password?: string;
+  // 组织id
+  orgId?: number;
+  // 工位id
+  stationId?: number;
+  // 工位名称
+  stationName?: string;
+  // 维护站类型
+  stationDictValue?: string;
+  // 保持登录状态(1:是 2:否)
+  maintainLoginStatus?: number;
+  // 更新时间戳
+  updateTime?: number;
+  // 用户头像
+  avatar?: string;
+}

+ 21 - 0
entry/src/main/ets/model/UserInfo.ets

@@ -0,0 +1,21 @@
+// 用户信息
+export default class UserInfo {
+  // id
+  id?: number;
+  // 仓储id
+  userId?: number;
+  // 用户名
+  userName?: string;
+  // 登录密码
+  password?: string;
+  // 组织id
+  orgId?: number;
+  // 工位id
+  stationId?: number;
+  // 用户头像
+  avatar?: string
+  // 保持登录状态(1:是 2:否)
+  maintainLoginStatus?: number;
+  // 更新时间戳
+  updateTime?: number;
+}

+ 59 - 0
entry/src/main/ets/model/WorkBinInfo.ets

@@ -0,0 +1,59 @@
+export default class WorkBinInfo{
+
+  //批次号
+  batchCode?: string;
+  ///完成数量
+  completedNum?:number
+
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  relPlanNo?:string
+  relOrderNo?:string
+  relOutOrderNo?:string
+  progress?:string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+}

+ 151 - 0
entry/src/main/ets/model/database/AssistantSetModel.ets

@@ -0,0 +1,151 @@
+import relationalStore from '@ohos.data.relationalStore';
+import CommonConstants from '../../common/constants/CommonConstants';
+import AssistantSet from '../AssistantSet';
+
+class AssistantSetModel {
+
+  private rdbStore: relationalStore.RdbStore | undefined=undefined
+  private tableName: string = 'ASSISTANT_SET'
+
+  /**
+   * 初始化表
+   */
+  async initTaskDB(context:Context){
+    // 1.rdb配置
+    const config = {
+      name: CommonConstants.RDB_NAME,
+      securityLevel: relationalStore.SecurityLevel.S1
+    }as relationalStore.StoreConfig
+    try {
+      // 获取数据库存储对象
+      this.rdbStore = await relationalStore.getRdbStore(context,config);
+    } catch (err) {
+      console.info(`getRdbStore err ${JSON.stringify(err)}`);
+    }
+    // 2.初始化SQL语句
+    const sql = `CREATE TABLE IF NOT EXISTS ASSISTANT_SET (
+                  ID INTEGER PRIMARY KEY AUTOINCREMENT,
+                  USER_ID INTEGER NOT NULL,
+                  VOICE_WAKE_UP INTEGER NOT NULL,
+                  TIMBRE INTEGER NOT NULL,
+                  WAKE_FREE INTEGER NOT NULL,
+                  PROMPT_BROADCAST INTEGER NOT NULL,
+                  VOICE_VOLUME INTEGER NOT NULL
+                 )`
+    // 3.获取rdb
+    relationalStore.getRdbStore(context, config, (err, rdbStore) => {
+      if(err){
+        console.log('testTag', '获取rdbStore失败!')
+        return
+      }
+      // 执行Sql
+      rdbStore.executeSql(sql).then(()=>{
+        console.log('testTag', '创建智汇助手表成功!')
+      }).catch((err: object)=>{
+        console.log('testTag', '创建失败')
+      })
+      // 保存rdbStore
+      this.rdbStore = rdbStore
+    })
+  }
+
+  // 根据用户查询对应的智汇助手设置信息
+  async getByUserId(userId: number): Promise<AssistantSet | undefined> {
+    if (!userId) {
+      return
+    }
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('USER_ID', userId)
+    predicates.limitAs(1)
+    // 2.查询
+    let result = await this.rdbStore?.query(predicates, ['ID', 'USER_ID', 'VOICE_WAKE_UP', 'TIMBRE', 'WAKE_FREE', 'PROMPT_BROADCAST', 'VOICE_VOLUME'])
+    // 3.2.遍历封装 只取第一条
+    while(result && !result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result.goToNextRow()
+      // 3.4.获取数据
+      let id = result.getLong(result.getColumnIndex('ID'))
+      let userId = result.getLong(result.getColumnIndex('USER_ID'))
+      let voiceWakeUp = result.getLong(result.getColumnIndex('VOICE_WAKE_UP'))
+      let timbre = result.getLong(result.getColumnIndex('TIMBRE'))
+      let wakeFree = result.getLong(result.getColumnIndex('WAKE_FREE'))
+      let promptBroadcast = result.getLong(result.getColumnIndex('PROMPT_BROADCAST'))
+      let voiceVolume = result.getLong(result.getColumnIndex('VOICE_VOLUME'))
+      return {id: id, userId: userId, voiceWakeUp: voiceWakeUp, timbre: timbre, wakeFree: wakeFree, promptBroadcast: promptBroadcast, voiceVolume: voiceVolume}
+    }
+    return
+  }
+
+  /**
+   * 查询智汇助手列表
+   */
+  async getAssistantSetList(){
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    // 2.查询
+    let result = await this.rdbStore?.query(predicates, ['ID', 'USER_ID', 'VOICE_WAKE_UP', 'TIMBRE', 'WAKE_FREE', 'PROMPT_BROADCAST', 'VOICE_VOLUME'])
+    // 3.解析查询结果
+    // 3.1.定义一个数组,组装最终的查询结果
+    let AssistantSets: AssistantSet[] = []
+    // 3.2.遍历封装
+    while(result && !result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result.goToNextRow()
+      // 3.4.获取数据
+      let id = result.getLong(result.getColumnIndex('ID'))
+      let userId = result.getLong(result.getColumnIndex('USER_ID'))
+      let voiceWakeUp = result.getLong(result.getColumnIndex('VOICE_WAKE_UP'))
+      let timbre = result.getLong(result.getColumnIndex('TIMBRE'))
+      let wakeFree = result.getLong(result.getColumnIndex('WAKE_FREE'))
+      let promptBroadcast = result.getLong(result.getColumnIndex('PROMPT_BROADCAST'))
+      let voiceVolume = result.getLong(result.getColumnIndex('VOICE_VOLUME'))
+      // 3.5.封装到数组
+      AssistantSets.push({id, userId, voiceWakeUp, timbre, wakeFree, promptBroadcast, voiceVolume})
+    }
+    return AssistantSets
+  }
+
+  /**
+   * 添加智汇助手
+   * @param set 智汇助手设置信息
+   * @returns 智汇助手id
+   */
+  addAssistantSet(set: AssistantSet): Promise<number> | undefined{
+    return this.rdbStore?.insert(this.tableName, {USER_ID: set.userId, VOICE_WAKE_UP: set.voiceWakeUp, TIMBRE: set.timbre,
+      WAKE_FREE: set.wakeFree, PROMPT_BROADCAST: set.promptBroadcast, VOICE_VOLUME: set.voiceVolume} as relationalStore.ValuesBucket)
+  }
+
+  /**
+   * 根据id更新智汇助手状态
+   * @param set 智汇助手设置信息
+   */
+  updateAssistantSet(set: AssistantSet) {
+      if (!set || !set.id) {
+        return
+      }
+    // 1.要更新的数据
+    let data:relationalStore.ValuesBucket | undefined = {VOICE_WAKE_UP: set.voiceWakeUp as number, TIMBRE: set.timbre as number, WAKE_FREE: set.wakeFree as number, PROMPT_BROADCAST: set.promptBroadcast as number, VOICE_VOLUME: set.voiceVolume as number}
+    // 2.更新的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', set.id)
+    // 3.更新操作
+    return this.rdbStore?.update(data, predicates)
+  }
+
+  /**
+   * 根据id删除任务
+   * @param id 任务id
+   */
+  deleteAssistantSetById(id: number){
+    // 1.删除的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 2.删除操作
+    return this.rdbStore?.delete(predicates)
+  }
+}
+
+let assistantSetModel = new AssistantSetModel();
+
+export default assistantSetModel as AssistantSetModel;

+ 117 - 0
entry/src/main/ets/model/database/RobotSelfCheckModel.ets

@@ -0,0 +1,117 @@
+import relationalStore from '@ohos.data.relationalStore';
+import CommonConstants from '../../common/constants/CommonConstants';
+import RobotSelfCheck from '../RobotSelfCheck';
+
+class RobotSelfCheckModel {
+
+  private rdbStore: relationalStore.RdbStore | undefined = undefined;
+  private tableName: string = 'ROBOT_SELF_CHECK'
+
+  /**
+   * 初始化表
+   */
+  async initTaskDB(context:Context){
+    // 1.rdb配置
+    const config= {
+      name: CommonConstants.RDB_NAME,
+      securityLevel: relationalStore.SecurityLevel.S1
+    }as relationalStore.StoreConfig
+    try {
+      // 获取数据库存储对象
+      this.rdbStore = await relationalStore.getRdbStore(context,config);
+    } catch (err) {
+      console.info(`getRdbStore err ${JSON.stringify(err)}`);
+    }
+    // 2.初始化SQL语句
+    const sql = `CREATE TABLE IF NOT EXISTS ROBOT_SELF_CHECK (
+                  ID INTEGER PRIMARY KEY AUTOINCREMENT,
+                  ROBOT_ID INTEGER NOT NULL,
+                  CHECK_NAME TEXT NOT NULL,
+                  CHECK_TIME TEXT NULL,
+                  CHECK_STATUS INTEGER NULL,
+                  FAULT_CAUSE TEXT NULL
+                 )`
+    // 3.获取rdb
+    relationalStore.getRdbStore(context, config, (err, rdbStore) => {
+      if(err){
+        console.log('testTag', '获取rdbStore失败!')
+        return
+      }
+      // 执行Sql
+      rdbStore?.executeSql(sql).then(()=>{
+        console.log('testTag', '创建机器人自检表成功!')
+      }).catch((err: object)=>{
+        console.log('testTag', '创建失败')
+      })
+    })
+  }
+
+  /**
+   * 查询自检列表
+   */
+  async getListByRobotId(robotId: number){
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ROBOT_ID', robotId)
+    // 2.查询
+    let result: relationalStore.ResultSet | undefined = await this.rdbStore?.query(predicates, ['ID', 'ROBOT_ID', 'CHECK_NAME', 'CHECK_TIME', 'CHECK_STATUS'])
+    // 3.解析查询结果
+    // 3.1.定义一个数组,组装最终的查询结果
+    let checks: RobotSelfCheck[] = []
+    // 3.2.遍历封装
+    while(!result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result?.goToNextRow()
+      // 3.4.获取数据
+      let id = result?.getLong(result?.getColumnIndex('ID'))
+      let robotId = result?.getLong(result?.getColumnIndex('ROBOT_ID'))
+      let checkName = result?.getString(result?.getColumnIndex('CHECK_NAME'))
+      let checkTime = result?.getString(result?.getColumnIndex('CHECK_TIME'))
+      let checkStatus = result?.getLong(result?.getColumnIndex('CHECK_STATUS'))
+      // 3.5.封装到数组
+      checks.push({id, robotId, checkName, checkTime, checkStatus})
+    }
+    return checks
+  }
+
+  /**
+   * 添加一个新的机器人自检
+   * @param robotId 机器人id
+   * @param checkName 自检项名称
+   * @param checkTime 自检时间
+   * @returns 自检id
+   */
+  addRobotSelfCheck(robotId: number, checkName: string, checkTime: string): Promise<number>|undefined{
+      return this.rdbStore?.insert(this.tableName, {ROBOT_ID: robotId, CHECK_NAME: checkName, CHECK_TIME: checkTime})
+  }
+
+  /**
+   * 根据id更新自检状态
+   * @param id 任务id
+   * @param finished 任务是否完成
+   */
+  updateStatus(id: number, checkStatus: number, faultCause: string) {
+    // 1.要更新的数据
+    let data: relationalStore.ValuesBucket = {CHECK_STATUS: checkStatus, FAULT_CAUSE: faultCause}
+    // 2.更新的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 3.更新操作
+    return this.rdbStore?.update(data, predicates)
+  }
+  /**
+   * 根据id删除自检
+   * @param id 任务id
+   */
+  deleteRobotSelfCheckById(id: number){
+    // 1.删除的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 2.删除操作
+    return this.rdbStore?.delete(predicates)
+  }
+}
+
+let robotSelfCheckModel = new RobotSelfCheckModel();
+
+export default robotSelfCheckModel as RobotSelfCheckModel;

+ 121 - 0
entry/src/main/ets/model/database/StorageModel.ets

@@ -0,0 +1,121 @@
+import relationalStore from '@ohos.data.relationalStore';
+import CommonConstants from '../../common/constants/CommonConstants';
+import StorageInfo from '../StorageInfo';
+
+class StorageModel {
+
+  private rdbStore: relationalStore.RdbStore | undefined = undefined;
+
+  private tableName: string = 'STORAGE'
+
+  /**
+   * 初始化表
+   */
+  async initTaskDB(context:Context){
+
+    // 1.rdb配置
+    const config = {
+      name: CommonConstants.RDB_NAME,
+      securityLevel: relationalStore.SecurityLevel.S1
+    }as relationalStore.StoreConfig
+    try {
+      // 获取数据库存储对象
+      this.rdbStore = await relationalStore.getRdbStore(context,config);
+    } catch (err) {
+      console.info(`getRdbStore err ${JSON.stringify(err)}`);
+    }
+    // 2.初始化SQL语句
+    const sql = `CREATE TABLE IF NOT EXISTS STORAGE (
+                  ID INTEGER PRIMARY KEY AUTOINCREMENT,
+                  STORAGE_NAME TEXT NOT NULL,
+                  X_SIZE INTEGER NOT NULL,
+                  Y_SIZE INTEGER NOT NULL,
+                  DEFAULT_LAYER INTEGER NOT NULL
+                 )`
+    // 3.获取rdb
+    relationalStore.getRdbStore(context, config, (err, rdbStore) => {
+      if(err){
+        console.log('testTag', '获取rdbStore失败!')
+        return
+      }
+      // 执行Sql
+      rdbStore.executeSql(sql).then(()=>{
+        console.log('testTag', '创建仓储表成功!')
+      }).catch((err:object)=>{
+        console.log('testTag', '创建失败')
+      })
+      // 保存rdbStore
+      this.rdbStore = rdbStore
+    })
+  }
+
+  /**
+   * 查询仓储列表
+   */
+  async  getStorageList(){
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    console.log("textTag"+this.tableName)
+    // 2.查询
+    let result:relationalStore.ResultSet |undefined= await this.rdbStore?.query(predicates, ['ID', 'STORAGE_NAME', 'X_SIZE', 'Y_SIZE', 'DEFAULT_LAYER'])
+    // 3.解析查询结果
+    // 3.1.定义一个数组,组装最终的查询结果
+    let storages: StorageInfo[] = []
+    // 3.2.遍历封装
+    while(!result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result?.goToNextRow()
+      // 3.4.获取数据
+      let id = result?.getLong(result?.getColumnIndex('ID'))
+      let storageName = result?.getString(result?.getColumnIndex('STORAGE_NAME'))
+      let xSize = result?.getLong(result?.getColumnIndex('X_SIZE'))
+      let ySize = result?.getLong(result?.getColumnIndex('Y_SIZE'))
+      let defaultLayer = result?.getLong(result?.getColumnIndex('DEFAULT_LAYER'))
+      // 3.5.封装到数组
+      storages.push({id, storageName, xSize, ySize, defaultLayer})
+    }
+    return storages
+  }
+
+  /**
+   * 添加仓储
+   * @param storageName 仓储名称
+   * @param xSize x尺寸
+   * @param ySize y尺寸
+   * @param defaultLayer 默认尺寸
+   * @returns 仓储id
+   */
+  addStorage(storageName: string, xSize: number, ySize: number, defaultLayer: number): Promise<number> | undefined{
+      return this.rdbStore?.insert(this.tableName, {STORAGE_NAME: storageName, X_SIZE: xSize, Y_SIZE: ySize, DEFAULT_LAYER: defaultLayer})
+  }
+
+  /**
+   * 根据id更新仓储状态
+   * @param id 任务id
+   * @param finished 任务是否完成
+   */
+  updateStorage(id: number, storageName: string, xSize: number, ySize: number, defaultLayer: number) {
+    // 1.要更新的数据
+    let data: relationalStore.ValuesBucket = {STORAGE_NAME: storageName, X_SIZE: xSize, Y_SIZE: ySize, DEFAULT_LAYER: defaultLayer}
+    // 2.更新的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 3.更新操作
+    return this.rdbStore?.update(data, predicates)
+  }
+  /**
+   * 根据id删除任务
+   * @param id 任务id
+   */
+  deleteStorageById(id: number){
+    // 1.删除的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 2.删除操作
+    return this.rdbStore?.delete(predicates)
+  }
+}
+
+let storageModel = new StorageModel();
+
+export default storageModel as StorageModel;

+ 161 - 0
entry/src/main/ets/model/database/StorageSpaceModel.ets

@@ -0,0 +1,161 @@
+import relationalStore from '@ohos.data.relationalStore';
+import CommonConstants from '../../common/constants/CommonConstants';
+import StorageInfo from '../StorageInfo';
+import StorageSpace from '../StorageSpace';
+
+class StorageSpaceModel {
+
+  private rdbStore: relationalStore.RdbStore | undefined = undefined
+  private tableName: string = 'STORAGE_SPACE'
+  /**
+   * 初始化表
+   */
+  async initTaskDB(context:Context){
+    // 1.rdb配置
+    const config = {
+      name: CommonConstants.RDB_NAME,
+      securityLevel: relationalStore.SecurityLevel.S1
+    } as relationalStore.StoreConfig
+    try {
+      // 获取数据库存储对象
+      this.rdbStore = await relationalStore.getRdbStore(context,config);
+    } catch (err) {
+      console.info(`getRdbStore err ${JSON.stringify(err)}`);
+    }
+    // 2.初始化SQL语句
+    const sql = `CREATE TABLE IF NOT EXISTS STORAGE_SPACE (
+                  ID INTEGER PRIMARY KEY AUTOINCREMENT,
+                  STORAGE_ID INTEGER NOT NULL,
+                  X INTEGER NULL,
+                  Y INTEGER NULL,
+                  ENABLE_STATE INTEGER NULL,
+                  STORAGE_TYPE TEXT NULL,
+                  CAPACITY INTEGER NULL,
+                  CAN_WAY INTEGER NULL,
+                  CAN_PARK INTEGER NULL,
+                  PARK_TYPE INTEGER NULL
+                 )`
+    // 3.获取rdb
+    relationalStore.getRdbStore(context, config, (err, rdbStore) => {
+      if(err){
+        console.log('testTag', '获取rdbStore失败!')
+        return
+      }
+      // 执行Sql
+      rdbStore.executeSql(sql).then(()=>{
+        console.log('testTag', '创建储位表成功!')
+      }).catch((err:object)=>{
+        console.log('testTag', '创建失败')
+      })
+      // 保存rdbStore
+      this.rdbStore = rdbStore
+    })
+  }
+
+  /**
+   * 查询储位列表
+   */
+  async getListByStorageId(storageId: number){
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('STORAGE_ID', storageId)
+    predicates.orderByAsc('Y')
+    predicates.orderByAsc('X')
+
+    // 2.查询
+    let result: relationalStore.ResultSet | undefined = await this.rdbStore?.query(predicates, ['ID', 'STORAGE_ID', 'X', 'Y', 'ENABLE_STATE', 'STORAGE_TYPE', 'CAPACITY', 'CAN_WAY', 'CAN_PARK', 'PARK_TYPE'])
+    // 3.解析查询结果
+    // 3.1.定义一个数组,组装最终的查询结果
+    let spaces: StorageSpace[] = []
+    // 3.2.遍历封装
+    while(!result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result?.goToNextRow()
+      // 3.4.获取数据
+      let id = result?.getLong(result?.getColumnIndex('ID'))
+      let storageId = result?.getLong(result?.getColumnIndex('STORAGE_ID'))
+      let x = result?.getLong(result?.getColumnIndex('X'))
+      let y = result?.getLong(result?.getColumnIndex('Y'))
+      let enableState = result?.getLong(result?.getColumnIndex('ENABLE_STATE'))
+      let storageType = result?.getString(result?.getColumnIndex('STORAGE_TYPE'))
+      let capacity = result?.getLong(result?.getColumnIndex('CAPACITY'))
+      let canWay = result?.getLong(result?.getColumnIndex('CAN_WAY'))
+      let canPark = result?.getLong(result?.getColumnIndex('CAN_PARK'))
+      let parkType = result?.getLong(result?.getColumnIndex('PARK_TYPE'))
+      // 3.5.封装到数组
+      spaces.push({id, storageId, x, y, enableState, storageType, capacity, canWay, canPark, parkType})
+    }
+    return spaces
+  }
+
+  /**
+   * 添加储位
+   * @param space 储位信息
+   * @returns 储位id
+   */
+  addStorageSpace(space: StorageSpace): Promise<number> | undefined {
+      return this.rdbStore?.insert(this.tableName, {STORAGE_ID: space.storageId, X: space.x, Y: space.y, ENABLE_STATE: space.enableState, STORAGE_TYPE: space.storageType, CAPACITY: space.capacity,
+        CAN_WAY: space.canWay, CAN_PARK: space.canPark, PARK_TYPE: space.parkType} as relationalStore.ValuesBucket)
+  }
+
+  /**
+   * 根据id更新储位
+   * @param id 任务id
+   * @param finished 任务是否完成
+   */
+  updateStorageSpace(id: number, enableState: number, storageType: string, capacity: number, canWay: number, canPark: number, parkType: number) {
+    // 1.要更新的数据
+    let data: relationalStore.ValuesBucket = {ENABLE_STATE: enableState, STORAGE_TYPE: storageType, CAPACITY: capacity, CAN_WAY: canWay, CAN_PARK: canPark, PARK_TYPE: parkType}
+    // 2.更新的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 3.更新操作
+    return this.rdbStore?.update(data, predicates)
+  }
+
+  /**
+   * 根据id删除储位
+   * @param id 任务id
+   */
+  deleteStorageSpaceById(id: number){
+    // 1.删除的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 2.删除操作
+    return this.rdbStore?.delete(predicates)
+  }
+
+  /**
+   * 根据仓储id删除储位
+   * @param id 任务id
+   */
+  deleteByStorageId(storageId: number | undefined){
+    // 1.删除的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('STORAGE_ID', storageId)
+    // 2.删除操作
+    return this.rdbStore?.delete(predicates)
+  }
+
+  // 初始化仓储的储位列表
+  initDataByStorage(storage: StorageInfo ) {
+    // 删除之前的储位
+    this.deleteByStorageId(storage.id)
+    if (storage.xSize && storage.xSize > 0 && storage.ySize && storage.ySize > 0) {
+      for (let y = 1; y <= storage.ySize; y++) {
+        for (let x = 1; x <= storage.xSize; x++) {
+          let space = {storageId: storage.id, x: x, y: y, enableState: 1, storageType: '', capacity: storage.defaultLayer, canWay: 1, canPark: 0}as StorageSpace
+          this.addStorageSpace(space)
+        }
+      }
+    }
+  }
+
+  batchInsert(array: relationalStore.ValuesBucket[]) {
+    return this.rdbStore?.batchInsert(this.tableName, array)
+  }
+}
+
+let storageSpaceModel = new StorageSpaceModel();
+
+export default storageSpaceModel as StorageSpaceModel;

+ 144 - 0
entry/src/main/ets/model/database/UniversalCardModel.ets

@@ -0,0 +1,144 @@
+import relationalStore from '@ohos.data.relationalStore';
+import CommonConstants from '../../common/constants/CommonConstants';
+import UniversalCard from '../UniversalCard';
+
+class UniversalCardModel {
+
+  private rdbStore: relationalStore.RdbStore | undefined
+  private tableName: string = 'UNIVERSAL_CARD'
+
+  /**
+   * 初始化表
+   */
+  async initTaskDB(context:Context){
+    // 1.rdb配置
+    const config = {
+      name: CommonConstants.RDB_NAME,
+      securityLevel: relationalStore.SecurityLevel.S1
+    }as relationalStore.StoreConfig
+    try {
+      // 获取数据库存储对象
+      this.rdbStore = await relationalStore.getRdbStore(context,config);
+    } catch (err) {
+      console.info(`getRdbStore err ${JSON.stringify(err)}`);
+    }
+    // 2.初始化SQL语句
+    const sql = `CREATE TABLE IF NOT EXISTS UNIVERSAL_CARD (
+                  ID INTEGER PRIMARY KEY AUTOINCREMENT,
+                  USER_ID INTEGER NOT NULL,
+                  CARD_TYPE INTEGER NOT NULL,
+                  CARD_STATUS INTEGER NOT NULL,
+                  CARD_SORT INTEGER NOT NULL
+                 )`
+    // 3.获取rdb
+    relationalStore.getRdbStore(context, config, (err, rdbStore) => {
+      if(err){
+        console.log('testTag', '获取rdbStore失败!')
+        return
+      }
+      // 执行Sql
+      rdbStore.executeSql(sql).then(()=>{
+        console.log('testTag', '创建万能卡片表成功!')
+      }).catch((err: object)=>{
+        console.log('testTag', '创建失败')
+      })
+      // 保存rdbStore
+      this.rdbStore = rdbStore
+    })
+  }
+
+  // 根据用户查询对应的万能卡片配置信息
+  async getListByUserId(userId: number): Promise<UniversalCard[] | undefined > {
+    if (!userId) {
+      return
+    }
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('USER_ID', userId)
+    predicates.orderByAsc('CARD_SORT')
+    // 2.查询
+    let result = await this.rdbStore?.query(predicates, ['ID', 'USER_ID', 'CARD_TYPE', 'CARD_STATUS', 'CARD_SORT'])
+    let cards: UniversalCard[] = []
+    console.log("textTag",'111111',cards)
+    // 3.2.遍历封装 只取第一条
+    while(result && !result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result.goToNextRow()
+      // 3.4.获取数据
+      let id = result.getLong(result.getColumnIndex('ID'))
+      let userId = result.getLong(result.getColumnIndex('USER_ID'))
+      let cardType = result.getLong(result.getColumnIndex('CARD_TYPE'))
+      let cardStatus = result.getLong(result.getColumnIndex('CARD_STATUS'))
+      let cardSort = result.getLong(result.getColumnIndex('CARD_SORT'))
+      cards.push({id: id, userId: userId, cardType: cardType, cardStatus: cardStatus, cardSort: cardSort})
+    }
+    return cards
+  }
+
+  /**
+   * 查询万能卡片列表
+   */
+  async getUniversalCardList(){
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    // 2.查询
+    let result = await this.rdbStore?.query(predicates, ['ID', 'USER_ID', 'CARD_TYPE', 'CARD_STATUS', 'CARD_SORT'])
+    // 3.解析查询结果
+    // 3.1.定义一个数组,组装最终的查询结果
+    let cards: UniversalCard[] = []
+    // 3.2.遍历封装
+    while(result && !result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result.goToNextRow()
+      // 3.4.获取数据
+      let id = result.getLong(result.getColumnIndex('ID'))
+      let userId = result.getLong(result.getColumnIndex('USER_ID'))
+      let cardType = result.getLong(result.getColumnIndex('CARD_TYPE'))
+      let cardStatus = result.getLong(result.getColumnIndex('CARD_STATUS'))
+      let cardSort = result.getLong(result.getColumnIndex('CARD_SORT'))
+      // 3.5.封装到数组
+      cards.push({id: id, userId: userId, cardType: cardType, cardStatus: cardStatus, cardSort: cardSort})
+    }
+    return cards
+  }
+
+  /**
+   * 添加万能卡片
+   * @param card 万能卡片配置信息
+   * @returns 万能卡片id
+   */
+  addUniversalCard(card: UniversalCard): Promise<number> | undefined{
+    return this.rdbStore?.insert(this.tableName, {USER_ID: card.userId,
+      CARD_TYPE: card.cardType, CARD_STATUS: card.cardStatus, CARD_SORT: card.cardSort} as relationalStore.ValuesBucket)
+  }
+
+  /**
+   * 根据id更新万能卡片状态
+   * @param card 万能卡片配置信息
+   */
+  updateUniversalCard(card: UniversalCard) {
+    // 1.要更新的数据
+    let data:relationalStore.ValuesBucket | undefined= {CARD_TYPE: card.cardType as number, CARD_STATUS: card.cardStatus as number, CARD_SORT: card.cardSort as number}
+    // 2.更新的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', card.id)
+    // 3.更新操作
+    return this.rdbStore?.update(data, predicates)
+  }
+
+  /**
+   * 根据id删除
+   * @param id 主键id
+   */
+  deleteUniversalCardById(id: number){
+    // 1.删除的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 2.删除操作
+    return this.rdbStore?.delete(predicates)
+  }
+}
+
+let universalCardModel = new UniversalCardModel();
+
+export default universalCardModel as UniversalCardModel;

+ 158 - 0
entry/src/main/ets/model/database/UserAuthModel.ets

@@ -0,0 +1,158 @@
+import relationalStore from '@ohos.data.relationalStore';
+import CommonConstants from '../../common/constants/CommonConstants';
+import UserInfo from '../UserAuthInfo';
+
+class UserModel {
+
+  private rdbStore: relationalStore.RdbStore |undefined=undefined
+  private tableName: string = 'USER'
+
+  /**
+   * 初始化表
+   */
+  async initTaskDB(context:Context){
+    // 1.rdb配置
+    const config = {
+      name: CommonConstants.RDB_NAME,
+      securityLevel: relationalStore.SecurityLevel.S1
+    }as relationalStore.StoreConfig
+    try {
+      // 获取数据库存储对象
+      this.rdbStore = await relationalStore.getRdbStore(context,config);
+    } catch (err) {
+      console.info(`getRdbStore err ${JSON.stringify(err)}`);
+    }
+    // 2.初始化SQL语句
+    const sql = `CREATE TABLE IF NOT EXISTS USER (
+                  ID INTEGER PRIMARY KEY AUTOINCREMENT,
+                  USER_ID INTEGER NOT NULL,
+                  USER_NAME VARCHAR NOT NULL,
+                  PASSWORD VARCHAR NOT NULL,
+                  ORG_ID INTEGER NOT NULL,
+                  STATION_ID INTEGER NOT NULL,
+                  STATION_NAME VARCHAR NULL,
+                  STATION_DICE_VALUE VARCHAR NULL,
+                  AVATAR VARCHAR NULL,
+                  MAINTAIN_LOGIN_STATUS INTEGER NOT NULL,
+                  UPDATE_TIME INTEGER NOT NULL
+                 )`
+    // 3.获取rdb
+    relationalStore.getRdbStore(context, config, (err, rdbStore) => {
+      if(err){
+        console.log('testTag', '获取rdbStore失败!')
+        return
+      }
+      // 执行Sql
+      rdbStore.executeSql(sql).then(()=>{
+        console.log('testTag', '创建用户设置表成功!')
+      }).catch((err: object)=>{
+        console.log('testTag', '创建失败')
+      })
+      // 保存rdbStore
+      this.rdbStore = rdbStore
+    })
+  }
+
+  // 查询最后一次用户登录的数据
+  async getLast(): Promise<UserInfo | undefined> {
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.orderByDesc('UPDATE_TIME')
+    predicates.limitAs(1)
+    // 2.查询
+    let result = await this.rdbStore?.query(predicates, ['ID', 'USER_ID', 'USER_NAME', 'PASSWORD', 'ORG_ID', 'STATION_ID', 'STATION_NAME', 'STATION_DICE_VALUE', 'AVATAR', 'MAINTAIN_LOGIN_STATUS', 'UPDATE_TIME'])
+    // 3.2.遍历封装 只取第一条
+    while(!result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result?.goToNextRow()
+      // 3.4.获取数据
+      let id = result?.getLong(result?.getColumnIndex('ID'))
+      let userId = result?.getLong(result?.getColumnIndex('USER_ID'))
+      let userName = result?.getString(result?.getColumnIndex('USER_NAME'))
+      let password = result?.getString(result?.getColumnIndex('PASSWORD'))
+      let orgId = result?.getLong(result?.getColumnIndex('ORG_ID'))
+      let stationId = result?.getLong(result?.getColumnIndex('STATION_ID'))
+      let stationName = result?.getString(result?.getColumnIndex('STATION_NAME'))
+      let stationDictValue = result?.getString(result?.getColumnIndex('STATION_DICE_VALUE'))
+      let avatar = result?.getString(result?.getColumnIndex('AVATAR'))
+      let maintainLoginStatus = result?.getLong(result?.getColumnIndex('MAINTAIN_LOGIN_STATUS'))
+      let updateTime = result?.getLong(result?.getColumnIndex('UPDATE_TIME'))
+      return {id: id, userId: userId, userName: userName, password: password, orgId: orgId, stationId: stationId, stationName: stationName, stationDictValue: stationDictValue, avatar: avatar, maintainLoginStatus: maintainLoginStatus, updateTime: updateTime}
+    }
+    return
+  }
+
+  // 查询最后一次用户登录的数据
+  async getByUserId(userId: number): Promise<UserInfo | undefined> {
+    if (!userId) {
+      return
+    }
+    // 1.构建查询条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('USER_ID', userId)
+    predicates.orderByDesc('UPDATE_TIME')
+    predicates.limitAs(1)
+    // 2.查询
+    let result: relationalStore.ResultSet | undefined = await this.rdbStore?.query(predicates, ['ID', 'USER_ID', 'USER_NAME', 'PASSWORD', 'ORG_ID', 'STATION_ID', 'STATION_NAME', 'STATION_DICE_VALUE', 'AVATAR', 'MAINTAIN_LOGIN_STATUS', 'UPDATE_TIME'])
+    // 3.2.遍历封装 只取第一条
+    while(result && !result?.isAtLastRow){
+      // 3.3.指针移动到下一行
+      result.goToNextRow()
+      // 3.4.获取数据
+      let id = result.getLong(result.getColumnIndex('ID'))
+      let userId = result.getLong(result.getColumnIndex('USER_ID'))
+      let userName = result.getString(result.getColumnIndex('USER_NAME'))
+      let password = result.getString(result.getColumnIndex('PASSWORD'))
+      let orgId = result.getLong(result.getColumnIndex('ORG_ID'))
+      let stationId = result.getLong(result.getColumnIndex('STATION_ID'))
+      let stationName = result?.getString(result?.getColumnIndex('STATION_NAME'))
+      let stationDictValue = result?.getString(result?.getColumnIndex('STATION_DICE_VALUE'))
+      let avatar = result.getString(result.getColumnIndex('AVATAR'))
+      let maintainLoginStatus = result.getLong(result.getColumnIndex('MAINTAIN_LOGIN_STATUS'))
+      let updateTime = result.getLong(result.getColumnIndex('UPDATE_TIME'))
+      return {id: id, userId: userId, userName: userName, password: password, orgId: orgId, stationId: stationId, stationName: stationName, stationDictValue: stationDictValue, avatar: avatar, maintainLoginStatus: maintainLoginStatus, updateTime: updateTime}
+    }
+    return
+  }
+
+  /**
+   * 添加用户设置
+   * @param user 用户信息
+   * @returns 用户信息id
+   */
+  addUser(user: UserInfo): Promise<number> | undefined {
+    return this.rdbStore?.insert(this.tableName, {USER_ID: user.userId, USER_NAME: user.userName, PASSWORD: user.password, ORG_ID: user.orgId, STATION_ID: user.stationId, STATION_NAME: user.stationName, STATION_DICE_VALUE: user.stationDictValue, AVATAR: user.avatar, MAINTAIN_LOGIN_STATUS: user.maintainLoginStatus, UPDATE_TIME: user.updateTime} as relationalStore.ValuesBucket)
+  }
+
+  /**
+   * 根据id更新用户设置状态
+   * @param id 任务id
+   * @param finished 任务是否完成
+   */
+  updateUser(user: UserInfo) {
+
+    // 1.要更新的数据
+    let data: relationalStore.ValuesBucket = {USER_ID: user.userId as number, USER_NAME: user.userName as string, PASSWORD: user.password as string, ORG_ID: user.orgId as number, STATION_ID: user.stationId as number, STATION_NAME: user.stationName as string, STATION_DICE_VALUE: user.stationDictValue as string, AVATAR: user.avatar as string, MAINTAIN_LOGIN_STATUS: user.maintainLoginStatus as number, UPDATE_TIME: user.updateTime as number}
+    // 2.更新的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', user.id)
+    // 3.更新操作
+    return this.rdbStore?.update(data, predicates)
+  }
+
+  /**
+   * 根据id删除任务
+   * @param id 任务id
+   */
+  deleteUserById(id: number){
+    // 1.删除的条件
+    let predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('ID', id)
+    // 2.删除操作
+    return this.rdbStore?.delete(predicates)
+  }
+}
+
+let userModel = new UserModel();
+
+export default userModel as UserModel;

+ 19 - 0
entry/src/main/ets/model/processmodel/MaterialInfo.ets

@@ -0,0 +1,19 @@
+/*
+ * 物料信息
+ * */
+export default class MaterialInfo {
+  // id
+  id: number;
+  // 物料名称
+  materialName:string
+  // 物料号
+  materialNo?: string
+  // 批次号
+  batchCode?: string
+  //需求数量
+  needNum: number
+  // 采集数量
+  collectNum?: number
+  // 库存数量
+  storeNum?: number
+}

+ 18 - 0
entry/src/main/ets/model/processmodel/OrderInfo.ets

@@ -0,0 +1,18 @@
+export default class OrderInfo {
+  // 订单id
+  id: number
+  // 订单名称
+  orderName: string
+  // 产品型号
+  productModel: string
+  // 计划编号
+  planCode: string
+  // 订单编号
+  orderCode: string
+  // 主料齐套
+  kittingNum: number
+  // 订单数量
+  orderNum: number
+  // 订单状态(1:未开始 2:生产中 3:已完成)
+  orderState: number = 1
+}

+ 17 - 0
entry/src/main/ets/model/processmodel/ProcessAlarmData.ets

@@ -0,0 +1,17 @@
+/*
+ * 告警信息类
+ * */
+export default class ProcessAlarmData {
+  // 告警类型(1:圈数过多 2:圈数不足 3:力矩过大 4:力矩不足)
+  alarmType?: number;
+  // 告警类型编码
+  alarmTypeCode?: string;
+  // 告警字符
+  alarmStr?: string;
+
+  // constructor(alarmType: number, alarmTypeCode: string, alarmStr: string) {
+  //   this.alarmType = alarmType
+  //   this.alarmTypeCode = alarmTypeCode
+  //   this.alarmStr = alarmStr
+  // }
+}

+ 18 - 0
entry/src/main/ets/model/processmodel/ProcessHandleData.ets

@@ -0,0 +1,18 @@
+/*
+ * 加工工艺数据类
+ * */
+@Observed
+export default class ProcessHandleData {
+  // 步骤
+  step?: number;
+  // 力矩
+  moment?: number;
+  // 力矩单位
+  momentUnit?: string = 'N.m';
+  // 旋转角度
+  rotate?: number;
+  // 力矩单位
+  rotateUnit?: string = '°';
+  // 加工状态 (1:已完成 2:未完成)
+  handleState?: number = 2;
+}

+ 20 - 0
entry/src/main/ets/model/processmodel/ProcessNoticeInfo.ets

@@ -0,0 +1,20 @@
+/*
+ * 通知信息表
+ * */
+export default class ProcessNoticeInfo {
+  // id
+  id: number;
+  // 通知
+  Notice: string ;
+  // 通知日期
+  NoticeDate: string ;
+  //默认层数
+  defaultLayer: number
+
+  constructor(id:number,Notice:string,NoticeDate:string,defaultLayer:number) {
+    this.id = id
+    this.Notice = Notice
+    this.NoticeDate = NoticeDate
+    this.defaultLayer = defaultLayer
+  }
+}

+ 29 - 0
entry/src/main/ets/model/processmodel/ProcessStandardData.ets

@@ -0,0 +1,29 @@
+/*
+ * 标准施工工艺类
+ * */
+export default class ProcessStandardData {
+  // 步骤
+  step?: number;
+  // 力矩最小值
+  momentMin?:number;
+  // 力矩最大值
+  momentMax?:number;
+  // 力矩单位
+  momentUnit?: string = 'N.m';
+  // 旋转角度最小值
+  rotateMin?: number;
+  // 旋转角度最小值
+  rotateMax?: number;
+  // 力矩单位
+  rotateUnit?: string = '°';
+
+  // constructor(step: number, momentMin:number, momentMax:number, momentUnit: string, rotateMin: number, rotateMax: number, rotateUnit: string) {
+  //   this.step = step
+  //   this.momentMin = momentMin
+  //   this.momentMax = momentMax
+  //   this.momentUnit = momentUnit
+  //   this.rotateMin = rotateMin
+  //   this.rotateMax = rotateMax
+  //   this.rotateUnit = rotateUnit
+  // }
+}

+ 10 - 0
entry/src/main/ets/model/processmodel/ProductInfo.ets

@@ -0,0 +1,10 @@
+export default class ProductInfo {
+  // id
+  id?: number
+  // 产品名称
+  productName?: string
+  // 产品编号
+  productCode?: string
+  // 产品型号
+  productModel?: string
+}

+ 132 - 0
entry/src/main/ets/pages/Distribute.ets

@@ -0,0 +1,132 @@
+import {TitleStateComp,}from '../common/component/TitleStateComp'
+import { BottomOperateComp } from '../common/component/BottomOperateComp';
+import router from '@ohos.router';
+
+@Entry
+@Component
+export struct Distribute{
+  private isHomePage: boolean = false
+  build(){
+    Column(){
+      TitleStateComp({ isHomePage: this.isHomePage})
+      Column(){
+        Text('分布式控制')
+          .width('100%')
+          .fontSize('51px')
+          .fontColor('#e6000000')
+          .textAlign(TextAlign.Center)
+          .height('10%')
+        Row(){
+          Column(){
+            Image($r('app.media.distributeimage'))
+              .height('90%')
+              .width('100%')
+              .border({width:5})
+              .borderRadius(21)
+            Row(){
+              Image($r('app.media.yonghudiannao'))
+                .width('80px')
+                .height('80px')
+              Text('王德发')
+                .width('100%')
+                }
+          }.width('25%')
+          .height('100%')
+          .padding({left:20})
+          Column(){
+            Stack(){
+              Image($r('app.media.distributeimage'))
+                .height('90%')
+                .width('100%')
+                .border({width:5})
+                .borderRadius(21)
+                .blur(40)
+
+              Row({space:50}){
+                Image($r('app.media.connect'))
+                  .width('120px')
+                  .height('120px')
+                  .onClick(()=>{
+                    router.pushUrl({
+                      url:'pages/DistributedControl'
+                    })
+                  })
+                Image($r('app.media.break'))
+                  .width('120px')
+                  .height('120px')
+
+              }.height('90%')
+              .width('100%')
+              .justifyContent(FlexAlign.Center)
+            }
+            Row(){
+              Image($r('app.media.yonghudiannao'))
+                .width('80px')
+                .height('80px')
+              Text('李敏')
+                .width('100%')
+            }
+
+
+
+          }.width('25%')
+          .height('100%')
+          .padding({left:20})
+          Column(){
+            Stack(){
+              Image($r('app.media.distributeimage'))
+                .height('90%')
+                .width('100%')
+                .border({width:5})
+                .borderRadius(21)
+                .blur(40)
+
+              Row({space:50}){
+                Image($r('app.media.connect'))
+                  .width('120px')
+                  .height('120px')
+                  .onClick(()=>{
+                    router.pushUrl({
+                      url:'pages/DistributedControl'
+                    })
+                  })
+                Image($r('app.media.break'))
+                  .width('120px')
+                  .height('120px')
+
+              }.height('90%')
+              .width('100%')
+              .justifyContent(FlexAlign.Center)
+            }
+            Row(){
+              Image($r('app.media.yonghudiannao'))
+                .width('80px')
+                .height('80px')
+              Text('王浩')
+                .width('100%')
+            }
+
+
+
+          }.width('25%')
+          .height('100%')
+          .padding({left:20})
+
+
+        }.width('100%')
+        .height('40%')
+
+
+
+
+
+
+      }
+      .width('100%')
+      .height('84%')
+      BottomOperateComp({ isHomePage: this.isHomePage })
+    }.width('100%')
+    .height('100%')
+
+  }
+}

+ 124 - 0
entry/src/main/ets/pages/DistributedControl.ets

@@ -0,0 +1,124 @@
+import {TitleStateComp,}from '../common/component/TitleStateComp'
+import { BottomOperateComp } from '../common/component/BottomOperateComp';
+import router from '@ohos.router';
+@Entry
+@Component
+export struct DistributeControl{
+  @State click:boolean=true
+  private isHomePage: boolean = false
+  build(){
+    Column(){
+      TitleStateComp({ isHomePage: this.isHomePage})
+      Column(){
+        Row(){
+          Image($r('app.media.Frame'))
+            .height('52px')
+            .height('52px')
+            .padding({left:20})
+            .onClick(()=>{
+              router.pushUrl({
+                url:'pages/Distribute'
+              })
+            })
+          Text('分布式控制')
+            .width('80%')
+            .fontSize('51px')
+            .fontColor('#e6000000')
+            .textAlign(TextAlign.Center)
+            .height('100%')
+        } .height('10%')
+        .width('100%')
+        Row(){
+          Blank()
+            Image($r('app.media.distributeimage'))
+              .height('90%')
+              .width('60%')
+              .border({width:5})
+              .borderRadius(21)
+          Column(){
+            Column(){
+
+          }.width('100%')
+            .height('20%')
+            Column({space:60}){
+              if(this.click===true){
+                Column(){
+                  Image($r('app.media.suoping'))
+                    .width('150px')
+                    .height('150px')
+                    .onClick(()=>{
+                      this.click=false
+                    })
+                  Text('锁屏')
+                    .fontSize('32px')
+                    .fontColor('#e6000000')
+                    .fontWeight(FontWeight.Medium)
+                }
+
+              } else if (this.click===false) {
+                Column(){
+                  Image($r('app.media.unlock'))
+                    .width('150px')
+                    .height('150px')
+                    .onClick(()=>{
+                      this.click=true
+                    })
+                  Text('解锁')
+                    .fontSize('32px')
+                    .fontColor('#e6000000')
+                    .fontWeight(FontWeight.Medium)
+                }
+              }
+              Column(){
+                Image($r('app.media.xiping'))
+                  .width('150px')
+                  .height('150px')
+                  .onClick(()=>{
+                    this.click=true
+                  })
+                Text('熄屏')
+                  .fontSize('32px')
+                  .fontColor('#e6000000')
+                  .fontWeight(FontWeight.Medium)
+              }
+
+            }.width('100%')
+            .height('60%')
+            Column(){
+              Text('退出')
+                .width('70%')
+                .height('50%')
+                .fontColor('#fff')
+                .borderRadius(21)
+                .textAlign(TextAlign.Center)
+                .backgroundColor("#0A59F7")
+                .onClick(()=>{
+                  router.pushUrl({
+                    url:'pages/Distribute'
+                  })
+                })
+            }.width('100%')
+            .height('20%')
+            .justifyContent(FlexAlign.Center)
+
+
+
+
+
+          }.height("100%")
+          .width('25%')
+          .justifyContent(FlexAlign.Center)
+
+        }
+        .width('100%')
+        .height('90%')
+
+      }
+      .width('100%')
+      .height('84%')
+      BottomOperateComp({ isHomePage: this.isHomePage })
+    }.width('100%')
+    .height('100%')
+
+  }
+}

+ 177 - 0
entry/src/main/ets/pages/DistributedPage.ets

@@ -0,0 +1,177 @@
+import deviceManager from '@ohos.distributedDeviceManager';
+import common from '@ohos.app.ability.common';
+import { KvStoreModel } from '../model/KvStoreModel';
+import { BUNDLE_NAME, RemoteDeviceModel } from '../model/RemoteDeviceModel';
+import Want from '@ohos.app.ability.Want';
+import { DeviceDialog } from '../common/DeviceDialog';
+import router from '@ohos.router';
+import { class1 } from './Storage';
+
+const TAG: string = 'testTag'
+const DATA_CHANGE: string = 'dataChange'
+const DATA_CHANGE1: number = 0
+const EXIT: string = 'exit'
+@Entry
+@Component
+struct DistributedPage{
+ // @StorageLink('deviceList') deviceList: Array<deviceManager.DeviceBasicInfo> = AppStorage.get('deviceList')!;
+  //private selectedIndex: number | undefined = 0;
+ // private onSelectedIndexChange: (selectedIndex: number | undefined) => void = () => {
+  //}
+  @State deviceDialogWidth: number = 0
+  @State @Watch('dataChange')  click: number = 0;
+  @State  click1: number = 0;
+  @State @Watch('dataChange')  message: string = 'Hello World';
+  @State inputMsg: string = '';
+  @State isDistributed: boolean = false
+  @StorageLink('deviceList') deviceList: Array<deviceManager.DeviceBasicInfo> = []
+  @State selectedIndex: number | undefined = -1
+
+  private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel()
+  private kvStoreModel: KvStoreModel = new KvStoreModel()
+  private dialogController: CustomDialogController | null = null
+
+  onSelectedIndexChange = async (index: number | undefined) => {
+    console.info(TAG, `selectedIndexChange`)
+    this.selectedIndex = index
+    this.selectDevice()
+  }
+
+  async aboutToAppear() {
+    this.showDeviceDialog()
+  }
+// aboutToAppear(){
+//   this.showDeviceDialog()
+// }
+  aboutToDisappear() {
+    this.kvStoreModel.deleteKvStore()
+  }
+
+  startAbilityCallBack = (key: string) => {
+    if (DATA_CHANGE === key) {
+      this.kvStoreModel.put(DATA_CHANGE, this.message)
+    }
+    if (EXIT === key) {
+      this.kvStoreModel.put(DATA_CHANGE, EXIT)
+    }
+  }
+
+  selectDevice() {
+    this.isDistributed = true
+    if (this.selectedIndex !== undefined && (this.remoteDeviceModel === null || this.remoteDeviceModel.discoverList.length <= 0)) {
+      console.info(TAG, `continue unauthed device: ${JSON.stringify(this.deviceList)}`)
+      this.startAbility(this.deviceList[this.selectedIndex].networkId as string)
+      this.clearSelectState()
+      return
+    }
+
+    if (this.selectedIndex !== undefined) {
+      this.remoteDeviceModel.authenticateDevice(this.deviceList[this.selectedIndex], () => {
+        if (this.remoteDeviceModel !== null && this.remoteDeviceModel.deviceList !== null && this.selectedIndex !== undefined) {
+          for (let i = 0; i < this.remoteDeviceModel.deviceList!.length; i++) {
+            if (this.remoteDeviceModel.deviceList![i].deviceName === this.deviceList[this.selectedIndex].deviceName) {
+              this.startAbility(this.remoteDeviceModel.deviceList![i].networkId);
+            }
+          }
+        }
+      })
+    }
+    this.clearSelectState()
+  }
+
+  clearSelectState() {
+    this.deviceList = []
+    if (this.dialogController !== null) {
+      this.dialogController.close()
+    }
+    console.info(TAG, `cancelDialog`)
+    if (this.remoteDeviceModel === undefined) {
+      return
+    }
+    this.remoteDeviceModel.unregisterDeviceListCallback()
+  }
+
+  async startAbility(deviceId: string | undefined) {
+    console.debug(TAG, `startAbility deviceId: ${deviceId}`)
+    let context = getContext(this) as common.UIAbilityContext
+     let choicePages:class1={}
+    // console.log("获取当前页面"+choicePages.choicePages?.toString())
+    let want: Want = {
+      bundleName: BUNDLE_NAME,
+      abilityName: 'EntryAbility',
+    //  abilityName: choicePages.choicePages===2?'':'firstAbility',
+      deviceId: deviceId,
+      parameters: {
+        isRemote: 'isRemote'
+      }
+    }
+    context.startAbility(want).then((data) => {
+      console.info(TAG, `start ability finished: ${JSON.stringify(data)}`)
+      this.startAbilityCallBack(DATA_CHANGE)
+    })
+  }
+
+  dataChange() {
+    console.info(TAG, `dataChange, message = ${this.message},`)
+    this.kvStoreModel.put(DATA_CHANGE1.toString(), this.click.toString())
+    this.kvStoreModel.put(DATA_CHANGE, this.message,)
+  }
+
+  showDeviceDialog() {
+    this.deviceList = []
+    // 注册监听回调,发现设备或查找到已认证设备会弹窗显示
+    this.remoteDeviceModel.registerDeviceListCallback(() => {
+      this.deviceList = []
+      let deviceTempList = this.remoteDeviceModel.discoverList.length > 0 ? this.remoteDeviceModel.discoverList : this.remoteDeviceModel.deviceList;
+      if (deviceTempList !== null) {
+        for (let i = 0; i < deviceTempList!.length; i++) {
+          console.debug(TAG, `device ${i}/${deviceTempList!.length} deviceId= ${deviceTempList![i].deviceId},
+        deviceName= ${deviceTempList![i].deviceName}, deviceType= ${deviceTempList![i].deviceType}`);
+          if (deviceTempList !== null) {
+            this.deviceList.push({
+              deviceId: deviceTempList![i].deviceId,
+              deviceName: deviceTempList![i].deviceName,
+              deviceType: deviceTempList![i].deviceType,
+              networkId: deviceTempList![i].networkId,
+            })
+            AppStorage.set('deviceList', this.deviceList)
+          }
+        }
+      }
+    })
+    if (this.dialogController === null) {
+      this.dialogController = new CustomDialogController({
+        builder: DeviceDialog({
+          selectedIndex: this.selectedIndex,
+          onSelectedIndexChange: this.onSelectedIndexChange
+        }),
+        cancel: () => {
+          this.clearSelectState()
+        },
+        autoCancel: true,
+        alignment: DialogAlignment.Center,
+        customStyle: false
+      })
+    }
+    if (this.dialogController !== null) {
+      this.dialogController.open()
+    }
+  }
+  build(){
+    Column(){
+    }.width('100%')
+    .backgroundColor('#ccfdfcfc')
+    .height('100%')
+    .justifyContent(FlexAlign.Center)
+    .padding({ left: 18, right: 32 })
+    .margin({ bottom: 15 })
+    .onAreaChange((oldArea: Area, newArea: Area) => {
+      this.deviceDialogWidth = (newArea.width > newArea.height ? newArea.height : newArea.width) as number * 0.1 //percentage
+    })
+    .onClick(()=>{
+      router.pushUrl({
+        url:'pages/Index'
+      })
+    })
+  }
+}

+ 834 - 0
entry/src/main/ets/pages/Index.ets

@@ -0,0 +1,834 @@
+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'
+import UniversalCardModel from '../model/database/UniversalCardModel';
+import JGRequest from '../common/util/request/Request';
+import DictInfo from '../model/DictInfo';
+
+import common from '@ohos.app.ability.common';
+import { KvStoreModel } from '../model/KvStoreModel';
+import deviceManager from '@ohos.distributedDeviceManager';
+import { RemoteDeviceModel, BUNDLE_NAME } from '../model/RemoteDeviceModel'
+import { DeviceDialog } from '../common/DeviceDialog';
+import Want from '@ohos.app.ability.Want';
+const TAG: string = 'testTag'
+const DATA_CHANGE: string = 'dataChange'
+const DATA_CHANGE1: number = 0
+const EXIT: string = 'exit'
+@CustomDialog
+struct confirmPopup {
+  cardType: number=0
+  private  cardServices?:UniversalCard[]
+  controller: CustomDialogController
+  @Link x: number
+  @Link  y: number
+  @Link cardSorting:number
+  build(){
+    Column(){
+      Column(){
+        Row(){
+          Image($r('app.media.card'))
+            .width(px2vp(50))
+            .height(px2vp(50))
+          Text('卡片服务')
+            .padding({left:10})
+            .margin(px2vp(5))
+            .width('100%')
+            .height('100%')
+            .fontWeight(FontWeight.Medium)
+            .fontSize(px2vp(38))
+            .textAlign(TextAlign.Start)
+
+
+        }.width('100%')
+        .height('80%')
+        .padding({left:10})
+        .borderRadius(px2vp(15))
+        .backgroundColor($r('app.color.general_font_white_color'))
+        .onClick(async ()=>{
+          // 第一种遍历, const后面的是变量,变量的值就是数组的元素
+          // for (const card of this.cardServices) {
+          //
+          //   card.cardStatus
+          // }
+          // 第二种遍历,index是数组索引
+          // 1.修改变量数组中,此卡片类型的对象(改为打开状态)
+          let temp: UniversalCard={}
+          let deleteIndex: number=0
+          if (!this.cardServices) {
+            console.log("TextTag1", this.cardServices)
+            return
+          }
+          console.log("TextTag2", this.cardServices)
+          for (let index=0; index < this.cardServices.length; index++) {
+            if (this.cardServices[index].cardType === this.cardType) {
+              this.cardServices[index].cardStatus  = 1
+              temp = this.cardServices[index]
+              deleteIndex = index
+              console.log("TextTag3",this.cardServices)
+              break
+            }
+          }
+          //2.删除变量数组中
+          // if (deleteIndex<=0) {
+          //   return
+          // }
+          this.cardServices.splice(deleteIndex, 1)
+          // 3.修改排序号
+          let sort: number = 0
+          if (this.cardServices===undefined) {
+            return
+          }
+          for (let index=0; index < this.cardServices.length; index++) {
+            this.cardServices[index].cardSort = sort
+            // 4.更新数据库数据
+            await UniversalCardModel.updateUniversalCard(this.cardServices[index])
+            sort++
+          }
+          // 5.变量数组添加元素
+          temp.cardSort = this.cardServices.length
+          console.log("TextTag",temp)
+          this.cardServices.push(temp)
+
+          // 6.修改数据入库
+          await UniversalCardModel.updateUniversalCard(temp)
+          this.controller.close()
+        })
+        Divider()
+          .width('80%')
+
+      }
+      .margin({bottom:5})
+      .borderRadius(px2vp(15))
+      .height('20%')
+      .width('120%')
+      .backgroundColor($r('app.color.general_font_white_color'))
+      Image(this.cardSorting===1?$r("app.media.processImages")
+        :this.cardSorting===2?$r('app.media.jg_circular_icon'):$r('app.media.storage'))
+        .width(this.cardSorting===2?px2vp(120):px2vp(280))
+        .height(this.cardSorting===2?px2vp(120):px2vp(280))
+        .borderRadius(15)
+    }
+    .alignItems(HorizontalAlign.Start)
+    .width('350px')
+    .height('600px')
+    .offset(this.cardSorting===2?{x:this.x+50+'px', y:this.y-270+'px'}:{x:this.x+5+'px', y:this.y-410+'px'})
+  }
+}
+@Entry
+@Component
+struct Index {
+
+  private cardType:number=0
+  @State cardSorting:number=0
+  @State x:number=0
+  @State y:number=0
+  @State cardServices: UniversalCard[]=[{}]
+  @State  SmartFactoryCardDelete:number=0
+  @State SmartFactoryDelete:number=0
+  @State  SmartFactoryCarLongPressDelete:number=0
+  @State storageCardDelete:number=0
+  @State smartWarehouseCard:number=0
+  @State avatarFrame:boolean=false
+  @State deleteConfirmation:number=0
+  @State longPressDelete:number=0
+  scroller: Scroller = new Scroller()
+  @State shutdownTransparency:number=0
+  @State YanSe: number = 0
+  @State carswitch:number=0
+  private isHomePage: boolean = true
+  @State textValue: string = ''
+  @State inputValue: string = ''
+  confirmPopupDialogController: CustomDialogController = new CustomDialogController({
+    builder: confirmPopup({
+      cardType:this.cardType,
+      x:this.x,
+      y:this.y,
+      cardSorting:this.cardSorting,
+      cardServices:this.cardServices
+    }
+      ),
+    alignment: DialogAlignment.TopStart,
+    autoCancel:true,
+    customStyle:true,
+  })
+  async aboutToAppear(){
+    // 查询数据字典放到CommonConstants的DICT_DATA变量中
+    let res: DictInfo[] = await JGRequest.post('/api/v1/sys/dictData/all',)
+    if (res && res.length > 0) {
+      for (const dict of res) {
+        CommonConstants.DICT_DATA.set(dict.dictCode, dict.list)
+      }
+    }
+
+    // 1.根据当前用户id查询他配置的万能卡片
+    let res1 :UniversalCard[] | undefined = await UniversalCardModel.getListByUserId(CommonConstants.USER_ID as number)
+    if (res1 && res.length > 0) {
+      this.cardServices = res1
+    }
+
+    if (!this.cardServices || this.cardServices.length <= 0) {
+      // 2.1用户第一次登录,所有的万能卡片都展示
+      for (let index = 0; index < CommonConstants.CARD_TYPE_DATA.length; index++) {
+        const card:UniversalCard = {
+          userId:CommonConstants.USER_ID,
+          cardType: CommonConstants.CARD_TYPE_DATA[index],
+          cardStatus:1,
+          cardSort: index
+        };
+        // 3.1用户的万能卡片入库,(以后再次打开页面能够查询到)
+        console.log("TextTag", card)
+        card.id = await UniversalCardModel.addUniversalCard(card)
+        // 3.2保存到数组变量,用于展示(避免再次查询,多于的开销)
+        console.log("TextTag", card)
+        this.cardServices?.push(card)
+      }
+
+    }
+    // 2.2查询到有万能卡片数据,就直接展示,不做任何操作
+    let context = getContext(this) as common.UIAbilityContext
+    this.kvStoreModel.setOnMessageReceivedListener(context, DATA_CHANGE, (value: string) => {
+      console.debug(TAG, `DATA_CHANGE: ${value},this.isDistributed = ${this.isDistributed}`)
+      let isRemote: string | undefined = AppStorage.get('isRemote')
+      if (isRemote === 'isRemote' ? true : false) {
+      }
+      if (value === 'null') {
+        this.message = ''
+      } else {
+        this.message = value
+      }
+
+    })
+  }
+  @State @Watch('dataChange')  click: number = 0;
+  @State  click1: number = 0;
+  @State @Watch('dataChange')  message: string = 'Hello World';
+  @State inputMsg: string = '';
+  @State isDistributed: boolean = false
+  @StorageLink('deviceList') deviceList: Array<deviceManager.DeviceBasicInfo> = []
+  @State selectedIndex: number | undefined = -1
+
+  private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel()
+  private kvStoreModel: KvStoreModel = new KvStoreModel()
+  private dialogController: CustomDialogController | null = null
+
+  onSelectedIndexChange = async (index: number | undefined) => {
+    console.info(TAG, `selectedIndexChange`)
+    this.selectedIndex = index
+    this.selectDevice()
+  }
+
+  aboutToDisappear() {
+    console.info(TAG, `index disappear`)
+    this.kvStoreModel.deleteKvStore()
+  }
+
+  startAbilityCallBack = (key: string) => {
+    console.info(TAG, `startAbilityCallBack ${key}`)
+    if (DATA_CHANGE === key) {
+      this.kvStoreModel.put(DATA_CHANGE, this.message)
+    }
+    if (EXIT === key) {
+      this.kvStoreModel.put(DATA_CHANGE, EXIT)
+    }
+  }
+
+  selectDevice() {
+    console.info(TAG, `start ability ......`)
+    this.isDistributed = true
+    if (this.selectedIndex !== undefined && (this.remoteDeviceModel === null || this.remoteDeviceModel.discoverList.length <= 0)) {
+      console.info(TAG, `continue unauthed device: ${JSON.stringify(this.deviceList)}`)
+      this.startAbility(this.deviceList[this.selectedIndex].networkId as string)
+      this.clearSelectState()
+      return
+    }
+    console.info(TAG, `start ability1, needAuth:`)
+    if (this.selectedIndex !== undefined) {
+      console.log(TAG, '------------' + JSON.stringify(this.deviceList[this.selectedIndex]));
+      this.remoteDeviceModel.authenticateDevice(this.deviceList[this.selectedIndex], () => {
+        console.info(TAG, `auth and online finished`);
+        if (this.remoteDeviceModel !== null && this.remoteDeviceModel.deviceList !== null && this.selectedIndex !== undefined) {
+          for (let i = 0; i < this.remoteDeviceModel.deviceList!.length; i++) {
+            if (this.remoteDeviceModel.deviceList![i].deviceName === this.deviceList[this.selectedIndex].deviceName) {
+              this.startAbility(this.remoteDeviceModel.deviceList![i].networkId);
+            }
+          }
+        }
+      })
+    }
+    console.info(TAG, `start ability2 ......`)
+    this.clearSelectState()
+  }
+
+  clearSelectState() {
+    this.deviceList = []
+    if (this.dialogController !== null) {
+      this.dialogController.close()
+    }
+    console.info(TAG, `cancelDialog`)
+    if (this.remoteDeviceModel === undefined) {
+      return
+    }
+    this.remoteDeviceModel.unregisterDeviceListCallback()
+  }
+
+  async startAbility(deviceId: string | undefined) {
+    console.debug(TAG, `startAbility deviceId: ${deviceId}`)
+    let context = getContext(this) as common.UIAbilityContext
+
+      let want: Want = {
+        bundleName: BUNDLE_NAME,
+        //abilityName: 'MainAbility',
+        abilityName: 'EntryAbility',
+        deviceId: deviceId,
+        parameters: {
+          isRemote: 'isRemote'
+        }
+      }
+
+
+    context.startAbility(want).then((data) => {
+      console.info(TAG, `start ability finished: ${JSON.stringify(data)}`)
+      this.startAbilityCallBack(DATA_CHANGE)
+    })
+  }
+
+  dataChange() {
+    console.info(TAG, `dataChange, message = ${this.message},`)
+    this.kvStoreModel.put(DATA_CHANGE1.toString(), this.click.toString())
+    this.kvStoreModel.put(DATA_CHANGE, this.message,)
+  }
+
+  showDeviceDialog() {
+    this.deviceList = []
+    // 注册监听回调,发现设备或查找到已认证设备会弹窗显示
+    this.remoteDeviceModel.registerDeviceListCallback(() => {
+      this.deviceList = []
+      let deviceTempList = this.remoteDeviceModel.discoverList.length > 0 ? this.remoteDeviceModel.discoverList : this.remoteDeviceModel.deviceList;
+      if (deviceTempList !== null) {
+        for (let i = 0; i < deviceTempList!.length; i++) {
+          console.debug(TAG, `device ${i}/${deviceTempList!.length} deviceId= ${deviceTempList![i].deviceId},
+        deviceName= ${deviceTempList![i].deviceName}, deviceType= ${deviceTempList![i].deviceType}`);
+          if (deviceTempList !== null) {
+            this.deviceList.push({
+              deviceId: deviceTempList![i].deviceId,
+              deviceName: deviceTempList![i].deviceName,
+              deviceType: deviceTempList![i].deviceType,
+              networkId: deviceTempList![i].networkId,
+            })
+            AppStorage.set('deviceList', this.deviceList)
+          }
+        }
+      }
+    })
+    if (this.dialogController === null) {
+      this.dialogController = new CustomDialogController({
+        builder: DeviceDialog({
+          selectedIndex: this.selectedIndex,
+          onSelectedIndexChange: this.onSelectedIndexChange
+        }),
+        cancel: () => {
+          this.clearSelectState()
+        },
+        autoCancel: true,
+        alignment: DialogAlignment.Center,
+        customStyle: false
+      })
+    }
+    if (this.dialogController !== null) {
+      this.dialogController.open()
+    }
+  }
+  build() {
+    Stack(){
+      Row() {
+        Column() {
+          TitleStateComp({ isHomePage: this.isHomePage,})
+            .onClick(()=>{
+              this.avatarFrame=!this.avatarFrame
+            })
+          Row() {
+            Column() {
+              Grid(){
+                ForEach(this.cardServices, (item:UniversalCard,index:number)=>{
+                  if (item.cardStatus === 1) {
+                    GridItem(){
+                      if (item.cardType===3){
+                        Stack(){
+                          Column(){
+                            TaskComp({isHomePage: this.isHomePage})
+                            Text('生产操作')
+                              .fontSize(px2vp(27))
+                              .margin({top:5})
+                              .fontWeight(FontWeight.Medium)
+                              .fontColor($r('app.color.robot_set_card_white'))
+                          }
+                          .height('40%')
+                          .width('95%')
+                          .gesture(
+                            LongPressGesture({ repeat: false })
+                              .onActionEnd(() => {
+                                this.deleteConfirmation=1
+                              })
+                          )
+                          if (this.deleteConfirmation===1){
+                            Row(){
+                              Text('取消')
+                                .fontWeight(FontWeight.Medium)
+                                .fontSize(px2vp(27))
+                                .textAlign(TextAlign.Center)
+                                .width('20%')
+                                .height('20%')
+                                .margin(10)
+                                .borderRadius(px2vp(21))
+                                .fontColor($r('app.color.robot_set_card_blue'))
+                                .backgroundColor($r('app.color.general_font_white_color'))
+                                .onClick(()=>{
+                                  this.deleteConfirmation=0
+                                })
+                              Text('删除')
+                                .fontWeight(FontWeight.Medium)
+                                .fontSize(px2vp(27))
+                                .width('20%')
+                                .margin(10)
+                                .fontColor($r('app.color.general_font_white_color'))
+                                .borderRadius(px2vp(21))
+                                .height('20%')
+                                .textAlign(TextAlign.Center)
+                                .backgroundColor(  $r('app.color.robot_set_card_blue'))
+                                .onClick(async()=>{
+                                  this.deleteConfirmation = 0
+                                  // 删除卡片
+                                  await this.deleteCard(index);
+                                })
+                            }
+                            .justifyContent(FlexAlign.Center)
+                            .height('40%')
+                            .width('95%')
+                          }
+                        }
+                      } else if (item.cardType===1){
+                        Stack(){
+                          Column(){
+                            Warehousing()
+                            Text('智能仓储')
+                              .margin({top:5})
+                              .fontSize(px2vp(27))
+                              .fontWeight(FontWeight.Medium)
+                              .fontColor($r('app.color.robot_set_card_white'))
+                          }
+                          .height('40%')
+                          .width('95%')
+                          .onClick(()=>{
+                            router.pushUrl({
+                              url:'pages/Storage'
+                            })
+                          })
+                          .gesture(
+                            LongPressGesture({ repeat: false })
+                              .onActionEnd(() => {
+                                this.smartWarehouseCard=1
+                              })
+                          )
+                          if (this.smartWarehouseCard===1){
+                            Row(){
+                              Text('取消')
+                                .fontWeight(FontWeight.Medium)
+                                .fontSize(px2vp(27))
+                                .textAlign(TextAlign.Center)
+                                .width('20%')
+                                .height('20%')
+                                .margin(10)
+                                .borderRadius(px2vp(21))
+                                .fontColor($r('app.color.robot_set_card_blue'))
+                                .backgroundColor($r('app.color.general_font_white_color'))
+                                .onClick(()=>{
+                                  this.smartWarehouseCard=0
+                                })
+                              Text('删除')
+                                .fontWeight(FontWeight.Medium)
+                                .fontSize(px2vp(27))
+                                .width('20%')
+                                .margin(10)
+                                .fontColor($r('app.color.general_font_white_color'))
+                                .borderRadius(px2vp(21))
+                                .height('20%')
+                                .textAlign(TextAlign.Center)
+                                .backgroundColor(  $r('app.color.robot_set_card_blue'))
+                                .onClick(async ()=>{
+                                  this.smartWarehouseCard=0
+                                  // 删除卡片
+                                  await this.deleteCard(index);
+                                })
+                            }
+                            .justifyContent(FlexAlign.Center)
+                            .height('40%')
+                            .width('95%')
+                          }
+                        }
+                      } else if (item.cardType===5){
+                        Stack(){
+                          Column(){
+                            SmartFactoryCard()
+                            Text('智汇工厂')
+                              .margin({top:5})
+                              .fontSize(px2vp(27))
+                              .fontWeight(FontWeight.Medium)
+                              .fontColor($r('app.color.robot_set_card_white'))
+                          }
+                          .height('40%')
+                          .width('95%')
+                          .onClick(()=>{
+                            router.pushUrl({
+                              url:'pages/SmartFactory'
+                            })
+                          })
+                          .gesture(
+                            LongPressGesture({ repeat: false })
+                              .onActionEnd(() => {
+                                this.SmartFactoryCarLongPressDelete=1
+                              })
+                          )
+                          if (this.SmartFactoryCarLongPressDelete===1){
+                            Row(){
+                              Text('取消')
+                                .fontWeight(FontWeight.Medium)
+                                .fontSize(px2vp(27))
+                                .textAlign(TextAlign.Center)
+                                .width('20%')
+                                .height('20%')
+                                .margin(10)
+                                .borderRadius(px2vp(21))
+                                .fontColor($r('app.color.robot_set_card_blue'))
+                                .backgroundColor($r('app.color.general_font_white_color'))
+                                .onClick(()=>{
+                                  this.SmartFactoryCarLongPressDelete=0
+                                })
+                              Text('删除')
+                                .fontWeight(FontWeight.Medium)
+                                .fontSize(px2vp(27))
+                                .width('20%')
+                                .margin(10)
+                                .fontColor($r('app.color.general_font_white_color'))
+                                .borderRadius(px2vp(21))
+                                .height('20%')
+                                .textAlign(TextAlign.Center)
+                                .backgroundColor(  $r('app.color.robot_set_card_blue'))
+                                .onClick(async ()=>{
+                                  this.SmartFactoryCarLongPressDelete=0
+                                  // 删除卡片
+                                  await this.deleteCard(index);
+                                })
+                            }
+                            .justifyContent(FlexAlign.Center)
+                            .height('40%')
+                            .width('95%')
+                          }
+                        }
+                      }
+                    }
+                  }
+                })
+              }
+              .columnsTemplate('1fr 1fr 1fr ')
+              .columnsGap(10)
+              .rowsGap(10)
+              .onScrollIndex((first: number) => {
+                console.info(first.toString())
+              })
+            }
+            .width('100%')
+            .height('100%')
+          }
+          .justifyContent(FlexAlign.Center)
+          .width('100%')
+          .height('68%')
+          Row({ space: 10 }) {
+            Text().width('1%')
+            Column({ space: 10 }) {
+              Image($r("app.media.shezhi"))
+                .width('60%')
+                .height('60%')
+                .margin({top:5})
+              Text('设置')
+                .width('100%')
+                .textAlign(TextAlign.Center)
+                .fontSize(16)
+                .fontColor('#ffff')
+            }
+            .width('10%')
+            .justifyContent(FlexAlign.Center)
+            .backdropBlur(13)
+            .height('90%')
+            .borderRadius(15)
+            .backgroundColor('#4d000000')
+            .onClick(() => {
+              router.pushUrl({
+                url: 'pages/SetPage'
+              })
+            })
+            Column({ space: 10 }) {
+              Image($r("app.media.storage"))
+                .width('60%')
+                .height('60%')
+                .margin({top:5})
+              Text('智能仓储')
+                .width('100%')
+                .textAlign(TextAlign.Center)
+                .fontSize(16)
+                .fontColor('#ffff')
+            }
+            .width('10%')
+            .justifyContent(FlexAlign.Center)
+            .height('90%')
+            .borderRadius(15)
+            .backgroundColor('#4d000000')
+            .id('smartWarehousing')
+            .onClick(() => {
+              router.pushUrl({
+                url: 'pages/Warehousing'
+               // url: 'pages/Storage'
+              })
+            })
+            .gesture(
+              LongPressGesture({ repeat: false })
+                .onActionEnd(() => {
+                  let rect = componentLocation.getComponentRect('smartWarehousing')
+                  let touchPoint: TouchObject = {
+                    displayX:0,
+                    displayY:0,
+                    windowX:0,
+                    windowY:0,
+                    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.cardSorting=1
+                  this.cardType=1
+                  this.confirmPopupDialogController.open()
+
+                })
+            )
+            Column({ space: 10 }) {
+              Image($r('app.media.jiqiren'))
+                .width('60%')
+                .height('60%')
+                .margin({top:5})
+              Text('机器人调试')
+                .width('100%')
+                .textAlign(TextAlign.Center)
+                .fontSize(16)
+                .fontColor('#ffff')
+            }
+            .width('10%')
+            .justifyContent(FlexAlign.Center)
+            .height('90%')
+            .borderRadius(15)
+            .backgroundColor('#4d000000')
+            .onClick(() => {
+              router.pushUrl({
+                url: 'pages/RobotDebug'
+              })
+            })
+
+            Column({ space: 10 }) {
+              Image($r("app.media.processImages"))
+                .width('60%')
+                .height('60%')
+                .margin({top:5})
+              Text('工序操作')
+                .width('100%')
+                .textAlign(TextAlign.Center)
+                .fontSize(16)
+                .fontColor('#ffff')
+
+            }
+            .width('10%')
+            .justifyContent(FlexAlign.Center)
+            .height('90%')
+            .borderRadius(15)
+            .id('workingProcedure')
+            .backgroundColor('#4d000000')
+            .onClick(() => {
+              router.pushUrl({
+                url: 'pages/process/ProcessHome'
+              })
+            })
+            .gesture(
+              LongPressGesture({ repeat: false })
+                .onActionEnd(() => {
+                  let rect = componentLocation.getComponentRect('workingProcedure')
+                  let touchPoint: TouchObject = {
+                    displayX:0,
+                    displayY:0,
+                    windowX:0,
+                    windowY:0,
+                    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.cardSorting=0
+                  this.cardType=3
+                  this.confirmPopupDialogController.open()
+                })
+            )
+
+            Column({ space: 10 }) {
+              Image($r('app.media.baobiao'))
+                .width('60%')
+                .height('60%')
+                .margin({top:5})
+              Text('统计报表')
+                .width('100%')
+                .textAlign(TextAlign.Center)
+                .fontSize(16)
+                .fontColor('#ffff')
+
+            }
+            // .onClick(()=>{
+            //     this.showDeviceDialog()
+            // })
+            .width('10%')
+            .justifyContent(FlexAlign.Center)
+            .height('90%')
+            .borderRadius(15)
+            .backgroundColor('#4d000000')
+          //   Column({ space: 10 }) {
+          //     Image($r('app.media.baobiao'))
+          //       .width('60%')
+          //       .height('60%')
+          //       .margin({top:5})
+          //     Text('维修站')
+          //       .width('100%')
+          //       .textAlign(TextAlign.Center)
+          //       .fontSize(16)
+          //       .fontColor('#ffff')
+          //
+          //   }
+          //   .width('10%')
+          //   .justifyContent(FlexAlign.Center)
+          //   .height('90%')
+          //   .borderRadius(15)
+          //   .backgroundColor('#4d000000')
+          //   .onClick(()=>{
+          //     router.pushUrl({
+          //       url:'pages/MaintenanceStation'
+          //     })
+          //   })
+           }
+          .width('100%')
+          .height('16%')
+          Stack(){
+            BottomOperateComp({ isHomePage: this.isHomePage})
+            Row(){
+              Text().width('100%')
+                .height('100%')
+                .id('Warehousing')
+                .onClick(()=>{
+                  router.pushUrl({
+                    url:'pages/SmartFactory',
+                  })
+                })
+                .gesture(
+                  LongPressGesture({ repeat: false })
+                    .onActionEnd(() => {
+                      let rect = componentLocation.getComponentRect('Warehousing')
+                      let touchPoint: TouchObject = {
+                        displayX:0,
+                        displayY:0,
+                        windowX:0,
+                        windowY:0,
+                        id: 2,
+                        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.cardSorting=2
+                      this.cardType=5
+                      this.confirmPopupDialogController.open()
+                    })
+                )
+
+            }
+            .width('6%')
+            .height('8%')
+            .justifyContent(FlexAlign.Center)
+          }
+        }
+        .backgroundImage($r('app.media.BG'))
+        .backgroundImageSize({ width: '100%', height: '100%' })
+        .width('100%')
+        .height('100%')
+      }
+      .height('100%')
+      .width('100%')
+    }
+    .alignContent(Alignment.TopEnd)
+    .height('100%')
+    .width('100%')
+
+  }
+
+  // 删除卡片
+  private async deleteCard(index: number) {
+    // 1.修改变量中cardStatus为2,关闭状态
+    if (this.cardServices===undefined) {
+    return
+    }
+      this.cardServices[index]  = {
+        id: this.cardServices[index].id,
+        userId: this.cardServices[index].userId,
+        cardType: this.cardServices[index].cardType,
+        cardStatus: 2,
+        cardSort: this.cardServices[index].cardSort,
+      };
+    // 2.更新数据库,当前删除的卡片状态
+    await UniversalCardModel.updateUniversalCard(this.cardServices[index]);
+    // 3.其他数据的修改排序
+    let sort: number = 0;
+    for (let a = 0; a < this.cardServices?.length; a++) {
+      if (this.cardServices[a].cardStatus === 1) {
+        this.cardServices[a].cardSort = sort;
+        // 4.更新数据库
+        await UniversalCardModel.updateUniversalCard(this.cardServices[a]);
+        sort++;
+      }
+    }
+  }
+
+  // 动画效果
+  pageTransition() {
+    // 设置1ms是为了使延时生效
+    PageTransitionEnter({ duration: 1, curve: Curve.Linear, delay: 400 })
+      .scale({
+        x: 0,
+        y: 0,
+        z: 0,
+        centerX: '50%',
+        centerY: '50%'
+      })
+    PageTransitionExit({ duration: 0, curve: Curve.Linear })
+  }
+}
+
+

+ 746 - 0
entry/src/main/ets/pages/LoginPage.ets

@@ -0,0 +1,746 @@
+import router from '@ohos.router'
+import CommonConstants from '../common/constants/CommonConstants'
+import JGRequest from '../common/util/request/Request'
+import {getToken, getUserInfo} from '../common/util/request/RequestInstance'
+import AssistantSetModel from '../model/database/AssistantSetModel'
+import UserAuthModel from '../model/database/UserAuthModel';
+import UserInfo from '../model/UserInfo'
+import process from '@ohos.process'
+import RequestParamModel from '../viewmodel/RequestParamModel'
+import StorageRequest from '../common/util/request/StorageRequest'
+import EquipmentRequest from '../common/util/request/EquipmentRequest'
+export const stationDictValue:string=''
+@Entry
+@Component
+struct LoginPage {
+  controller: TextInputController = new TextInputController()
+  //1是拣选,2是装配,3是测试,4是维修站,5是入库,6是出库
+  @State stationDictValue:string= ''
+  @State loginName: string = 'JGtest-32'
+  @State password: string = 'admin@123'
+
+  @State dept: DeptInfo = {deptName:'仿真中心'}
+  @State workstation: WorkstationInfo = {}
+  @State productionLine: ProductionLine = {name:'仿真中心电装产线'}
+
+  @State deptArray: DeptInfo[] = []
+  @State lineArray: ProductionLine[] = []
+  @State workstationArray: WorkstationInfo[] = [{name:'入库工位',stationDictValue:"5"},
+    {name:'预齐套工位',stationDictValue:"6"},
+{name:'装配工位',stationDictValue:"3"}]
+
+  // 部门选择弹框
+  selectDeptController: CustomDialogController = new CustomDialogController({
+    builder: SelectDeptDialog({
+      dept: this.dept,
+      deptArray: this.deptArray
+    }),
+    autoCancel: true,
+    alignment: DialogAlignment.Center,
+    // gridCount: 3,
+    customStyle: true,
+  })
+
+  // 产线选择弹框
+  selectProductionLineController: CustomDialogController = new CustomDialogController({
+    builder: ProductionLineDialog({
+      productionLine: this.productionLine,
+      workstationArray: this.workstationArray,
+      workstation: this.workstation,
+      lineArray: this.lineArray,
+    }),
+    autoCancel: true,
+    alignment: DialogAlignment.Center,
+    // gridCount: 3,
+    customStyle: true,
+  })
+
+  // 工位选择弹框
+  selectWorkstationController: CustomDialogController = new CustomDialogController({
+    builder: SelectWorkstationDialog({
+      stationDictValue:this.stationDictValue,
+      workstation: this.workstation,
+      workstationArray: this.workstationArray,
+      lineCode: this.productionLine.code,
+    }),
+    autoCancel: true,
+    alignment: DialogAlignment.Center,
+    // gridCount: 3,
+    customStyle: true,
+  })
+
+  async aboutToAppear() {
+    this.controller.stopEditing()
+    let userInfo = await UserAuthModel.getLast()
+    //登录时,查询部门、
+    //todo
+    this.deptArray = await JGRequest.get("/api/v1/sys/dept/orgList", {}) as DeptInfo[]
+    if (this.deptArray && this.deptArray.length > 0) {
+      this.dept = this.deptArray[0]
+    }
+    //查询产线
+    this.lineArray = await JGRequest.post("/api/v1/base/productionLine/list/list", {} as RequestParamModel) as ProductionLine[]
+    if (this.lineArray && this.lineArray.length > 0) {
+      this.productionLine = this.lineArray[0]
+      // 根据产线查询工位
+      this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code, {}) as WorkstationInfo[]
+      if (this.workstationArray && this.workstationArray.length > 0) {
+        this.workstation = this.workstationArray[0]
+        CommonConstants.stationDictValue=this.workstationArray[0].stationDictValue!
+      }
+    }
+
+    if (CommonConstants.LOGIN_OUT) {
+      if (userInfo) {
+        this.loginName = userInfo.userName ? userInfo.userName : ''
+        this.password = userInfo.password ? userInfo.password : ''
+      }
+      return
+    }
+
+    if (userInfo && userInfo.maintainLoginStatus === 1) {
+      CommonConstants.STATION_NANE = userInfo.stationName!
+      CommonConstants.STATION_ID = userInfo.stationId!
+      await getToken(userInfo.userName as string, userInfo.password as string, userInfo.orgId as number, userInfo?.stationId!.toString()).then(token=>{
+        if (token && token.length > 0) {
+          CommonConstants.AUTH_TOKEN = token
+        }
+      })
+      let user = await getUserInfo() as UserInfo
+      if (null != user) {
+        CommonConstants.USER_ID= user.id!
+        CommonConstants.USER_NAME = user.userName!
+        CommonConstants.USER_AVATAR = user.avatar!
+        CommonConstants.USER_AVATAR = user.avatar!
+        CommonConstants.LOGIN_OUT = false
+      }
+      if (CommonConstants.AUTH_TOKEN && CommonConstants.AUTH_TOKEN.length > 0) {
+        if ( CommonConstants.stationDictValue === '5') {
+          router.pushUrl({
+           url:'pages/Warehousing',
+            params: {
+              userName:CommonConstants.USER_NAME as UserInfo,
+              avatar:CommonConstants.USER_AVATAR as UserInfo,
+              stationId:CommonConstants.STATION_NANE as WorkstationInfo
+            }
+          })
+        } else if ( CommonConstants.stationDictValue=== '6'){
+          router.pushUrl({
+            url:'pages/OutboundStation',
+            params: {
+              userName:CommonConstants.USER_NAME as UserInfo,
+              avatar:CommonConstants.USER_AVATAR as UserInfo,
+              stationId:CommonConstants.STATION_NANE as WorkstationInfo
+            }
+          })
+        } else {
+          router.pushUrl({
+            url:'pages/process/ProcessHome',
+          })
+        }
+      }
+    }
+  }
+
+  build() {
+    Column() {
+      Column() {
+        Row() {
+          Image($r('app.media.jing_zhiyuan_logo'))
+            .width(px2vp(610))
+            .height(px2vp(40))
+        }
+        .height('18.3%')
+        .width('88.5%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.Start)
+
+        TextInput({placeholder: '账号', text: this.loginName ,controller:this.controller})
+          .placeholderColor($r('app.color.login_text_input_placeholder_color'))
+          .placeholderFont({ size: $r('app.float.set_card_font_size'), weight: FontWeight.Medium})
+          .fontColor($r('app.color.login_text_input_font_color'))
+          .fontWeight(FontWeight.Medium)
+          .fontSize($r('app.float.fontSize_24'))
+          .width('90.4%')
+          .enableKeyboardOnFocus(false)
+          .height('10.6%')
+          .opacity($r('app.float.general_font_opacity'))
+          .borderRadius($r('app.float.general_border_radius'))
+          .backgroundColor('#BCC2C9')
+          .onChange((value: string) => {
+            this.loginName = value
+          })
+        Row() {}.height('4%')
+
+        TextInput({placeholder: '密码', text: this.password })
+          .placeholderColor($r('app.color.login_text_input_placeholder_color'))
+          .placeholderFont({ size: $r('app.float.set_card_font_size'), weight: FontWeight.Medium})
+          .fontColor($r('app.color.login_text_input_font_color'))
+          .width('90.4%')
+          .height('10.6%')
+          .enableKeyboardOnFocus(false)
+          .fontWeight(FontWeight.Medium)
+          .fontSize($r('app.float.fontSize_24'))
+          .type(InputType.Password)
+          .borderRadius($r('app.float.general_border_radius'))
+          .backgroundColor('#BCC2C9')
+          .onChange((value: string) => {
+            this.password = value
+          })
+
+        Row() {}.height('2.65%')
+
+        // 部门、产线选择
+        Row() {
+          Row() {
+            Text('部门')
+              .fontColor($r('app.color.general_font_white_color'))
+              .fontSize($r('app.float.fontSize_20'))
+          }
+          .width('47.8%')
+          .height('100%')
+          .alignItems(VerticalAlign.Top)
+          Blank()
+          Row() {
+            Text('产线')
+              .fontColor($r('app.color.general_font_white_color'))
+              .fontSize($r('app.float.fontSize_20'))
+          }
+          .alignItems(VerticalAlign.Top)
+          .width('47.8%')
+          .height('100%')
+        }
+        .height('4.5%')
+        .width('90.4%')
+        // 部门选择
+        Row() {
+          Row() {
+            Text(this.dept ? this.dept.deptName : '')
+              .fontWeight(FontWeight.Medium)
+              .fontSize($r('app.float.fontSize_24'))
+              .fontColor($r('app.color.general_font_color'))
+              .opacity($r('app.float.general_font_opacity'))
+            Blank()
+            Row() {
+              Image($r('app.media.subscript_space'))
+                .height($r('app.float.card_subscript_new_size'))
+                .width($r('app.float.card_subscript_new_size'))
+            }
+            .alignItems(VerticalAlign.Bottom)
+            .justifyContent(FlexAlign.End)
+            .width('20%')
+            .height('100%')
+          }
+          .width('47.8%')
+          .height('100%')
+          .padding({left: 10})
+          .backgroundColor($r('app.color.general_card_background_color'))
+          .borderRadius($r('app.float.general_border_radius'))
+          .onClick(async ()=>{
+            this.deptArray = await JGRequest.get("/api/v1/sys/dept/orgList", {}) as DeptInfo[]
+            if (this.deptArray && this.deptArray.length > 0) {
+              this.dept = this.deptArray[0]
+            }
+            // 查询工位
+            this.workstationArray = await JGRequest.get("/api/v1/base/station/queryStationList", {}) as WorkstationInfo[]
+            if (this.workstationArray && this.workstationArray.length > 0) {
+              this.workstation = this.workstationArray[0]
+              CommonConstants.stationDictValue=this.workstationArray[0].stationDictValue!
+
+            }
+            this.selectDeptController.open()
+          })
+
+          Blank()
+
+          // 产线选择
+          Row() {
+            Text(this.productionLine ? this.productionLine.name : '')
+              .fontWeight(FontWeight.Medium)
+              .fontSize($r('app.float.fontSize_24'))
+              .fontColor($r('app.color.general_font_color'))
+              .opacity($r('app.float.general_font_opacity'))
+            Blank()
+            Row() {
+              Image($r('app.media.subscript_space'))
+                .height($r('app.float.card_subscript_new_size'))
+                .width($r('app.float.card_subscript_new_size'))
+            }
+            .alignItems(VerticalAlign.Bottom)
+            .justifyContent(FlexAlign.End)
+            .width('20%')
+            .height('100%')
+          }
+          .width('47.8%')
+          .height('100%')
+          .padding({left: 10})
+          .backgroundColor($r('app.color.general_card_background_color'))
+          .borderRadius($r('app.float.general_border_radius'))
+          .onClick(async ()=>{
+            this.deptArray = await JGRequest.get("/api/v1/sys/dept/orgList", {}) as DeptInfo[]
+            if (this.deptArray && this.deptArray.length > 0) {
+              this.dept = this.deptArray[0]
+            }
+            // 查询工位
+            this.workstationArray = await JGRequest.get("/api/v1/base/station/queryStationList", {}) as WorkstationInfo[]
+            if (this.workstationArray && this.workstationArray.length > 0) {
+              this.workstation = this.workstationArray[0]
+              CommonConstants.stationDictValue=this.workstationArray[0].stationDictValue!
+
+            }
+            this.selectProductionLineController.open()
+          })
+        }
+        .width('90.4%')
+        .height('10.6%')
+
+        Row() {}.height('2.65%')
+
+        if (JSON.stringify(this.productionLine) === '{}') {
+          Row() {}.height('15.1%')
+        } else {
+          // 工位选择
+          Row() {
+            Text('工位选择')
+              .fontColor($r('app.color.general_font_white_color'))
+              .fontSize($r('app.float.fontSize_20'))
+          }
+          .height('4.5%')
+          .width('90.4%')
+          .justifyContent(FlexAlign.Start)
+          .alignItems(VerticalAlign.Top)
+
+          Row() {
+            Text(!this.workstationArray || this.workstationArray.length <= 0 ? '无数据' : (this.workstation ? this.workstation.name : ''))
+              .fontWeight(FontWeight.Medium)
+              .fontSize($r('app.float.fontSize_24'))
+              .fontColor($r('app.color.general_font_color'))
+              .opacity(!this.workstationArray || this.workstationArray.length <= 0 ? $r('app.float.zero_point_two_font_opacity') : $r('app.float.general_font_opacity'))
+            Blank()
+            Row() {
+              Image($r('app.media.subscript_space'))
+                .height($r('app.float.card_subscript_new_size'))
+                .width($r('app.float.card_subscript_new_size'))
+            }
+            .alignItems(VerticalAlign.Bottom)
+            .justifyContent(FlexAlign.End)
+            .width('20%')
+            .height('100%')
+          }
+          .width('90.4%')
+          .height('10.6%')
+          .backgroundColor($r('app.color.general_card_background_color'))
+          .borderRadius($r('app.float.general_border_radius'))
+          .padding({left: 10})
+          .onClick(()=>{
+            if (!this.workstationArray || this.workstationArray.length <= 0 ) {
+              return
+            }
+            this.selectWorkstationController.open()
+          })
+        }
+
+        Column() {
+          Row().height('35%')
+          Text('登录')
+            .fontWeight(FontWeight.Medium)
+            .fontSize($r('app.float.fontSize_24'))
+            .fontColor($r('app.color.general_font_white_color'))
+            .textAlign(TextAlign.Center)
+            .width(px2vp(608))
+            .height(px2vp(80))
+            .backgroundColor($r('app.color.robot_set_card_blue'))
+            .borderRadius($r('app.float.robot_set_radius'))
+            .opacity(this.loginName && this.loginName.length > 0 && this.password && this.password.length > 0 && JSON.stringify(this.dept) != '{}' && JSON.stringify(this.workstation) != '{}' ? 1 : $r('app.float.card_font_default_opacity'))
+        }
+        .width('90.4%')
+        .layoutWeight(1)
+        .alignItems(HorizontalAlign.Center)
+        .justifyContent(FlexAlign.Start)
+        .onClick(async ()=>{
+          //todo
+         // 没有网的时候直接进去
+          router.pushUrl({
+            url:'pages/OutboundStation',
+            params: {
+              userName:CommonConstants.USER_NAME as UserInfo,
+              avatar:CommonConstants.USER_AVATAR as UserInfo,
+              stationId:CommonConstants.STATION_NANE as WorkstationInfo
+            }
+          })
+          console.log("tesTag1"+'+++++++++++++++'+this.workstation.stationDictValue)
+         if (this.loginName && this.loginName.length > 0 && this.password && this.password.length > 0) {
+            await getToken(this.loginName, this.password, this.dept?.id ? this.dept.id : 0, this.workstation?.id ? this.workstation.id : '0').then(token =>{
+              if (token && token.length > 0) {
+                CommonConstants.AUTH_TOKEN = token
+              }
+            })
+            if (CommonConstants.AUTH_TOKEN.length <= 0) {
+              return
+            }
+            let userInfo = await getUserInfo() as UserInfo
+            CommonConstants.USER_ID = userInfo.id!
+            CommonConstants.USER_NAME = userInfo.userName!
+            CommonConstants.USER_AVATAR = userInfo.avatar!
+            CommonConstants.STATION_NANE = this.workstation && this.workstation.name ? this.workstation.name : ''
+            CommonConstants.STATION_ID = this.workstation && this.workstation.id ? Number.parseInt(this.workstation.id) : 0
+            let user = await UserAuthModel.getByUserId(userInfo.id?userInfo.id:0)
+            if (!user || !user.id) {
+              // 将后端数据库id作为userId, 默认是保持登录
+              user = {userId: userInfo.id, userName: this.loginName, password: this.password, orgId: this.dept ? this.dept.id : 0,
+                stationId: this.workstation ? Number.parseInt(this.workstation.id!) : 0, stationName: this.workstation && this.workstation.name ? this.workstation.name : '',
+                stationDictValue: this.workstation?.stationDictValue ? this.workstation.stationDictValue! : '', avatar: userInfo.avatar, maintainLoginStatus: 1, updateTime: new Date().getTime()}
+              let res = await UserAuthModel.addUser(user)
+              res = await AssistantSetModel.addAssistantSet({userId: userInfo.id, voiceWakeUp: 1, timbre: 2, wakeFree: 2, promptBroadcast: 1, voiceVolume: 0})
+            }
+            CommonConstants.LOGIN_OUT = false
+
+            if (this.workstation.stationDictValue === '6') {
+              router.pushUrl({
+                url:'pages/OutboundStation',
+                params: {
+                  userName:CommonConstants.USER_NAME as UserInfo,
+                  avatar:CommonConstants.USER_AVATAR as UserInfo,
+                  stationId:CommonConstants.STATION_NANE as WorkstationInfo
+                }
+              })
+            } else if (this.workstation.stationDictValue === '5'){
+              router.pushUrl({
+                url:'pages/Warehousing',
+                params: {
+                  userName:CommonConstants.USER_NAME as UserInfo,
+                  avatar:CommonConstants.USER_AVATAR as UserInfo,
+                  stationId:CommonConstants.STATION_NANE as WorkstationInfo
+                }
+              })
+            } else {
+              router.pushUrl({
+                url:'pages/process/ProcessHome',
+              })
+            }
+        }
+        })
+      }
+      .width('35%')
+      .height('70%')
+      .backgroundColor($r('app.color.login_background_color'))
+      .borderRadius($r('app.float.general_border_radius'))
+      .margin({right: '8.25%'})
+
+      Row() {
+        Image($r('app.media.shutdown'))
+          .width($r('app.float.login_image_size'))
+          .height($r('app.float.login_image_size'))
+      }
+      .height('19%')
+      .width('100%')
+      .alignItems(VerticalAlign.Bottom)
+      .justifyContent(FlexAlign.End)
+      .margin({bottom: '1%', right: '1%'})
+      .onClick(()=>{
+        let pro = new process.ProcessManager();
+        pro.exit(0);
+      })
+    }
+    .width('100%')
+    .height('100%')
+    .backgroundImage($r('app.media.login_backgroundImage'))
+    .backgroundImageSize({width: '100%', height: '100%'})
+    .alignItems(HorizontalAlign.End)
+    .justifyContent(FlexAlign.End)
+
+  }
+}
+
+// 部门选择弹框
+@CustomDialog
+struct SelectDeptDialog {
+  @Link dept: DeptInfo
+
+  @State deptArray: DeptInfo[] = [{deptName:'仿真中心',id:111,orgId:112}]
+
+  controller?: CustomDialogController
+  cancel: () => void = () => {}
+  confirm: () => void = () => {}
+
+  async aboutToAppear() {
+    if (!this.deptArray || this.deptArray.length <= 0) {
+      this.deptArray = await JGRequest.get("/api/v1/sys/dept/orgList", {}) as DeptInfo[]
+      if (this.deptArray && this.deptArray.length > 0) {
+        this.dept = this.deptArray[0]
+      }
+    }
+  }
+
+  build() {
+    Column() {
+      Row() {
+        Text('选择部门')
+          .fontSize($r('app.float.fontSize_38'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.general_font_opacity'))
+      }
+      .height('20%')
+      .justifyContent(FlexAlign.Center)
+
+      Column() {
+        List({space: 10}) {
+          ForEach(this.deptArray, (item: DeptInfo)=>{
+            ListItem() {
+              Row() {
+                Text(item.deptName)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor(this.dept && this.dept.id === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
+                  .opacity($r('app.float.general_font_opacity'))
+              }
+              .height('15%')
+              .width('80%')
+              .backgroundColor(this.dept && this.dept.id === item.id ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
+              .borderRadius($r('app.float.general_border_radius'))
+              .padding({left: 10})
+              .onClick(()=>{
+                this.dept = item
+                if (this.controller != undefined) {
+                  this.controller.close()
+                }
+              })
+            }
+          })
+        }
+        .alignListItem(ListItemAlign.Center)
+      }
+      .height('70%')
+      .width('80%')
+      .justifyContent(FlexAlign.Start)
+    }
+    .width('48%')
+    .height('63%')
+    .backgroundColor($r('app.color.page_general_background'))
+    .justifyContent(FlexAlign.Start)
+    .borderRadius($r('app.float.general_border_radius'))
+  }
+}
+
+// 产线选择弹框
+@CustomDialog
+struct ProductionLineDialog {
+  @Link productionLine: ProductionLine
+
+  @State lineArray: ProductionLine[] = []
+
+  @Link workstation: WorkstationInfo
+  @Link workstationArray: WorkstationInfo[]
+  controller?: CustomDialogController
+  cancel: () => void = () => {}
+  confirm: () => void = () => {}
+
+  async aboutToAppear() {
+    if (this.lineArray && this.lineArray.length > 0) {
+      return
+    }
+    // 查询产线
+    this.lineArray = await JGRequest.post("/api/v1/base/productionLine/list/list", {} as RequestParamModel) as ProductionLine[]
+    if (this.lineArray && this.lineArray.length > 0) {
+      this.productionLine = this.lineArray[0]
+      // 根据产线查询工位
+      this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code, {}) as WorkstationInfo[]
+      console.log("====================1234567890"+"成功+++++"+this.workstationArray[0])
+      if (this.workstationArray && this.workstationArray.length > 0) {
+        this.workstation = this.workstationArray[0]
+        console.log("====================1234567890"+"成功"+this.workstation)
+      }
+    }
+  }
+
+  build() {
+    Column() {
+      Row() {
+        Text('选择产线')
+          .fontSize($r('app.float.fontSize_38'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.general_font_opacity'))
+      }
+      .height('20%')
+      .justifyContent(FlexAlign.Center)
+
+      Column() {
+        List({space: 10}) {
+          ForEach(this.lineArray, (item: ProductionLine)=>{
+            ListItem() {
+              Row() {
+                Text(item.name)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor(this.productionLine && this.productionLine.id === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
+                  .opacity($r('app.float.general_font_opacity'))
+              }
+              .height('15%')
+              .width('80%')
+              .backgroundColor(this.productionLine && this.productionLine.id === item.id ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
+              .borderRadius($r('app.float.general_border_radius'))
+              .padding({left: 10})
+              .onClick(async ()=>{
+                this.productionLine = item
+                // 根据产线查询工位
+                this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code, {}) as WorkstationInfo[]
+                if (this.workstationArray && this.workstationArray.length > 0) {
+                  this.workstation = this.workstationArray[0]
+                } else {
+                  this.workstation = {}
+                }
+                if (this.controller != undefined) {
+                  this.controller.close()
+                }
+              })
+            }
+          })
+        }
+        .alignListItem(ListItemAlign.Center)
+      }
+      .height('70%')
+      .width('80%')
+      .justifyContent(FlexAlign.Start)
+    }
+    .width('48%')
+    .height('63%')
+    .backgroundColor($r('app.color.page_general_background'))
+    .justifyContent(FlexAlign.Start)
+    .borderRadius($r('app.float.general_border_radius'))
+  }
+}
+
+// 工位选择弹框
+@CustomDialog
+struct SelectWorkstationDialog {
+  @Link stationDictValue:string
+  @Link workstation: WorkstationInfo
+  // 产线编码
+  private lineCode: string = ''
+  @Link workstationArray: WorkstationInfo[]
+
+  controller?: CustomDialogController
+  cancel: () => void = () => {}
+  confirm: () => void = () => {}
+
+  async aboutToAppear() {
+    if (this.workstationArray && this.workstationArray.length > 0) {
+      return
+    }
+    if (!this.lineCode || this.lineCode.length <= 0) {
+      return
+    }
+    // 根据产线查询工位
+    this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.lineCode, {}) as WorkstationInfo[]
+    if (this.workstationArray && this.workstationArray.length > 0) {
+      this.workstation = this.workstationArray[0]
+    }
+  }
+
+  build() {
+    Column() {
+      Row() {
+        Text('选择工位')
+          .fontSize($r('app.float.fontSize_38'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.general_font_opacity'))
+      }
+      .height('20%')
+      .justifyContent(FlexAlign.Center)
+
+      Column() {
+        List({space: 10}) {
+          ForEach(this.workstationArray, (item: WorkstationInfo,index:number)=>{
+            ListItem() {
+              Row() {
+                Text(item.name)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor(this.workstation && this.workstation.id === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
+                  .opacity($r('app.float.general_font_opacity'))
+              }
+              .height('15%')
+              .width('80%')
+              .backgroundColor(this.workstation && this.workstation.id === item.id ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
+              .borderRadius($r('app.float.general_border_radius'))
+              .padding({left: 10})
+              .onClick(()=>{
+                this.workstation = item
+                this.stationDictValue=item.stationDictValue!
+                CommonConstants.stationDictValue=this.workstationArray[index].stationDictValue!
+
+
+                if (this.controller != undefined) {
+                  this.controller.close()
+                }
+              })
+            }
+          })
+        }
+        .alignListItem(ListItemAlign.Center)
+      }
+      .height('70%')
+      .width('80%')
+      .justifyContent(FlexAlign.Start)
+    }
+    .width('48%')
+    .height('63%')
+    .backgroundColor($r('app.color.page_general_background'))
+    .justifyContent(FlexAlign.Start)
+    .borderRadius($r('app.float.general_border_radius'))
+  }
+}
+
+export class DeptInfo {
+  id?: number
+  // 部门名称
+  deptName?: string
+  // 组织id
+  orgId?: number
+}
+
+export class WorkstationInfo {
+  id?: string
+  // 工位名称
+  name?: string
+  //工位类型
+  stationDictValue?:string
+}
+
+class ProductionLine {
+  // 产线code
+  code?: string
+  // 创建时间
+  created?: string
+  // 创建人
+  creato?: string
+  // 是否删除
+  deleted?: number
+  // 部门ID
+  deptId?: string
+  // 主键
+  id?: string
+  // 数级结构层级
+  level?: string
+  // 产线管理者
+  manager?: string
+  // 产线名称
+  name?: string
+  // 组织ID
+  orgId?: string
+  // 所属车间code
+  parentCode?: string
+  // 产线位置
+  position?: string
+  // 产线描述
+  remark?: string
+  // 修改时间
+  updated?: string
+  // 上次修改人
+  updator?: string
+  // 所属车间
+  workShopName?: string
+}

+ 357 - 0
entry/src/main/ets/pages/MaintenanceStation.ets

@@ -0,0 +1,357 @@
+import { TitleStateComp } from '../common/component/TitleStateComp';
+import { BottomOperateComp } from '../common/component/BottomOperateComp';
+import router from '@ohos.router';
+
+export default class repairList {
+  deviceName?:string
+  unqualifiedQuantity?:number
+  repairedQuantity?:number
+  time?:string
+}
+@Entry
+@Component
+struct MaintenanceStation{
+
+  textcontroller: TextInputController = new TextInputController()
+  @State deviceName?:string=''
+  @State click:number=-1
+  private  repairList:Array<repairList>=[
+    {deviceName:"DS123422233卫星天线1",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
+  {deviceName:"DS123422233卫星天线2",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
+{deviceName:"DS123422233卫星天线3",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/5/1 15:11:11'},
+    {deviceName:"DS123422233卫星天线4",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
+    {deviceName:"DS123422233卫星天线5",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
+    {deviceName:"DS123422233卫星天线6",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/5/1 15:11:11'},
+  ]
+  private isHomePage:boolean = false
+  build(){
+    Column(){
+      TitleStateComp({isHomePage : this.isHomePage})
+      Row(){
+        Column(){
+          Text('待维修产品'+'['+this.repairList.length.toString()+']')
+            .fontSize(px2vp(51))
+            .fontColor('#e6000000')
+            .fontWeight(FontWeight.Medium)
+            .textAlign(TextAlign.Start)
+            .width('90%')
+            .height('8%')
+          List({ space: 10, initialIndex: 0 }) {
+            ForEach(this.repairList, (item:repairList,index:number) => {
+              ListItem() {
+                Column(){
+                  Text(item.deviceName)
+                    .fontWeight(FontWeight.Medium)
+                    .fontSize(px2vp(32))
+                    .fontColor('#e6000000')
+                    .width('100%')
+                    .height('40%')
+                  Row(){
+                    Text('不合格数')
+                      .fontWeight(FontWeight.Regular)
+                      .fontSize(px2vp(27))
+                      .fontColor('#99000000')
+                      .width('20%')
+                      .height('100%')
+                    Text(item.unqualifiedQuantity?.toString())
+                      .fontWeight(FontWeight.Medium)
+                      .fontSize(px2vp(27))
+                      .fontColor('#e6000000')
+                      .width('20%')
+                      .height('100%')
+                    Text('已维修数')
+                      .fontWeight(FontWeight.Regular)
+                      .fontSize(px2vp(27))
+                      .fontColor('#99000000')
+                      .width('20%')
+                      .height('100%')
+                    Text(item.repairedQuantity?.toString())
+                      .fontWeight(FontWeight.Medium)
+                      .fontSize(px2vp(27))
+                      .fontColor('#e6000000')
+                      .width('10%')
+                      .height('100%')
+                  }.width('100%')
+                  .height('30%')
+                  Row(){
+                    Text('审理时间:')
+                      .fontWeight(FontWeight.Regular)
+                      .fontSize(px2vp(27))
+                      .fontColor('#99000000')
+                      .width('30%')
+                      .height('100%')
+                    Text(item.time)
+                      .fontWeight(FontWeight.Medium)
+                      .fontSize(px2vp(27))
+                      .fontColor('#e6000000')
+                      .width('70%')
+                      .height('100%')
+                  }.width('100%')
+                  .height('30%')
+
+
+                }.width('100%')
+                .height('25%')
+                .borderRadius(15)
+                .padding({left:10})
+                .backgroundColor(this.click===index?$r('app.color.robot_set_card_blue'):$r('app.color.general_card_background_color'))
+                .onClick(()=>{
+                  this.click=index
+                  this.deviceName=item.deviceName
+                })
+              }
+            }
+              // , item => item
+            )
+          }
+          .width('90%')
+          .height('92%')
+
+        }.height('100%')
+        .width('30%')
+        Column(){
+          Text('故障详情')
+            .fontSize(px2vp(51))
+            .fontColor('#e6000000')
+            .fontWeight(FontWeight.Medium)
+            .textAlign(TextAlign.Start)
+            .width('90%')
+            .height('8%')
+          Text(this.deviceName)
+            .fontWeight(FontWeight.Medium)
+            .fontSize(px2vp(32))
+            .fontColor('#e6000000')
+            .width('100%')
+            .height('5%')
+        }.height('100%')
+        .width('30%')
+        Column(){
+          Row(){
+            Text('不合格品状况')
+              .fontSize(px2vp(51))
+              .fontColor('#e6000000')
+              .fontWeight(FontWeight.Medium)
+              .textAlign(TextAlign.Start)
+              .width('60%')
+              .height('100%')
+            Text('操作')
+              .fontSize(px2vp(51))
+              .fontColor('#e6000000')
+              .fontWeight(FontWeight.Medium)
+              .textAlign(TextAlign.Start)
+              .width('40%')
+              .height('100%')
+          }
+          .width('100%')
+          .height('8%')
+          Row(){
+            Row(){
+              Column(){
+                Column(){
+                  Row(){
+                    Image($r('app.media.pending_report'))
+                      .width(px2vp(37))
+                      .height(px2vp(37))
+                      .margin({left:10})
+                    Text('待处理报故')
+                      .fontWeight(FontWeight.Regular)
+                      .fontSize(px2vp(27))
+                      .fontColor('#99000000')
+                      .margin({left:5})
+
+                  }
+                  .height('30%')
+                  .width("100%")
+                  Text('100')
+                    .textAlign(TextAlign.Center)
+                    .height('70%')
+                    .width("100%")
+                    .fontSize(px2vp(80))
+                    .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
+                    .fontWeight(FontWeight.Bold)
+
+                }.width('90%')
+                .height('45%')
+                .borderRadius(px2vp(15))
+                .margin({ left:10,right:10,top:5,bottom:5 })
+                .backgroundColor($r('app.color.robot_set_card_white'))
+                Divider()
+                  .width('85%')
+                  .margin({left:20})
+                Column(){
+                  Row(){
+                    Image($r('app.media.repair_products'))
+                      .width(px2vp(37))
+                      .height(px2vp(37))
+                      .margin({left:10})
+                    Text('待维修产品')
+                      .fontWeight(FontWeight.Regular)
+                      .fontSize(px2vp(27))
+                      .fontColor('#99000000')
+                      .margin({left:5})
+
+                  }
+                  .height('30%')
+                  .width("100%")
+                  Text('100')
+                    .textAlign(TextAlign.Center)
+                    .height('70%')
+                    .width("100%")
+                    .fontSize(px2vp(80))
+                    .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
+                    .fontWeight(FontWeight.Bold)
+
+                }.width('90%')
+                .height('45%')
+                .borderRadius(px2vp(15))
+                .margin({ left:10,right:10,top:5,bottom:5 })
+              }
+              .width('50%')
+              .height('100%')
+              Divider()
+                .vertical(true)
+                .height('80%')
+              Column(){
+                Column(){
+                  Row(){
+                    Image($r('app.media.hear'))
+                      .width(px2vp(37))
+                      .height(px2vp(37))
+                      .margin({left:10})
+                    Text('审理中')
+                      .fontWeight(FontWeight.Regular)
+                      .fontSize(px2vp(27))
+                      .fontColor('#99000000')
+                      .margin({left:5})
+
+                  }
+                  .height('30%')
+                  .width("100%")
+                  Text('10')
+                    .textAlign(TextAlign.Center)
+                    .height('70%')
+                    .width("100%")
+                    .fontSize(px2vp(80))
+                    .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
+                    .fontWeight(FontWeight.Bold)
+
+                }.width('90%')
+                .height('45%')
+                .borderRadius(px2vp(15))
+                .margin({ left:10,right:10,top:5,bottom:5 })
+
+                Divider()
+                  .width('85%')
+                  .margin({right:20})
+                Column(){
+                  Row(){
+                    Image($r('app.media.maintenance_history'))
+                      .width(px2vp(37))
+                      .height(px2vp(37))
+                      .margin({left:10})
+                    Text('维修历史')
+                      .fontWeight(FontWeight.Regular)
+                      .fontSize(px2vp(27))
+                      .fontColor('#99000000')
+                      .margin({left:5})
+
+                  }
+                  .height('30%')
+                  .width("100%")
+                  Text('999+')
+                    .textAlign(TextAlign.Center)
+                    .height('70%')
+                    .width("100%")
+                    .fontSize(px2vp(80))
+                    .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
+                    .fontWeight(FontWeight.Bold)
+
+                }.width('90%')
+                .height('45%')
+                .borderRadius(px2vp(15))
+                .margin({ left:10,right:10,top:5,bottom:5 })
+                .backgroundColor($r('app.color.robot_set_card_white'))
+              }
+              .width('50%')
+              .height('100%')
+
+            }.width('60%')
+            .height('100%')
+
+            Column(){
+              Row(){
+                Text('生产履历')
+                  .fontWeight(FontWeight.Medium)
+                  .fontSize(px2vp(32))
+                  .fontColor('#e6000000')
+                  .width('60%')
+                  .height('100%')
+                Image($r('app.media.product_history'))
+                  .width(px2vp(64))
+                  .height(px2vp(64))
+              }.width('95%')
+              .height('30%')
+              .margin({right:20,left:10})
+              .padding({left:10,right:10})
+              .borderRadius(px2vp(15))
+              .backgroundColor($r('app.color.robot_set_card_white'))
+
+            }.width('40%')
+            .height('100%')
+
+          }.width('100%')
+          .height('40%')
+          Blank()
+          Column(){
+            Text('扫码')
+              .fontSize(px2vp(51))
+              .fontColor('#e6000000')
+              .fontWeight(FontWeight.Medium)
+              .textAlign(TextAlign.Start)
+              .width('100%')
+              .height('10%')
+            Column(){
+              Image($r('app.media.scan_qr'))
+                .width(px2vp(141))
+                .height(px2vp(141))
+            }.width('100%')
+            .height('50%')
+            .justifyContent(FlexAlign.Center)
+            Row(){
+              Image($r('app.media.shaoma'))
+                .width('56px')
+                .height('56px')
+                .margin({right:10})
+              TextInput({ text: '', placeholder: '点击扫码或者输入编码', controller: this.textcontroller})
+                .placeholderColor(Color.Grey)
+                .placeholderFont({ size: 14, weight: 400 })
+                .caretColor(Color.Blue)
+                .backgroundColor($r('app.color.robot_set_card_white'))
+                .height('100%')
+                .fontSize(px2vp(32))
+                .fontColor(Color.Black)
+                .onSubmit(()=>{
+                  router.pushUrl({
+                    url:'pages/MaintenanceStationOperations'
+                  })
+                })
+            }.width('80%')
+            .backgroundColor($r('app.color.robot_set_card_white'))
+            .borderRadius(15)
+            .height('15%')
+          }
+          .width('90%')
+          .height('40%')
+        }.height('100%')
+        .width('40%')
+
+      }.width("100%")
+      .height("84%")
+      BottomOperateComp({isHomePage : this.isHomePage})
+    }
+    .width("100%")
+    .height("100%")
+    .backgroundColor($r('app.color.title_bar_background'))
+
+  }
+}

+ 522 - 0
entry/src/main/ets/pages/MaintenanceStationOperations.ets

@@ -0,0 +1,522 @@
+import TimeUtil from '../common/util/TimeUtil'
+import { BottomOperateComp } from '../common/component/BottomOperateComp';
+import router from '@ohos.router';
+import { Method } from '@ohos/axios';
+
+export default class repairList {
+  deviceName?:string
+  materialNo?:string
+  repairedQuantity?:number
+  time?:string
+}
+@CustomDialog
+struct materialDetails{
+  private repairList:Array<repairList>=[]
+  controller: CustomDialogController
+  build(){
+    Column(){
+      Text('产品详情')
+        .fontSize(px2vp(51))
+        .fontColor('#e6000000')
+        .fontWeight(FontWeight.Medium)
+        .textAlign(TextAlign.Center)
+        .width('90%')
+        .height('10%')
+        .margin({bottom:10})
+      Column(){
+        Text('DS123422233卫星天线1')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(32))
+          .fontColor('#e6000000')
+          .width('100%')
+        Text('SASD-FSDDS-ASDDFFSA1')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(27))
+          .fontColor('#99000000')
+          .width('100%')
+      }
+      .width('60%')
+      .height('10%')
+
+
+
+
+    }.width('40%')
+    .height('60%')
+    .backgroundColor($r('app.color.robot_set_card_white'))
+    .borderRadius(px2vp(21))
+
+  }
+}
+@CustomDialog
+struct confirm{
+
+  @Link deviceName:string
+  controller: CustomDialogController
+  build(){
+    Column(){
+      Text('替换确认')
+        .fontSize(px2vp(51))
+        .fontColor('#e6000000')
+        .fontWeight(FontWeight.Medium)
+        .textAlign(TextAlign.Center)
+        .width('90%')
+        .height('10%')
+        .margin({top:10})
+      Text('是否替换:'+this.deviceName+'为新的物料?')
+        .fontWeight(FontWeight.Medium)
+        .fontColor('#e6000000')
+        .fontSize(px2vp(32))
+        .width('80%')
+        .height('60%')
+      Row({space:20}){
+        Text('取消')
+          .textAlign(TextAlign.Center)
+          .width('40%')
+          .height('100%')
+          .borderRadius(px2vp(30))
+          .fontColor($r('app.color.order_producing_state_background'))
+          .backgroundColor('#0f000000')
+          .onClick(()=>{
+            this.controller.close()
+          })
+        Text('确认')
+          .textAlign(TextAlign.Center)
+          .width('40%')
+          .height('100%')
+          .borderRadius(px2vp(30))
+          .fontColor($r('app.color.robot_set_card_white'))
+          .backgroundColor($r('app.color.order_producing_state_background'))
+          .onClick(()=>{
+            this.controller.close()
+
+          })
+
+      }.width('80%')
+      .height('20%')
+
+    }.width('40%')
+    .height('40%')
+    .backgroundColor($r('app.color.robot_set_card_white'))
+    .borderRadius(px2vp(21))
+
+  }
+}
+@CustomDialog
+struct selectReplacementMaterials{
+  @State deviceName?:string=''
+  confirmController: CustomDialogController = new CustomDialogController({
+    builder:confirm({
+      deviceName:this.deviceName,
+    }),
+    alignment: DialogAlignment.Center,
+    customStyle: true,
+  })
+  private repairList:Array<repairList>=[]
+  controller: CustomDialogController
+  build(){
+    Column(){
+      Text('选择替换物料')
+        .fontSize(px2vp(51))
+        .fontColor('#e6000000')
+        .fontWeight(FontWeight.Medium)
+        .textAlign(TextAlign.Center)
+        .width('90%')
+        .height('10%')
+        .margin({bottom:10})
+      Column(){
+        Text('DS123422233卫星天线1')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(32))
+          .fontColor('#e6000000')
+          .height('5%')
+          .width('90%')
+        Text('SASD-FSDDS-ASDDFFSA1')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(27))
+          .height('5%')
+          .fontColor('#99000000')
+          .width('90%')
+        List({ space: 10 ,initialIndex: 0 }) {
+          ForEach(this.repairList, (item:repairList,index:number) => {
+            ListItem() {
+              Column(){
+                Text(item.deviceName)
+                  .fontWeight(FontWeight.Medium)
+                  .fontSize(px2vp(32))
+                  .fontColor('#e6000000')
+                  .width('100%')
+                  .height('100%')
+              }.width('100%')
+              .height('20%')
+              .backgroundColor($r('app.color.robot_set_card_white'))
+              .borderRadius(px2vp(15))
+              .padding({left:10})
+              .onClick(()=>{
+                this.deviceName=item.deviceName
+                this.confirmController.open()
+              })
+            }
+          })
+        }
+        .width('90%')
+        .height('80%')
+      }
+      .width('90%')
+      .height('90%')
+
+
+
+
+    }.width('40%')
+    .height('60%')
+    .padding({top:10})
+    .backgroundColor($r('app.color.title_bar_background'))
+    .borderRadius(px2vp(21))
+  }
+}
+@Entry
+@Component
+struct MaintenanceStationOperations{
+  private  repairList:Array<repairList>=[
+    {deviceName:"DS123422233卫星天线1", materialNo:"SASD-FSDDS-ASDDFFSA1",repairedQuantity:5,time:'2024/4/30 15:11:11'},
+    {deviceName:"DS123422233卫星天线2", materialNo:"SASD-FSDDS-ASDDFFSA2",repairedQuantity:5,time:'2024/4/30 15:11:11'},
+    {deviceName:"DS123422233卫星天线3", materialNo:"SASD-FSDDS-ASDDFFSA3",repairedQuantity:5,time:'2024/5/1 15:11:11'},
+    {deviceName:"DS123422233卫星天线4", materialNo:"SASD-FSDDS-ASDDFFSA4",repairedQuantity:5,time:'2024/4/30 15:11:11'},
+    {deviceName:"DS123422233卫星天线5", materialNo:"SASD-FSDDS-ASDDFFSA5",repairedQuantity:5,time:'2024/4/30 15:11:11'},
+    {deviceName:"DS123422233卫星天线6", materialNo:"SASD-FSDDS-ASDDFFSA6",repairedQuantity:5,time:'2024/5/1 15:11:11'},
+  ]
+  textcontroller: TextInputController = new TextInputController()
+  @State click:number=0
+  @State processvalue:number=50
+  controller: TextClockController = new TextClockController()
+  private isHomePage:boolean = false
+  materialDetailsController: CustomDialogController = new CustomDialogController({
+    builder:materialDetails({
+      repairList:this.repairList
+    }),
+    alignment: DialogAlignment.Center,
+    customStyle: true,
+  })
+  selectReplacementMaterialController: CustomDialogController = new CustomDialogController({
+    builder:selectReplacementMaterials({
+      repairList:this.repairList
+    }),
+    alignment: DialogAlignment.Center,
+    customStyle: true,
+  })
+  build(){
+    Column(){
+      Stack() {
+        Text()
+          .width('100%')
+          .height('100%')
+          .backgroundColor($r('app.color.title_bar_background'))
+          .opacity(this.isHomePage ? $r('app.float.title_bar_home_page_opacity') : $r('app.float.title_bar_general_opacity'))
+
+        Row() {
+          Row() {
+            Image($r('app.media.return'))
+              .objectFit(ImageFit.Contain)
+          }
+          .width('20%')
+          .height('90%')
+          .alignItems(VerticalAlign.Center)
+          .justifyContent(FlexAlign.Center)
+          .margin({left: 10 , top: 5})
+          .onClick(()=>{
+            router.pushUrl({
+              url:'pages/MaintenanceStation'
+            })
+          })
+          Blank()
+          Column() {
+            Text(TimeUtil.getCurrentDate())
+              .fontColor($r('app.color.general_font_color'))
+              .fontSize($r('app.float.title_date_font_size'))
+              .fontWeight(FontWeight.Regular)
+            TextClock({ timeZoneOffset: -8, controller: this.controller })
+              .format('HH:mm:ss')
+              .fontSize($r('app.float.title_time_font_size'))
+              .fontWeight(FontWeight.Bold)
+          }
+          .height('100%')
+          .width('6%')
+          .alignItems(HorizontalAlign.Center)
+          .justifyContent(FlexAlign.Center)
+          Blank()
+          Row({space:10}) {
+            Blank()
+            Column(){
+              Progress({ value:this.processvalue, total: 100,type: ProgressType.Linear, }).width('100%')
+                .backgroundColor('#ffff')
+                .style({strokeWidth:5})
+              Text('任务进度:'+this.processvalue+'%')
+                .fontSize(px2vp(19))
+                .fontColor('#99000000')
+                .fontWeight(FontWeight.Medium)
+            }
+            .justifyContent(FlexAlign.Center)
+            .height('100%')
+            .width('25%')
+
+            Column(){
+              Text('王德发')
+                .fontSize(px2vp(27))
+                .fontColor('#99000000')
+                .fontWeight(FontWeight.Medium)
+              Text('装配工位001')
+                .fontSize(px2vp(19))
+                .fontColor('#99000000')
+                .fontWeight(FontWeight.Medium)
+
+            }.height('100%')
+            .width('25%')
+            .justifyContent(FlexAlign.Center)
+            .alignItems(HorizontalAlign.End)
+            Image($r('app.media.user_white'))
+              .width(px2vp(72))
+              .height(px2vp(72))
+
+          }
+          .width('20%')
+          .height('90%')
+          .alignItems(VerticalAlign.Center)
+          .justifyContent(FlexAlign.SpaceEvenly)
+        }
+        .width('100%')
+        .height('100%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.Center)
+      }
+      .width('100%')
+      .height('8%')
+     Row() {
+         Column() {
+           Column(){
+             Text("SADFFFSAD-大天线")
+               .height('16%')
+               .fontSize($r('app.float.card_title_font_size'))
+               .fontWeight(FontWeight.Medium)
+               .fontColor($r('app.color.general_font_color'))
+               .opacity($r('app.float.general_font_opacity'))
+               .maxLines(1)
+               .width('100%')
+             Text('SASD-FSDDS-ASDDFFSA...')
+               .width('100%')
+               .height('20%')
+               .fontSize($r('app.float.card_info_font_size'))
+               .fontColor('#99000000')
+               .fontWeight(FontWeight.Regular)
+               .opacity($r('app.float.card_font_default_opacity'))
+               .maxLines(1)
+             Blank()
+             Text('序列号')
+               .width('100%')
+               .height('12%')
+               .textAlign(TextAlign.Start)
+               .fontSize(px2vp(27))
+               .fontColor('#99000000')
+               .fontWeight(FontWeight.Regular)
+               .opacity($r('app.float.card_font_default_opacity'))
+               .maxLines(1)
+             Text('ASD123212DSAD332')
+               .width('100%')
+               .height('20%')
+               .fontWeight(FontWeight.Medium)
+               .fontSize($r('app.float.card_info_font_size'))
+               .fontColor('#e6000000')
+               .opacity($r('app.float.card_font_default_opacity'))
+               .maxLines(1)
+             Blank()
+             Text('当前工序')
+               .height('12%')
+               .width('100%')
+               .textAlign(TextAlign.Start)
+               .fontSize(px2vp(27))
+               .fontColor('#99000000')
+               .fontWeight(FontWeight.Regular)
+               .opacity($r('app.float.card_font_default_opacity'))
+               .maxLines(1)
+             Row(){
+               Text('固封')
+                 .height('100%')
+                 .width('80%')
+                 .fontWeight(FontWeight.Medium)
+                 .fontSize($r('app.float.card_info_font_size'))
+                 .fontColor('#e6000000')
+                 .opacity($r('app.float.card_font_default_opacity'))
+                 .maxLines(1)
+               Image($r('app.media.subscript'))
+                 .width($r('app.float.storage_set_image_effect_height'))
+                 .height($r('app.float.storage_set_image_effect_height'))
+             }
+             .height('20%')
+             .width('100%')
+           }
+           .backgroundColor($r('app.color.robot_set_card_white'))
+           .width('90%')
+           .height("27%")
+           .padding({ left:10,top:5 })
+           .borderRadius(px2vp(15))
+           .onClick(()=>{
+             this.materialDetailsController.open()
+           })
+           Column(){
+            Row(){
+              Text('叫料')
+                .fontWeight(FontWeight.Medium)
+                .fontColor('#e6000000')
+                .fontSize(px2vp(32))
+              Blank()
+              Image($r('app.media.call_material'))
+                .width($r('app.float.general_icon_size'))
+                .height($r('app.float.general_icon_size'))
+
+
+            }
+              .width('100%')
+              .height('15%')
+              .margin(5)
+              .padding({left:10,right:10})
+              .borderRadius(px2vp(15))
+              .backgroundColor(this.click===0?$r('app.color.robot_set_card_white'):this.click===1?
+              $r('app.color.order_finished_state_background'):$r('app.color.robot_set_card_white'))
+              .onClick(()=>{
+
+              })
+             Row(){
+               Text('工位上料')
+                 .fontWeight(FontWeight.Medium)
+                 .fontColor('#e6000000')
+                 .fontSize(px2vp(32))
+               Blank()
+               Image($r('app.media.station_loading'))
+                 .width($r('app.float.general_icon_size'))
+                 .height($r('app.float.general_icon_size'))
+
+             }
+               .width('100%')
+               .height('15%')
+               .margin(5)
+               .borderRadius(px2vp(15))
+               .padding({left:10,right:10})
+               .borderRadius(px2vp(15))
+               .backgroundColor($r('app.color.robot_set_card_white'))
+             Row(){
+               Text('图纸')
+                 .fontWeight(FontWeight.Medium)
+                 .fontColor('#e6000000')
+                 .fontSize(px2vp(32))
+               Blank()
+               Image($r('app.media.drawing'))
+                 .width($r('app.float.general_icon_size'))
+                 .height($r('app.float.general_icon_size'))
+
+             }.width('100%')
+               .height('15%')
+               .margin(5)
+               .padding({left:10,right:10})
+               .borderRadius(px2vp(15))
+               .backgroundColor($r('app.color.robot_set_card_white'))
+             Row(){
+               Text('报工')
+                 .fontWeight(FontWeight.Medium)
+                 .fontColor('#e6000000')
+                 .fontSize(px2vp(32))
+               Blank()
+               Image($r('app.media.report_work'))
+                 .width($r('app.float.general_icon_size'))
+                 .height($r('app.float.general_icon_size'))
+
+             }
+             .width('100%')
+             .height('15%')
+             .margin(5)
+             .margin(5)   .borderRadius(px2vp(15))
+             .padding({left:10,right:10})
+             .backgroundColor($r('app.color.order_finished_state_background'))
+
+
+
+
+           } .width('90%')
+           .padding({top:5})
+           .height("73%")
+
+         }
+         .height('100%')
+         .width('20%')
+         .alignItems(HorizontalAlign.Center)
+       Column(){
+         Text('故障详情')
+           .fontSize(px2vp(51))
+           .fontColor('#e6000000')
+           .fontWeight(FontWeight.Medium)
+           .textAlign(TextAlign.Start)
+           .width('90%')
+           .height('8%')
+           .border({width:1})
+       }.height('100%')
+       .width('30%')
+       Column(){
+         Text('物料替换')
+           .fontSize(px2vp(51))
+           .fontColor('#e6000000')
+           .fontWeight(FontWeight.Medium)
+           .textAlign(TextAlign.Start)
+           .width('90%')
+           .height('8%')
+         Row(){
+           Image($r('app.media.shaoma'))
+             .width('56px')
+             .height('56px')
+             .margin({right:10})
+             .backgroundColor($r('app.color.robot_set_card_white'))
+           TextInput({ text: '', placeholder: '点击扫码或者输入编码', controller: this.textcontroller})
+             .placeholderColor(Color.Grey)
+             //.placeholderFont({ size: 14, weight: 400 })
+             .caretColor(Color.Blue)
+             .backgroundColor($r('app.color.robot_set_card_white'))
+             .height('100%')
+             .width('60%')
+             .fontSize(px2vp(32))
+             .fontColor(Color.Black)
+             .onSubmit(()=>{
+               router.pushUrl({
+                 url:'pages/MaintenanceStationOperations'
+               })
+             })
+
+         }.width('60%')
+         .backgroundColor($r('app.color.robot_set_card_white'))
+         .borderRadius(21)
+         .margin({top:5})
+         .height('10%')
+         .onClick(()=>{
+           this.selectReplacementMaterialController.open()
+         })
+         Column(){
+
+
+         }.width('95%')
+         .height('82%')
+
+       }
+       .height('100%')
+       .width('50%')
+       .padding({left:20})
+       .alignItems(HorizontalAlign.Start)
+
+
+
+
+     }.width('100%')
+      .height('84%')
+      BottomOperateComp({isHomePage : this.isHomePage})
+    }
+    .width("100%")
+    .height("100%")
+    .backgroundColor($r('app.color.title_bar_background'))
+  }
+}

+ 120 - 0
entry/src/main/ets/pages/Outbound.ets

@@ -0,0 +1,120 @@
+import { TitleStateComp } from '../common/component/TitleStateComp'
+import { CompleteSet } from '../view/CompleteSet'
+
+@Entry
+@Component
+struct Outbound{
+  //齐套按钮:0、手动出库:1、调仓:2.统计:3
+  @State inboundButton:number=0
+  //仓储和其他仓储点击按钮变色
+  @State warehouseButton:number=0
+  @State isHomePage:boolean=false
+  build() {
+    Column(){
+      TitleStateComp({ isHomePage: this.isHomePage,})
+      Column(){
+        Row({space:10}){
+          Row(){
+            Text('智能仓储')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('48%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.warehouseButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.warehouseButton===0?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.warehouseButton=0
+              })
+            Blank()
+            Text('其他仓储')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('48%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.warehouseButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.warehouseButton===1?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.warehouseButton=1
+              })
+
+
+          }.width('33%')
+          .borderRadius(px2vp(15))
+          .height('100%')
+          .backgroundColor($r('app.color.black_10'))
+          Row(){
+            Text('齐套')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('25%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===0?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=0
+              })
+            Text('手动出库')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('25%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===1?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=1
+              })
+            Text('调仓')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('25%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===2?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===2?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=2
+              })
+            Text('统计')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('25%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===3?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===3?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=3
+              })
+          }.width('67%')
+          .borderRadius(px2vp(15))
+          .height('100%')
+          .backgroundColor($r('app.color.black_10'))
+        }.width('100%')
+        .height('8%')
+        if (this.warehouseButton===0&&this.inboundButton===0){
+          Column(){
+            CompleteSet()
+          }.width('100%')
+            .height('92%')
+
+        }
+
+      }.width('100%')
+      .height('92%')
+      .padding({left:px2vp(50),right:px2vp(50)})
+      .backgroundColor($r('app.color.white_f1f3f5'))
+    }.width('100%')
+    .height('100%')
+
+  }
+}

+ 170 - 0
entry/src/main/ets/pages/OutboundStation.ets

@@ -0,0 +1,170 @@
+import { TitleStateComp } from '../common/component/TitleStateComp'
+import { CompleteSet } from '../view/CompleteSet'
+import  {Statistics}from '../view/Statistics'
+import { AdjustStorageView } from '../view/storage/AdjustStorageView'
+import { ManualOutbound } from '../view/ManualOutbound'
+import { WarehouseMap } from './WarehouseMap'
+
+/*
+ * 出库工位
+ * */
+@Entry
+@Component
+struct OutboundStation {
+  //齐套按钮(0:齐套 1:手动出库 2:调仓:3:统计)
+  @State inboundButton:number = 0
+  @State Button:number=0
+  //仓储和其他仓储点击按钮变色
+  @State warehouseButton: number = 0
+
+  @State isHomePage: boolean = false
+  build() {
+    Column(){
+      TitleStateComp({ isHomePage: this.isHomePage,})
+      Column(){
+        Row({space:px2vp(24)}){
+          Row(){
+            Text('智能仓储')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.warehouseButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.warehouseButton===0?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.warehouseButton=0
+              })
+            Blank()
+            Text('其他仓储')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.warehouseButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.warehouseButton===1?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.warehouseButton=1
+              })
+          }
+          .width(px2vp(608))
+          .borderRadius(px2vp(16))
+          .height(px2vp(80))
+          .backgroundColor($r('app.color.black_10'))
+          Row({space:px2vp(24)}){
+            Text('齐套')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===0?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=0
+              })
+            Text('手动出库')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===1?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=1
+              })
+            Text('调仓')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===2?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===2?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=2
+              })
+            Text('统计')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width(px2vp(146))
+              .height(px2vp(80))
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===3?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===3?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=3
+              })
+            Text('叫车')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width(px2vp(124))
+              .height(px2vp(80))
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.Button===1?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.Button===1?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.Button=1
+
+              })
+
+          }.width(px2vp(1240))
+          .borderRadius(px2vp(16))
+          .height(px2vp(80))
+          .backgroundColor($r('app.color.black_10'))
+        }
+        .width(px2vp(1920))
+        .height(px2vp(80))
+        .padding({left:px2vp(24),right:px2vp(24)})
+        if (this.warehouseButton === 0&& this.inboundButton === 0){
+          //齐套
+          Column(){
+            CompleteSet()
+          }
+          .margin({top:px2vp(20),bottom:$r('app.float.topMargins_20')})
+          .width(px2vp(1920))
+          .height(px2vp(900))
+        }else if (this.warehouseButton===0&&this.inboundButton===2){
+          Column(){
+            //调仓
+            //AdjustStorageView()
+            WarehouseMap()
+          }
+          .width('100%')
+          .height('92%')
+        } else if (this.warehouseButton===0&&this.inboundButton===3){
+          Column(){
+            //智能仓储统计
+            Statistics()
+          }
+          .width('100%')
+          .height('92%')
+        }
+        else if (this.warehouseButton===0&&this.inboundButton===1){
+          Column(){
+            //手动出库
+            ManualOutbound()
+          }
+          .margin({top:$r('app.float.topMargins_20'),bottom:$r('app.float.topMargins_20')})
+          .width('100%')
+          .height('92%')
+        }
+      }
+      .width('100%')
+      .height('92%')
+      .padding({left:px2vp(24),right:px2vp(24)})
+      .backgroundColor($r('app.color.white_f1f3f5'))
+    }.width('100%')
+    .height('100%')
+
+  }
+}

+ 483 - 0
entry/src/main/ets/pages/RfidAllocation.ets

@@ -0,0 +1,483 @@
+import { TitleStateComp } from '../common/component/TitleStateComp';
+import { ScanStorageclass } from './Storage';
+import StorageRequest from '../common/util/request/StorageRequest';
+import router from '@ohos.router';
+import { WorkstationInfo } from './LoginPage';
+import CommonConstants from '../common/constants/CommonConstants';
+import EquipmentRequest from '../common/util/request/EquipmentRequest';
+import RequestParamModel from '../viewmodel/RequestParamModel';
+
+@Entry
+@CustomDialog
+export struct RfidAllocation{
+  //写入rfid
+  @State InRfid:string=''
+  @State workstation: WorkstationInfo = {}
+  //新建料箱最后两位
+  @State newBox:number=0
+  //点击选择
+  @State onclick:number=-1
+  //打印机在线状态
+  @State onlineStatus:number=0
+  //RFID在线状态
+  @State RfidOnlineStatus:number=0
+  //箱子编码
+  @State boxCode:string=''
+  //扫码控制器
+  textcontroller: TextInputController = new TextInputController()
+  //新建料箱list
+  @State private scanStorageList:Array<ScanStorageclass>=[]
+  @State isHomePage:boolean=false
+  RfidController?: CustomDialogController;
+  //料箱容量
+  @State capacity:string='9999'
+  //料箱类别
+  @State category:string='0'
+  //载具编号
+  @State code:string=''
+  //载具名称
+  @State name:string=''
+  //资产编号
+  @State propertyCode:string='YXJ-4610'
+  //时间
+  @State coding:string=''
+  //料箱创建日期
+  @State MaterialBoxData:string=''
+  //料箱创建时间
+  @State MaterialBoxTime:string=''
+  //新建料箱表
+  @State private  newMaterial:Array<newMaterialBoxList>=[]
+  @State private  newMaterialBin:Array<newMaterialBin>=[]
+  //读取到的rfid信息
+  @State private  httpRfid:RfidClass={}
+  //获取rfid
+  RfidHttp= async() : Promise<RfidClass> => {
+    //todo SGHRI3LR48500设备编号,从后端数据获取,暂时写死
+    let res:RfidClass = await EquipmentRequest.get("/api/y1/device/data/recentlyRecord/SGHRI3LR48500", {})
+    this.httpRfid=res
+    console.log('textTag', 'rfid请求结果' +JSON.stringify(res)
+    );
+    return res
+  }
+  //写入rfid
+  InRfidHttp= async() : Promise<RfidClass> => {
+    //todo SGHRI3LR48500设备编号,从后端数据获取,暂时写死
+    let res:RfidClass = await EquipmentRequest.get("/api/y1/device/data/recentlyRecord/SGHRI3LR48500", {})
+    this.httpRfid=res
+    console.log('textTag', 'rfid请求结果' +JSON.stringify(res)
+    );
+    return res
+  }
+aboutToAppear(): void {
+  setInterval(async () => {
+    this.RfidHttp().then((res:RfidClass)=> {
+      console.log('textTag', '-------rfid获取信息' + JSON.stringify(res))
+    })
+     }, 1000);
+
+
+
+}
+  //后端料箱绑定
+  newMaterialBox = async() : Promise<newMaterialBoxList> => {
+  let obj: newMaterialBoxList = {}
+  let res:newMaterialBoxList = await StorageRequest.post("/api/v1/wms/vehicle/add", {
+    capacity: '9999',
+    category:'0',
+    code: this.coding,
+    name:this.coding,
+    propertyCode: this.coding,
+    universal: '0'
+  }as newMaterialBoxList)
+  console.log('testTag', 'Tasklist成功' + JSON.stringify(res))
+  obj = JSON.parse(JSON.stringify(res))
+  console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+  return obj
+}
+  build() {
+    Column(){
+      Stack({ alignContent: Alignment.Start }){
+        TitleStateComp({ isHomePage: this.isHomePage,})
+        Row(){
+          Image($r('app.media.return'))
+            .width(px2vp(56))
+            .height(px2vp(56))
+            .onClick(()=>{
+              if ( CommonConstants.stationDictValue=== '5') {
+                router.pushUrl({
+                url:'pages/Warehousing'
+                })
+              }else if ( CommonConstants.stationDictValue=== '6'){
+                router.pushUrl({
+                  url:'pages/OutboundStation',
+                })
+              }
+              else {
+                router.pushUrl({
+                  url:'pages/process/ProcessHome',
+                })
+              }
+
+            })
+
+        }.width('20%')
+        .height('8%')
+        .padding({left:px2vp(24)})
+        .backgroundColor($r('app.color.title_bar_background'))
+      }
+
+      Row(){
+        Column(){
+          Column(){
+            Column(){
+              Text('已有料盒'+"["+this.newMaterialBin.length.toString()+']')
+                .fontSize($r('app.float.fontSize_30'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.black_90'))
+                .width('40%')
+                .height(px2vp(80))
+
+            }
+            .width('100%')
+            .height(px2vp(80))
+            .alignItems(HorizontalAlign.Start)
+            Row(){
+              Button('新建料箱')
+                .width(px2vp(292))
+                .height(px2vp(80))
+                .fontSize($r('app.float.fontSize_24'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.process_divider_white_color'))
+                .backgroundColor($r('app.color.blue_100'))
+                .onClick(()=>{
+                  this.newBox++
+                  //日期时间
+                  let dateTime = new Date()
+                  let coding = dateTime.getFullYear() + (dateTime.getMonth() + 1).toString().padStart(2, '0')
+                    +  (dateTime.getDate().toString().padStart(2, '0')) +
+                  (dateTime.getHours()).toString().padStart(2, '0')+(dateTime.getMinutes() + 1).toString().padStart(2, '0')
+                    +(dateTime.getSeconds() ).toString().padStart(2, '0')+(this.newBox<10?0:'')+this.newBox
+                  this.coding=coding
+                  let data=dateTime.getFullYear() +'-'+ (dateTime.getMonth() + 1).toString().padStart(2, '0')
+                    +'-'+  (dateTime.getDate().toString().padStart(2, '0'))
+                  this.MaterialBoxData=data
+                  let time=dateTime.getHours() +':'+ (dateTime.getMinutes() + 1).toString().padStart(2, '0')
+                    +':'+  (dateTime.getSeconds().toString().padStart(2, '0'))
+                  this.MaterialBoxTime=time
+
+                  //todo 后台接口完善后要放开注释
+                  // this.newMaterialBox().then((res:newMaterialBoxList)=>{
+                  //   this.newMaterial.push(res)
+                  // })
+
+                  let obj:newMaterialBin={MaterialBoxData:this.MaterialBoxData,MaterialBoxTime:this.MaterialBoxTime,coding:this.coding }
+                  this.newMaterialBin.unshift(obj)
+                })
+              Blank()
+              Row(){
+                Image($r('app.media.shaoma'))
+                  .width(px2vp(32))
+                  .height(px2vp(32))
+                  .margin({left:$r('app.float.fontSize_30')})
+                TextInput({ text:this.boxCode,
+                  placeholder: '请点击扫码或者输入物料编码',
+                  controller: this.textcontroller }).width('92%')
+                  .height('100%')
+                  .width(px2vp(450))
+                  .fontWeight(FontWeight.Medium)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .backgroundColor("#ffff")
+                  .borderRadius(21)
+                  .onSubmit(() => {
+
+                  })
+                Image($r('app.media.search'))
+                  .width(px2vp(32))
+                  .height(px2vp(32))
+                  .margin({right:$r('app.float.fontSize_30')})
+
+              }
+              .width(px2vp(608))
+              .height(px2vp(80))
+              .borderRadius(px2vp(100))
+              .alignItems(VerticalAlign.Center)
+              .backgroundColor($r('app.color.process_divider_white_color'))
+            }
+            .margin({right:$r('app.float.Margins_24')})
+            .width('100%')
+            .height(px2vp(80))
+          }
+          .width('100%')
+          .height(px2vp(160))
+          .margin({right:$r('app.float.Margins_24'),bottom:px2vp(20)})
+
+
+          Column(){
+            List(){
+              ForEach(this.newMaterialBin,(item:newMaterialBin,index:number)=>{
+                ListItem(){
+                  Column(){
+                    Text(item.coding)
+                      .fontSize($r('app.float.fontSize_24'))
+                      .fontWeight(FontWeight.Medium)
+                      .fontColor($r('app.color.black_90'))
+                      .width('100%')
+                      .height('40%')
+
+                    Row(){
+                      Text(item.MaterialBoxData+'  '+item.MaterialBoxTime)
+                        .fontSize($r('app.float.fontSize_20'))
+                        .fontWeight(FontWeight.Medium)
+                        .fontColor($r('app.color.black_60'))
+                        .width('100%')
+                        .height('100%')
+                        .textAlign(TextAlign.Start)
+                    }
+                    .width('100%')
+                    .height('40%')
+                  }
+                  .justifyContent(FlexAlign.Center)
+                  .width(px2vp(608))
+                  .height(px2vp(88))
+                  .margin({right:$r('app.float.Margins_24'),bottom:$r('app.float.topMargins_20')})
+                  .padding({left:$r('app.float.leftMargins_30') })
+                  .backgroundColor(this.onclick===index?$r('app.color.blue_100'):$r('app.color.process_divider_white_color'))
+                  .borderRadius(px2vp(16))
+                  .onClick(()=>{
+                    this.onclick=index
+                    this.InRfid=item.coding!
+
+                  })
+                }
+                .margin({right:$r('app.float.Margins_24')})
+              })
+
+            }
+            .lanes(2)
+          }.width('100%')
+          .height('80%')
+
+        }.width('66%')
+        .height('100%')
+        .borderRadius($r('app.float.borderRadius_16'))
+        .alignItems(HorizontalAlign.Start)
+        //.margin({right:$r('app.float.Margins_24')})
+
+        Column(){
+          Column(){
+            Text('条码打印')
+              .fontSize($r('app.float.fontSize_30'))
+              .fontWeight(FontWeight.Medium)
+              .fontColor($r('app.color.black_90'))
+              .textAlign(TextAlign.Start)
+              .width('100%')
+              .height('15%')
+              .margin({left:$r('app.float.leftMargins_30')})
+            Column(){
+              Row({space:10}){
+                Text('打印机状态')
+                  .fontSize($r('app.float.fontSize_20'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor($r('app.color.black_60'))
+                  .textAlign(TextAlign.End)
+                  .width('40%')
+                  .height('100%')
+                if (this.onlineStatus===0){
+                  Text().width(px2vp(12))
+                    .height(px2vp(12))
+                    .borderRadius(px2vp(50))
+                    .backgroundColor($r('app.color.green_100'))
+                  Text('在线')
+                    .fontSize($r('app.float.fontSize_20'))
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor($r('app.color.black_90'))
+                    .textAlign(TextAlign.Start)
+                    .width('35%')
+                    .height('100%')
+                }else if (this.onlineStatus===1) {
+
+                  Text().width('5%')
+                    .height('30%')
+                    .borderRadius(px2vp(50))
+                    .backgroundColor($r('app.color.grey_100'))
+                  Text('不在线')
+                    .fontSize($r('app.float.fontSize_20'))
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor($r('app.color.black_90'))
+                    .textAlign(TextAlign.Start)
+                    .width('35%')
+                    .height('100%')
+                }
+
+              }
+              .width('100%')
+              .height('30%')
+              Row({space:10}){
+                Text('打印机RFID编号')
+                  .fontSize($r('app.float.fontSize_20'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor($r('app.color.black_60'))
+                  .textAlign(TextAlign.End)
+                  .width('40%')
+                  .height('100%')
+                Text('6537289495783').width('40%')
+                  .height('30%')
+                  .borderRadius(px2vp(50))
+                  .fontColor($r('app.color.blue_100'))
+
+              }
+              .width('100%')
+              .height('30%')
+            }.width('100%')
+            .height('60%')
+            .justifyContent(FlexAlign.Center)
+            .alignItems(HorizontalAlign.Center)
+            Blank()
+            Button('打印条码')
+              .fontColor($r('app.color.process_divider_white_color'))
+              .fontSize($r('app.float.fontSize_20'))
+              .fontWeight(FontWeight.Medium)
+              .backgroundColor($r('app.color.blue_100'))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .margin({bottom:$r('app.float.topMargins_20')})
+
+          }.width('100%')
+          .height('49%')
+          .borderRadius(px2vp(16))
+          .backgroundColor($r('app.color.white_E3E5E7'))
+          .margin({bottom:$r('app.float.topMargins_20')})
+          Column(){
+            Text('写入RFID')
+              .fontSize($r('app.float.fontSize_30'))
+              .fontWeight(FontWeight.Medium)
+              .fontColor($r('app.color.black_90'))
+              .textAlign(TextAlign.Start)
+              .width('100%')
+              .height('15%')
+              .margin({left:$r('app.float.leftMargins_30')})
+            Column(){
+              Row({space:10}){
+                Text('RFID状态')
+                  .fontSize($r('app.float.fontSize_20'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor($r('app.color.black_60'))
+                  .textAlign(TextAlign.End)
+                  .width('40%')
+                  .height('100%')
+                if (this.RfidOnlineStatus===0){
+                  Text().width(px2vp(12))
+                    .height(px2vp(12))
+                    .borderRadius(px2vp(50))
+                    .backgroundColor($r('app.color.green_100'))
+                  Text('在线')
+                    .fontSize($r('app.float.fontSize_20'))
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor($r('app.color.black_90'))
+                    .textAlign(TextAlign.Start)
+                    .width('35%')
+                    .height('100%')
+                }else if (this.RfidOnlineStatus===1){
+
+                  Text().width('5%')
+                    .height('30%')
+                    .borderRadius(px2vp(50))
+                    .backgroundColor($r('app.color.grey_100'))
+                  Text('不在线')
+                    .fontSize($r('app.float.fontSize_20'))
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor($r('app.color.black_90'))
+                    .textAlign(TextAlign.Start)
+                    .width('35%')
+                    .height('100%')
+                }
+
+              }
+              .width('100%')
+              .height('30%')
+              Row({space:10}){
+                Text('当前RFID编号')
+                  .fontSize($r('app.float.fontSize_20'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor($r('app.color.black_60'))
+                  .textAlign(TextAlign.End)
+                  .width('40%')
+                  .height('100%')
+                Text('6537289495783').width('40%')
+                  .height('30%')
+                  .borderRadius(px2vp(50))
+                  .fontColor($r('app.color.blue_100'))
+
+              }
+              .width('100%')
+              .height('30%')
+              Row({space:10}){
+                Text('写入RFID编号')
+                  .fontSize($r('app.float.fontSize_20'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor($r('app.color.black_60'))
+                  .textAlign(TextAlign.End)
+                  .width('40%')
+                  .height('100%')
+                Text(this.InRfid.toString()).width('40%')
+                  .height('30%')
+                  .borderRadius(px2vp(50))
+                  .fontColor($r('app.color.blue_100'))
+
+              }
+              .width('100%')
+              .height('30%')
+            }.width('100%')
+            .height('60%')
+            .justifyContent(FlexAlign.Center)
+            .alignItems(HorizontalAlign.Center)
+            Blank()
+            Button('写入RFID')
+              .fontColor($r('app.color.process_divider_white_color'))
+              .fontSize($r('app.float.fontSize_20'))
+              .fontWeight(FontWeight.Medium)
+              .backgroundColor($r('app.color.blue_100'))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .margin({bottom:$r('app.float.topMargins_20')})
+
+          }.width('100%')
+          .height('49%')
+          .borderRadius(px2vp(16))
+          .backgroundColor($r('app.color.white_E3E5E7'))
+
+        }.width('33%')
+        .height('100%')
+
+      }.width('100%')
+      .height('92%')
+      .justifyContent(FlexAlign.Center)
+      .padding({left:$r('app.float.Margins_24'),right:$r('app.float.Margins_24'),top:$r('app.float.topMargins_20'),bottom:$r('app.float.topMargins_20')})
+
+    }.width('100%')
+    .height('100%')
+    .backgroundColor($r('app.color.white_f1f3f5'))
+  }
+}
+export interface  newMaterialBoxList{
+  capacity?: string
+  category?: string
+  code?: string
+  name?: string
+  propertyCode?: string
+  universal?: string
+}
+export interface newMaterialBin{
+  MaterialBoxData?:string
+  MaterialBoxTime?:string
+  coding?:string
+}
+
+export interface RfidClass{
+  data?:datalass
+}
+export interface datalass{
+  RFID?:string
+  UID?:string
+  errCode?:string
+}

+ 753 - 0
entry/src/main/ets/pages/RobotDebug.ets

@@ -0,0 +1,753 @@
+import { TitleStateComp } from '../common/component/TitleStateComp';
+import { RobotPreviewComp } from '../common/component/RobotPreviewComp';
+import RobotInfo from '../model/RobotInfo';
+import CommonConstants from '../common/constants/CommonConstants';
+import StorageInfo from '../model/StorageInfo';
+import StorageSpace from '../model/StorageSpace';
+import SpaceStateList from '../model/SpaceStateList';
+import StorageModel from '../model/database/StorageModel';
+import StorageSpaceModel from '../model/database/StorageSpaceModel';
+import { RobotLogComp } from '../common/component/RobotLogComp';
+import StorageConfig from '../viewmodel/StorageConfig';
+import JGRequest from '../common/util/request/Request';
+
+export interface NavigationItem {
+  id: number;
+  text: string;
+  icon: Resource;
+}
+
+export const NavigationList: NavigationItem[] = [
+  {
+    id: 0,
+    text: '总控',
+    icon: $r('app.media.daohangzongkong')
+  },
+  {
+    id: 1,
+    text: '位移',
+    icon: $r('app.media.daohangyidong')
+  },
+  {
+    id: 2,
+    text: '车轮',
+    icon: $r('app.media.daohangchelun')
+  },
+  {
+    id: 3,
+    text: '吊篮',
+    icon: $r('app.media.daohangdiaolan')
+  },
+  {
+    id: 4,
+    text: '充电',
+    icon: $r('app.media.daohangchongdian')
+  },
+]
+
+@Entry
+@Component
+export struct RobotDebug {
+  @State mCurrentPage: number = 0;
+  private isHomePage: boolean = false
+  private mTabController: TabsController = new TabsController()
+  @State selectRobot: number = 1
+  // todo
+  @State storages: StorageInfo[] = []
+  @State list: Resource[] = [$r('app.media.car_preview'), $r('app.media.car_preview'), $r('app.media.car_preview')]
+  @State robots: RobotInfo[] = CommonConstants.ROBOTS
+  @State robotX: number | undefined = 0
+  @State robotY: number | undefined  = 0
+  @State robotStorage: StorageInfo = {}
+  // 机器人在网格中展示的图片
+  @State robotImage: Resource = $r('app.media.robot_toward_1')
+  @State robotArmX: number | undefined= 0
+  @State robotArmY: number | undefined= 0
+  scroller: Scroller = new Scroller()
+  /*
+   * 仓储格子相关
+   * */
+  // key为storageSpace的y值
+  @State spaceArray: StorageSpace[][] = []
+  // 储位状态(1:禁用 2:未设置类型 3:正常 4:禁用+选中 5:未设置类型+选中 6:正常+选中)
+  @State stateArray: Array<SpaceStateList> = [];
+  @State selectSpace: StorageSpace = {}
+  @State yNum: number[] = []
+
+  async aboutToAppear() {
+    let storageId:number | undefined = 0
+    if (this.robots && this.robots[this.selectRobot]) {
+      let robot: RobotInfo  = this.robots[this.selectRobot]
+      storageId = robot.storageId
+      switch (robot.robotToward) {
+        case 1:
+          this.robotImage = $r('app.media.robot_toward_1')
+          this.robotArmX = (robot.x?robot.x:0) + 1
+          this.robotArmY = robot.y
+          break
+        case 2:
+          this.robotImage = $r('app.media.robot_toward_2')
+          this.robotArmX = (robot.x?robot.x:0)- 1
+          this.robotArmY = robot.y
+          break
+        case 3:
+          this.robotImage = $r('app.media.robot_toward_3')
+          this.robotArmX = (robot.x?robot.x:0)
+          this.robotArmY = (robot.y?robot.y:0) + 1
+          break
+        default:
+          this.robotImage = $r('app.media.robot_toward_4')
+          this.robotArmX = (robot.x?robot.x:0)
+          this.robotArmY = (robot.y?robot.y:0) - 1
+          break
+      }
+    }
+    if (storageId === 0) {
+      return
+    }
+
+    let spaces: StorageSpace[] = []
+    // 查询本地数据库,没有则添加数据(仓储和储位数据)
+    this.storages = await StorageModel.getStorageList()
+    if (!this.storages || this.storages.length <= 0) {
+      // 查询后台数据库的线边库
+      let config: StorageConfig = await JGRequest.get("/api/v1/wms/position/houseConfigInfo/" + 1, {})
+      if (!config) {
+        return
+      }
+      this.storages.push({
+        storageName: config.houseName,
+        xSize: config.xNum,
+        ySize: config.yNum,
+        defaultLayer: config.layer
+      } as StorageInfo)
+      let storageId = await StorageModel.addStorage(config.houseName as string, config.xNum as number, config.yNum as number, config.layer as number)
+      this.storages[0].id = storageId
+      if (config.xNum && config.xNum > 0 && config.yNum && config.yNum > 0) {
+        for (let y = 1; y <= config.yNum; y++) {
+          for (let x = 1; x <= config.xNum; x++) {
+            let space: StorageSpace = {
+              storageId: storageId,
+              x: x,
+              y: y,
+              enableState: 1,
+              storageType: '',
+              capacity: config.layer,
+              canWay: 1,
+              canPark: 0
+            }
+            space.id = await StorageSpaceModel.addStorageSpace(space)
+            // spaces.push(space)
+          }
+        }
+      }
+    }
+
+    for (const storage of this.storages) {
+        if (storageId === storage.id) {
+          this.robotStorage = storage
+          break
+        }
+      }
+    if (this.robotStorage) {
+      let x: number = 0
+      if (this.robotStorage.xSize && this.robotStorage.xSize > 0) {
+        x = this.robotStorage.xSize
+      } else {
+        return
+      }
+      // 生成需要遍历的行 (y倒序)
+      if (this.robotStorage.ySize && this.robotStorage.ySize > 0) {
+        if (this.robotStorage.ySize && this.robotStorage.ySize > 0) {
+          for (let index = this.robotStorage.ySize - 1; index >= 0; index--) {
+            this.yNum.push(index)
+          }
+        }
+      } else {
+        return
+      }
+      StorageSpaceModel.getListByStorageId((this.robotStorage.id?this.robotStorage.id:0)).then(spaces => {
+        if (spaces && spaces.length > 0) {
+          let tempArray: StorageSpace[] = []
+          let stateList = new SpaceStateList()
+          for (const space of spaces) {
+            tempArray.push(space)
+            // 储位状态创建
+            if (space.enableState === 2) {
+              stateList.push(1)
+            } else if (!space.storageType || space.storageType.length === 0) {
+              stateList.push(2)
+            } else {
+              stateList.push(3)
+            }
+            if (tempArray.length === x) {
+              this.spaceArray.push(tempArray)
+              this.stateArray.push(stateList)
+              tempArray = []
+              stateList = new SpaceStateList()
+            }
+          }
+        }
+      })
+    }
+  }
+
+  updateViewData() {
+    if (this.robots && this.robots[this.selectRobot]) {
+      this.robotX = this.robots[this.selectRobot].x ? this.robots[this.selectRobot].x : 0
+      this.robotY = this.robots[this.selectRobot].y ? this.robots[this.selectRobot].y : 0
+      if (this.robots[this.selectRobot].robotType === 2) {
+        let robot: RobotInfo = this.robots[this.selectRobot - 1]
+        switch (robot.robotToward) {
+          case 1:
+            this.robotImage = $r('app.media.robot_toward_1')
+            this.robotArmX =(robot.x?robot.x:0) + 1
+            this.robotArmY = robot?.y
+            break
+          case 2:
+            this.robotImage = $r('app.media.robot_toward_2')
+            this.robotArmX =  (robot.x?robot.x:0)- 1
+            this.robotArmY = robot.y
+            break
+          case 3:
+            this.robotImage = $r('app.media.robot_toward_3')
+            this.robotArmX = robot.x
+            this.robotArmY = (robot.y?robot.y:0) + 1
+            break
+          default:
+            this.robotImage = $r('app.media.robot_toward_4')
+            this.robotArmX = robot.x
+            this.robotArmY = (robot.y?robot.y:0) - 1
+            break
+        }
+      }
+    }
+    for (const storage of this.storages) {
+      if (this.robots && this.robots[this.selectRobot] && this.robots[this.selectRobot].storageId && this.robots[this.selectRobot].storageId === storage.id) {
+        this.robotStorage = storage
+      }
+    }
+  }
+
+  build() {
+    Column() {
+      TitleStateComp({ isHomePage: this.isHomePage})
+      Row() {
+        Column() {
+          Column() {
+            Text('机器人调试')
+              .padding(10)
+              .width('100%')
+              .height('8%')
+              .fontSize($r('app.float.title_font_size'))
+              .textAlign(TextAlign.Start)
+            Flex() {
+              Tabs({ barPosition: BarPosition.Start, controller: this.mTabController }) {
+                TabContent() {
+                  Column() {
+                    this.card('调试模式', $r('app.media.zongkongtiaoshi'))
+                    this.card('自动模式', $r('app.media.zongkongzidong'))
+                    Divider().width('90%')
+                      .margin({ bottom: '20px' })
+                    this.card('电机通电', $r('app.media.zongkongdianjitongdian'))
+                    this.card('电机断电', $r('app.media.zongkongguanbidianji'))
+                  }
+                  .alignItems(HorizontalAlign.Start)
+                  .width('100%')
+                  .height('100%')
+                  .margin({ left: '24px' })
+                }
+                .tabBar(this.TabBuilder(0))
+
+                TabContent() {
+                  Column() {
+                    Row() {
+                      Column() {
+                        Text('当前坐标')
+                          .fontSize('24px')
+                          .fontWeight(FontWeight.Medium)
+                          .margin({ left: '26px' })
+                        Text('X:2 Y:3')
+                          .fontSize('20px')
+                          .fontWeight(FontWeight.Regular)
+                          .margin({ left: '26px' })
+                      }
+
+                      .height('52px')
+                      .alignItems(HorizontalAlign.Start)
+
+                      Blank()
+                      Image($r('app.media.weiyibianjiweizhi'))
+                        .width('48px')
+                        .height('48px')
+                        .margin('20px')
+                    }
+                    .width('90%')
+                    .height('12%')
+                    .backgroundColor('#FFFFFF')
+                    .alignItems(VerticalAlign.Center)
+                    .borderRadius('16px')
+                    .margin({ bottom: '18px' })
+
+                    Divider().margin({ bottom: '20px' }).width('90%')
+                    this.card('+X轴移1格', $r('app.media.weiyix'))
+                    this.card('-X轴移1格', $r('app.media.weiyixx'))
+                    this.card('+Y轴移1格', $r('app.media.weiyiy'))
+                    this.card('-Y轴移1格', $r('app.media.weiyiyy'))
+                    Divider().margin({ bottom: '20px' }).width('90%')
+                    this.card('中止', $r('app.media.weiyizhongzhi'))
+                    this.card('急停', $r('app.media.weiyijiting'))
+                  }
+                  .alignItems(HorizontalAlign.Start)
+                  .width('100%')
+                  .height('100%')
+                  .margin({ left: '24px' })
+                }
+                .tabBar(this.TabBuilder(1))
+
+                TabContent() {
+                  Column() {
+                    this.card('置顶', $r('app.media.chelunzhiding'))
+                    this.card('置中', $r('app.media.chelunzhizhong'))
+                    this.card('置底', $r('app.media.chelunzhidi'))
+                  }
+                  .alignItems(HorizontalAlign.Start)
+                  .width('100%')
+                  .height('100%')
+                  .margin({ left: '24px' })
+                }
+                .tabBar(this.TabBuilder(2))
+
+                TabContent() {
+                  Column() {
+                    Row() {
+                      Text('当前吊篮位')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .margin({ right: '110px' })
+                      Text('上限位')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                    }
+                    .height('7%')
+                    .width('90%')
+                    .justifyContent(FlexAlign.SpaceBetween)
+                    .alignItems(VerticalAlign.Bottom)
+
+                    Divider().margin({ bottom: '20px' }).width('90%')
+                    this.card('提起', $r('app.media.dianlanshang'))
+                    this.card('放下', $r('app.media.dianlanxia'))
+                    Divider().margin({ bottom: '20px' }).width('90%')
+                    this.card('张开爪夹', $r('app.media.dianlanzhangkai'))
+                    this.card('闭合爪夹', $r('app.media.dianlanbihe'))
+                    Divider().margin({ bottom: '20px' }).width('90%')
+                    this.card('急停', $r('app.media.dianlanjiting'))
+                  }
+                  .alignItems(HorizontalAlign.Start)
+                  .width('100%')
+                  .height('100%')
+                  .margin({ left: '24px' })
+                }
+                .tabBar(this.TabBuilder(3))
+
+                TabContent() {
+                  Column() {
+                    Row() {
+                      Text('当前状态')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .margin({ right: '130px' })
+                        .width('90px')
+                        .height('26px')
+                      Text('充电中')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .width('60px')
+                        .height('26px')
+                    }
+                    .alignItems(VerticalAlign.Bottom)
+                    .width('90%')
+                    .justifyContent(FlexAlign.SpaceBetween)
+                    .height('5%')
+
+                    Divider().width('90%')
+
+                    Row() {
+                      Text('当前电量')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .margin({ right: '130px' })
+                        .width('90px')
+                        .height('26px')
+                      Text('80%')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .width('60px')
+                        .height('26px')
+                    }
+                    .width('90%')
+                    .justifyContent(FlexAlign.SpaceBetween)
+                    .height('26px')
+                    .margin({ top: '20px' })
+
+                    Divider().width('90%')
+                    Row() {
+                      Text('电压')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .margin({ right: '130px' })
+                        .width('90px')
+                        .height('26px')
+                      Text('50V')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .width('60px')
+                        .height('26px')
+                    }
+                    .height('26px')
+                    .margin({ top: '20px' })
+                    .width('90%')
+                    .justifyContent(FlexAlign.SpaceBetween)
+
+                    Divider().width('90%')
+                    Row() {
+                      Text('电流')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .margin({ right: '130px' })
+                        .width('90px')
+                        .height('26px')
+                      Text('10mA')
+                        .fontSize('20px')
+                        .fontWeight(FontWeight.Medium)
+                        .width('60px')
+                        .height('26px')
+                    }
+                    .width('90%')
+                    .justifyContent(FlexAlign.SpaceBetween)
+                    .height('26px')
+                    .margin({ top: '20px' })
+                    Divider().margin({ bottom: '20px' }).width('90%')
+                    this.card('开始充电', $r('app.media.chongdianlianjie'))
+                    this.card('停止充电', $r('app.media.chongdianduankai'))
+                  }
+                  .alignItems(HorizontalAlign.Start)
+                  .width('100%')
+                  .height('100%')
+                  .margin({ left: '24px' })
+                }
+                .tabBar(this.TabBuilder(4))
+
+              }
+              .vertical(true)
+              .onChange((index) => {
+                this.mCurrentPage = index;
+              })
+              .borderRadius($r('app.float.general_border_radius'))
+              .barWidth('30%')
+              .barHeight('100%')
+              .scrollable(false)
+              .barMode(BarMode.Fixed)
+            }
+            .width('100%')
+            .height('90%')
+            .margin({ bottom: '27px', left: '40px' })
+          }
+          .width('100%')
+          .height('95%')
+        }
+        .width('25%')
+        .height('100%')
+
+        Column() {
+          // 机器人预览图片和当前机器人状态
+          Row() {
+            RobotPreviewComp({
+              list: $list,
+              selectRobot: $selectRobot,
+              robots: $robots,
+              robotX: $robotX,
+              robotY: $robotY,
+              robotStorage: $robotStorage,
+              storages: $storages,
+            })
+              .width($r('app.float.robot_image_list_size'))
+            Blank()
+            Row() {
+              Image($r('app.media.robot'))
+                .width($r('app.float.card_image_size'))
+                .height($r('app.float.card_image_size'))
+              Text(this.robots && this.robots[this.selectRobot] && this.robots[this.selectRobot].robotCode ? this.robots[this.selectRobot].robotCode : '')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.general_font_color'))
+                .opacity($r('app.float.general_font_opacity'))
+                .width('40%')
+            }
+            .width('15%')
+            .justifyContent(FlexAlign.SpaceEvenly)
+
+            Row() {
+              Image($r('app.media.battery_level'))
+                .width($r('app.float.card_image_size'))
+                .height($r('app.float.card_image_size'))
+              Text('98%')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.general_font_color'))
+                .opacity($r('app.float.general_font_opacity'))
+            }
+            .width('10%')
+            .justifyContent(FlexAlign.SpaceEvenly)
+
+            Row() {
+              Image($r('app.media.coordinate'))
+                .width($r('app.float.card_image_size'))
+                .height($r('app.float.card_image_size'))
+              Text('x:' + (this.robots && this.robots[this.selectRobot] && this.robots[this.selectRobot].x ? this.robots[this.selectRobot].x : ' ') + 'y:' + (this.robots && this.robots[this.selectRobot] && this.robots[this.selectRobot].y ? this.robots[this.selectRobot].y : ' '))
+                .fontSize($r('app.float.robot_state_font_size'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.general_font_color'))
+                .opacity($r('app.float.general_font_opacity'))
+            }
+            .width('10%')
+            .justifyContent(FlexAlign.SpaceEvenly)
+
+            Row() {
+              Image($r('app.media.robot_auto_mode'))
+                .width($r('app.float.card_image_size'))
+                .height($r('app.float.card_image_size'))
+              Text('自动模式')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.general_font_color'))
+                .opacity($r('app.float.general_font_opacity'))
+            }
+            .width('12%')
+            .justifyContent(FlexAlign.SpaceEvenly)
+          }
+          .width('100%')
+          .height('8%')
+          .justifyContent(FlexAlign.End)
+          .padding({ right: '2%' })
+
+          Row() {
+            SpaceGrid({
+              stateArray: $stateArray,
+              selectSpace: $selectSpace,
+              yNum: $yNum,
+              spaceArray: $spaceArray,
+              robotX: $robotX,
+              robotY: $robotY,
+              robotArmX: $robotArmX,
+              robotArmY: $robotArmY,
+              robotImage: $robotImage,
+            })
+          }
+          .width('100%')
+          .alignItems(VerticalAlign.Center)
+          .layoutWeight(1)
+          .onDragEnter(() => {
+            if (this.selectSpace) {
+              this.stateArray[(this.selectSpace.y?this.selectSpace.y:0)-1][(this.selectSpace.x?this.selectSpace.x:0)-1] -= 3
+            }
+            this.selectSpace = {}
+          })
+          .onClick(()=>{
+            if (this.selectSpace) {
+              this.stateArray[(this.selectSpace.y?this.selectSpace.y:0)-1][(this.selectSpace.x?this.selectSpace.x:0)-1] -= 3
+            }
+            this.selectSpace = {}
+          })
+
+          Row() {
+            Row() {
+              RobotLogComp()
+            }
+            .width('20%')
+            .height('100%')
+          }
+          .width('100%')
+          .height('20%')
+          .justifyContent(FlexAlign.End)
+          .padding({ right: '3%' })
+        }
+        .width('75%')
+        .height('100%')
+      }
+      .backgroundColor('#F1F3F5')
+      .width('100%')
+      .height('92%')
+    }
+    .width('100%')
+    .height('100%')
+  }
+
+  // 动画效果
+  pageTransition() {
+    PageTransitionEnter({ duration: 400, curve: Curve.Linear, delay: 400 })
+      .scale({
+        x: 0,
+        y: 0,
+        z: 0,
+        centerX: '50%',
+        centerY: '50%'
+      })
+    PageTransitionExit({ duration: 400, curve: Curve.Linear })
+      .scale({ x: 0, y: 0, z: 0 })
+  }
+
+  @Builder
+  TabBuilder(index: number) {
+    Column() {
+      Image(NavigationList[index].icon)
+        .width($r('app.float.general_icon_size'))
+        .height($r('app.float.general_icon_size'))
+      Text(NavigationList[index].text)
+        .fontSize($r('app.float.set_card_font_size'))
+        .fontColor($r('app.color.general_font_color'))
+        .opacity($r('app.float.general_font_opacity'))
+        .fontWeight(FontWeight.Medium)
+    }
+    .margin({ left: 10, right: 10 })
+    .backgroundColor(index === this.mCurrentPage ? '#FFFFFF' : '#F1F3F5')
+    .borderRadius($r('app.float.general_border_radius'))
+    .justifyContent(FlexAlign.Center)
+    .opacity(index === this.mCurrentPage ? 1 : 0.6)
+    .width('100%')
+    .height('80%')
+  }
+
+  @Builder
+  card(text: string, icon: Resource) {
+    Row() {
+      Text(text)
+        .fontSize('24px')
+        .fontWeight(FontWeight.Medium)
+        .margin({ left: '26px' })
+      Blank()
+      Image(icon)
+        .width('48px')
+        .height('48px')
+        .margin('20px')
+    }
+    .width('90%')
+    .height('12%')
+    .backgroundColor('#FFFFFF')
+    .alignItems(VerticalAlign.Center)
+    .borderRadius('16px')
+    .margin({ bottom: '20px' })
+  }
+}
+
+@Component
+struct SpaceGrid {
+  @Link stateArray: Array<SpaceStateList>
+  @Link selectSpace: StorageSpace
+  @Link yNum: number[]
+  @Link spaceArray: StorageSpace[][]
+  @Link robotX: number
+  @Link robotY: number
+  @Link robotArmX: number
+  @Link robotArmY: number
+  @Link robotImage: Resource
+
+  scroller: Scroller = new Scroller()
+  build() {
+    Column() {
+      Scroll(this.scroller) {
+        Scroll(this.scroller) {
+            List() {
+              ForEach(this.yNum, (y: number) => {
+                ListItem() {
+                  List() {
+                    ForEach(this.spaceArray[y], (item: StorageSpace) => {
+                      ListItem() {
+                        Stack() {
+                          if (this.robotX && this.robotY && item.x === this.robotX && item.y === this.robotY) {
+                            Image($r('app.media.robot_top'))
+                              .objectFit(ImageFit.Fill)
+                          } else if (this.robotArmX && this.robotArmY && item.x === this.robotArmX && item.y === this.robotArmY) {
+                            Image($r('app.media.robot_arm'))
+                              .objectFit(ImageFit.Fill)
+                          } else {
+                            Image((this.stateArray[y][(item.x?item.x:0)-1] === 1 || this.stateArray[y][(item.x?item.x:0)-1] === 4) ? $r("app.media.storage_space_disable") :
+                              (this.stateArray[y][(item.x?item.x:0)-1] === 2 || this.stateArray[y][(item.x?item.x:0)-1] === 5 ? $r('app.media.storage_space_no_type') : $r("app.media.storage_space")))
+                              .objectFit(ImageFit.Fill)
+                          }
+
+                          if (this.selectSpace && this.selectSpace.id === item.id) {
+                            Image($r('app.media.storage_space_select'))
+                              .objectFit(ImageFit.Auto)
+                          }
+
+                          if (this.selectSpace && this.selectSpace.id === item.id) {
+                            Text(item.x + ':' + item.y)
+                              .fontSize($r('app.float.robot_set_font_size'))
+                              .fontColor($r('app.color.general_font_color'))
+                              .opacity($r('app.float.card_font_default_opacity'))
+                          } else {
+                            Text(item.x + ':' + item.y)
+                              .fontSize($r('app.float.robot_set_font_size'))
+                              .fontColor(item.enableState === 2 ? $r('app.color.robot_set_card_white') : $r('app.color.general_font_color'))
+                              .opacity(item.enableState === 2 ? 1 : $r('app.float.card_font_default_opacity'))
+                          }
+                        }
+                        .width($r('app.float.storage_space_set_size'))
+                        .height($r('app.float.storage_space_set_size'))
+                        .onClick(() => {
+                          if (this.selectSpace) {
+                            this.stateArray[(this.selectSpace.y?this.selectSpace.y:0)-1][(this.selectSpace.y?this.selectSpace.y:0)-1] -= 3
+                          }
+                          this.stateArray[y][(item.x?item.x:0)-1] += 3
+                          this.selectSpace = item
+                        })
+                        .onDragStart(() => {
+                          let isRobotPosition = false
+                          if ((this.robotX && this.robotY && item.x === this.robotX && item.y === this.robotY) || (this.robotArmX && this.robotArmY && item.x === this.robotArmX && item.y === this.robotArmY)) {
+                            isRobotPosition = true
+                          }
+                          if (!isRobotPosition) {
+                            return
+                          }
+                          // 设置拖拽过程中显示的图片
+                          return this.pixelMapBuilder
+                        })
+                        .onDragEnter(() => {
+                          if (this.selectSpace) {
+                            this.stateArray[(this.selectSpace.y?this.selectSpace.y:0)-1][(this.selectSpace.x?this.selectSpace.x:0)-1] -= 3
+                          }
+                          this.stateArray[y][(item.x?item.x:0)-1] += 3
+                          this.selectSpace = item
+                        })
+                      }
+                    })
+                  }
+                  .listDirection(Axis.Horizontal)
+                }
+              })
+            }
+            .alignListItem(ListItemAlign.Center)
+
+            .onDrop((event: DragEvent, extraParams: string) => {
+              console.log('List onDragMove, ' + extraParams + 'X:' + event.getWindowX() + 'Y:' + event.getWindowY())
+            })
+          }
+          .scrollable(ScrollDirection.Horizontal)
+      }
+    }
+    .width('100%')
+    .layoutWeight(1)
+    .justifyContent(FlexAlign.Center)
+    .alignItems(HorizontalAlign.Center)
+  }
+
+  @Builder
+  pixelMapBuilder() {
+    Column() {
+      Image(this.robotImage)
+        .width('262px')
+        .height($r('app.float.storage_space_set_size'))
+    }
+  }
+}

+ 135 - 0
entry/src/main/ets/pages/SetPage.ets

@@ -0,0 +1,135 @@
+import { TitleStateComp } from '../common/component/TitleStateComp';
+import { RobotSetView } from '../view/RobotSetView';
+import { StorageSetView } from '../view/StorageSetView';
+import { AssistantSetView } from '../view/AssistantSetView';
+import { UserInfoSetView } from '../view/UserInfoSetView';
+
+@Entry
+@Component
+struct SetPage {
+  @State userName:string=''
+  @State avatar:string=''
+  controller: TextClockController = new TextClockController()
+  @State selectIndex: number = 1
+
+  build() {
+    Column() {
+      //顶部状态栏组件
+      Stack(){
+        TitleStateComp()
+      }
+
+      Row() {
+        // 设置相关卡片
+        Column() {
+          Row() {
+            Text($r('app.string.title_set'))
+              .fontSize($r('app.float.fontSize_38'))
+              .fontWeight(FontWeight.Medium)
+              .fontColor($r('app.color.general_font_color'))
+              .opacity($r('app.float.general_font_opacity'))
+          }
+          .width('85%')
+          .height('10%')
+
+          SetCardComp({
+            cardImage: $r('app.media.set_storage'),
+            cardName: $r('app.string.set_card_storage'),
+            selectIndex: this.selectIndex,
+            currentIndex: 1
+          })
+          SetCardComp({
+            cardImage: $r('app.media.set_robot'),
+            cardName: $r('app.string.set_card_robot'),
+            selectIndex: this.selectIndex,
+            currentIndex: 2
+          })
+          // SetCardComp({
+          //   cardImage: $r('app.media.set_voice_assistant'),
+          //   cardName: $r('app.string.set_card_ai'),
+          //   selectIndex: this.selectIndex,
+          //   currentIndex: 3
+          // })
+          // SetCardComp({
+          //   cardImage: $r('app.media.set_service_card'),
+          //   cardName: $r('app.string.set_card_service_card'),
+          //   selectIndex: this.selectIndex,
+          //   currentIndex: 4
+          // })
+          SetCardComp({
+            cardImage: $r('app.media.set_user_info'),
+            cardName: $r('app.string.set_card_user_info'),
+            selectIndex: this.selectIndex,
+            currentIndex: 5
+          })
+        }
+        .width(px2vp(498))
+        .height('100%')
+
+        Column() {
+          if (this.selectIndex === 1) {
+            StorageSetView()
+          } else if (this.selectIndex === 2) {
+            RobotSetView()
+          } else if (this.selectIndex === 3) {
+            AssistantSetView()
+          } else if (this.selectIndex === 5) {
+            UserInfoSetView()
+          }
+        }
+        .height('100%')
+        .layoutWeight(1)
+        .margin({ right: '1.6%' })
+      }
+      .width('100%')
+      .height('92%')
+    }
+    .height(px2vp(1080))
+    .width(px2vp(1920))
+    .backgroundColor($r('app.color.page_general_background'))
+  }
+
+  // 动画效果
+  pageTransition() {
+    PageTransitionEnter({ duration: 400, curve: Curve.Linear ,delay:400})
+      .scale({x:0,y:0,z:0,centerX:'50%',centerY:'50%'})
+    PageTransitionExit({ duration: 400, curve: Curve.Linear})
+      .scale({x:0,y:0,z:0})
+  }
+}
+
+@Component
+struct SetCardComp {
+  cardImage: Resource | undefined=undefined
+  cardName: Resource| undefined=undefined
+  @Link selectIndex: number
+  currentIndex: number=0
+
+  build() {
+    Stack() {
+      Text()
+        .width('100%')
+        .height('100%')
+        .backgroundColor($r('app.color.general_card_background_color'))
+        .opacity(this.selectIndex === this.currentIndex ? 1 : 0)
+        .borderRadius($r('app.float.general_border_radius'))
+      Row({ space: 5 }) {
+        Image(this.cardImage)
+          .height($r('app.float.general_icon_size'))
+          .width($r('app.float.general_icon_size'))
+        Text(this.cardName)
+          .fontSize($r('app.float.fontSize_24'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.black_60'))
+      }
+      .width('100%')
+      .opacity(this.selectIndex === this.currentIndex ? $r('app.float.card_font_select_opacity') : $r('app.float.card_font_default_opacity'))
+      .padding({left:'7%'})
+    }
+    .width('85%')
+    .height('10%')
+    .onClick(() => {
+      this.selectIndex = this.currentIndex
+    })
+  }
+}

File diff suppressed because it is too large
+ 1610 - 0
entry/src/main/ets/pages/SmartFactory.ets


+ 391 - 0
entry/src/main/ets/pages/Storage.ets

@@ -0,0 +1,391 @@
+import { TitleStateComp } from '../common/component/TitleStateComp';
+import {IntelligentWarehousingOutbound, SelectMaterialslist}from '../view/IntelligentWarehousingOutbound'
+import  {Statistics}from '../view/Statistics'
+import {IntelligentStorageWarehousing }from '../view/IntelligentStorageWarehousing'
+import {OtherStorageOutbound}from '../view/OtherStorageOutbound'
+import {OtherWarehousing}from '../view/OtherWarehousing'
+import { OtherStatistics } from '../view/OtherStatistics';
+import taskSheetInformation from '../model/TaskSheetInformation';
+
+export interface class1{
+  choicePages?:number
+}
+export interface ScanStorageclass {
+  //改变的数量
+  exchangeNumber?:number
+  label?:string
+  //订单编号
+  taskId:string
+  //批次号
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:string
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+  batchCode?:string
+}
+export interface ScanStoragecodeclass {
+  //批次号
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:string
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+  batchCode?:string
+}
+@Entry
+@Component
+struct Storage {
+  @State choicePages:class1={}
+  @State userName:string=''
+  @State avatar:string=''
+  @State primaryKeyId:string=''
+  @State textValue: string = ''
+  @State inputValue: string = ''
+  scroller: Scroller = new Scroller()
+  @State CangKu:number=0
+  @State CunQuHuo:number=0
+  @State ChuRukun:number=0
+  @State ZhuangTai:number=0
+  @State private ScanStoragecodelist:Array<ScanStoragecodeclass>=[]
+  @State private scanStorageList:Array<ScanStorageclass>=[]
+  @State private SelectMaterial:Array<taskSheetInformation>=[]
+  private isHomePage:boolean = false
+  build() {
+    Row() {
+      Column() {
+        TitleStateComp({isHomePage : this.isHomePage})
+        Column(){
+          //选中
+          Row(){
+            Row({space:10}){
+              Stack(){
+                Row(){
+
+                }.width('100%')
+                .height('100%')
+                if(this.CangKu===0){
+                  Row(){
+                   Text('智能仓储')
+                     .textAlign(TextAlign.Center)
+                      .width('50%')
+                      .fontSize('32px')
+                      .height('100%')
+                      .fontWeight(FontWeight.Medium)
+                      .fontColor('#e6000000')
+                      .borderRadius(15)
+                      .backgroundColor('#FFFFFF')
+                      .onClick(()=>{
+                        this.CangKu=0
+                      })
+                    Text('其他仓储')
+                      .width('50%')
+                      .textAlign(TextAlign.Center)
+                      .border({width:0})
+                      .fontSize('32px')
+                      .height('100%')
+                      .fontWeight(FontWeight.Medium)
+                      .borderRadius(15)
+
+                      .fontColor('#e6000000')
+                      .onClick(()=>{
+                        this.CangKu=1
+                      })
+                  }.width('100%')
+                  .height('100%')
+                  .borderRadius(15)
+                }else if(this.CangKu===1){
+                  Row(){
+                    Text('智能仓储')
+                      .textAlign(TextAlign.Center)
+                      .width('50%')
+                      .fontSize('32px')
+                      .fontWeight(FontWeight.Medium)
+                      .height('100%')
+                      .fontColor('#e6000000')
+                      .borderRadius(15)
+                      .onClick(()=>{
+                        this.CangKu=0
+                      })
+                    Text('其他仓储')
+                      .width('50%')
+                      .textAlign(TextAlign.Center)
+                      .border({width:0})
+                      .height('100%')
+                      .fontWeight(FontWeight.Medium)
+                      .fontSize('32px')
+                      .borderRadius(15)
+                      .backgroundColor('#FFFFFF')
+                      .fontColor('#e6000000')
+                      .onClick(()=>{
+                        this.CangKu=1
+                      })
+                  }.width('100%')
+                  .height('100%')
+                  .borderRadius(15)
+                }
+              }.width('30%')
+              .height('80%')
+              .borderRadius(15)
+              .backgroundColor('#1a000000')
+              .margin({left:10})
+          }
+            Blank()
+            Stack(){
+              Row(){
+              }.width('100%')
+              .height('100%')
+              .backgroundColor('#1a000000')
+              .borderRadius(15)
+              if(this.ChuRukun===0){
+                Row(){
+                  Text('入库')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .height('100%')
+                    .fontSize('32px')
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor('#e6000000')
+                    .borderRadius(15)
+                    .onClick(()=>{
+                      this.ChuRukun=1
+                    })
+                  Text('出库')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .fontSize('32px')
+                    .border({width:0})
+                    .fontWeight(FontWeight.Medium)
+                    .height('100%')
+                    .borderRadius(15)
+                    .backgroundColor('#FFFFFF')
+                    .fontColor('#e6000000')
+                    .onClick(()=>{
+                      this.ChuRukun=0
+                    })
+                  Text('统计')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .fontWeight(FontWeight.Medium)
+                    .fontSize('32px')
+                    .border({width:0})
+                    .height('100%')
+                    .borderRadius(15)
+                    .fontColor('#e6000000')
+                    .onClick(()=>{
+                      this.ChuRukun=2
+                    })
+                }.width('100%')
+                .height('100%')
+                .borderRadius(15)
+              }else if(this.ChuRukun===1){
+                Row(){
+                  Text('入库')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .height('100%')
+                    .fontSize('32px')
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor('#e6000000')
+                    .borderRadius(15)
+                    .backgroundColor('#FFFFFF')
+                    .onClick(()=>{
+                      this.ChuRukun=1
+                    })
+                  Text('出库')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .border({width:0})
+                    .height('100%')
+                    .fontSize('32px')
+                    .borderRadius(15)
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor('#e6000000')
+                    .onClick(()=>{
+                      this.ChuRukun=0
+                    })
+                  Text('统计')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .fontSize('32px')
+                    .fontWeight(FontWeight.Medium)
+                    .border({width:0})
+                    .height('100%')
+                    .borderRadius(15)
+
+                    .fontColor('#e6000000')
+                    .onClick(()=>{
+                      this.ChuRukun=2
+                    })
+
+                }.width('100%')
+                .height('100%')
+                .borderRadius(15)
+              }else if (this.ChuRukun===2){
+                Row(){
+                  Text('入库')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .fontWeight(FontWeight.Medium)
+                    .height('100%')
+                    .fontSize('32px')
+                    .fontColor('#e6000000')
+                    .borderRadius(15)
+                    .onClick(()=>{
+                      this.ChuRukun=1
+                    })
+                  Text('出库')
+                    .textAlign(TextAlign.Center)
+                    .width('33%')
+                    .fontSize('32px')
+                    .border({width:0})
+                    .height('100%')
+                    .fontWeight(FontWeight.Medium)
+                    .borderRadius(15)
+                    .fontColor('#e6000000')
+                    .onClick(()=>{
+                      this.ChuRukun=0
+                    })
+                  Text('统计')
+                    .textAlign(TextAlign.Center)
+                    .width('34%')
+                    .border({width:0})
+                    .height('100%')
+                    .fontWeight(FontWeight.Medium)
+                    .fontSize('32px')
+                    .borderRadius(15)
+                    .backgroundColor('#FFFFFF')
+                    .fontColor('#e6000000')
+                    .onClick(()=>{
+                      this.ChuRukun=2
+                    })
+
+                }.width('100%')
+                .height('100%')
+                .borderRadius(15)
+              }
+            }.width('45%')
+            .height('80%')
+            .borderRadius(15)
+
+            Blank()
+          }.width('100%')
+          .height('10%')
+          Row({space:15}){
+            //仓储3D位置
+            if (this.ChuRukun===0&&this.CangKu===0){
+              //出库
+              IntelligentWarehousingOutbound({scanStorageList:this.scanStorageList,SelectMaterial:this.SelectMaterial,primaryKeyId:this.primaryKeyId })
+            }else if (this.ChuRukun===1&&this.CangKu===0){
+              //入库
+              IntelligentStorageWarehousing({ScanStoragelist:this.ScanStoragecodelist})
+            }else if (this.ChuRukun===2&&this.CangKu===0){
+              //智能仓储统计
+              Statistics()
+              // Statistics({ useNum:this.useNum,canUsedNum:this.canUsedNum,
+              //   allNum:this.allNum, emptyBoxNum:this.emptyBoxNum})
+            }else if (this.ChuRukun===0&&this.CangKu===1){
+              OtherStorageOutbound()
+            }else if (this.ChuRukun===1&&this.CangKu===1){
+              OtherWarehousing()
+            }else if (this.ChuRukun===2&&this.CangKu===1){
+              OtherStatistics()
+            }
+          }.width('100%')
+          .height('90%')
+
+        }
+        .width('100%')
+        .height('92%')
+      }
+      .width('100%')
+      .backgroundColor('#F1F3F5')
+      .width('100%')
+    }
+    .height('100%')
+    .width('100%')
+  }
+}

+ 31 - 0
entry/src/main/ets/pages/TestComponentPage.ets

@@ -0,0 +1,31 @@
+
+@Entry
+@Component
+struct WebComponent {
+
+  @State isEnabled: boolean = false
+  @State text1: string = '2'
+  aboutToAppear() {
+    console.log('testTag', 'font====80--'+px2fp(19));
+    console.log('testTag', 'font====51--'+px2fp(51));
+    console.log('testTag', 'font====32--'+px2fp(32));
+    console.log('testTag', 'font====27--'+px2fp(27));
+    console.log('testTag', 'font====61--'+px2vp(61));
+
+
+    console.log('testTag', 'size====54--'+px2vp(54));
+    console.log('testTag', 'size====13--'+px2vp(13));
+    console.log('testTag', 'size====64--'+px2vp(64));
+    console.log('testTag', 'size====104--'+px2vp(104));
+    console.log('testTag', 'size====91--'+px2vp(91));
+  }
+
+  // HUAWEI MatePad Pro 11英寸 2024款
+  // 分辨率 2560 x 1600
+  // 274 PPI
+  build() {
+
+    Column({space: '20px'}) {
+    }.width('100%').height('100%') //.width('2560px')
+  }
+}

+ 51 - 0
entry/src/main/ets/pages/TestComponentPage1.ets

@@ -0,0 +1,51 @@
+import web_webview from '@ohos.web.webview';
+import business_error from '@ohos.base';
+class TestObj {
+  constructor() {
+  }
+  test(data1: string, data2: string, data3: string): string {
+    console.log("data1:" + data1)
+    console.log("data2:" + data2)
+    console.log("data3:" + data3)
+    return "AceString"
+  }
+
+  toString(): void {
+    console.log('toString' + "interface instead.")
+  }
+}
+
+// xxx.ets
+@Entry
+@Component
+struct AlertDialogExample {
+  controller: web_webview.WebviewController = new web_webview.WebviewController()
+  webviewController: web_webview.WebviewController = new web_webview.WebviewController();
+  testObj = new TestObj();
+  build() {
+    Column({ space: 5 }) {
+      Button('loadUrl')
+        .onClick(() => {
+          try {
+
+            // 点击按钮时,通过loadUrl,跳转到www.example1.com
+            this.webviewController.loadUrl('http://apm.jgiot.com:7012/login#/quality/traceability', );
+          } catch (error) {
+            let e: business_error.BusinessError = error as business_error.BusinessError;
+            console.error(`ErrorCode: ${e.code},  Message: ${e.message}`);
+          }
+        })
+      // 组件创建时,加载www.example.com
+      Web({ src: 'www.example.com', controller: this.webviewController})
+        .javaScriptProxy({
+          object: this.testObj,
+          name: "objName",
+          methodList: ["test", "toString"],
+          controller: this.controller,
+        })
+    }
+    .width('100%')
+    .height('100%')
+    .margin({ top: 5 })
+  }
+}

+ 584 - 0
entry/src/main/ets/pages/WarehouseMap.ets

@@ -0,0 +1,584 @@
+import EquipmentRequest from '../common/util/request/EquipmentRequest'
+import StorageRequest from '../common/util/request/StorageRequest'
+import RequestParamModel from '../viewmodel/RequestParamModel'
+export class  routerClass{
+  xRoute?:number
+  YRoute?:number
+}
+export class  routerHttp{
+  XCoordinateIn?:number
+  YCoordinateIn?:number
+}
+
+@Entry
+@Component
+export struct WarehouseMap {
+  //车的位置请求返回数据
+  @State CarPosition: Array<carPositionClass> =[]
+  @State rgvNo:string='rgv1'
+  @State route:routerClass[]=[
+    {xRoute:10,YRoute:9},
+  {xRoute:10,YRoute:9},
+{xRoute:10,YRoute:10},
+{xRoute:9,YRoute:10},
+{xRoute:8,YRoute:10},
+  ]
+  @State routeIndex:number=0
+  //路径开关
+  @State routeIndexSwitch:number=0
+  //选择层数颜色
+  @State selectColor:number=-1
+  //调入svg
+  @State enterSvg:number=0
+  //调出svg
+  @State outSvg:number=0
+  @State selectSvg:number=0
+  //车坐标
+  @State carYCoordinate:number=10
+  @State carXCoordinate:number=10
+  @State carYCoordinate1:number=8
+  @State carXCoordinate1:number=9
+  //调入xy坐标
+  @State YCoordinateIn:number=0
+  @State XCoordinateIn:number=0
+  //调出xy坐标
+  @State YCoordinate:number=0
+  @State XCoordinate:number=0
+  //调入格子
+  @State SelectEnter:number=0
+  //调出格子
+  @State SelectOut:number=0
+  @State boxNumber:number=0
+  @State JobHopping:number=0
+  scroller: Scroller = new Scroller()
+  //选择的第几层
+  @State selectStorey:number=-1
+  //选调出格子有多少层
+  @State storeyNumber:number=-1
+  @State private  storey:number[]=[6,5,4,3,2,1]
+ @State private  YAxis:number[]=[1,2,3,4,5,6,7,8,9,10,11,12,13]
+  @State private  XAxis:number[]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
+  @State private  XYxis:number[][]=[
+  [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,6,0,6,6],
+  [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,6,0,6,6],
+  [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [-1,-1,-1,-1,-1,-1,-1,0,0,0,6,6,6,0,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [-1,-1,-1,-1,-1,-1,-1,0,6,0,6,5,6,0,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [-1,-1,-1,-1,-1,6,6,6,6,6,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [-1,-1,-1,-1,-1,6,6,6,6,6,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [-1,0,0,0,0,6,6,6,6,6,6,3,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [-1,-1,-1,-1,-1,6,6,6,6,6,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [-1,-1,-1,-1,-1,6,6,6,6,5,6,6,6,6,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [0,0,0,-1,-1,6,6,6,2,6,6,6,6,3,6,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+  [0,0,0,0,0,6,6,6,6,6,6,6,6,6,4,6,0,-1,-1,-1,-1,-1,-1,-1,-1],
+    [0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]
+  ]
+  @State yNum:number[]=[1,2,3,4,5,6,7,8,9,10,11,12,13]
+  //提示弹窗
+  promptsController: CustomDialogController = new CustomDialogController({
+    builder:prompt({
+      JobHopping:this.JobHopping
+
+    }),
+    alignment: DialogAlignment.Center,
+    gridCount: 4,
+    customStyle: true,
+  })
+  //硬件调仓操作
+  AdjustmentHttp= async() : Promise<Adjustment[]> => {
+    let res:Adjustment[] = await EquipmentRequest.post("/api/v1/wcs/box/movMultiple",
+      //todo 坐标加1,二维数组索引从零开始
+      {
+        //目标位置
+        dest:(this.XCoordinateIn+1)+'-'+(this.YCoordinateIn+1),
+        //移动位置
+        src:(this.XCoordinate+1)+'-'+(this.YCoordinate+1),
+        //todo 数量暂时写死1
+        num:1
+    }as RequestParamModel)
+    //
+    console.log('textTag', 'post请求结果' +JSON.stringify(res)
+    );
+    return res
+  }
+  Adjustment= async() : Promise<Adjustment[]> => {
+    let res:Adjustment[] = await EquipmentRequest.get("/api/v1/wcs/rgvs/",
+      {
+        // destx:this.XCoordinateIn,
+        // destY:this.YCoordinateIn,
+        // rgvNo:'rgvNo1'
+      })
+    console.log('textTag', 'get请求结果' +JSON.stringify(res));
+    return res
+  }
+  //请求车的位置
+  CarPositionHttp= async() : Promise<carPositionClass> => {
+  let res: carPositionClass= await EquipmentRequest.get("/api/v1/wcs/rgv/" + this.rgvNo, {
+  }) as carPositionClass
+    if (res!==undefined&&res.data!==undefined){
+      this.carYCoordinate=res.data.y!
+      this.carXCoordinate=res.data.x!
+    }
+    console.log('textTag', '----------' + JSON.stringify(res));
+    console.log('textTag', '----------' + JSON.stringify(this.carYCoordinate));
+    console.log('textTag', '----------' + JSON.stringify(this.carXCoordinate));
+  return res
+  }
+  aboutToAppear(): void {
+    this.CarPositionHttp().then((res:carPositionClass)=> {
+
+      console.log('textTag', '-------car现在的位置执行情况结果 cccccc11' + JSON.stringify(res))
+    })
+
+  }
+  build() {
+    Row() {
+      Column(){
+        Button(this.JobHopping===0?'启动调仓':'停止调仓', { type: ButtonType.Normal, stateEffect: true })
+          .borderRadius(8)
+          .borderRadius(px2vp(76))
+          .backgroundColor(this.JobHopping===0?$r('app.color.blue_100'):$r('app.color.red_100'))
+          .width(px2vp(292))
+          .height(px2vp(80))
+          .onClick(()=>{
+            if (this.JobHopping===0) {
+              this.promptsController.open()
+            }else  if (this.JobHopping===1) {
+              this.JobHopping=0
+            }
+          })
+        Blank()
+        if (this.storeyNumber!==-1){
+          Text('层数')
+            .fontSize($r('app.float.fontSize_24'))
+            .fontWeight(FontWeight.Medium)
+            .textAlign(TextAlign.Center)
+            .width(px2vp(292))
+            .height(px2vp(80))
+          List({space:px2vp(20)}){
+            ForEach(this.storey, (item:number,index:number) => {
+              ListItem(){
+                Text(item.toString())
+                  .width(px2vp(291))
+                  .height(px2vp(80))
+                  .fontColor($r('app.color.black_100'))
+                  .textAlign(TextAlign.Center)
+                  .border({width:px2vp(1)})
+                  .backgroundColor((index===(this.selectStorey-1))?$r('app.color.red_100'):index>=(6-this.storeyNumber)?$r('app.color.green_100'):$r('app.color.white_f1f3f5'))
+                  .borderRadius(px2vp(16))
+                  .onClick(()=>{
+                    if (index>=(6-this.storeyNumber)) {
+                      this.selectStorey=index+1
+                      console.log('textTag'+'选择第几层的料箱'+this.selectStorey)
+                    }
+                  })
+              }
+            })
+          }
+          .scrollBar(BarState.Off)
+          .width(px2vp(292))
+          .height(px2vp(600))
+        }
+
+      }.width(px2vp(292))
+      .height(px2vp(800))
+      .margin({right:px2vp(24)})
+
+      Column() {
+        Row(){
+          Column(){
+            Text('y')
+              .width(px2vp(25))
+              .height(px2vp(25))
+              .fontColor($r('app.color.order_producing_state_background'))
+              .textAlign(TextAlign.Center)
+          }
+          .width(px2vp(25))
+          .height(px2vp(55))
+          .justifyContent(FlexAlign.End)
+          Column(){
+            Text('x')
+              .width(px2vp(25))
+              .height(px2vp(25))
+              .fontColor($r('app.color.order_producing_state_background'))
+              .textAlign(TextAlign.Center)
+          }
+          .width(px2vp(25))
+          .height(px2vp(55))
+          .justifyContent(FlexAlign.Start)
+        }
+        .width(px2vp(50))
+        .height(px2vp(55))
+        List({space:px2vp(1)}){
+          ForEach(this.YAxis, (item:number,index:number) => {
+            ListItem(){
+              Text(item.toString())
+                .width(px2vp(55))
+                .height(px2vp(55))
+                .fontColor($r('app.color.black_10'))
+                .textAlign(TextAlign.Center)
+
+            }
+          })
+        }
+        .scrollBar(BarState.Off)
+        .width(px2vp(60))
+        .height(px2vp(745))
+      }
+      .width(px2vp(60))
+      .height(px2vp(800))
+      Scroll(this.scroller){
+        Column(){
+          List({space:px2vp(1)}){
+            ForEach(this.XAxis, (item:number,index:number) => {
+              ListItem(){
+                Text(item.toString())
+                  .width(px2vp(55))
+                  .height(px2vp(55))
+                  .fontColor($r('app.color.black_10'))
+                  .textAlign(TextAlign.Center)
+
+              }
+            })
+          }
+          .listDirection(Axis.Horizontal)
+          .scrollBar(BarState.Off)
+          .width(px2vp(2000))
+          .height(px2vp(55))
+          List({space:px2vp(1)}) {
+            ForEach(this.XYxis, (y: number[],index1:number) => {
+              ListItem() {
+                List({space:px2vp(1)}) {
+                  ForEach(y, (x: number,index2:number) => {
+                    ListItem() {
+                      if (x>=0) {
+                        Stack(){
+                          Text(x===0?'':x.toString())
+                            .width(px2vp(55))
+                            .height(px2vp(55))
+                            .fontColor($r('app.color.blue_100'))
+                            .textAlign(TextAlign.Center)
+                            .border({width:px2vp(1),color:'#7DC8EA'})
+                            .backgroundColor(((index1===4
+                              &&index2===7)||(index1===3&&index2===7)||(index1===3&&index2===9)||(index1===4&&index2===9)||(index1===4&&index2===13)||(index1===3&&index2===13))?'#E84026 ':x===0?$r('app.color.white_f1f3f5'):(this.SelectOut===1||this.SelectEnter===1)?$r('app.color.green_100'):'')
+                          if (this.routeIndexSwitch===1){
+                            //for (let num = 0; num < this.route.length; num++) {
+                              Text()
+                                .width(px2vp(55))
+                                .height(px2vp(55))
+                                .fontColor($r('app.color.black_100'))
+                                .textAlign(TextAlign.Center)
+                              //  .backgroundColor((index1===this.route[this.routeIndex].YRoute&&index2===this.route[this.routeIndex].xRoute)?$r('app.color.green_100'):'')
+                           // }
+
+                          }
+
+                          Row(){
+                            Image((index1===this.carYCoordinate&&index2===this.carXCoordinate)?$r('app.media.robot_top'):(index1===this.carYCoordinate&&index2===this.carXCoordinate+1)?$r("app.media.robot_arm"):(index1===this.carYCoordinate1&&index2===this.carXCoordinate1)?$r('app.media.car_top'):(index1===this.carYCoordinate1&&index2===this.carXCoordinate1-1)?$r('app.media.car_bottom'):'')
+                              .width(px2vp(55))
+                              .height(px2vp(55))
+                              .margin({right:px2vp(55)})
+                              .onClick(()=>{
+                                if (x!==-1&&this.SelectOut===1) {
+                                  this.YCoordinate=index1
+                                  this.XCoordinate=index2
+                                  this.SelectOut=2
+                                  this.SelectEnter=3
+                                  this.outSvg=1
+                                  this.storeyNumber=x
+                                  console.log('textTag'+'调出坐标'+this.YCoordinate+ this.XCoordinate)
+                                }
+                              })
+                          }
+                          .justifyContent(FlexAlign.End)
+                          .width(px2vp(55))
+                          .height(px2vp(55))
+
+                          if ((this.outSvg===1)){
+                            Image(((index1===this.YCoordinate&&index2===this.XCoordinate))?$r('app.media.Retrieve_grid'):'')
+                              .width(px2vp(55))
+                              .height(px2vp(55))
+                              .onClick(()=>{
+                                if (x!==-1&&this.SelectEnter===1&&this.SelectOut===2){
+                                  this.YCoordinateIn=index1
+                                  this.XCoordinateIn=index2
+                                  this.SelectEnter=2
+                                  this.enterSvg=1
+                                  console.log('textTag'+'调入坐标'+this.YCoordinateIn+ this.XCoordinateIn)
+                                }
+                              })
+                          }
+                          if (this.enterSvg===1){
+                            Image((((index1===this.YCoordinateIn&&index2===this.XCoordinateIn)))?$r('app.media.Transfer_grid'):'')
+                              .width(px2vp(55))
+                              .height(px2vp(55))
+
+                          }
+                        }
+
+                      }else {
+                        Text()
+                          .width(px2vp(55))
+                          .height(px2vp(55))
+                          .fontColor($r('app.color.black_100'))
+                          .textAlign(TextAlign.Center)
+                      }
+                    }
+                  })
+                }
+                .listDirection(Axis.Horizontal)
+              }
+            })
+          }
+          .scrollBar(BarState.Off)
+        }.width(px2vp(2000))
+        .height(px2vp(800))
+
+
+      }
+      .width(px2vp(1020))
+      .height(px2vp(800))
+      .scrollable(ScrollDirection.Horizontal) // 滚动方向纵向
+      if (this.JobHopping===1){
+        Column(){
+          Column(){
+            Row(){
+              Text('调出料格')
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.black_100'))
+                .fontSize($r('app.float.fontSize_24'))
+                .width(px2vp(410))
+                .textAlign(TextAlign.Start)
+            }
+
+            Blank()
+            Button(this.SelectOut===2?'取消选择':'选调出料格', { type: ButtonType.Normal, stateEffect: true })
+              .borderRadius(8)
+              .backgroundColor(this.SelectOut===2?$r('app.color.red_100'):$r('app.color.blue_100'))
+              .width(px2vp(292))
+              .borderRadius(px2vp(76))
+              .height(px2vp(80))
+              .onClick(()=>{
+                if (this.SelectOut===0||this.SelectOut===2) {
+                  this.SelectOut=1
+                  this.YCoordinate=0
+                  this.XCoordinate=0
+                  this.outSvg=0
+                  this.enterSvg=0
+                }
+                console.log('textTag'+'-----'+this.SelectOut)
+              })
+            Blank()
+
+          }.width(px2vp(450))
+          .height(px2vp(188))
+          .padding(px2vp(20))
+          .alignItems(HorizontalAlign.Center)
+          .borderRadius(px2vp(16))
+          .backgroundColor($r('app.color.black_10'))
+          .margin({bottom:px2vp(48)})
+          Column(){
+            Text('调入料格')
+              .fontWeight(FontWeight.Medium)
+              .fontColor($r('app.color.black_100'))
+              .fontSize($r('app.float.fontSize_24'))
+              .width(px2vp(410))
+              .textAlign(TextAlign.Start)
+            Blank()
+            Button(this.SelectEnter===2?'取消选择':'选调入料格', { type: ButtonType.Normal, stateEffect: true })
+              .borderRadius(8)
+              .backgroundColor(this.SelectEnter===3?$r('app.color.blue_100'):this.SelectEnter===2?$r('app.color.red_100'):$r('app.color.blue_20'))
+              .width(px2vp(292))
+              .height(px2vp(80))
+              .borderRadius(px2vp(76))
+              .onClick(()=>{
+                if (this.SelectEnter===3) {
+                  this.SelectEnter=1
+                  console.log('textTag'+'-----'+this.SelectEnter)
+                }else if (this.SelectEnter===2){
+                  this.SelectEnter=1
+                  //this.outSvg=0
+                  this.enterSvg=0
+                  this.XCoordinateIn=0
+                  this.YCoordinateIn=0
+                }
+              })
+            Blank()
+
+          }.width(px2vp(450))
+          .height(px2vp(188))
+          .padding(px2vp(20))
+          .alignItems(HorizontalAlign.Center)
+          .borderRadius(px2vp(16))
+          .backgroundColor($r('app.color.black_10'))
+          .margin({bottom:px2vp(48)})
+          Column(){
+            Text('调箱数量')
+              .fontWeight(FontWeight.Medium)
+              .fontColor($r('app.color.black_100'))
+              .fontSize($r('app.float.fontSize_24'))
+              .width(px2vp(410))
+              .textAlign(TextAlign.Start)
+            Row(){
+              Text('调动箱数')
+                .fontWeight(FontWeight.Regular)
+                .fontColor($r('app.color.black_60'))
+                .fontSize($r('app.float.fontSize_20'))
+                .width(px2vp(150))
+                .textAlign(TextAlign.Start)
+              Text('最大[6]')
+                .fontWeight(FontWeight.Regular)
+                .fontColor($r('app.color.black_60'))
+                .fontSize($r('app.float.fontSize_20'))
+                .width(px2vp(150))
+                .textAlign(TextAlign.End)
+              }.width(px2vp(300))
+              .height(px2vp(30))
+            Blank()
+           Row(){
+             Image($r('app.media.add_disabled'))
+               .width(px2vp(50))
+               .height(px2vp(50))
+               .onClick(()=>{
+                 if (this.boxNumber<6) {
+                   this.boxNumber++
+                 }
+
+               })
+             Text(this.boxNumber.toString())
+               .fontWeight(FontWeight.Medium)
+               .fontColor($r('app.color.black_100'))
+               .fontSize($r('app.float.fontSize_24'))
+               .width(px2vp(80))
+               .textAlign(TextAlign.Center)
+
+             Image($r('app.media.subtract_disabled'))
+               .width(px2vp(50))
+               .height(px2vp(50))
+               .onClick(()=>{
+                 if (this.boxNumber>0) {
+                   this.boxNumber--
+                 }
+
+               })
+           }.width(px2vp(450))
+           .height(px2vp(80))
+           .justifyContent(FlexAlign.Center)
+            Blank()
+
+          }.width(px2vp(450))
+          .height(px2vp(188))
+          .padding(px2vp(20))
+          .alignItems(HorizontalAlign.Center)
+          .borderRadius(px2vp(16))
+          .backgroundColor($r('app.color.black_10'))
+          .margin({bottom:px2vp(48)})
+          Button('确认调仓', { type: ButtonType.Normal, stateEffect: true })
+            .borderRadius(8)
+            .backgroundColor(this.SelectEnter===2?$r('app.color.blue_100'):$r('app.color.blue_20'))
+            .width(px2vp(292))
+            .height(px2vp(80))
+            .borderRadius(px2vp(76))
+            .onClick(()=>{
+              // this.Adjustment().then((res:Adjustment[])=> {
+              //   console.log('textTag', '-------执行情况结果 cccccc11' + JSON.stringify(res))
+              // })
+              for (let index = 0; index < this.route.length; index++) {
+                this.routeIndex = index
+              }
+              this.routeIndexSwitch=1
+              this.enterSvg=0
+              this.SelectEnter=0
+              this.SelectOut=0
+              this.storeyNumber=-1
+              this.outSvg=0
+                this.AdjustmentHttp().then((res:Adjustment[])=> {
+                  console.log('textTag', '-------执行情况结果 cccccc111111' + JSON.stringify(res))
+                })
+
+
+            })
+
+
+
+        }.width(px2vp(450))
+        .height(px2vp(800))
+        .margin({left:px2vp(24)})
+      }else if (this.JobHopping===1){
+
+      }
+
+    }
+    .width(px2vp(1920))
+    .height(px2vp(800))
+    .padding({left:px2vp(24),right:px2vp(24)})
+    .margin({top:px2vp(20)})
+  }
+}
+@CustomDialog
+  ///无批次号物料详情弹窗
+struct prompt {
+  @Link JobHopping:number
+  controller: CustomDialogController
+  build() {
+    Column({space:px2vp(50)}){
+      Text('调仓确认')
+        .fontSize($r('app.float.fontSize_50'))
+        .fontWeight(FontWeight.Medium)
+        .fontColor($r('app.color.black_100'))
+        .textAlign(TextAlign.Center)
+        .width(px2vp(400))
+        .margin({top:px2vp(30)})
+      Text('启动调仓后,其他工位将无法叫料,是否开始?')
+        .fontSize($r('app.float.fontSize_24'))
+        .fontWeight(FontWeight.Medium)
+        .fontColor($r('app.color.black_100'))
+        .textAlign(TextAlign.Center)
+        .width(px2vp(400))
+      Row(){
+        Button('取消', { type: ButtonType.Normal, stateEffect: true })
+          .borderRadius(8)
+          .backgroundColor($r('app.color.blue_100'))
+          .width(px2vp(252))
+          .height(px2vp(69))
+          .borderRadius(px2vp(76))
+          .onClick(()=>{
+            this.controller.close()
+          })
+        Blank()
+        Button('确认', { type: ButtonType.Normal, stateEffect: true })
+          .borderRadius(8)
+          .backgroundColor($r('app.color.blue_100'))
+          .width(px2vp(252))
+          .height(px2vp(69))
+          .borderRadius(px2vp(76))
+          .onClick(()=>{
+            this.JobHopping=1
+            this.controller.close()
+          })
+      }.width(px2vp(600))
+      .padding({left:px2vp(30),right:px2vp(30)})
+
+    }.width(px2vp(800))
+    .height(px2vp(400))
+    .backgroundColor($r('app.color.white_f1f3f5'))
+    .borderRadius(16)
+  }
+}
+export class
+Adjustment{
+  destx?:string
+  code?:string
+  msg?:string
+  cmdId?:string
+  state?:string
+}
+export class carPositionClass{
+  code?:string
+  message?:string
+  data?:dataClass
+}
+export class dataClass{
+  x?: number
+  y?: number
+}

+ 309 - 0
entry/src/main/ets/pages/Warehousing.ets

@@ -0,0 +1,309 @@
+import { TitleStateComp } from '../common/component/TitleStateComp'
+import EquipmentRequest from '../common/util/request/EquipmentRequest'
+import StorageRequest from '../common/util/request/StorageRequest'
+import { MaterialInformationList } from '../model/MaterialInformation'
+import { boxMaterialClass, controlClass } from '../view/CompleteSet'
+import { IntelligentWarehousingGo, stat1 } from '../view/IntelligentWarehousingGo'
+import { ManualWarehousing } from '../view/ManualWarehousing'
+import { Statistics } from '../view/Statistics'
+import RequestParamModel from '../viewmodel/RequestParamModel'
+import { ScanStorageclass } from './Storage'
+
+@Entry
+@Component
+struct Warehousing{
+  @State private controlList: Array<controlClass> = []
+  //工序id
+  @State orderId:string=''
+  //自动入库开关
+  @State automaticWarehousing:number=0
+  //有无违禁品
+  @State contraband:number=0
+  //料箱等级(类型)
+  @State vehicleLevel:string=''
+  //暂时固定的料箱编码
+  @State binCode:string=''
+  //重量
+  @State weight:number=0
+  ///料箱状态
+  @State materialBox:number=0
+  //取料箱中物料信息
+  @State private boxMaterials: Array<boxMaterialClass> = []
+  //定义物料信息
+  @State private MaterialInformation:Array<MaterialInformationList>=[]
+  @State private entranceWaiting:Array<stat1>=[]
+  //后端控制系统料箱出库
+  controlHttp = async() :Promise<controlClass[]>  => {
+    let res:controlClass[]= await StorageRequest.post("/api/v1/wms/common/receiveResult",{
+      //任务单号id
+      orderId:this.orderId,
+      state:1
+    }as RequestParamModel)
+    console.log('testTag', 'aaaaaaaa1' +JSON.stringify(res));
+    this.controlList=res
+    return res
+  }
+  //硬件stat1位置接口
+  locationRequest=async() : Promise<stat1> =>{
+    let res:stat1 = await EquipmentRequest.get("api/v1/wcs/stat/stat1")
+    console.log('testTag1'+'-------------'+JSON.stringify(res))
+    return res
+  }
+  //todo
+  //暂时扫的是库存里的料箱编码信息
+  //查询取出料箱里面的物料信息
+  boxMaterialHttp= async() : Promise<MaterialInformationList[]> => {
+    let res:MaterialInformationList[] = await StorageRequest.post("/api/v1/stock/list",{
+      //todo 读取RFId的料箱编码,要根据硬件读到的改
+      vehicleCode:this.binCode
+    }as RequestParamModel)
+    console.log('testTag', 'aaaaaaaa2' +JSON.stringify(res));
+    this.MaterialInformation=res
+    return res
+  }
+  //硬件请求入库操作
+  warehousingHttp= async() : Promise<boxMaterialClass> => {
+    let res:boxMaterialClass = await StorageRequest.post("/api/v1/wcs/stockin",{
+      boxNo:this.entranceWaiting[0].rfid!,
+      position:"stat2",
+      mtype:this.vehicleLevel
+    }as RequestParamModel)
+    console.log('testTag1', '----------' +JSON.stringify(res));
+    return res
+  }
+  //后端入库操作
+  Warehousing=async() : Promise<boxMaterialClass[]> => {
+    let res:boxMaterialClass[]= await StorageRequest.post("/api/v1/wmsOrder/inBox",{
+      houseNo:'1',
+      vehicleCode:this.entranceWaiting[0].rfid!,
+      detailsList:this.boxMaterials
+    }as RequestParamModel)
+    console.log('testTag', 'aaaaaaaa1' +JSON.stringify(res));
+    return res
+  }
+  //todo。暂时关闭
+  //打开页面0.5s请求一次硬件,当io(有无料箱)和weight(重量)发送变化时执行改变数据,同时通过RFID请求读取料箱里面物料信息
+  async aboutToAppear() {
+    // setInterval(async () => {
+    //   console.log('testTag1'+'-------------')
+    //   //第一步
+    //   this.locationRequest().then((res:stat1)=>{
+    //     this.entranceWaiting.push(res)
+    //     console.log('testTag1'+'-------------'+JSON.stringify(res))
+    //   })
+    //   //第二步
+    //   //当料箱状态和重量发生改变时才会执行
+    //   if (Number(this.entranceWaiting[0].io)!==this.materialBox||this.weight!==Number(this.entranceWaiting[0].weight!)/1000) {
+    //     this.materialBox=Number(this.entranceWaiting[0].io!)
+    //     this.weight=Number(this.entranceWaiting[0].weight!)/1000
+    //     //当rfid长度等于0,但是读取到有箱子说明rfid读取失败
+    //     //第三步
+    //     if (this.entranceWaiting[0].rfid!.length===0&&Number(this.entranceWaiting[0].io)===1){
+    //       this.RfidCarController.open()
+    //     }
+    //     //第四步
+    //     //todo 通过rfid获得料箱编码现在写死的
+    //     this.binCode="ZJ-JG013"
+    //     //this.binCode=this.entranceWaiting[0].rfid!
+    //
+    //     console.log('testTag1'+this.materialBox)
+    //     //料箱来了执行请求
+    //     this.boxMaterialHttp().then((res :MaterialInformationList[]) => {
+    //       console.log('testTag', 'result cccccc22'+JSON.stringify(res))
+    //       if (res && res.length > 0) {
+    //         this.MaterialInformation = res
+    //         this.vehicleLevel=res[0].vehicleLevel!
+    //       }
+    //
+    //     })
+    //     //todo
+    //     //第五步
+    //     //一直执行判定是否有违禁品
+    //     let len=this.MaterialInformation.length
+    //     for (let i = 0; i < len; i++) {
+    //       if (this.MaterialInformation[i].materialNo==="42944402000591") {
+    //         this.contraband=1
+    //       }
+    //     }
+    //     //第六步
+    //     //自动入库
+    //     if (this.contraband===0&&this.automaticWarehousing===0&&this.weight<=15&&this.automaticWarehousing===0) {
+    //       //执行硬件入库
+    //       this.warehousingHttp().then((res:boxMaterialClass)=>{
+    //         console.log('testTag1', '-------result cccccc11'+JSON.stringify(res))
+    //
+    //       })
+    //       //执行后端入库操作
+    //       this.Warehousing().then((res :boxMaterialClass[]) => {
+    //         console.log('testTag', 'result cccccc'+JSON.stringify(res))
+    //         if (res && res.length > 0) {
+    //         }
+    //控制终端
+    //       this.controlHttp().then((res:controlClass[])=>{
+    //        console.log('testTag1', '-------result cccccc11'+JSON.stringify(res))
+    //        })
+
+    //       })
+    //
+    //
+    //     }
+    //   }
+    // }, 500);
+  }
+  //料箱里的物料
+  @State private scanStorageList:Array<ScanStorageclass>=[]
+  @State isHomePage:boolean=false
+//0:主动入库,1:手动入库,2:统计按钮
+  @State inboundButton:number=0
+  //仓储和其他仓储点击按钮变色
+  @State warehouseButton:number=0
+  //RFID卡读取失败弹窗
+  RfidCarController: CustomDialogController = new CustomDialogController({
+    builder:RfidCar({
+
+    }),
+    alignment: DialogAlignment.Center,
+    gridCount: 4,
+    customStyle: true,
+  })
+  build() {
+    Column(){
+      TitleStateComp({ isHomePage: this.isHomePage,})
+      Column(){
+        Row(){
+            Row(){
+              Text('智能仓储')
+                .textAlign(TextAlign.Center)
+                .borderRadius(px2vp(16))
+                .width('292px')
+                .height('80px')
+                .fontWeight(FontWeight.Medium)
+                .fontSize(px2vp(24))
+                .fontColor(this.warehouseButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
+                .backgroundColor(this.warehouseButton===0?$r('app.color.process_divider_white_color'):'')
+                .onClick(()=>{
+                  this.warehouseButton=0
+                })
+              Blank()
+              Text('其他仓储')
+                .textAlign(TextAlign.Center)
+                .borderRadius(px2vp(16))
+                .width('292px')
+                .height('80px')
+                .fontWeight(FontWeight.Medium)
+                .fontSize(px2vp(24))
+                .fontColor(this.warehouseButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
+                .backgroundColor(this.warehouseButton===1?$r('app.color.process_divider_white_color'):'')
+                .onClick(()=>{
+                  this.warehouseButton=1
+                })
+
+
+            }.width(px2vp(608))
+            .borderRadius(px2vp(15))
+            .height(px2vp(80))
+            .backgroundColor($r('app.color.black_10'))
+            .margin({right:px2vp(24)})
+           Row(){
+            Text('自动入库')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('33%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===0?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=0
+              })
+            Blank()
+            Text('手动入库')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('33%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2fp(24))
+              .fontColor(this.inboundButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===1?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=1
+              })
+            Blank()
+            Text('统计')
+              .textAlign(TextAlign.Center)
+              .borderRadius(px2vp(16))
+              .width('33%')
+              .height('100%')
+              .fontWeight(FontWeight.Medium)
+              .fontSize(px2vp(24))
+              .fontColor(this.inboundButton===2?$r('app.color.black_90'):$r('app.color.black_60'))
+              .backgroundColor(this.inboundButton===2?$r('app.color.process_divider_white_color'):'')
+              .onClick(()=>{
+                this.inboundButton=2
+              })
+          }.width(px2vp(923))
+          .borderRadius(px2vp(15))
+          .height(px2vp(80))
+          .backgroundColor($r('app.color.black_10'))
+        }.width('100%')
+        .height('8%')
+        .padding({left:px2vp(24),right:px2vp(24)})
+        if (this.inboundButton===0&&this.warehouseButton===0){
+          //自动入库
+          IntelligentWarehousingGo({scanStorageList:this.scanStorageList,entranceWaiting:this.entranceWaiting,
+            ///料箱状态
+           materialBox:this.materialBox,weight:this.weight,binCode:this.binCode,
+       MaterialInformation:this.MaterialInformation,vehicleLevel:this.vehicleLevel,
+            contraband:this.contraband,automaticWarehousing:this.automaticWarehousing,
+            boxMaterials:this.boxMaterials})
+        }else if (this.inboundButton===2&&this.warehouseButton===0){
+          //统计
+          Column(){
+            Statistics()
+          }.width('100%')
+          .height('92%')
+        }else if (this.inboundButton===1&&this.warehouseButton===0) {
+          //手动入库
+          ManualWarehousing()
+        }
+
+      }.width('100%')
+      .height('92%')
+    }.width('100%')
+    .height('100%')
+    .backgroundColor($r('app.color.title_bar_background'))
+  }
+}
+//RFID读取失败弹窗
+@CustomDialog
+struct RfidCar{
+  controller: CustomDialogController
+  build() {
+    Column(){
+      Text('RFID读取失败')
+        .fontWeight(FontWeight.Medium)
+        .fontSize($r('app.float.fontSize_50'))
+      Blank()
+      Text('请检查RFID读卡器或料箱底部识别卡片是否正常!')
+        .fontWeight(FontWeight.Medium)
+        .fontSize($r('app.float.fontSize_38'))
+      Blank()
+      Button('取消', { type: ButtonType.Normal, stateEffect: true })
+        .width(px2vp(252))
+        .height(px2vp(70))
+        .borderRadius(px2vp(75))
+        .fontSize($r('app.float.fontSize_20'))
+        .onClick(()=>{
+          this.controller.close()
+        })
+
+    }.width(px2vp(924))
+    .height(px2vp(536))
+    .padding({top:px2vp(60),bottom:px2vp(60)})
+    .borderRadius($r('app.float.borderRadius_16'))
+    .backgroundColor($r('app.color.white_100'))
+  }
+}
+

BIN
entry/src/main/ets/pages/car.png


+ 108 - 0
entry/src/main/ets/pages/chart.ets

@@ -0,0 +1,108 @@
+@Entry
+@Component
+struct chart{
+  @State number1:number=200
+  build() {
+    Column(){
+      Stack(){
+        Column(){
+          Text('存钱频率')
+            .fontSize($r('app.float.fontSize_24'))
+            .fontColor($r('app.color.black_90'))
+            .fontWeight(FontWeight.Medium)
+            .width('100%')
+            .padding({left:px2vp(30)})
+          Row(){
+            Column(){
+              Text('500')
+                .fontSize($r('app.float.fontSize_14'))
+                .fontColor($r('app.color.black_90'))
+                .fontWeight(FontWeight.Regular)
+                .height(px2vp(100))
+              Text('400')
+                .fontSize($r('app.float.fontSize_14'))
+                .fontColor($r('app.color.black_90'))
+                .fontWeight(FontWeight.Regular)
+                .height(px2vp(100))
+              Text('300')
+                .fontSize($r('app.float.fontSize_14'))
+                .fontColor($r('app.color.black_90'))
+                .fontWeight(FontWeight.Regular)
+                .height(px2vp(100))
+              Text('200')
+                .fontSize($r('app.float.fontSize_14'))
+                .fontColor($r('app.color.black_90'))
+                .fontWeight(FontWeight.Regular)
+                .height(px2vp(100))
+              Text('100')
+                .fontSize($r('app.float.fontSize_14'))
+                .fontColor($r('app.color.black_90'))
+                .fontWeight(FontWeight.Regular)
+                .height(px2vp(100))
+
+            }
+            .width(px2vp(60))
+            .height(px2vp(500))
+            Column(){
+              Column(){
+                Divider()
+                  .width(px2vp(548))
+                  .color($r('app.color.black_100'))
+              } .height(px2vp(100))
+              .justifyContent(FlexAlign.Center)
+              Column(){
+                Divider()
+                  .width(px2vp(548))
+                  .color($r('app.color.black_100'))
+              } .height(px2vp(100))
+              .justifyContent(FlexAlign.Center)
+              Column(){
+                Divider()
+                  .width(px2vp(548))
+                  .color($r('app.color.black_100'))
+              } .height(px2vp(100))
+              .justifyContent(FlexAlign.Center)
+              Column(){
+                Divider()
+                  .width(px2vp(548))
+                  .color($r('app.color.black_100'))
+              } .height(px2vp(100))
+              .justifyContent(FlexAlign.Center)
+              Column(){
+                Divider()
+                  .width(px2vp(548))
+                  .color($r('app.color.black_100'))
+              } .height(px2vp(100))
+              .justifyContent(FlexAlign.Center)
+
+
+
+
+            }
+            .width(px2vp(548))
+            .height(px2vp(500))
+
+          }.width(px2vp(608))
+          .height(px2vp(500))
+
+        }.width(px2vp(608))
+        .height(px2vp(608))
+
+
+      }
+      .width(px2vp(608))
+      .height(px2vp(608))
+
+      Polyline({ width: 608, height: 608 })
+        .points([[0, 0], [100, 260], [300, 100]])
+        .fillOpacity(0)
+        .stroke(Color.Blue)
+        .strokeWidth(3)
+
+
+    }
+    .width(px2vp(608))
+    .height(px2vp(608))
+    .border({width:1})
+  }
+}

+ 0 - 0
entry/src/main/ets/pages/process/CallMaterialPage.ets


Some files were not shown because too many files changed in this diff