@@ -112,6 +112,9 @@ var TREE_SHEET_HELPER = {
} else {
cell.value(getFieldText2());
}
+ if (colSetting.data.cellType) {
+ cell.cellType(colSetting.data.cellType);
+ }
if (colSetting.readOnly) {
if (Object.prototype.toString.apply(colSetting.readOnly) === "[object Function]") {
cell.locked(colSetting.readOnly(node));
@@ -102,8 +102,8 @@ var BillsGridSetting ={
},
{
- "width":40,
- "readOnly":false,
+ "width":60,
+ "readOnly":'readOnly.ration',
"head":{
"titleNames":[
"计量\n单位"
@@ -131,7 +131,8 @@ var BillsGridSetting ={
"field":"unit",
"vAlign":1,
"hAlign":1,
- "font":"Arial"
+ "font":"Arial",
+ "cellType": 'cellType.unit'
@@ -43,6 +43,14 @@ let MainTreeCol = {
return MainTreeCol.readOnly.billsParent && MainTreeCol.readOnly.non_bills;
+ cellType: {
+ unit: function () {
+ let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
+ combo.itemHeight(10).items(['m', 'm2', 'm3', 'km', 't', 'kg', '台班', '工日', '昼夜', '元', '项', '处', '个', '件',
+ '根', '组', '系统', '台', '套', '株', '丛', '缸', '支', '只', '块', '座', '对', '份', '樘', '攒', '榀']);
+ return combo;
+ },
getEvent: function (eventName) {
let names = eventName.split('.');
let event = this;
@@ -94,6 +94,10 @@ var projectObj = {
if (col.readOnly && Object.prototype.toString.apply(col.readOnly) === "[object String]") {
col.readOnly = MainTreeCol.getEvent(col.readOnly);
+ if (col.data.cellType && Object.prototype.toString.apply(col.data.cellType) === "[object String]") {
+ let getCellType = MainTreeCol.getEvent(col.data.cellType);
+ col.data.cellType = getCellType();
if (col.data.digit && Object.prototype.toString.apply(col.data.digit) === "[object String]") {
col.data.decimal = that.project.getDecimal(col.data.digit);
col.data.formatter = MainTreeCol.getNumberFormatter(col.data.decimal);