From 4a054905855fc38a31aa7de242c5f198e70f02d4 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 28 Apr 2022 16:58:58 +0800 Subject: [PATCH] edit --- .../sms-template/sms-template.component.html | 9 +++--- .../sms-template/sms-template.component.ts | 30 +++++++++---------- .../sys-setting/sys-setting-routing.module.ts | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/app/routes/sys-setting/components/sms-template/sms-template.component.html b/src/app/routes/sys-setting/components/sms-template/sms-template.component.html index 2b413ab5..41716b59 100644 --- a/src/app/routes/sys-setting/components/sms-template/sms-template.component.html +++ b/src/app/routes/sys-setting/components/sms-template/sms-template.component.html @@ -2,7 +2,7 @@
- +
- + - + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/sms-template/sms-template.component.ts b/src/app/routes/sys-setting/components/sms-template/sms-template.component.ts index 43d1df9c..7adb409a 100644 --- a/src/app/routes/sys-setting/components/sms-template/sms-template.component.ts +++ b/src/app/routes/sys-setting/components/sms-template/sms-template.component.ts @@ -1,4 +1,3 @@ - import { AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; @@ -23,7 +22,7 @@ export class SmsTemplateComponent implements OnInit { isVisible = false; tempData = {}; isEdit = false; - + searchSchema: SFSchema = { properties: { templateName: { @@ -50,27 +49,27 @@ export class SmsTemplateComponent implements OnInit { templateName: { type: 'string', title: '模板名称', - ui: { placeholder: '请输入模板名称', errors: { require: '必填项'} } + ui: { placeholder: '请输入模板名称', errors: { require: '必填项' } } }, templateCode: { type: 'string', title: '模板编码', readOnly: this.isEdit, - ui: { placeholder: '请输入模板编码', errors: { require: '必填项'} } + ui: { placeholder: '请输入模板编码', errors: { require: '必填项' } } }, templateContent: { type: 'string', title: '模板内容', - ui: { placeholder: '请输入模板内容', errors: { require: '必填项'} } + ui: { placeholder: '请输入模板内容', errors: { require: '必填项' } } } }, - required: ['templateName','templateCode','templateContent'] - } + required: ['templateName', 'templateCode', 'templateContent'] + }; } columns: STColumn[] = [ - { title: '模板名称', className: 'text-center', index: 'templateName' }, - { title: '模板编码', className: 'text-center', index: 'templateCode' }, + { title: '模板名称', className: 'text-center', width: '200px', index: 'templateName' }, + { title: '模板编码', className: 'text-center', width: '140px', index: 'templateCode' }, { title: '模板内容', className: 'text-center', index: 'templateContent' }, // { // title: '创建人', className: 'text-center', index: 'content', @@ -79,21 +78,23 @@ export class SmsTemplateComponent implements OnInit { title: '更新时间', index: 'modifyTime', type: 'date', + width: '160px', className: 'text-center' }, { title: '操作', + width: '90px', buttons: [ { text: '编辑', - click: i => this.edit(i), + acl: { ability: ['SMS_TEMPLATE-save'] }, + click: i => this.edit(i) } ] } ]; - constructor(public service: SystemService, private nzModalService: NzModalService, private route: ActivatedRoute) { - } + constructor(public service: SystemService, private nzModalService: NzModalService, private route: ActivatedRoute) {} ngOnInit(): void { this.initSF(); @@ -144,7 +145,7 @@ export class SmsTemplateComponent implements OnInit { templateCode, templateName, templateContent - } + }; this.service.request(this.service.$api_smsTemplate_edit, params).subscribe(res => { // console.log(res); @@ -152,8 +153,7 @@ export class SmsTemplateComponent implements OnInit { this.isVisible = false; this.st.reload(); } - }) - + }); } handleCancel(): void { diff --git a/src/app/routes/sys-setting/sys-setting-routing.module.ts b/src/app/routes/sys-setting/sys-setting-routing.module.ts index 3eb42854..17f14f29 100644 --- a/src/app/routes/sys-setting/sys-setting-routing.module.ts +++ b/src/app/routes/sys-setting/sys-setting-routing.module.ts @@ -56,7 +56,7 @@ const routes: Routes = [ // { path: 'btn-management', component: BtnManagementComponent }, { path: 'announcement-message', component: AnnouncementMessageComponent }, { path: 'insurance-set', component: InsuranceSetComponent }, - { path: 'sms-template', component: SmsTemplateComponent } + { path: 'sms-template', component: SmsTemplateComponent, data: { guard: { ability: ['SMS_TEMPLATE-search'] } } } ]; @NgModule({