diff --git a/README.md b/README.md index b33ba51..55d1285 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# AX.Angular9DataCollection +# 上海采集平台 diff --git a/package-lock.json b/package-lock.json index f36019f..b6ad9fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16655,8 +16655,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -16699,8 +16698,7 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", @@ -16711,8 +16709,7 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -16829,8 +16826,7 @@ "inherits": { "version": "2.0.4", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -16842,7 +16838,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -16872,7 +16867,6 @@ "version": "2.9.0", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -16891,7 +16885,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -16994,7 +16987,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -17080,8 +17072,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -17117,7 +17108,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", @@ -17137,7 +17127,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -17181,14 +17170,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -17787,7 +17774,6 @@ "version": "2.9.0", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -17806,7 +17792,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -17909,7 +17894,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -17995,8 +17979,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -18096,14 +18079,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 7eb3cc8..5a03a1a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -13,16 +13,13 @@ import { MTokenK1Component } from './m-token-k1/m-token-k1.component'; const routes: Routes = [ {path:'',redirectTo:'login',pathMatch:'full'}, { - path:'', - component:NavigationComponent, - canActivate: [AuthGuard],//守卫验证 + path:'', component:NavigationComponent, canActivate: [AuthGuard],//守卫验证 children:[ {path:'datacollection',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)} ]}, {path:'login', component:LoginComponent}, //登录页 {path:'register', component:RegisterComponent,}, //注册页 - ]; @NgModule({ diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e8e367a..bdd6887 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -19,26 +19,16 @@ export class AppComponent { ngOnInit(): void { var token = this.cookieService.get("token") var refreshToken = this.cookieService.get("refreshToken"); - if(token && refreshToken) { - this.http.post( - '/api/CompanyAccount/RefreshToken', - { - token: token, - refreshToken: refreshToken - } - ).subscribe( - (data: Data) => { - sessionStorage.setItem("token",data.token); - this.cookieService.set("token",data.token,null,'/'); - this.cookieService.set("refreshToken",data.refreshToken,null,'/'); - this.token.startUp() - } - ) + if(token && refreshToken) { + this.http.post('/api/CompanyAccount/RefreshToken',{token: token,refreshToken: refreshToken}).subscribe((data: Data) => { + sessionStorage.setItem("token",data.token); + this.cookieService.set("token",data.token,null,'/'); + this.cookieService.set("refreshToken",data.refreshToken,null,'/'); + this.token.startUp() + }) } } - - } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 20093ac..83f08c4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -8,7 +8,6 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatIconModule } from '@angular/material/icon'; import { MatSidenavModule } from '@angular/material/sidenav'; import { NavigationModule } from './navigation/navigation.module'; -import { HomeComponent } from './home/home.component'; import { TabbarComponent } from './tabbar/tabbar.component'; import { PagesModule } from './pages/pages.module'; import { FormsModule } from '@angular/forms'; @@ -24,7 +23,6 @@ import { MTokenK1Component } from './m-token-k1/m-token-k1.component'; @NgModule({ declarations: [ AppComponent, - HomeComponent, MTokenK1Component ], imports: [ diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index 62c8cc0..b69d6c5 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -8,7 +8,6 @@ import { GameMode } from './working-area/model/gameMode'; export class CanvasShareDataService { constructor() { } private _sendMessage: ReplaySubject = new ReplaySubject(1); - GameMode: any; isChange = false; // 数据 是否改动 diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html deleted file mode 100644 index 19f0e76..0000000 --- a/src/app/home/home.component.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/app/home/home.component.scss b/src/app/home/home.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/home/home.component.spec.ts b/src/app/home/home.component.spec.ts deleted file mode 100644 index 490e81b..0000000 --- a/src/app/home/home.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HomeComponent } from './home.component'; - -describe('HomeComponent', () => { - let component: HomeComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ HomeComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(HomeComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts deleted file mode 100644 index f2d2eb4..0000000 --- a/src/app/home/home.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.scss'] -}) - -export class HomeComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - - - -} diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html index 985c8e0..112815c 100644 --- a/src/app/navigation/navigation.component.html +++ b/src/app/navigation/navigation.component.html @@ -1,43 +1,38 @@ - - - -
- -
- -
+ + +
+ +
+ +
- + -
-
- -
-
- -
+
+
+
- +
+ +
+
diff --git a/src/app/navigation/navigation.component.scss b/src/app/navigation/navigation.component.scss index a20053b..c77ba06 100644 --- a/src/app/navigation/navigation.component.scss +++ b/src/app/navigation/navigation.component.scss @@ -32,6 +32,8 @@ mat-sidenav{ padding-left: 55px; background-color: #3c4252; color: white; + border: none; + outline: none; } .superli{ padding-left: 66px; diff --git a/src/app/navigation/navigation.component.ts b/src/app/navigation/navigation.component.ts index 2b05dca..b2d1737 100644 --- a/src/app/navigation/navigation.component.ts +++ b/src/app/navigation/navigation.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; - import {CacheTokenService} from '../http-interceptors/cache-token.service'//引入服务 + @Component({ selector: 'app-navigation', templateUrl: './navigation.component.html', @@ -13,19 +13,5 @@ export class NavigationComponent implements OnInit { ngOnInit() { } - ngOnDestroy(){ - } - - darktheme = false; - switchTheme(dark) { - this.darktheme = dark; - // alert(this.darkTheme); - } - defaulttheme(){ - this.darktheme = false - } - redtheme(){ - this.darktheme = true - } } diff --git a/src/app/navigation/navigation.module.ts b/src/app/navigation/navigation.module.ts index 5574afd..7b1c9b3 100644 --- a/src/app/navigation/navigation.module.ts +++ b/src/app/navigation/navigation.module.ts @@ -7,7 +7,6 @@ import { RouterModule } from '@angular/router'; import { FormsModule } from '@angular/forms'; import { TabbarComponent } from '../tabbar/tabbar.component'; import { UiModule } from '../ui/ui.module'; - import {A11yModule} from '@angular/cdk/a11y'; import {DragDropModule} from '@angular/cdk/drag-drop'; import {PortalModule} from '@angular/cdk/portal'; @@ -29,7 +28,6 @@ import {MatDialogModule} from '@angular/material/dialog'; import {MatDividerModule} from '@angular/material/divider'; import {MatExpansionModule} from '@angular/material/expansion'; import {MatGridListModule} from '@angular/material/grid-list'; - import {MatInputModule} from '@angular/material/input'; import {MatListModule} from '@angular/material/list'; import {MatMenuModule} from '@angular/material/menu'; @@ -39,7 +37,6 @@ import {MatProgressBarModule} from '@angular/material/progress-bar'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {MatRadioModule} from '@angular/material/radio'; import {MatSelectModule} from '@angular/material/select'; - import {MatSliderModule} from '@angular/material/slider'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {MatSnackBarModule} from '@angular/material/snack-bar'; @@ -50,7 +47,6 @@ import {MatToolbarModule} from '@angular/material/toolbar'; import {MatTooltipModule} from '@angular/material/tooltip'; import {MatTreeModule} from '@angular/material/tree'; - @NgModule({ declarations: [ NavigationComponent, @@ -63,7 +59,6 @@ import {MatTreeModule} from '@angular/material/tree'; MatIconModule, FormsModule, UiModule, - A11yModule, CdkStepperModule, CdkTableModule, diff --git a/src/app/pages/lockscreen/lockscreen.component.html b/src/app/pages/lockscreen/lockscreen.component.html deleted file mode 100644 index 65e7177..0000000 --- a/src/app/pages/lockscreen/lockscreen.component.html +++ /dev/null @@ -1,28 +0,0 @@ -
-
-
- -

锁屏

-
- - 输入密码 - - lock - -
-

- 输入密码以进入 -

- - - -
-
-
diff --git a/src/app/pages/lockscreen/lockscreen.component.scss b/src/app/pages/lockscreen/lockscreen.component.scss deleted file mode 100644 index 0c1034a..0000000 --- a/src/app/pages/lockscreen/lockscreen.component.scss +++ /dev/null @@ -1,111 +0,0 @@ -.pages-lockscreen { - .page-content { - display: inline-block; - width: 400px; - max-width: 100%; - padding: 30px; - } - .avatar { - width: 50px; - height: 50px; - margin: 0 auto; - - img { - border-radius: 50%; - } - - } -} -.layout-full { - position: absolute; - z-index: 0; - width: 100%; - height: 100%; - color: #fff; - font-family: Roboto, sans-serif; - background: url('../../../assets/images/caiji.jpg'); - &::before { - position: fixed; - top: 0; - left: 0; - z-index: -1; - width: 100%; - height: 100%; - content: ""; - background-position: center top; - background-size: cover; - } - - &::after { - position: fixed; - top: 0; - left: 0; - z-index: -1; - width: 100%; - height: 100%; - content: ""; - background-color: rgba(33, 33, 33, .6); - } - - .page { - position: relative; - height: 100%; - padding: 0; - margin: 0; - background: transparent; - } - -} - - -.auth-box { - - .copyright { - margin-top: 60px; - font-size: 12px; - font-weight: 500; - letter-spacing: 1px; - - p { - margin: 0 0 14px; - } - } - - .social { - mat-icon { - color: #fff; - } - } -} - -.vertical-align { - &::before { - display: inline-block; - height: 100%; - vertical-align: middle; - content: ""; - } - - .vertical-align-middle { - display: inline-block; - vertical-align: middle; - } - -} - -.pages-login { - .page-content { - display: inline-block; - width: 400px; - max-width: 100%; - padding: 30px; - } - -} -.page-content{ - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%,-50%); - text-align: center; -} \ No newline at end of file diff --git a/src/app/pages/lockscreen/lockscreen.component.spec.ts b/src/app/pages/lockscreen/lockscreen.component.spec.ts deleted file mode 100644 index 7f11516..0000000 --- a/src/app/pages/lockscreen/lockscreen.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LockscreenComponent } from './lockscreen.component'; - -describe('LockscreenComponent', () => { - let component: LockscreenComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ LockscreenComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(LockscreenComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/lockscreen/lockscreen.component.ts b/src/app/pages/lockscreen/lockscreen.component.ts deleted file mode 100644 index 27073a9..0000000 --- a/src/app/pages/lockscreen/lockscreen.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router,ActivatedRoute } from '@angular/router' -import {CacheTokenService} from '../../http-interceptors/cache-token.service'//引入服务 -@Component({ - selector: 'app-lockscreen', - templateUrl: './lockscreen.component.html', - styleUrls: ['./lockscreen.component.scss'] -}) -export class LockscreenComponent implements OnInit { - - constructor(private router:Router,private route:ActivatedRoute,private getMenus:CacheTokenService) { } - password = '' - ngOnInit() { - } - open(){ - if(this.password == "12345678"){ - this.router.navigate(['/datacollection/basicinfo']) - } - } -} diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts deleted file mode 100644 index ec1ecae..0000000 --- a/src/app/pages/pages-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -// import { Routes, RouterModule } from '@angular/router'; -// import { NgModule } from '@angular/core'; -// import { PagesComponent } from './pages.component'; -// import { PersonaldataComponent } from './personaldata/personaldata.component'; - - -// const routes: Routes = [ -// { path: '', component: PagesComponent}, -// { path: 'personaldata ', component: PersonaldataComponent}, - -// ]; - -// @NgModule({ -// imports: [RouterModule.forChild(routes)], -// exports: [RouterModule] -// }) -// export class PagesRoutingModule {} diff --git a/src/app/pages/pages.component.html b/src/app/pages/pages.component.html deleted file mode 100644 index c56369e..0000000 --- a/src/app/pages/pages.component.html +++ /dev/null @@ -1 +0,0 @@ -

pages works!

diff --git a/src/app/pages/pages.component.scss b/src/app/pages/pages.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/pages/pages.component.spec.ts b/src/app/pages/pages.component.spec.ts deleted file mode 100644 index 7a864ac..0000000 --- a/src/app/pages/pages.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PagesComponent } from './pages.component'; - -describe('PagesComponent', () => { - let component: PagesComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PagesComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PagesComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/pages.component.ts b/src/app/pages/pages.component.ts deleted file mode 100644 index d8ad6cb..0000000 --- a/src/app/pages/pages.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-pages', - templateUrl: './pages.component.html', - styleUrls: ['./pages.component.scss'] -}) -export class PagesComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index 2282c13..430a5a5 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -1,11 +1,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { PagesComponent } from './pages.component'; import { LoginComponent } from './login/login.component'; import { RegisterComponent } from './register/register.component'; -// import { PagesRoutingModule } from './pages-routing.module' - - import {A11yModule} from '@angular/cdk/a11y'; import {DragDropModule} from '@angular/cdk/drag-drop'; import {PortalModule} from '@angular/cdk/portal'; @@ -48,17 +44,12 @@ import {MatToolbarModule} from '@angular/material/toolbar'; import {MatTooltipModule} from '@angular/material/tooltip'; import {MatTreeModule} from '@angular/material/tree'; import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { PersonaldataComponent } from './personaldata/personaldata.component'; import { RouterModule } from '@angular/router'; -import { LockscreenComponent } from './lockscreen/lockscreen.component'; -// import { PagesRoutingModule } from './pages-routing.module'; - @NgModule({ - declarations: [PagesComponent, LoginComponent, RegisterComponent, LockscreenComponent], + declarations: [LoginComponent, RegisterComponent,], imports: [ CommonModule, - A11yModule, CdkStepperModule, CdkTableModule, @@ -70,7 +61,6 @@ import { LockscreenComponent } from './lockscreen/lockscreen.component'; MatButtonModule, MatButtonToggleModule, MatCardModule, - MatCheckboxModule, MatChipsModule, MatStepperModule, @@ -102,11 +92,9 @@ import { LockscreenComponent } from './lockscreen/lockscreen.component'; MatTreeModule, PortalModule, ScrollingModule, - FormsModule, ReactiveFormsModule, RouterModule - // PagesRoutingModule, ] }) export class PagesModule { } diff --git a/src/app/pages/personaldata/personaldata.component.html b/src/app/pages/personaldata/personaldata.component.html deleted file mode 100644 index 4e0fb3e..0000000 --- a/src/app/pages/personaldata/personaldata.component.html +++ /dev/null @@ -1,280 +0,0 @@ -
-
- - - - 安信科创 - 嘻嘻嘻嘻 -

- 不要做程序员,要做问题解决者 -

-
- - - - -
- -
- -
- 260 - 粉丝 -
-
- 180 - 关注 -
-
- 2000 - 博客 -
-
-
- - - - - - -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- - - - -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- - 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
-
-
- -
-
- - - -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- - 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
- - - -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- - - - -
-
-
-
- - - -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- - 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- - - - -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
- -
- -
-
我是假数据 - 我是假数据 -
- 我是假数据 -
-
-
- 我是假数据 -
-
-
-
-
-
-
-
diff --git a/src/app/pages/personaldata/personaldata.component.scss b/src/app/pages/personaldata/personaldata.component.scss deleted file mode 100644 index 674904d..0000000 --- a/src/app/pages/personaldata/personaldata.component.scss +++ /dev/null @@ -1,110 +0,0 @@ - -#xxx{ - display: flex; - justify-content: space-around; -} -.pages-profile { - padding: 30px; - - .profile-card { - padding: 9px; - text-align: center; - font-family: Roboto, sans-serif; - width: 500px; - height: 600px; - mat-card-content { - padding: 40px 15px; - margin: 0; - } - - .mat-card-avatar { - width: 130px; - height: 130px; - margin-bottom: 10px; - } - - .profile-user { - margin: 10px 0; - font-weight: normal; - } - - .profile-job { - margin-bottom: 20px; - color: #9e9e9e; - font-weight: 500; - } - - .profile-introduction { - margin: 0 0 1rem; - color: #757575; - } - - .profile-social { - margin: 25px 0; - - mat-icon { - margin: 0 10px; - color: rgba(66, 66, 66, .4); - } - } - - mat-card-actions { - padding: 10px; - background: #f6f9fd; - } - - .profile-card-footer { - display: flex; - justify-content: space-around; - .profile-stat-count { - display: block; - margin-bottom: 3px; - font-size: 20px; - font-weight: bold; - color: #616161; - - +span { - color: #9e9e9e; - } - } - } - - } - - .profile-board { - padding: 30px; - width: 500px; - mat-list { - padding-bottom: 20px; - } - - mat-list-item { - height: auto; - padding: 25px 0; - margin-left: -16px; - border-bottom: 1px solid #dfe0df; - - .profile-item-content { - padding: 20px 0 0 56px; - line-height: 1.571429; - color: #757575; - white-space: normal; - display: flex; - flex-wrap: wrap; - - img { - width: 100%; - max-width: 220px; - max-height: 150px; - padding: 0 20px 20px 0; - } - } - } - } - - .show-more-btn { - width: 100%; - background-color: #eee; - color: #3949ab; - } -} \ No newline at end of file diff --git a/src/app/pages/personaldata/personaldata.component.spec.ts b/src/app/pages/personaldata/personaldata.component.spec.ts deleted file mode 100644 index cf44bea..0000000 --- a/src/app/pages/personaldata/personaldata.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PersonaldataComponent } from './personaldata.component'; - -describe('PersonaldataComponent', () => { - let component: PersonaldataComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PersonaldataComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PersonaldataComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/personaldata/personaldata.component.ts b/src/app/pages/personaldata/personaldata.component.ts deleted file mode 100644 index 28d9b93..0000000 --- a/src/app/pages/personaldata/personaldata.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-personaldata', - templateUrl: './personaldata.component.html', - styleUrls: ['./personaldata.component.scss'] -}) -export class PersonaldataComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/tabbar/help-file.service.spec.ts b/src/app/tabbar/help-file.service.spec.ts deleted file mode 100644 index ca1a4fc..0000000 --- a/src/app/tabbar/help-file.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { HelpFileService } from './help-file.service'; - -describe('HelpFileService', () => { - let service: HelpFileService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(HelpFileService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/tabbar/tabbar.component.html b/src/app/tabbar/tabbar.component.html index 6197840..9922537 100644 --- a/src/app/tabbar/tabbar.component.html +++ b/src/app/tabbar/tabbar.component.html @@ -1,23 +1,6 @@ - +

{{companyName}}

- - - - - - - - - -
\ No newline at end of file diff --git a/src/app/tabbar/tabbar.component.ts b/src/app/tabbar/tabbar.component.ts index 9d22008..2b402cf 100644 --- a/src/app/tabbar/tabbar.component.ts +++ b/src/app/tabbar/tabbar.component.ts @@ -16,20 +16,7 @@ import { CookieService } from 'ngx-cookie-service'; styleUrls: ['./tabbar.component.scss'] }) export class TabbarComponent implements OnInit { - theme: boolean = true; - @Output() - toggle = new EventEmitter(); - @Output() - toggleDarkTheme = new EventEmitter(); - @Output() - defaulttheme = new EventEmitter(); - @Output() - redtheme = new EventEmitter(); - // @Output() - // boxed = new EventEmitter(); - onChange(eventValue: boolean){ - this.toggleDarkTheme.emit(eventValue); - } + constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog,public snackBar: MatSnackBar, private cookieService: CookieService,private help: HelpFileService) { } @@ -37,55 +24,8 @@ export class TabbarComponent implements OnInit { this.getUserInfo() } - boxed(css){ - const Element = document.body; - Element.style.width = '1200px' - } - standard(){ - const Element = document.body; - Element.style.width = '100%' - } - - isfullscreen:boolean = false; - fullscreenToggle(){ - const docElmWithBrowsersFullScreenFunctions = document.documentElement as HTMLElement & { - mozRequestFullScreen(): Promise; - webkitRequestFullscreen(): Promise; - msRequestFullscreen(): Promise; - }; - - if (docElmWithBrowsersFullScreenFunctions.requestFullscreen) { - docElmWithBrowsersFullScreenFunctions.requestFullscreen(); - } else if (docElmWithBrowsersFullScreenFunctions.mozRequestFullScreen) { /* Firefox */ - docElmWithBrowsersFullScreenFunctions.mozRequestFullScreen(); - } else if (docElmWithBrowsersFullScreenFunctions.webkitRequestFullscreen) { /* Chrome, Safari and Opera */ - docElmWithBrowsersFullScreenFunctions.webkitRequestFullscreen(); - } else if (docElmWithBrowsersFullScreenFunctions.msRequestFullscreen) { /* IE/Edge */ - docElmWithBrowsersFullScreenFunctions.msRequestFullscreen(); - } - - this.isfullscreen = true; - - } - closefullscreen(){ - const docWithBrowsersExitFunctions = document as Document & { - mozCancelFullScreen(): Promise; - webkitExitFullscreen(): Promise; - msExitFullscreen(): Promise; - }; - if (docWithBrowsersExitFunctions.exitFullscreen) { - docWithBrowsersExitFunctions.exitFullscreen(); - } else if (docWithBrowsersExitFunctions.mozCancelFullScreen) { /* Firefox */ - docWithBrowsersExitFunctions.mozCancelFullScreen(); - } else if (docWithBrowsersExitFunctions.webkitExitFullscreen) { /* Chrome, Safari and Opera */ - docWithBrowsersExitFunctions.webkitExitFullscreen(); - } else if (docWithBrowsersExitFunctions.msExitFullscreen) { /* IE/Edge */ - docWithBrowsersExitFunctions.msExitFullscreen(); - } - this.isfullscreen = false; - } - companyName:any; //企业name + //获取用户信息 getUserInfo () { this.http.get('/api/CompanyAccount/Profiles').subscribe((data:any)=>{ diff --git a/src/app/ui/authority/authority.component.html b/src/app/ui/authority/authority.component.html deleted file mode 100644 index afa7fcd..0000000 --- a/src/app/ui/authority/authority.component.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - {{node.name}} - - - - - - - - {{node.name}} - - - - - \ No newline at end of file diff --git a/src/app/ui/authority/authority.component.scss b/src/app/ui/authority/authority.component.scss deleted file mode 100644 index dea1283..0000000 --- a/src/app/ui/authority/authority.component.scss +++ /dev/null @@ -1,30 +0,0 @@ -table { - width: 100%; - th,td{ - text-align: center; - } -} -form{ - text-align: center; - button{ - margin: 0 12px; - } -} -mat-tree{ - width: 500px; - button{ - display: block; - float: right; - } - mat-tree-node{ - position: relative; - .deleted{ - position: absolute; - right: 0; - } - .create{ - position: absolute; - right: 40px; - } - } -} diff --git a/src/app/ui/authority/authority.component.ts b/src/app/ui/authority/authority.component.ts deleted file mode 100644 index 7493b71..0000000 --- a/src/app/ui/authority/authority.component.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { TreeService } from '../../http-interceptors/tree.service' -export interface authority { - id: string, - name: string, - value: string, - order: number, - parentId: string -} -@Component({ - selector: 'app-authority', - templateUrl: './authority.component.html', - styleUrls: ['./authority.component.scss'] -}) -export class AuthorityComponent implements OnInit { - - data:any =[] - newdata = []; - - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId - }; - } - treeControl = new FlatTreeControl(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); - constructor(private http: HttpClient,public dialog: MatDialog,private tree:TreeService) { } - - //重新拉去列表函数 - getlist = ():void=>{ - this.http.get('/api/Permissions').subscribe((data: any[])=>{ - this.newdata = this.tree.toTree(data) - const nodes = this.treeControl.dataNodes; - const expandNodes = []; - nodes.forEach((item) => { - if(item.expandable && this.treeControl.isExpanded(item)){ - expandNodes.push(item.id); - } - }); - this.dataSource.data = this.newdata; - let newNodes = this.treeControl.dataNodes; - newNodes = newNodes.filter(n => { - return expandNodes.indexOf(n.id) >= 0; - }); - newNodes.forEach(item => { - this.treeControl.expand(item); - }); - }) - } - - //初始化视图 - ngOnInit() { - this.http.get('/api/Permissions').subscribe((data: any[])=>{ - this.dataSource.data = this.tree.toTree(data) - }) - } - hasChild = (_: number, node: any) => node.expandable; - - //创建按钮 - createauthority(value){ - const dialogRef = this.dialog.open(CreateAuthority, {//调用open方法打开对话框并且携带参数过去 - width: '260px', - data: {id:value.id} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.newdata = [] - this.getlist() - } - } - ); - } - //删除按钮 - deleted(authority){ - var isdeleted = confirm("确定要删除此用户吗?") - if(isdeleted){ - //请求删除接口 - this.newdata = [] - this.http.delete(`/api/Permissions/${authority.id}`).subscribe( data=>{ - this.getlist() - }) - } - } -} - - -//创建组件 -@Component({ - selector: 'createauthority', - templateUrl: './createauthority.component.html', - styleUrls: ['./authority.component.scss'] -}) -export class CreateAuthority { - myControl = new FormControl(); - options: string[] = ['0', '1','2', '3','4', '5','6', '7','8']; - - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - - if(value.parentId == "null"){ - value.parentId = null - } - //编写请求创建用户接口(value是参数)//并且刷新一下 - this.http.post( - '/api/Permissions', - { - id: '', - name: value.name, - value: value.value, - order: Number(value.order), - parentId: this.data.id - } - ).subscribe( - data=>{ - this.dialogRef.close(data); - }, - err=>{ - alert("请填写正确格式") - } - ) - } -} \ No newline at end of file diff --git a/src/app/ui/authority/createauthority.component.html b/src/app/ui/authority/createauthority.component.html deleted file mode 100644 index b8e7500..0000000 --- a/src/app/ui/authority/createauthority.component.html +++ /dev/null @@ -1,36 +0,0 @@ -
- - - - - - - - - - - - - - - {{option}} - - - - - -
- - -
- -
\ No newline at end of file diff --git a/src/app/ui/card/card.component.html b/src/app/ui/card/card.component.html deleted file mode 100644 index da5b6ca..0000000 --- a/src/app/ui/card/card.component.html +++ /dev/null @@ -1,12 +0,0 @@ - - 简单的卡片 - 卡片的字幕 - 原来爱情的世界很大,大得可以装下一百种委屈;原来爱情的世界很小,小得三个人就会窒息。 - - - - - - 我要被固定在卡片底部 - - \ No newline at end of file diff --git a/src/app/ui/card/card.component.scss b/src/app/ui/card/card.component.scss deleted file mode 100644 index feb037a..0000000 --- a/src/app/ui/card/card.component.scss +++ /dev/null @@ -1,10 +0,0 @@ - -mat-card{ - width: 300px; - height: 600px; - img{ - width: 300px; - height: 300px; - padding: 16px; - } -} \ No newline at end of file diff --git a/src/app/ui/card/card.component.spec.ts b/src/app/ui/card/card.component.spec.ts deleted file mode 100644 index e141708..0000000 --- a/src/app/ui/card/card.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CardComponent } from './card.component'; - -describe('CardComponent', () => { - let component: CardComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ CardComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/card/card.component.ts b/src/app/ui/card/card.component.ts deleted file mode 100644 index ae25273..0000000 --- a/src/app/ui/card/card.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-card', - templateUrl: './card.component.html', - styleUrls: ['./card.component.scss'] -}) -export class CardComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/ui/fire-fighting-template/editingFireControl.html b/src/app/ui/fire-fighting-template/editingFireControl.html deleted file mode 100644 index 9d2be33..0000000 --- a/src/app/ui/fire-fighting-template/editingFireControl.html +++ /dev/null @@ -1,45 +0,0 @@ -
编辑消防要素模板
- -
-
- - - -
- - -
- -
- - - - - {{node.name}} - - - - - - - {{node.name}} - - - -
- -
- - -
-
-
\ No newline at end of file diff --git a/src/app/ui/fire-fighting-template/fire-fighting-template.component.html b/src/app/ui/fire-fighting-template/fire-fighting-template.component.html deleted file mode 100644 index 0b62ce3..0000000 --- a/src/app/ui/fire-fighting-template/fire-fighting-template.component.html +++ /dev/null @@ -1,36 +0,0 @@ -
- 消防要素模板 - -
- - - - - - - - - - - - - - -
模板名称 {{element.name}} 操作 - - - - -
\ No newline at end of file diff --git a/src/app/ui/fire-fighting-template/fire-fighting-template.component.scss b/src/app/ui/fire-fighting-template/fire-fighting-template.component.scss deleted file mode 100644 index 06f7d26..0000000 --- a/src/app/ui/fire-fighting-template/fire-fighting-template.component.scss +++ /dev/null @@ -1,18 +0,0 @@ -table { - width: 100%; - text-align: center; - .cdk-header-cell { - text-align: center; - } -} -.magin { - margin: 10px; - font-weight: 600; -} -.marginLeft { - margin-left: 5px; -} -.tree { - height: 450px; - overflow: auto; -} \ No newline at end of file diff --git a/src/app/ui/fire-fighting-template/fire-fighting-template.component.ts b/src/app/ui/fire-fighting-template/fire-fighting-template.component.ts deleted file mode 100644 index ec34a24..0000000 --- a/src/app/ui/fire-fighting-template/fire-fighting-template.component.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree'; -import { FlatTreeControl } from '@angular/cdk/tree'; - -@Component({ - selector: 'app-fire-fighting-template', - templateUrl: './fire-fighting-template.component.html', - styleUrls: ['./fire-fighting-template.component.scss'] -}) -export class FireFightingTemplateComponent implements OnInit { - - constructor(private http:HttpClient,public dialog: MatDialog) { } - - ngOnInit(): void { - this.getAllFireFighting() - } - - displayedColumns: string[] = ['name','operation']; - aLLFireFighting:any; //所有消防要素模板 - - //获取所有消防要素模板 - getAllFireFighting () { - this.http.get('/api/FireCategories').subscribe(data=>{ - this.aLLFireFighting=data - }) - } - - - - //新增消防模块窗口 - establish () { - let dialogRef = this.dialog.open(NewFireFighting, - { - width:'600px', - }); - dialogRef.afterClosed().subscribe((data)=>{ - if (data) {this.getAllFireFighting()} - }); - } - - //编辑消防模块窗口 - edit (e) { - let dialogRef = this.dialog.open(EditFireClassification, - { - width:'600px', - data:{e} - }); - dialogRef.afterClosed().subscribe((data)=>{ - if (data) {this.getAllFireFighting()} - }); - } - - //启用 - enable (e) { - this.http.put(`/api/FireCategories/${e.id}`,{ - id:e.id, - name:e.name, - enabled:true, - fireElements:e.fireElements - }).subscribe(data=>{ - this.getAllFireFighting() - }) - } - - //禁用 - prohibit (e) { - this.http.put(`/api/FireCategories/${e.id}`,{ - id:e.id, - name:e.name, - enabled:false, - fireElements:e.fireElements - }).subscribe(data=>{ - this.getAllFireFighting() - }) - } - - //删除 - delete (e) { - let isTrue = confirm('您确定要删除吗') - if (isTrue) { - this.http.delete(`/api/FireCategories/${e}`).subscribe(data=>{ - this.getAllFireFighting() - }) - } - } - - - - -} - - - -//新增消防分类窗口 -@Component({ - selector: 'app-newFireFighting', - templateUrl: './newFireFighting.html', - styleUrls: ['./fire-fighting-template.component.scss'] -}) -export class NewFireFighting { - newdata = []; - - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - computed:node.computed, - order:node.order, - children:node.children ||'', - tag:node.tag, - }; - } - treeControl = new FlatTreeControl(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); - - constructor(private http:HttpClient, - public dialogRef: MatDialogRef) {} - - ngOnInit(): void { - this.rendering() - } - - - - checkedAll:boolean=false; //全选 - checkedList:any=[]; //选中的消防要素 - - //渲染Tree - rendering () { - this.http.get('/api/FireElements').subscribe((data:any)=>{ - this.newdata=[] - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - var parentNode = getparentNode(item.parentId); - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata.push(item) - } - } - }); - this.dataSource.data = this.newdata; - this.treeControl.expandAll() - }) - } - hasChild = (_: number, node: any) => node.expandable; - - //change时判断是否选中 - changed (e,id) { - if (e.checked) { - this.checkedList.push(id) - } else if (e.checked == false) { - this.checkedList.splice(this.checkedList.findIndex(item => item === id), 1) - } - } - - - - //提交创建 - onSubmit (e) { - if(this.checkedList.length) { - this.http.post('/api/FireCategories',{ - name:e.name, - enabled:true, - fireElements:this.checkedList - }).subscribe(data=>{ - this.dialogRef.close('success') - }) - }else { - alert('请选择消防要素') - } - } - - - -} - - - - - -//编辑消防分类窗口 -@Component({ - selector: 'app-editingFire', - templateUrl: './editingFireControl.html', - styleUrls: ['./fire-fighting-template.component.scss'] -}) -export class EditFireClassification { - newdata = []; - - private transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - computed:node.computed, - order:node.order, - children:node.children ||'', - tag:node.tag, - checked:node.checked, - }; - } - treeControl = new FlatTreeControl(node => node.level, node => node.expandable); - treeFlattener = new MatTreeFlattener(this.transformer, node => node.level, node => node.expandable, node => node.children); - newDataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); - - constructor(private http:HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public newdate) {} - - ngOnInit(): void { - this.fireID=this.newdate.e.id - this.fireName=this.newdate.e.name - this.rendering() - } - - - - fireID:any; //模板id - fireName:any; //模板name - checkedAll:boolean=false; //全选 - checkedList:any=[]; //选中的消防要素 - - //渲染Tree - rendering () { - this.http.get(`/api/FireCategories/${this.newdate.e.id}/FireElements`).subscribe((data:any)=>{ - data.forEach(item=>{ - if (item.checked === true) { - this.checkedList.push(item.id) - } - }) - this.newdata=[] - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - var parentNode = getparentNode(item.parentId); - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata.push(item) - } - } - }); - this.newDataSource.data = this.newdata; - this.treeControl.expandAll() - }) - } - hasChild = (_: number, node: any) => node.expandable; - - //change时判断是否选中 - changed (e,id) { - if (e.checked) { - this.checkedList.push(id) - } else if (e.checked == false) { - this.checkedList.splice(this.checkedList.findIndex(item => item === id), 1) - } - } - - //提交编辑修改 - onSubmit (e) { - if (this.checkedList.length) { - this.http.put(`/api/FireCategories/${this.fireID}`,{ - id:this.fireID, - name:e.name, - enabled:this.newdate.e.enabled, - fireElements:this.checkedList - }).subscribe(data=>{ - this.dialogRef.close('success') - }) - } else{ - alert('请选择消防要素') - } - } - - - -} \ No newline at end of file diff --git a/src/app/ui/fire-fighting-template/newFireFighting.html b/src/app/ui/fire-fighting-template/newFireFighting.html deleted file mode 100644 index 9d9fa46..0000000 --- a/src/app/ui/fire-fighting-template/newFireFighting.html +++ /dev/null @@ -1,44 +0,0 @@ -
创建消防要素模板
- -
-
- - - -
- - -
- -
- - - - - {{node.name}} - - - - - - - {{node.name}} - - - -
- -
- - -
-
-
\ No newline at end of file diff --git a/src/app/ui/fire-protection-elements/editingFireControl.html b/src/app/ui/fire-protection-elements/editingFireControl.html deleted file mode 100644 index 42b1071..0000000 --- a/src/app/ui/fire-protection-elements/editingFireControl.html +++ /dev/null @@ -1,41 +0,0 @@ -
编辑消防要素
-
- -
- - - - - -
- - - - 是 - - - 否 - - -
- -
- - - 信息录入 - 预案管理 - 指挥系统 - - -
- -
- - -
- -
-
\ No newline at end of file diff --git a/src/app/ui/fire-protection-elements/establish.html b/src/app/ui/fire-protection-elements/establish.html deleted file mode 100644 index 50f86b8..0000000 --- a/src/app/ui/fire-protection-elements/establish.html +++ /dev/null @@ -1,41 +0,0 @@ -
创建消防要素
-
- -
- - - - - -
- - - - 是 - - - 否 - - -
- -
- - - 信息录入 - 预案管理 - 指挥系统 - - -
- -
- - -
- -
-
\ No newline at end of file diff --git a/src/app/ui/fire-protection-elements/fire-protection-elements.component.html b/src/app/ui/fire-protection-elements/fire-protection-elements.component.html deleted file mode 100644 index 570e219..0000000 --- a/src/app/ui/fire-protection-elements/fire-protection-elements.component.html +++ /dev/null @@ -1,52 +0,0 @@ -
-
-
- 消防要素 -
- - - - {{node.name}} -
- - - -
-
- - - - - {{node.name}} -
- - - -
-
- -
-
- -
- -
-
\ No newline at end of file diff --git a/src/app/ui/fire-protection-elements/fire-protection-elements.component.scss b/src/app/ui/fire-protection-elements/fire-protection-elements.component.scss deleted file mode 100644 index 1415e16..0000000 --- a/src/app/ui/fire-protection-elements/fire-protection-elements.component.scss +++ /dev/null @@ -1,34 +0,0 @@ - -.magin { - margin: 18px 0 17px 10px; - font-weight: 600; -} - -.Box { - width: 100%; - display: flex; - padding-left: 10px; - .right { - width: 100%; - } -} - -.mat-tree-node { - width: 400px; - position: relative; - .float { - position: absolute; - right: 0; - } -} -.maginTop { - margin: 10px 0; -} - -.example-radio-group { - flex-direction: column; -} - -.example-radio-button { -margin: 5px; -} \ No newline at end of file diff --git a/src/app/ui/fire-protection-elements/fire-protection-elements.component.ts b/src/app/ui/fire-protection-elements/fire-protection-elements.component.ts deleted file mode 100644 index ed37e10..0000000 --- a/src/app/ui/fire-protection-elements/fire-protection-elements.component.ts +++ /dev/null @@ -1,226 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree'; -import { FlatTreeControl } from '@angular/cdk/tree'; - -@Component({ - selector: 'app-fire-protection-elements', - templateUrl: './fire-protection-elements.component.html', - styleUrls: ['./fire-protection-elements.component.scss'] -}) -export class FireProtectionElementsComponent implements OnInit { - data:any =[] - newdata = []; - - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - computed:node.computed, - order:node.order, - children:node.children ||'', - tag:node.tag - }; - } - treeControl = new FlatTreeControl(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); - - constructor(private http:HttpClient,public dialog: MatDialog) { } - - ngOnInit(): void { - this.getAllfireControl() - } - - //获取所有消防要素 - getAllfireControl () { - this.http.get('/api/FireElements').subscribe( - (data:any)=>{ - this.newdata=[] - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - var parentNode = getparentNode(item.parentId); - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata.push(item) - } - } - }); - this.dataSource.data = this.newdata; - } - - ) - } - - //更新数据后重新渲染Tree - getlist = ():void=>{ - this.http.get('/api/FireElements').subscribe( - (data:any)=>{ - this.newdata = [] - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - var parentNode = getparentNode(item.parentId); - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata.push(item) - } - } - }); - - const nodes = this.treeControl.dataNodes; - const expandNodes = []; - nodes.forEach((item) => { - if(item.expandable && this.treeControl.isExpanded(item)){ - expandNodes.push(item.id); - } - }); - this.dataSource.data = this.newdata; - let newNodes = this.treeControl.dataNodes; - newNodes = newNodes.filter(n => { - return expandNodes.indexOf(n.id) >= 0; - }); - newNodes.forEach(item => { - this.treeControl.expand(item); - }); - } - ) - } - - hasChild = (_: number, node: any) => node.expandable; - - //打开创建窗口 - establish (e) { - let dialogRef = this.dialog.open(Establish, - { - data:e - }); - dialogRef.afterClosed().subscribe((data)=>{ - if (data) {this.getlist()} - }); - } - - //打开编辑窗口 - edit (e) { - let dialogRef = this.dialog.open(EditingFireControl, - { - data:e - }); - dialogRef.afterClosed().subscribe((data)=>{ - if (data) {this.getlist()} - }); - } - - //删除 - delete (e) { - let isTrue = confirm(`您确定要删除${e.name}吗`) - if (isTrue) { - this.http.delete(`/api/FireElements/${e.id}`).subscribe(data=>{ - this.getlist() - }) - } - } - - - - -} - - - -//创建窗口组件 -@Component({ - selector: 'app-establish', - templateUrl: './establish.html', - styleUrls: ['./fire-protection-elements.component.scss'] -}) -export class Establish { - - constructor(private http:HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - ngOnInit(): void {} - - order:any; //创建消防要素order排序值 - - //提交创建消防要素 - onSubmit (e) { - if(this.data.children == '') { - this.order=0 - } else if (this.data.children.length) { - this.order=this.data.children[this.data.children.length-1].order+1 - } - this.http.post('/api/FireElements',{ - name:e.name, - order:this.order, - computed:e.radio, - tag:e.tag, - parentId:this.data.id - }).subscribe(data=>{ - this.dialogRef.close('success') - }) - } - - - -} - - - -//编辑窗口组件 -@Component({ - selector: 'app-editingFireControl', - templateUrl: './editingFireControl.html', - styleUrls: ['./fire-protection-elements.component.scss'] -}) -export class EditingFireControl { - - constructor(private http:HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - ngOnInit(): void { - this.fireName=this.data.name - } - - fireName:any; //消防要素name - - //编辑提交 - onSubmit (e) { - this.http.put(`/api/FireElements/${this.data.id}`,{ - id:this.data.id, - name:this.fireName, - order:this.data.order, - computed:this.data.computed, - tag:this.data.tag, - parentId:this.data.parentId - }).subscribe(data=>{ - this.dialogRef.close('success') - }) - } - - - - } diff --git a/src/app/ui/material-bank/addAttribute.html b/src/app/ui/material-bank/addAttribute.html deleted file mode 100644 index 92ede68..0000000 --- a/src/app/ui/material-bank/addAttribute.html +++ /dev/null @@ -1,71 +0,0 @@ -
新增属性
-
-
- -
- - - -
- -
- - - - {{item.viewValue}} - - - - - - -
- -
- - - - - -
- -
- - - 不验证 - - - 区间 - 正则匹配 - - - - - -
- -
- - - -
- -
- - - -
- -
- - -
-
-
\ No newline at end of file diff --git a/src/app/ui/material-bank/addmatlibrary.component.html b/src/app/ui/material-bank/addmatlibrary.component.html deleted file mode 100644 index 14ec468..0000000 --- a/src/app/ui/material-bank/addmatlibrary.component.html +++ /dev/null @@ -1,23 +0,0 @@ -
- 创建素材库 - - - - - - - 信息录入 - 预案管理 - 指挥系统 - - - - -
- - -
- -
\ No newline at end of file diff --git a/src/app/ui/material-bank/addmatlibrary.component.ts b/src/app/ui/material-bank/addmatlibrary.component.ts deleted file mode 100644 index a9dedaa..0000000 --- a/src/app/ui/material-bank/addmatlibrary.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -@Component({ - selector: 'addmatlibrary', - templateUrl: './addmatlibrary.component.html', - styleUrls: ['./material-bank.component.scss'] - }) - export class AddMatLibrary { - myControl = new FormControl(); - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.post("/api/AssetLibraries",{ - id: "", - name: value.name, - order: this.data.allMaterialBank[this.data.allMaterialBank.length - 1].order + 1, - tag: value.tag, - enabled: true, - modifiedTime: time - }).subscribe(data=>{ - this.dialogRef.close(); - }) - } - } \ No newline at end of file diff --git a/src/app/ui/material-bank/addoriginalcopy.component.html b/src/app/ui/material-bank/addoriginalcopy.component.html deleted file mode 100644 index 7f78ddf..0000000 --- a/src/app/ui/material-bank/addoriginalcopy.component.html +++ /dev/null @@ -1,91 +0,0 @@ -
-
- 新增原件 -
-
-
- - - - - - - 多点连线 - 多边形 - - -
- 固定大小: - - - - -
-
- 填充方式: - - 颜色 - 图片 - -
-
-
    -
  • -
-
-
- 图片:(选择后请点击上传) -
- 暂无图片 -
- -
-
- -
-
- - - -
-
- -
- - - -
  • {{node.name}}
  • -
    - - - - -
  • {{node.name}}
  • -
    -
    -
    -
    - -
    - - - -
    - - -
    - -
    diff --git a/src/app/ui/material-bank/addoriginalcopy.component.ts b/src/app/ui/material-bank/addoriginalcopy.component.ts deleted file mode 100644 index daa0644..0000000 --- a/src/app/ui/material-bank/addoriginalcopy.component.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -import { TreeService } from '../../http-interceptors/tree.service' -import { FileUploader } from 'ng2-file-upload' - -import { DomSanitizer } from '@angular/platform-browser' -@Component({ - selector: 'addoriginalcopy', - templateUrl: './addoriginalcopy.component.html', - styleUrls: ['./material-bank.component.scss'] - }) - export class AddOriginalCopy { - - uploader:FileUploader = new FileUploader({ - url: "/api/Objects/PlanPlatform", - method: "POST", - itemAlias: "uploadedfile" - }); - - - - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - children:node.children - }; - } - treeControl = new FlatTreeControl(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); - myControl = new FormControl(); - displaynoneid = ""//选择的关联消防id - displaynonename = "" - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private tree:TreeService,private sanitizer:DomSanitizer) {} - - - onNoClick(): void { - this.dialogRef.close(); - } - ngOnInit() { - this.http.get('/api/FireElements').subscribe(data=>{ - this.dataSource.data = this.tree.toTree(data) - }) - } - add(e){ - this.displaynoneid = e.id - this.displaynonename = e.name - } - hasChild = (_: number, node: any) => node.expandable; - - colors = ['#066eed','#00e5ef','#00ef76','#ffff00','#efb522','#20b4ac','#836eff','#ff8d00','#ef00ef','#ffa17a','#ff6a6a','#ff0000','#ff6eb5','#00bfff','#54ff9f','#00cd00','#00ffff','#6495ed','#ffdbb9','#836eff'] - isshow = true//选择颜色或者上传图片 - colorIndex:any=0; //选中的颜色的index - selectedcolor = "#066eed" - imgUrl = ""//返回来的图片地址后缀 - selectcolor(item,key){ - if(this.colorIndex != key){ - this.colorIndex = key - } - this.selectedcolor = item - } - changecolor(){ - this.isshow = true - } - changeimg(){ - this.isshow = false - } - imgsrc = "" - filechange(e){ - const file = e.srcElement.files[0]; // 获取图片这里只操作一张图片 - var reader = new FileReader(); - reader.readAsDataURL(file); - var image:any = new Image(); - reader.onload = function(){ - image.src = reader.result - } - setTimeout(() => { - if(image.width!=128 && image.height!=128){ - var obj = document.getElementById('selectedfile') ; - obj.outerHTML=obj.outerHTML; - alert("请选择分辨率为128*128的图片") - } - }, 100); - } - upload(){ - if(!this.uploader.queue[0]){ - alert("请选择文件") - }else{ - this.uploader.queue[0].upload();//开始上传 - this.uploader.queue[0].onSuccess = (response, status, headers) => { - // 上传文件成功 - if (status == 201) { - // 上传文件后获取服务器返回的数据 - alert("上传成功") - let tempRes = JSON.parse(response); - this.imgUrl = tempRes.objectName - this.imgsrc = '/api/Objects/PlanPlatform/' + this.imgUrl - }else { - // 上传文件后获取服务器返回的数据错误 - } - }; - this.uploader.queue[0].onError = (response, status, headers) => { - if (status == 401) { - alert("无权限上传") - } - }; - } - - } - padding = "0" - onSubmit(value){ - value.pige=Boolean(Number(value.pige)) - if(value.padding == "0"){//填充方式为颜色 - this.http.post(`/api/Assets`,{ - id:"", - name:value.name, - width: 0, - height: 0, - angle: 0, - interactiveMode: Number(value.tag),//交互方式 - fixedSize: value.pige, - fillMode: Number(value.padding),//填充方式 - color: this.selectedcolor+'80', - imageUrl:"", - order: 0, - enabled: true, - propertyInfos: [ - ], - fireElementId:this.displaynoneid - }, - { - params: { - libraryId:this.data.node.id, - } - }).subscribe((data)=>{ - this.dialogRef.close("ooo"); - alert("新建成功") - }) - }else{ - this.http.post(`/api/Assets`,{ - id:"", - name:value.name, - width: 0, - height: 0, - angle: 0, - interactiveMode: Number(value.tag),//交互方式 - fixedSize: value.pige, - fillMode: Number(value.padding),//填充方式 - color: "", - imageUrl:'/api/Objects/PlanPlatform/' + this.imgUrl, - order: 0, - enabled: true, - propertyInfos: [ - ], - fireElementId:this.displaynoneid - }, { - params: { - libraryId:this.data.node.id, - } - }).subscribe((data)=>{ - this.dialogRef.close("ooo"); - alert("新建成功") - }) - } - } - } \ No newline at end of file diff --git a/src/app/ui/material-bank/attribute.html b/src/app/ui/material-bank/attribute.html deleted file mode 100644 index 77a0c72..0000000 --- a/src/app/ui/material-bank/attribute.html +++ /dev/null @@ -1,89 +0,0 @@ -
    -
    -
    {{data.name}}
    -
    - - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    add_to_photos - - 名称 - {{element.propertyName}} - 类型 - - - - - - 默认值 - {{element.propertyValue}} - 必填 - - - 单位 - {{element.physicalUnit}} - 操作 - border_color - visibility - visibility_off - block - block - delete -
    -
    -
    \ No newline at end of file diff --git a/src/app/ui/material-bank/editAttribute.html b/src/app/ui/material-bank/editAttribute.html deleted file mode 100644 index 725edc3..0000000 --- a/src/app/ui/material-bank/editAttribute.html +++ /dev/null @@ -1,72 +0,0 @@ -
    编辑属性
    -
    -
    - -
    - - - -
    - -
    - - - - {{item.viewValue}} - - - - - - -
    - -
    - - - - - -
    - -
    - - - 不验证 - - - 区间 - 正则匹配 - - - - - -
    - -
    - - - -
    - -
    - - - -
    - -
    - - -
    -
    -
    \ No newline at end of file diff --git a/src/app/ui/material-bank/editmatlibrary.component.html b/src/app/ui/material-bank/editmatlibrary.component.html deleted file mode 100644 index f79ec8b..0000000 --- a/src/app/ui/material-bank/editmatlibrary.component.html +++ /dev/null @@ -1,23 +0,0 @@ -
    - 修改素材库 - - - - - - - 信息录入 - 预案管理 - 指挥系统 - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/material-bank/editmatlibrary.component.ts b/src/app/ui/material-bank/editmatlibrary.component.ts deleted file mode 100644 index ffb9994..0000000 --- a/src/app/ui/material-bank/editmatlibrary.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -@Component({ - selector: 'editmatlibrary', - templateUrl: './editmatlibrary.component.html', - styleUrls: ['./material-bank.component.scss'] - }) - export class EditMatLibrary { - myControl = new FormControl(); - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.put(`/api/AssetLibraries/${this.data.material.id}`,{ - id: this.data.material.id, - name: value.name, - order: this.data.material.order, - tag: value.tag, - enabled: true, - modifiedTime: time - }).subscribe(data=>{ - this.dialogRef.close(); - }) - } - } \ No newline at end of file diff --git a/src/app/ui/material-bank/editoriginalcopy.component.html b/src/app/ui/material-bank/editoriginalcopy.component.html deleted file mode 100644 index 5cdb0e3..0000000 --- a/src/app/ui/material-bank/editoriginalcopy.component.html +++ /dev/null @@ -1,92 +0,0 @@ -
    -
    - 编辑原件 -
    -
    -
    - - - - - - - 多点连线 - 多边形 - - -
    - 固定大小: - - - - -
    -
    - 填充方式: - - 颜色 - 图片 - -
    -
    -
      -
    • -
    -
    -
    - 图片:(选择后请点击上传) -
    - 暂无图片 -
    - - -
    -
    - -
    -
    - - - -
    -
    - -
    - - - -
  • {{node.name}}
  • -
    - - - - -
  • {{node.name}}
  • -
    -
    -
    -
    - -
    - - - -
    - - -
    - -
    diff --git a/src/app/ui/material-bank/editoriginalcopy.component.ts b/src/app/ui/material-bank/editoriginalcopy.component.ts deleted file mode 100644 index 2cfde1b..0000000 --- a/src/app/ui/material-bank/editoriginalcopy.component.ts +++ /dev/null @@ -1,172 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -import { TreeService } from '../../http-interceptors/tree.service' -import { FileUploader } from 'ng2-file-upload' -import { DomSanitizer } from '@angular/platform-browser' -@Component({ - selector: 'editoriginalcopy', - templateUrl: './editoriginalcopy.component.html', - styleUrls: ['./material-bank.component.scss'] - }) - export class EditOriginalCopy { - - uploader:FileUploader = new FileUploader({ - url: "/api/Objects/PlanPlatform", - method: "POST", - itemAlias: "uploadedfile" - }); - - - - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - children:node.children - }; - } - treeControl = new FlatTreeControl(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); - myControl = new FormControl(); - displaynoneid = ""//选择的关联消防id - displaynonename = "" - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private tree:TreeService,private sanitizer:DomSanitizer) {} - - - onNoClick(): void { - this.dialogRef.close(); - } - ngOnInit() { - this.http.get('/api/FireElements').subscribe(data=>{ - this.dataSource.data = this.tree.toTree(data) - }) - } - add(e){ - this.displaynoneid = e.id - this.displaynonename = e.name - } - hasChild = (_: number, node: any) => node.expandable; - - colors = ['#066eed','#00e5ef','#00ef76','#ffff00','#efb522','#20b4ac','#836eff','#ff8d00','#ef00ef','#ffa17a','#ff6a6a','#ff0000','#ff6eb5','#00bfff','#54ff9f','#00cd00','#00ffff','#6495ed','#ffdbb9','#836eff'] - isshow = true//选择颜色或者上传图片 - colorIndex:any=0; //选中的颜色的index - selectedcolor = "#066eed" - imgUrl = ""//返回来的图片地址后缀 - defaultname = this.data.Original.name//点击的原件的name - OriginalId = this.data.Original.id//点击的原件的id - OriginalfireElementId = this.data.Original.fireElementId//点击的原件的消防id - selectcolor(item,key){ - if(this.colorIndex != key){ - this.colorIndex = key - } - this.selectedcolor = item - } - changecolor(){ - this.isshow = true - } - changeimg(){ - this.isshow = false - } - imgsrc = "" - //提交图片 - filechange(e){ - const file = e.srcElement.files[0]; // 获取图片这里只操作一张图片 - var reader = new FileReader(); - reader.readAsDataURL(file); - var image:any = new Image(); - reader.onload = function(){ - image.src = reader.result - } - setTimeout(() => { - if(image.width!=128 && image.height!=128){ - var obj = document.getElementById('selectedfile') ; - obj.outerHTML=obj.outerHTML; - alert("请选择分辨率为128*128的图片") - } - }, 100); - } - //上传图片 - upload(){ - if(!this.uploader.queue[0]){ - alert("请选择文件") - }else{ - this.uploader.queue[0].upload();//开始上传 - this.uploader.queue[0].onSuccess = (response, status, headers) => { - // 上传文件成功 - if (status == 201) { - // 上传文件后获取服务器返回的数据 - alert("上传成功") - let tempRes = JSON.parse(response); - this.imgUrl = tempRes.objectName - this.imgsrc = '/api/Objects/PlanPlatform/' + this.imgUrl - }else { - // 上传文件后获取服务器返回的数据错误 - } - }; - this.uploader.queue[0].onError = (response, status, headers) => { - if (status == 401) { - alert("无权限上传") - } - }; - } - - } - padding = "0" - - onSubmit(value){ - value.pige=Boolean(Number(value.pige)) - if(value.padding == "0"){//填充方式为颜色 - this.http.put(`/api/Assets/${this.OriginalId}`,{ - id:this.OriginalId, - name:value.name, - width: 0, - height: 0, - angle: 0, - interactiveMode: Number(value.tag),//交互方式 - fixedSize: value.pige, - fillMode: Number(value.padding),//填充方式 - color: this.selectedcolor+'80', - imageUrl:"", - order: 0, - enabled: true, - propertyInfos: [ - ], - fireElementId:this.displaynoneid - }).subscribe((data)=>{ - this.dialogRef.close("ooo"); - alert("修改成功") - }) - }else{//填充方式为图片 - this.http.put(`/api/Assets/${this.OriginalId}`,{ - id:this.OriginalId, - name:value.name, - width: 0, - height: 0, - angle: 0, - interactiveMode: Number(value.tag),//交互方式 - fixedSize: value.pige, - fillMode: Number(value.padding),//填充方式 - color: "", - imageUrl:'/api/Objects/PlanPlatform/' + this.imgUrl, - order: 0, - enabled: true, - propertyInfos: [ - ], - fireElementId:this.displaynoneid - }).subscribe((data)=>{ - this.dialogRef.close("ooo"); - alert("修改成功") - }) - } - } - } \ No newline at end of file diff --git a/src/app/ui/material-bank/material-bank.component.html b/src/app/ui/material-bank/material-bank.component.html deleted file mode 100644 index ea60ebd..0000000 --- a/src/app/ui/material-bank/material-bank.component.html +++ /dev/null @@ -1,66 +0,0 @@ -
    -
    -
    - keyboard_arrow_down - chevron_right - 素材库管理 -
    - - - - -
    -
    -
    -
    - folder{{item.name}} - block -
    -
    - -
    - -
    -
    -
    -

    {{material.name}}

    -
    - - - - - - -
    -
    - -
    -
    - - {{item.name}} - block -
    -
    - -
    -
    -
    diff --git a/src/app/ui/material-bank/material-bank.component.scss b/src/app/ui/material-bank/material-bank.component.scss deleted file mode 100644 index 554a515..0000000 --- a/src/app/ui/material-bank/material-bank.component.scss +++ /dev/null @@ -1,255 +0,0 @@ -.content { - margin: 0 0 0 10px; - width: 100%; - height: 100%; - display: flex; - .leftBox { - flex: 20%; - padding-top: 10px; - } - .rightBox { - border-left: 1px solid #999; - flex: 80%; - display: flex; - flex-direction: column; - .topBox { - flex:1; - .originalScript { - border-bottom: 1px solid #999; - background-color: #fafafa; - padding:5px 0; - width: 100%; - padding-left: 20px; - font-weight: 500; - display: flex; - flex-direction: row; - p{ - margin-top: 11px; - } - .mat-icon { - vertical-align:middle; - } - } - } - } -} - - - -.bank { - display: flex; - font-size: 18px; - font-weight: 500; -} - -.mat-icon { - width: 18px; - height: 18px; - vertical-align:top; - margin-right: 8px; - cursor:pointer; -} -.material { - cursor:pointer; - height: 30px; - font-size: 16px; - margin-top: 10px; - padding-left: 25px; - .btn { - color: #ffe69b; - } - .blockBtn { - float: right; - margin-right: 15px; - width: 16px; - height: 16px; - } -} -.imgBox { - padding: 5px 0 0 5px; - margin-top: 5px; - - display: flex; - flex-direction: row; - flex-wrap: wrap; - .imgDiv { - span{ - overflow: hidden; - text-overflow: ellipsis; - } - display: inline-block; - margin-right: 10px; - margin-bottom: 10px; - width: 90px; - height: 165px; - text-align: center; - img { - width: 100%; - } - } -} - -.attribute { - padding-left: 25px; - display: flex; - flex-direction: row; - background-color: #d7d7d7; - div { - margin-top: 10px; - margin-right: 25px; - } - .attributeLeft{ - flex: 75%; - } -} -.overFlow { - height: 500px; - overflow: auto; -} -table { - width: 100%; - text-align: center; - .cdk-header-cell { - text-align: center; - } -} - - - -.active { - background-color: rgba(225,225,225,0.8) -} -.OriginalActive { - background-color: rgba(225,225,225,0.8); -} - -.btn{ - text-align: center; - button{ - margin: 0 8px; - } -} -.addbtn{ - width: 450px; - height: 32px; - border-top: 1px solid black; - text-align: center; - padding-top: 6px; - button{ - margin: 0 6px; - } -} -.mat-radio-button { - font-size: 13px; - margin-right: 5px; -} -.topbox{ - height: 32px; - border-bottom: 1px solid black; - -} -.mainbox{ - width: 450px; - height: 380px; - .mainleft{ - height: 370px; - width: 220px; - float: left; - border-right: 1px solid black; - padding-top: 10px; - mat-form-field{ - display: block; - width: 220px; - } - .padding{ - margin-top: 12px; - } - .color{ - height: 50px; - .color1{ - - margin-bottom: 5px; - margin-top: 12px; - li{ - width: 17px; - height: 17px; - list-style: none; - // margin: 2px; - float: left; - border: 2px solid white; - } - } - } - } - .mainright{ - width: 220px; - height: 380px; - float: right; - overflow: auto; - label{ - font-weight: 900; - } - } -} -.coloractive{ - border: 2px solid black !important; - -} -.pigepadding{ - font-size: 14px; -} -.selectoriginalcopybox{ - width: 423px; - height: 300px; - border: 1px solid black; - overflow: auto; - margin-bottom: 10px; -} -.originalcopyimg{ - width: 100px; - height: 120px; - float: left; - text-align: center; - img{ - width: 70px; - height: 70px; - } - p{ - font-size: 11px; - height: 11px; - } - -} -.selectedback{ - background-color:rgba(0,145,219,0.5); -} -.selecteditem{ - // background: grey; - cursor:not-allowed -} -.matname{ - margin-left: 6px; - -} -.divImg{ - width:100px; - height: 50px; - font-size: 15px; - img{ - width: 50px; - } -} -.relevancefire{ - margin-top: 5px; -} -.fireli{ - list-style: none; - -} -.fireli:hover{ - background: rgba(225, 225, 225, 0.8); - cursor: pointer; -} -.firebtn{ - line-height: 24px; -} \ No newline at end of file diff --git a/src/app/ui/material-bank/material-bank.component.ts b/src/app/ui/material-bank/material-bank.component.ts deleted file mode 100644 index 5adcf57..0000000 --- a/src/app/ui/material-bank/material-bank.component.ts +++ /dev/null @@ -1,528 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { AddMatLibrary } from './addmatlibrary.component' -import { EditMatLibrary } from './editmatlibrary.component' -import { AddOriginalCopy } from './addoriginalcopy.component' -import { MatTableDataSource } from '@angular/material/table'; -import { EditOriginalCopy } from './editoriginalcopy.component' -import { SelectOriginalCopy } from './selectoriginalcopy.component' -import format from 'date-fns/format'; - - - -@Component({ - selector: 'app-material-bank', - templateUrl: './material-bank.component.html', - styleUrls: ['./material-bank.component.scss'] -}) -export class MaterialBankComponent implements OnInit { - - constructor(private http:HttpClient,public dialog: MatDialog) { } - - ngOnInit(): void { - this.http.get('/api/AssetLibraries').subscribe(data=>{ - this.material = data[0] - this.allMaterialBank = data - this.getSourceMaterial() - }) - } - - allMaterialBank:any; //所有素材库 - material:any={name:''}; //选中的素材库 - materialIndex:any=0; //选中的素材库index - - sourceMaterial:any; //素材库对应所有原件 - Original:any; //选中的原件 - OriginalIndex:any=null; //选中的原件index - isshow = true//左侧列表的显示隐藏 - //收起左侧列表 - showlist(){ - this.isshow = !this.isshow - } - //获取所有素材库 - getMaterialBank () { - this.http.get('/api/AssetLibraries').subscribe(data=>{ - this.allMaterialBank = data - this.material = data[this.materialIndex] - }) - } - - //获得指定素材库所有原件 - getSourceMaterial () { - this.sourceMaterial = null - let data = { - libraryId:this.material.id - } - this.http.get('/api/Assets',{ - params:data - }).subscribe(data=>{ - this.sourceMaterial = data - this.Original = data[this.OriginalIndex] - }) - } - - //选中素材库 - add (e,index) { - this.Original = null - this.OriginalIndex = null - if (this.materialIndex != index) { - this.material = e - this.materialIndex = index - this.getSourceMaterial() - } - } - - //选中原件 - addOriginal (e,index) { - this.Original = e - this.OriginalIndex = index - } - - //打开查看属性弹窗 - viewProperties () { - if(this.Original){ - let data = this.Original - const dialogRef = this.dialog.open(attributeComponent, - {width: '1000px',data}); - dialogRef.afterClosed().subscribe( - (data)=>{if(data){this.getSourceMaterial()}} - ) - }else { - alert('请选择原件') - } - } - - - - - //新增素材库 - addmatlibrary(){ - const dialogRef = this.dialog.open(AddMatLibrary, {//调用open方法打开对话框并且携带参数过去 - width: '260px', - data: {allMaterialBank:this.allMaterialBank} - }); - dialogRef.afterClosed().subscribe( - data=>{ - this.getMaterialBank () - } - ); - } - - //编辑素材库 - editmatlibrary(){ - const dialogRef = this.dialog.open(EditMatLibrary, {//调用open方法打开对话框并且携带参数过去 - width: '260px', - data: {allMaterialBank:this.allMaterialBank,material:this.material} - }); - dialogRef.afterClosed().subscribe( - data=>{ - this.getMaterialBank () - } - ); - } - - //删除素材库 - delete(){ - var isdeleted = confirm(`确定要删除${this.material.name}素材库吗?`) - if(isdeleted){ - //请求删除接口 - this.http.delete(`/api/AssetLibraries/${this.material.id}`).subscribe( data=>{ - this.getMaterialBank () - }) - } - } - - //禁启用素材库 - disabled(){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - if(this.material.enabled){ - this.http.put(`/api/AssetLibraries/${this.material.id}`,{ - id: this.material.id, - name: this.material.name, - order: this.material.order, - tag: this.material.tag, - enabled: false, - modifiedTime: time - }).subscribe(data=>{ - alert("禁用成功") - this.getMaterialBank () - }) - }else{ - this.http.put(`/api/AssetLibraries/${this.material.id}`,{ - id: this.material.id, - name: this.material.name, - order: this.material.order, - tag: this.material.tag, - enabled: true, - modifiedTime: time - }).subscribe(data=>{ - alert("启用成功") - this.getMaterialBank () - }) - } - - } - - //新增素材原件 - addoriginalcopy(node){ - const dialogRef = this.dialog.open(AddOriginalCopy, {//调用open方法打开对话框并且携带参数过去 - height:"500px", - data: {allMaterialBank:this.allMaterialBank,node:node} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getSourceMaterial () - } - - } - ); - } - //修改素材原件 - editoriginalcopy(node){ - if(this.Original){ - const dialogRef = this.dialog.open(EditOriginalCopy, {//调用open方法打开对话框并且携带参数过去 - height:"500px", - data: {allMaterialBank:this.allMaterialBank,node:node,Original:this.Original} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getSourceMaterial () - } - } - ); - }else{ - alert("请选择原件") - } - - } - - //禁启用原件 - disableoriginal(material){ - if(this.Original){ - this.http.put(`/api/Assets/${this.Original.id}`,{ - id:this.Original.id, - name:this.Original.name, - width: 0, - height: 0, - angle: 0, - interactiveMode:this.Original.interactiveMode,//交互方式 - fixedSize: this.Original.fixedSize, - fillMode: this.Original.fillMode,//填充方式 - color: this.Original.color, - imageUrl:this.Original.imageUrl, - order: 0, - enabled: !this.Original.enabled, - propertyInfos: [ - ], - fireElementId:this.Original.fireElementId - }).subscribe((data)=>{ - this.getSourceMaterial () - }) - }else{ - alert("请选择原件") - } - } - - //删除原件 - deleteoriginal(material){ - if(this.Original){ - var isdeleted = confirm(`确定要删除当前原件吗?`) - if(isdeleted){ - //请求删除接口 - this.http.delete(`/api/Assets/${this.Original.id}`).subscribe( data=>{ - this.getSourceMaterial () - }) - } - }else{ - alert("请选择原件") - } - } - - //选择原件素材 material为当前素材库的信息 - selectoriginal(material){ - const dialogRef = this.dialog.open(SelectOriginalCopy, {//调用open方法打开对话框并且携带参数过去 - height:"500px", - data: {allMaterialBank:this.allMaterialBank,material:material} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getSourceMaterial () - } - - } - ); - } - - - -} - - - -//原件对应所有属性弹窗 -@Component({ - selector: 'app-attribute', - templateUrl: './attribute.html', - styleUrls: ['./material-bank.component.scss'] -}) -export class attributeComponent { - - constructor(private http:HttpClient,public dialog: MatDialog, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data,) { } - - ngOnInit(): void { - if (this.data.propertyInfos == null) { - this.data.propertyInfos = [] - } - this.setIndex() - this.dataSource = new MatTableDataSource(this.data.propertyInfos) - } - - displayedColumns = ['checked', 'name', 'type', 'default','required','physicalUnit','operation']; - dataSource:any=[]; //当前原件属性渲染table - dataSourceIndex:any=[]; //选中属性的index - - - - //封装函数每次更改,重新获取下标 - setIndex () { - if (this.data.propertyInfos) { - this.data.propertyInfos.forEach((item,index)=>{ - item.index = index - }) - } - } - - //点击checked框获取当前属性index - checkedChange (e,index) { - if (e.checked) { - this.dataSourceIndex.push(index) - } else { - this.dataSourceIndex.splice(this.dataSourceIndex.findIndex(item=>item==index),1) - } - } - - //上移 - toTop () { - if(this.dataSourceIndex.length) { - let index = this.dataSourceIndex[this.dataSourceIndex.length-1] - if (index != 0) { - let data = this.data.propertyInfos[index] - this.data.propertyInfos[index]=this.data.propertyInfos[index-1] - this.data.propertyInfos[index-1] = data - this.dataSourceIndex[this.dataSourceIndex.length-1] = index-1 - this.setIndex() - this.dataSource = new MatTableDataSource(this.data.propertyInfos) - } - } - } - - //下移 - toBottom () { - if(this.dataSourceIndex.length) { - let index = this.dataSourceIndex[this.dataSourceIndex.length-1] - if (index != this.data.propertyInfos.length-1) { - let data = this.data.propertyInfos[index] - this.data.propertyInfos[index]=this.data.propertyInfos[index+1] - this.data.propertyInfos[index+1] = data - this.dataSourceIndex[this.dataSourceIndex.length-1] = index+1 - this.setIndex() - this.dataSource = new MatTableDataSource(this.data.propertyInfos) - } - } - } - - - - //新增属性弹窗 - add () { - const dialogRef = this.dialog.open(addAttributeComponent); - dialogRef.afterClosed().subscribe( - (data)=>{ - if (data) { - this.data.propertyInfos.push(data) - this.setIndex() - this.dataSource = new MatTableDataSource(this.data.propertyInfos)} - }) - } - - //编辑属性弹窗 - edit (e) { - let data = this.data.propertyInfos[e] - const dialogRef = this.dialog.open(editAttribute,{data}); - dialogRef.afterClosed().subscribe( - data=>{ - if (data) { - this.data.propertyInfos[data.index] = data - this.setIndex() - this.dataSource = new MatTableDataSource(this.data.propertyInfos)} - }) - } - - //显示 - visible (e) { - this.data.propertyInfos[e].visible = true - } - //隐藏 - noVisible (e) { - this.data.propertyInfos[e].visible = false - } - //启用 - enabled (e) { - this.data.propertyInfos[e].enabled = true - } - //禁用 - noEnabled (e) { - this.data.propertyInfos[e].enabled = false - } - //删除 - delete (e) { - let isTrue = confirm('您确定要删除吗') - if (isTrue) { - this.data.propertyInfos.splice(e,1) - this.setIndex() - this.dataSource = new MatTableDataSource(this.data.propertyInfos) - } - } - - - - //原件属性保存 - preservation () { - if (this.data.propertyInfos.length) { - this.data.propertyInfos.forEach(item => { - delete item.index - }); - this.submit() - } else { - this.submit() - } - } - - //提交保存 - submit () { - this.http.put(`/api/Assets/${this.data.id}`,{ - id:this.data.id, - name:this.data.name, - width:this.data.width, - height:this.data.height, - angle:this.data.angle, - interactiveMode:this.data.interactiveMode, - fixedSize:this.data.fixedSize, - fillMode:this.data.fillMode, - color:this.data.color, - imageUrl:this.data.imageUrl, - order:this.data.order, - enabled:this.data.enabled, - propertyInfos:this.data.propertyInfos, - fireElementId:this.data.fireElementId - }).subscribe(data=>{ - this.dialogRef.close('success') - alert('保存成功') - }) - } - - - -} - - - -//新增属性弹窗 -export interface Food { - value: number; - viewValue: string; -} -@Component({ - selector: 'app-addAttribute', - templateUrl: './addAttribute.html', - styleUrls: ['./material-bank.component.scss'] -}) -export class addAttributeComponent { - - constructor(private http:HttpClient,public dialog: MatDialog, - public dialogRef: MatDialogRef,) { } - - ngOnInit(): void {} - - //定义属性数据 - propertyType:Food[]=[ - {value:0, viewValue: '单行文本'}, - {value:1, viewValue: '多行文本'}, - {value:2, viewValue: '数值'}, - {value:3, viewValue: '图片'}, - {value:4, viewValue: '图片数量'},] - - //提交表单 - onSubmit (e) { - e.order = 0 - e.enabled = true - e.visible = true - e.required=Boolean(Number(e.required)) - this.dialogRef.close(e) - } - - - -} - - -//编辑属性弹窗 -@Component({ - selector: 'app-editAttribute', - templateUrl: './editAttribute.html', - styleUrls: ['./material-bank.component.scss'] -}) -export class editAttribute { - - constructor(private http:HttpClient,public dialog: MatDialog, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data,) { } - - ngOnInit(): void { - this.propertyName = this.data.propertyName - this.propertyValue = this.data.propertyValue - this.propertyType = this.data.propertyType - this.required = this.data.required - this.ruleName = this.data.ruleName - this.ruleValue = this.data.ruleValue - this.physicalUnit = this.data.physicalUnit - this.tag = this.data.tag} - - - propertyName:any - propertyValue:any; - propertyType:number; - required:boolean; - ruleName:any; - ruleValue:any; - physicalUnit:any; - tag:any; - - //定义属性数据 - type:Food[]=[ - {value:0, viewValue: '单行文本'}, - {value:1, viewValue: '多行文本'}, - {value:2, viewValue: '数值'}, - {value:3, viewValue: '图片'}, - {value:4, viewValue: '图片数量'},] - - //提交表单 - onSubmit (e) { - e.order = 0 - e.enabled = this.data.enabled - e.visible = this.data.visible - e.index = this.data.index - e.required=Boolean(Number(e.required)) - this.dialogRef.close(e) - } - - - -} \ No newline at end of file diff --git a/src/app/ui/material-bank/selectoriginalcopy.component.html b/src/app/ui/material-bank/selectoriginalcopy.component.html deleted file mode 100644 index 5cc238f..0000000 --- a/src/app/ui/material-bank/selectoriginalcopy.component.html +++ /dev/null @@ -1,22 +0,0 @@ -
    - 选择原件 - - - {{item.name}} - - -
    -
    - -

    {{item.name}}

    -

    (已拥有)

    - -
    -
    - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/material-bank/selectoriginalcopy.component.ts b/src/app/ui/material-bank/selectoriginalcopy.component.ts deleted file mode 100644 index e4595c2..0000000 --- a/src/app/ui/material-bank/selectoriginalcopy.component.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -@Component({ - selector: 'selectoriginalcopy', - templateUrl: './selectoriginalcopy.component.html', - styleUrls: ['./material-bank.component.scss'] - }) - export class SelectOriginalCopy { - myControl = new FormControl(); - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - matlibrary = this.data.allMaterialBank//所有素材库 - selectedmatlibraryid = ""//当前下拉框选中的素材库id - sourceMaterial:any; //指定素材库对应所有原件 - atpresentSourceMaterial:any//当前选择原件素材库对应所有原件 - ngOnInit(): void { - this.getatpresentSourceMaterial ()//初始化时先获取一下当前素材库对应所有原件,然后在获取指定素材库原件时进行筛选对比 - let data = { - libraryId:"5de77a32c40f13242011f054" - } - this.http.get('/api/Assets',{ - params:data - }).subscribe((data : any)=>{ - data.forEach(item => { - this.atpresentSourceMaterial.forEach(n=>{ - if(n.id == item.id){ - item.isselected = true - } - }) - }); - this.sourceMaterial = data - }) - - } - onNoClick(): void { - this.dialogRef.close(); - } - - xxx="5de77a32c40f13242011f054" - //获得指定素材库所有原件 - getSourceMaterial () { - let data = { - libraryId:this.selectedmatlibraryid - } - this.http.get('/api/Assets',{ - params:data - }).subscribe((data : any)=>{ - data.forEach(item => { - this.atpresentSourceMaterial.forEach(n=>{ - if(n.id == item.id){ - item.isselected = true - } - }) - }); - this.sourceMaterial = data - }) - } - //获得当前素材库所有原件 - getatpresentSourceMaterial (){ - let data = { - libraryId:this.data.material.id - } - this.http.get('/api/Assets',{ - params:data - }).subscribe(data=>{ - this.atpresentSourceMaterial = data - }) - } - selectmatlibrart(item){//点击下拉框中的一项 - this.selectedmatlibraryid = item.id - this.getSourceMaterial () - } - aaa = "5de77a32c40f13242011f054" - selectedimg = []//需要提交的原件id数组 - clickimg(item){//点击选择原件的多张图片 - if(!item.isselected){ - if(item.istrue){//如果图片已经被选中,此时点击 - item.istrue = false - this.selectedimg.forEach((n,index) => { - if(n == item.id){//将此id从数组中移除 - this.selectedimg.splice(index,1) - } - }); - }else{//如果图片还没有被选中 - item.istrue = true - this.selectedimg.push(item.id)//将选中图片id存入数组 - } - } - - } - onSubmit(value){ - this.http.post("/api/Assets/Select",{ - assetLibraryId:this.data.material.id , - assetIds: this.selectedimg - }).subscribe(data=>{ - this.dialogRef.close('ooo'); - }) - } - } \ No newline at end of file diff --git a/src/app/ui/navmenus/createmenus.component.html b/src/app/ui/navmenus/createmenus.component.html deleted file mode 100644 index 3258a3d..0000000 --- a/src/app/ui/navmenus/createmenus.component.html +++ /dev/null @@ -1,24 +0,0 @@ -
    - - - - - - - - - - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/navmenus/editmenus.component.html b/src/app/ui/navmenus/editmenus.component.html deleted file mode 100644 index 845fa86..0000000 --- a/src/app/ui/navmenus/editmenus.component.html +++ /dev/null @@ -1,24 +0,0 @@ -
    - - - - - - - - - - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/navmenus/navmenus.component.html b/src/app/ui/navmenus/navmenus.component.html deleted file mode 100644 index 6351de2..0000000 --- a/src/app/ui/navmenus/navmenus.component.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - {{node.name}} - - - - - - - - - {{node.name}} - - - - - - \ No newline at end of file diff --git a/src/app/ui/navmenus/navmenus.component.scss b/src/app/ui/navmenus/navmenus.component.scss deleted file mode 100644 index f6123e2..0000000 --- a/src/app/ui/navmenus/navmenus.component.scss +++ /dev/null @@ -1,34 +0,0 @@ -table { - width: 100%; - th,td{ - text-align: center; - } -} -form{ - text-align: center; - button{ - margin: 0 12px; - } -} -mat-tree{ - width: 500px; - button{ - display: block; - float: right; - } - mat-tree-node{ - position: relative; - .deleted{ - position: absolute; - right: 0; - } - .create{ - position: absolute; - right: 80px; - } - .edit{ - position: absolute; - right: 40px; - } - } -} diff --git a/src/app/ui/navmenus/navmenus.component.spec.ts b/src/app/ui/navmenus/navmenus.component.spec.ts deleted file mode 100644 index 788f582..0000000 --- a/src/app/ui/navmenus/navmenus.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NavmenusComponent } from './navmenus.component'; - -describe('NavmenusComponent', () => { - let component: NavmenusComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ NavmenusComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(NavmenusComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/navmenus/navmenus.component.ts b/src/app/ui/navmenus/navmenus.component.ts deleted file mode 100644 index 25018ce..0000000 --- a/src/app/ui/navmenus/navmenus.component.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { Component, OnInit,Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { TreeService } from '../../http-interceptors/tree.service' -@Component({ - selector: 'app-navmenus', - templateUrl: './navmenus.component.html', - styleUrls: ['./navmenus.component.scss'] -}) -export class NavmenusComponent implements OnInit { - newdata = []; - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - children:node.children - }; - } - treeControl = new FlatTreeControl(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); - constructor(private http: HttpClient,public dialog: MatDialog,private tree:TreeService) { } - getlist = ():void=>{ - this.http.get('/api/NavMenus').subscribe((data: any[])=>{ - this.newdata = this.tree.toTree(data) - const nodes = this.treeControl.dataNodes; - const expandNodes = []; - nodes.forEach((item) => { - if(item.expandable && this.treeControl.isExpanded(item)){ - expandNodes.push(item.id); - } - }); - this.dataSource.data = this.newdata; - let newNodes = this.treeControl.dataNodes; - newNodes = newNodes.filter(n => { - return expandNodes.indexOf(n.id) >= 0; - }); - newNodes.forEach(item => { - this.treeControl.expand(item); - }); - - }) - } - //初始化页面时渲染出tree - ngOnInit() { - this.http.get('/api/NavMenus').subscribe((data: any[])=>{ - this.dataSource.data = this.tree.toTree(data) - }) - } - hasChild = (_: number, node: any) => node.expandable; - - //弹出创建窗口按钮 - createauthority(value){ - const dialogRef = this.dialog.open(CreateMenus, {//调用open方法打开对话框并且携带参数过去 - width: '260px', - data: {id:value.id,children:value.children,icon:value.icon,url:value.url} - }); - dialogRef.afterClosed().subscribe( - data=>{ - this.newdata = [] - this.getlist() - } - ); - } - //删除按钮 - deleted(authority){ - var isdeleted = confirm("确定要删除此用户吗?") - if(isdeleted){ - //请求删除接口 - this.newdata = [] - this.http.delete(`/api/NavMenus/${authority.id}`).subscribe( data=>{ - this.getlist() - }) - } - } - //编辑按钮 - edit(value){ - const dialogRef = this.dialog.open(EditMenus, {//调用open方法打开对话框并且携带参数过去 - width: '260px', - data: {id:value.id,parentId:value.parentId,order:value.order} - }); - dialogRef.afterClosed().subscribe( - data=>{ - this.newdata = [] - this.getlist() - } - ); - } -} - -//创建组件 -@Component({ - selector: 'createmenus', - templateUrl: './createmenus.component.html', - styleUrls: ['./navmenus.component.scss'] -}) -export class CreateMenus { - myControl = new FormControl(); - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - if(this.data.children){ - this.http.post( - '/api/NavMenus', - { - id: '', - name: value.name, - icon: value.icon, - url: value.url, - order:this.data.children[this.data.children.length -1].order + 1, - parentId: this.data.id - } - ).subscribe( - data=>{ - this.dialogRef.close(); - }, - err=>{ - alert("请填写正确格式") - } - ) - }else{ - this.http.post( - '/api/NavMenus', - { - id: '', - name: value.name, - icon: value.icon, - url: value.url, - order:0, - parentId: this.data.id - } - ).subscribe( - data=>{ - this.dialogRef.close(); - }, - err=>{ - alert("请填写正确格式") - } - ) - } - - } -} - - - -//编辑组件 -@Component({ - selector: 'editmenus', - templateUrl: './editmenus.component.html', - styleUrls: ['./navmenus.component.scss'] -}) -export class EditMenus { - myControl = new FormControl(); - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - if(value.icon){ - this.data.icon = value.icon - } - if(value.url){ - this.data.url = value.url - } - this.http.put( - ` /api/NavMenus/${this.data.id}`, - { - id: this.data.id, - name: value.name, - icon: this.data.icon, - url: this.data.url, - order:this.data.order, - parentId: this.data.parentId - } - ).subscribe( - data=>{ - this.dialogRef.close(); - }, - err=>{ - alert("请填写正确格式") - } - ) - } -} \ No newline at end of file diff --git a/src/app/ui/organization/createorganization.component.html b/src/app/ui/organization/createorganization.component.html deleted file mode 100644 index f3facfc..0000000 --- a/src/app/ui/organization/createorganization.component.html +++ /dev/null @@ -1,30 +0,0 @@ -
    - - - - - - - - - - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/organization/editorganization.component.html b/src/app/ui/organization/editorganization.component.html deleted file mode 100644 index 9a2cbfa..0000000 --- a/src/app/ui/organization/editorganization.component.html +++ /dev/null @@ -1,46 +0,0 @@ - -
    -
    - - - - - - - - - - - -
    - - -
    - -
    -
    -
    - - - - -
  • {{node.name}}
  • -
    - - - - -
  • {{node.name}}
  • -
    -
    -
    diff --git a/src/app/ui/organization/organization.component.html b/src/app/ui/organization/organization.component.html deleted file mode 100644 index 5d33f73..0000000 --- a/src/app/ui/organization/organization.component.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - {{node.name}} - - - - - - - - - - - - - - {{node.name}} - - - - - - - - - - - diff --git a/src/app/ui/organization/organization.component.scss b/src/app/ui/organization/organization.component.scss deleted file mode 100644 index 3e8692d..0000000 --- a/src/app/ui/organization/organization.component.scss +++ /dev/null @@ -1,71 +0,0 @@ -mat-tree{ - width:800px; - button{ - display: block; - float: right; - } - mat-tree-node{ - position: relative; - - .deleted{ - position: absolute; - right: 0px; - } - - .disabled{ - position: absolute; - right: 40px; - } - - .edit{ - position: absolute; - right:160px; - } - .create{ - position: absolute; - right: 200px; - } - .up{ - position: absolute; - right: 120px; - } - .down{ - position: absolute; - right: 80px; - } - } -} -form{ - text-align: center; - button{ - margin: 0 8px; - margin-top: 8px; - } -} - -.leftbox{ - width: 300px; - float: left; -} -.treebox{ - float: right; - height: 250px; - width: 300px; - /* overflow: auto; */ - overflow-x: hidden; - overflow-y: auto; -} -.smalltreebox{ - width: 300px; - mat-tree-node{ - width: 300px; - } -} -.orilist{ - list-style: none; - -} -.orilist:hover{ - cursor: pointer; - background-color: rgba(225, 225, 225, 0.8); -} \ No newline at end of file diff --git a/src/app/ui/organization/organization.component.ts b/src/app/ui/organization/organization.component.ts deleted file mode 100644 index 27ff287..0000000 --- a/src/app/ui/organization/organization.component.ts +++ /dev/null @@ -1,465 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { TreeService } from '../../http-interceptors/tree.service' -@Component({ - selector: 'app-organization', - templateUrl: './organization.component.html', - styleUrls: ['./organization.component.scss'] -}) -export class OrganizationComponent implements OnInit { - data:any =[] - newdata = []; - - private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数 - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - enabled:node.enabled, - order:node.order, - children:node.children, - isTop:node.isTop, - isBottom:node.isBottom - }; - } - treeControl = new FlatTreeControl(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); - - constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private tree: TreeService ) { - } - - //重新获取列表并且展开到上次位置的方法 - getlist = ():void=>{ - this.http.get('/api/Organizations').subscribe( - (data:any)=>{ - this.data = data; - this.newdata = this.tree.toTree(data) - - const nodes = this.treeControl.dataNodes; - const expandNodes = []; - nodes.forEach((item) => { - if(item.expandable && this.treeControl.isExpanded(item)){ - expandNodes.push(item.id); - } - }); - - - this.dataSource.data = this.newdata; - let newNodes = this.treeControl.dataNodes; - newNodes = newNodes.filter(n => { - return expandNodes.indexOf(n.id) >= 0; - }); - newNodes.forEach(item => { - this.treeControl.expand(item); - }); - - - } - ) - } - //初始化视图 - ngOnInit() { - this.http.get('/api/Organizations').subscribe( - (data:any)=>{ - this.data = data; - this.dataSource.data = this.tree.toTree(data); - this.treeControl.expand(this.treeControl.dataNodes[0]); - } - ) - } - hasChild = (_: number, node: any) => node.expandable; - - //创建组织按钮 - create(value){ - const dialogRef = this.dialog.open(CreateOrganization, {//调用open方法打开对话框并且携带参数过去 - width: '260px', - data: {id:value.id,childlength:value.children,level:value.level} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getlist() - } - } - ); - } - //编辑组织按钮 - edit(value){ - const dialogRef = this.dialog.open(EditOrganization, {//调用open方法打开对话框并且携带参数过去 - data: {id:value.id,parentId:value.parentId,order:value.order,level:value.level} - }); - dialogRef.afterClosed().subscribe( - data=>{ - this.getlist() - } - ); - } - //删除组织按钮 - delete(value){ - var isdeleted = confirm("确定要删除此组织?") - if(isdeleted){ - //请求删除接口 - this.http.delete(`/api/Organizations/${value.id}`).subscribe( data=>{ - this.getlist() - }) - } - } - //禁用按钮 - disable(value){ - if(!value.enabled){ - this.http.put( - `/api/Organizations/${value.id}`, - { - id:value.id, - code:"", - name: value.name, - level:value.level, - order: value.order, - location: null, - enabled: true, - parentId: value.parentId - } - ).subscribe( - data=>{ - this.snackBar.open('启用成功', '', { - duration: 3000 - }); - this.getlist() - }, - err=>{ - alert("操作无效") - } - ) - - }else{ - // var isdeleted = confirm("确定要禁用此组织?") - // if(isdeleted){ - this.http.put( - `/api/Organizations/${value.id}`, - { - id:value.id, - code:"", - name: value.name, - level:value.level, - order: value.order, - location: null, - enabled: false, - parentId: value.parentId - } - ).subscribe( - data=>{ - this.snackBar.open('禁用成功', '', { - duration: 3000 - }); - this.getlist() - }, - err=>{ - alert("操作无效") - } - ) - // } - } - - - } - - - //向上箭头 - updata = [] - up(node){ - var olddata = this.data; - this.updata = [] - olddata.forEach(item => { - if(item.id == node.parentId){ - this.updata = item.children - } - }); - this.updata.forEach((item,index)=>{ - if(item.name == node.name){ - this.http.put(//更改点击的节点为上一节点的order - `/api/Organizations/${this.updata[index].id}`, - { - id:this.updata[index].id, - code:"", - name: this.updata[index].name, - level: this.updata[index].level, - order: this.updata[index - 1].order, - location: null, - enabled: true, - parentId: this.updata[index].parentId, - } - ).subscribe( - data=>{ - this.getlist() - }, - err=>{ - alert("请填写正确格式") - } - ) - - this.http.put(//更改上一节点为点击节点的order - `/api/Organizations/${this.updata[index - 1].id}`, - { - id:this.updata[index - 1].id, - code:"", - name: this.updata[index - 1].name, - level: this.updata[index - 1].level, - order: this.updata[index].order, - location: null, - enabled: true, - parentId: this.updata[index].parentId, - } - ).subscribe( - data=>{ - this.getlist() - }, - err=>{ - alert("错误") - } - ) - } - - - - }) - - } - //向下箭头 - downdata = [] - down(node){ - var olddata = this.data; - this.downdata = [] - olddata.forEach(item => { - if(item.id == node.parentId){ - this.downdata = item.children - } - }); - this.downdata.forEach((item,index)=>{ - if(item.name == node.name){ - this.http.put(//更改点击的节点为下一节点的order - `/api/Organizations/${this.downdata[index].id}`, - { - id:this.downdata[index].id, - code:"", - name: this.downdata[index].name, - level: this.downdata[index].level, - order: this.downdata[index + 1].order, - location: null, - enabled: true, - parentId: this.downdata[index].parentId, - } - ).subscribe( - data=>{ - this.getlist() - }, - err=>{ - alert("请填写正确格式") - } - ) - - this.http.put(//更改上一节点为点击节点的order - `/api/Organizations/${this.downdata[index + 1].id}`, - { - id:this.downdata[index + 1].id, - code:"", - name: this.downdata[index + 1].name, - level: this.downdata[index + 1].level, - order: this.downdata[index].order, - location: null, - enabled: true, - parentId: this.downdata[index].parentId, - } - ).subscribe( - data=>{ - this.getlist() - }, - err=>{ - alert("错误") - } - ) - } - - - - }) - } -} - - - - - -//创建组织 -@Component({ - selector: 'createorganization', - templateUrl: './createorganization.component.html', - styleUrls: ['./organization.component.scss'] -}) -export class CreateOrganization { - myControl = new FormControl(); - ishttp: boolean =false - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - if(this.data.childlength){//如果点击节点存在children - this.http.post( - '/api/Organizations', - { - id:"", - code:value.number, - name: value.name, - level:this.data.level + 1, - order: this.data.childlength[this.data.childlength.length -1].order + 1, - location: null, - enabled: true, - parentId: this.data.id, - } - ).subscribe( - data=>{ - this.dialogRef.close(data); - alert("创建组织成功") - }, - err=>{ - alert("请填写正确格式") - } - ) - }else{ - this.http.post( - '/api/Organizations', - { - id:"", - code:"", - name: value.name, - level:this.data.level + 1, - order:0, - location: null, - enabled: true, - parentId: this.data.id, - } - ).subscribe( - data=>{ - this.dialogRef.close(data); - alert("创建组织成功") - }, - err=>{ - alert("请填写正确格式") - } - ) - } - - } -} - -//编辑组件 -@Component({ - selector: 'editorganization', - templateUrl: './editorganization.component.html', - styleUrls: ['./organization.component.scss'] -}) -export class EditOrganization { - newdata = []; - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - children:node.children - }; - } - treeControl = new FlatTreeControl(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); - myControl = new FormControl(); - - organizationName:any =''//上级组织的名字 - organizationId:any =''//上级组织的id - organizationLevel:number =null//上级组织的层级 - organizationchildlength:number = null - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private tree:TreeService) {} - //获取所有组织机构 - getMechanism () { - this.http.get('/api/Organizations').subscribe( - (data:any)=>{ - this.dataSource.data = this.tree.toTree(data); - } - ) - } - - ngOnInit() { - this.getMechanism() - } - hasChild = (_: number, node: any) => node.expandable; - onNoClick(): void { - this.dialogRef.close(); - } - add(e){ - this.organizationName=e.name - this.organizationId=e.id - this.organizationLevel=e.level - if(e.children){//如果点击的父组织有子节点 - this.organizationchildlength = e.children.length - }else{ - this.organizationchildlength = 0 - } - } - onSubmit(value){ - if(this.organizationLevel){//如果点击了右边的树 - this.http.put( - `/api/Organizations/${this.data.id}`, - { - id:this.data.id, - code:value.number, - name: value.name, - level:this.organizationLevel + 1, - order: this.organizationchildlength, - location: null, - enabled: true, - parentId: this.organizationId, - } - ).subscribe( - data=>{ - this.dialogRef.close(); - alert("修改成功") - }, - err=>{ - alert("请填写正确格式") - } - ) - }else{ //如果只改了姓名 - this.http.put( - `/api/Organizations/${this.data.id}`, - { - id:this.data.id, - code:"", - name: value.name, - level:this.data.level, - order: this.data.order, - location: null, - enabled: true, - parentId: this.data.parentId, - } - ).subscribe( - data=>{ - this.dialogRef.close(); - alert("修改成功") - }, - err=>{ - alert("请填写正确格式") - } - ) - } - - } -} \ No newline at end of file diff --git a/src/app/ui/paginator/my-paginator.ts b/src/app/ui/paginator/my-paginator.ts deleted file mode 100644 index 9d5ecbb..0000000 --- a/src/app/ui/paginator/my-paginator.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { MatPaginatorIntl } from '@angular/material/paginator'; - - -const dutchRangeLabel = (page: number, pageSize: number, length: number) => { - if (length === 0 || pageSize === 0) { return `0 到 ${length}`; } - length = Math.max(length, 0); - const startIndex = page * pageSize; - const endIndex = startIndex < length ? - Math.min(startIndex + pageSize, length) : - startIndex + pageSize; - return `${startIndex + 1} - ${endIndex} / ${length}条`; - -} - -export function myPaginator() { - - const paginatorIntl = new MatPaginatorIntl(); - - paginatorIntl.itemsPerPageLabel = '每页条数:'; - - paginatorIntl.nextPageLabel = '下一页:'; - - paginatorIntl.previousPageLabel = '上一页:'; - - paginatorIntl.getRangeLabel = dutchRangeLabel; - - return paginatorIntl; - -} diff --git a/src/app/ui/paginator/paginator.component.html b/src/app/ui/paginator/paginator.component.html deleted file mode 100644 index 4cc8c57..0000000 --- a/src/app/ui/paginator/paginator.component.html +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/src/app/ui/paginator/paginator.component.scss b/src/app/ui/paginator/paginator.component.scss deleted file mode 100644 index c67d923..0000000 --- a/src/app/ui/paginator/paginator.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -mat-paginator{ - margin-top: 50px; -} \ No newline at end of file diff --git a/src/app/ui/paginator/paginator.component.spec.ts b/src/app/ui/paginator/paginator.component.spec.ts deleted file mode 100644 index cabc63d..0000000 --- a/src/app/ui/paginator/paginator.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PaginatorComponent } from './paginator.component'; - -describe('PaginatorComponent', () => { - let component: PaginatorComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PaginatorComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PaginatorComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/paginator/paginator.component.ts b/src/app/ui/paginator/paginator.component.ts deleted file mode 100644 index f05051e..0000000 --- a/src/app/ui/paginator/paginator.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-paginator', - templateUrl: './paginator.component.html', - styleUrls: ['./paginator.component.scss'] -}) -export class PaginatorComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/ui/paginator/paginator.module.ts b/src/app/ui/paginator/paginator.module.ts deleted file mode 100644 index 44f1352..0000000 --- a/src/app/ui/paginator/paginator.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { PaginatorComponent } from './paginator.component'; -import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator'; -import { myPaginator } from './my-paginator' -import { UiModule } from '../ui.module'; - - -@NgModule({ - declarations: [PaginatorComponent], - imports: [ - CommonModule, - MatPaginatorModule - ], - providers: [ { provide: MatPaginatorIntl, useValue: myPaginator() } ] -}) -export class PaginatorModule { } diff --git a/src/app/ui/plan/plan.component.html b/src/app/ui/plan/plan.component.html index 00adef4..5206fc9 100644 --- a/src/app/ui/plan/plan.component.html +++ b/src/app/ui/plan/plan.component.html @@ -1,2 +1 @@ - diff --git a/src/app/ui/progress/progress.component.html b/src/app/ui/progress/progress.component.html deleted file mode 100644 index a858bc9..0000000 --- a/src/app/ui/progress/progress.component.html +++ /dev/null @@ -1,13 +0,0 @@ - -
    -

    确定进度条

    - -
    -

    不确定进度条

    - -
    -

    缓冲进度条

    - -
    -

    查询进度条

    - diff --git a/src/app/ui/progress/progress.component.scss b/src/app/ui/progress/progress.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/ui/progress/progress.component.spec.ts b/src/app/ui/progress/progress.component.spec.ts deleted file mode 100644 index aea0b97..0000000 --- a/src/app/ui/progress/progress.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ProgressComponent } from './progress.component'; - -describe('ProgressComponent', () => { - let component: ProgressComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ProgressComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ProgressComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/progress/progress.component.ts b/src/app/ui/progress/progress.component.ts deleted file mode 100644 index 93168b5..0000000 --- a/src/app/ui/progress/progress.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-progress', - templateUrl: './progress.component.html', - styleUrls: ['./progress.component.scss'] -}) -export class ProgressComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/ui/role/createrole.component.html b/src/app/ui/role/createrole.component.html deleted file mode 100644 index 4738ce2..0000000 --- a/src/app/ui/role/createrole.component.html +++ /dev/null @@ -1,54 +0,0 @@ -
    - - 创建新角色 - - - - 分配权限 -
    - - -
    - 关联数据权限 - 全选 - - - - - {{node.name}} - - - - - {{node.name}} - - -
    -
    - 关联导航菜单 - 全选 - - - - - {{node.name}} - - - - - {{node.name}} - - -
    -
    - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/role/editrole.component.html b/src/app/ui/role/editrole.component.html deleted file mode 100644 index c1814fc..0000000 --- a/src/app/ui/role/editrole.component.html +++ /dev/null @@ -1,21 +0,0 @@ -
    - 编辑角色 - - - - - - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/role/role.component.html b/src/app/ui/role/role.component.html deleted file mode 100644 index c76e714..0000000 --- a/src/app/ui/role/role.component.html +++ /dev/null @@ -1,42 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    角色名称 {{roledata.name}} 创建/修改时间 {{roledata.creationTime | time }} 是否启用 {{roledata.enabled | isno}} 操作 - - - - - - - -
    - - -
    - \ No newline at end of file diff --git a/src/app/ui/role/role.component.scss b/src/app/ui/role/role.component.scss deleted file mode 100644 index d5b7c76..0000000 --- a/src/app/ui/role/role.component.scss +++ /dev/null @@ -1,49 +0,0 @@ -table { - width: 100%; - th,td{ - text-align: center; - } - button{ - margin: 0 3px; - } - -} -form{ - // text-align: center; - - button{ - - margin: 0 8px; - margin-bottom: 30px; - } - .mat-checkbox{ - display: block; - text-align: left; - } - .btn{ - padding-top: 18px; - text-align: center; - } - mat-form-field{ - margin-right:80px; - } - span{ - display: block; - margin-bottom: 10px; - } -} -.shareform{ - height: 300px; -} -.leftbox{ - width: 250px; - float: left; -} -.rightbox{ - width: 250px; - float: right; -} -.bigbox{ - height: 400px; - overflow: auto; -} \ No newline at end of file diff --git a/src/app/ui/role/role.component.ts b/src/app/ui/role/role.component.ts deleted file mode 100644 index eecde73..0000000 --- a/src/app/ui/role/role.component.ts +++ /dev/null @@ -1,693 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { CacheTokenService } from '../../http-interceptors/cache-token.service' -import format from 'date-fns/format'; -import {CdkDragDrop, moveItemInArray} from '@angular/cdk/drag-drop'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { TreeService } from '../../http-interceptors/tree.service' -export interface roledata { - id: string, - name: string,//名称 - order: number, - enabled: boolean, - creationTime: string -} -@Component({ - selector: 'app-role', - templateUrl: './role.component.html', - styleUrls: ['./role.component.scss'] -}) - -export class RoleComponent implements OnInit { - constructor(private http: HttpClient,public dialog: MatDialog,public createtime:CacheTokenService,private tree:TreeService) { } - displayedColumns: string[] = ['name','createtiome', 'edit']; - dataSource: any - - public compare(property){ - return function(a,b){ - var value1 = a[property]; - var value2 = b[property]; - return value1 - value2; - } - } - //获取角色列表并且给排头和排尾赋是否为首尾 - getlist(){ - this.http.get('/api/Roles').subscribe( (data:Array)=>{ - this.dataSource = data - this.dataSource[0].isTop = true; - this.dataSource[this.dataSource.length-1].isBottom = true - }) - } - //初始化视图 - ngOnInit() { - this.getlist() - } - //向上按钮 - up(node){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.put(//把上一节点order换成点击的节点 - `/api/Roles/${this.dataSource[node.order -1].id}`, - { - id:this.dataSource[node.order -1].id, - name: this.dataSource[node.order -1].name, - order: node.order, - enabled: true, - creationTime:time, - } - ).subscribe(data=>{ - this.getlist() - }) - - this.http.put(//把当前节点order换成上一点击的节点 - `/api/Roles/${node.id}`, - { - id:node.id, - name: node.name, - order: node.order-1, - enabled: true, - creationTime:time, - } - ).subscribe(data=>{ - this.getlist() - }) - - } - //向下按钮 - down(node){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.put(//把下一节点order换成点击的节点 - `/api/Roles/${this.dataSource[node.order + 1].id}`, - { - id:this.dataSource[node.order + 1].id, - name: this.dataSource[node.order + 1].name, - order: node.order, - enabled: true, - creationTime:time, - } - ).subscribe(data=>{ - this.getlist() - }) - - this.http.put(//把当前节点order换成下一点击的节点 - `/api/Roles/${node.id}`, - { - id:node.id, - name: node.name, - order: node.order + 1, - enabled: true, - creationTime:time, - } - ).subscribe(data=>{ - this.getlist() - }) - } - //创建按钮并且弹出对话框 - createuser(){ - const dialogRef = this.dialog.open(CreateRole, {//调用open方法打开对话框并且携带参数过去 - width: '600px', - height:'658px', - data: {name: this.createuser.name,data: this.dataSource,length:this.dataSource.length} - }); - dialogRef.afterClosed().subscribe( - data=>{ - this.getlist() - } - ); - } - //编辑 - // edituser(roledata){ - // const dialogRef = this.dialog.open(EditRole, {//调用open方法打开对话框并且携带参数过去 - // width: '260px', - // data: {id:roledata.id} - // }); - // dialogRef.afterClosed().subscribe( - // data=>{ - // this.dataSource.push(data) - // this.http.get('/api/Roles').subscribe( (data:Array)=>{ - // var orderdate = data.sort(this.compare('order')); - // this.dataSource = orderdate - // }) - // } - // ); - // } - - - //删除按钮 - deleteduser(roledata){ - var isdeleted = confirm("确定要删除此用户吗?") - if(isdeleted){ - //请求删除接口 - this.http.delete(`/api/Roles/${roledata.id}`).subscribe( data=>{ - this.getlist() - }) - } - } - //分配权限--------变成-------->编辑按钮 - allot(roledata){ - const dialogRef = this.dialog.open(SharePower, {//调用open方法打开对话框并且携带参数过去 - width: '600px', - height:'658px', - data: {id:roledata.id,name:roledata.name,order:roledata.order}//把点击的id传过去 - }); - - dialogRef.afterClosed().subscribe( - data=>{ - this.getlist() - } - ); - } - - //启用或禁用按钮 - open(roledata){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.put( - `/api/Roles/${roledata['id']}`, - { - id:roledata['id'], - name: roledata.name, - order: roledata.order, - enabled: !roledata.enabled, - creationTime: time, - } - ).subscribe( - data=>{ - this.getlist() - } - ) - } - - drop(event: CdkDragDrop) {//拖拽函数 - moveItemInArray(this.dataSource, event.previousIndex, event.currentIndex); - this.dataSource.forEach((item, index) => { - item.order = index; - }) - const a = [...this.dataSource]; - this.dataSource = []; - setTimeout(() => { - this.dataSource = a; - }, 10); - }; -} - - - - - - -//创建角色组件 -@Component({ - selector: 'createrole', - templateUrl: './createrole.component.html', - styleUrls: ['./role.component.scss'] -}) -export class CreateRole { - private _transformer = (node: any, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id:node.id - }; - } - treeControl = new FlatTreeControl( - 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); - dataSource2 = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); - myControl = new FormControl(); - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private tree:TreeService) {} - olddata =[] - olddata2 = [] - xxx = {} - jjj = {} - //用于存放选中的数组 - checkedMap = {} - //初始化两棵tree - ngOnInit(){ - this.http.get('/api/Permissions').subscribe((data: any[])=>{ - this.olddata =data - this.dataSource.data = this.tree.toTree(data); - this.treeControl.expandAll() - this.dataSource.data.forEach(item=>{ - if(item.children){ - var childarr = [] - item.children.forEach(n => { - childarr.push(n.id) - }) - this.xxx[item.id] = childarr - } - }) - - }) - this.http.get('/api/NavMenus').subscribe((data: any[])=>{ - this.olddata2 =data - this.dataSource2.data = this.tree.toTree(data); - this.treeControl.expandAll() - this.dataSource2.data.forEach(item=>{ - if(item.children){ - var childarr = [] - item.children.forEach(n => { - childarr.push(n.id) - }) - this.jjj[item.id] = childarr - } - }) - }) - - } - //选中后子节点默认选中 - selectedAll(event, node){ - this.olddata.forEach(item=>{ - if(item.parentId == node.id){ - this.checkedMap[item.id] = event.checked; - } - }) - this.olddata2.forEach(item=>{ - if(item.parentId == node.id){ - this.checkedMap[item.id] = event.checked; - } - }) - } - //数据权限tree的全选功能 - leftTreeAll(event,form){ - const values = form.value; - for (let key in values) { - if(key.indexOf("second")){ - this.checkedMap[key.split('.')[1]] = event.checked; - } - } - } - //菜单权限tree的全选功能 - rightTreeAll(event,form){ - const values = form.value; - for (let key in values) { - if(key.indexOf("first")){ - this.checkedMap[key.split('.')[1]] = event.checked; - } - } - } - hasChild = (_: number, node: any) => node.expandable; - - onNoClick(): void { - this.dialogRef.close(); - } - //提交 - onSubmit(value){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.post( - '/api/Roles', - { - id:"", - name: value.name, - order: this.data.data[this.data.data.length - 1].order + 1, - enabled: true, - creationTime: time, - } - ).subscribe( - data=>{ - var id = data['id'] - var keydata = [] - var keydata2 = [] - for(let i in value){ - if(value[i]){ - if(i.indexOf("first") && i!="name"){ - keydata.push(i.split('.')[1]) - } - if(i.indexOf("second") && i!="name"){ - keydata2.push(i.split('.')[1]) - } - } - } - //如果父节点选中过滤子节点不提交 - keydata2.forEach(item=>{ - for(let i in this.xxx){ - if(item == i){ - this.xxx[i].forEach(i => { - keydata2.forEach(o=>{ - if(o == i){ - var index = keydata2.indexOf(i) - keydata2.splice(index,1) - } - }) - }); - } - } - }) - keydata.forEach(item=>{ - for(let i in this.jjj){ - if(item == i){ - this.jjj[i].forEach(i => { - keydata.forEach(o=>{ - if(o == i){ - var index = keydata.indexOf(i) - keydata.splice(index,1) - } - }) - }); - } - } - }) - - this.http.post( - `/api/Roles/${id}/Permissions`, - keydata2 - ).subscribe( - data=>{ - this.http.post( - `/api/Roles/${id}/NavMenus`, - keydata - ).subscribe( - data=>{ - this.dialogRef.close(); - alert('创建成功') - }, - err=>{ - this.dialogRef.close(); - alert('创建失败2') - } - ) - }, - err=>{ - this.dialogRef.close(); - alert('创建失败1') - } - ) - - }, - err=>{ - alert("角色名称不符合规范") - } - ) - } -} - - -//编辑角色组件---------->废弃 -@Component({ - selector: 'editrole', - templateUrl: './editrole.component.html', - styleUrls: ['./role.component.scss'] -}) -export class EditRole { - myControl = new FormControl(); - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - info = {} - ngOnInit(){ - } - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.put( - `/api/Roles/${this.data['id']}`, - { - id:this.data['id'], - name: value.name, - order: value.order, - enabled: true, - creationTime:time, - } - ).subscribe( - data=>{ - this.dialogRef.close(); - }, - err=>{ - alert("请填写正确格式") - } - ) - - } -} - - - -//分配权限组件---------->编辑组件 -@Component({ - selector: 'sharepower', - templateUrl: './sharepower.component.html', - styleUrls: ['./role.component.scss'] -}) -export class SharePower { - private _transformer = (node: any, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id:node.id, - children:node.children - }; - } - treeControl = new FlatTreeControl( - 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); - dataSource2 = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); - - myControl = new FormControl(); - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private tree:TreeService) {} - olddata =[] - olddata2 =[] - newdata = [] - newdata2 = [] - placeholdername = this.data.name - xxx1 = {}//存放有children的 父id:子id1 子id2 子id3 - jjj = {} - checkedMap = {} - ngOnInit(){ - this.http.get(`/api/Roles/${this.data.id}/Permissions`).subscribe((data: any[])=>{ - this.olddata =data - - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - if(item.checked){ - this.checkedMap[item.id] = item.checked; - } - var parentNode = getparentNode(item.parentId); - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata.push(item) - } - } - }); - data.forEach(item=>{ - //父节点如果被选中子节点则默认选中 - if(item.checked && item.children){ - item.children.forEach(n => { - this.checkedMap[n.id] = true; - }); - } - }) - this.dataSource.data = this.newdata; - this.treeControl.expandAll() - - this.dataSource.data.forEach(item=>{ - if(item.children){ - var childarr = [] - item.children.forEach(n => { - childarr.push(n.id) - }) - this.xxx1[item.id] = childarr - } - }) - }) - - - this.http.get(`/api/Roles/${this.data.id}/NavMenus`).subscribe((data: any[])=>{ - this.olddata2 =data - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - if(item.checked){ - this.checkedMap[item.id] = item.checked; - } - - var parentNode = getparentNode(item.parentId); - - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata2.push(item) - } - } - }); - - data.forEach(item=>{ - //父节点选中子节点默认选中 - if(item.checked && item.children){ - item.children.forEach(n => { - this.checkedMap[n.id] = true; - }); - } - }) - this.dataSource2.data = this.newdata2; - this.treeControl.expandAll() - - this.dataSource2.data.forEach(item=>{ - if(item.children){ - var childarr = [] - item.children.forEach(n => { - childarr.push(n.id) - }) - this.jjj[item.id] = childarr - } - }) - }) - } - - selectedAll(event, node){ - this.olddata.forEach(item=>{ - if(item.parentId == node.id){ - this.checkedMap[item.id] = event.checked; - } - }) - this.olddata2.forEach(item=>{ - if(item.parentId == node.id){ - this.checkedMap[item.id] = event.checked; - } - }) - } - - - // xxx(event,form){ - // const values = form.value; - // for (let key in values) { - // this.checkedMap[key] = event.checked; - // } - // } - - hasChild = (_: number, node: any) => node.expandable; - onNoClick(): void { - this.dialogRef.close(); - } - - - onSubmit(value){ - let newdate = new Date(); - let time = format(newdate, 'yyyy-MM-dd') - this.http.put( - `/api/Roles/${this.data['id']}`, - { - id:this.data['id'], - name: value.name, - order: this.data.order, - enabled: true, - creationTime:time, - } - ).subscribe( - data=>{ - var keydata = [] - var keydata2 = [] - for(let i in value){ - if(value[i]){ - if(i.indexOf("first") && i!="name" && i!="order"){ - keydata.push(i.split('.')[1]) - } - if(i.indexOf("second") && i!="name" && i!="order"){ - keydata2.push(i.split('.')[1]) - } - } - } - keydata2.forEach(item=>{ - for(let i in this.xxx1){ - if(item == i){ - this.xxx1[i].forEach(i => { - keydata2.forEach(o=>{ - if(o == i){ - var index = keydata2.indexOf(i) - keydata2.splice(index,1) - } - }) - }); - } - } - }) - - keydata.forEach(item=>{ - for(let i in this.jjj){ - if(item == i){ - this.jjj[i].forEach(i => { - keydata.forEach(o=>{ - if(o == i){ - var index = keydata.indexOf(i) - keydata.splice(index,1) - } - }) - }); - } - } - }) - this.http.post( - `/api/Roles/${this.data.id}/Permissions`, - keydata2 - ).subscribe( - data=>{ - this.http.post( - `/api/Roles/${this.data.id}/NavMenus`, - keydata - ).subscribe( - data=>{ - this.dialogRef.close(); - alert('编辑成功') - }, - err=>{ - this.dialogRef.close(); - alert('分配权限失败2') - } - ) - }, - err=>{ - this.dialogRef.close(); - alert('分配权限失败1') - } - ) - - - }, - err=>{ - alert("名称格式不正确") - } - ) - - - - } -} - - diff --git a/src/app/ui/role/sharepower.component.html b/src/app/ui/role/sharepower.component.html deleted file mode 100644 index 0471799..0000000 --- a/src/app/ui/role/sharepower.component.html +++ /dev/null @@ -1,57 +0,0 @@ -
    - - 编辑角色 - - - - - - 分配权限 - -
    -
    - 关联数据权限 - - - - - {{node.name}} - - - - - - {{node.name}} - - -
    - - -
    - 关联导航菜单 - - - - - {{node.name}} - - - - - - {{node.name}} - - -
    -
    - - - -
    - - -
    - -
    diff --git a/src/app/ui/snackbar/snackbar.component.html b/src/app/ui/snackbar/snackbar.component.html deleted file mode 100644 index 49dfc20..0000000 --- a/src/app/ui/snackbar/snackbar.component.html +++ /dev/null @@ -1,10 +0,0 @@ -

    底部提示消息

    - - - - - - - - - diff --git a/src/app/ui/snackbar/snackbar.component.scss b/src/app/ui/snackbar/snackbar.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/ui/snackbar/snackbar.component.spec.ts b/src/app/ui/snackbar/snackbar.component.spec.ts deleted file mode 100644 index 664d327..0000000 --- a/src/app/ui/snackbar/snackbar.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SnackbarComponent } from './snackbar.component'; - -describe('SnackbarComponent', () => { - let component: SnackbarComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ SnackbarComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(SnackbarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/snackbar/snackbar.component.ts b/src/app/ui/snackbar/snackbar.component.ts deleted file mode 100644 index 1fcdc8c..0000000 --- a/src/app/ui/snackbar/snackbar.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import {MatSnackBar} from '@angular/material/snack-bar'; -@Component({ - selector: 'app-snackbar', - templateUrl: './snackbar.component.html', - styleUrls: ['./snackbar.component.scss'] -}) -export class SnackbarComponent implements OnInit { - - constructor(private _snackBar: MatSnackBar) { } - - ngOnInit() { - } - openSnackBar(message: string, action: string) { - this._snackBar.open(message, action, { - duration: 2000, - }); - } -} diff --git a/src/app/ui/stepper/stepper.component.html b/src/app/ui/stepper/stepper.component.html deleted file mode 100644 index c999bd3..0000000 --- a/src/app/ui/stepper/stepper.component.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - -
    - 填写姓名 - - - - - -
    - - -
    -
    -
    - - - -
    - 家庭住址 - - - -
    - - - -
    -
    -
    - - - 完成 - 你已经完成了 -
    - - -
    -
    -
    - - diff --git a/src/app/ui/stepper/stepper.component.scss b/src/app/ui/stepper/stepper.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/ui/stepper/stepper.component.spec.ts b/src/app/ui/stepper/stepper.component.spec.ts deleted file mode 100644 index 4bf2213..0000000 --- a/src/app/ui/stepper/stepper.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { StepperComponent } from './stepper.component'; - -describe('StepperComponent', () => { - let component: StepperComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ StepperComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(StepperComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/stepper/stepper.component.ts b/src/app/ui/stepper/stepper.component.ts deleted file mode 100644 index 943805a..0000000 --- a/src/app/ui/stepper/stepper.component.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; -@Component({ - selector: 'app-stepper', - templateUrl: './stepper.component.html', - styleUrls: ['./stepper.component.scss'] -}) -export class StepperComponent implements OnInit { - isLinear = false; - firstFormGroup: FormGroup; - secondFormGroup: FormGroup; - constructor(private _formBuilder: FormBuilder) { } - - ngOnInit() { - this.firstFormGroup = this._formBuilder.group({ - firstCtrl: ['', Validators.required] - }); - this.secondFormGroup = this._formBuilder.group({ - secondCtrl: ['', Validators.required] - }); - } - -} diff --git a/src/app/ui/tabgroup/tabgroup.component.html b/src/app/ui/tabgroup/tabgroup.component.html deleted file mode 100644 index 8df2739..0000000 --- a/src/app/ui/tabgroup/tabgroup.component.html +++ /dev/null @@ -1,22 +0,0 @@ - - 我是内容一 - 我是内容二 - 我是内容三 - - - - - - - - 一 三 - -

    四五六

    -
    - - - thumb_down 失败者 - -

    rush B!!!

    -
    -
    diff --git a/src/app/ui/tabgroup/tabgroup.component.scss b/src/app/ui/tabgroup/tabgroup.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/ui/tabgroup/tabgroup.component.spec.ts b/src/app/ui/tabgroup/tabgroup.component.spec.ts deleted file mode 100644 index 7e9fe94..0000000 --- a/src/app/ui/tabgroup/tabgroup.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TabgroupComponent } from './tabgroup.component'; - -describe('TabgroupComponent', () => { - let component: TabgroupComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TabgroupComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TabgroupComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/tabgroup/tabgroup.component.ts b/src/app/ui/tabgroup/tabgroup.component.ts deleted file mode 100644 index 5bd6398..0000000 --- a/src/app/ui/tabgroup/tabgroup.component.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-tabgroup', - templateUrl: './tabgroup.component.html', - styleUrls: ['./tabgroup.component.scss'] -}) -export class TabgroupComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - - xxx(){ - } -} diff --git a/src/app/ui/ui-routing.module.ts b/src/app/ui/ui-routing.module.ts index f1a06bb..f4689ee 100644 --- a/src/app/ui/ui-routing.module.ts +++ b/src/app/ui/ui-routing.module.ts @@ -12,7 +12,6 @@ import { UploadingCADComponent } from './uploading-cad/uploading-cad.component'; import {CollectionToolsComponent} from './collection-tools/collection-tools.component' const routes: Routes = [ - { path: '', component:UserdataComponent }, { path: 'userdata', component:UserdataComponent }, { path: 'basicinfo', component:BasicinfoComponent }, { path: 'plan', component:PlanComponent }, diff --git a/src/app/ui/ui.component.html b/src/app/ui/ui.component.html deleted file mode 100644 index 81f1dc8..0000000 --- a/src/app/ui/ui.component.html +++ /dev/null @@ -1 +0,0 @@ -

    ui works!

    diff --git a/src/app/ui/ui.component.scss b/src/app/ui/ui.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/ui/ui.component.spec.ts b/src/app/ui/ui.component.spec.ts deleted file mode 100644 index 6364771..0000000 --- a/src/app/ui/ui.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { UiComponent } from './ui.component'; - -describe('UiComponent', () => { - let component: UiComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ UiComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(UiComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/ui/ui.component.ts b/src/app/ui/ui.component.ts deleted file mode 100644 index aa89818..0000000 --- a/src/app/ui/ui.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-ui', - templateUrl: './ui.component.html', - styleUrls: ['./ui.component.scss'] -}) -export class UiComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index 47ec05b..91fa05a 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -1,6 +1,5 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { UiComponent } from './ui.component'; import { UiRoutingModule } from './ui-routing.module'; import {A11yModule} from '@angular/cdk/a11y'; import {DragDropModule} from '@angular/cdk/drag-drop'; @@ -43,43 +42,13 @@ import {MatTabsModule} from '@angular/material/tabs'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatTooltipModule} from '@angular/material/tooltip'; import {MatTreeModule} from '@angular/material/tree'; -import { CardComponent } from './card/card.component'; -import { StepperComponent } from './stepper/stepper.component'; import { ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { TabgroupComponent } from './tabgroup/tabgroup.component'; -import { ProgressComponent } from './progress/progress.component'; -import { SnackbarComponent } from './snackbar/snackbar.component'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatPaginatorIntl } from '@angular/material/paginator'; -import { PaginatorModule } from './paginator/paginator.module'; -import { PersonaldataComponent } from '../pages/personaldata/personaldata.component'; import { UserdataComponent, EditUser } from './userdata/userdata.component'; import { ChangepasswordComponent } from './changepassword/changepassword.component'; -import { OrganizationComponent, CreateOrganization, EditOrganization } from './organization/organization.component'; -import { UnittypeComponent, DialogOverviewExampleDialog, editorialUnit } from './unittype/unittype.component'; -import { AuthorityComponent, CreateAuthority } from './authority/authority.component'; -import { RoleComponent, CreateRole, EditRole, SharePower } from './role/role.component'; -import { UsermanagementComponent, CreateNewUser, EditNewUser, allRoles, seeInformation } from './usermanagement/usermanagement.component'; - import { IsnoPipe } from '../pipes/boolean.pipe'; import {ConfirmpswDirective} from './changepassword/equal-validator.directive'; import { TimePipe } from '../pipes/time.pipe'; -import { NavmenusComponent, CreateMenus, EditMenus } from './navmenus/navmenus.component'; -import { FireProtectionElementsComponent, Establish, EditingFireControl } from './fire-protection-elements/fire-protection-elements.component'; -import { FireFightingTemplateComponent, NewFireFighting, EditFireClassification } from './fire-fighting-template/fire-fighting-template.component'; -import { MaterialBankComponent, attributeComponent, addAttributeComponent, editAttribute } from './material-bank/material-bank.component'; -import { UnitInformationComponent } from './unit-information/unit-information.component'; -import { AddMatLibrary } from './material-bank/addmatlibrary.component'; -import { EditMatLibrary } from './material-bank/editmatlibrary.component'; -import { AddOriginalCopy } from './material-bank/addoriginalcopy.component'; - import { FileUploadModule } from 'ng2-file-upload'; -import { EditOriginalCopy } from './material-bank/editoriginalcopy.component'; -import { SelectOriginalCopy } from './material-bank/selectoriginalcopy.component'; -import { EditUnitInfo } from './unit-information/editunitinfo.component'; -import { AddUnitInfo } from './unit-information/addunitinfo.component'; -import { AddGroups } from './unit-information/addgroups.component'; -import { EditGroup } from './unit-information/editgroup.component'; import { BasicinfoComponent } from './basicinfo/basicinfo.component'; import { PlanComponent } from './plan/plan.component'; import { AllaroundComponent } from './allaround/allaround.component'; @@ -100,7 +69,7 @@ import { WorkingAreaComponent } from '../working-area/working-area.component'; import {leftFunctionalDomainComponent,editPlaneFigureComponent} from './collection-tools/leftFunctionalDomain' @NgModule({ - declarations: [UiComponent, CardComponent, StepperComponent, TabgroupComponent, ProgressComponent, SnackbarComponent, PersonaldataComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent, IsnoPipe, ConfirmpswDirective, DialogOverviewExampleDialog, CreateAuthority, CreateRole, EditRole, TimePipe, CreateNewUser, EditNewUser, allRoles, SharePower, CreateOrganization, EditOrganization, seeInformation, EditUser, editorialUnit, FireProtectionElementsComponent, Establish, EditingFireControl, FireFightingTemplateComponent, NavmenusComponent, CreateMenus, EditMenus, NewFireFighting, EditFireClassification, MaterialBankComponent, UnitInformationComponent, AddMatLibrary, EditMatLibrary, attributeComponent, AddOriginalCopy, addAttributeComponent, editAttribute, EditOriginalCopy, SelectOriginalCopy, EditUnitInfo, AddUnitInfo, AddGroups, EditGroup, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent, AddHouseInfo, ImgDetails, ImagesData, ImgsDataDetail, KeySiteImgs, KeyImgDetail, addPartition, addPartitionAttribute, previewImg, addRealPicture, editRealPicture, readFile, editFile, LookMaster, previewBigImg, CollectionToolsComponent, WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails + declarations: [UserdataComponent, ChangepasswordComponent, IsnoPipe, ConfirmpswDirective, TimePipe, EditUser, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent, AddHouseInfo, ImgDetails, ImagesData, ImgsDataDetail, KeySiteImgs, KeyImgDetail, addPartition, addPartitionAttribute, previewImg, addRealPicture, editRealPicture, readFile, editFile, LookMaster, previewBigImg, CollectionToolsComponent, WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails ], imports: [ @@ -148,10 +117,8 @@ import {leftFunctionalDomainComponent,editPlaneFigureComponent} from './collecti MatTreeModule, PortalModule, ScrollingModule, - ReactiveFormsModule, FormsModule, - PaginatorModule, FileUploadModule ] diff --git a/src/app/ui/unit-information/addgroups.component.html b/src/app/ui/unit-information/addgroups.component.html deleted file mode 100644 index 392fd2a..0000000 --- a/src/app/ui/unit-information/addgroups.component.html +++ /dev/null @@ -1,15 +0,0 @@ -
    - 新增分组 - - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/unit-information/addgroups.component.ts b/src/app/ui/unit-information/addgroups.component.ts deleted file mode 100644 index 85e2458..0000000 --- a/src/app/ui/unit-information/addgroups.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -@Component({ - selector: 'addgroups', - templateUrl: './addgroups.component.html', - styleUrls: ['./unit-information.component.scss'] - }) - export class AddGroups { - myControl = new FormControl(); - templatestatus = "0"//创建模板时的默认状态 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - onNoClick(): void { - this.dialogRef.close(); - } - grouporder = null - onSubmit(value){ - if(this.data.allGrouping.length == 0){ - this.grouporder = 0 - }else{ - this.grouporder = this.data.allGrouping[this.data.allGrouping.length - 1].order + 1 - } - - this.http.post("/api/BasicGroups",{ - id: "", - name: value.groupname, - order: this.grouporder, - enabled: true, - propertyInfos: [ - ], - basicCategoryId: this.data.unitInformation.id - }).subscribe(data=>{ - this.dialogRef.close('ooo'); - }) - } - } \ No newline at end of file diff --git a/src/app/ui/unit-information/addunitinfo.component.html b/src/app/ui/unit-information/addunitinfo.component.html deleted file mode 100644 index 4ef9240..0000000 --- a/src/app/ui/unit-information/addunitinfo.component.html +++ /dev/null @@ -1,22 +0,0 @@ -
    - 新增单位信息 - - - - - - - 禁用 - 启用 - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/unit-information/addunitinfo.component.ts b/src/app/ui/unit-information/addunitinfo.component.ts deleted file mode 100644 index 60a0e2f..0000000 --- a/src/app/ui/unit-information/addunitinfo.component.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -@Component({ - selector: 'addunitinfo', - templateUrl: './addunitinfo.component.html', - styleUrls: ['./unit-information.component.scss'] - }) - export class AddUnitInfo { - myControl = new FormControl(); - templatestatus = "0"//创建模板时的默认状态 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - this.http.post("/api/BasicCategories",{ - id: "", - name: value.templatename, - enabled: Boolean(Number(value.enable)) , - }).subscribe(data=>{ - this.dialogRef.close('ooo'); - }) - } - } \ No newline at end of file diff --git a/src/app/ui/unit-information/editgroup.component.html b/src/app/ui/unit-information/editgroup.component.html deleted file mode 100644 index 15ff37c..0000000 --- a/src/app/ui/unit-information/editgroup.component.html +++ /dev/null @@ -1,15 +0,0 @@ -
    - 修改分组 - - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/unit-information/editgroup.component.ts b/src/app/ui/unit-information/editgroup.component.ts deleted file mode 100644 index 9976bac..0000000 --- a/src/app/ui/unit-information/editgroup.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -@Component({ - selector: 'editgroup', - templateUrl: './editgroup.component.html', - styleUrls: ['./unit-information.component.scss'] - }) - export class EditGroup { - myControl = new FormControl(); - groupname = this.data.item.name - templatestatus = "0"//创建模板时的默认状态 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - onNoClick(): void { - this.dialogRef.close(); - } - onSubmit(value){ - this.http.put(`/api/BasicGroups/${this.data.item.id}`,{ - id: this.data.item.id, - name: value.groupname, - order: this.data.item.order, - enabled: this.data.item.enabled, - propertyInfos:this.data.item.propertyInfos, - basicCategoryId: this.data.item.basicCategoryId - }).subscribe(data=>{ - this.dialogRef.close('ooo'); - }) - } - } \ No newline at end of file diff --git a/src/app/ui/unit-information/editunitinfo.component.html b/src/app/ui/unit-information/editunitinfo.component.html deleted file mode 100644 index 8fbc3a5..0000000 --- a/src/app/ui/unit-information/editunitinfo.component.html +++ /dev/null @@ -1,22 +0,0 @@ -
    - 修改单位信息 - - - - - - - 禁用 - 启用 - - - - -
    - - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/unit-information/editunitinfo.component.ts b/src/app/ui/unit-information/editunitinfo.component.ts deleted file mode 100644 index 8738e4f..0000000 --- a/src/app/ui/unit-information/editunitinfo.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; -import {FlatTreeControl} from '@angular/cdk/tree'; -import { HttpClient } from '@angular/common/http'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; -import {FormControl} from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; -@Component({ - selector: 'editunitinfo', - templateUrl: './editunitinfo.component.html', - styleUrls: ['./unit-information.component.scss'] - }) - export class EditUnitInfo { - templatenamedefault = this.data.unitInformation.name - myControl = new FormControl(); - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} - onNoClick(): void { - this.dialogRef.close(); - } - - onSubmit(value){ - this.http.put(`/api/BasicCategories/${this.data.unitInformation.id}`,{ - id: this.data.unitInformation.id, - name: value.templatename, - enabled: Boolean(Number(value.enable)), - }).subscribe(data=>{ - this.dialogRef.close('ooo'); - }) - } - } \ No newline at end of file diff --git a/src/app/ui/unit-information/unit-information.component.html b/src/app/ui/unit-information/unit-information.component.html deleted file mode 100644 index b796bd5..0000000 --- a/src/app/ui/unit-information/unit-information.component.html +++ /dev/null @@ -1,169 +0,0 @@ -
    -
    -
    - keyboard_arrow_down - chevron_right - 单位信息 -
    - - - - -
    -
    -
    -
    - {{item.name}} - block -
    -
    - -
    - -
    -
    -
    -

    {{unitInformation.name}}

    -
    - - - - -
    -
    - -
    -
    -
    - - {{item.name}} - border_color - - block - - - block - - delete -
    -
    - - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - add_to_photos - - - 名称 - {{element.propertyName}} - 类型 - - - - - - 默认值 - {{element.propertyValue}} - 必填 - - - 单位 - {{element.physicalUnit}} - 操作 - - border_color - - - visibility - - - visibility_off - - - block - - - block - - - delete - -
    -
    -
    - - - -
    -
    -
    diff --git a/src/app/ui/unit-information/unit-information.component.scss b/src/app/ui/unit-information/unit-information.component.scss deleted file mode 100644 index 633d195..0000000 --- a/src/app/ui/unit-information/unit-information.component.scss +++ /dev/null @@ -1,112 +0,0 @@ -.content { - margin: 0 0 0 10px; - width: 100%; - height: 100%; - display: flex; - .leftBox { - flex: 20%; - padding-top: 10px; - } - .rightBox { - border-left: 1px solid #999; - flex: 80%; - display: flex; - flex-direction: column; - .topBox { - flex:1; - .originalScript { - width: 100%; - background-color: #fafafa; - padding:10px 0; - padding-left: 20px; - font-weight: 500; - display: flex; - flex-direction: row; - p{ - margin-top: 11px; - } - .mat-icon { - vertical-align:middle; - } - } - } - } -} - - - -.bank { - display: flex; - font-size: 18px; - font-weight: 500; -} -.mat-icon { - width: 18px; - height: 18px; - vertical-align:top; - margin-right: 8px; - cursor:pointer; -} -.overFlowText { - width: 135px; - display: inline-block; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.material { - cursor:pointer; - height: 30px; - font-size: 16px; - margin-top: 10px; - padding-left: 25px; - .blockBtn { - float: right; - margin-right: 12px; - width: 16px; - height: 16px; - } -} - -.tableBox { - padding-top: 7px; -} -.attribute { - padding-left: 25px; - display: flex; - flex-direction: row; - background-color: #d7d7d7; - div { - margin-top: 10px; - margin-right: 25px; - } - .attributeLeft{ - flex: 75%; - } -} -.overFlow { - height: 250px; - overflow: auto; -} -table { - width: 100%; - text-align: center; - .cdk-header-cell { - text-align: center; - } -} - - - -.active { - background-color: rgba(225,225,225,0.8) -} -.btn{ - text-align: center; - button{ - margin: 0 8px; - } -} -.editunitformfield{ - width:230px -} \ No newline at end of file diff --git a/src/app/ui/unit-information/unit-information.component.ts b/src/app/ui/unit-information/unit-information.component.ts deleted file mode 100644 index 5752711..0000000 --- a/src/app/ui/unit-information/unit-information.component.ts +++ /dev/null @@ -1,419 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { AddUnitInfo } from './addunitinfo.component' -import { EditUnitInfo } from './editunitinfo.component' -import { AddGroups } from './addgroups.component' -import { EditGroup } from './editgroup.component' -import { HttpClient } from '@angular/common/http'; -import { MatDialog } from '@angular/material/dialog'; -import {addAttributeComponent,editAttribute} from '../material-bank/material-bank.component' - - - -@Component({ - selector: 'app-unit-information', - templateUrl: './unit-information.component.html', - styleUrls: ['./unit-information.component.scss'] -}) -export class UnitInformationComponent implements OnInit { - - constructor(private http:HttpClient,public dialog: MatDialog) { } - - ngOnInit(): void { - this.http.get('/api/BasicCategories').subscribe(data=>{ - this.allUnitInformation = data - this.unitInformation = data[0] - this.getAllGrouping()}) - } - - allUnitInformation:any; //所有单位 - unitInformation:any={name:''}; //选中的单位 - unitInformationIndex:any=0; //选中的单位index - - allGrouping:any; //单位信息模板对应所有分组 - groupingSelect:any=[]; //选中的分组 - groupingIndex:any=[]; //选中的分组index - attributeSelect:any=[]; //选中的分组属性 - attributeIndex:any=[]; //选中的分组属性所属分组index - - displayedColumns = ['checked', 'name', 'type', 'default','required','physicalUnit','operation']; - - isshow = true//左侧列表的显示隐藏 - //收起左侧列表 - showlist(){ - this.isshow = !this.isshow - } - //获取所有的单位信息模板 - getAllUnitInformation () { - this.http.get('/api/BasicCategories').subscribe(data=>{ - this.allUnitInformation = data - this.unitInformation = data[this.unitInformationIndex] - }) - } - - //单位信息模板对应所有分组 - getAllGrouping () { - let id = {categoryId:this.unitInformation.id} - this.http.get('/api/BasicGroups',{params:id}).subscribe(data=>{ - this.allGrouping = data - this.groupingSelect = [] - this.groupingIndex = [] - this.attributeSelect = [] - this.attributeIndex= [] - this.setIndex() - }) - } - - //选中单位 - add (e,index) { - if (this.unitInformationIndex != index) { - this.unitInformation = e - this.unitInformationIndex = index - this.getAllGrouping() - } - } - - //选中当前分组checked - groupingChange (e,index,event) { - if (event.checked === true) { - this.groupingSelect.push(e) - this.groupingIndex.push(index) - } else { - this.groupingSelect.splice(this.groupingSelect.findIndex(item => item.id == e.id), 1) - this.groupingIndex.splice(this.groupingIndex.findIndex(items => items == index), 1) - } - } - - //分组上移 - groupingTop () { - if (this.groupingSelect.length && this.groupingIndex.length) { - let select = this.groupingSelect[this.groupingSelect.length-1] - let index = this.groupingIndex[this.groupingIndex.length-1] - if (index!=0) { - let topOrder = this.allGrouping[index].order - let bottomOrder = this.allGrouping[index-1].order - this.allGrouping[index-1].order = topOrder - this.allGrouping.forEach(item => { - item.propertyInfos.forEach((element) => { - delete element.index - }); - }); - this.http.put(`/api/BasicGroups/${this.allGrouping[index-1].id}`,{ - id:this.allGrouping[index-1].id, - name:this.allGrouping[index-1].name, - order:this.allGrouping[index-1].order, - enabled:this.allGrouping[index-1].enabled, - propertyInfos:this.allGrouping[index-1].propertyInfos, - basicCategoryId:this.allGrouping[index-1].basicCategoryId - }).subscribe(data=>{ - this.allGrouping[index].order = bottomOrder - this.submit(select,index) - }) - } - } - } - - //分组下移 - groupingBottom () { - if (this.groupingSelect.length && this.groupingIndex.length) { - let select = this.groupingSelect[this.groupingSelect.length-1] - let index = this.groupingIndex[this.groupingIndex.length-1] - if (index!=this.allGrouping.length-1) { - let topOrder = this.allGrouping[index].order - let bottomOrder = this.allGrouping[index+1].order - this.allGrouping[index+1].order = topOrder - this.allGrouping.forEach(item => { - item.propertyInfos.forEach((element) => { - delete element.index - }); - }); - this.http.put(`/api/BasicGroups/${this.allGrouping[index+1].id}`,{ - id:this.allGrouping[index+1].id, - name:this.allGrouping[index+1].name, - order:this.allGrouping[index+1].order, - enabled:this.allGrouping[index+1].enabled, - propertyInfos:this.allGrouping[index+1].propertyInfos, - basicCategoryId:this.allGrouping[index+1].basicCategoryId - }).subscribe(data=>{ - this.allGrouping[index].order = bottomOrder - this.submit(select,index) - }) - } - } - } - - //新增单位 - addunitinfo(){ - const dialogRef = this.dialog.open(AddUnitInfo, {//调用open方法打开对话框并且携带参数过去 - width: '260px', - data: {} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getAllUnitInformation () - } - - } - ); - } - - //编辑单位 - editunitinfo(){ - if(this.unitInformation){ - const dialogRef = this.dialog.open(EditUnitInfo, {//调用open方法打开对话框并且携带参数过去 - width: '295px', - data: {unitInformation:this.unitInformation} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getAllUnitInformation () - } - } - ); - }else{ - alert("请先选择单位") - } - } - - //禁启用单位 - disableunit(){ - if(this.unitInformation){ - this.http.put(`/api/BasicCategories/${this.unitInformation.id}`,{ - id: this.unitInformation.id, - name: this.unitInformation.name, - enabled: !this.unitInformation.enabled, - }).subscribe(data=>{ - this.getAllUnitInformation () - }) - }else{ - alert("请先选择单位") - } - } - - //删除单位 - deleteunit(){ - var isdeleted = confirm(`确定要删除${this.unitInformation.name}单位信息吗?`) - if(isdeleted){ - //请求删除接口 - this.http.delete(`/api/BasicCategories/${this.unitInformation.id}`).subscribe( data=>{ - this.getAllUnitInformation () - }) - } - } - - //新增分组 - addgroups(){ - const dialogRef = this.dialog.open(AddGroups, {//调用open方法打开对话框并且携带参数过去 - width: '295px', - data: {unitInformation:this.unitInformation,allGrouping:this.allGrouping} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getAllGrouping () - } - } - ); - } - - //编辑分组 - editgroup(item,index){ - const dialogRef = this.dialog.open(EditGroup, {//调用open方法打开对话框并且携带参数过去 - width: '295px', - data: {unitInformation:this.unitInformation,allGrouping:this.allGrouping,item:item} - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.getAllGrouping () - } - } - ); - } - - //禁启用分组 - disablegroup(item){ - if(item.enabled){ - this.http.put(`/api/BasicGroups/${item.id}`,{ - id: item.id, - name: item.name, - order: item.order, - enabled: false, - propertyInfos:item.propertyInfos, - basicCategoryId: item.basicCategoryId - }).subscribe(data=>{ - alert("禁用成功") - this.getAllGrouping () - }) - }else{ - this.http.put(`/api/BasicGroups/${item.id}`,{ - id: item.id, - name: item.name, - order: item.order, - enabled: true, - propertyInfos:item.propertyInfos, - basicCategoryId: item.basicCategoryId - }).subscribe(data=>{ - alert("启用成功") - this.getAllGrouping () - }) - } - } - - //删除分组 - deletegroup(item){ - var isdeleted = confirm(`确定要删除${item.name}分组吗?`) - if(isdeleted){ - //请求删除接口 - this.http.delete(`/api/BasicGroups/${item.id}`).subscribe( data=>{ - this.getAllGrouping () - }) - } - } - - - - - - //分组属性操作↓ - //选中分组属性checked - attributeChange (item,index,event) { - if (event.checked === true) { - this.attributeSelect.push(item) - this.attributeIndex.push(index) - } else { - this.attributeSelect.splice(this.attributeSelect.findIndex(items => items == item), 1) - this.attributeIndex.splice(this.attributeIndex.findIndex(items => items == index), 1) - } - } - - //属性上移 - attributeTop (e,index) { - let select = this.attributeSelect[this.attributeSelect.length-1] - let newIndex = this.attributeIndex[this.attributeIndex.length-1] - if (this.attributeSelect.length && newIndex===index) { - if(select.index != 0) { - this.allGrouping[index].propertyInfos[select.index]=this.allGrouping[index].propertyInfos[select.index-1] - this.allGrouping[index].propertyInfos[select.index-1]=select - this.submit(e,index) - } - } - } - - //属性下移 - attributeBottom (e,index) { - let select = this.attributeSelect[this.attributeSelect.length-1] - let newIndex = this.attributeIndex[this.attributeIndex.length-1] - if (this.attributeSelect.length && newIndex===index) { - if(select.index != this.allGrouping[index].propertyInfos.length-1) { - this.allGrouping[index].propertyInfos[select.index]=this.allGrouping[index].propertyInfos[select.index+1] - this.allGrouping[index].propertyInfos[select.index+1]=select - this.submit(e,index) - } - } - } - - //封装函数每条属性添加index - setIndex () { - if (this.allGrouping.length) { - this.allGrouping.forEach(item => { - item.propertyInfos.forEach((element,index) => { - element.index = index - }); - }); - } - } - - //创建分组属性 - addGrouping (e,index) { - const dialogRef = this.dialog.open(addAttributeComponent); - dialogRef.afterClosed().subscribe( - data=>{ if (data) { - this.allGrouping[index].propertyInfos.push(data) - this.submit(e,index) - }}) - } - - //编辑分组属性 - editGrouping (e,index,element) { - let data = element - const dialogRef = this.dialog.open(editAttribute,{data}); - dialogRef.afterClosed().subscribe( - data=>{ if (data) { - this.allGrouping[index].propertyInfos[data.index] = data - this.submit(e,index) - }}) - } - - //属性显示 - display (e) { - e.visible = true - } - - //属性隐藏 - noDisplay (e) { - e.visible = false - } - - //属性启用 - enabledGrouping (e) { - e.enabled = true - } - - //属性禁用 - noEnabledGrouping (e) { - e.enabled = false - } - - //属性删除 - deleteGrouping (e,index,elementIndex) { - let isTrue = confirm('您确定要删除吗') - if (isTrue) { - this.allGrouping[index].propertyInfos.splice(elementIndex,1) - this.submit(e,index) - } - } - - - - //提交当前分组保存数据 - submit (e,index) { - if (this.allGrouping.length) { - this.allGrouping.forEach(item => { - item.propertyInfos.forEach((element) => { - delete element.index - }); - }); - this.http.put(`/api/BasicGroups/${e.id}`,{ - id:e.id, - name:e.name, - order:e.order, - enabled:e.enabled, - propertyInfos:this.allGrouping[index].propertyInfos, - basicCategoryId:e.basicCategoryId - }).subscribe(data=>{ - this.getAllGrouping() - }) - } else { - this.http.put(`/api/BasicGroups/${e.id}`,{ - id:e.id, - name:e.name, - order:e.order, - enabled:e.enabled, - propertyInfos:this.allGrouping[index].propertyInfos, - basicCategoryId:e.basicCategoryId - }).subscribe(data=>{ - this.getAllGrouping() - }) - } - } - - - -} - -export interface Food { - value: number; - viewValue: string; -} diff --git a/src/app/ui/unittype/dialog-overview-example-dialog.html b/src/app/ui/unittype/dialog-overview-example-dialog.html deleted file mode 100644 index 860748b..0000000 --- a/src/app/ui/unittype/dialog-overview-example-dialog.html +++ /dev/null @@ -1,61 +0,0 @@ -
    - 创建单位类型 - -
    -
    - - - -
    - -
    - - - {{item.name}} - - -
    - -
    - - - - {{food.name}} - - - -
    - -
    - - -
    -
    -
    - -
    - - - - {{node.name}} check_circle_outline - - - - - - {{node.name}} check_circle_outline - - - -
    \ No newline at end of file diff --git a/src/app/ui/unittype/editorialUnit.html b/src/app/ui/unittype/editorialUnit.html deleted file mode 100644 index 1395e63..0000000 --- a/src/app/ui/unittype/editorialUnit.html +++ /dev/null @@ -1,40 +0,0 @@ -
    - 编辑单位类型 - -
    -
    - - - -
    - -
    - - - - {{item.name}} - - - -
    - -
    - - - - {{food.name}} - - - -
    - -
    - - -
    -
    -
    \ No newline at end of file diff --git a/src/app/ui/unittype/unittype.component.html b/src/app/ui/unittype/unittype.component.html deleted file mode 100644 index b37fb38..0000000 --- a/src/app/ui/unittype/unittype.component.html +++ /dev/null @@ -1,50 +0,0 @@ -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    单位类型{{element.name}}单位信息模板消防要素模板{{element.fireCategoryName}}操作 - - - - - - - -
    -
    \ No newline at end of file diff --git a/src/app/ui/unittype/unittype.component.scss b/src/app/ui/unittype/unittype.component.scss deleted file mode 100644 index d48e6de..0000000 --- a/src/app/ui/unittype/unittype.component.scss +++ /dev/null @@ -1,30 +0,0 @@ -.left { - margin: 10px; -} -.marginLeft { - margin-left: 5px; -} -table { - width: 100%; - text-align: center; - .cdk-header-cell { - text-align: center; - } - } - -.leftBox { - width: 200px; - float: left; -} -.tree { - float: right; - width: 300px; - height: 300px; - overflow: auto; -} -.mat-icon { - font-size: 22px; -} -mat-form-field{ - width: 200px; -} \ No newline at end of file diff --git a/src/app/ui/unittype/unittype.component.ts b/src/app/ui/unittype/unittype.component.ts deleted file mode 100644 index 854ae77..0000000 --- a/src/app/ui/unittype/unittype.component.ts +++ /dev/null @@ -1,279 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import {HttpClient} from '@angular/common/http' -import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { FlatTreeControl } from '@angular/cdk/tree'; -import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree'; - - - -@Component({ - selector: 'app-unittype', - templateUrl: './unittype.component.html', - styleUrls: ['./unittype.component.scss'] -}) -export class UnittypeComponent implements OnInit { - - constructor(public http: HttpClient,public dialog: MatDialog) { } - - displayedColumns: string[]=['company', 'template','fireControl','operation']; - dataSource:any; //所有单位类型 - allFireControl:any; //所有消防要素模板 - - ngOnInit() { - this.getList() - this.getFireControl() - } - - - //获取所有单位类型 - getList () { - this.http.get('/api/BuildingTypes').subscribe( - (data: any[]) => { - this.dataSource=data - } - ) - } - - //获取所有消防要素模板 - getFireControl () { - this.http.get('/api/FireCategories').subscribe( - (data:any)=>{ - this.allFireControl=data - } - )} - - //创建单位弹窗 - open() { - let data = this.allFireControl - let dialogRef = this.dialog.open(DialogOverviewExampleDialog, - { - data - }); - dialogRef.afterClosed().subscribe( - (data)=>{ - if (data) {this.getList()} - } - ); - } - - //编辑弹窗 - edit (e) { - let data= e - let allFireControl= this.allFireControl - let dialogRef = this.dialog.open(editorialUnit, - - { - width:"260px", - data:{ - data,allFireControl - } - }); - dialogRef.afterClosed().subscribe( - (data)=>{ - if (data) {this.getList()} - } - ); - } - - //启用 - enabled(e) { - this.http.put( - `/api/BuildingTypes/${e.id}`, - { - id:e.id, - name: e.name, - enabled: true, - fireCategoryId:e.fireCategoryId - } - ).subscribe( - ()=> { - this.getList() - } - ) - } - - //禁用 - prohibit (e) { - this.http.put( - `/api/BuildingTypes/${e.id}`, - { - id:e.id, - name: e.name, - enabled: false, - fireCategoryId:e.fireCategoryId - } - ).subscribe( - ()=> { - this.getList() - } - ) - } - - //删除 - delete(e) { - let isTrue = confirm('您确定要删除吗') - if(isTrue) { - this.http.delete(`/api/BuildingTypes/${e}`).subscribe( - ()=>{ - this.getList() - } - ) - } - } - - - -} - -//创建单位弹窗组件 -@Component({ - selector: 'dialog-overview-example-dialog', - templateUrl: 'dialog-overview-example-dialog.html', - styleUrls: ['./unittype.component.scss'] -}) -export class DialogOverviewExampleDialog { - data:any =[] - newdata = []; - - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - computed:node.computed, - order:node.order, - checked:node.checked, - tag:node.tag - }; - } - treeControl = new FlatTreeControl(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); - - constructor(public http: HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public allFireControl) {} - - ngOnInit() { - this.getunitmsg() - } - - oldSelected:any; //选中的单位信息模板id - selected:any; //选中的消防要素模板id - allunitmsg:any //所有单位信息 - - //获得所有单位信息模板 - getunitmsg(){ - this.http.get('/api/BasicCategories').subscribe(data=>{ - this.allunitmsg = data - }) - } - //封装实现select框切换渲染更新Tree函数 - select () { - this.newdata=[] - let id = this.selected - this.http.get(`/api/FireCategories/${id}/FireElements`).subscribe( - (data:any)=>{ - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - var parentNode = getparentNode(item.parentId); - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata.push(item) - } - } - }); - this.dataSource.data = this.newdata; - } - ) - - } - - //select选择切换Tree - toggleDisplay() { - this.select() - } - - hasChild = (_: number, node: any) => node.expandable; - - //创建单位类型 - onSubmit (e) { - if(this.selected) { - this.http.post('/api/BuildingTypes',{ - name:e.name, - enabled:true, - fireCategoryId:this.selected - }).subscribe(data=>{ - this.dialogRef.close('success') - }) - } else { - alert('请填写完整') - } - } - - - -} - - -//编辑单位弹窗组件 -@Component({ - selector: 'app-editorialUnit', - templateUrl: './editorialUnit.html', - styleUrls: ['./unittype.component.scss'] -}) -export class editorialUnit { - -constructor(public http: HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - ngOnInit() { - this.companyName=this.data.data.name - this.selected=this.data.data.fireCategoryId - this.getunitmsg() - } - - companyName:any; //单位类型name - oldSelected:any; //单位信息模板id - selected:any; //消防要素模板id - allunitmsg:any //所有单位信息 - - //获得所有单位信息模板 - getunitmsg(){ - this.http.get('/api/BasicCategories').subscribe(data=>{ - this.allunitmsg = data - }) - } - //编辑功能 - onSubmit (e) { - let id = this.data.data.id - let enabled = this.data.data.enabled - if(e.name&&this.selected) { - this.http.put(`/api/BuildingTypes/${id}`,{ - id:id, - name:e.name, - enabled: enabled, - fireCategoryId:this.selected - }).subscribe(data=>{ - this.dialogRef.close('success') - }) - } else { - alert('请填写完整') - } - } - - - -} diff --git a/src/app/ui/usermanagement/allRoles.html b/src/app/ui/usermanagement/allRoles.html deleted file mode 100644 index db20d4c..0000000 --- a/src/app/ui/usermanagement/allRoles.html +++ /dev/null @@ -1,29 +0,0 @@ -分配角色 - -
    -
    -
    所有角色
    -
    - - {{item.name}} - -
    -
    - -
    -
    用户角色
    -
    -

    - {{item.name}} -

    -
    -
    -
    - -
    - - -
    \ No newline at end of file diff --git a/src/app/ui/usermanagement/createUser.html b/src/app/ui/usermanagement/createUser.html deleted file mode 100644 index b216966..0000000 --- a/src/app/ui/usermanagement/createUser.html +++ /dev/null @@ -1,62 +0,0 @@ -
    - 创建用户 - -
    -
    - - - -
    -
    - 登录名格式为字母开头,5-18位 -
    -
    -
    -
    - - - -
    - -
    - - - -
    - -
    - - -
    -
    -
    - -
    - 请选择所属机构 - - - -
  • {{node.name}}
  • -
    - - - - -
  • {{node.name}}
  • -
    - -
    -
    \ No newline at end of file diff --git a/src/app/ui/usermanagement/editUser.html b/src/app/ui/usermanagement/editUser.html deleted file mode 100644 index 0f516df..0000000 --- a/src/app/ui/usermanagement/editUser.html +++ /dev/null @@ -1,32 +0,0 @@ -编辑用户 - -
    - - - -
    - -
    - - - -
    - -
    - - - - {{food.name}} - - - -
    - -
    - - -
    \ No newline at end of file diff --git a/src/app/ui/usermanagement/seeInformation.html b/src/app/ui/usermanagement/seeInformation.html deleted file mode 100644 index a627ce7..0000000 --- a/src/app/ui/usermanagement/seeInformation.html +++ /dev/null @@ -1,29 +0,0 @@ -查看用户 - -
    - - 登录账号: - {{data.name}} - - 真实姓名: - {{data.realName}} - - 所属机构: - {{data.organizationName}} - - 所属角色: - {{item}} - - 创建时间: - {{data.creationTime|date:'yyyy-MM-dd'}} - - 是否禁用: - - - - -
    - -
    - -
    \ No newline at end of file diff --git a/src/app/ui/usermanagement/usermanagement.component.html b/src/app/ui/usermanagement/usermanagement.component.html deleted file mode 100644 index 9cb6f42..0000000 --- a/src/app/ui/usermanagement/usermanagement.component.html +++ /dev/null @@ -1,97 +0,0 @@ -
    - -
    - 用户账号: - - 用户姓名: - - - 所属机构: - - - - {{food.name}} - - - - - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    登录账号{{element.name}}真实姓名{{element.realName}}所属机构{{element.organizationName}}所属角色 - {{item}} - 创建时间 - {{element.creationTime|date:'yyyy-MM-dd'}} - 操作 - - - - - - - - - - - - - -
    - - - diff --git a/src/app/ui/usermanagement/usermanagement.component.scss b/src/app/ui/usermanagement/usermanagement.component.scss deleted file mode 100644 index 0162cb9..0000000 --- a/src/app/ui/usermanagement/usermanagement.component.scss +++ /dev/null @@ -1,88 +0,0 @@ -table { - width: 100%; - text-align: center; - .cdk-header-cell { - text-align: center; - } - } -.left{ - margin: 20px; -} -.right { - margin-top: 10px; - margin-right: 50px; - float: right; -} -.maginleft { - margin-left: 5px; -} -.searchInput { - width: 130px; -} -.mat-form-field { - width: 130px; -} -.alert-danger{ - font-size: 14px; - color: red; -} -.leftTree { - width: 200px; - float: left; -} -.tree { - width: 300px; - height: 300px; - float: right; - overflow: auto; -} -.example-margin { - display: block; - margin-top: 5px; -} - -.clearfix:after{/*伪元素是行内元素 正常浏览器清除浮动方法*/ - content: ""; - display: block; - height: 0; - clear:both; - visibility: hidden; -} -.clearfix{ - *zoom: 1;/*ie6清除浮动的方式 *号只有IE6-IE7执行,其他浏览器不执行*/ -} -.leftBox { - float: left; - width: 250px; - border-radius: 10px;; - border: 1px solid #999; -} -.rightBox { - float: right; - width: 250px; - border-radius: 10px;; - border: 1px solid #999; -} -.header { - height: 30px; - line-height: 30px; - border-radius: 10px 10px 0 0; - padding-left: 10px; - background-color: #f9fafc; -} -.select { - height: 300px; - padding-left: 10px; - border-top: 1px solid #999; - p{ - height: 24px; - line-height: 24px; - } -} -.organizationlist{ - list-style: none -} -.organizationlist:hover{ - background: rgba(225, 225, 225, 0.8); - cursor: pointer; -} diff --git a/src/app/ui/usermanagement/usermanagement.component.ts b/src/app/ui/usermanagement/usermanagement.component.ts deleted file mode 100644 index d269861..0000000 --- a/src/app/ui/usermanagement/usermanagement.component.ts +++ /dev/null @@ -1,403 +0,0 @@ -import { Component, OnInit, ViewChild, Inject } from '@angular/core'; -import {HttpClient} from '@angular/common/http' -import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatTableDataSource } from '@angular/material/table'; -import { FlatTreeControl } from '@angular/cdk/tree'; -import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree'; -import { PageEvent } from '@angular/material/paginator'; -@Component({ - selector: 'app-usermanagement', - templateUrl: './usermanagement.component.html', - styleUrls: ['./usermanagement.component.scss'] -}) -export class UsermanagementComponent implements OnInit { - - constructor(public http: HttpClient,public dialog: MatDialog) { } - ViewChild: PageEvent; - - ngOnInit() { - this.getUsers() - this.getAllMechanism() - } - - - displayedColumns: string[] = ['loginName', 'realName', 'mechanism','role','time', 'operation']; - dataSource:any; //所有用户 - allMechanism:any; //所有机构 - - userLogin:string; //搜索账号 - userName:string; //搜索名称 - userMechanism:string //搜索机构 - - //分页 - @ViewChild(MatPaginator, {static: true}) - paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 - pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 - - //分页切换 - chagePage (e) { - this.PageNumber = e.pageIndex+1 - this.getUsers() - } - - //获取所有用户 + 搜索功能 - getUsers () { - let data = { - Name: this.userLogin ||'', - RealName:this.userName ||'', - OrganizationId:this.userMechanism ||'', - PageNumber: this.PageNumber || '1' - } - this.http.get('/api/Users',{params:data}).subscribe( - (data:any[])=> { - this.length = data['totalCount'] - this.pageSize = data['pageSize'] - this.dataSource = new MatTableDataSource(data['items']); - } - ) - - } - - //清空自动搜索 - empty () { - this.userLogin='' - this.userName='' - this.userMechanism='' - this.getUsers() - } - - //获取所有机构 - getAllMechanism() { - this.http.get('/api/Organizations').subscribe(data=>{ - this.allMechanism=data - }) - } - - //打开创建用户窗口 - open() { - let dialogRef = this.dialog.open(CreateNewUser,{ - width: '600px', - }); - dialogRef.afterClosed().subscribe( - (data)=>{ - if (data) {this.getUsers()} - } - ); - } - - //打开分配角色窗口 - openuser (e) { - let dialogRef = this.dialog.open(allRoles, - { - width:'600px', - data: {e} - }); - dialogRef.afterClosed().subscribe( - (data)=>{ - if (data) {this.getUsers()} - } - ); - } - - //启用 - enable (e) { - this.http.put(`/api/Users/${e.name}`,{ - name: e.name, - realName:e.realName, - enabled: true, - creationTime:e.creationTime, - organizationId:e.organizationId - }).subscribe( - data=> { - this.getUsers() - } - ) - } - - //禁用 - prohibit (e) { - this.http.put(`/api/Users/${e.name}`,{ - name: e.name, - realName:e.realName, - enabled: false, - creationTime:e.creationTime, - organizationId:e.organizationId - }).subscribe( - data=> { - this.getUsers() - } - ) - } - - //编辑 - edit (e) { - let allMechanism=this.allMechanism - let dialogRef = this.dialog.open(EditNewUser, - { - data: {e,allMechanism} - }); - - dialogRef.afterClosed().subscribe( - (data)=>{ - if (data) {this.getUsers()} - } - ); - } - - //查看 - see (e) { - this.http.get(`/api/Users/${e}`).subscribe( - data=> { - let dialogRef = this.dialog.open(seeInformation, - { - width:'600px', - data - }); - dialogRef.afterClosed().subscribe(); - } - - ) - } - - //重置密码 - reset (e) { - this.http.put(`/api/Users/${e}/ResetPassword`,{}).subscribe( - data=> { - alert('重置密码成功!') - } - ) - } - - //删除 - delete (e) { - let isTrue = confirm('您确定要删除吗') - if (isTrue) { - this.http.delete(`/api/Users/${e}`).subscribe( - data=>{ - this.getUsers() - } - ) - } - } - - - -} - - -//创建用户组件 -@Component({ - selector: 'app-createUser', - templateUrl: './createUser.html', - styleUrls: ['./usermanagement.component.scss'] -}) -export class CreateNewUser { - - newdata = []; - - private _transformer = (node, level: number) => { - return { - expandable: !!node.children && node.children.length > 0, - name: node.name, - level: level, - id: node.id, - parentId: node.parentId, - enabled:node.enabled, - order:node.order, - }; - } - treeControl = new FlatTreeControl(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); - - constructor(public http: HttpClient, - public dialogRef: MatDialogRef) {} - - organizationId:any=''; //所属机构id - organizationName:any; //所属机构name - - ngOnInit() { - this.tree() - } - - //渲染Tree - tree () { - this.newdata=[] - this.http.get('/api/Organizations').subscribe( - (data:any)=>{ - function getparentNode(parentId){ - return data.find((item)=>{ - return item.id == parentId - }) - } - data.forEach(item => { - var parentNode = getparentNode(item.parentId); - if(parentNode){ - if(!parentNode.children){ - parentNode.children = [] - } - parentNode.children.push(item) - }else{ - if(!item.parentId){ - this.newdata.push(item) - } - } - }); - this.dataSource.data = this.newdata; - } - ) - - } - hasChild = (_: number, node: any) => node.expandable; - - //选择机构 - add (e) { - this.organizationId = e.id - this.organizationName = e.name - } - - //新增用户 - onSubmit(e) { - let time =new Date() - if(this.organizationId) { - this.http.post('/api/Users',{ - name:e.name, - realName:e.user, - enabled:true, - creationTime:time, - organizationId:this.organizationId - }).subscribe( - data=> { - this.dialogRef.close('success'); - } - ) - }else{ - alert('请选择机构') - } - - } - - - -} - - -//编辑用户组件 -@Component({ - selector: 'app-editUser', - templateUrl: './editUser.html', - styleUrls: ['./usermanagement.component.scss'] -}) -export class EditNewUser { - constructor(public http: HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - ngOnInit() { - this.name=this.data.e.name - this.realName=this.data.e.realName - this.affiliate=this.data.e.organizationId - } - - name:any; //登录账号 - realName:any; //真实姓名 - affiliate:any; //所属机构id - - //编辑 - confirmRevision () { - if (this.realName) { - this.http.put(`/api/Users/${this.data.e.name}`,{ - name:this.data.e.name, - realName:this.realName, - enabled: this.data.e.enabled, - creationTime:this.data.e.creationTime, - organizationId:this.affiliate - }).subscribe(data=>{ - this.dialogRef.close('success') - }) - } else { - alert('请填写完整') - } - } - -} - - -//分配角色组件 -@Component({ - selector: 'app-allRoles', - templateUrl: './allRoles.html', - styleUrls: ['./usermanagement.component.scss'] -}) -export class allRoles { - - constructor(public http: HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - ngOnInit() { - this.getUsers() - } - - allRoles:any; //所有角色 - checked:any=[]; //选中的角色 - - //获取所有角色 - getUsers () { - this.http.get('/api/Roles').subscribe( - data=>{ - this.allRoles=data - } - ) - } - - //check框change事件 - fill (isCheced,e) { - if (isCheced) { - this.checked.push(e) - } else { - this.checked.splice(this.checked.findIndex(item => item.id === e.id), 1) - } - } - - //分配角色 - onSubmit () { - if (this.checked.length) { - let data:any=[] - this.checked.forEach(item=>{ - data.push(item.id) - }) - this.http.post(`/api/Users/${this.data.e}/Roles`,data).subscribe( - data=> { - this.dialogRef.close('success') - } - ) - } else { - alert('请选择分配角色') - } - } - - - -} - - -//查看用户组件 -@Component({ - selector: 'app-seeInformation', - templateUrl: './seeInformation.html', - styleUrls: ['./usermanagement.component.scss'] -}) -export class seeInformation { - constructor(public http: HttpClient, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - ngOnInit() { - } - -}