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
66
67
68
69
70
71
72
73
74
75
ÿþ--[[
   x: JX-65-12
    Tðy: 
   \O€ÿ
   åegÿ2025-04-11
 
   ýQpeÿ BeforeGridShow
   ŸRý€:
 
   ôf9e°‹U_:
 
--]]
json  = require("json")
mobox = require("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function BeforeGridShow(strLuaDEID)
    local nRet, strRetInfo
    local data_objs
    local nCount
 
    -- ·ƒÖSQ<hpenc
    nRet, data_objs = m3.GetSysDataJson(strLuaDEID)
    if nRet ~= 0 then
        lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSQ<hpenc1Y%: " .. tostring(data_objs))
        return
    end
 
    nCount = #data_objs
    if nCount == 0 then return end
 
    local row_data_set = {}
 
    for i = 1, nCount do
        local row_item = {
            id = data_objs[i].id,
            attrs = {}
        }
 
        -- YtÏk*N^\'`
        for j = 1, #data_objs[i].attrs do
            local attr = {
                attr = data_objs[i].attrs[j].attr,
                value = data_objs[i].attrs[j].value
            }
 
            -- yrŠkYtS_ACTIONW[µk
            if attr.attr == "S_ACTION" then
                if attr.value == "+" then
                    attr.value = "eQ“^"
                elseif attr.value == "-" then
                    attr.value = "úQ“^"
                end
            end
 
            table.insert(row_item.attrs, attr)
        end
 
        table.insert(row_data_set, row_item)
    end
 
    -- ôf°eLub—penc
    local action = {
        {
            action_type = "reset_data_attr",
            value = row_data_set
        }
    }
 
    nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
    if nRet ~= 0 then
        lua.Error(strLuaDEID, debug.getinfo(1), "ôf°epenc1Y%: " .. tostring(strRetInfo))
    end
end