* 状态启用禁用修改

This commit is contained in:
Kevin 2023-10-06 17:18:37 +08:00
parent f27241251c
commit 432b41799d
3 changed files with 5 additions and 4 deletions

View File

@ -11,6 +11,7 @@ const (
StatusEnabled int = 1 // 启用 StatusEnabled int = 1 // 启用
StatusDisable int = 2 // 禁用 StatusDisable int = 2 // 禁用
StatusDelete int = 3 // 已删除 StatusDelete int = 3 // 已删除
StatusOFF int = 0 // 禁用
) )
var StatusSlice = []int{StatusALL, StatusEnabled, StatusDisable, StatusDelete} var StatusSlice = []int{StatusALL, StatusEnabled, StatusDisable, StatusDelete, StatusOFF}

View File

@ -112,7 +112,7 @@ func (in *@{.varName}StatusInp) Filter(ctx context.Context) (err error) {
return return
} }
if in.Status <= 0 { if in.Status < 0 {
err = gerror.New("状态不能为空") err = gerror.New("状态不能为空")
return return
} }

View File

@ -123,7 +123,7 @@
},@{end} },@{end}
@{ if eq .options.Step.HasStatus true } { @{ if eq .options.Step.HasStatus true } {
label: '禁用', label: '禁用',
onClick: handleStatus.bind(null, record, 2), onClick: handleStatus.bind(null, record, 0),
ifShow: () => { ifShow: () => {
return record.status === 1; return record.status === 1;
}, },
@ -133,7 +133,7 @@
label: '启用', label: '启用',
onClick: handleStatus.bind(null, record, 1), onClick: handleStatus.bind(null, record, 1),
ifShow: () => { ifShow: () => {
return record.status === 2; return record.status === 0;
}, },
auth: ['/@{.apiPrefix}/status'], auth: ['/@{.apiPrefix}/status'],
},@{end} },@{end}