From 265102e3b6c9865f0e9f1e035e7b1aba281dc8c1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 03 十二月 2019 15:33:16 +0800
Subject: [PATCH] 2019-12-03

---
 src/tabviews/commontable/index.jsx |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index f20d6af..d092828 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -102,11 +102,27 @@
         }
       })
 
+      let _actions = config.action.filter(item => item.position === 'toolbar')
+      let _operation = config.action.filter(item => item.position === 'grid')
+
+      if (_operation.length > 0) {
+        _columns.push({
+          Align: 'center',
+          uuid: Utils.getuuid(),
+          IsSort: 'false',
+          Width: 120,
+          type: 'operation',
+          style: 'button',
+          label: this.state.dict['main.column.operation'],
+          operations: _operation
+        })
+      }
+
       this.setState({
         config: config,
         setting: config.setting,
         searchlist: config.search,
-        actions: config.action,
+        actions: _actions,
         columns: _columns,
         arr_field: _arrField.join(','),
         search: _search ? 'where (' + _search + ')' : '',
@@ -210,8 +226,7 @@
 
     let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderColumn} ${orderType}) as rows from ${setting.dataresource} ${search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
     let DateCount = `select count(1) as total from ${setting.dataresource} ${search}`
-    console.log(LText)
-    console.log(DateCount)
+
     param.LText = Utils.formatOptions(LText)
     param.DateCount = Utils.formatOptions(DateCount)
     let result = await Api.genericInterface(param)
@@ -226,6 +241,16 @@
       })
     } else {
       this.setState({
+        data: [1,2,3,4,5,6,7,8,9,10].map((item, index) => {
+          let cell = {}
+          this.state.config.columns.forEach(column => {
+            if (!column.field) return
+            cell[column.field] = 'test' + item
+          })
+          cell.key = index
+          return cell
+        }),
+        total: 329,
         loading: false
       })
       notification.error({

--
Gitblit v1.8.0