liyayan 5 tahun lalu
induk
melakukan
f7dff03b1d
23 mengubah file dengan 480 tambahan dan 344 penghapusan
  1. 16 30
      package-lock.json
  2. 3 1
      package.json
  3. 13 9
      src/app/app.module.ts
  4. 14 14
      src/app/modules/main/detection-details/detection-details.page.html
  5. 4 6
      src/app/modules/main/visualization-equipment-detection/visualization-equipment-detection.page.html
  6. 0 12
      src/app/modules/main/visualization-equipment-detection/visualization-equipment-detection.page.scss
  7. 14 17
      src/app/modules/main/visualization-equipment-operation/visualization-equipment-operation.page.html
  8. 0 27
      src/app/modules/main/visualization-equipment-operation/visualization-equipment-operation.page.spec.ts
  9. 23 20
      src/app/modules/main/visualization-equipment-operation/visualization-equipment-operation.page.ts
  10. 9 14
      src/app/modules/main/visualization-security-tools/visualization-security-tools.page.html
  11. 5 5
      src/app/modules/main/visualization-security-tools/visualization-security-tools.page.ts
  12. 10 16
      src/app/shared/compenents/select-picture/select-picture.component.html
  13. 20 0
      src/app/shared/compenents/select-picture/select-picture.component.scss
  14. 5 5
      src/app/shared/compenents/select-picture/select-picture.component.ts
  15. 15 2
      src/app/shared/compenents/select-video/select-video.component.html
  16. 45 14
      src/app/shared/compenents/select-video/select-video.component.ts
  17. 1 1
      src/app/shared/servers/network.service.ts
  18. 0 12
      src/app/shared/servers/tabs.service.spec.ts
  19. 4 4
      src/app/shared/servers/tabs.service.ts
  20. 164 135
      src/app/util/helper-classes/businesses-helper.ts
  21. 92 0
      src/app/util/utilservers/utils.services.ts
  22. 15 0
      src/global.scss
  23. 8 0
      yarn.lock

+ 16 - 30
package-lock.json

@@ -3054,6 +3054,11 @@
       "integrity": "sha1-gP4eggZ62Ny8Xs8AytL436DQ4Q8=",
       "dev": true
     },
+    "cordova-plugin-media-capture": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npm.taobao.org/cordova-plugin-media-capture/download/cordova-plugin-media-capture-3.0.2.tgz",
+      "integrity": "sha1-2mV8L6rc/H/cKGjlnSFe2D5wDDo="
+    },
     "cordova-plugin-nativestorage": {
       "version": "2.3.2",
       "resolved": "https://registry.npm.taobao.org/cordova-plugin-nativestorage/download/cordova-plugin-nativestorage-2.3.2.tgz",
@@ -4447,8 +4452,7 @@
         "ansi-regex": {
           "version": "2.1.1",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "aproba": {
           "version": "1.2.0",
@@ -4469,14 +4473,12 @@
         "balanced-match": {
           "version": "1.0.0",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -4491,20 +4493,17 @@
         "code-point-at": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "concat-map": {
           "version": "0.0.1",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "console-control-strings": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "core-util-is": {
           "version": "1.0.2",
@@ -4621,8 +4620,7 @@
         "inherits": {
           "version": "2.0.3",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "ini": {
           "version": "1.3.5",
@@ -4634,7 +4632,6 @@
           "version": "1.0.0",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
@@ -4649,7 +4646,6 @@
           "version": "3.0.4",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
@@ -4657,14 +4653,12 @@
         "minimist": {
           "version": "0.0.8",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "minipass": {
           "version": "2.3.5",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
@@ -4683,7 +4677,6 @@
           "version": "0.5.1",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
@@ -4764,8 +4757,7 @@
         "number-is-nan": {
           "version": "1.0.1",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "object-assign": {
           "version": "4.1.1",
@@ -4777,7 +4769,6 @@
           "version": "1.4.0",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "wrappy": "1"
           }
@@ -4863,8 +4854,7 @@
         "safe-buffer": {
           "version": "5.1.2",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "safer-buffer": {
           "version": "2.1.2",
@@ -4900,7 +4890,6 @@
           "version": "1.0.2",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",
@@ -4920,7 +4909,6 @@
           "version": "3.0.1",
           "bundled": true,
           "dev": true,
-          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
@@ -4964,14 +4952,12 @@
         "wrappy": {
           "version": "1.0.2",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         },
         "yallist": {
           "version": "3.0.3",
           "bundled": true,
-          "dev": true,
-          "optional": true
+          "dev": true
         }
       }
     },

+ 3 - 1
package.json

@@ -62,6 +62,7 @@
     "cordova-plugin-file-transfer": "1.7.1",
     "cordova-plugin-filepath": "1.5.5",
     "cordova-plugin-gaodelocation-chenyu": "2.0.2",
+    "cordova-plugin-media-capture": "3.0.2",
     "cordova-plugin-nativestorage": "2.3.2",
     "core-js": "^2.5.4",
     "echarts": "^4.2.1",
@@ -134,7 +135,8 @@
       },
       "cordova-android-support-gradle-release": {
         "ANDROID_SUPPORT_VERSION": "28.+"
-      }
+      },
+      "cordova-plugin-media-capture": {}
     },
     "platforms": [
       "android"

+ 13 - 9
src/app/app.module.ts

@@ -1,5 +1,5 @@
 import { NgModule, ErrorHandler } from '@angular/core';
-import { BrowserModule} from '@angular/platform-browser';
+import { BrowserModule } from '@angular/platform-browser';
 import { RouteReuseStrategy } from '@angular/router';
 
 import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
@@ -12,13 +12,13 @@ import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
 import { StorageService } from './shared/servers/storage.service';
 import { GaoDeLocation } from '@ionic-native/gao-de-location/ngx';
 import { EventService } from './shared/servers/envent.service';
-import {AppMinimize} from '@ionic-native/app-minimize/ngx';
+import { AppMinimize } from '@ionic-native/app-minimize/ngx';
 import { NetworkService } from './shared/servers/network.service';
 import { AuthHttpInterceptor } from './shared/interceptors/auth-http.interceptor';
 import { Device } from '@ionic-native/device/ngx';
 import { Camera } from '@ionic-native/camera/ngx';
 import { NativeService } from './shared/servers/native.service';
-import { FileTransfer} from '@ionic-native/file-transfer/ngx';
+import { FileTransfer } from '@ionic-native/file-transfer/ngx';
 import { ReactiveFormsModule, FormsModule } from '@angular/forms';
 import { TabsService } from './shared/servers/tabs.service';
 import { VisualizationEquipmentService } from './modules/main/visualization-equipment-detection/visualization-equipment-Service';
@@ -30,7 +30,9 @@ import { File } from '@ionic-native/file/ngx';
 import { FilePath } from '@ionic-native/file-path/ngx';
 import { WebView } from '@ionic-native/ionic-webview/ngx';
 import { NativeStorage } from '@ionic-native/native-storage/ngx';
-import { MediaCapture} from '@ionic-native/media-capture/ngx';
+import { MediaCapture } from '@ionic-native/media-capture/ngx';
+import { BusinessesHelper } from './util/helper-classes/businesses-helper';
+import { UtilsService } from './util/utilservers/utils.services';
 
 
 @NgModule({
@@ -46,12 +48,12 @@ import { MediaCapture} from '@ionic-native/media-capture/ngx';
     SharePageModule,
     AppRoutingModule,
     IonicModule.forRoot(
-      
-      { 
-        mode:'md',
+
+      {
+        mode: 'md',
         //配置android ios用统一的样式
         // backButtonText:'返回' //修改默认返回文字
-      } 
+      }
     )
   ],
   providers: [
@@ -76,10 +78,12 @@ import { MediaCapture} from '@ionic-native/media-capture/ngx';
     NativeStorage,
     NativePageTransitions,
     MediaCapture,
+    BusinessesHelper,
+    UtilsService,
     { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
     // { provide: HTTP_INTERCEPTORS, useClass: AuthHttpInterceptor, multi: true }, //添加拦截器
     // {provide: ErrorHandler, useClass: error},
-  
+
   ],
   bootstrap: [AppComponent]
 })

+ 14 - 14
src/app/modules/main/detection-details/detection-details.page.html

@@ -1,4 +1,4 @@
-<ion-header  mode='ios'>
+<ion-header mode='ios'>
   <ion-toolbar color="primary">
     <ion-buttons slot="start" mode='ios'>
       <ion-back-button defaultHref="home/fieldmonitoring" color="light"></ion-back-button>
@@ -6,9 +6,9 @@
     <routing-search [routing]="routingAddress" [placeholder]="placeholder"></routing-search>
   </ion-toolbar>
   <div class="date_home" *ngIf="showTime">
-      <div class="date_wiht">
-          <date-selection #dateSelection (selection)="selectionDate($event)" [title]='title' class="date"></date-selection>
-      </div>
+    <div class="date_wiht">
+      <date-selection #dateSelection (selection)="selectionDate($event)" [title]='title' class="date"></date-selection>
+    </div>
   </div>
   <div class="title_list">
     <ion-icon name="copy" color="primary"></ion-icon>
@@ -25,50 +25,50 @@
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="paper" slot="start" color="danger"></ion-icon>
-      <ion-label  position="fixed">监控设备编号:</ion-label>
+      <ion-label position="fixed">监控设备编号:</ion-label>
       <span>{{item.videoId}}</span>
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="paper" slot="start" color="danger"></ion-icon>
-      <ion-label  position="fixed">分析设备编号:</ion-label>
+      <ion-label position="fixed">分析设备编号:</ion-label>
       <span>{{item.videoEquipId}}</span>
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="subway" slot="start" color="warning"></ion-icon>
-      <ion-label  position="fixed">违规时间:</ion-label>
+      <ion-label position="fixed">违规时间:</ion-label>
       <span>{{item.voilateTime}}</span>
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="subway" slot="start" color="warning"></ion-icon>
-      <ion-label  position="fixed">违规截图:</ion-label>
+      <ion-label position="fixed">违规截图:</ion-label>
       <span>{{item.voilateImg}}</span>
     </ion-item>
 
     <ion-item lines="none">
       <ion-icon name="subway" slot="start" color="warning"></ion-icon>
-      <ion-label  position="fixed">违规是否解除:</ion-label>
+      <ion-label position="fixed">违规是否解除:</ion-label>
       <span>{{item.voilateRelieve}}</span>
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="subway" slot="start" color="warning"></ion-icon>
-      <ion-label  position="fixed">违规解除时间:</ion-label>
+      <ion-label position="fixed">违规解除时间:</ion-label>
       <span>{{item.voilateRelieveTm}}</span>
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="subway" slot="start" color="warning"></ion-icon>
-      <ion-label  position="fixed">违规内容:</ion-label>
+      <ion-label position="fixed">违规内容:</ion-label>
       <span>{{item.voilateBack}}</span>
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="subway" slot="start" color="warning"></ion-icon>
-      <ion-label  position="fixed">变电站:</ion-label>
+      <ion-label position="fixed">变电站:</ion-label>
       <span>{{item.stationName}}</span>
     </ion-item>
     <ion-item lines="none">
       <ion-icon name="subway" slot="start" color="warning"></ion-icon>
-      <ion-label  position="fixed">任务名称:</ion-label>
+      <ion-label position="fixed">任务名称:</ion-label>
       <span>{{item.taskName}}</span>
     </ion-item>
   </ion-list>
-  
+
 </ion-content>

+ 4 - 6
src/app/modules/main/visualization-equipment-detection/visualization-equipment-detection.page.html

@@ -12,12 +12,10 @@
 <ion-content>
   <com-select-picture #selectpicture></com-select-picture>
 </ion-content>
-<ion-footer (click)="doUpload()">
+<ion-footer id="oneHundredPercent">
   <ion-toolbar color="primary">
-    <ion-buttons slot="start" >
-      <ion-button>
-        <span>上传</span>
-      </ion-button>
-    </ion-buttons>
+    <div (click)="doUpload()">
+      <span>上 传</span>
+    </div>
   </ion-toolbar>
 </ion-footer>

+ 0 - 12
src/app/modules/main/visualization-equipment-detection/visualization-equipment-detection.page.scss

@@ -1,13 +1 @@
 
-ion-footer{
-    ion-toolbar{
-        ion-buttons{
-            ion-button{
-                span{
-                    font-size: 20px;
-                    text-align: center
-                }
-            }
-        }
-    }
-}

+ 14 - 17
src/app/modules/main/visualization-equipment-operation/visualization-equipment-operation.page.html

@@ -1,23 +1,20 @@
 <ion-header>
   <ion-toolbar color="primary">
-      <ion-buttons slot="start">
-          <ion-button (click)="goBack()">
-            <ion-icon slot="icon-only" name="arrow-back" color="light"></ion-icon>
-          </ion-button>
-        </ion-buttons>
+    <ion-buttons slot="start">
+      <ion-button (click)="goBack()">
+        <ion-icon slot="icon-only" name="arrow-back" color="light"></ion-icon>
+      </ion-button>
+    </ion-buttons>
     <ion-title>设备操作</ion-title>
   </ion-toolbar>
 </ion-header>
-
-<ion-content (pan)="goPage()">
-  <com-select-video  #selectvideo ></com-select-video>
+<ion-content>
+  <com-select-video #selectvideo (uploadVideoList)='uploadVideoList($event)'></com-select-video>
 </ion-content>
-<ion-footer>
-    <ion-toolbar color="primary">
-      <ion-buttons slot="start" (click)="doUpload()">
-        <ion-button >  
-           <span>上传</span>
-        </ion-button>
-      </ion-buttons>
-    </ion-toolbar>
-  </ion-footer>
+<ion-footer id="oneHundredPercent">
+  <ion-toolbar color="primary">
+    <div (click)="doUpload()">
+      <span>上 传</span>
+    </div>
+  </ion-toolbar>
+</ion-footer>

+ 0 - 27
src/app/modules/main/visualization-equipment-operation/visualization-equipment-operation.page.spec.ts

@@ -1,27 +0,0 @@
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { VisualizationEquipmentOperationPage } from './visualization-equipment-operation.page';
-
-describe('VisualizationEquipmentOperationPage', () => {
-  let component: VisualizationEquipmentOperationPage;
-  let fixture: ComponentFixture<VisualizationEquipmentOperationPage>;
-
-  beforeEach(async(() => {
-    TestBed.configureTestingModule({
-      declarations: [ VisualizationEquipmentOperationPage ],
-      schemas: [CUSTOM_ELEMENTS_SCHEMA],
-    })
-    .compileComponents();
-  }));
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(VisualizationEquipmentOperationPage);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 23 - 20
src/app/modules/main/visualization-equipment-operation/visualization-equipment-operation.page.ts

@@ -2,7 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core';
 import { Router } from '@angular/router';
 import { SelectVideoComponent } from 'src/app/shared/compenents/select-video/select-video.component';
 import { Alert } from 'selenium-webdriver';
-// import { VideoCapturePlus, VideoCapturePlusOptions, MediaFile } from '@ionic-native/video-capture-plus/ngx';
+import { BusinessesHelper } from 'src/app/util/helper-classes/businesses-helper';
+import { UtilsService } from 'src/app/util/utilservers/utils.services';
+import { __core_private_testing_placeholder__ } from '@angular/core/testing';
 
 @Component({
   selector: 'visualization-equipment-operation',
@@ -11,34 +13,35 @@ import { Alert } from 'selenium-webdriver';
 })
 export class VisualizationEquipmentOperationPage implements OnInit {
   @ViewChild('selectvideo')
-  selectvideo:SelectVideoComponent;
+  selectvideo: SelectVideoComponent;
   constructor(
     private router: Router,
-    // private videoCapturePlus: VideoCapturePlus
+    private utilsService: UtilsService
   ) { }
 
   ngOnInit() {
+
+  }
+  uploadVideoList(e) {
+    console.log('1111')
+    console.log(e.length)
+    console.log(e)
   }
 
-  selectVideo() {
-    // const options: VideoCapturePlusOptions = {
-    //   limit: 1,
-    //   highquality: true,
-    //   portraitOverlay: 'assets/img/camera/overlay/portrait.png',
-    //   landscapeOverlay: 'assets/img/camera/overlay/landscape.png'
-    // }
-    // this.videoCapturePlus.captureVideo(options).then((mediafile: MediaFile[]) => {
-    //   alert(mediafile);
-    // }, (err) => {
-    //   alert(err);
-    // });
+
+  ionViewWillLeave() {
+
+  }
+  doUpload() {
+    this.selectvideo.uploadPhoto();
   }
 
   goBack() {
-    this.router.navigate(['/home/fieldvisualization'])
-  }
-  goPage(){
-    alert('goPage')
-    this.router.navigate(['/home/fieldvisualization'])
+    this.utilsService.arlt('保留此次编辑?', '不保存', '保存', (res) => {
+      this.router.navigate(['/home/fieldvisualization'])
+    }, (canle) => {
+      this.router.navigate(['/home/fieldvisualization'])
+    });
   }
+
 }

+ 9 - 14
src/app/modules/main/visualization-security-tools/visualization-security-tools.page.html

@@ -1,24 +1,19 @@
 <ion-header>
   <ion-toolbar color="primary">
-      <ion-buttons slot="start">
-          <ion-button (click)="goBack()">
-            <ion-icon slot="icon-only" name="arrow-back" color="light"></ion-icon>
-          </ion-button>
-        </ion-buttons>
+    <ion-buttons slot="start">
+      <ion-button (click)="goBack()">
+        <ion-icon slot="icon-only" name="arrow-back" color="light"></ion-icon>
+      </ion-button>
+    </ion-buttons>
     <ion-title>安全工器具</ion-title>
   </ion-toolbar>
 </ion-header>
 
 
-<ion-content>
-  <com-select-picture  #selectpicture ></com-select-picture>
-</ion-content>
-<ion-footer>
+<ion-footer id="oneHundredPercent">
   <ion-toolbar color="primary">
-    <ion-buttons slot="start" (click)="doUpload()">
-      <ion-button >  
-         <span>上传</span>
-      </ion-button>
-    </ion-buttons>
+    <div (click)="doUpload()">
+      <span>上 传</span>
+    </div>
   </ion-toolbar>
 </ion-footer>

+ 5 - 5
src/app/modules/main/visualization-security-tools/visualization-security-tools.page.ts

@@ -9,17 +9,17 @@ import { Router } from '@angular/router';
 })
 export class VisualizationSecurityToolsPage implements OnInit {
   @ViewChild('selectpicture')
-  selectpicture:SelectPictureComponent;
+  selectpicture: SelectPictureComponent;
   constructor(
     private router: Router,
   ) { }
 
   ngOnInit() {
   }
-  doUpload(){
-   
-    
-    
+  doUpload() {
+
+
+
   }
 
   goBack() {

+ 10 - 16
src/app/shared/compenents/select-picture/select-picture.component.html

@@ -1,4 +1,3 @@
-
 <ion-item>
   <ion-label>
     <ion-row>
@@ -10,20 +9,15 @@
     </ion-row>
   </ion-label>
 </ion-item>
-<ion-item *ngIf="error">
-  <ion-label>
-    <strong>{{error}}</strong>
-  </ion-label>
-</ion-item>
 <div>
   <ion-grid fixed>
-      <ion-row>
-        <ion-col size="6" *ngFor="let item of imageList">
-          <img [src]="item" />
-        </ion-col>
-      </ion-row>
-    </ion-grid>
-</div>
-<ion-button (click)="onClick()">
-  Click me
-</ion-button>
+    <ion-row>
+      <ion-col size="4" *ngFor="let item of imageList">
+        <img [src]="item" />
+      </ion-col>
+      <ion-col class="add" size="4">
+        <ion-icon name="add"></ion-icon>
+      </ion-col>
+    </ion-row>
+  </ion-grid>
+</div>

+ 20 - 0
src/app/shared/compenents/select-picture/select-picture.component.scss

@@ -0,0 +1,20 @@
+div{
+    ion-grid{
+        ion-row{
+            ion-col{
+                 border: 1px dotted #f4f5f8;
+            }
+            .add{
+                border: 1px dotted #f4f5f8;
+                background-color: #fff;
+                height: 120px;
+                ion-icon{
+                    height: 100px;
+                    width: 86px;
+                    margin: 0 0 0 6px;
+                }
+            }
+
+        }
+    }
+}

+ 5 - 5
src/app/shared/compenents/select-picture/select-picture.component.ts

@@ -64,8 +64,8 @@ export class SelectPictureComponent {
       allowEdit: true,   //允许编辑
       sourceType: srcType,
       saveToPhotoAlbum: true,  //允许保存到相册中
-      targetWidth: IMAGE_SIZE, // 缩放图像的宽度(像素),  /*宽度高度要设置*/
-      targetHeight: IMAGE_SIZE,
+      // targetWidth: IMAGE_SIZE, // 缩放图像的宽度(像素),  /*宽度高度要设置*/
+      // targetHeight: IMAGE_SIZE,
       mediaType: this.camera.MediaType.PICTURE
     }
     return options;
@@ -83,7 +83,7 @@ export class SelectPictureComponent {
             let options = this.setOptions(srcType);
             that.camera.getPicture(options).then((path) => {
               that.base64File(path);
-              that.uploadPhoto(path);
+              // that.uploadPhoto(path);
             }, (err) => {
               // Handle error
             });
@@ -95,7 +95,7 @@ export class SelectPictureComponent {
             let options = this.setOptions(srcType);
             that.camera.getPicture(options).then((path) => {
               that.base64File(path);
-              that.uploadPhoto(path);
+              // that.uploadPhoto(path);
             }, (err) => {
               // Handle error
             });
@@ -144,7 +144,7 @@ export class SelectPictureComponent {
   }
 
   private postData(formData: FormData) {
-    this.http.post<boolean>(`http://192.168.43.169:6006/appVisual/upload`, formData)
+    this.http.post<boolean>(`http://192.168.42.109:6006/appVisual/upload`, formData)
       .pipe(
         catchError(e => this.handleError(e)),
         finalize(() => this.loading.dismiss())

+ 15 - 2
src/app/shared/compenents/select-video/select-video.component.html

@@ -1,3 +1,16 @@
 <ion-button (click)="openVideo()">
-  Click me
-</ion-button>
+  拍摄视频
+</ion-button>
+<div>
+  <ion-grid fixed>
+    <ion-row>
+      <ion-col class="add" size="6" *ngFor="let item of videoList,let key=index">
+        <video width="180" height="240" controls="controls" (press)=tap(key)>
+          <source [src]="item" type="video/ogg">
+          <source [src]="item" type="video/mp4">
+          <source [src]="item" type="video/3gpp">
+        </video>
+      </ion-col>
+    </ion-row>
+  </ion-grid>
+</div>

+ 45 - 14
src/app/shared/compenents/select-video/select-video.component.ts

@@ -11,6 +11,7 @@ import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions, CaptureVide
 import { HttpClient } from '@angular/common/http';
 import { WebView } from '@ionic-native/ionic-webview/ngx';
 import { finalize, catchError } from 'rxjs/operators';
+import { UtilsService } from 'src/app/util/utilservers/utils.services';
 
 
 
@@ -23,6 +24,11 @@ import { finalize, catchError } from 'rxjs/operators';
 export class SelectVideoComponent {
   error: any;
   loading: any;
+  videoList: any = [];
+  videoPathList: any = [];
+  videoPath: any;
+  @Output()
+  uploadVideoList: EventEmitter<any> = new EventEmitter<any>();//选中
   constructor(
     private actionSheet: ActionSheetController,
     private camera: Camera,
@@ -35,11 +41,24 @@ export class SelectVideoComponent {
     private http: HttpClient,
     private loadingCtrl: LoadingController,
     protected webView: WebView,
+    public utilsService: UtilsService
 
 
   ) { }
+
+
+
+  tap(key: any) {
+    console.log(key)
+    this.utilsService.arlt('确定删除该视频?', '取消', '确定', (res) => {
+      this.videoList.pop(key)
+    }, (canle) => {
+
+    });
+  }
+
   openVideo() {
-    let path: any;
+    // let path: any;
     let options: CaptureVideoOptions = {
       limit: 1,
       quality: 0,  //1为高质量,0为低质量
@@ -49,14 +68,14 @@ export class SelectVideoComponent {
       .then(
         (data: MediaFile[]) => {
           for (let i = 0, len = data.length; i < len; i += 1) {
-            path = data[i].fullPath;
-            console.log(data[i])
-            console.log(path)
-            // do something interesting with the file
+            this.videoPath = data[i].fullPath;
+            this.base64File(this.videoPath);
+            console.log(JSON.stringify(this.videoList))
+
           }
+          this.videoPathList.push(this.videoPath)
           alert('成功的回调函数');
-          console.log(JSON.stringify(data))
-          this.uploadPhoto(path)
+
         },
         (err: CaptureError) => {
           alert('失败的回调函数');
@@ -65,18 +84,19 @@ export class SelectVideoComponent {
       );
   }
 
-  private async uploadPhoto(imageFileUri: any) {
+  public async uploadPhoto(imageFileUri?: any) {
     this.error = null;
     this.loading = await this.loadingCtrl.create({
       message: 'Uploading...'
     });
-
     this.loading.present();
+    this.videoPathList.forEach((item: any) => {
+      window['resolveLocalFileSystemURL'](item,
+        entry => {
+          entry['file'](file => this.readFile(file));
+        });
+    });
 
-    window['resolveLocalFileSystemURL'](imageFileUri,
-      entry => {
-        entry['file'](file => this.readFile(file));
-      });
   }
 
   private readFile(file: any) {
@@ -91,7 +111,7 @@ export class SelectVideoComponent {
   }
 
   private postData(formData: FormData) {
-    this.http.post<boolean>(`http://192.168.43.169:6006/appVisual/upload`, formData)
+    this.http.post<boolean>(`http://192.168.42.109:6006/appVisual/upload`, formData)
       .pipe(
         catchError(e => this.handleError(e)),
         finalize(() => this.loading.dismiss())
@@ -105,4 +125,15 @@ export class SelectVideoComponent {
     this.businesses.toast('上传成功')
   }
 
+  //文件转换为base64
+  base64File(path: any) {
+    this.base64.encodeFile(path).then((base64File: string) => {
+      this.videoList.push(this.sanitizer.bypassSecurityTrustResourceUrl(base64File));
+      this.uploadVideoList.emit(this.videoList);
+    }, (err) => {
+      console.log(err);
+    });
+  }
+
+
 }

+ 1 - 1
src/app/shared/servers/network.service.ts

@@ -9,7 +9,7 @@ export class NetworkService {
   options: any
   public config: any = {
     dev: 'http://127.0.0.1:6006/',
-    prod: 'http://192.168.43.169:6006/'
+    prod: 'http://192.168.42.109:6006/'
   }
   constructor(
     public http: HttpClient,

+ 0 - 12
src/app/shared/servers/tabs.service.spec.ts

@@ -1,12 +0,0 @@
-import { TestBed } from '@angular/core/testing';
-
-import { TabsService } from './tabs.service';
-
-describe('TabsService', () => {
-  beforeEach(() => TestBed.configureTestingModule({}));
-
-  it('should be created', () => {
-    const service: TabsService = TestBed.get(TabsService);
-    expect(service).toBeTruthy();
-  });
-});

+ 4 - 4
src/app/shared/servers/tabs.service.ts

@@ -53,12 +53,12 @@ export class TabsService {
     // Result: new-group?type=group
     let page = pageUrl.split('?')[0];
     // console.log(page==='fieldmonitoring');
-    if(page ===''|| page ==='login'){
-       return
+    if (page === '' || page === 'login') {
+      return
     }
-    if(page ==='home' || page==='fieldmonitoring' ||page==='intelligentalarm' || page==='personalcenter' ){
+    if (page === 'home' || page === 'fieldmonitoring' || page === 'intelligentalarm' || page === 'personalcenter') {
       this.showTabs()
-    }else{
+    } else {
       this.hideTabs()
     }
   }

+ 164 - 135
src/app/util/helper-classes/businesses-helper.ts

@@ -4,10 +4,10 @@ import { Observable } from 'rxjs';
 import { PopoverController, AlertController, PickerController, ToastController, ActionSheetController, Platform, LoadingController } from '@ionic/angular';
 import { EventService } from 'src/app/shared/servers/envent.service';
 import { ImagePicker } from '@ionic-native/image-picker/ngx';
-import { Camera,CameraOptions} from '@ionic-native/camera/ngx';
+import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
 declare enum LocalFileSystem {
-  PERSISTENT= 0,
-  TEMPORARY= 1
+  PERSISTENT = 0,
+  TEMPORARY = 1
 }
 declare let window: {
   requestFileSystem: any,
@@ -29,40 +29,40 @@ export class BusinessesHelper {
     public alertController: AlertController,
     public pickerCtrl: PickerController,
     public toastCtrl: ToastController,
-    public eventService:EventService,
+    public eventService: EventService,
     public actionSheetController: ActionSheetController,
     public platform: Platform,
     public toastController: ToastController,
-    public loadingController:LoadingController,
+    public loadingController: LoadingController,
     private imagePicker: ImagePicker,
   ) {
     this.IsMobile = this.platform.is('cordova');
   }
-   
-       /**
-     * 断言是否真机环境
-     */
-    assertIsMobile(): void {
-      if (this.isNotMobile()) {
-          this.toast('请使用真机调试');
-          throw new Error('请使用真机调试');
-      } 
+
+  /**
+* 断言是否真机环境
+*/
+  assertIsMobile(): void {
+    if (this.isNotMobile()) {
+      this.toast('请使用真机调试');
+      throw new Error('请使用真机调试');
+    }
   }
-    /**
-     * 是否真机环境
-     */
-    isMobile(): boolean {
-      return this.IsMobile;
+  /**
+   * 是否真机环境
+   */
+  isMobile(): boolean {
+    return this.IsMobile;
   }
-    /**
-     * 是否真机环境
-     */
-    isNotMobile(): boolean {
-      return !this.isMobile();
+  /**
+   * 是否真机环境
+   */
+  isNotMobile(): boolean {
+    return !this.isMobile();
   }
 
   // 提示框
-   async tip(msg:string, butText = '确定', icon?: string , callback?: Function) {
+  async tip(msg: string, butText = '确定', icon?: string, callback?: Function) {
     let message = `<div>${msg}</div>`;
     if (icon === 'success') {
       message = `<div class="alert-icon"><i></i></div><div>${msg}</div>`;
@@ -73,7 +73,7 @@ export class BusinessesHelper {
     } else if (icon) {
       message = `<div class="alert-icon"><i></i></div><div>${msg}</div>`;
     }
-    let alert =await this.alertController.create({
+    let alert = await this.alertController.create({
       header: '提示框',
       message: message,
       buttons: [
@@ -92,27 +92,31 @@ export class BusinessesHelper {
   }
 
   //确认框
-  async showConfirm(message: string, sureBackcall?: Function, canleBackcall?: Function) {
-    const confirm =await this.alertController.create({
+  async showConfirm(message: string, canle?: string, sure?: string, sureBackcall?: Function, canleBackcall?: Function) {
+    if (!canle) {
+      canle = '取消'
+    }
+    if (!sure) {
+      sure = '确定'
+    }
+    const confirm = await this.alertController.create({
       message: message,
       buttons: [
         {
           cssClass: "tip-button-cancel",
-          text: '取消',
+          text: canle,
           handler: () => {
-            console.log('Disagree clicked');
             if (canleBackcall) {
-              canleBackcall();
+              canleBackcall('eeeee');
             }
           }
         },
         {
           cssClass: "tip-button-confirm",
-          text: '确定',
+          text: sure,
           handler: () => {
-            console.log('Agree clicked');
             if (sureBackcall) {
-              sureBackcall();
+              sureBackcall('eeees');
             }
           }
         }
@@ -121,6 +125,31 @@ export class BusinessesHelper {
     await confirm.present();
   }
 
+  public async arlt(msg: String, sureBackcall?: Function, canleBackcall?: Function) {
+    let message = `<div>${msg}</div>`;
+    const alert = await this.alertController.create({
+      header: '提示框',
+      message: message,
+      buttons: [
+        {
+          text: '取消',
+          role: 'cancel',
+          cssClass: 'secondary',
+          handler: (blah) => {
+            canleBackcall('canleBackcall'); //很好用
+
+          }
+        }, {
+          text: '确认',
+          handler: () => {
+            sureBackcall('sureBackcall');//很好用
+          }
+        }
+      ]
+    });
+    await alert.present();
+  }
+
   /**
      * alert弹框,默认只有确定按钮,当存在取消回调函数则会显示取消按钮
      * 注:如果存在打开的alert则不再打开
@@ -129,105 +158,105 @@ export class BusinessesHelper {
      * @param okBackFun 成功回调
      * @param cancelBtnFun 失败回调
      */
-    alert(header = '', message = '', okBackFun = null, cancelBtnFun = null): void {
-      // alertController.create是异步方法,所以使用AlertIsExist标志是否打开
-      if (this.AlertIsExist) {
-          console.log('alert已经存在,禁止重复打开');
-          setTimeout(() => { // alert关闭的可能性比较多,不止点击确定或取消按钮
-              this.AlertIsExist = false;
-          }, 10000);
-          return;
-      }
-      this.AlertIsExist = true;
-      const buttons = [{
-          text: '确定', handler: () => {
-              this.AlertIsExist = false;
-              okBackFun && okBackFun();
-          }
-      }];
-      if (cancelBtnFun) {
-          const cancelBtn = {
-              text: '取消',
-              role: 'cancel',
-              handler: () => {
-                  this.AlertIsExist = false;
-                  cancelBtnFun();
-              }
-          };
-          buttons.unshift(cancelBtn);
+  alert(header = '', message = '', okBackFun = null, cancelBtnFun = null): void {
+    // alertController.create是异步方法,所以使用AlertIsExist标志是否打开
+    if (this.AlertIsExist) {
+      console.log('alert已经存在,禁止重复打开');
+      setTimeout(() => { // alert关闭的可能性比较多,不止点击确定或取消按钮
+        this.AlertIsExist = false;
+      }, 10000);
+      return;
+    }
+    this.AlertIsExist = true;
+    const buttons = [{
+      text: '确定', handler: () => {
+        this.AlertIsExist = false;
+        okBackFun && okBackFun();
       }
-      this.alertController.create({
-          header,
-          message,
-          buttons
-      }).then(alert => alert.present());
+    }];
+    if (cancelBtnFun) {
+      const cancelBtn = {
+        text: '取消',
+        role: 'cancel',
+        handler: () => {
+          this.AlertIsExist = false;
+          cancelBtnFun();
+        }
+      };
+      buttons.unshift(cancelBtn);
+    }
+    this.alertController.create({
+      header,
+      message,
+      buttons
+    }).then(alert => alert.present());
   }
-   /**
-     * 显示提示信息
-     * 建议优先调用 NativeService.toast
-     */
-    toast(message: string = '操作成功', duration:any=200,color:any='warning', position: 'top' | 'bottom' | 'middle' = 'middle'): void {
-      const opts = { message, duration, color, position, showCloseButton: true, closeButtonText: '✖' };
-      console.log(opts)
-      this.toastController.create(opts).then(toast => toast.present());
+  /**
+    * 显示提示信息
+    * 建议优先调用 NativeService.toast
+    */
+  toast(message: string = '操作成功', duration: any = 200, color: any = 'warning', position: 'top' | 'bottom' | 'middle' = 'middle'): void {
+    const opts = { message, duration, color, position, showCloseButton: true, closeButtonText: '✖' };
+    console.log(opts)
+    this.toastController.create(opts).then(toast => toast.present());
   }
 
-  
-    /**
-     * 统一调用此方法显示loading
-     */
-    async showLoading() {
-      const loading = await this.loadingController.create({
-        spinner: 'crescent',
-        mode:'ios',
-        duration: 1000,
-        message: 'Please wait...',
-        translucent: true,
-        cssClass: 'custom-class custom-loading'
-      });
-      return await loading.present();
-    }
 
-     /**
-     * 统一调用此方法显示loading
-     */
-    showLoadingTest(message: string = ''): void {
+  /**
+   * 统一调用此方法显示loading
+   */
+  async showLoading() {
+    const loading = await this.loadingController.create({
+      spinner: 'crescent',
+      mode: 'ios',
+      duration: 1000,
+      message: 'Please wait...',
+      translucent: true,
+      cssClass: 'custom-class custom-loading'
+    });
+    return await loading.present();
+  }
+
+  /**
+  * 统一调用此方法显示loading
+  */
+  showLoadingTest(message: string = ''): void {
+    if (this.LoadingIsExist) {
+      return;
+    }
+    this.LoadingIsExist = true;
+    this.loadingController.create({
+      spinner: 'crescent', // dots https://ionicframework.com/docs/api/spinner
+      duration: 1000,
+      mode: 'ios',
+      message: 'Please wait...'
+    }).then(loading => {
+      // loadingController.create异步方法,调用loading.present()前有可能已经调用hideLoading方法
       if (this.LoadingIsExist) {
-          return;
+        loading.present();
+        this.Loading = loading;
+      } else {
+        loading.dismiss();
       }
-      this.LoadingIsExist = true;
-      this.loadingController.create({
-          spinner: 'crescent', // dots https://ionicframework.com/docs/api/spinner
-          duration: 1000,
-          mode:'ios',
-          message: 'Please wait...'
-      }).then(loading => {
-          // loadingController.create异步方法,调用loading.present()前有可能已经调用hideLoading方法
-          if (this.LoadingIsExist) {
-              loading.present();
-              this.Loading = loading;
-          } else {
-              loading.dismiss();
-          }
-      });
+    });
   }
 
-   /**
-     * 关闭loading
-     */
-    hideLoading(): void {
-      this.LoadingIsExist = false;
-      if (this.Loading) {
-          this.Loading.dismiss();
-          this.Loading = null;
-      }
+  /**
+    * 关闭loading
+    */
+  hideLoading(): void {
+    this.LoadingIsExist = false;
+    if (this.Loading) {
+      this.Loading.dismiss();
+      this.Loading = null;
+    }
   }
-  
-  
-  async presentActionSheet(param?:any,emit?:String,allback?: Function) {
-    let object:Object;
+
+
+  async presentActionSheet(param?: any, emit?: String, allback?: Function) {
+    let object: Object;
     const actionSheet = await this.actionSheetController.create({
-      header:'Albums',
+      header: 'Albums',
       mode: 'ios',
       buttons: [{
         text: '删除',
@@ -235,28 +264,28 @@ export class BusinessesHelper {
         icon: 'trash',
         handler: () => {
           console.log('Delete clicked');
-          this.eventService.event.emit(emit,object)
+          this.eventService.event.emit(emit, object)
         }
       }, {
         text: '分享',
         icon: 'share',
         handler: () => {
           console.log('Share clicked');
-          this.eventService.event.emit(emit,object)
+          this.eventService.event.emit(emit, object)
         }
       }, {
         text: '支付',
         icon: 'arrow-dropright-circle',
         handler: () => {
           console.log('Play clicked');
-          this.eventService.event.emit(emit,object)
+          this.eventService.event.emit(emit, object)
         }
       }, {
         text: '最爱',
         icon: 'heart',
         handler: () => {
           console.log('Favorite clicked');
-          this.eventService.event.emit(emit,object)
+          this.eventService.event.emit(emit, object)
         }
       }, {
         text: '取消',
@@ -264,17 +293,17 @@ export class BusinessesHelper {
         role: 'cancel',
         handler: () => {
           console.log('Cancel clicked');
-          this.eventService.event.emit(emit,object)
+          this.eventService.event.emit(emit, object)
         }
       }]
     });
     await actionSheet.present();
   }
 
-  async presentActionSheet1(param?:any,emit?:String,allback?: Function) {
-    let object:Object;
+  async presentActionSheet1(param?: any, emit?: String, allback?: Function) {
+    let object: Object;
     const actionSheet = await this.actionSheetController.create({
-      header:'Albums',
+      header: 'Albums',
       mode: 'md',
       buttons: [{
         text: '删除',
@@ -282,14 +311,14 @@ export class BusinessesHelper {
         icon: 'trash',
         handler: () => {
           console.log('Delete clicked');
-          this.eventService.event.emit(emit,object)
+          this.eventService.event.emit(emit, object)
         }
       }, {
         text: '分享',
         icon: 'share',
         handler: () => {
           console.log('Share clicked');
-          this.eventService.event.emit(emit,object)
+          this.eventService.event.emit(emit, object)
         }
       }]
     });
@@ -356,8 +385,8 @@ export class BusinessesHelper {
     });
   }
 
-  
-  
 
-  
+
+
+
 }

+ 92 - 0
src/app/util/utilservers/utils.services.ts

@@ -0,0 +1,92 @@
+
+import { Injectable } from "@angular/core";
+import { Observable } from 'rxjs';
+import { PopoverController, AlertController, PickerController, ToastController } from '@ionic/angular';
+
+
+
+// import { ReloadingController } from '../components/reloading/reloading-controller';
+declare enum LocalFileSystem {
+    PERSISTENT = 0,
+    TEMPORARY = 1
+}
+declare let window: {
+    requestFileSystem: any,
+    resolveLocalFileSystemURL: any
+};
+
+@Injectable()
+export class UtilsService {
+    static loadingObject: Array<any> = [];
+
+    constructor(
+        public popover: PopoverController,
+        public alertCtrl: AlertController,
+        public pickerCtrl: PickerController,
+        public toastCtrl: ToastController,
+
+
+
+
+    ) { }
+
+    //确认框
+    async showConfirm(message, sureBackcall?: Function, canleBackcall?: Function) {
+        const confirm = await this.alertCtrl.create({
+            message: message,
+            buttons: [
+                {
+                    cssClass: "tip-button-cancel",
+                    text: '取消',
+                    handler: () => {
+                        console.log('Disagree clicked');
+                        if (canleBackcall) {
+                            canleBackcall();
+                        }
+                    }
+                },
+                {
+                    cssClass: "tip-button-confirm",
+                    text: '确定',
+                    handler: () => {
+                        console.log('Agree clicked');
+                        if (sureBackcall) {
+                            sureBackcall();
+                        }
+                    }
+                }
+            ]
+        });
+        await confirm.present();
+    }
+
+
+    public async arlt(msg: String, cancel?: String, confirm?: String, sureBackcall?: Function, canleBackcall?: Function) {
+        let confirmBut = `${confirm}`
+        let cancelBut = `${cancel}`
+        let message = `<div>${msg}</div>`
+        const alert = await this.alertCtrl.create({
+            header: '提示框',
+            message: message,
+            buttons: [
+                {
+                    text: cancelBut,
+                    role: 'cancel',
+                    cssClass: 'secondary',
+                    handler: (blah) => {
+                        canleBackcall('canleBackcall');
+
+                    }
+                }, {
+                    text: confirmBut,
+                    handler: () => {
+                        sureBackcall('sureBackcall');//很好用
+
+                    }
+                }
+            ]
+        });
+        await alert.present();
+    }
+
+}

+ 15 - 0
src/global.scss

@@ -78,3 +78,18 @@
     }
   }
 
+  #oneHundredPercent{
+    ion-toolbar{
+        div{
+            height: 100%;
+            width: 100%;
+            text-align: center;
+            span{
+                font-size: 30px;
+                text-align: center
+
+            }
+        }
+    }
+}
+

+ 8 - 0
yarn.lock

@@ -2013,6 +2013,9 @@ cordova-plugin-device@^2.0.2:
   resolved "http://registry.npm.taobao.org/cordova-plugin-device/download/cordova-plugin-device-2.0.2.tgz#fc08f3722e67eef7b6c67bfc99a83df6add0baba"
   integrity sha1-/Ajzci5n7ve2xnv8mag99q3Quro=
 
+"cordova-plugin-dingxin-sso@file:myplugin/yi-dong-ying-yong-copy":
+  version "1.0.11"
+
 cordova-plugin-file-opener2@2.2.0:
   version "2.2.0"
   resolved "https://registry.npm.taobao.org/cordova-plugin-file-opener2/download/cordova-plugin-file-opener2-2.2.0.tgz#f562f1b02a2a66c6c4dbfd9e3b5d861bd99efe41"
@@ -2048,6 +2051,11 @@ cordova-plugin-ionic-webview@^3.1.2:
   resolved "http://registry.npm.taobao.org/cordova-plugin-ionic-webview/download/cordova-plugin-ionic-webview-3.1.2.tgz#80fe1e82067ad8dcbc5ecf00cad2f8dfa0d0e10f"
   integrity sha1-gP4eggZ62Ny8Xs8AytL436DQ4Q8=
 
+cordova-plugin-media-capture@3.0.2:
+  version "3.0.2"
+  resolved "https://registry.npm.taobao.org/cordova-plugin-media-capture/download/cordova-plugin-media-capture-3.0.2.tgz#da657c2faadcfc7fdc2868e59d215ed83e700c3a"
+  integrity sha1-2mV8L6rc/H/cKGjlnSFe2D5wDDo=
+
 cordova-plugin-nativestorage@2.3.2:
   version "2.3.2"
   resolved "https://registry.npm.taobao.org/cordova-plugin-nativestorage/download/cordova-plugin-nativestorage-2.3.2.tgz#d6a1d50632aff2a70227102f68bc605e91aabca2"