Browse Source

[完善]功能删减

tianjin
邵佳豪 2 years ago
parent
commit
40f5bb9789
  1. 2
      angular.json
  2. 5
      proxy.config.json
  3. 121
      src/app/app-routing.module.ts
  4. 3
      src/app/app.module.ts
  5. 4
      src/app/key-unit/basicinfo/basicinfo.component.html
  6. 2
      src/app/key-unit/basicinfo/basicinfo.component.ts
  7. 10
      src/app/key-unit/edit-plan-info/edit-plan-info.component.html
  8. 24
      src/app/key-unit/edit-unit-info/edit-unit-info.component.html
  9. 7
      src/app/key-unit/edit-unit-info/edit-unit-info.component.ts
  10. 2
      src/app/key-unit/key-unit-management/key-unit-management.component.html
  11. 19
      src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html
  12. 10
      src/app/key-unit/view-unit-details/view-unit-details.component.html
  13. 43
      src/app/plan-audit/plan-record/plan-record.component.ts
  14. 35
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  15. 4
      src/app/plan-management/entry-plan-look/AddPlanone.html
  16. 2
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  17. 8
      src/app/test/test.component.html
  18. 17
      src/app/test/test.component.scss
  19. 25
      src/app/test/test.component.spec.ts
  20. 56
      src/app/test/test.component.ts
  21. 30
      src/app/ui/organization/organization.component.html
  22. 697
      src/app/ui/organization/organization.component.ts
  23. 18
      src/index.html

2
angular.json

@ -34,8 +34,6 @@
], ],
"scripts": [ "scripts": [
"node_modules/echarts/dist/echarts.js", "node_modules/echarts/dist/echarts.js",
"src/assets/mTokenK1/mToken_K1.js",
"src/assets/kmap/kmap-service-main-kd.js",
"./node_modules/swiper/js/swiper.min.js", "./node_modules/swiper/js/swiper.min.js",
"src/assets/chartstheme/westeros.js", "src/assets/chartstheme/westeros.js",
"src/assets/chartstheme/walden.js", "src/assets/chartstheme/walden.js",

5
proxy.config.json

@ -1,9 +1,6 @@
{ {
"/api": { "/api": {
"target": "http://10.81.73.39:8000/", "target": "http://121.36.37.70:8223/",
"生产": "http://10.81.73.39:8000/",
"测试": "http://121.36.37.70:8201/",
"生产2": "http://183.194.244.232:8088/",
"secure": false, "secure": false,
"changeOrigin": true "changeOrigin": true
} }

121
src/app/app-routing.module.ts

@ -6,49 +6,102 @@
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-07-29 10:26:58 * @LastEditTime: 2021-07-29 10:26:58
*/ */
import { NgModule } from '@angular/core'; import { NgModule } from "@angular/core";
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from "@angular/router";
import { LoginComponent } from './pages/login/login.component'; import { LoginComponent } from "./pages/login/login.component";
import { NavigationComponent } from './navigation/navigation.component'; import { NavigationComponent } from "./navigation/navigation.component";
import {HomeComponent} from './home/home.component' import { HomeComponent } from "./home/home.component";
import { PlanPassComponent } from '../app/plan-audit/plan-pass/plan-pass.component'; import { PlanPassComponent } from "../app/plan-audit/plan-pass/plan-pass.component";
//路由守卫 //路由守卫
import {AuthGuard} from './auth.guard' import { AuthGuard } from "./auth.guard";
import {MTokenK1Component} from './m-token-k1/m-token-k1.component' //K1秘钥 import { MTokenK1Component } from "./m-token-k1/m-token-k1.component"; //K1秘钥
import {ViewUnitDetailsPlanComponent} from './key-unit/view-unit-details-plan/view-unit-details-plan.component' import { ViewUnitDetailsPlanComponent } from "./key-unit/view-unit-details-plan/view-unit-details-plan.component";
import { TestComponent } from './test/test.component'; import { ExternalLinksPlanComponent } from "./external-links-plan/external-links-plan.component";
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component'; import { CreatePlanOnlineFiveComponent } from "./plan-management/create-plan-online-five/create-plan-online-five.component";
import { CreatePlanOnlineFiveComponent } from './plan-management/create-plan-online-five/create-plan-online-five.component' import { ExportExcelComponent } from "./export-excel/export-excel.component";
import { ExportExcelComponent } from './export-excel/export-excel.component'
const routes: Routes = [ const routes: Routes = [
{path:'',redirectTo:'login',pathMatch:'full'}, { path: "", redirectTo: "login", pathMatch: "full" },
{ {
path:'',component:NavigationComponent,canActivate: [AuthGuard],//守卫验证 path: "",
component: NavigationComponent,
canActivate: [AuthGuard], //守卫验证
children: [ children: [
{path:'ui',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)}, {
{path:'keyUnit',loadChildren:() => import('./key-unit/key-unit.module').then(m => m.KeyUnitModule)}, path: "ui",
{path:'planManagement',loadChildren:() => import('./plan-management/plan-management.module').then(m => m.PlanManagementModule)}, loadChildren: () => import("./ui/ui.module").then((m) => m.UiModule),
{path:'planAudit',loadChildren:() => import('./plan-audit/plan-audit.module').then(m => m.PlanAuditModule)}, },
{path:'visualization',component: HomeComponent}, {
{path:'gis',loadChildren:() => import('./gis-management/gis-management.module').then(m => m.GISManagementModule)}, path: "keyUnit",
{path:'statisticanalysis',loadChildren:() => import('./statistic-analysis/statistic-analysis.module').then(m => m.StatisticAnalysisModule)}, loadChildren: () =>
{path:'dataCollection',loadChildren:() => import('./data-collection/data-collection.module').then(m => m.DataCollectionModule)}, import("./key-unit/key-unit.module").then((m) => m.KeyUnitModule),
] },
}, {
{path:'login',component:LoginComponent}, path: "planManagement",
{path:'keyUnit/viewunitinfoplans', component:ViewUnitDetailsPlanComponent,canActivate: [AuthGuard],}, loadChildren: () =>
{path:'getNoMToken',component:MTokenK1Component, canActivate: [AuthGuard],}, //K1秘钥验证失败是跳转页面 import("./plan-management/plan-management.module").then(
{path:'planAudit/planpass', component: PlanPassComponent , canActivate: [AuthGuard]}, (m) => m.PlanManagementModule
{path:'test', component: TestComponent }, ),
{path:'linksPlan', component: ExternalLinksPlanComponent }, },
{path:'CreatePlanOnlineFive',component:CreatePlanOnlineFiveComponent}, {
{path:'exportExcel',component:ExportExcelComponent, canActivate: [AuthGuard]}, path: "planAudit",
loadChildren: () =>
import("./plan-audit/plan-audit.module").then(
(m) => m.PlanAuditModule
),
},
{ path: "visualization", component: HomeComponent },
{
path: "gis",
loadChildren: () =>
import("./gis-management/gis-management.module").then(
(m) => m.GISManagementModule
),
},
{
path: "statisticanalysis",
loadChildren: () =>
import("./statistic-analysis/statistic-analysis.module").then(
(m) => m.StatisticAnalysisModule
),
},
{
path: "dataCollection",
loadChildren: () =>
import("./data-collection/data-collection.module").then(
(m) => m.DataCollectionModule
),
},
],
},
{ path: "login", component: LoginComponent },
{
path: "keyUnit/viewunitinfoplans",
component: ViewUnitDetailsPlanComponent,
canActivate: [AuthGuard],
},
{
path: "getNoMToken",
component: MTokenK1Component,
canActivate: [AuthGuard],
}, //K1秘钥验证失败是跳转页面
{
path: "planAudit/planpass",
component: PlanPassComponent,
canActivate: [AuthGuard],
},
{ path: "linksPlan", component: ExternalLinksPlanComponent },
{ path: "CreatePlanOnlineFive", component: CreatePlanOnlineFiveComponent },
{
path: "exportExcel",
component: ExportExcelComponent,
canActivate: [AuthGuard],
},
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes)], imports: [RouterModule.forRoot(routes)],
exports: [RouterModule] exports: [RouterModule],
}) })
export class AppRoutingModule {} export class AppRoutingModule {}

3
src/app/app.module.ts

@ -9,7 +9,6 @@ import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav'; import { MatSidenavModule } from '@angular/material/sidenav';
import { NavigationModule } from './navigation/navigation.module'; import { NavigationModule } from './navigation/navigation.module';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
import { TabbarComponent } from './tabbar/tabbar.component';
import { PagesModule } from './pages/pages.module'; import { PagesModule } from './pages/pages.module';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { UiModule } from './ui/ui.module'; import { UiModule } from './ui/ui.module';
@ -22,7 +21,6 @@ import { CountdownModule } from 'ngx-countdown'; //倒计时插件
import { GISManagementModule } from './gis-management/gis-management.module'; import { GISManagementModule } from './gis-management/gis-management.module';
import { DataCollectionModule } from './data-collection/data-collection.module'; import { DataCollectionModule } from './data-collection/data-collection.module';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { TestComponent } from './test/test.component';
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component'; import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component';
import { SearchDownList } from '../modules/map/declare/component/SearchDownListPlugins/SearchDownList'; import { SearchDownList } from '../modules/map/declare/component/SearchDownListPlugins/SearchDownList';
import { ExportExcelComponent } from './export-excel/export-excel.component'; import { ExportExcelComponent } from './export-excel/export-excel.component';
@ -34,7 +32,6 @@ registerLocaleData(zh);
AppComponent, AppComponent,
HomeComponent, HomeComponent,
MTokenK1Component, MTokenK1Component,
TestComponent,
ExternalLinksPlanComponent, ExternalLinksPlanComponent,
SearchDownList, SearchDownList,
ExportExcelComponent ExportExcelComponent

4
src/app/key-unit/basicinfo/basicinfo.component.html

@ -117,7 +117,7 @@
</div> </div>
</div> </div>
<div class="mainright" id="setUnitPosition"> <div class="mainright" id="setUnitPosition">
<div style="width: 100%;height: 100%;" id="container"> <!-- <div style="width: 100%;height: 100%;" id="container">
</div> </div>
@ -151,7 +151,7 @@
<div class="setPosition" (click)="search()"> <div class="setPosition" (click)="search()">
搜索 搜索
</div> </div>
</div> </div> -->
</div> </div>
</div> </div>
</form> </form>

2
src/app/key-unit/basicinfo/basicinfo.component.ts

@ -413,7 +413,7 @@ export class BasicinfoComponent implements OnInit {
} else {//未标注 } else {//未标注
_this.isMapLabel = false _this.isMapLabel = false
} }
this.labelGis() // this.labelGis()
}) })
} }
) )

10
src/app/key-unit/edit-plan-info/edit-plan-info.component.html

@ -45,7 +45,7 @@
<app-function-division></app-function-division> <app-function-division></app-function-division>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="8.行车路线"> <!-- <mat-tab label="8.行车路线">
<ng-template matTabContent> <ng-template matTabContent>
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
@ -54,18 +54,18 @@
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>
</mat-tab> </mat-tab> -->
<mat-tab label="10.实景图"> <mat-tab label="8.实景图">
<ng-template matTabContent> <ng-template matTabContent>
<app-realistic-picture></app-realistic-picture> <app-realistic-picture></app-realistic-picture>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="11.上传CAD"> <mat-tab label="9.上传CAD">
<ng-template matTabContent> <ng-template matTabContent>
<app-uploading-cad></app-uploading-cad> <app-uploading-cad></app-uploading-cad>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="12.特别警示"> <mat-tab label="10.特别警示">
<ng-template matTabContent> <ng-template matTabContent>
<app-special-warning></app-special-warning> <app-special-warning></app-special-warning>
</ng-template> </ng-template>

24
src/app/key-unit/edit-unit-info/edit-unit-info.component.html

@ -1,10 +1,3 @@
<!-- K1密钥拔出时倒计时显示 -->
<div style="width: 100%;height: 0;position: relative; z-index: 999;" *ngIf="mToken.isShow">
<div style="position: absolute;color: red;width: 100%;text-align: center;margin-top: 5%;font-size: 18px;">
<countdown [config]="{leftTime: 10,format: '密钥已拔出,本页面将于s秒后关闭,请及时保存'}"></countdown>
</div>
</div>
<mat-tab-group selectedIndex="10" style="height: 100%;"> <mat-tab-group selectedIndex="10" style="height: 100%;">
<mat-tab label="1.基本信息"> <mat-tab label="1.基本信息">
<ng-template matTabContent> <ng-template matTabContent>
@ -31,7 +24,7 @@
<app-function-division></app-function-division> <app-function-division></app-function-division>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="6.行车路线"> <!-- <mat-tab label="6.行车路线">
<ng-template matTabContent> <ng-template matTabContent>
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
@ -40,30 +33,25 @@
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>
</mat-tab> </mat-tab> -->
<mat-tab label="8.实景图"> <mat-tab label="6.实景图">
<ng-template matTabContent> <ng-template matTabContent>
<app-realistic-picture></app-realistic-picture> <app-realistic-picture></app-realistic-picture>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="9.上传CAD"> <mat-tab label="7.上传CAD">
<ng-template matTabContent> <ng-template matTabContent>
<app-uploading-cad></app-uploading-cad> <app-uploading-cad></app-uploading-cad>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="10.特别警示"> <mat-tab label="8.特别警示">
<ng-template matTabContent> <ng-template matTabContent>
<app-special-warning></app-special-warning> <app-special-warning></app-special-warning>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="11.作战部署"> <mat-tab label="9.作战部署">
<ng-template matTabContent> <ng-template matTabContent>
<app-collection-tools></app-collection-tools> <app-collection-tools></app-collection-tools>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<!-- <mat-tab label="11.unity作战部署">
<ng-template matTabContent>
<iframe id="main" src="/unityApp2/index.html" name="unityApp" frameborder="0" width="100%" height="98%"></iframe>
</ng-template>
</mat-tab> -->
</mat-tab-group> </mat-tab-group>

7
src/app/key-unit/edit-unit-info/edit-unit-info.component.ts

@ -1,9 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
// import { BasicinfoComponent } from '../basicinfo/basicinfo.component'
import { Router,ActivatedRoute } from '@angular/router'
import {MTokenK1Service} from '../../m-token-k1/m-token-k1.service' //引入服务
import { CollectionToolsComponent } from '../../../app/ui/collection-tools/collection-tools.component'
@Component({ @Component({
selector: 'app-edit-unit-info', selector: 'app-edit-unit-info',
@ -12,7 +7,7 @@ import { CollectionToolsComponent } from '../../../app/ui/collection-tools/colle
}) })
export class EditUnitInfoComponent implements OnInit { export class EditUnitInfoComponent implements OnInit {
constructor(private router:Router,private route:ActivatedRoute,public mToken: MTokenK1Service) { } constructor() { }
ngOnInit(): void { ngOnInit(): void {

2
src/app/key-unit/key-unit-management/key-unit-management.component.html

@ -352,7 +352,7 @@
<ng-container matColumnDef="operation"> <ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th> <th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element" class="operation"> <td mat-cell *matCellDef="let element" class="operation">
<span (click)="drill(element)">演练</span> <!-- <span (click)="drill(element)">演练</span> -->
<span (click)="unitdetails(element)">查看详情</span> <span (click)="unitdetails(element)">查看详情</span>
<span style="color: blue;margin-left: 4px;" <span style="color: blue;margin-left: 4px;"
*ngIf="(element.isNewData && (element.newVerifyState=='未提交审核'||element.newVerifyState=='审核通过' *ngIf="(element.isNewData && (element.newVerifyState=='未提交审核'||element.newVerifyState=='审核通过'

19
src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html

@ -24,7 +24,7 @@
<app-function-division-look></app-function-division-look> <app-function-division-look></app-function-division-look>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="6.行车路线"> <!-- <mat-tab label="6.行车路线">
<ng-template matTabContent> <ng-template matTabContent>
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
@ -33,32 +33,25 @@
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>
</mat-tab> </mat-tab> -->
<mat-tab label="8.实景图"> <mat-tab label="6.实景图">
<ng-template matTabContent> <ng-template matTabContent>
<app-realistic-picture-look></app-realistic-picture-look> <app-realistic-picture-look></app-realistic-picture-look>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="9.上传CAD"> <mat-tab label="7.上传CAD">
<ng-template matTabContent> <ng-template matTabContent>
<app-uploading-cad-look></app-uploading-cad-look> <app-uploading-cad-look></app-uploading-cad-look>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="10.特别警示"> <mat-tab label="8.特别警示">
<ng-template matTabContent> <ng-template matTabContent>
<app-special-warning></app-special-warning> <app-special-warning></app-special-warning>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="11.作战部署"> <mat-tab label="9.作战部署">
<ng-template matTabContent> <ng-template matTabContent>
<app-collection-tools></app-collection-tools> <app-collection-tools></app-collection-tools>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<!-- <mat-tab label="11.unity作战部署">
<ng-template matTabContent>
<app-collection-tools></app-collection-tools>
<iframe id="main" src="/unityApp2/index.html" name="unityApp" frameborder="0" width="100%" height="98%"></iframe>
</ng-template>
</mat-tab> -->
</mat-tab-group> </mat-tab-group>

10
src/app/key-unit/view-unit-details/view-unit-details.component.html

@ -44,7 +44,7 @@
<app-function-division-look></app-function-division-look> <app-function-division-look></app-function-division-look>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="8.行车路线"> <!-- <mat-tab label="8.行车路线">
<ng-template matTabContent> <ng-template matTabContent>
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
@ -53,18 +53,18 @@
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>
</mat-tab> </mat-tab> -->
<mat-tab label="10.实景图"> <mat-tab label="8.实景图">
<ng-template matTabContent> <ng-template matTabContent>
<app-realistic-picture-look></app-realistic-picture-look> <app-realistic-picture-look></app-realistic-picture-look>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="11.上传CAD"> <mat-tab label="9.上传CAD">
<ng-template matTabContent> <ng-template matTabContent>
<app-uploading-cad-look></app-uploading-cad-look> <app-uploading-cad-look></app-uploading-cad-look>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="12.特别警示"> <mat-tab label="10.特别警示">
<ng-template matTabContent> <ng-template matTabContent>
<app-special-warning></app-special-warning> <app-special-warning></app-special-warning>
</ng-template> </ng-template>

43
src/app/plan-audit/plan-record/plan-record.component.ts

@ -9,8 +9,7 @@ import {
import { HttpClient } from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer } from "@angular/platform-browser";
import { Viewer } from "photo-sphere-viewer"; import { Viewer } from "photo-sphere-viewer";
declare var CryptoJS; import * as ViewerJs from "viewerjs";
@Component({ @Component({
selector: "app-plan-record", selector: "app-plan-record",
templateUrl: "./plan-record.component.html", templateUrl: "./plan-record.component.html",
@ -152,9 +151,9 @@ export class PlanRecordComponent implements OnInit {
postlevel: any; postlevel: any;
bianzhi = false; bianzhi = false;
tableClick(e, item) { tableClick(e, item) {
console.log(item);
this.showtype = -1; this.showtype = -1;
//e.target.parentElement.bgColor='#2196F3'
// console.log(item)
this.organizationName = ""; this.organizationName = "";
this.itemid = item.itemId; this.itemid = item.itemId;
this.id = item.id; this.id = item.id;
@ -206,9 +205,9 @@ export class PlanRecordComponent implements OnInit {
this.http this.http
.get(`/api/PlanComponents/${item.itemId}`) .get(`/api/PlanComponents/${item.itemId}`)
.subscribe((data: any) => { .subscribe((data: any) => {
console.log("预案详情", data);
this.companyId = data.companyId; this.companyId = data.companyId;
this.companyName = data.companyName; this.companyName = data.companyName;
//this.bianzhi = false
if (data.planType != 2 && data.planType != 1) { if (data.planType != 2 && data.planType != 1) {
if (data.planMode == 2) { if (data.planMode == 2) {
this.showtype = 0; this.showtype = 0;
@ -217,11 +216,17 @@ export class PlanRecordComponent implements OnInit {
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl( this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(
this.src this.src
); );
//this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}`
} else { } else {
this.bianzhi = false; this.bianzhi = false;
this.fetchUrl = data.attachmentUrls[0]; this.fetchUrl = data.attachmentUrls[0];
var index = this.fetchUrl.indexOf("/"); var index = this.fetchUrl.indexOf("/");
let isImg;
if (
this.fetchUrl.indexOf("png") !== -1 ||
this.fetchUrl.indexOf("jpg") !== -1
) {
isImg = true;
}
if (this.fetchUrl.substr(0, index) == "psw") { if (this.fetchUrl.substr(0, index) == "psw") {
this.showtype = 1; this.showtype = 1;
var obj = document.getElementById("viewer"); var obj = document.getElementById("viewer");
@ -234,6 +239,26 @@ export class PlanRecordComponent implements OnInit {
panorama: "/api/Objects/PlanPlatform/" + this.fetchUrl, panorama: "/api/Objects/PlanPlatform/" + this.fetchUrl,
}); });
}); });
} else if (isImg) {
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement("img");
node.style.display = "none";
node.src = "/api/Objects/PlanPlatform/" + this.fetchUrl;
node.id = "img";
dom.appendChild(node);
setTimeout(() => {
let viewer = new ViewerJs(
document.getElementById(`viewerjs`),
{
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
},
}
);
node.click();
}, 0);
} else { } else {
this.lookWord(); this.lookWord();
} }
@ -243,10 +268,6 @@ export class PlanRecordComponent implements OnInit {
this.planData = data; this.planData = data;
this.handleData(); this.handleData();
return; return;
//this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`
//this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`)
} }
}); });
} }
@ -261,8 +282,6 @@ export class PlanRecordComponent implements OnInit {
} }
} }
this.radioid = item.itemId; this.radioid = item.itemId;
/* this.chuorzhong=item.verifyState
this.radioid=item.itemId */
} }
//毕升 //毕升

35
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -18,9 +18,8 @@ import { HttpClient } from "@angular/common/http";
declare var CryptoJS; declare var CryptoJS;
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer } from "@angular/platform-browser";
import { Viewer as photoViewer } from "photo-sphere-viewer"; import { Viewer as photoViewer } from "photo-sphere-viewer";
import Viewer from "viewerjs";
declare var echarts: any; declare var echarts: any;
import * as ViewerJs from "viewerjs";
@Component({ @Component({
selector: "app-wait-examineer", selector: "app-wait-examineer",
templateUrl: "./wait-examineer.component.html", templateUrl: "./wait-examineer.component.html",
@ -197,8 +196,6 @@ export class WaitExamineerComponent implements OnInit {
bianzhi = false; bianzhi = false;
radioClick(e, item) { radioClick(e, item) {
this.selectedItem = item; this.selectedItem = item;
// console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) )
if (item.contentType == 11 && this.selectedItem.differentContent) { if (item.contentType == 11 && this.selectedItem.differentContent) {
let differentContent = JSON.parse(this.selectedItem.differentContent); let differentContent = JSON.parse(this.selectedItem.differentContent);
@ -272,9 +269,6 @@ export class WaitExamineerComponent implements OnInit {
}); });
} }
} }
// console.log('功能分区', this.differentContentOfFunction)
this.showtype = -1; this.showtype = -1;
this.organizationName = ""; this.organizationName = "";
this.itemid = item.itemId; this.itemid = item.itemId;
@ -349,6 +343,13 @@ export class WaitExamineerComponent implements OnInit {
this.bianzhi = false; this.bianzhi = false;
this.fetchUrl = data.attachmentUrls[0]; this.fetchUrl = data.attachmentUrls[0];
var index = this.fetchUrl.indexOf("/"); var index = this.fetchUrl.indexOf("/");
let isImg;
if (
this.fetchUrl.indexOf("png") !== -1 ||
this.fetchUrl.indexOf("jpg") !== -1
) {
isImg = true;
}
if (this.fetchUrl.substr(0, index) == "psw") { if (this.fetchUrl.substr(0, index) == "psw") {
this.showtype = 1; this.showtype = 1;
var obj = document.getElementById("viewer"); var obj = document.getElementById("viewer");
@ -361,6 +362,26 @@ export class WaitExamineerComponent implements OnInit {
panorama: "/api/Objects/PlanPlatform/" + this.fetchUrl, panorama: "/api/Objects/PlanPlatform/" + this.fetchUrl,
}); });
}); });
} else if (isImg) {
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement("img");
node.style.display = "none";
node.src = "/api/Objects/PlanPlatform/" + this.fetchUrl;
node.id = "img";
dom.appendChild(node);
setTimeout(() => {
let viewer = new ViewerJs(
document.getElementById(`viewerjs`),
{
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
},
}
);
node.click();
}, 0);
} else { } else {
this.lookWord(); this.lookWord();
} }

4
src/app/plan-management/entry-plan-look/AddPlanone.html

@ -61,12 +61,12 @@
<input style="width: 175px;" type="file" name="" id="uploadFile" *ngIf="isup" (change)="filechange($event)"> <input style="width: 175px;" type="file" name="" id="uploadFile" *ngIf="isup" (change)="filechange($event)">
<span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span> <span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span>
</div> </div>
<div *ngIf="inputword"> <!-- <div *ngIf="inputword">
<mat-radio-button value="2" style="margin-right: 10px;">模板在线编制</mat-radio-button> <mat-radio-button value="2" style="margin-right: 10px;">模板在线编制</mat-radio-button>
</div> </div>
<div *ngIf="inputNew"> <div *ngIf="inputNew">
<mat-radio-button value="4" style="margin-right: 10px;">自定义在线编制</mat-radio-button> <mat-radio-button value="4" style="margin-right: 10px;">自定义在线编制</mat-radio-button>
</div> </div> -->
<!-- <div *ngIf="inputword"> <!-- <div *ngIf="inputword">
<mat-radio-button value="1" style="margin-right: 10px;">导入word文档</mat-radio-button> <mat-radio-button value="1" style="margin-right: 10px;">导入word文档</mat-radio-button>

2
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -131,7 +131,7 @@
<ng-container *ngIf="isoperation == 'false'" matColumnDef="operation"> <ng-container *ngIf="isoperation == 'false'" matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th> <th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<span (click)="sixFamiliarize(element)">六熟悉</span> <!-- <span (click)="sixFamiliarize(element)">六熟悉</span> -->
<span (click)="lookPlan(element)">查看</span> <span (click)="lookPlan(element)">查看</span>
<span (click)="readFile(element)" <span (click)="readFile(element)"
[ngClass]="{'grey': element.planMode == '1' || element.planMode == '2' || element.planMode == '3'}">下载</span> [ngClass]="{'grey': element.planMode == '1' || element.planMode == '2' || element.planMode == '3'}">下载</span>

8
src/app/test/test.component.html

@ -1,8 +0,0 @@
<div class="box">
<button mat-button style="position: absolute;left: 50%;top: 0;z-index: 999;" (click)="createimg()">生成图片</button>
<div id="mapxxx"></div>
<div class="img">
<img [src]="canvasImg" alt="">
</div>
</div>

17
src/app/test/test.component.scss

@ -1,17 +0,0 @@
.box{
width: 100%;
height: 100%;
display: flex;
#mapxxx{
width: 500px;
height: 500px;
}
.img{
width: 500px;
height: 500px;
img{
width: 500px;
height: 500px;
}
}
}

25
src/app/test/test.component.spec.ts

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

56
src/app/test/test.component.ts

@ -1,56 +0,0 @@
import { Component, OnInit } from '@angular/core';
declare var html2canvas: any;
declare var AMap: any;
@Component({
selector: 'app-test',
templateUrl: './test.component.html',
styleUrls: ['./test.component.scss']
})
export class TestComponent implements OnInit {
constructor() { }
map: any
ngOnInit(): void {
setTimeout(() => {
this.map = new AMap.Map('mapxxx', {
WebGLParams: {
preserveDrawingBuffer: true
}
});
this.map.setCity('上海市');
}, 0);
}
//生成图片
canvasImg
createimg() {
// 使用html2canvas插件,将数据源中的数据转换成画布。
html2canvas(document.querySelector("#mapxxx"), {
useCORS: true,
onrendered: function (canvas) {
var dataUrl = canvas.toDataURL("image/png");
}
}).then(canvas => {
// 修改生成的宽度
// canvas.style.width = "1000px";
console.log(canvas, "生成的画布文件");
this.canvasImg = canvas.toDataURL("image/png");
// console.log(this.canvasImg)
}).then(() => {
this.downloadFile("导出图片", this.canvasImg);
})
}
downloadFile(filename, content) {
var base64Img = content;
var oA = document.createElement('a');
oA.href = base64Img;
oA.download = filename;
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
oA.dispatchEvent(event);
}
}

30
src/app/ui/organization/organization.component.html

@ -1,4 +1,7 @@
<div class="box" style="height: 100%; overflow-y: auto;position: relative"> <div class="box" style="height: 100%; overflow-y: auto;position: relative">
<!-- <button mat-button (click)="createOne()">新增一级目录</button> -->
<div> <div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" > <mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<mat-tree-node *matTreeNodeDef="let node;" matTreeNodePadding (click)="getOffices(node)"> <mat-tree-node *matTreeNodeDef="let node;" matTreeNodePadding (click)="getOffices(node)">
@ -37,32 +40,5 @@
</mat-tree> </mat-tree>
</div> </div>
<!-- 组织机构下属机关 -->
<div class="rightDiv" *ngIf="selectedOrg">
<div class="topbox">
({{selectedOrg.name}})组织机构下属机关
<button style="width: 68px;margin: 0 12px;" mat-flat-button color="primary" (click)="addOffices()">新增</button>
</div>
<div class="listBox">
<ul>
<li *ngFor="let item of OfficesList">
<span>{{item.officeName}}</span>
<span class="btnbox">
<button mat-icon-button class="edit" (click)="editOffice(item)"><mat-icon>create</mat-icon></button>
<button mat-icon-button class="deleted" (click)="deleteOffice(item)"><mat-icon style="color: #f44336;">delete</mat-icon></button>
</span>
</li>
</ul>
<span style="text-align: center;" *ngIf="OfficesList && OfficesList.length == 0">
暂无下属机关
</span>
</div>
</div>
<div *ngIf="isloading" style="position: absolute;width: 100%;height: 100%;background-color: rgba(125, 125, 125, 0.3);z-index: 999;left: 0;top: 0;text-align: center;">
<mat-spinner style="position: fixed;top: 40%;left: 50%;transform: translate(-40%,-50%);"></mat-spinner>
<p style="position: fixed;top:53%;left: 53%;transform: translate(-53%,-50%);">努力加载中...</p>
</div>
</div> </div>

697
src/app/ui/organization/organization.component.ts

@ -1,21 +1,29 @@
import { Component, OnInit, Inject } from '@angular/core'; import { Component, OnInit, Inject } from "@angular/core";
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; import {
import {FlatTreeControl} from '@angular/cdk/tree'; MatTreeFlatDataSource,
import { HttpClient } from '@angular/common/http'; MatTreeFlattener,
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; } from "@angular/material/tree";
import {FormControl} from '@angular/forms'; import { FlatTreeControl } from "@angular/cdk/tree";
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { HttpClient } from "@angular/common/http";
import { TreeService } from '../../http-interceptors/tree.service' import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { FormControl } from "@angular/forms";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { TreeService } from "../../http-interceptors/tree.service";
@Component({ @Component({
selector: 'app-organization', selector: "app-organization",
templateUrl: './organization.component.html', templateUrl: "./organization.component.html",
styleUrls: ['./organization.component.scss'] styleUrls: ["./organization.component.scss"],
}) })
export class OrganizationComponent implements OnInit { export class OrganizationComponent implements OnInit {
data:any =[] //存储所有组织机构 data: any = []; //存储所有组织机构
newdata = []; newdata = [];
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数 private _transformer = (node, level: number) => {
//要给渲染节点传那些属性参数
return { return {
expandable: !!node.children && node.children.length > 0, expandable: !!node.children && node.children.length > 0,
name: node.name, name: node.name,
@ -28,22 +36,33 @@ export class OrganizationComponent implements OnInit {
isTop: node.isTop, isTop: node.isTop,
isBottom: node.isBottom, isBottom: node.isBottom,
code: node.code, code: node.code,
division:node.division division: node.division,
}; };
} };
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable); treeControl = new FlatTreeControl<any>(
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); (node) => node.level,
(node) => node.expandable
);
treeFlattener = new MatTreeFlattener(
this._transformer,
(node) => node.level,
(node) => node.expandable,
(node) => node.children
);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private tree: TreeService) { constructor(
} private http: HttpClient,
isloading:any = false //loading效果 public dialog: MatDialog,
public snackBar: MatSnackBar,
private tree: TreeService
) {}
isloading: any = false; //loading效果
//重新获取列表并且展开到上次位置的方法 //重新获取列表并且展开到上次位置的方法
getlist = (): void => { getlist = (): void => {
this.http.get('/api/Organizations').subscribe( this.http.get("/api/Organizations").subscribe((data: any) => {
(data:any)=>{
this.data = data; this.data = data;
this.newdata = this.tree.toTree(data) this.newdata = this.tree.toTree(data);
const nodes = this.treeControl.dataNodes; const nodes = this.treeControl.dataNodes;
const expandNodes = []; const expandNodes = [];
@ -53,76 +72,79 @@ export class OrganizationComponent implements OnInit {
} }
}); });
this.dataSource.data = this.newdata; this.dataSource.data = this.newdata;
let newNodes = this.treeControl.dataNodes; let newNodes = this.treeControl.dataNodes;
newNodes = newNodes.filter(n => { newNodes = newNodes.filter((n) => {
return expandNodes.indexOf(n.id) >= 0; return expandNodes.indexOf(n.id) >= 0;
}); });
newNodes.forEach(item => { newNodes.forEach((item) => {
this.treeControl.expand(item); this.treeControl.expand(item);
}); });
this.isloading = false this.isloading = false;
});
} };
)
}
//初始化视图 //初始化视图
ngOnInit() { ngOnInit() {
this.http.get('/api/Organizations').subscribe( this.http.get("/api/Organizations").subscribe((data: any) => {
(data:any)=>{
this.data = data; this.data = data;
this.dataSource.data = this.tree.toTree(data); this.dataSource.data = this.tree.toTree(data);
this.treeControl.expand(this.treeControl.dataNodes[0]); this.treeControl.expand(this.treeControl.dataNodes[0]);
} });
)
} }
hasChild = (_: number, node: any) => node.expandable; hasChild = (_: number, node: any) => node.expandable;
//创建组织按钮 //创建组织按钮
create(value) { create(value) {
const dialogRef = this.dialog.open(CreateOrganization, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(CreateOrganization, {
width: '260px', //调用open方法打开对话框并且携带参数过去
data: {id:value.id,childlength:value.children,level:value.level} width: "260px",
data: { id: value.id, childlength: value.children, level: value.level },
}); });
dialogRef.afterClosed().subscribe( dialogRef.afterClosed().subscribe((data) => {
data=>{
if (data) { if (data) {
this.getlist() this.getlist();
} }
});
} }
); createOne() {
const dialogRef = this.dialog.open(CreateOrganization, {
//调用open方法打开对话框并且携带参数过去
width: "260px",
data: { id: "", childlength: "", level: "" },
});
dialogRef.afterClosed().subscribe((data) => {
if (data) {
this.getlist();
}
});
} }
//编辑组织按钮 //编辑组织按钮
edit(node) { edit(node) {
const dialogRef = this.dialog.open(EditOrganization, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(EditOrganization, {
data: node //调用open方法打开对话框并且携带参数过去
data: node,
});
dialogRef.afterClosed().subscribe((data) => {
this.getlist();
}); });
dialogRef.afterClosed().subscribe(
data=>{
this.getlist()
}
);
} }
//删除组织按钮 //删除组织按钮
delete(value) { delete(value) {
var isdeleted = confirm("确定要删除此组织?") var isdeleted = confirm("确定要删除此组织?");
if (isdeleted) { if (isdeleted) {
//请求删除接口 //请求删除接口
this.isloading = true this.isloading = true;
this.http.delete(`/api/Organizations/${value.id}`).subscribe( data=>{ this.http.delete(`/api/Organizations/${value.id}`).subscribe((data) => {
this.getlist() this.getlist();
});
})
} }
} }
//禁用按钮 //禁用按钮
disable(value) { disable(value) {
this.isloading = true this.isloading = true;
if (!value.enabled) { if (!value.enabled) {
this.http.put( this.http
`/api/Organizations/${value.id}`, .put(`/api/Organizations/${value.id}`, {
{
id: value.id, id: value.id,
code: value.code, code: value.code,
name: value.name, name: value.name,
@ -130,32 +152,29 @@ export class OrganizationComponent implements OnInit {
order: value.order, order: value.order,
location: null, location: null,
enabled: true, enabled: true,
parentId: value.parentId parentId: value.parentId,
} })
).subscribe( .subscribe(
data=>{ (data) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('启用成功','确定',config); this.snackBar.open("启用成功", "确定", config);
this.getlist() this.getlist();
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('操作无效','确定',config); this.snackBar.open("操作无效", "确定", config);
this.isloading = false this.isloading = false;
} }
) );
} else { } else {
// var isdeleted = confirm("确定要禁用此组织?") // var isdeleted = confirm("确定要禁用此组织?")
// if(isdeleted){ // if(isdeleted){
this.http.put( this.http
`/api/Organizations/${value.id}`, .put(`/api/Organizations/${value.id}`, {
{
id: value.id, id: value.id,
code: value.code, code: value.code,
name: value.name, name: value.name,
@ -163,49 +182,47 @@ export class OrganizationComponent implements OnInit {
order: value.order, order: value.order,
location: null, location: null,
enabled: false, enabled: false,
parentId: value.parentId parentId: value.parentId,
} })
).subscribe( .subscribe(
data=>{ (data) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('禁用成功','确定',config); this.snackBar.open("禁用成功", "确定", config);
this.getlist() this.getlist();
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('操作无效','确定',config); this.snackBar.open("操作无效", "确定", config);
this.isloading = false this.isloading = false;
} }
) );
// } // }
} }
} }
//向上箭头 //向上箭头
updata = [] updata = [];
up(node) { up(node) {
this.isloading = true this.isloading = true;
var olddata = this.data; var olddata = this.data;
// console.log(1,olddata) // console.log(1,olddata)
// console.log(2,node) // console.log(2,node)
this.updata = [] this.updata = [];
olddata.forEach(item => { olddata.forEach((item) => {
if (item.id == node.parentId) { if (item.id == node.parentId) {
this.updata = item.children this.updata = item.children;
} }
}); });
// console.log(this.updata) // console.log(this.updata)
this.updata.forEach((item, index) => { this.updata.forEach((item, index) => {
if (item.name == node.name) { if (item.name == node.name) {
this.http.put(//更改点击的节点为上一节点的order this.http
.put(
//更改点击的节点为上一节点的order
`/api/Organizations/${this.updata[index].id}`, `/api/Organizations/${this.updata[index].id}`,
{ {
id: this.updata[index].id, id: this.updata[index].id,
@ -217,10 +234,13 @@ export class OrganizationComponent implements OnInit {
enabled: true, enabled: true,
parentId: this.updata[index].parentId, parentId: this.updata[index].parentId,
} }
).subscribe( )
data=>{ .subscribe(
(data) => {
// this.getlist() // this.getlist()
this.http.put(//更改上一节点为点击节点的order this.http
.put(
//更改上一节点为点击节点的order
`/api/Organizations/${this.updata[index - 1].id}`, `/api/Organizations/${this.updata[index - 1].id}`,
{ {
id: this.updata[index - 1].id, id: this.updata[index - 1].id,
@ -232,55 +252,49 @@ export class OrganizationComponent implements OnInit {
enabled: true, enabled: true,
parentId: this.updata[index].parentId, parentId: this.updata[index].parentId,
} }
).subscribe( )
data=>{ .subscribe(
this.getlist() (data) => {
this.getlist();
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('更改order失败','确定',config); this.snackBar.open("更改order失败", "确定", config);
this.isloading = false this.isloading = false;
} }
) );
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('更改order失败','确定',config); this.snackBar.open("更改order失败", "确定", config);
this.isloading = false this.isloading = false;
} }
) );
} }
});
})
} }
//向下箭头 //向下箭头
downdata = [] downdata = [];
down(node) { down(node) {
this.isloading = true this.isloading = true;
var olddata = this.data; var olddata = this.data;
this.downdata = [] this.downdata = [];
olddata.forEach(item => { olddata.forEach((item) => {
if (item.id == node.parentId) { if (item.id == node.parentId) {
this.downdata = item.children this.downdata = item.children;
} }
}); });
// console.log(this.downdata) // console.log(this.downdata)
this.downdata.forEach((item, index) => { this.downdata.forEach((item, index) => {
if (item.name == node.name) { if (item.name == node.name) {
this.http.put(//更改点击的节点为下一节点的order this.http
.put(
//更改点击的节点为下一节点的order
`/api/Organizations/${this.downdata[index].id}`, `/api/Organizations/${this.downdata[index].id}`,
{ {
id: this.downdata[index].id, id: this.downdata[index].id,
@ -292,10 +306,13 @@ export class OrganizationComponent implements OnInit {
enabled: true, enabled: true,
parentId: this.downdata[index].parentId, parentId: this.downdata[index].parentId,
} }
).subscribe( )
data=>{ .subscribe(
(data) => {
// this.getlist() // this.getlist()
this.http.put(//更改上一节点为点击节点的order this.http
.put(
//更改上一节点为点击节点的order
`/api/Organizations/${this.downdata[index + 1].id}`, `/api/Organizations/${this.downdata[index + 1].id}`,
{ {
id: this.downdata[index + 1].id, id: this.downdata[index + 1].id,
@ -307,179 +324,154 @@ export class OrganizationComponent implements OnInit {
enabled: true, enabled: true,
parentId: this.downdata[index].parentId, parentId: this.downdata[index].parentId,
} }
).subscribe( )
data=>{ .subscribe(
this.getlist() (data) => {
this.getlist();
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('更改order失败','确定',config); this.snackBar.open("更改order失败", "确定", config);
this.isloading = false this.isloading = false;
} }
) );
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('更改order失败','确定',config); this.snackBar.open("更改order失败", "确定", config);
this.isloading = false this.isloading = false;
} }
) );
} }
});
})
} }
selectedOrg:any//当前选择的组织机构 selectedOrg: any; //当前选择的组织机构
OfficesList:any //获得的下级列表 OfficesList: any; //获得的下级列表
//获得点击组织机构的下级机关单位 //获得点击组织机构的下级机关单位
getOffices(node) { getOffices(node) {
// console.log(node) // console.log(node)
this.selectedOrg = node this.selectedOrg = node;
this.http.get(`/api/OrganizationsOffices/${node.id}`).subscribe(data => { this.http.get(`/api/OrganizationsOffices/${node.id}`).subscribe((data) => {
// console.log("获取成功",data) // console.log("获取成功",data)
this.OfficesList = data this.OfficesList = data;
}) });
} }
//新增下属机关 //新增下属机关
addOffices() { addOffices() {
const dialogRef = this.dialog.open(addOffices, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(addOffices, {
data: {selectedOrg:this.selectedOrg,OfficesList:this.OfficesList} //调用open方法打开对话框并且携带参数过去
data: { selectedOrg: this.selectedOrg, OfficesList: this.OfficesList },
}); });
dialogRef.afterClosed().subscribe( dialogRef.afterClosed().subscribe((data) => {
data=>{ if (data == "创建成功") {
if(data == '创建成功'){ this.getOffices(this.selectedOrg);
this.getOffices(this.selectedOrg)
} }
} });
);
} }
//编辑机关 //编辑机关
editOffice(item) { editOffice(item) {
const dialogRef = this.dialog.open(editOffices, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(editOffices, {
data: {item:item} //调用open方法打开对话框并且携带参数过去
data: { item: item },
}); });
dialogRef.afterClosed().subscribe( dialogRef.afterClosed().subscribe((data) => {
data=>{ if (data == "修改成功") {
if(data == '修改成功'){ this.getOffices(this.selectedOrg);
this.getOffices(this.selectedOrg)
}
} }
); });
} }
//删除机关 //删除机关
deleteOffice(item) { deleteOffice(item) {
let isDelete = window.confirm('确定要删除此机关吗?') let isDelete = window.confirm("确定要删除此机关吗?");
if (isDelete) { if (isDelete) {
this.http.delete(`/api/OrganizationsOffices/${item.id}`).subscribe(data => { this.http
.delete(`/api/OrganizationsOffices/${item.id}`)
.subscribe((data) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('删除成功','确定',config); this.snackBar.open("删除成功", "确定", config);
this.getOffices(this.selectedOrg) this.getOffices(this.selectedOrg);
}) });
} }
} }
} }
//创建组织 //创建组织
@Component({ @Component({
selector: 'createorganization', selector: "createorganization",
templateUrl: './createorganization.component.html', templateUrl: "./createorganization.component.html",
styleUrls: ['./organization.component.scss'] styleUrls: ["./organization.component.scss"],
}) })
export class CreateOrganization { export class CreateOrganization {
myControl = new FormControl(); myControl = new FormControl();
ishttp: boolean =false ishttp: boolean = false;
constructor(private http: HttpClient,public dialogRef: MatDialogRef<CreateOrganization>,@Inject(MAT_DIALOG_DATA) public data, constructor(
public snackBar: MatSnackBar) {} private http: HttpClient,
public dialogRef: MatDialogRef<CreateOrganization>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
onNoClick(): void { onNoClick(): void {
this.dialogRef.close(); this.dialogRef.close();
} }
onSubmit(value) { onSubmit(value) {
if(this.data.childlength){//如果点击节点存在children let obj = {
this.http.post(
'/api/Organizations',
{
id: "", id: "",
code:value.number, code: "12000000",
division:value.division, division: "12000000",
name: value.name, name: "天津总队",
level:this.data.level + 1, level: 0,
order: this.data.childlength[this.data.childlength.length -1].order + 1, order: null,
location: null, location: null,
enabled: true, enabled: true,
parentId: this.data.id, parentId: null,
} };
).subscribe( //如果点击节点存在children
data=>{ this.http
this.dialogRef.close(data); .post("/api/Organizations", {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('创建组织成功','确定',config);
},
err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请填写正确格式','确定',config);
}
)
}else{
this.http.post(
'/api/Organizations',
{
id: "", id: "",
code: value.number, code: value.number,
division: value.division, division: value.division,
name: value.name, name: value.name,
level: this.data.level + 1, level: this.data.level + 1,
order:0, order: this.data.childlength
? this.data.childlength[this.data.childlength.length - 1].order + 1
: 0,
location: null, location: null,
enabled: true, enabled: true,
parentId: this.data.id, parentId: this.data.id,
} })
).subscribe( .subscribe(
data=>{ (data) => {
this.dialogRef.close(data); this.dialogRef.close(data);
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('创建组织成功','确定',config); this.snackBar.open("创建组织成功", "确定", config);
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('请填写正确格式','确定',config); this.snackBar.open("请填写正确格式", "确定", config);
}
)
} }
);
} }
} }
//编辑组件 //编辑组件
@Component({ @Component({
selector: 'editorganization', selector: "editorganization",
templateUrl: './editorganization.component.html', templateUrl: "./editorganization.component.html",
styleUrls: ['./organization.component.scss'] styleUrls: ["./organization.component.scss"],
}) })
export class EditOrganization { export class EditOrganization {
newdata = []; newdata = [];
@ -491,65 +483,77 @@ export class EditOrganization {
id: node.id, id: node.id,
parentId: node.parentId, parentId: node.parentId,
children: node.children, children: node.children,
division:node.division division: node.division,
}; };
} };
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable); treeControl = new FlatTreeControl<any>(
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); (node) => node.level,
(node) => node.expandable
);
treeFlattener = new MatTreeFlattener(
this._transformer,
(node) => node.level,
(node) => node.expandable,
(node) => node.children
);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl(); myControl = new FormControl();
organizationname:string=""//自己组织的名字 organizationname: string = ""; //自己组织的名字
organizationcode:any//自己组织的编号 organizationcode: any; //自己组织的编号
organizationName:any =''//上级组织的名字 organizationName: any = ""; //上级组织的名字
organizationId:any =''//上级组织的id organizationId: any = ""; //上级组织的id
organizationLevel:number =null//上级组织的层级 organizationLevel: number = null; //上级组织的层级
organizationchildlength:number = null organizationchildlength: number = null;
allOrganizations:any //所有组织机构 allOrganizations: any; //所有组织机构
division:any //区划 division: any; //区划
constructor(private http: HttpClient,public dialogRef: MatDialogRef<EditOrganization>,@Inject(MAT_DIALOG_DATA) public data, constructor(
private tree:TreeService,public snackBar: MatSnackBar) {} private http: HttpClient,
public dialogRef: MatDialogRef<EditOrganization>,
@Inject(MAT_DIALOG_DATA) public data,
private tree: TreeService,
public snackBar: MatSnackBar
) {}
//获取所有组织机构 //获取所有组织机构
getMechanism() { getMechanism() {
this.http.get('/api/Organizations').subscribe( this.http.get("/api/Organizations").subscribe((data: any) => {
(data:any)=>{ this.allOrganizations = data;
this.allOrganizations = data
this.dataSource.data = this.tree.toTree(data); this.dataSource.data = this.tree.toTree(data);
data.forEach(item=>{ data.forEach((item) => {
if (item.id == this.data.parentId) { if (item.id == this.data.parentId) {
this.organizationName = item.name this.organizationName = item.name;
} }
}) });
} });
)
} }
ngOnInit() { ngOnInit() {
// console.log(this.data) // console.log(this.data)
this.getMechanism() this.getMechanism();
this.organizationname = this.data.name this.organizationname = this.data.name;
this.organizationcode = this.data.code this.organizationcode = this.data.code;
this.division = this.data.division this.division = this.data.division;
} }
hasChild = (_: number, node: any) => node.expandable; hasChild = (_: number, node: any) => node.expandable;
onNoClick(): void { onNoClick(): void {
this.dialogRef.close(); this.dialogRef.close();
} }
add(e) { add(e) {
this.organizationName=e.name this.organizationName = e.name;
this.organizationId=e.id this.organizationId = e.id;
this.organizationLevel=e.level this.organizationLevel = e.level;
if(e.children){//如果点击的父组织有子节点 if (e.children) {
this.organizationchildlength = e.children.length //如果点击的父组织有子节点
this.organizationchildlength = e.children.length;
} else { } else {
this.organizationchildlength = 0 this.organizationchildlength = 0;
} }
} }
onSubmit(value) { onSubmit(value) {
if(this.organizationLevel){//如果点击了右边的树 if (this.organizationLevel) {
this.http.put( //如果点击了右边的树
`/api/Organizations/${this.data.id}`, this.http
{ .put(`/api/Organizations/${this.data.id}`, {
id: this.data.id, id: this.data.id,
code: value.number, code: value.number,
division: value.division, division: value.division,
@ -559,26 +563,26 @@ export class EditOrganization {
location: null, location: null,
enabled: true, enabled: true,
parentId: this.organizationId, parentId: this.organizationId,
} })
).subscribe( .subscribe(
data=>{ (data) => {
this.dialogRef.close(); this.dialogRef.close();
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('修改成功','确定',config); this.snackBar.open("修改成功", "确定", config);
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('请填写正确格式','确定',config); this.snackBar.open("请填写正确格式", "确定", config);
} }
) );
}else{ //如果只改了姓名 } else {
this.http.put( //如果只改了姓名
`/api/Organizations/${this.data.id}`, this.http
{ .put(`/api/Organizations/${this.data.id}`, {
id: this.data.id, id: this.data.id,
code: value.number, code: value.number,
division: value.division, division: value.division,
@ -588,37 +592,39 @@ export class EditOrganization {
location: null, location: null,
enabled: true, enabled: true,
parentId: this.data.parentId, parentId: this.data.parentId,
} })
).subscribe( .subscribe(
data=>{ (data) => {
this.dialogRef.close(); this.dialogRef.close();
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('修改成功','确定',config); this.snackBar.open("修改成功", "确定", config);
}, },
err=>{ (err) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('请填写正确格式','确定',config); this.snackBar.open("请填写正确格式", "确定", config);
} }
) );
} }
} }
} }
//增加下属机关 //增加下属机关
@Component({ @Component({
selector: 'addOffices', selector: "addOffices",
templateUrl: './addOffices.html', templateUrl: "./addOffices.html",
styleUrls: ['./organization.component.scss'] styleUrls: ["./organization.component.scss"],
}) })
export class addOffices { export class addOffices {
constructor(
constructor(private http: HttpClient,public dialogRef: MatDialogRef<addOffices>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} private http: HttpClient,
public dialogRef: MatDialogRef<addOffices>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
onNoClick(): void { onNoClick(): void {
this.dialogRef.close(); this.dialogRef.close();
@ -630,30 +636,35 @@ export class addOffices {
id: null, id: null,
organizationId: this.data.selectedOrg.id, organizationId: this.data.selectedOrg.id,
officeName: value.name, officeName: value.name,
order: this.data.OfficesList.length == 0 ? 0 : this.data.OfficesList[this.data.OfficesList.length - 1].order, order:
enabled: true this.data.OfficesList.length == 0
} ? 0
this.http.post('/api/OrganizationsOffices',body).subscribe(data => { : this.data.OfficesList[this.data.OfficesList.length - 1].order,
enabled: true,
};
this.http.post("/api/OrganizationsOffices", body).subscribe((data) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('创建成功','确定',config); this.snackBar.open("创建成功", "确定", config);
this.dialogRef.close('创建成功'); this.dialogRef.close("创建成功");
}) });
} }
} }
//编辑下属机关 //编辑下属机关
@Component({ @Component({
selector: 'editOffices', selector: "editOffices",
templateUrl: './editOffices.html', templateUrl: "./editOffices.html",
styleUrls: ['./organization.component.scss'] styleUrls: ["./organization.component.scss"],
}) })
export class editOffices { export class editOffices {
constructor(
constructor(private http: HttpClient,public dialogRef: MatDialogRef<editOffices>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} private http: HttpClient,
public dialogRef: MatDialogRef<editOffices>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
ngOnInit(): void { ngOnInit(): void {
// console.log(this.data) // console.log(this.data)
@ -661,7 +672,7 @@ export class editOffices {
onNoClick(): void { onNoClick(): void {
this.dialogRef.close(); this.dialogRef.close();
} }
officeName:any = this.data.item.officeName officeName: any = this.data.item.officeName;
onSubmit(value) { onSubmit(value) {
// console.log(value) // console.log(value)
let body = { let body = {
@ -669,14 +680,16 @@ export class editOffices {
organizationId: this.data.item.organizationId, organizationId: this.data.item.organizationId,
officeName: value.name, officeName: value.name,
order: this.data.item.order, order: this.data.item.order,
enabled: true enabled: true,
} };
this.http.put(`/api/OrganizationsOffices/${this.data.item.id}`,body).subscribe(data => { this.http
.put(`/api/OrganizationsOffices/${this.data.item.id}`, body)
.subscribe((data) => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = "top";
config.duration = 3000 config.duration = 3000;
this.snackBar.open('修改成功','确定',config); this.snackBar.open("修改成功", "确定", config);
this.dialogRef.close('修改成功'); this.dialogRef.close("修改成功");
}) });
} }
} }

18
src/index.html

@ -6,7 +6,6 @@
<title>数字化预案编制管理平台</title> <title>数字化预案编制管理平台</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <meta name="viewport" content="initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no,uc-fitscreen=yes,viewport-fit=cover"> -->
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<link href='/assets/icon/material-icons.css' rel="stylesheet"> <link href='/assets/icon/material-icons.css' rel="stylesheet">
<link rel="stylesheet" href="/assets/css/photo-sphere-viewer.css" /> <link rel="stylesheet" href="/assets/css/photo-sphere-viewer.css" />
@ -17,22 +16,9 @@
<div id="viewerjs" style="display:none"></div> <div id="viewerjs" style="display:none"></div>
</body> </body>
<!-- <script type="text/javascript" src="./assets/kmap/kmap-service-main-kd.js"></script> -->
<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode: '0afa0b144398727fad2ca06f5f7156b3'
}
</script>
<script
src="http://10.81.73.39:8000/webapi/maps?v=2.0&key=17bb9b27e49451cde8f2e6655b11ff1a&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script>
<script src="http://10.81.73.39:8000/webapi/ui/1.1/main.js"></script>
<!-- <script
src="https://webapi.amap.com/maps?v=2.0&key=17bb9b27e49451cde8f2e6655b11ff1a&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script>
<script src="https://webapi.amap.com/ui/1.1/main.js"></script> -->
<script src="/assets/html2canvas.js"></script> <script src="/assets/html2canvas.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.js"></script> <!-- <script type="text/javascript" src="/assets/wordexport/jquery.js"></script>
<script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script> <script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script> <script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script> -->
</html> </html>
Loading…
Cancel
Save