layout.addReady(function(){ (function(layout){ var uri = new URI(window.location.href); var options = uri.get("data"); var app = uri.getData("app"); var form = uri.getData("form"); options.form = { "app": app, "id": form }; var appNames = "process.Work"; var statusObj = null; var _load = function(){ // layout.message = new MWF.xDesktop.MessageMobile(); // layout.message.load(); layout.apps = []; //layout.node = $("layout"); layout.node = $("layout") || $("appContent") || document.body; var appName=appNames, m_status=statusObj, option=options; var topWindow = window.opener; if (topWindow){ try{ if (!appName) appName = topWindow.layout.desktop.openBrowserApp; if (!m_status) m_status = topWindow.layout.desktop.openBrowserStatus; if (!option) option = topWindow.layout.desktop.openBrowserOption; }catch(e){} } if (options.job && !options.workid){ var workData = null; o2.Actions.get("x_processplatform_assemble_surface").listWorkByJob(options.job, function(json){ if (json.data) workData = json.data; }.bind(this), null, false); if (workData){ var len = workData.workList.length + workData.workCompletedList.length; if (len){ if (len>1 && options.choice){ layout.node.empty(); layout.node.setStyle("background", "#f1f1f1"); var node = new Element("div", { "styles": {"font-size": "18px", "text-align": "center", "font-weight": "bold", "margin": "auto", "height": "30px", "width": "90%", "max-width": "600px", "padding": "40px 0px 20px 20px"}, "text": o2.LP.widget.choiceWork }).inject(layout.node); var node = new Element("div", {"styles": {"margin": "auto", "padding": "0px 20px", "width": "90%", "max-width": "600px"}}).inject(layout.node); workData.workList.each(function(work){ var workNode = new Element("div", { "styles": { "background": "#ffffff", "border-radius": "10px", "clear": "both", "margin-bottom": "10px", "height": "40px", "padding": "10px 10px" } }).inject(node); var html = "
" + "