huhao@jgai.com vor 4 Tagen
Ursprung
Commit
59c65a329d

+ 5 - 5
build-profile.json5

@@ -12,13 +12,13 @@
       {
         "name": "default",
         "material": {
-          "storePassword": "000000161E6A0872CFACBC7AA0CF17A53EB94AB0B9D9DD59DE8FC0412E30678672479783C32A",
-          "certpath": "D:/HuaweiWorkspace/launcher-OpenHarmony/applications_launcher-OpenHarmony-4.1-Release/signature/OpenHarmonyApplication.cer",
+          "storePassword": "00000016263D35F1D2C22FE301C653F30510631B97619920B08A2CC8F7AC3185344EEBD198A5",
+          "certpath": "D:/HuaweiWorkspace/launcher-OpenHarmony/HJ_launcher/signature/OpenHarmonyApplication.cer",
           "keyAlias": "OpenHarmony Application Release",
-          "keyPassword": "00000016A6D2664E44EE02902809660580B2A693577CB3CBAACA1F76E429C5C5E1D2D10424A1",
-          "profile": "D:/HuaweiWorkspace/launcher-OpenHarmony/applications_launcher-OpenHarmony-4.1-Release/signature/launcher.p7b",
+          "keyPassword": "00000016A4EA2BCCB995156201EE3DFF5513A6752C47691F9896171A744CB7844DC8AE84B1E9",
+          "profile": "D:/HuaweiWorkspace/launcher-OpenHarmony/HJ_launcher/signature/launcher.p7b",
           "signAlg": "SHA256withECDSA",
-          "storeFile": "D:/HuaweiWorkspace/launcher-OpenHarmony/applications_launcher-OpenHarmony-4.1-Release/signature/OpenHarmony.p12"
+          "storeFile": "D:/HuaweiWorkspace/launcher-OpenHarmony/HJ_launcher/signature/OpenHarmony.p12"
         }
       }
     ]

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
product/phone/.preview/PreviewBuildParam.json


+ 2 - 5
product/phone/src/main/ets/pages/app/PlanProduce.ets

@@ -5,11 +5,8 @@ import router from '@ohos.router';
 
 
 const TAG = "openHarmonyBridge" //webview和vue沟通的名称
-// const webUrl = "http://192.168.1.4:11000/"  //创客前端服务
-//const webUrl = "http://192.168.0.49:3005/"  //本地跑的项目
-//const webUrl = "http://10.88.11.200:11000/"  //险峰服务
-// const webUrl = "http://192.168.2.100:10000/"  //江山服务
-const webUrl = "http://192.168.1.3:8086/planprocess"  //计划排产
+
+const webUrl = "http://192.168.1.3:8086/planprocess"  //计划管理
 
 class BridgeModel {
   constructor() {

+ 1 - 4
product/phone/src/main/ets/pages/app/ProduceExecute.ets

@@ -5,10 +5,7 @@ import uploadInstance from "../../common/util/UploadUtil"
 
 
 const TAG = "openHarmonyBridge" //webview和vue沟通的名称
-// const webUrl = "http://192.168.1.4:11000/"  //创客前端服务
-//const webUrl = "http://192.168.0.49:3005/"  //本地跑的项目
-//const webUrl = "http://10.88.11.200:11000/"  //险峰服务
-// const webUrl = "http://192.168.2.100:10000/"  //江山服务
+
 const webUrl = "http://192.168.1.3:8081/"  //一体机
 
 class BridgeModel {

+ 2 - 2
product/phone/src/main/ets/pages/app/ProduceReport.ets

@@ -6,7 +6,7 @@ import router from '@ohos.router';
 
 const TAG = "openHarmonyBridge" //webview和vue沟通的名称
 
-const webUrl = "http://192.168.1.3:8086/report/statistics/stationbeat"  //一体机
+const webUrl = "http://192.168.1.3:8086/report/statistics/stationbeat"
 
 class BridgeModel {
   constructor() {
@@ -30,7 +30,7 @@ class BridgeModel {
   }
 }
 
-// 生产计划
+// 生产报表
 @Entry
 @Component
 struct ProduceReport {

+ 119 - 0
product/phone/src/main/ets/pages/app/QualityManagement.ets

@@ -0,0 +1,119 @@
+import web_webview from '@ohos.web.webview';
+import process from '@ohos.process'
+import router from '@ohos.router';
+// import uploadInstance from "../utils/UploadUtil"
+
+
+const TAG = "openHarmonyBridge" //webview和vue沟通的名称
+
+const webUrl = "http://192.168.1.3:8086/outsource"
+
+class BridgeModel {
+  constructor() {
+
+  }
+
+  // this.controller.registerJavaScriptProxy 这个里面要对应
+  download(params: string): void {
+    // download(value: string, params: BridgeParams): string {
+    // let downloadUrl: string = baseUrl + proxyPrefix + params.path
+    // console.info(TAG, `download:`, downloadUrl);
+    console.info(TAG, `params:`, params);
+    // return true;
+  }
+
+
+  exitApp(params: string): void {
+    console.info(TAG, `exitApp:`, params);
+    let pro = new process.ProcessManager();
+    pro.exit(0);
+  }
+}
+
+// 质量管理
+@Entry
+@Component
+struct QualityManagement {
+  controller: web_webview.WebviewController = new web_webview.WebviewController();
+  // 声明需要注册的对象
+  @State bridgeObj: BridgeModel = new BridgeModel();
+  hasRegistered: boolean = false
+  registerJS = () => {
+
+    // 这个必须要调用刷新才起作用, 而且只能执行一次
+    if (!this.hasRegistered) {
+      console.info(TAG, `registerJavaScriptProxy:`);
+
+      this.controller.registerJavaScriptProxy(this.bridgeObj, TAG, ["download", "selectFile", "startCamera", "goToDevicePage", "exitApp"])
+      this.controller.refresh()
+      this.hasRegistered = true
+
+      // uploadInstance.controller = this.controller
+    }
+  }
+
+  aboutToAppear(): void {
+    console.log('hhtest', '-------webUrl------------' + webUrl)
+  }
+
+  build() {
+    Stack() {
+
+      // 这个webview调用相机不知道为什么只能执行一次,选择文件的回到还行,但是为了统一写法还是用registerJavaScriptProxy,但是有时候注册的方法也只能执行一次,不知道为什么。
+      // Web({ src: $rawfile('doc_old.html'), controller: this.controller })//测试官方文档 这个是好使的
+
+      // Button("跳转到相机页面").onClick(() => {
+      //   router.pushUrl({
+      //     url: "pages/CameraVersion2"
+      //   })
+      // })
+      Web({
+        src: webUrl,
+        controller: this.controller
+      })
+        .mixedMode(MixedMode.All)
+        .onlineImageAccess(true)
+        .javaScriptAccess(true)
+        .overviewModeAccess(true)
+        .databaseAccess(true)
+        .domStorageAccess(true)
+        .onShowFileSelector((event) => {
+          console.log(TAG, "onShowFileSelector", JSON.stringify(event))
+          // this.openGallery()
+          // setTimeout(() => {
+          //   // 这个会触发addEventListener('change')的事件,但是每次的值都要不同。
+          //   event?.result.handleFileList([Date.now() + '.jpg']);
+          // }, 1300)
+          return true;
+        })
+        .onProgressChange((e) => {
+          if (e && e.newProgress == 100) {
+            this.registerJS()
+          }
+        })
+        .onPermissionRequest((event) => {
+          console.log(TAG, "onPermissionRequest")
+
+          // event.request.grant([""])
+        })
+        .onConsole((e) => {
+          console.log(TAG, "onConsole", JSON.stringify(e))
+          return true
+        })
+
+      // 退出程序
+      // Image($r('app.media.shutdown'))
+      //   .width(px2vp(80))
+      //   .height(px2vp(80))
+      //   .onClick(() => {
+      //     let pro = new process.ProcessManager();
+      //     pro.exit(0);
+      //   })
+
+
+    }
+    .width("100%")
+    .height("100%")
+    .alignContent(Alignment.BottomEnd)
+  }
+}

+ 6 - 2
product/phone/src/main/ets/view/ApplicationView.ets

@@ -174,8 +174,6 @@ export struct ApplicationView {
               url: "pages/app/PlanProduce"
             })
           })
-          // http://192.168.1.3:8086/planprocess
-
 
           Column().width('1%')
 
@@ -357,6 +355,12 @@ export struct ApplicationView {
           .height('100%')
           .borderRadius($r('app.float.virtualSize_6_4'))
           .backgroundColor($r('app.color.10FFFFFF'))
+          .onClick(()=>{
+            router.pushUrl({
+              url: "pages/app/QualityManagement"
+            })
+          })
+
           Column().width('1%')
 
           // 工艺管理

+ 1 - 1
product/phone/src/main/ets/view/HomeView.ets

@@ -86,7 +86,7 @@ export struct HomeView {
         Image($r('app.media.home_edit'))
           .width($r('app.float.virtualSize_16_8'))
           .height($r('app.float.virtualSize_16_8'))
-          .backgroundColor('white')
+          .fillColor($r('app.color.FFFFFF'))
       }
       .width('94.4%')
       .height('14.9%')

+ 2 - 0
product/phone/src/main/resources/base/profile/main_pages.json

@@ -10,6 +10,8 @@
     "pages/app/ProduceSchedule",
     "pages/app/PlanProduce",
     "pages/app/ProcessManagement",
+    "pages/app/ProduceReport",
+    "pages/app/QualityManagement",
     "pages/DeviceControllerPage",
     "pages/warehouse/RfidAllocation",
     "pages/warehouse/Storage",