Commit 205fa6a5 authored by wangqinghua's avatar wangqinghua

update

parent 7f51ad2d
......@@ -48,6 +48,9 @@ import {ServerComponent} from './overAll/modal/server/server.component';
import {SwitchComponent} from './overAll/modal/switch/switch.component';
import {MineComponent} from './mine/mine.component';
import {CommentStmt} from '@angular/compiler';
import {CommonProblemComponent} from './knowladge/common-problem/common-problem.component';
import {InformationTechComponent} from './knowladge/information-tech/information-tech.component';
import {ManagementSystemComponent} from './knowladge/management-system/management-system.component';
export const route: Routes = [
{path: '', redirectTo: 'app/main/home', pathMatch: 'prefix'}, //空路由定向
......@@ -101,6 +104,9 @@ export const route: Routes = [
{path: 'database', component: DatabaseComponent, data: {breadcrumb: '数据库'},},
{path: 'server', component: ServerComponent, data: {breadcrumb: '服务器'},},
{path: 'switch', component: SwitchComponent, data: {breadcrumb: '交换机'},},
{path: 'commonProblem', component: CommonProblemComponent, data: {breadcrumb: '常见问题'},},
{path: 'informationTech', component: InformationTechComponent, data: {breadcrumb: '信息技术'},},
{path: 'managementSystem', component: ManagementSystemComponent, data: {breadcrumb: '管理制度'},},
{path: 'mine', component: MineComponent, data: {breadcrumb: '菜单栏'},},
]
},
......
......@@ -25,7 +25,7 @@
<nz-table #basicTable [nzData]="dataSet" [nzFrontPagination]="true">
<thead>
<tr>
<th>id</th>
<th nzWidth="25%">id</th>
<th>名称</th>
<th>父级ID</th>
<th>code</th>
......@@ -37,7 +37,7 @@
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>
<td nzWidth="25%">
{{data.id}}
</td>
<td>
......
......@@ -2,6 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {SystemService} from '../system/system.service';
import {LocalStorageService} from 'ngx-webstorage';
import {NzMessageService} from 'ng-zorro-antd';
import {UtilService} from '../shared/common/util.service';
@Component({
selector: 'smart-mine',
......@@ -10,11 +11,11 @@ import {NzMessageService} from 'ng-zorro-antd';
})
export class MineComponent implements OnInit {
editCache = {};
editCache = [];
dataSet = [];
constructor(private systemSer: SystemService, private localStorage: LocalStorageService,
private message: NzMessageService) {
private message: NzMessageService, private util: UtilService) {
}
ngOnInit() {
......@@ -51,16 +52,19 @@ export class MineComponent implements OnInit {
}
add() {
this.dataSet.forEach((e, index) => e.key = index + 1);
const item = {
id: this.util.generateUUID(),
name: '',
parentId: '',
code: '',
url: '',
imageUrl: '',
showOrder: '',
key: 0
};
this.dataSet = [item, ...this.dataSet,];
this.updateEditCache(0);
this.dataSet = [item, ...this.dataSet];
this.editCache = [{data: item, edit: true}, ...this.editCache];
console.log(this.dataSet);
console.log(this.editCache);
}
......@@ -77,6 +81,7 @@ export class MineComponent implements OnInit {
const index = this.dataSet.findIndex(item => item.key === key);
this.dataSet[index] = this.editCache[key].data;
this.editCache[key].edit = false;
console.log(this.dataSet[index]);
this.systemSer.createMenu(this.dataSet[index]).subscribe(
(res) => {
this.message.success('保存成功');
......
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