Commit dee44e67 by 杨子

更新资产管理模块

parent e954ad55
<Navbar>
资产管理
</Navbar>
<div class="container">
<ng-container *ngFor="let item of data">
<div class="title">
<Flex [align]="'baseline'" [justify]="'between'">
<div>{{item.title}}</div>
<div (click)="onExpend(item)">{{item.expend?'收起':'更多'}}</div>
</Flex>
</div>
<Grid [activeStyle]="false" [data]="item.children" (OnClick)="click($event)"></Grid>
</ng-container>
</div>
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-assets',
templateUrl: './assets.component.html',
styleUrls: ['./assets.component.less']
styleUrls: ['./assets.component.less'],
})
export class AssetsComponent implements OnInit {
data = [
{
id: 1,
title: '(类)固定资产->资产信息',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '固定资产台账',
link: '/admin/fixed-assets/assets-info/fixed-assets',
},
{
icon: '/assets/tmp/img/1.png',
text: '类固定资产台账',
link: '/admin/fixed-assets/assets-info/cate-fixed-assets',
},
{
icon: '/assets/tmp/img/1.png',
text: '资产分类',
link: '/admin/fixed-assets/assets-info/assets-cate',
},
{
icon: '/assets/tmp/img/1.png',
text: '房屋',
link: '/admin/fixed-assets/assets-info/house',
},
{
icon: '/assets/tmp/img/1.png',
text: '一键折旧',
link: '/admin/fixed-assets/assets-info/depreciate',
},
{
icon: '/assets/tmp/img/1.png',
text: '资产折旧记录',
link: '/admin/fixed-assets/assets-info/depreciation-record',
},
{
icon: '/assets/tmp/img/1.png',
text: '资产性质',
link: '/admin/fixed-assets/assets-info/assets-nature',
},
{
icon: '/assets/tmp/img/1.png',
text: '特种设备事故记录',
link: '/admin/fixed-assets/assets-info/plant-accident',
},
{
icon: '/assets/tmp/img/1.png',
text: '特种设备运行故障',
link: '/admin/fixed-assets/assets-info/plant-operate',
},
{
icon: '/assets/tmp/img/1.png',
text: '车辆/特种设备检定',
link: '/admin/fixed-assets/assets-info/plant-verify',
},
{
icon: '/assets/tmp/img/1.png',
text: '附件表',
link: '/admin/fixed-assets/assets-info/parts',
},
{
icon: '/assets/tmp/img/1.png',
text: '自定义字段',
link: '/admin/fixed-assets/assets-info/custom',
},
{
icon: '/assets/tmp/img/1.png',
text: '附属设备及配件',
link: '/admin/fixed-assets/assets-info/anlage',
},
],
},
{
id: 2,
title: '(类)固定资产->资产使用',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '消息通知',
},
{
icon: '/assets/tmp/img/1.png',
text: '预警中心',
},
],
},
{
id: 3,
title: '(类)固定资产->资产租赁',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '消息通知',
},
{
icon: '/assets/tmp/img/1.png',
text: '预警中心',
},
],
},
{
id: 4,
title: '(类)固定资产->设备维保',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '消息通知',
},
{
icon: '/assets/tmp/img/1.png',
text: '预警中心',
},
],
},
{
id: 5,
title: '(类)固定资产->单机车核算',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '消息通知',
},
{
icon: '/assets/tmp/img/1.png',
text: '预警中心',
},
],
},
{
id: 6,
title: '(类)固定资产->资产保险',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '消息通知',
},
{
icon: '/assets/tmp/img/1.png',
text: '预警中心',
},
],
},
{
id: 7,
title: '(类)固定资产->证件管理',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '消息通知',
},
{
icon: '/assets/tmp/img/1.png',
text: '预警中心',
},
],
},
{
id: 8,
title: '(类)固定资产->搅拌站配比',
expend: false,
children: [
{
icon: '/assets/tmp/img/1.png',
text: '消息通知',
},
{
icon: '/assets/tmp/img/1.png',
text: '预警中心',
},
],
},
];
currentArr = []; // 收起
remainArr = []; //更多
constructor(private router: Router) {}
constructor() { }
ngOnInit() {
ngOnInit() {}
click(event) {
console.log(event);
const url = event.data.link;
this.router.navigateByUrl(url);
}
onExpend(item) {
item.expend = !item.expend;
if (item.expend) {
this.currentArr = item.children.slice(0, 4);
this.remainArr = item.children;
this.data[item.id - 1].children = this.currentArr;
} else {
this.data[item.id - 1].children = [...this.remainArr];
}
console.log(this.data);
}
}
<Navbar>
盘点
</Navbar>
<div class="container">
<ng-container *ngFor="let item of data">
<div class="title">
<Flex [align]="'baseline'" [justify]="'between'">
<div>{{item.title}}</div>
<div *ngIf="item.expend">{{item.expend?'收起':'更多'}}</div>
</Flex>
</div>
<Grid [activeStyle]="false" [data]="item.children" (OnClick)="click($event)"></Grid>
</ng-container>
</div>
......@@ -3,13 +3,51 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-inventory',
templateUrl: './inventory.component.html',
styleUrls: ['./inventory.component.less']
styleUrls: ['./inventory.component.less'],
})
export class InventoryComponent implements OnInit {
data = [
{
title: '事务管理中心',
expend: false,
children: [
{
icon: '/assets/img/logo.svg',
text: '我启动的流程',
},
{
icon: '/assets/img/logo.svg',
text: '我的代办流程',
},
{
icon: '/assets/img/logo.svg',
text: '我的已办流程',
},
{
icon: '/assets/img/logo.svg',
text: '流程监督',
},
],
},
{
title: '信息中心',
expend: false,
children: [
{
icon: '/assets/img/logo.svg',
text: '消息通知',
},
{
icon: '/assets/img/logo.svg',
text: '预警中心',
},
],
},
];
constructor() {}
constructor() { }
ngOnInit() {
ngOnInit() {}
click(event) {
console.log(event);
}
}
<Navbar>
信息中心
</Navbar>
<div class="title">事务管理中心</div>
<Grid [activeStyle]="false" [data]="data" (OnClick)="click($event)"></Grid>
<div class="container">
<ng-container *ngFor="let item of data">
<div class="title">
<Flex [align]="'baseline'" [justify]="'between'">
<div>{{item.title}}</div>
<div *ngIf="item.expend">{{item.expend?'收起':'更多'}}</div>
</Flex>
</div>
<Grid [activeStyle]="false" [data]="item.children" (OnClick)="click($event)"></Grid>
</ng-container>
</div>
......@@ -6,10 +6,44 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./message.component.less'],
})
export class MessageComponent implements OnInit {
data = Array.from(new Array(9)).map((_val, i) => ({
icon: '/assets/img/logo.svg',
text: `name${i}`,
}));
data = [
{
title: '事务管理中心',
expend: false,
children: [
{
icon: '/assets/img/logo.svg',
text: '我启动的流程',
},
{
icon: '/assets/img/logo.svg',
text: '我的代办流程',
},
{
icon: '/assets/img/logo.svg',
text: '我的已办流程',
},
{
icon: '/assets/img/logo.svg',
text: '流程监督',
},
],
},
{
title: '信息中心',
expend: false,
children: [
{
icon: '/assets/img/logo.svg',
text: '消息通知',
},
{
icon: '/assets/img/logo.svg',
text: '预警中心',
},
],
},
];
constructor() {}
ngOnInit() {}
......
<Navbar>
统计
</Navbar>
<div class="container">
<ng-container *ngFor="let item of data">
<div class="title">
<Flex [align]="'baseline'" [justify]="'between'">
<div>{{item.title}}</div>
<div *ngIf="item.expend">{{item.expend?'收起':'更多'}}</div>
</Flex>
</div>
<Grid [activeStyle]="false" [data]="item.children" (OnClick)="click($event)"></Grid>
</ng-container>
</div>
......@@ -3,13 +3,51 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-total',
templateUrl: './total.component.html',
styleUrls: ['./total.component.less']
styleUrls: ['./total.component.less'],
})
export class TotalComponent implements OnInit {
data = [
{
title: '事务管理中心',
expend: false,
children: [
{
icon: '/assets/img/logo.svg',
text: '我启动的流程',
},
{
icon: '/assets/img/logo.svg',
text: '我的代办流程',
},
{
icon: '/assets/img/logo.svg',
text: '我的已办流程',
},
{
icon: '/assets/img/logo.svg',
text: '流程监督',
},
],
},
{
title: '信息中心',
expend: false,
children: [
{
icon: '/assets/img/logo.svg',
text: '消息通知',
},
{
icon: '/assets/img/logo.svg',
text: '预警中心',
},
],
},
];
constructor() {}
constructor() { }
ngOnInit() {
ngOnInit() {}
click(event) {
console.log(event);
}
}
<Navbar>
我的
</Navbar>
<div class="container">
</div>
......@@ -3,13 +3,10 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.less']
styleUrls: ['./user.component.less'],
})
export class UserComponent implements OnInit {
constructor() {}
constructor() { }
ngOnInit() {
}
ngOnInit() {}
}
<page-header [title]="'详情'"></page-header>
<nz-collapse>
<nz-collapse-panel *ngFor="let panel of panels" [nzHeader]="panel.name" [nzActive]="panel.active"
[nzDisabled]="panel.disabled">
<ng-container *ngIf="panel.id == 1">
<ng-container *ngFor="let item of panel.items">
<span>{{item.text}}</span>
</ng-container>
</ng-container>
</nz-collapse-panel>
</nz-collapse>
......@@ -16,7 +16,7 @@ import { HomeComponent } from './home/home.component';
const routes: Routes = [
{
path: 'admin',
component: AppDefaultComponent,
component: LayoutFullScreenComponent,
children: [
// 数据分析与展示
{
......@@ -58,11 +58,6 @@ const routes: Routes = [
path: 'settings',
loadChildren: './settings/settings.module#SettingsModule',
},
// 用户中心
{
path: 'user',
loadChildren: './user/user.module#UserModule',
},
],
},
{
......
......@@ -9,11 +9,13 @@ import { UserLoginComponent } from './passport/login/login.component';
// single pages
import { CallbackComponent } from './callback/callback.component';
import { HomeComponent } from './home/home.component';
import { CenterComponent } from './user/center/center.component';
const COMPONENTS = [
HomeComponent,
// passport pages
UserLoginComponent,
CenterComponent,
// single pages
CallbackComponent,
];
......
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CenterComponent } from './center.component';
describe('CenterComponent', () => {
let component: CenterComponent;
let fixture: ComponentFixture<CenterComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CenterComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CenterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-center',
templateUrl: './center.component.html',
styleUrls: ['./center.component.less']
})
export class CenterComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class UserRoutingModule { }
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UserRoutingModule } from './user-routing.module';
@NgModule({
declarations: [],
imports: [
CommonModule,
UserRoutingModule
]
})
export class UserModule { }
/* You can add global styles to this file, and also import other style files */
.title {
padding: 16px;
font-weight: 500;
font-size: 16px;
color: #333;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment