1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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
--[[
   编码: JX-800-06
   名称: 总数
   作者:SGX
    日期:2025-1-29
 
   函数: GenerateViewHTML
   功能:
   
   更改记录:
 
--]] 
json = require("json")
mobox = require("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function GenerateViewHTML(strLuaDEID)
    local nRet, strRetInfo
    --[[ 方块1 ]]
    local strFKTitle1 = "年度入库总量";
    local strFKData1 = "30000";
    local strFKBack1 = "#8BC34A";
    --[[ 方块2 ]]
    local strFKTitle2 = "年度出库总量";
    local strFKData2 = "25000";
    local strFKBack2 = "#FF9800";
 
    local strHtml = '<div class="table2" style="display: flex;    margin: 82px 82px;">' ..
                        '<div style="width: 190px;height: 110px;background: ' .. strFKBack1 ..
                        ';border-radius: 7px;padding: 10px;">' .. '<div style="color: #fff;font-size: 15px;">' ..
                        strFKTitle1 .. '</div>' ..
                        '<div style="font-size: 40px;margin: 2px 0px 0px 0px;text-align: center;color: #fff;">' ..
                        strFKData1 .. '</div>' .. '</div>' .. '<div style="margin-left: 59px;width: 190px;height: 110px;background: ' ..
                        strFKBack2 .. ';border-radius: 7px;padding: 10px;">' ..
                        '<div style=" color: #fff;font-size: 15px;">' .. strFKTitle2 .. '</div>' ..
                        '<div style="font-size: 40px;margin: 2px 0px 0px 0px;text-align: center;color: #fff;">' ..
                        strFKData2 .. '</div>' .. '</div>' .. '</div>'
    local action = {}
    action[1] = {
        action_type = "chart",
        value = {
            graphicType = "html",
            title = {
                text = "总数",
                align = "center",
                color = "#000",
                font = "微软雅黑",
                fontSize = 16
            },
            html = strHtml
        }
    }
 
    nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo .. ' action = ' .. strAction)
    end
end