diff --git a/src/pages/workbench/yygl/yyglList.vue b/src/pages/workbench/yygl/yyglList.vue index 3c81979aad54ed557707c5e6197c91e723ead85f..5a582c87e2cf544417837c7d584883af3ed9873f 100644 --- a/src/pages/workbench/yygl/yyglList.vue +++ b/src/pages/workbench/yygl/yyglList.vue @@ -341,19 +341,45 @@ export default { actionList: [ { getLabel(item) { - return item.online_state == 0 ? "上架" : "下架"; + if (item.online_state == 0) { + return "上架"; + } else { + return "下架"; + } }, callback(item) { - item.online_state == 0 - ? _self.soldUpItem(item) - : _self.soldOutItem(item); + if ( + item.online_state == 0 && // 未上架 + item.up_deploy_status == 1 && // 申请上架中 + item.up_platform_status == 0 // 未上线 + ) { + return _self.soldUpItem(item); // 上架的操作 + } else if ( + item.online_state == 1 && // 开发者应用 + item.up_deploy_status == 3 && // 申请下架中 + item.up_platform_status == 0 // 未上线 + ) { + return _self.soldOutItem(item); // 下架的操作 + } + + return null; }, disabledRule(item) { - return ( - item.online_state == 2 || - item.up_deploy_status == 0 || - item.up_deploy_status == 2 - ); + if ( + item.online_state == 0 && // 未上架 + item.up_deploy_status == 1 && // 申请上架中 + item.up_platform_status == 0 // 未上线 + ) { + return false; // 可上架 + } else if ( + item.online_state == 1 && // 开发者应用 + item.up_deploy_status == 3 && // 申请下架中 + item.up_platform_status == 0 // 未上线 + ) { + return false; // 可下架 + } + + return true; }, }, ], @@ -649,18 +675,44 @@ export default { }, { getLabel(item) { - return item.online_state == 0 ? "上线" : "下线"; + if (item.online_state == 2) { + return "下线"; + } else { + return "上线"; + } }, callback(item) { - item.online_state == 0 - ? _self.onLine(item) - : _self.offLine(item); + if ( + item.online_state == 1 && // 开发者应用 + item.up_deploy_status == 2 && // 已上架 + item.up_platform_status == 1 // 申请上线中 + ) { + return _self.onLine(item); // 上线的操作 + } else if ( + item.online_state == 2 && // 平台应用 + item.up_deploy_status == 2 && // 已上架 + item.up_platform_status == 3 // 申请下线中 + ) { + return _self.offLine(item); // 下线的操作 + } else { + return null; + } }, disabledRule(item) { - if (item.online_state == 0) { - return item.up_platform_status != 0; + if ( + item.online_state == 1 && + item.up_deploy_status == 2 && + item.up_platform_status == 1 + ) { + return false; // 可上线 + } else if ( + item.online_state == 2 && + item.up_deploy_status == 2 && + item.up_platform_status == 3 + ) { + return false; // 可下线 } else { - return item.up_platform_status != 2; + return true; } }, },