{"id":2153,"date":"2024-02-23T11:40:01","date_gmt":"2024-02-23T03:40:01","guid":{"rendered":"http:\/\/www.plm.cn\/?p=2153"},"modified":"2024-02-29T11:39:47","modified_gmt":"2024-02-29T03:39:47","slug":"%e5%9f%ba%e4%ba%8emobox%e5%af%b9gungho%e4%bb%bb%e5%8a%a1%e4%ba%8c%e6%ac%a1%e5%bc%80%e5%8f%91%e7%9a%84%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"http:\/\/www.plm.cn\/2153\/","title":{"rendered":"\u57fa\u4e8eMobox\u5bf9Gungho\u4efb\u52a1\u4e8c\u6b21\u5f00\u53d1\u7684\u5b9e\u73b0"},"content":{"rendered":"
<\/p>\n
Gungho\u9879\u76ee\u7ba1\u7406\u8f6f\u4ef6\u5728\u4f01\u4e1a\u90e8\u7f72\u7684\u65f6\u5019\u56e0\u5176\u4e1a\u52a1\u7684\u4e2a\u6027\uff0c\u5f88\u6709\u53ef\u80fd\u9700\u8981\u5bf9\u4efb\u52a1\u505a\u5404\u79cd\u5404\u6837\u7684\u4e8c\u6b21\u5f00\u53d1\uff0c\u4ece\u800c\u9002\u5e94\u4f01\u4e1a\u9700\u6c42<\/p>\n
<\/p>\n
\u4e3e\u4f8b\uff1a<\/strong><\/p>\n \u67d0\u68c0\u6d4b\u68c0\u9a8c\u4e2d\u5fc3\uff0c\u5728\u505a\u53c9\u8f66\u6574\u8f66\u68c0\u6d4b\u7684\u65f6\u5019\u4f1a\u5206\u89e3\u51fa100\u591a\u4e2a\u7684\u68c0\u6d4b\u4efb\u52a1\uff0c\u6bcf\u4e00\u4e2a\u4efb\u52a1\u9664\u4e86\u8981\u6c42\u5458\u5de5\u6309\u65f6\u95f4\u8981\u6c42\u5b8c\u6210\u4ee5\u5916\uff0c\u8fd8\u9700\u5c06\u6bcf\u4e2a\u68c0\u6d4b\u4efb\u52a1\u6240\u83b7\u53d6\u7684\u6570\u636e\u7b49\u7ea7\u4e0b\u6765\u3002\u8fd9\u4e2a\u6570\u636e\u53ef\u80fd\u662f\u4e00\u4e2a\u8868\uff0c\u800c\u4e14\u6bcf\u4e00\u4e2a\u4efb\u52a1\u6240\u5bf9\u5e94\u7684\u586b\u5199\u6570\u636e\u4e5f\u90fd\u662f\u4e0d\u4e00\u6837\u7684\u3002<\/p>\n \u8fd9\u6837\u4e00\u4e2a\u9700\u6c42\uff0c\u6211\u4eec\u5c31\u5fc5\u987b\u5bf9\u4efb\u52a1\u505a\u4e8c\u6b21\u5f00\u53d1<\/p>\n <\/p>\n \u7528sa \u767b\u5f55Mobox\u5e73\u53f0\uff0c\u8fdb\u5165\u7cfb\u7edf\u7ba1\u7406\u6a21\u5757<\/p>\n <\/p>\n <\/p>\n \u5b9a\u4e49\u7684\u4efb\u52a1\u7c7b\u578b\u540d\u79f0\uff0c\u5728\u540e\u9762\u4f1a\u7528\u5230<\/p>\n <\/p>\n \u5f00\u53d1\u4e00\u4e2a\u811a\u672c\uff1a\u4efb\u52a1\u70b9\u51fb\u540e \u811a\u672c \uff08\u76ee\u7684\u662f \u4efb\u52a1\u70b9\u51fb\u540e\u80fd\u5c06 prj_id\uff0ctask_id \u7b49\u8bbe\u7f6e\u5230\u5168\u5c40\u53d8\u91cf\uff09<\/p>\n <\/p>\n \u8fd9\u4e2a\u4efb\u52a1\u70b9\u51fb\u540e\uff08lua\u811a\u672c\uff09\u662f\u6807\u51c6\u7684<\/p>\n <\/p>\n mobox = require(“OILua_JavelinExt”)<\/span><\/p>\n require(“oi_basestrfunc”)<\/span><\/p>\n <\/p>\n function AfterClickTask(strLuaDEID)<\/span><\/p>\n \u00a0\u00a0\u00a0 local nRet, strRetInfo, strTaskID,strClsID<\/span><\/p>\n <\/p>\n \u00a0\u00a0\u00a0\u00a0 –\u83b7\u53d6\u5f53\u524d\u70b9\u4e2d\u7684\u4efb\u52a1\u5bf9\u8c61\u6807\u8bc6<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0 nRet, strClsID, strTaskID = mobox.getCurEditDataObjID( strLuaDEID )<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0 if ( nRet ~=0 ) then<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mobox.error( strLuaDEID, “\u83b7\u53d6\u5f53\u524d\u70b9\u4e2d\u4efb\u52a1\u5bf9\u8c61\u6807\u8bc6\u5931\u8d25!” )<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0 end<\/span><\/p>\n \u00a0\u00a0\u00a0 –\u83b7\u53d6\u4efb\u52a1\u5185\u5bb9<\/span><\/p>\n \u00a0\u00a0\u00a0 nRet, strRetInfo = mobox.getTaskAttr(strLuaDEID,strTaskID, “CN_G_PRJ_ID”)<\/span><\/p>\n \u00a0\u00a0\u00a0 if (nRet ~= 0) then<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mobox.error(strLuaDEID, strRetInfo)<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return<\/span><\/p>\n \u00a0\u00a0\u00a0 end<\/span><\/p>\n \u00a0\u00a0\u00a0 local taskAttr = json.decode(strRetInfo)<\/span><\/p>\n \u00a0\u00a0\u00a0 local strPrjID = taskAttr[1].value<\/span><\/p>\n <\/p>\n \u00a0\u00a0\u00a0 if (strPrjID == nil or strPrjID == nil) then<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mobox.error(strLuaDEID, “\u83b7\u53d6\u9879\u76ee\u4fe1\u606f\u5931\u8d25!”)<\/span><\/p>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return<\/span><\/p>\n \u00a0\u00a0\u00a0 end<\/span><\/p>\n \u00a0\u00a0\u00a0 –\u53bb\u6389\u7a7a\u683c<\/span><\/p>\n \u00a0\u00a0\u00a0 strPrjID = trim_guid_str(strPrjID)<\/span><\/p>\n \u00a0\u00a0\u00a0 — \u628a\u9879\u76eeID \uff0c\u4efb\u52a1ID \u52a0\u5165\u5168\u5c40\u53d8\u91cf<\/span><\/p>\n \u00a0\u00a0\u00a0 local strGlobalAttrs = ‘{“attr”:”prj<\/span>_id”,”value”:”‘ .. strPrjID .. ‘”}’<\/span><\/p>\n \u00a0\u00a0\u00a0 strGlobalAttrs = strGlobalAttrs .. ‘,{“attr”:”task_id<\/span>“,”value”:”‘ .. strTaskID .. ‘”}’<\/span><\/p>\n \u00a0\u00a0\u00a0 local strAction = ‘[{“action_type”:”set_global_attr”,”value”:[‘ .. strGlobalAttrs .. ‘]}]’<\/span><\/p>\n \u00a0\u00a0\u00a0 mobox.setAction(strLuaDEID, strAction)<\/span><\/p>\n end<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n \u8fd9\u4e2a\u811a\u672c\u76ee\u7684\u662f\u751f\u6210 \u5168\u5c40\u53d8\u91cf<\/span>\uff1aprj_id<\/span> , task_id<\/span> \u3002 \u8fd92\u4e2a\u53d8\u91cf\u63cf\u8ff0\u4e86\u5f53\u524d\u4efb\u52a1\u6240\u5c5e\u9879\u76ee\u552f\u4e00\u6807\u8bc6<\/span>\uff0c\u53ca<\/span>\u4efb\u52a1\u552f\u4e00\u6807\u8bc6<\/span>\u3002\u662fGungho\u7cfb\u7edf\u5411Mobox\u5e73\u53f0\u4f20\u9012\u6838\u5fc3\u53c2\u6570\uff0cMobox\u540e\u671f\u4e8c\u6b21\u5f00\u53d1\u7684\u65f6\u5019\u90fd\u9700\u8981\u7528\u5230\u3002<\/p>\n \u6ce8\u610f\uff0c\u8fd9\u91cc\u5b9a\u4e49\u7684\u5168\u5c40\u53d8\u91cf<\/span> \u540d\u79f0\u5728\u540e\u671f\u8c03\u7528\u7684\u662f\u8981\u5b8c\u5168\u4e00\u6837<\/p>\n \u8fd9\u4e2a\u811a\u672c\uff0c\u4f1a\u5728\u540e\u9762\u6587\u7ae0\u7684\uff1a\u4efb\u52a1\u5206\u7c7b\u5b9a\u4e49<\/span> –\u00a0 \u4e8b\u4ef6<\/span> \uff08\u70b9\u51fb\u540e\u4e8b\u4ef6<\/span>\u7528\u5230\uff09 \u53c2\u8003<\/p>\n <\/p>\n <\/p>\n \u6309\u9700\u5206\u522b\u5b9a\u4e49\u6570\u636e\u6a21\u578b\uff0c\u53ca\u6a21\u578b\u91cc\u9762\u7684\u5b57\u6bb5\u3002\u8fd9\u91cc\u4e0d\u8be6\u7ec6\u5c55\u5f00\uff08\u9700\u8981\u6709mobox\u4e8c\u6b21\u5f00\u7ecf\u9a8c\uff09<\/p>\n <\/p>\n <\/p>\n \u5b9a\u4e49\u5c0f\u7a97\u53e3<\/span>\u7684\u65f6\u5019\u9700\u8981\u6ce8\u610f\uff0c\u6709\u4e00\u4e2a\u7a97\u53e3\u521d\u59cb\u5316\u811a\u672c\u8981\u6267\u884c\uff08\u76ee\u7684\u662f\u4e2a\u5c0f\u7a97\u53e3\u5185\u8bbe\u7f6eprj_id, task_id\uff09<\/p>\n <\/p>\n <\/p>\n \u56e0\u4e3a\u662f\u4e0eGungho\u96c6\u6210\uff0c\u524d\u9762\u63cf\u8ff0\u8fc7gungho\u7684\u5168\u5c40\u53d8\u91cf\uff0c\u8fd9\u91cc\u5f00\u53d1\u7684\u65f6\u5019\u5df2\u7ecf\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\uff08prj_id , task_id\uff09<\/p>\n \u6839\u636e\u9700\u6c42\uff0c\u56f4\u7ed5\u6570\u636e\u6a21\u578b\u505a\u4e8c\u6b21\u5f00\u53d1\uff08\u53ef\u80fd\u6709\u5f88\u591a\u8fc7\u4e2a\u811a\u672c\uff0c\u6309\u9700\u6c42\u5f00\u53d1\uff09\u6bd4\u5982<\/p>\n 1\uff09\u67e5\u8be2\u4e8b\u4ef6 \uff08\u6211\u4eec\u7684\u6269\u5c55\u5c5e\u6027\uff0c\u662f\u4e0e\u4efb\u52a1\u7ed1\u5b9a\u7684\uff0c\u6240\u4ee5\u9700\u8981\u67e5\u51fa\u4e0e\u672c\u4efb\u52a1\u6709\u5173\u7684\u5c5e\u6027 \u5982 \u4efb\u52a1ID\u8fc7\u6ee4 \uff09<\/p>\n <\/p>\n \u56e0\u4e3a\u662f\u4e0eGungho\u96c6\u6210\uff0c\u524d\u9762\u63cf\u8ff0\u8fc7gungho\u7684\u5168\u5c40\u53d8\u91cf\uff0c\u8fd9\u91cc\u5f00\u53d1\u7684\u65f6\u5019\u5df2\u7ecf\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\uff08prj_id , task_id<\/span>\uff09<\/p>\n 2\uff09\u521d\u59cb\u5316\u811a\u672c \uff08\u56e0\u4e3a\u9700\u8981\u4e0eGungho\u7684\u4efb\u52a1\u96c6\u6210\uff0c\u5b9a\u4e49\u754c\u9762\uff08\u5c0f\u7a97\u53e3\u7684\u65f6\u5019\u9700\u8981\u5b9a\u4e49\u521d\u59cb\u5316\u811a\u672c \u5982 \u8bbe\u7f6e\u9879\u76ee\u53ca\u4efb\u52a1ID<\/span> \uff09<\/p>\n <\/p>\n <\/p>\n \u4efb\u52a1\u6269\u5c55\u5c5e\u6027\u4fe1\u606f\u7684grid\u5c55\u793a\uff08\u67e5\u8be2\u4e8b\u4ef6\uff09\u3001\u5c0f\u7a97\u53e3\u6570\u636e\u7684\u8f93\u5165\u4fdd\u5b58\uff08\u9700\u8981\u7ed1\u5b9atask_id\u7b49\uff09<\/p>\n <\/p>\n <\/p>\n \u4efb\u52a1\u5206\u7c7b\u5b9a\u4e49\uff0c\u662fgungho\u7684\u4efb\u52a1\u4e0eMobox\u7684\u529f\u80fd\u70b9\u96c6\u5408\u7684\u4e00\u4e2a\u8fc7\u7a0b<\/p>\n <\/p>\n <\/p>\n \u6ce8\u610f\uff1a\u6570\u91cf\u9650\u5236 \u5fc5\u987b\u9009\u62e9 \u591a\u6570\u636e<\/span>\uff0c \u663e\u793a\u65b9\u5f0f\u5fc5\u987b\u9009\u62e9 \u81ea\u5b9a\u4e49\u9875\u9762<\/span><\/p>\n <\/p>\n \u6ce8\u610f\uff1a\u70b9\u51fb\u4efb\u52a1\u540e\u4e8b\u4ef6<\/span> \u662f\u5fc5\u987b\u9009\u62e9\uff08 \u6765\u6e90\uff1a gungho\u9886\u57df – TASK\u4efb\u52a1 – \u67d0\u81ea\u5b9a\u4e49\u4e8b\u4ef6\uff09<\/p>\n <\/p>\n \u81ea\u5b9a\u4e49\u91cc\u9762\u662f\u5c06\u4efb\u52a1\u4e0eMobox\u7684\u529f\u80fd\u70b9\u96c6\u5408\u5728\u4e00\u8d77<\/p>\n \u6309\u4e0a\u56fe\uff0cA2\u6837\u54c1\u6280\u672f\u53c2\u6570<\/span>\uff0c\u8fd9\u7c7b\u4efb\u52a1\uff0c\u7ed1\u5b9a\u4e862\u4e2a\u529f\u80fd\u70b9<\/p>\n <\/p>\n \u7ed1\u5b9a\u4e862\u4e2a\u529f\u80fd\u70b9<\/strong><\/p>\n \u00a0 <\/strong>1 \u4e2a\u7528\u4e8e\u6280\u672f\u53c2\u6570\u8f93\u5165 \uff08\u53ef\u80fd\u662f\u4e00\u4e2a\u8868\uff09<\/p>\n 1 \u4e2a\u7528\u4e8e\u68c0\u6d4b\u7ed3\u679c\u8f93\u5165<\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" \u57fa\u4e8eMobox\u5bf9Gungho\u4efb\u52a1\u4e8c\u6b21\u5f00\u53d1\u7684\u5b9e\u73b0 Gungho\u9879\u76ee\u7ba1\u7406\u8f6f\u4ef6\u5728\u4f01\u4e1a\u90e8\u7f72\u7684\u65f6\u5019\u56e0\u5176\u4e1a\u52a1 […]<\/p>\n","protected":false},"author":1,"featured_media":2103,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9,1,34],"tags":[31,13],"class_list":["post-2153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plmcenter","category-pcdoc","category-didaima","category-pmgl","tag-didaima","tag-shouche"],"_links":{"self":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/comments?post=2153"}],"version-history":[{"count":7,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2153\/revisions"}],"predecessor-version":[{"id":2212,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2153\/revisions\/2212"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media\/2103"}],"wp:attachment":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media?parent=2153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/categories?post=2153"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/tags?post=2153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\u5b9e\u73b0\u8fc7\u7a0b\u5982\u4e0b<\/h3>\n
\n
\n
\n
\n\n
\n <\/td>\n<\/tr>\n \n <\/td>\n \n \n\n
\n json\u00a0\u00a0 = require(“json”)<\/span><\/p>\n \n
\n
\n
\n
\n
\n
\n
\n