--[[
|
编码: JX-800-03
|
名称: 出库任务列表
|
作者:HAN
|
日期:2025-1-29
|
级别: 固定 (说明本段代码在项目中不太会变化)
|
|
函数: GenerateViewHTML
|
|
功能:
|
统计作业各种状态的数量(测试一下用)
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require("oi_base_mobox")
|
|
function GetHtmlStyle()
|
return '<style>' .. '.table3 {' .. ' border: 2px solid #fff;' .. ' width: 100%;' .. ' height: 100%;' ..
|
'}' .. '.table-head {' .. ' border-bottom: 2px solid #fff; color: #fff;' .. '}' .. '.table-head>div {' ..
|
' text-align: center;' .. ' display: inline-block;' .. ' padding: 5px 0px;' ..
|
' font-size: 17px;' .. ' font-weight: 600;' .. '}' .. '.table-head .table-col1 {' ..
|
' width: 34%;' .. ' border-right: 2px solid;' .. '}' .. '.table-head .table-col2 {' ..
|
' width: 32%;' .. ' border-right: 2px solid;' .. '}' .. '.table-head .table-col3 {' ..
|
' width: 31%;' .. '}' .. '.table-body .table-row-data{ margin-top: 10px;} .table-body .table-row-data>div {' .. ' text-align: center;' ..
|
' display: inline-block;' .. ' padding: 5px 0px;' .. ' color: #fff;' .. '}' ..
|
|
'.table-row-data .table-col1 {' .. ' width: 34%;' .. '}' .. '.table-row-data .table-col1>div {' ..
|
' border-radius: 50px;' .. ' width: 92%;' .. ' display: inline-block;' .. ' padding: 5px 1px;' ..
|
' font-size: 12px;' .. '}' .. '.table-row-data .table-col2 {' .. ' width: 32%;' .. '}' ..
|
|
'.table-row-data .table-col3 {' .. ' width: 31%;' .. '}' .. '</style>'
|
end
|
|
|
function GenerateViewHTML(strLuaDEID)
|
local nRet, strRetInfo
|
local strHtmlTitle = "";
|
local strHtmlRow = "";
|
--[[ 获取样式 ]]
|
local strHtmlStyle = GetHtmlStyle();
|
--[[ 列明 ]]
|
local tabTitleList = {"作业编码", "起点", "终点"}
|
|
--[[ 组织列名 ]]
|
--[[ class 处理样式 这里 组成(table-col' .. i .. ') table-col1,table-col2,table-col3 ]]
|
for i = 1, #tabTitleList do
|
strHtmlTitle = strHtmlTitle .. '<div class="table-col' .. i .. '">' .. tabTitleList[i] .. '</div>'
|
end
|
--[[ 数据 ]]
|
local tabDataList = {
|
{
|
code = "OP2402-0120",
|
qd = "K2-122-131",
|
zd = "K2-122-135",
|
back = "#2196F3"
|
},
|
{
|
code = "OP2402-0112",
|
qd = "K2-122-132",
|
zd = "K2-122-136",
|
back = "#ff5722"
|
},
|
{
|
code = "OP2402-0020",
|
qd = "K2-122-133",
|
zd = "K2-122-137",
|
back = "#ffc107"
|
},
|
{
|
code = "OP2402-0110",
|
qd = "K2-122-134",
|
zd = "K2-122-135",
|
back = "#2196F3"
|
}
|
}
|
|
--[[ 组织行数据html ]]
|
for i = 1, #tabDataList do
|
strHtmlRow = strHtmlRow .. '<div class="table-row-data">' .. '<div class="table-col1">' ..
|
'<div style=" background: ' .. tabDataList[i].back .. ';">' .. tabDataList[i].code .. '</div>' ..
|
'</div>' .. '<div class="table-col2">' .. tabDataList[i].qd .. '</div>' ..
|
'<div class="table-col3">' .. tabDataList[i].zd .. '</div>' .. '</div>'
|
end
|
|
--[[ 总html ]]
|
local strHtml = ' <div class="table3">' .. '<div class="table-head">' .. strHtmlTitle .. '</div>' ..
|
'<div class="table-body">' .. strHtmlRow .. '</div>' .. '</div>'
|
|
local action = {}
|
action[1] = {
|
action_type = "chart",
|
value = {
|
graphicType = "html",
|
title = {
|
text = "当前出库任务",
|
align = "left",
|
color = "#fff",
|
font = "微软雅黑",
|
fontSize = 18
|
},
|
html = strHtmlStyle .. strHtml
|
}
|
}
|
|
-- lua.Debug( strLuaDEID, debug.getinfo(1), "action! ", action )
|
|
nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
|
if (nRet ~= 0) then
|
lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo .. ' action = ' .. strAction)
|
end
|
end
|