{"id":1617,"date":"2023-09-01T16:12:11","date_gmt":"2023-09-01T08:12:11","guid":{"rendered":"http:\/\/www.plm.cn\/?p=1617"},"modified":"2023-09-01T16:20:49","modified_gmt":"2023-09-01T08:20:49","slug":"%e4%bd%8e%e4%bb%a3%e7%a0%81%e8%84%9a%e6%9c%ac-%e4%ba%ba%e5%91%98%e9%80%89%e6%8b%a9","status":"publish","type":"post","link":"http:\/\/www.plm.cn\/1617\/","title":{"rendered":"\u4f4e\u4ee3\u7801\u811a\u672c\u5f00\u53d1-\u4eba\u5458\u9009\u62e9"},"content":{"rendered":"

Lua\u811a\u672c\u3010\u4eba\u5458\u9009\u62e9\u524d<\/span>\u3011<\/h3>\n
\n

json = require (“json”)<\/p>\n

mobox = require (“OILua_JavelinExt”)<\/p>\n

function BeforeSelectUser ( strLuaDEID )<\/p>\n

local action = ‘[{“action_type”:”open_select_userdlg<\/span>“,”value”:{“multi_choice “:false,”style”:”user<\/span>“}}]’<\/p>\n

\u00a0— user \u7684\u610f\u601d \u53ea\u5217\u51fa\u7528\u6237\u9009\u62e9<\/p>\n

nRet, strRetInfo = mobox.setAction( strLuaDEID, action )<\/p>\n

if (nRet ~= 0) then error( strRetInfo ) end<\/p>\n

end<\/p><\/blockquote>\n<\/div>\n

\n

Lua\u811a\u672c\u3010\u4eba\u5458\u9009\u62e9\u540e<\/span>\u3011<\/h3>\n
\n
\n
json\u00a0 = require (“json”)<\/div>\n
mobox = require (“OILua_JavelinExt”)<\/div>\n
function AfterSelectUser ( strLuaDEID )<\/div>\n
\u00a0 \u00a0 local\u00a0 \u00a0nRet, strUserLogin, strUserName<\/div>\n
<\/div>\n
\u00a0 \u00a0 — \u83b7\u53d6\u5f53\u524d\u9009\u62e9\u6570\u636e<\/div>\n
\u00a0 \u00a0 nRet, strRetInfo = mobox.getInputParameter( strLuaDEID )<\/div>\n
\u00a0 \u00a0 if ( nRet ~= 0 or\u00a0 strRetInfo == ”) then<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 mobox.error( strLuaDEID, “\u65e0\u6cd5\u83b7\u53d6\u6570\u636e!”)<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 return<\/div>\n
\u00a0 \u00a0 end<\/div>\n
<\/div>\n
\u00a0 \u00a0 local retJson = json.decode( strRetInfo )<\/div>\n
\u00a0 \u00a0 local input_parameter = retJson[“parameter”]<\/div>\n
\u00a0 \u00a0 strUserLogin = input_parameter[1].id<\/div>\n
\u00a0 \u00a0 strUserName =\u00a0 input_parameter[1].name<\/div>\n
<\/div>\n
\u00a0 \u00a0 — \u8bbe\u7f6e\u6240\u9009\u4eba\u5458<\/div>\n
\u00a0 \u00a0 local setAttr = ‘[{“attr”:”S_MASTER”,”value”:”‘..strUserName..'”},{“attr”:”S_S_MASTER_Login”,”value”:”‘..strUserLogin..'”}]’<\/div>\n
<\/div>\n
\u00a0 \u00a0 mobox.setCurEditDataObjAttr( strLuaDEID,setAttr )<\/div>\n
<\/div>\n
end<\/div>\n<\/blockquote>\n<\/div>\n
<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

Lua\u811a\u672c\u3010\u4eba\u5458\u9009\u62e9\u524d\u3011 json = require (“json”) mobox […]<\/p>\n","protected":false},"author":1,"featured_media":1272,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,5,1],"tags":[31,14],"class_list":["post-1617","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-eckf","category-plmcenter","category-didaima","tag-didaima","tag-jiaoben"],"_links":{"self":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/1617","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=1617"}],"version-history":[{"count":3,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/1617\/revisions"}],"predecessor-version":[{"id":1620,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/1617\/revisions\/1620"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media\/1272"}],"wp:attachment":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media?parent=1617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/categories?post=1617"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/tags?post=1617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}