local m_lvEqpt = CLuaListViewUtil();
m_lvEqpt:setWnd(ui:getDialogName(),'id_eqpt_list');
local helpEqptState = CSelectHelp();
local cStr = CTNString();
local sql = [[
select a.eqpt_id,b.eqpt_name,a.eqpt_cur_state,a.update_time from dc_real_eqpt_state a
left join bs_eqpt b on a.eqpt_id = b.eqpt_id
where a.eqpt_cur_state <> 0 and b.eqpt_name <> ''
]];
db:commandStr('plugin.dc_server.select_sqlite',sql, cStr);
helpEqptState:reset();
helpEqptState:fromString(cStr:get());
m_lvEqpt:setHelp(helpEqptState);
for i=0,helpEqptState:size()-1 do
local itTmp = CIntent();
local eqpt_id = helpEqptState:valueStringByCol(i, 0);
local State = helpEqptState:vs(i,'eqpt_cur_state');
if State == '0' then
itTmp:set('color', '12303291');
elseif State == '1' then
itTmp:set('color', '4042303');
elseif State == '2' then
itTmp:set('color', '5296617');
elseif State == '3' then
itTmp:set('color', '12224767');
elseif State == '4' then
itTmp:set('color', '16719932');
elseif State == '7' then
itTmp:set('color', '12719932');
elseif State == '8' then
itTmp:set('color', '16416882');
else
itTmp:set('color', '5165031');
end
m_lvEqpt:setProp(i,'eqpt_name','f_text_c',itTmp:get('color'));
end