|
|
@ -52,8 +52,10 @@ export class CmsContentComponent implements OnInit { |
|
|
|
// 附件返回地址
|
|
|
|
// 附件返回地址
|
|
|
|
patchPath = ''; |
|
|
|
patchPath = ''; |
|
|
|
// 允许上传的文件类型
|
|
|
|
// 允许上传的文件类型
|
|
|
|
annexForm: FormGroup; /** 定义附件表单 **/ |
|
|
|
annexForm: FormGroup; |
|
|
|
isVisible = false; /** 是否弹出添加 **/ |
|
|
|
/** 定义附件表单 **/ |
|
|
|
|
|
|
|
isVisible = false; |
|
|
|
|
|
|
|
/** 是否弹出添加 **/ |
|
|
|
fileList = []; |
|
|
|
fileList = []; |
|
|
|
// 上传的后缀名
|
|
|
|
// 上传的后缀名
|
|
|
|
suffix = ''; |
|
|
|
suffix = ''; |
|
|
@ -150,6 +152,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
BTN_cmscontent_delete = 0; |
|
|
|
BTN_cmscontent_delete = 0; |
|
|
|
BTN_cmscontent_patch = 0; |
|
|
|
BTN_cmscontent_patch = 0; |
|
|
|
BTN_cmscontent_up_down = 0; |
|
|
|
BTN_cmscontent_up_down = 0; |
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private fb: FormBuilder, |
|
|
|
private fb: FormBuilder, |
|
|
|
private http: HttpClient, // http请求
|
|
|
|
private http: HttpClient, // http请求
|
|
|
@ -158,7 +161,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
private modalService: NzModalService, // 对话框
|
|
|
|
private modalService: NzModalService, // 对话框
|
|
|
|
private store: LocalStorageService, // 请求缓存
|
|
|
|
private store: LocalStorageService, // 请求缓存
|
|
|
|
) { |
|
|
|
) { |
|
|
|
this.WEB_SERVE_URL = environment.imageUrl; |
|
|
|
this.WEB_SERVE_URL = environment.baseUrl; |
|
|
|
this.searchCompanyId = this.store.get(ADMIN_INFO_OBJECT)['secUser']['companyId']; |
|
|
|
this.searchCompanyId = this.store.get(ADMIN_INFO_OBJECT)['secUser']['companyId']; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -167,13 +170,17 @@ export class CmsContentComponent implements OnInit { |
|
|
|
for (let i = 0; i < this.store.get(ADMIN_INFO_OBJECT)['buttonList'].length; i++) { |
|
|
|
for (let i = 0; i < this.store.get(ADMIN_INFO_OBJECT)['buttonList'].length; i++) { |
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_add') { |
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_add') { |
|
|
|
this.BTN_cmscontent_add = 1; |
|
|
|
this.BTN_cmscontent_add = 1; |
|
|
|
}if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_edit' ) { |
|
|
|
} |
|
|
|
|
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_edit') { |
|
|
|
this.BTN_cmscontent_edit = 1; |
|
|
|
this.BTN_cmscontent_edit = 1; |
|
|
|
}if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_delete' ) { |
|
|
|
} |
|
|
|
|
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_delete') { |
|
|
|
this.BTN_cmscontent_delete = 1; |
|
|
|
this.BTN_cmscontent_delete = 1; |
|
|
|
}if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_patch' ) { |
|
|
|
} |
|
|
|
|
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_patch') { |
|
|
|
this.BTN_cmscontent_patch = 1; |
|
|
|
this.BTN_cmscontent_patch = 1; |
|
|
|
}if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_up_down' ) { |
|
|
|
} |
|
|
|
|
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['buttonList'][i].permissionCode === 'BTN_cmscontent_up_down') { |
|
|
|
this.BTN_cmscontent_up_down = 1; |
|
|
|
this.BTN_cmscontent_up_down = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -204,6 +211,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.findCategoryTree(roleType); |
|
|
|
this.findCategoryTree(roleType); |
|
|
|
this.getRequest(); |
|
|
|
this.getRequest(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 重置搜索
|
|
|
|
// 重置搜索
|
|
|
|
resetSearch() { |
|
|
|
resetSearch() { |
|
|
|
// 搜索内容标题
|
|
|
|
// 搜索内容标题
|
|
|
@ -213,6 +221,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
// 分类搜索
|
|
|
|
// 分类搜索
|
|
|
|
this.searchCategoryId = ''; |
|
|
|
this.searchCategoryId = ''; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 请求列表
|
|
|
|
// 请求列表
|
|
|
|
getRequest(reset: boolean = false) { |
|
|
|
getRequest(reset: boolean = false) { |
|
|
|
this.showPatch = 0; |
|
|
|
this.showPatch = 0; |
|
|
@ -237,10 +246,12 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 搜索
|
|
|
|
// 搜索
|
|
|
|
getSearch() { |
|
|
|
getSearch() { |
|
|
|
this.getRequest(); |
|
|
|
this.getRequest(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询分类树
|
|
|
|
// 查询分类树
|
|
|
|
findCategoryTree(roleType) { |
|
|
|
findCategoryTree(roleType) { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/cmsCategory/getOwnCategoryTree?roleType=' + roleType).subscribe(data => { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/cmsCategory/getOwnCategoryTree?roleType=' + roleType).subscribe(data => { |
|
|
@ -256,11 +267,13 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 递归分类树
|
|
|
|
// 递归分类树
|
|
|
|
generateComment(data) { |
|
|
|
generateComment(data) { |
|
|
|
for (const i in data) { |
|
|
|
for (const i in data) { |
|
|
|
if (data[i].nodes == null) { |
|
|
|
if (data[i].nodes == null) { |
|
|
|
const item = { /** 重新赋值 **/ |
|
|
|
const item = { |
|
|
|
|
|
|
|
/** 重新赋值 **/ |
|
|
|
isLeaf: true, |
|
|
|
isLeaf: true, |
|
|
|
title: data[i].text, |
|
|
|
title: data[i].text, |
|
|
|
key: data[i].id, |
|
|
|
key: data[i].id, |
|
|
@ -268,7 +281,8 @@ export class CmsContentComponent implements OnInit { |
|
|
|
}; |
|
|
|
}; |
|
|
|
data[i] = item; |
|
|
|
data[i] = item; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const item = { /** 重新赋值 **/ |
|
|
|
const item = { |
|
|
|
|
|
|
|
/** 重新赋值 **/ |
|
|
|
isLeaf: false, |
|
|
|
isLeaf: false, |
|
|
|
title: data[i].text, |
|
|
|
title: data[i].text, |
|
|
|
key: data[i].id, |
|
|
|
key: data[i].id, |
|
|
@ -281,6 +295,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.nodes = data; |
|
|
|
this.nodes = data; |
|
|
|
console.log(this.nodes); |
|
|
|
console.log(this.nodes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 跳转添加
|
|
|
|
// 跳转添加
|
|
|
|
getAdd() { |
|
|
|
getAdd() { |
|
|
|
this.router.navigate(['/admin/cms/cmscontentadd'], { |
|
|
|
this.router.navigate(['/admin/cms/cmscontentadd'], { |
|
|
@ -289,6 +304,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 跳转修改
|
|
|
|
// 跳转修改
|
|
|
|
getEdit(id) { |
|
|
|
getEdit(id) { |
|
|
|
this.router.navigate(['/admin/cms/cmscontentedit'], { |
|
|
|
this.router.navigate(['/admin/cms/cmscontentedit'], { |
|
|
@ -297,6 +313,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 跳转详情
|
|
|
|
// 跳转详情
|
|
|
|
getContentView(id) { |
|
|
|
getContentView(id) { |
|
|
|
this.router.navigate(['/admin/cms/cmscontentview'], { |
|
|
|
this.router.navigate(['/admin/cms/cmscontentview'], { |
|
|
@ -305,6 +322,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 对话框删除
|
|
|
|
// 对话框删除
|
|
|
|
showDeleteConfirmDelete(id): void { |
|
|
|
showDeleteConfirmDelete(id): void { |
|
|
|
this.modalService.confirm({ |
|
|
|
this.modalService.confirm({ |
|
|
@ -314,13 +332,16 @@ export class CmsContentComponent implements OnInit { |
|
|
|
nzCancelText: '否', |
|
|
|
nzCancelText: '否', |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 删除内容
|
|
|
|
// 删除内容
|
|
|
|
deleteContent(id) { |
|
|
|
deleteContent(id) { |
|
|
|
if (id === undefined) { |
|
|
|
if (id === undefined) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
}if (id === null) { |
|
|
|
} |
|
|
|
|
|
|
|
if (id === null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
}if (id === '') { |
|
|
|
} |
|
|
|
|
|
|
|
if (id === '') { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/cmsContent/delContent?id=' + id).subscribe(data => { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/cmsContent/delContent?id=' + id).subscribe(data => { |
|
|
@ -332,6 +353,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询附件列表
|
|
|
|
// 查询附件列表
|
|
|
|
findPatchByContent(id) { |
|
|
|
findPatchByContent(id) { |
|
|
|
this.contentSelect = id; |
|
|
|
this.contentSelect = id; |
|
|
@ -345,10 +367,12 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 弹出添加附件
|
|
|
|
// 弹出添加附件
|
|
|
|
addPatch() { |
|
|
|
addPatch() { |
|
|
|
this.isVisible = true; |
|
|
|
this.isVisible = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 删除附件确认
|
|
|
|
// 删除附件确认
|
|
|
|
showDeletePatch(id) { |
|
|
|
showDeletePatch(id) { |
|
|
|
this.modalService.confirm({ |
|
|
|
this.modalService.confirm({ |
|
|
@ -358,6 +382,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
nzCancelText: '否', |
|
|
|
nzCancelText: '否', |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 删除附件
|
|
|
|
// 删除附件
|
|
|
|
deletePatch(id) { |
|
|
|
deletePatch(id) { |
|
|
|
if (id === undefined || id === null || id === '') { |
|
|
|
if (id === undefined || id === null || id === '') { |
|
|
@ -372,6 +397,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
handleCancel(): void { |
|
|
|
handleCancel(): void { |
|
|
|
this.isVisible = false; |
|
|
|
this.isVisible = false; |
|
|
@ -379,6 +405,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.fileList = []; |
|
|
|
this.fileList = []; |
|
|
|
/** 隐藏弹框 **/ |
|
|
|
/** 隐藏弹框 **/ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 附件类型选择
|
|
|
|
// 附件类型选择
|
|
|
|
getChange(event) { |
|
|
|
getChange(event) { |
|
|
|
if (event != null) { |
|
|
|
if (event != null) { |
|
|
@ -386,6 +413,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
console.log(event); |
|
|
|
console.log(event); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 附件上传设置
|
|
|
|
// 附件上传设置
|
|
|
|
customReq = (item: UploadXHRArgs) => { |
|
|
|
customReq = (item: UploadXHRArgs) => { |
|
|
|
this.patchPath = ''; // 置空路径
|
|
|
|
this.patchPath = ''; // 置空路径
|
|
|
@ -418,6 +446,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 清空 **/ |
|
|
|
/** 清空 **/ |
|
|
|
emptyForm(e: MouseEvent): void { |
|
|
|
emptyForm(e: MouseEvent): void { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
@ -427,6 +456,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.annexForm.controls[key].updateValueAndValidity(); |
|
|
|
this.annexForm.controls[key].updateValueAndValidity(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 附件弹窗确定添加按钮
|
|
|
|
// 附件弹窗确定添加按钮
|
|
|
|
handlePatchOk(value: any): void { |
|
|
|
handlePatchOk(value: any): void { |
|
|
|
// 校验类型选择与必填
|
|
|
|
// 校验类型选择与必填
|
|
|
@ -495,6 +525,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.message.create('error', `未知错误!`); |
|
|
|
this.message.create('error', `未知错误!`); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 弹出发布附件
|
|
|
|
// 弹出发布附件
|
|
|
|
addPush(id, categoryId) { |
|
|
|
addPush(id, categoryId) { |
|
|
|
this.findModuleByCategory(categoryId); |
|
|
|
this.findModuleByCategory(categoryId); |
|
|
@ -502,6 +533,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
// document.getElementById('resetPush').click();
|
|
|
|
// document.getElementById('resetPush').click();
|
|
|
|
this.isPublish = true; |
|
|
|
this.isPublish = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 取消发布
|
|
|
|
// 取消发布
|
|
|
|
handleCancelPush(): void { |
|
|
|
handleCancelPush(): void { |
|
|
|
this.isPublish = false; |
|
|
|
this.isPublish = false; |
|
|
@ -509,6 +541,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.pushId = ''; |
|
|
|
this.pushId = ''; |
|
|
|
/** 隐藏弹框 **/ |
|
|
|
/** 隐藏弹框 **/ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 附件弹窗确定添加按钮
|
|
|
|
// 附件弹窗确定添加按钮
|
|
|
|
handlePushOk(value: any): void { |
|
|
|
handlePushOk(value: any): void { |
|
|
|
console.log('发布'); |
|
|
|
console.log('发布'); |
|
|
@ -545,6 +578,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.message.create('error', `未知错误!`); |
|
|
|
this.message.create('error', `未知错误!`); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 清空模板 **/ |
|
|
|
/** 清空模板 **/ |
|
|
|
emptyPushForm(e: MouseEvent): void { |
|
|
|
emptyPushForm(e: MouseEvent): void { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
@ -554,6 +588,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
this.pushForm.controls[key].updateValueAndValidity(); |
|
|
|
this.pushForm.controls[key].updateValueAndValidity(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 根据内容分类查询可使用的模板列表
|
|
|
|
// 根据内容分类查询可使用的模板列表
|
|
|
|
findModuleByCategory(categoryId) { |
|
|
|
findModuleByCategory(categoryId) { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/cmsCategoryModule/getModuleByCategoryId?categoryId=' + categoryId).subscribe(data => { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/cmsCategoryModule/getModuleByCategoryId?categoryId=' + categoryId).subscribe(data => { |
|
|
@ -574,6 +609,7 @@ export class CmsContentComponent implements OnInit { |
|
|
|
nzCancelText: '否', |
|
|
|
nzCancelText: '否', |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 下线
|
|
|
|
// 下线
|
|
|
|
DownContent(id) { |
|
|
|
DownContent(id) { |
|
|
|
// 定义附件数据
|
|
|
|
// 定义附件数据
|
|
|
|