Chenshilong 8 years ago
parent
commit
3073cc67e3
1 changed files with 6 additions and 30 deletions
  1. 6 30
      web/rationRepository/js/coeList.js

+ 6 - 30
web/rationRepository/js/coeList.js

@@ -92,6 +92,9 @@ var coeList = {
         coeType.items(["单个","全部","人工类","材料类","机械类"]);
         me.detailSpread.getSheet(0).getRange(-1, 0, -1, 1).cellType(coeType);
 
+        var operType = new GC.Spread.Sheets.CellTypes.ComboBox();
+        operType.items(["+","-","*","/","="]);
+        me.detailSpread.getSheet(0).getRange(-1, 2, -1, 1).cellType(operType);
 
         // datas for test.
         //sheetObj.create($('#mainSpread')[0], me.colDefMain, createDatas(50));
@@ -107,11 +110,14 @@ var coeList = {
     },
 
     onDetailCellChanged:  function(sender, args) {
+        alert('onDetailCellChanged');
         var me = coeList;
         var row = args.sheet.getActiveRowIndex();
         var curType = args.sheet.getValue(row,0);
         if (!(curType == '单个')){
+            me.detailSpread.suspendEvent();
             args.sheet.setValue(row, 1, null);
+            me.detailSpread.resumeEvent();
             //args.sheet.getCell(row, 1).backColor("red");
         }
         else{
@@ -123,33 +129,3 @@ var coeList = {
 coeList.show();
 
 
-function createDatas(counts){
-    var datas = [];
-    var names = ['洞内排水量15m3/h以内', '二级以上松土', '三四级石方', '灌注桩,水平泵送混凝土距离100m', '用于拆除工程'];
-    for (var i = 0; i < counts; i++) {
-        var data = new Object();
-        data.ID = i;
-        data.name = names[i % names.length] + i;
-        data.content = '附注条件' + data.name + '之内容部分';
-        datas.push(data);
-    };
-    return datas;
-}
-function createContents(counts){
-    var datas = [];
-    var types = ['人工类', '材料类', '机械类','单GLJ','全部'];
-    var operators = ['+', '-', '*', '/', '='];
-    for (var i = 0; i < counts; i++) {
-        var data = new Object();
-        data.coeType = types[i % types.length];
-        data.gljID = (data.coeType == '单GLJ') ? Math.floor(Math.random() * 1000) : '';
-        data.operator = operators[i % operators.length];
-        data.amount = Math.floor(Math.random() * 1000) / 100;
-        data.amount2 = Math.floor(Math.random() * 1000) / 100;
-        data.amount3 = Math.floor(Math.random() * 1000) / 100;
-        data.amount4 = Math.floor(Math.random() * 1000) / 100;
-        datas.push(data);
-    };
-    return datas;
-}
-