lzh
2025-06-24 13c4a636539584ab977fddacfae884b3ec250aee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
ÿþ--[[
   x: 
    Tðy: 
   \O€ÿ
   åegÿ2024-11-13
 
   ýQpeÿ Initial
   ŸRý€:
 
   ôf9e°‹U_:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
 
function Initial( strLuaDEID )
    local nRet, strRetInfo
    nRet, strRetInfo = mobox.getCurEditDataObjAttr(strLuaDEID,"S_CODE","S_TYPE","S_ITEM_TYPE","N_LEVEL")
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖS‘áOo`1Y% " .. strRetInfo) end
    local obj_attrs = json.decode(strRetInfo)
    local code = obj_attrs[1].value
    if(code == nil or code == '')then code = "" end
    local types = obj_attrs[2].value
    if(types == nil or types == '')then types = "" end
    local item_type = obj_attrs[3].value
    if(item_type == nil or item_type == '')then item_type = "" end
    local level = tonumber(obj_attrs[4].value)
    if(level == nil)then level = 0 end
    
    local choic_items = ''
    local strCondition = "S_CODE = S_CODE"
    nRet, strRetInfo = mobox.queryDataObjAttr(strLuaDEID, "GT_Dock_Doors", strCondition, "S_CODE","S_CODE" )
    if (nRet ~= 0) then error( "·ƒÖS0xS'è•0áOo`1Y%! " .. strRetInfo) end
    if ( strRetInfo ~= '' ) then
        local dock_doors = {}
        local n, nCount
        local success
        local attrs
        success, dock_doors = pcall( json.decode, strRetInfo)
        if ( success == false ) then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖS0xS'è•0áOo`1Y%! ^—Õl„vJSON<h_!"..dock_doors ) end
 
        nCount = #dock_doors
        -- Ä~Ç~ NÉbRhˆ    y˜
            
        for n = 1, nCount do
            attrs = dock_doors[n].attrs
            choic_items = choic_items..'"'..attrs[1].value..'",'
        end
        choic_items = lua.trim_laster_char( choic_items )
    end
 
    local list1 = '"ceňö€","³xў","^P[^",")Y6qö€","‰|™e","¢”N","…Pg"'
    local list2 = '"yrš[","(u"'
    local list3 = '0,1,2'
    local setAttr = '[{"attr":"S_CODE","value":"'..code..'","choice_list":['..choic_items..']}'
    setAttr = setAttr..',{"attr":"S_TYPE","value":"'..types..'","choice_list":['..list2..']}'
    setAttr = setAttr..',{"attr":"S_ITEM_TYPE","value":"'..item_type..'","choice_list":['..list1..']}'
    setAttr = setAttr..',{"attr":"N_LEVEL","value":"'..level..'","choice_list":['..list3..']}]'
    local strAction = '[{"action_type":"set_dlg_attr","value":'..setAttr..'}]'
    nRet, strRetInfo = mobox.setAction( strLuaDEID, strAction  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction1Y%! "..strRetInfo..' action = '..strAction ) end 
 
end