Commit e958a969 authored by 徐一鸣's avatar 徐一鸣

应用列表操作

parent 22c8b3d2
......@@ -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;
}
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment