Browse Source

最新版+跑项目。

jiaxiaoqiang 8 months ago
parent
commit
e5aae0aed0

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

@@ -3,6 +3,10 @@
     {
       "name": "app_name",
       "value": "WonderfulDemo"
+    },
+    {
+      "name": "user_reason",
+      "value": "需要用到分布式的权限"
     }
   ]
 }

+ 16 - 16
build-profile.json5

@@ -1,35 +1,35 @@
 {
   "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",
+        "runtimeOS": "OpenHarmony"
       }
     ],
     "buildModeSet": [
       {
-        "name": "debug",
+        "name": "debug"
       },
       {
         "name": "release"
       }
+    ],
+    "signingConfigs": [
+      {
+        "name": "default",
+        "material": {
+          "certpath": "C:/Users/Administrator/.ohos/config/openharmony/default_xf-ohos_X8TOyHb28yqSkBeeCoAe5D77NG67SlqdwI214NdhMP0=.cer",
+          "storePassword": "0000001B099379D1077D0D21F63B0F354F09A095D0FC7583A8C53EF285F76241509C088A3C0385F6DCB0F8",
+          "keyAlias": "debugKey",
+          "keyPassword": "0000001B14013BBCC22566BC6CB95E9BC0B2BEA11851A71EF1DEC364113A80AF935345A223EDA21C9CF8BA",
+          "profile": "C:/Users/Administrator/.ohos/config/openharmony/default_xf-ohos_X8TOyHb28yqSkBeeCoAe5D77NG67SlqdwI214NdhMP0=.p7b",
+          "signAlg": "SHA256withECDSA",
+          "storeFile": "C:/Users/Administrator/.ohos/config/openharmony/default_xf-ohos_X8TOyHb28yqSkBeeCoAe5D77NG67SlqdwI214NdhMP0=.p12"
+        }
+      }
     ]
   },
   "modules": [

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

@@ -4,7 +4,7 @@ import CommonConstants from '../../constants/CommonConstants';
 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://0.0.0.0:8000/"
 const baseUrl = "http://10.88.19.120:8000/"
 const DEBUG = true //
 

+ 2 - 1
entry/src/main/ets/common/util/request/Request.ets

@@ -3,8 +3,9 @@ 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://121.41.179.41:8079/"
 //const baseUrl = "http://10.88.19.200:8079/"
+const baseUrl = "http://10.88.19.222:8079/"
 const DEBUG = true //
 
 // 创建实例

+ 2 - 1
entry/src/main/ets/common/util/request/StorageRequest.ets

@@ -2,8 +2,9 @@ import axios, { AxiosError, AxiosResponse, AxiosRequestHeaders,AxiosRequestConfi
 import CommonConstants from '../../constants/CommonConstants';
 import { printError, printRequest, printResponse, handleRes } from './Helps';
 
- const baseUrl = "http://121.41.179.41:8079/"
+ // const baseUrl = "http://121.41.179.41:8079/"
 //const baseUrl = "http://10.88.19.200:8079/"
+const baseUrl = "http://10.88.19.222:8079/"
 const DEBUG = true //
 
 // 创建实例

+ 8 - 8
entry/src/main/ets/pages/LoginPage.ets

@@ -360,14 +360,14 @@ struct LoginPage {
         .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
-            }
-          })
+         //  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 =>{

+ 30 - 10
entry/src/main/ets/pages/RfidAllocation.ets

@@ -10,6 +10,8 @@ import RequestParamModel from '../viewmodel/RequestParamModel';
 @Entry
 @CustomDialog
 export struct RfidAllocation{
+  //todo 读写器编号
+  @State ReadingWriting:string='SGHRI3LR48500'
   //写入rfid
   @State InRfid:string=''
   @State workstation: WorkstationInfo = {}
@@ -53,27 +55,33 @@ export struct RfidAllocation{
   //获取rfid
   RfidHttp= async() : Promise<RfidClass> => {
     //todo SGHRI3LR48500设备编号,从后端数据获取,暂时写死
-    let res:RfidClass = await EquipmentRequest.get("/api/y1/device/data/recentlyRecord/SGHRI3LR48500", {})
+    let res:RfidClass = await EquipmentRequest.get("/api/v1/device/data/recentlyRecord/SGHRI3LR48500", {})
     this.httpRfid=res
+    this.RfidOnlineStatus=1
     console.log('textTag', 'rfid请求结果' +JSON.stringify(res)
     );
     return res
   }
   //写入rfid
-  InRfidHttp= async() : Promise<RfidClass> => {
+  InRfidHttp= async() : Promise<InRfidClass> => {
     //todo SGHRI3LR48500设备编号,从后端数据获取,暂时写死
-    let res:RfidClass = await EquipmentRequest.get("/api/y1/device/data/recentlyRecord/SGHRI3LR48500", {})
-    this.httpRfid=res
-    console.log('textTag', 'rfid请求结果' +JSON.stringify(res)
+    let res:InRfidClass = await EquipmentRequest.post("/api/v1/device/setup", {
+      deviceNo:this.ReadingWriting,
+      data:{
+        rfid0:this.InRfid
+      }
+    }as RequestParamModel)
+    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);
+     }, 5000);
 
 
 
@@ -365,7 +373,7 @@ aboutToAppear(): void {
                   .textAlign(TextAlign.End)
                   .width('40%')
                   .height('100%')
-                if (this.RfidOnlineStatus===0){
+                if (this.RfidOnlineStatus===1){
                   Text().width(px2vp(12))
                     .height(px2vp(12))
                     .borderRadius(px2vp(50))
@@ -377,7 +385,7 @@ aboutToAppear(): void {
                     .textAlign(TextAlign.Start)
                     .width('35%')
                     .height('100%')
-                }else if (this.RfidOnlineStatus===1){
+                }else if (this.RfidOnlineStatus===0){
 
                   Text().width('5%')
                     .height('30%')
@@ -403,7 +411,7 @@ aboutToAppear(): void {
                   .textAlign(TextAlign.End)
                   .width('40%')
                   .height('100%')
-                Text('6537289495783').width('40%')
+                Text(this.httpRfid.data?.RFID!).width('40%')
                   .height('30%')
                   .borderRadius(px2vp(50))
                   .fontColor($r('app.color.blue_100'))
@@ -440,6 +448,11 @@ aboutToAppear(): void {
               .width(px2vp(292))
               .height(px2vp(80))
               .margin({bottom:$r('app.float.topMargins_20')})
+              .onClick(()=>{
+                this.InRfidHttp().then((res:InRfidClass)=> {
+                  console.log('textTag', '-------rfid写入信息' + JSON.stringify(res))
+                })
+              })
 
           }.width('100%')
           .height('49%')
@@ -480,4 +493,11 @@ export interface datalass{
   RFID?:string
   UID?:string
   errCode?:string
-}
+}
+export interface InRfidClass{
+  deviceNo?:string
+  data?:InDataClass
+}
+export interface InDataClass{
+  rfid0?:string
+}

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


+ 3 - 3
entry/src/main/ets/pages/WarehouseMap.ets

@@ -94,7 +94,7 @@ export struct WarehouseMap {
         //移动位置
         src:(this.XCoordinate+1)+'-'+(this.YCoordinate+1),
         //todo 数量暂时写死1
-        num:1
+        num:"1"
     }as RequestParamModel)
     //
     console.log('textTag', 'post请求结果' +JSON.stringify(res)
@@ -286,7 +286,7 @@ export struct WarehouseMap {
                                   this.SelectEnter=3
                                   this.outSvg=1
                                   this.storeyNumber=x
-                                  console.log('textTag'+'调出坐标'+this.YCoordinate+ this.XCoordinate)
+                                  console.log('textTag'+'调出坐标'+ this.XCoordinate+this.YCoordinate)
                                 }
                               })
                           }
@@ -304,7 +304,7 @@ export struct WarehouseMap {
                                   this.XCoordinateIn=index2
                                   this.SelectEnter=2
                                   this.enterSvg=1
-                                  console.log('textTag'+'调入坐标'+this.YCoordinateIn+ this.XCoordinateIn)
+                                  console.log('textTag'+'调入坐标' +this.XCoordinateIn+this.YCoordinateIn)
                                 }
                               })
                           }

+ 4 - 1
entry/src/main/ets/viewmodel/RequestParamModel.ets

@@ -1,15 +1,18 @@
 //通用请求后台参数
+import { InDataClass } from '../pages/RfidAllocation'
 import { detailsListvlass } from '../view/IntelligentWarehousingOutbound'
 import MaterialInfo from './MaterialInfo'
 import Orders from './Orders'
 
 export default class RequestParamModel {
+  data?:InDataClass
+  deviceNo?:string
   rgvNo?:string
   destY?:string
   destX?:string
   dest?:string
   src?:string
-  num?:number
+  num?:string
   mtype?:string
   position?:string
   boxNo?:string

+ 1 - 0
entry/src/main/module.json5

@@ -39,6 +39,7 @@
       },
       {
         "name": "ohos.permission.DISTRIBUTED_DATASYNC",
+        "reason": "$string:user_reason",
         "usedScene": {
           "abilities": [
             "EntryAbility"

+ 12 - 7
hvigor/hvigor-config.json5

@@ -1,17 +1,22 @@
 {
-  "modelVersion": "5.0.0",
+  "hvigorVersion": "3.2.4",
   "dependencies": {
+    "@ohos/hvigor-ohos-plugin": "3.2.4"
   },
   "execution": {
-    // "daemon": true,                          /* Enable daemon compilation. Default: true */
-    // "incremental": true,                     /* Enable incremental compilation. Default: true */
-    // "parallel": true,                        /* Enable parallel compilation. Default: true */
-    // "typeCheck": false,                      /* Enable typeCheck. Default: false */
+    // "analyze": "default",                    /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
+    // "daemon": true,                          /* Enable daemon compilation. Value: [ true | false ]. Default: true */
+    // "incremental": true,                     /* Enable incremental compilation. Value: [ true | false ]. Default: true */
+    // "parallel": true,                        /* Enable parallel compilation. Value: [ true | false ]. Default: true */
+    // "typeCheck": false,                      /* Enable typeCheck. Value: [ true | false ]. Default: false */
   },
   "logging": {
     // "level": "info"                          /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
   },
   "debugging": {
-    // "stacktrace": false                      /* Disable stacktrace compilation. Default: false */
+    // "stacktrace": false                      /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
+  },
+  "nodeOptions": {
+    // "maxOldSpaceSize": 4096                  /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
   }
-}
+}

+ 17 - 0
hvigor/hvigor-config.json5_backup

@@ -0,0 +1,17 @@
+{
+  "modelVersion": "5.0.0",
+  "dependencies": {
+  },
+  "execution": {
+    // "daemon": true,                          /* Enable daemon compilation. Default: true */
+    // "incremental": true,                     /* Enable incremental compilation. Default: true */
+    // "parallel": true,                        /* Enable parallel compilation. Default: true */
+    // "typeCheck": false,                      /* Enable typeCheck. Default: false */
+  },
+  "logging": {
+    // "level": "info"                          /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
+  },
+  "debugging": {
+    // "stacktrace": false                      /* Disable stacktrace compilation. Default: false */
+  }
+}

File diff suppressed because it is too large
+ 1 - 0
hvigor/hvigor-wrapper.js


+ 20 - 33
oh-package-lock.json5

@@ -1,52 +1,39 @@
 {
-  "meta": {
-    "stableOrder": true
-  },
-  "lockfileVersion": 3,
+  "lockfileVersion": 2,
   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
   "specifiers": {
-    "@mcui/mccharts@^1.0.2": "@mcui/mccharts@1.0.2",
+    "lite_chart@^0.0.1": "lite_chart@0.0.1",
+    "pinyin-pro@^3.18.3": "pinyin-pro@3.18.3",
     "@ohos/axios@^2.2.1-rc.0": "@ohos/axios@2.2.2",
     "@ohos/hypium@1.0.11": "@ohos/hypium@1.0.11",
-    "lite_chart@^0.0.1": "lite_chart@0.0.1",
-    "pinyin-pro@^3.18.3": "pinyin-pro@3.18.3"
+    "@mcui/mccharts@^1.0.2": "@mcui/mccharts@1.0.2"
   },
   "packages": {
-    "@mcui/mccharts@1.0.2": {
-      "name": "@mcui/mccharts",
-      "version": "1.0.2",
-      "integrity": "sha512-44hGTwZcsfFnny7nT/zMpWKFqXbaVmdlDbyeJIOlJwbglS/S3ypqhBdzbpj3aJrcMSd5FLFO0FrZGntph9HSIw==",
-      "resolved": "https://ohpm.openharmony.cn/ohpm/@mcui/mccharts/-/mccharts-1.0.2.har",
-      "registryType": "ohpm"
-    },
-    "@ohos/axios@2.2.2": {
-      "name": "@ohos/axios",
-      "version": "2.2.2",
-      "integrity": "sha512-JpSAeuR9NPhK1dbJjk1DVLgBZVRHgorNFAcpNrnBxt02mVGeeB3dyqmLetfqk+25f2dWwPkCHwm4+TqQPc093w==",
-      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/axios/-/axios-2.2.2.har",
-      "registryType": "ohpm"
-    },
     "@ohos/hypium@1.0.11": {
-      "name": "@ohos/hypium",
-      "version": "1.0.11",
+      "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.11.tgz",
       "integrity": "sha512-KawcLnv43C3QIYv1UbDnKCFX3MohtDxGuFvzlUxT/qf2DBilR56Ws6zrj90LdH6PjloJQwOPESuBQIHBACAK7w==",
-      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.11.tgz",
-      "shasum": "fa799d273fa7d921701578c5e7084849354a4af0",
-      "registryType": "ohpm"
+      "registryType": "ohpm",
+      "shasum": "fa799d273fa7d921701578c5e7084849354a4af0"
     },
     "lite_chart@0.0.1": {
-      "name": "lite_chart",
-      "version": "0.0.1",
+      "resolved": "https://repo.harmonyos.com/ohpm/lite_chart/-/lite_chart-0.0.1.har",
       "integrity": "sha512-iEq2uXyC3jkeErHOLVFLz/yj5ft9OHST8aqCltewqlbRtwQRzUqLi/KpNTXlZlSsAGZPizVjFje1oyT19frSJw==",
-      "resolved": "https://ohpm.openharmony.cn/ohpm/lite_chart/-/lite_chart-0.0.1.har",
       "registryType": "ohpm"
     },
     "pinyin-pro@3.18.3": {
-      "name": "pinyin-pro",
-      "version": "3.18.3",
+      "resolved": "https://repo.harmonyos.com/ohpm/pinyin-pro/-/pinyin-pro-3.18.3.tgz",
       "integrity": "sha512-YkY/n+T2DoRZxmZk+ReuNeSl2SowIMVDdagydILlPI0qNsbH7K5IKAQFihKl1JNiXLqwQT6kkVwVDsUek7AIqg==",
-      "resolved": "https://ohpm.openharmony.cn/ohpm/pinyin-pro/-/pinyin-pro-3.18.3.tgz",
-      "shasum": "6dd2fcf2dbba3b1e3d6b54d6b138cf2e6003b0c7",
+      "registryType": "ohpm",
+      "shasum": "6dd2fcf2dbba3b1e3d6b54d6b138cf2e6003b0c7"
+    },
+    "@ohos/axios@2.2.2": {
+      "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.2.har",
+      "integrity": "sha512-JpSAeuR9NPhK1dbJjk1DVLgBZVRHgorNFAcpNrnBxt02mVGeeB3dyqmLetfqk+25f2dWwPkCHwm4+TqQPc093w==",
+      "registryType": "ohpm"
+    },
+    "@mcui/mccharts@1.0.2": {
+      "resolved": "https://repo.harmonyos.com/ohpm/@mcui/mccharts/-/mccharts-1.0.2.har",
+      "integrity": "sha512-44hGTwZcsfFnny7nT/zMpWKFqXbaVmdlDbyeJIOlJwbglS/S3ypqhBdzbpj3aJrcMSd5FLFO0FrZGntph9HSIw==",
       "registryType": "ohpm"
     }
   }