前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >react中常规删除功能

react中常规删除功能

作者头像
botkenni
发布2020-02-11 16:57:08
5760
发布2020-02-11 16:57:08
举报
文章被收录于专栏:IT码农IT码农

// 删除

handleDeleteNiche = async () => {

// 方法一:

// let title = '删除';

// let message = ( <div><p > 商机删除后列表将不可见此商机, 请谨慎操作! </p> </div>);

// let ret = await this.confirmModal(title, message);

// ret && this.deleteNiche();

// };

// deleteNiche = async () => {

// const res = await this.webapi.sellFlow.deleteNiche({

// nicheIds: [this.component.props.nicheId || 0]

// });

// if (res.result) {

// this.message.success('操作成功!');

// this.reload();

// } else {

// this.message.error('操作失败!');

// }

// 方法二:

let id = this.base.gs('data.nicheId');

let ret = await this.modal.show({

title: '删除',

centered: true,

className: 'delete-modal',

width: 600,

children: ( <p> 删除后列表将不可见, 请谨慎操作! </p>),

})

if (!ret)

return

let resp = await this.webapi.sellFlow.deleteNiche({

nicheIds: [id || 0]

});

if (resp.result) {

this.message.success('操作成功!');

this.component.props.modalOk(true);

}

};

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档