|  |  | 
 |  |  |     }} | 
 |  |  |     <span class="layui-badge febs-bg-{{openType.color}}">{{ openType.title }}</span> | 
 |  |  | </script> | 
 |  |  | <script type="text/html" id="loseOrProfit"> | 
 |  |  |     {{# if(d.loseOrProfit >= 0){ }} | 
 |  |  |     <span style="color: green">{{ d.loseOrProfit }}</span> | 
 |  |  |     {{# } else { }} | 
 |  |  |     <span style="color: red">{{ d.loseOrProfit }}</span> | 
 |  |  |     {{# } }} | 
 |  |  | </script> | 
 |  |  | <script type="text/html" id="returnRatio"> | 
 |  |  |     {{# if(d.returnRatio >= 0){ }} | 
 |  |  |     <span style="color: green">{{ d.returnRatio }}</span> | 
 |  |  |     {{# } else { }} | 
 |  |  |     <span style="color: red">{{ d.returnRatio }}</span> | 
 |  |  |     {{# } }} | 
 |  |  | </script> | 
 |  |  | <!-- 表格字段状态格式化 start --> | 
 |  |  |  | 
 |  |  | <script data-th-inline="none" type="text/javascript"> | 
 |  |  |     // 引入组件并初始化 | 
 |  |  |     layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { | 
 |  |  |     layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect', 'enhance'], function () { | 
 |  |  |         var $ = layui.jquery, | 
 |  |  |             laydate = layui.laydate, | 
 |  |  |             febs = layui.febs, | 
 |  |  | 
 |  |  |                     {field: 'forceClosingPrice', title: '预估强平价', minWidth: 130, align: 'center'}, | 
 |  |  |                     {field: 'bondAmount', title: '保证金', minWidth: 130, align: 'center'}, | 
 |  |  |                     {field: 'createTime', title: '开仓时间', minWidth: 160, align: 'center'}, | 
 |  |  |                     {field: 'loseOrProfit', title: '盈亏', minWidth: 140, align: 'center', fixed : "right"}, | 
 |  |  |                     {field: 'returnRatio', title: '回报率', minWidth: 140, align: 'center', fixed : "right"}, | 
 |  |  |                     {field: 'loseOrProfit',templet: '#loseOrProfit', title: '盈亏', minWidth: 140, align: 'center', fixed: 'right'}, | 
 |  |  |                     {field: 'returnRatio',templet: '#returnRatio', title: '回报率', minWidth: 140, align: 'center', fixed: 'right'}, | 
 |  |  |                 ]] | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  | 
 |  |  |                 invalidate_ie_cache: new Date() | 
 |  |  |             }; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         setTimeout(function() { | 
 |  |  |             var flag = true; | 
 |  |  |             while(flag) { | 
 |  |  |                 if (table.cache['userTable']) { | 
 |  |  |                     setInterval(function () { | 
 |  |  |                         $.ajax({ | 
 |  |  |                             url : ctx + 'order/getHoldList', | 
 |  |  |                             type : 'get', | 
 |  |  |                             data : getQueryParams(), | 
 |  |  |                             async : false, | 
 |  |  |                             success : function(data) { | 
 |  |  |                                 if (data.data.rows.length > 0) { | 
 |  |  |                                     for(var i = 0, length = data.data.rows.length; i < length; i++) { | 
 |  |  |                                         table.renderSpecRow('userTable', i, data.data.rows[i]); | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                         }); | 
 |  |  |                     }, 2000) | 
 |  |  |  | 
 |  |  |                     flag = false; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         }, 2000) | 
 |  |  |  | 
 |  |  |     }) | 
 |  |  | </script> |