Default Changelist

pull/1/head
袁野 3 years ago
parent 7ee96fa41a
commit 209459d4de
  1. 58
      src/app/admin/cms/cms-content/cms-content.component.ts
  2. 8
      src/environments/environment.ts

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

@ -4,10 +4,10 @@
export const environment = {
production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'http://localhost:9302/filesystem/',
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'http://localhost:9302/filesystem/',
// baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
};

Loading…
Cancel
Save