Browse Source

【看板客户端】【titlerender定义】

zhuth 8 years ago
parent
commit
5207d91bda
1 changed files with 55 additions and 0 deletions
  1. 55 0
      kanban-client/app/utils/RenderUtils.js

+ 55 - 0
kanban-client/app/utils/RenderUtils.js

@@ -28,6 +28,33 @@ function titleRender(state) {
     </table>
 }
 
+function titleRender2(state) {
+    let line = state.line;
+    let ban = state.ban;
+    return <table className="title-table" cellSpacing="0" cellPadding="0">
+            <thead>
+            <tr>
+                <td className="logo" width="320" rowSpan="2">
+                    <img src={logeImg} alt=""/>
+                </td>
+                <td className="title-center" width="550" rowSpan="2">产线执行综合看板</td>
+                <td className="title-field" width="210">
+                   线次
+                </td>
+                <td className="title-value" style={{color: 'red'}} width="210">
+                    {line}
+                </td>
+            </tr>
+            <tr>
+                <td className="title-field">
+                    班次
+                </td>
+                <td className="title-value" style={{color: 'red'}}>{ban}</td>
+            </tr>
+            </thead>
+    </table>
+}
+
 function formHeaderRender(state) {
     return <div style={{margin: 0, fontSize: '1.75rem', padding: '20px 0 40px 0'}}>{`班次102投入产出统计`}</div>;
 }
@@ -75,13 +102,41 @@ function xaixsFetch(th, state, params) {
     });
 }
 
+function tableRender(value, record, index) {
+    return {
+        children: value,
+        props: {
+            style: {color: '#0000cd'}
+        }
+    }
+}
+
+function rateRender(value, record, index) {
+    let nv = value.replace(/%/, "");
+    let style = {};
+    if(nv < 100) {
+        style = {color: 'red'};
+    }else {
+        style = {color: '#0000cd'};
+    }
+    return {
+        children: value,
+        props: {
+            style: style
+        }
+    }
+}
+
 let renders = {
     titleRender,
+    titleRender2,
     formHeaderRender,
     descRender,
     perRender,
     ztlbhFetch,
     xaixsFetch,
+    tableRender,
+    rateRender,
 }
 
 module.exports = renders;