|
@@ -7,6 +7,8 @@ import { DictService } from 'app/services/dict.service';
|
|
|
import { Dict } from 'app/entity/dict';
|
|
import { Dict } from 'app/entity/dict';
|
|
|
import { NzNotificationService, NzModalService } from 'ng-zorro-antd';
|
|
import { NzNotificationService, NzModalService } from 'ng-zorro-antd';
|
|
|
import { BasedataBaseArchivesMilestoneAddComponent } from './add/add.component';
|
|
import { BasedataBaseArchivesMilestoneAddComponent } from './add/add.component';
|
|
|
|
|
+import { BaseArchivesMilestoneService } from 'app/services/basedata/base-archives-milestone.service';
|
|
|
|
|
+import { I18NService } from '@core';
|
|
|
export interface TreeNodeInterface {
|
|
export interface TreeNodeInterface {
|
|
|
key: string;
|
|
key: string;
|
|
|
code: string;
|
|
code: string;
|
|
@@ -23,13 +25,15 @@ export interface TreeNodeInterface {
|
|
|
})
|
|
})
|
|
|
export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
constructor(private dictService: DictService, private nzNotificationService: NzNotificationService,
|
|
constructor(private dictService: DictService, private nzNotificationService: NzNotificationService,
|
|
|
- private modalService:NzModalService
|
|
|
|
|
|
|
+ private modalService:NzModalService,
|
|
|
|
|
+ private baseArchivesMilestoneService:BaseArchivesMilestoneService,
|
|
|
|
|
+ private i18NService:I18NService
|
|
|
) {}
|
|
) {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
ngOnInit() {
|
|
|
this.getTypeList();
|
|
this.getTypeList();
|
|
|
}
|
|
}
|
|
|
- listOfMapData: TreeNodeInterface[] = [];
|
|
|
|
|
|
|
+ listOfMapData:any = [];
|
|
|
//里程碑档案实体
|
|
//里程碑档案实体
|
|
|
baseArchivesMilestone: BaseArchivesMilestone = {};
|
|
baseArchivesMilestone: BaseArchivesMilestone = {};
|
|
|
|
|
|
|
@@ -47,7 +51,7 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
* 查询按钮
|
|
* 查询按钮
|
|
|
*/
|
|
*/
|
|
|
query() {
|
|
query() {
|
|
|
- if (this.baseArchivesMilestone.type) {
|
|
|
|
|
|
|
+ if (this.baseArchivesMilestone.typeId) {
|
|
|
this.getTreeList();
|
|
this.getTreeList();
|
|
|
} else {
|
|
} else {
|
|
|
this.nzNotificationService.warning('请选择类别', '');
|
|
this.nzNotificationService.warning('请选择类别', '');
|
|
@@ -58,28 +62,38 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
* 获取树形集合
|
|
* 获取树形集合
|
|
|
*/
|
|
*/
|
|
|
getTreeList() {
|
|
getTreeList() {
|
|
|
- this.listOfMapData = [
|
|
|
|
|
- {
|
|
|
|
|
- key: `1`,
|
|
|
|
|
- code: '001',
|
|
|
|
|
- name: '项目启动',
|
|
|
|
|
- type: '开发',
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- key: `1-1`,
|
|
|
|
|
- code: '001',
|
|
|
|
|
- name: '启动1',
|
|
|
|
|
- type: '开发',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- key: `2`,
|
|
|
|
|
- code: '002',
|
|
|
|
|
- name: '蓝图设计',
|
|
|
|
|
- type: '实施',
|
|
|
|
|
- },
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ this.baseArchivesMilestone.pkOrg=sessionStorage.getItem("pkOrg");//组织
|
|
|
|
|
+ this.baseArchivesMilestoneService.getTreeList(this.baseArchivesMilestone).then((response)=>{
|
|
|
|
|
+ this.listOfMapData=response.result
|
|
|
|
|
+ this.getLoding();
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ // this.listOfMapData = [
|
|
|
|
|
+ // {
|
|
|
|
|
+ // key: `1`,
|
|
|
|
|
+ // code: '001',
|
|
|
|
|
+ // name: '项目启动',
|
|
|
|
|
+ // type: '开发',
|
|
|
|
|
+ // children: [
|
|
|
|
|
+ // {
|
|
|
|
|
+ // key: `1-1`,
|
|
|
|
|
+ // code: '001',
|
|
|
|
|
+ // name: '启动1',
|
|
|
|
|
+ // type: '开发',
|
|
|
|
|
+ // },
|
|
|
|
|
+ // ],
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // key: `2`,
|
|
|
|
|
+ // code: '002',
|
|
|
|
|
+ // name: '蓝图设计',
|
|
|
|
|
+ // type: '实施',
|
|
|
|
|
+ // },
|
|
|
|
|
+ // ];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ getLoding(){
|
|
|
this.listOfMapData.forEach(item => {
|
|
this.listOfMapData.forEach(item => {
|
|
|
this.mapOfExpandedData[item.key] = this.convertTreeToList(item);
|
|
this.mapOfExpandedData[item.key] = this.convertTreeToList(item);
|
|
|
});
|
|
});
|
|
@@ -95,6 +109,7 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
nzWidth: 600,
|
|
nzWidth: 600,
|
|
|
nzComponentParams:{
|
|
nzComponentParams:{
|
|
|
// parentId:this.id
|
|
// parentId:this.id
|
|
|
|
|
+ typeId:this.baseArchivesMilestone.typeId
|
|
|
},
|
|
},
|
|
|
nzFooter: [
|
|
nzFooter: [
|
|
|
{
|
|
{
|
|
@@ -109,7 +124,9 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
type: "primary",
|
|
type: "primary",
|
|
|
// loading:this.modelSaveLoading,
|
|
// loading:this.modelSaveLoading,
|
|
|
onClick: addModel => {
|
|
onClick: addModel => {
|
|
|
- addModel.submitForm()
|
|
|
|
|
|
|
+ addModel.submitForm().then(()=>{
|
|
|
|
|
+ this.getTreeList();
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -126,7 +143,8 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
nzContent: BasedataBaseArchivesMilestoneAddComponent,
|
|
nzContent: BasedataBaseArchivesMilestoneAddComponent,
|
|
|
nzWidth: 600,
|
|
nzWidth: 600,
|
|
|
nzComponentParams:{
|
|
nzComponentParams:{
|
|
|
- parentId:item.key
|
|
|
|
|
|
|
+ parentId:item.key,
|
|
|
|
|
+ typeId:this.baseArchivesMilestone.typeId
|
|
|
},
|
|
},
|
|
|
nzFooter: [
|
|
nzFooter: [
|
|
|
{
|
|
{
|
|
@@ -141,7 +159,9 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
type: "primary",
|
|
type: "primary",
|
|
|
// loading:this.modelSaveLoading,
|
|
// loading:this.modelSaveLoading,
|
|
|
onClick: addModel => {
|
|
onClick: addModel => {
|
|
|
- addModel.submitForm()
|
|
|
|
|
|
|
+ addModel.submitForm().then(()=>{
|
|
|
|
|
+ this.getTreeList();
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -173,7 +193,9 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
type: "primary",
|
|
type: "primary",
|
|
|
// loading:this.modelSaveLoading,
|
|
// loading:this.modelSaveLoading,
|
|
|
onClick: addModel => {
|
|
onClick: addModel => {
|
|
|
- addModel.submitForm()
|
|
|
|
|
|
|
+ addModel.submitForm().then(()=>{
|
|
|
|
|
+ this.getTreeList();
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -184,7 +206,18 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
|
|
|
* 删除按钮
|
|
* 删除按钮
|
|
|
*/
|
|
*/
|
|
|
delete(id){
|
|
delete(id){
|
|
|
- alert("删除成功")
|
|
|
|
|
|
|
+ let baseArchivesMilestone=new BaseArchivesMilestone();
|
|
|
|
|
+ baseArchivesMilestone.id=id
|
|
|
|
|
+ this.baseArchivesMilestoneService.delete(baseArchivesMilestone).then((response)=>{
|
|
|
|
|
+ if (response.success) {
|
|
|
|
|
+ //删除成功
|
|
|
|
|
+ this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
|
|
|
|
|
+ this.getTreeList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //删除失败
|
|
|
|
|
+ this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////树形配置
|
|
///////////////////////////树形配置
|