fix bug
This commit is contained in:
@ -21,7 +21,7 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
sf!: SFComponent;
|
||||
spuStatus = '1';
|
||||
|
||||
data=[{name1:1111}]
|
||||
data = [{ name1: 1111 }];
|
||||
constructor(
|
||||
public router: Router,
|
||||
public ar: ActivatedRoute,
|
||||
@ -45,21 +45,25 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
properties: {
|
||||
gradeName: {
|
||||
type: 'string',
|
||||
title: '等级姓名',
|
||||
title: '等级姓名'
|
||||
},
|
||||
stateLocked: {
|
||||
type: 'string',
|
||||
title: '状态',
|
||||
enum:[{label:'启用',value:'1'},{label:'禁用',value:'0'}],
|
||||
ui:{
|
||||
widget:'select',
|
||||
enum: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '启用', value: '1' },
|
||||
{ label: '禁用', value: '0' }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select'
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
this.ui = {
|
||||
'*': {
|
||||
width:300,
|
||||
width: 300,
|
||||
grid: { span: 12, gutter: 4 }
|
||||
}
|
||||
};
|
||||
@ -79,6 +83,10 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
title: '创建时间',
|
||||
index: 'createTime'
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
index: 'sortId'
|
||||
},
|
||||
{
|
||||
title: '启用时间',
|
||||
index: 'enableTime'
|
||||
@ -87,7 +95,7 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
title: '状态',
|
||||
index: 'stateLocked',
|
||||
format: (item: any) => {
|
||||
return item.stateLocked ? '禁用':'启用'
|
||||
return item.stateLocked ? '启用' : '禁用';
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -96,17 +104,17 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
buttons: [
|
||||
{
|
||||
text: '编辑',
|
||||
click: (_record, _modal, _instance) => this.edit(_record),
|
||||
click: (_record, _modal, _instance) => this.edit(_record)
|
||||
},
|
||||
{
|
||||
text: '禁用',
|
||||
click: (_record, _modal, _instance) => this.stop(_record),
|
||||
iif:(item)=>!item.stateLocked
|
||||
iif: item => !item.stateLocked
|
||||
},
|
||||
{
|
||||
text: '启用',
|
||||
click: (_record, _modal, _instance) => this.restart(_record),
|
||||
iif:(item)=>item.stateLocked
|
||||
iif: item => item.stateLocked
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -115,7 +123,7 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
|
||||
add() {
|
||||
const modalRef = this.modalService.create({
|
||||
nzWidth:500,
|
||||
nzWidth: 500,
|
||||
nzTitle: '新增',
|
||||
nzContent: ParterLevelConfigEditComponent,
|
||||
nzComponentParams: { type: this.spuStatus }
|
||||
@ -130,7 +138,7 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
// 编辑
|
||||
edit(record: STData) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzWidth:500,
|
||||
nzWidth: 500,
|
||||
nzTitle: '编辑',
|
||||
nzContent: ParterLevelConfigEditComponent,
|
||||
nzComponentParams: { i: record, type: this.spuStatus }
|
||||
@ -142,8 +150,8 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// 编辑
|
||||
view(record: STData) {
|
||||
// 编辑
|
||||
view(record: STData) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '查看',
|
||||
nzContent: ParterLevelConfigEditComponent,
|
||||
@ -156,7 +164,7 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
nzTitle: '<i>启用确认</i>',
|
||||
nzContent: `<b>确定启用该账号吗?</br>`,
|
||||
nzOnOk: () =>
|
||||
this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => {
|
||||
this.service.request(this.service.$api_updatePartnerGradeConfig, { id: item.id }).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('启用成功!');
|
||||
this.st.reload();
|
||||
@ -169,7 +177,7 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
nzTitle: '<i>禁用确认</i>',
|
||||
nzContent: `<b>确定禁用该账号吗?</br>`,
|
||||
nzOnOk: () =>
|
||||
this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => {
|
||||
this.service.request(this.service.$api_updatePartnerGradeConfig, { id: item.id }).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('禁用成功!');
|
||||
this.st.reload();
|
||||
@ -185,6 +193,4 @@ export class ParterLevelConfigListComponent implements OnInit {
|
||||
this.sf.reset();
|
||||
this.st.load(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user