{"id":2590,"date":"2024-04-18T11:06:07","date_gmt":"2024-04-18T03:06:07","guid":{"rendered":"http:\/\/www.plm.cn\/?p=2590"},"modified":"2024-04-18T11:06:07","modified_gmt":"2024-04-18T03:06:07","slug":"mobox-3000%e5%8a%9f%e8%83%bd%e7%82%b9%e9%a1%b5%e9%9d%a2%e6%8c%89%e9%92%ae%e9%9a%90%e8%97%8f%e7%9a%84lua%e5%ae%9e%e7%8e%b0%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.plm.cn\/2590\/","title":{"rendered":"Mobox 3000\u529f\u80fd\u70b9\u9875\u9762\u6309\u94ae\u9690\u85cf\u7684lua\u5b9e\u73b0\u65b9\u6cd5"},"content":{"rendered":"
\u9700\u6c42\uff0c\u6211\u4eec\u6709\u4e00\u4e2a\u4efb\u52a1\u6267\u884c\u540e\uff0c\u9700\u8981\u5bf9\u8fd9\u4e2a\u4efb\u52a1\u505a\u540e\u505a\u8bc4\u4ef7\u3002\u4e3a\u6b64\u4e0e\u4efb\u52a1\u7cfb\u7edf\u96c6\u6210\u901a\u8fc73000\u529f\u80fd\u70b9\u5b9a\u4e49\u4e86\u4e00\u4e2a\u4efb\u52a1\u8bc4\u5206\u7684\u529f\u80fd\u70b9\u3002\u4efb\u52a1\u8bc4\u5206\u540e\uff0c\u4e0d\u80fd\u901a\u8fc7\u65b0\u589e\uff0c\u5bf9\u8fd9\u4e2a\u4efb\u52a1\u518d\u6b21\u589e\u52a0\u4e00\u4e2a\u8bc4\u5206\u3002\u56e0\u6b64\u7b2c\u4e00\u4e2a\u4efb\u52a1\u8bc4\u5206\u540e\uff0c\u9700\u8981\u5c06\u9875\u9762\u6309\u94ae\uff08\u65b0\u589e\uff09\u9690\u85cf\u6389<\/p>\n
<\/p>\n
— \u529f\u80fd:
\n— 3000 \u529f\u80fd\u70b9 \u5217\u51fa\u4e0e\u67d0\u4e00\u4e2ataskid\u76f8\u5173\u7684\u6570\u636e
\n— \u82e5\u5217\u51fa\u6570\u636e\u5df2\u7ecf\u6709\uff0c\u5c06 \u65b0\u589e \u9875\u9762\u6309\u94ae\u5c4f\u853d \uff08\u8fd9\u4e2a\u529f\u80fd\u662f\u505a\u4efb\u52a1\u8bc4\u6d4b\u7ed3\u679c\u7684\uff0c\u7ed3\u679c\u53ea\u80fd\u6709\u4e00\u4e2a\uff0c\u4e0d\u53ef\u80fd\u591a\u4e2a\uff09
\n————————————————————————–
\njson = require (“json”)
\nmobox = require (“OILua_JavelinExt”)<\/p>\nfunction shownowtaskdata ( strLuaDEID )<\/p>\nlocal nRet, strRetInfo\r\nlocal nType\r\nlocal strTaskID\r\nlocal bHidden=false\r\nlocal strClsID=\"\"<\/pre>\n--\u62ff\u5230\u6570\u636e\u5bf9\u8c61\u6807\u8bc6\r\nnRet, strRetInfo = mobox.getCurEditExtInfo( strLuaDEID )\r\nif ( nRet ~= 0 ) then\r\n mobox.error( strLuaDEID, \"\u7cfb\u7edf\u83b7\u53d6\u6269\u5c55\u5c5e\u6027\u5931\u8d25 \"..strRetInfo )\r\n return\r\nend\r\nif ( strRetInfo =='' or strRetInfo==nil or strRetInfo=='{}' ) then\r\n mobox.error( strLuaDEID, \"\u7cfb\u7edf\u83b7\u53d6\u6269\u5c55\u5c5e\u6027\u4e3a\u7a7a\uff01\" )\r\n return\r\nend\r\nlocal extinfo = json.decode( strRetInfo )\r\nstrClsID=extinfo.cls_id -- \u5f97\u5230\u5f53\u524dcls\u7684id \uff0c\u4e0b\u9762\u64cd\u4f5c\u9700\u8981<\/pre>\n— \u83b7\u53d6\u4efb\u52a1\u5168\u5c40\u5c5e\u6027 \uff08\u8fd9\u4e2a\u6848\u4f8b\u662f\u4e0e Gungho\u4efb\u52a1\u7cfb\u7edf\u96c6\u6210\uff0c\u6240\u4ee5\u9700\u8981\u8fd9\u4e2a\u53c2\u6570\uff0c\u522b\u7684\u73af\u5883\u8fd9\u4e2a\u53ef\u4ee5\u5ffd\u7565
\nnRet, strRetInfo = mobox.getGlobalAttr( strLuaDEID, “task_id” )
\nif ( nRet ~= 0 or strRetInfo == ” ) then
\nmobox.error( strLuaDEID, “\u7cfb\u7edf\u65e0\u6cd5\u83b7\u53d6\u4efb\u52a1\u53f7 “..strRetInfo )
\nreturn
\nend
\nlocal input_paramter = json.decode( strRetInfo )
\nlocal strTaskID = input_paramter[1].value<\/p>\nlocal strCondition\r\nstrCondition = \"G_TASK_ID='\"..strTaskID..\"'\"\r\n\r\n--\u589e\u52a0\u9690\u85cf\u6309\u94ae\u7684\u4f9d\u636e-\u901a\u8fc7\u6761\u4ef6\u67e5\u8be2\u8fd4\u56de\u7b26\u5408\u6570\u636e>0 \u65e2\u9690\u85cf\r\n-- local strQeuryCondition=\"S_TESTITEM='X'\" \uff08\u5b9a\u4e49grid\u67d0\u4e00\u4e2a\u5b57\u6bb5\u5185\u6709\u67d0\u4e9b\u6570\u503c \u8fd9\u91cc\u6ca1\u6709\u542f\u7528\uff09\r\nnRet, strRetInfo = mobox.getDataObjCount(strLuaDEID, strClsID, strCondition)\r\nif (nRet ~= 0 ) then\r\n mobox.error(strLuaDEID, \"\u5f97\u5230\u6570\u636e\u6570\u91cf\u5931\u8d25\uff0c\u539f\u56e0\uff1a\" .. strRetInfo)\r\n return\r\nend\r\n\r\n--\u8f6c\u4e3a\u6574\u6570\u7c7b\u578b\r\nlocal nDataCount = tonumber(strRetInfo)\r\nif (nDataCount >0) then\r\n bHidden=true\r\nend\r\n\r\n--\u9690\u85cf\u9875\u9762\u6309\u94ae \u201c\u65b0\u589e\u201d\r\nlocal strHiddenButton = ''\r\nif (bHidden) then\r\n strHiddenButton =<\/span>\r\n ',{\"action_type\":\"hidden_button\",\"value\":[{\"name\":\"\u65b0\u589e\"}]}'<\/span>\r\nend\r\n\r\nlocal strAction = '[{\"action_type\":\"set_query_condition\",\"value\":{\"where\":\"' .. strCondition .. '\",\"order\":\"\"}}'\r\nstrAction = strAction .. strHiddenButton .. ']'\r\nmobox.setAction( strLuaDEID, strAction )<\/pre>\n
end<\/pre>\n<\/div>\n<\/blockquote>\n\u8fd9\u4e2a\u5217\u5b50\u4e5f\u53ef\u4ee5\u7528\u4e8e\u522b\u7684\u4e00\u4e9b\u975e\u6cd5\u5b57\u7b26\u4e32\u7684\u5904\u7406<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"
\u9700\u6c42\uff0c\u6211\u4eec\u6709\u4e00\u4e2a\u4efb\u52a1\u6267\u884c\u540e\uff0c\u9700\u8981\u5bf9\u8fd9\u4e2a\u4efb\u52a1\u505a\u540e\u505a\u8bc4\u4ef7\u3002\u4e3a\u6b64\u4e0e\u4efb\u52a1\u7cfb\u7edf\u96c6\u6210\u901a\u8fc73000\u529f\u80fd\u70b9\u5b9a\u4e49\u4e86\u4e00\u4e2a\u4efb\u52a1\u8bc4\u5206\u7684 […]<\/p>\n","protected":false},"author":1,"featured_media":2591,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,5],"tags":[14],"class_list":["post-2590","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-eckf","category-plmcenter","tag-jiaoben"],"_links":{"self":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2590","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=2590"}],"version-history":[{"count":1,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2590\/revisions"}],"predecessor-version":[{"id":2592,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2590\/revisions\/2592"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media\/2591"}],"wp:attachment":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media?parent=2590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/categories?post=2590"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/tags?post=2590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}